From c8238579fb0b1c3affbd77749ae2b2c4dfafb2d6 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Thu, 11 Mar 2021 08:16:13 +0100 Subject: [PATCH] lib: Drop internal virXXXPtr typedefs Historically, we declared pointer type to our types: typedef struct _virXXX virXXX; typedef virXXX *virXXXPtr; But usefulness of such declaration is questionable, at best. Unfortunately, we can't drop every such declaration - we have to carry some over, because they are part of public API (e.g. virDomainPtr). But for internal types - we can do drop them and use what every other C project uses 'virXXX *'. This change was generated by a very ugly shell script that generated sed script which was then called over each file in the repository. For the shell script refer to the cover letter: https://listman.redhat.com/archives/libvir-list/2021-March/msg00537.html Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- docs/advanced-tests.rst | 2 +- docs/api_extension.rst | 2 +- docs/coding-style.rst | 2 +- docs/internals/command.html.in | 12 +- docs/internals/rpc.html.in | 32 +- scripts/esx_vi_generator.py | 6 +- scripts/hyperv_wmi_generator.py | 6 +- src/access/viraccessdriver.h | 52 +- src/access/viraccessdrivernop.c | 46 +- src/access/viraccessdriverpolkit.c | 52 +- src/access/viraccessdriverstack.c | 82 +- src/access/viraccessdriverstack.h | 4 +- src/access/viraccessmanager.c | 78 +- src/access/viraccessmanager.h | 57 +- src/admin/admin_remote.c | 56 +- src/admin/admin_server.c | 34 +- src/admin/admin_server.h | 26 +- src/admin/admin_server_dispatch.c | 131 +- src/admin/admin_server_dispatch.h | 8 +- src/admin/libvirt-admin.c | 8 +- src/bhyve/bhyve_capabilities.c | 26 +- src/bhyve/bhyve_capabilities.h | 16 +- src/bhyve/bhyve_command.c | 124 +- src/bhyve/bhyve_command.h | 16 +- src/bhyve/bhyve_conf.c | 18 +- src/bhyve/bhyve_conf.h | 9 +- src/bhyve/bhyve_device.c | 30 +- src/bhyve/bhyve_device.h | 8 +- src/bhyve/bhyve_domain.c | 36 +- src/bhyve/bhyve_domain.h | 7 +- src/bhyve/bhyve_driver.c | 162 +- src/bhyve/bhyve_driver.h | 6 +- src/bhyve/bhyve_firmware.c | 4 +- src/bhyve/bhyve_firmware.h | 4 +- src/bhyve/bhyve_monitor.c | 34 +- src/bhyve/bhyve_monitor.h | 7 +- src/bhyve/bhyve_parse_command.c | 40 +- src/bhyve/bhyve_parse_command.h | 6 +- src/bhyve/bhyve_process.c | 56 +- src/bhyve/bhyve_process.h | 22 +- src/bhyve/bhyve_utils.h | 25 +- src/conf/backup_conf.c | 54 +- src/conf/backup_conf.h | 24 +- src/conf/capabilities.c | 241 +- src/conf/capabilities.h | 116 +- src/conf/checkpoint_conf.c | 80 +- src/conf/checkpoint_conf.h | 23 +- src/conf/cpu_conf.c | 76 +- src/conf/cpu_conf.h | 69 +- src/conf/device_conf.c | 36 +- src/conf/device_conf.h | 42 +- src/conf/domain_addr.c | 316 +- src/conf/domain_addr.h | 131 +- src/conf/domain_audit.c | 98 +- src/conf/domain_audit.h | 76 +- src/conf/domain_capabilities.c | 70 +- src/conf/domain_capabilities.h | 39 +- src/conf/domain_conf.c | 2605 ++++++++--------- src/conf/domain_conf.h | 1022 ++++--- src/conf/domain_event.c | 556 ++-- src/conf/domain_event.h | 178 +- src/conf/domain_nwfilter.c | 18 +- src/conf/domain_nwfilter.h | 6 +- src/conf/domain_validate.c | 64 +- src/conf/domain_validate.h | 10 +- src/conf/interface_conf.c | 76 +- src/conf/interface_conf.h | 18 +- src/conf/moment_conf.c | 8 +- src/conf/moment_conf.h | 8 +- src/conf/netdev_bandwidth_conf.c | 12 +- src/conf/netdev_bandwidth_conf.h | 6 +- src/conf/netdev_vlan_conf.c | 4 +- src/conf/netdev_vlan_conf.h | 4 +- src/conf/netdev_vport_profile_conf.c | 6 +- src/conf/netdev_vport_profile_conf.h | 4 +- src/conf/network_conf.c | 198 +- src/conf/network_conf.h | 105 +- src/conf/network_event.c | 26 +- src/conf/network_event.h | 6 +- src/conf/networkcommon_conf.c | 6 +- src/conf/networkcommon_conf.h | 6 +- src/conf/node_device_conf.c | 214 +- src/conf/node_device_conf.h | 70 +- src/conf/node_device_event.c | 37 +- src/conf/node_device_event.h | 8 +- src/conf/node_device_util.c | 4 +- src/conf/node_device_util.h | 4 +- src/conf/numa_conf.c | 162 +- src/conf/numa_conf.h | 93 +- src/conf/nwfilter_conf.c | 142 +- src/conf/nwfilter_conf.h | 52 +- src/conf/nwfilter_ipaddrmap.c | 10 +- src/conf/nwfilter_ipaddrmap.h | 2 +- src/conf/nwfilter_params.c | 78 +- src/conf/nwfilter_params.h | 42 +- src/conf/object_event.c | 134 +- src/conf/object_event.h | 18 +- src/conf/object_event_private.h | 18 +- src/conf/secret_conf.c | 16 +- src/conf/secret_conf.h | 7 +- src/conf/secret_event.c | 37 +- src/conf/secret_event.h | 8 +- src/conf/snapshot_conf.c | 98 +- src/conf/snapshot_conf.h | 49 +- src/conf/snapshot_conf_priv.h | 4 +- src/conf/storage_adapter_conf.c | 30 +- src/conf/storage_adapter_conf.h | 13 +- src/conf/storage_capabilities.c | 14 +- src/conf/storage_capabilities.h | 7 +- src/conf/storage_conf.c | 143 +- src/conf/storage_conf.h | 82 +- src/conf/storage_encryption_conf.c | 44 +- src/conf/storage_encryption_conf.h | 15 +- src/conf/storage_event.c | 37 +- src/conf/storage_event.h | 8 +- src/conf/storage_source_conf.c | 152 +- src/conf/storage_source_conf.h | 125 +- src/conf/virchrdev.c | 19 +- src/conf/virchrdev.h | 7 +- src/conf/virconftypes.h | 114 - src/conf/virdomaincheckpointobjlist.c | 58 +- src/conf/virdomaincheckpointobjlist.h | 54 +- src/conf/virdomainmomentobjlist.c | 110 +- src/conf/virdomainmomentobjlist.h | 66 +- src/conf/virdomainobjlist.c | 147 +- src/conf/virdomainobjlist.h | 57 +- src/conf/virdomainsnapshotobjlist.c | 62 +- src/conf/virdomainsnapshotobjlist.h | 54 +- src/conf/virinterfaceobj.c | 83 +- src/conf/virinterfaceobj.h | 44 +- src/conf/virnetworkobj.c | 272 +- src/conf/virnetworkobj.h | 156 +- src/conf/virnetworkportdef.c | 18 +- src/conf/virnetworkportdef.h | 15 +- src/conf/virnodedeviceobj.c | 157 +- src/conf/virnodedeviceobj.h | 57 +- src/conf/virnwfilterbindingdef.c | 26 +- src/conf/virnwfilterbindingdef.h | 16 +- src/conf/virnwfilterbindingobj.c | 40 +- src/conf/virnwfilterbindingobj.h | 23 +- src/conf/virnwfilterbindingobjlist.c | 88 +- src/conf/virnwfilterbindingobjlist.h | 27 +- src/conf/virnwfilterobj.c | 112 +- src/conf/virnwfilterobj.h | 59 +- src/conf/virsavecookie.c | 22 +- src/conf/virsavecookie.h | 25 +- src/conf/virsecretobj.c | 139 +- src/conf/virsecretobj.h | 60 +- src/conf/virstorageobj.c | 340 ++- src/conf/virstorageobj.h | 150 +- src/cpu/cpu.c | 74 +- src/cpu/cpu.h | 127 +- src/cpu/cpu_arm.c | 94 +- src/cpu/cpu_ppc64.c | 63 +- src/cpu/cpu_s390.c | 8 +- src/cpu/cpu_x86.c | 426 ++- src/cpu/cpu_x86.h | 8 +- src/cpu/cpu_x86_data.h | 3 - src/datatypes.c | 58 +- src/datatypes.h | 74 +- src/driver-hypervisor.h | 3 +- src/driver-interface.h | 1 - src/driver-network.h | 1 - src/driver-nodedev.h | 1 - src/driver-nwfilter.h | 1 - src/driver-secret.h | 1 - src/driver-state.h | 2 - src/driver-storage.h | 1 - src/driver-stream.h | 2 - src/driver.c | 2 +- src/driver.h | 32 +- src/esx/esx_driver.c | 22 +- src/esx/esx_interface_driver.c | 4 +- src/esx/esx_network_driver.c | 8 +- src/esx/esx_private.h | 4 +- src/esx/esx_storage_driver.c | 28 +- src/esx/esx_util.c | 4 +- src/esx/esx_util.h | 2 +- src/esx/esx_vi.c | 6 +- src/esx/esx_vi.h | 8 +- src/esx/esx_vi_types.c | 12 +- src/esx/esx_vi_types.h | 26 +- src/hyperv/hyperv_driver.c | 74 +- src/hyperv/hyperv_private.h | 4 +- src/hyperv/hyperv_util.c | 4 +- src/hyperv/hyperv_util.h | 2 +- src/hyperv/hyperv_wmi.c | 66 +- src/hyperv/hyperv_wmi.h | 49 +- src/hyperv/hyperv_wmi_classes.h | 4 +- src/hypervisor/domain_cgroup.c | 20 +- src/hypervisor/domain_cgroup.h | 16 +- src/hypervisor/domain_driver.c | 30 +- src/hypervisor/domain_driver.h | 18 +- src/hypervisor/virclosecallbacks.c | 55 +- src/hypervisor/virclosecallbacks.h | 25 +- src/hypervisor/virhostdev.c | 328 +-- src/hypervisor/virhostdev.h | 121 +- src/interface/interface_backend_netcf.c | 26 +- src/interface/interface_backend_udev.c | 14 +- src/libvirt.c | 38 +- src/libxl/libxl_capabilities.c | 64 +- src/libxl/libxl_capabilities.h | 6 +- src/libxl/libxl_conf.c | 142 +- src/libxl/libxl_conf.h | 75 +- src/libxl/libxl_domain.c | 196 +- src/libxl/libxl_domain.h | 57 +- src/libxl/libxl_driver.c | 730 +++-- src/libxl/libxl_logger.c | 8 +- src/libxl/libxl_logger.h | 9 +- src/libxl/libxl_migration.c | 145 +- src/libxl/libxl_migration.h | 24 +- src/libxl/xen_common.c | 188 +- src/libxl/xen_common.h | 30 +- src/libxl/xen_xl.c | 186 +- src/libxl/xen_xl.h | 8 +- src/libxl/xen_xm.c | 44 +- src/libxl/xen_xm.h | 6 +- src/locking/domain_lock.c | 72 +- src/locking/domain_lock.h | 40 +- src/locking/lock_daemon.c | 106 +- src/locking/lock_daemon.h | 10 +- src/locking/lock_daemon_config.c | 12 +- src/locking/lock_daemon_config.h | 8 +- src/locking/lock_daemon_dispatch.c | 92 +- src/locking/lock_driver.h | 21 +- src/locking/lock_driver_lockd.c | 73 +- src/locking/lock_driver_nop.c | 16 +- src/locking/lock_driver_sanlock.c | 62 +- src/locking/lock_manager.c | 42 +- src/locking/lock_manager.h | 29 +- src/logging/log_daemon.c | 88 +- src/logging/log_daemon.h | 7 +- src/logging/log_daemon_config.c | 12 +- src/logging/log_daemon_config.h | 8 +- src/logging/log_daemon_dispatch.c | 32 +- src/logging/log_handler.c | 72 +- src/logging/log_handler.h | 17 +- src/logging/log_manager.c | 24 +- src/logging/log_manager.h | 13 +- src/lxc/lxc_cgroup.c | 74 +- src/lxc/lxc_cgroup.h | 16 +- src/lxc/lxc_conf.c | 34 +- src/lxc/lxc_conf.h | 37 +- src/lxc/lxc_container.c | 92 +- src/lxc/lxc_container.h | 6 +- src/lxc/lxc_controller.c | 226 +- src/lxc/lxc_domain.c | 56 +- src/lxc/lxc_domain.h | 18 +- src/lxc/lxc_driver.c | 594 ++-- src/lxc/lxc_fuse.c | 32 +- src/lxc/lxc_fuse.h | 10 +- src/lxc/lxc_hostdev.c | 30 +- src/lxc/lxc_hostdev.h | 20 +- src/lxc/lxc_monitor.c | 50 +- src/lxc/lxc_monitor.h | 28 +- src/lxc/lxc_native.c | 114 +- src/lxc/lxc_native.h | 6 +- src/lxc/lxc_process.c | 162 +- src/lxc/lxc_process.h | 38 +- src/network/bridge_driver.c | 573 ++-- src/network/bridge_driver.h | 6 +- src/network/bridge_driver_linux.c | 100 +- src/network/bridge_driver_nop.c | 8 +- src/network/bridge_driver_platform.h | 17 +- src/node_device/node_device_driver.c | 84 +- src/node_device/node_device_driver.h | 12 +- src/node_device/node_device_udev.c | 152 +- src/nwfilter/nwfilter_dhcpsnoop.c | 186 +- src/nwfilter/nwfilter_dhcpsnoop.h | 6 +- src/nwfilter/nwfilter_driver.c | 48 +- src/nwfilter/nwfilter_ebiptables_driver.c | 207 +- src/nwfilter/nwfilter_gentech_driver.c | 129 +- src/nwfilter/nwfilter_gentech_driver.h | 18 +- src/nwfilter/nwfilter_learnipaddr.c | 40 +- src/nwfilter/nwfilter_learnipaddr.h | 6 +- src/nwfilter/nwfilter_tech_driver.h | 8 +- src/openvz/openvz_conf.c | 30 +- src/openvz/openvz_conf.h | 12 +- src/openvz/openvz_driver.c | 142 +- src/openvz/openvz_util.c | 2 +- src/qemu/THREADS.txt | 72 +- src/qemu/qemu_agent.c | 280 +- src/qemu/qemu_agent.h | 90 +- src/qemu/qemu_alias.c | 72 +- src/qemu/qemu_alias.h | 48 +- src/qemu/qemu_backup.c | 136 +- src/qemu/qemu_backup.h | 26 +- src/qemu/qemu_block.c | 522 ++-- src/qemu/qemu_block.h | 199 +- src/qemu/qemu_blockjob.c | 334 +-- src/qemu/qemu_blockjob.h | 120 +- src/qemu/qemu_capabilities.c | 643 ++-- src/qemu/qemu_capabilities.h | 117 +- src/qemu/qemu_capspriv.h | 60 +- src/qemu/qemu_cgroup.c | 202 +- src/qemu/qemu_cgroup.h | 81 +- src/qemu/qemu_checkpoint.c | 190 +- src/qemu/qemu_checkpoint.h | 52 +- src/qemu/qemu_command.c | 1158 ++++---- src/qemu/qemu_command.h | 176 +- src/qemu/qemu_conf.c | 204 +- src/qemu/qemu_conf.h | 105 +- src/qemu/qemu_dbus.c | 38 +- src/qemu/qemu_dbus.h | 22 +- src/qemu/qemu_domain.c | 1454 ++++----- src/qemu/qemu_domain.h | 627 ++-- src/qemu/qemu_domain_address.c | 384 +-- src/qemu/qemu_domain_address.h | 44 +- src/qemu/qemu_domainjob.c | 132 +- src/qemu/qemu_domainjob.h | 100 +- src/qemu/qemu_driver.c | 2055 +++++++------ src/qemu/qemu_extdevice.c | 82 +- src/qemu/qemu_extdevice.h | 36 +- src/qemu/qemu_firmware.c | 140 +- src/qemu/qemu_firmware.h | 13 +- src/qemu/qemu_hostdev.c | 128 +- src/qemu/qemu_hostdev.h | 92 +- src/qemu/qemu_hotplug.c | 876 +++--- src/qemu/qemu_hotplug.h | 190 +- src/qemu/qemu_interface.c | 42 +- src/qemu/qemu_interface.h | 38 +- src/qemu/qemu_interop_config.c | 4 +- src/qemu/qemu_migration.c | 598 ++-- src/qemu/qemu_migration.h | 76 +- src/qemu/qemu_migration_cookie.c | 188 +- src/qemu/qemu_migration_cookie.h | 66 +- src/qemu/qemu_migration_params.c | 139 +- src/qemu/qemu_migration_params.h | 69 +- src/qemu/qemu_migration_paramspriv.h | 14 +- src/qemu/qemu_monitor.c | 600 ++-- src/qemu/qemu_monitor.h | 714 +++-- src/qemu/qemu_monitor_json.c | 1558 +++++----- src/qemu/qemu_monitor_json.h | 419 ++- src/qemu/qemu_monitor_priv.h | 2 +- src/qemu/qemu_monitor_text.c | 10 +- src/qemu/qemu_monitor_text.h | 10 +- src/qemu/qemu_namespace.c | 182 +- src/qemu/qemu_namespace.h | 66 +- src/qemu/qemu_process.c | 1200 ++++---- src/qemu/qemu_process.h | 158 +- src/qemu/qemu_processpriv.h | 6 +- src/qemu/qemu_qapi.c | 48 +- src/qemu/qemu_qapi.h | 4 +- src/qemu/qemu_saveimage.c | 78 +- src/qemu/qemu_saveimage.h | 44 +- src/qemu/qemu_security.c | 140 +- src/qemu/qemu_security.h | 110 +- src/qemu/qemu_slirp.c | 44 +- src/qemu/qemu_slirp.h | 39 +- src/qemu/qemu_snapshot.c | 303 +- src/qemu/qemu_snapshot.h | 20 +- src/qemu/qemu_tpm.c | 44 +- src/qemu/qemu_tpm.h | 24 +- src/qemu/qemu_validate.c | 172 +- src/qemu/qemu_validate.h | 2 +- src/qemu/qemu_vhost_user.c | 49 +- src/qemu/qemu_vhost_user.h | 15 +- src/qemu/qemu_vhost_user_gpu.c | 24 +- src/qemu/qemu_vhost_user_gpu.h | 24 +- src/qemu/qemu_virtiofs.c | 46 +- src/qemu/qemu_virtiofs.h | 28 +- src/remote/remote_daemon.c | 46 +- src/remote/remote_daemon.h | 25 +- src/remote/remote_daemon_config.c | 4 +- src/remote/remote_daemon_dispatch.c | 990 +++---- src/remote/remote_daemon_dispatch.h | 2 +- src/remote/remote_daemon_stream.c | 82 +- src/remote/remote_daemon_stream.h | 12 +- src/remote/remote_driver.c | 590 ++-- src/remote/remote_sockets.c | 4 +- src/remote/remote_sockets.h | 4 +- src/remote/remote_ssh_helper.c | 17 +- src/rpc/virkeepalive.c | 38 +- src/rpc/virkeepalive.h | 21 +- src/rpc/virnetclient.c | 271 +- src/rpc/virnetclient.h | 82 +- src/rpc/virnetclientprogram.c | 38 +- src/rpc/virnetclientprogram.h | 30 +- src/rpc/virnetclientstream.c | 82 +- src/rpc/virnetclientstream.h | 49 +- src/rpc/virnetdaemon.c | 114 +- src/rpc/virnetdaemon.h | 46 +- src/rpc/virnetlibsshsession.c | 84 +- src/rpc/virnetlibsshsession.h | 29 +- src/rpc/virnetmessage.c | 42 +- src/rpc/virnetmessage.h | 46 +- src/rpc/virnetsaslcontext.c | 50 +- src/rpc/virnetsaslcontext.h | 36 +- src/rpc/virnetserver.c | 202 +- src/rpc/virnetserver.h | 74 +- src/rpc/virnetserverclient.c | 232 +- src/rpc/virnetserverclient.h | 130 +- src/rpc/virnetserverprogram.c | 94 +- src/rpc/virnetserverprogram.h | 70 +- src/rpc/virnetserverservice.c | 80 +- src/rpc/virnetserverservice.h | 36 +- src/rpc/virnetsocket.c | 174 +- src/rpc/virnetsocket.h | 95 +- src/rpc/virnetsshsession.c | 85 +- src/rpc/virnetsshsession.h | 31 +- src/rpc/virnettlscontext.c | 58 +- src/rpc/virnettlscontext.h | 32 +- src/secret/secret_driver.c | 51 +- src/security/security_apparmor.c | 218 +- src/security/security_dac.c | 474 ++- src/security/security_dac.h | 8 +- src/security/security_driver.c | 8 +- src/security/security_driver.h | 181 +- src/security/security_manager.c | 264 +- src/security/security_manager.h | 210 +- src/security/security_nop.c | 128 +- src/security/security_selinux.c | 530 ++-- src/security/security_stack.c | 346 ++- src/security/security_stack.h | 12 +- src/security/virt-aa-helper.c | 58 +- src/storage/storage_backend.c | 10 +- src/storage/storage_backend.h | 57 +- src/storage/storage_backend_disk.c | 96 +- src/storage/storage_backend_fs.c | 38 +- src/storage/storage_backend_gluster.c | 35 +- src/storage/storage_backend_iscsi.c | 28 +- src/storage/storage_backend_iscsi_direct.c | 36 +- src/storage/storage_backend_logical.c | 80 +- src/storage/storage_backend_mpath.c | 14 +- src/storage/storage_backend_rbd.c | 118 +- src/storage/storage_backend_scsi.c | 39 +- src/storage/storage_backend_sheepdog.c | 48 +- src/storage/storage_backend_sheepdog_priv.h | 4 +- src/storage/storage_backend_vstorage.c | 16 +- src/storage/storage_backend_zfs.c | 42 +- src/storage/storage_driver.c | 293 +- src/storage/storage_driver.h | 6 +- src/storage/storage_util.c | 270 +- src/storage/storage_util.h | 89 +- src/storage_file/storage_file_backend.c | 6 +- src/storage_file/storage_file_backend.h | 22 +- src/storage_file/storage_file_backend_fs.c | 22 +- .../storage_file_backend_gluster.c | 52 +- src/storage_file/storage_file_probe.c | 10 +- src/storage_file/storage_file_probe.h | 2 +- src/storage_file/storage_source.c | 106 +- src/storage_file/storage_source.h | 54 +- .../storage_source_backingstore.c | 104 +- .../storage_source_backingstore.h | 8 +- src/test/test_driver.c | 1163 ++++---- src/util/virarptable.c | 8 +- src/util/virarptable.h | 8 +- src/util/viraudit.c | 2 +- src/util/viraudit.h | 2 +- src/util/virauth.c | 2 +- src/util/virauth.h | 2 +- src/util/virauthconfig.c | 12 +- src/util/virauthconfig.h | 10 +- src/util/virbitmap.c | 94 +- src/util/virbitmap.h | 69 +- src/util/virbuffer.c | 50 +- src/util/virbuffer.h | 47 +- src/util/vircgroup.c | 484 +-- src/util/vircgroup.h | 139 +- src/util/vircgroupbackend.c | 10 +- src/util/vircgroupbackend.h | 151 +- src/util/vircgrouppriv.h | 27 +- src/util/vircgroupv1.c | 152 +- src/util/vircgroupv2.c | 144 +- src/util/vircgroupv2devices.c | 22 +- src/util/vircgroupv2devices.h | 10 +- src/util/vircommand.c | 208 +- src/util/vircommand.h | 125 +- src/util/vircommandpriv.h | 2 +- src/util/virconf.c | 152 +- src/util/virconf.h | 55 +- src/util/virdnsmasq.c | 40 +- src/util/virdnsmasq.h | 15 +- src/util/virfdstream.c | 81 +- src/util/virfile.c | 28 +- src/util/virfile.h | 14 +- src/util/virfilecache.c | 30 +- src/util/virfilecache.h | 14 +- src/util/virfirewall.c | 85 +- src/util/virfirewall.h | 38 +- src/util/virfirmware.c | 12 +- src/util/virfirmware.h | 10 +- src/util/virgic.h | 1 - src/util/virhash.c | 18 +- src/util/virhash.h | 10 +- src/util/virhostcpu.c | 40 +- src/util/virhostcpu.h | 11 +- src/util/viridentity.c | 52 +- src/util/viridentity.h | 50 +- src/util/viriptables.c | 90 +- src/util/viriptables.h | 60 +- src/util/virjson.c | 333 ++- src/util/virjson.h | 157 +- src/util/virlease.c | 10 +- src/util/virlease.h | 6 +- src/util/virlockspace.c | 60 +- src/util/virlockspace.h | 21 +- src/util/virlog.c | 88 +- src/util/virlog.h | 39 +- src/util/virmacaddr.c | 12 +- src/util/virmacaddr.h | 14 +- src/util/virmacmap.c | 34 +- src/util/virmacmap.h | 13 +- src/util/virmdev.c | 88 +- src/util/virmdev.h | 75 +- src/util/virnetdev.c | 88 +- src/util/virnetdev.h | 36 +- src/util/virnetdevbandwidth.c | 28 +- src/util/virnetdevbandwidth.h | 16 +- src/util/virnetdevip.c | 42 +- src/util/virnetdevip.h | 27 +- src/util/virnetdevmacvlan.c | 12 +- src/util/virnetdevmidonet.c | 4 +- src/util/virnetdevopenvswitch.c | 14 +- src/util/virnetdevtap.c | 2 +- src/util/virnetdevtap.h | 2 +- src/util/virnetdevvlan.c | 6 +- src/util/virnetdevvlan.h | 7 +- src/util/virnetdevvportprofile.c | 8 +- src/util/virnetdevvportprofile.h | 7 +- src/util/virnetlink.c | 21 +- src/util/virnetlink.h | 3 +- src/util/virnodesuspend.c | 4 +- src/util/virnuma.c | 22 +- src/util/virnuma.h | 12 +- src/util/virnvme.c | 66 +- src/util/virnvme.h | 40 +- src/util/virobject.c | 80 +- src/util/virobject.h | 28 +- src/util/virpci.c | 263 +- src/util/virpci.h | 132 +- src/util/virperf.c | 32 +- src/util/virperf.h | 13 +- src/util/virpolkit.c | 16 +- src/util/virpolkit.h | 5 +- src/util/virportallocator.c | 27 +- src/util/virportallocator.h | 5 +- src/util/virprocess.c | 16 +- src/util/virprocess.h | 4 +- src/util/virqemu.c | 44 +- src/util/virqemu.h | 22 +- src/util/virresctrl.c | 313 +- src/util/virresctrl.h | 75 +- src/util/virresctrlpriv.h | 4 +- src/util/virrotatingfile.c | 54 +- src/util/virrotatingfile.h | 22 +- src/util/virscsi.c | 69 +- src/util/virscsi.h | 52 +- src/util/virscsivhost.c | 56 +- src/util/virscsivhost.h | 40 +- src/util/virseclabel.c | 16 +- src/util/virseclabel.h | 12 +- src/util/virsecret.c | 12 +- src/util/virsecret.h | 13 +- src/util/virsocketaddr.c | 65 +- src/util/virsocketaddr.h | 52 +- src/util/virsysinfo.c | 132 +- src/util/virsysinfo.h | 45 +- src/util/virsysinfopriv.h | 8 +- src/util/virsystemd.c | 30 +- src/util/virsystemd.h | 11 +- src/util/virthread.c | 52 +- src/util/virthread.h | 64 +- src/util/virthreadpool.c | 68 +- src/util/virthreadpool.h | 25 +- src/util/virtpm.c | 18 +- src/util/virtypedparam.c | 32 +- src/util/virtypedparam.h | 29 +- src/util/viruri.c | 20 +- src/util/viruri.h | 19 +- src/util/virusb.c | 76 +- src/util/virusb.h | 50 +- src/util/virxml.c | 22 +- src/util/virxml.h | 21 +- src/vbox/vbox_common.c | 274 +- src/vbox/vbox_driver.c | 2 +- src/vbox/vbox_get_driver.h | 6 +- src/vbox/vbox_network.c | 36 +- src/vbox/vbox_snapshot_conf.c | 128 +- src/vbox/vbox_snapshot_conf.h | 62 +- src/vbox/vbox_storage.c | 22 +- src/vbox/vbox_tmpl.c | 44 +- src/vbox/vbox_uniformed_api.h | 51 +- src/vmware/vmware_conf.c | 20 +- src/vmware/vmware_conf.h | 12 +- src/vmware/vmware_driver.c | 70 +- src/vmx/vmx.c | 184 +- src/vmx/vmx.h | 14 +- src/vz/vz_driver.c | 421 ++- src/vz/vz_sdk.c | 390 +-- src/vz/vz_sdk.h | 78 +- src/vz/vz_utils.c | 48 +- src/vz/vz_utils.h | 42 +- tests/bhyveargv2xmlmock.c | 4 +- tests/bhyvexml2argvmock.c | 4 +- tests/commandtest.c | 8 +- tests/cputest.c | 106 +- tests/domaincapstest.c | 22 +- tests/domainconftest.c | 8 +- tests/genericxml2xmltest.c | 10 +- tests/interfacexml2xmltest.c | 2 +- tests/libxlxml2domconfigtest.c | 6 +- tests/lxcconf2xmltest.c | 6 +- tests/lxcxml2xmltest.c | 2 +- tests/networkxml2conftest.c | 18 +- tests/networkxml2firewalltest.c | 2 +- tests/networkxml2xmltest.c | 4 +- tests/networkxml2xmlupdatetest.c | 2 +- tests/nodedevmdevctltest.c | 18 +- tests/nodedevxml2xmltest.c | 6 +- tests/nwfilterxml2firewalltest.c | 29 +- tests/nwfilterxml2xmltest.c | 2 +- tests/openvzutilstest.c | 2 +- tests/qemuagenttest.c | 86 +- tests/qemublocktest.c | 80 +- tests/qemucapabilitiestest.c | 9 +- tests/qemucaps2xmltest.c | 13 +- tests/qemucapsprobe.c | 2 +- tests/qemucapsprobemock.c | 18 +- tests/qemucommandutiltest.c | 2 +- tests/qemucpumock.c | 4 +- tests/qemudomaincheckpointxml2xmltest.c | 4 +- tests/qemudomainsnapshotxml2xmltest.c | 2 +- tests/qemufirmwaretest.c | 10 +- tests/qemuhotplugmock.c | 8 +- tests/qemuhotplugtest.c | 42 +- tests/qemumigparamstest.c | 10 +- tests/qemumigrationcookiexmltest.c | 10 +- tests/qemumonitorjsontest.c | 141 +- tests/qemumonitortestutils.c | 163 +- tests/qemumonitortestutils.h | 56 +- tests/qemusecuritytest.c | 18 +- tests/qemustatusxml2xmltest.c | 2 +- tests/qemuxml2argvmock.c | 12 +- tests/qemuxml2argvtest.c | 42 +- tests/seclabeltest.c | 2 +- tests/secretxml2xmltest.c | 2 +- tests/securityselinuxlabeltest.c | 8 +- tests/securityselinuxtest.c | 14 +- tests/storagepoolcapstest.c | 8 +- tests/storagepoolxml2argvtest.c | 4 +- tests/storagevolxml2argvtest.c | 8 +- tests/sysinfotest.c | 2 +- tests/testutils.c | 33 +- tests/testutils.h | 12 +- tests/testutilshostcpus.h | 4 +- tests/testutilslxc.c | 12 +- tests/testutilslxc.h | 6 +- tests/testutilsqemu.c | 44 +- tests/testutilsqemu.h | 28 +- tests/testutilsqemuschema.c | 108 +- tests/testutilsqemuschema.h | 14 +- tests/testutilsxen.c | 14 +- tests/testutilsxen.h | 4 +- tests/vboxsnapshotxmltest.c | 2 +- tests/virauthconfigtest.c | 4 +- tests/virbitmaptest.c | 4 +- tests/virbuftest.c | 4 +- tests/vircaps2xmltest.c | 2 +- tests/vircapstest.c | 16 +- tests/vircgroupmock.c | 2 +- tests/vircgrouptest.c | 2 +- tests/virconftest.c | 2 +- tests/virfilecachetest.c | 29 +- tests/virfirewalltest.c | 6 +- tests/virhostcputest.c | 2 +- tests/virhostdevtest.c | 8 +- tests/virjsontest.c | 2 +- tests/virkmodtest.c | 2 +- tests/virlockspacetest.c | 14 +- tests/virlogtest.c | 4 +- tests/virmacmaptest.c | 8 +- tests/virnetdaemontest.c | 44 +- tests/virnetmessagetest.c | 10 +- tests/virnetserverclientmock.c | 4 +- tests/virnetserverclienttest.c | 6 +- tests/virnetsockettest.c | 32 +- tests/virnettlscontexttest.c | 4 +- tests/virnettlssessiontest.c | 8 +- tests/virnumamock.c | 6 +- tests/virnwfilterbindingxml2xmltest.c | 2 +- tests/virpcitest.c | 32 +- tests/virportallocatortest.c | 4 +- tests/virresctrltest.c | 4 +- tests/virrotatingfiletest.c | 26 +- tests/virschematest.c | 10 +- tests/virscsitest.c | 8 +- tests/virstoragetest.c | 24 +- tests/virsystemdtest.c | 10 +- tests/viruritest.c | 4 +- tests/virusbtest.c | 14 +- tests/vmx2xmltest.c | 8 +- tests/vshtabletest.c | 20 +- tests/xlconfigtest.c | 6 +- tests/xmconfigtest.c | 6 +- tests/xml2vmxtest.c | 10 +- tools/virsh-checkpoint.c | 17 +- tools/virsh-completer-checkpoint.c | 2 +- tools/virsh-completer-domain.c | 16 +- tools/virsh-completer-host.c | 6 +- tools/virsh-completer-interface.c | 2 +- tools/virsh-completer-network.c | 8 +- tools/virsh-completer-nodedev.c | 2 +- tools/virsh-completer-nwfilter.c | 4 +- tools/virsh-completer-pool.c | 2 +- tools/virsh-completer-secret.c | 2 +- tools/virsh-completer-snapshot.c | 2 +- tools/virsh-completer-volume.c | 2 +- tools/virsh-console.c | 21 +- tools/virsh-domain-monitor.c | 23 +- tools/virsh-domain.c | 95 +- tools/virsh-host.c | 42 +- tools/virsh-interface.c | 29 +- tools/virsh-network.c | 36 +- tools/virsh-nodedev.c | 23 +- tools/virsh-nwfilter.c | 36 +- tools/virsh-pool.c | 33 +- tools/virsh-secret.c | 19 +- tools/virsh-snapshot.c | 25 +- tools/virsh-util.c | 14 +- tools/virsh-util.h | 1 - tools/virsh-volume.c | 19 +- tools/virsh.c | 12 +- tools/virsh.h | 1 - tools/virt-admin-completer.c | 2 +- tools/virt-admin.c | 44 +- tools/virt-admin.h | 1 - tools/virt-host-validate-common.c | 8 +- tools/virt-host-validate-common.h | 2 +- tools/virt-host-validate-qemu.c | 2 +- tools/virt-login-shell-helper.c | 4 +- tools/vsh-table.c | 36 +- tools/vsh-table.h | 12 +- tools/vsh.c | 4 +- 734 files changed, 29338 insertions(+), 30231 deletions(-) diff --git a/docs/advanced-tests.rst b/docs/advanced-tests.rst index f17d8b0031..370e24cc98 100644 --- a/docs/advanced-tests.rst +++ b/docs/advanced-tests.rst @@ -105,7 +105,7 @@ of leak: ==5414== by 0x34D9021734: (below main) (in /usr/lib64/libc-2.15.so) In this example, the ``virDomainDefParseXML()`` had an error -path where the ``virDomainVideoDefPtr video`` pointer was not +path where the ``virDomainVideoDef *video`` pointer was not properly disposed. By simply adding a ``virDomainVideoDefFree(video);`` in the error path, the issue was resolved. diff --git a/docs/api_extension.rst b/docs/api_extension.rst index 02b39efd82..16d4b0a005 100644 --- a/docs/api_extension.rst +++ b/docs/api_extension.rst @@ -263,7 +263,7 @@ Implement common handling If the new API is applicable to more than one driver, it may make sense to provide some utility routines, or to factor some of the work into the dispatcher, to avoid reimplementing the same code in every driver. In -the example code, this involved adding a member to the virDomainDefPtr +the example code, this involved adding a member to the virDomainDef struct for mapping between the XML API addition and the in-memory representation of a domain, along with updating all clients to use the new member. Up to this point, there have been no changes to existing diff --git a/docs/coding-style.rst b/docs/coding-style.rst index 19055e43ab..470c61860f 100644 --- a/docs/coding-style.rst +++ b/docs/coding-style.rst @@ -836,7 +836,7 @@ vircommand.h: :: - void virCommandAddEnvFormat(virCommandPtr cmd, const char *format, ...) + void virCommandAddEnvFormat(virCommand *cmd, const char *format, ...) G_GNUC_PRINTF(2, 3); This makes it so gcc's -Wformat and -Wformat-security options can diff --git a/docs/internals/command.html.in b/docs/internals/command.html.in index 634afdc937..585ba53a93 100644 --- a/docs/internals/command.html.in +++ b/docs/internals/command.html.in @@ -83,7 +83,7 @@

-virCommandPtr cmd = virCommandNew("/usr/bin/dnsmasq");
+virCommand *cmd = virCommandNew("/usr/bin/dnsmasq");
 

@@ -136,7 +136,7 @@ virCommandAddArgList(cmd, "--domain", "localdomain", NULL);

This can also be done at the time of initial construction of - the virCommandPtr object: + the virCommand * object:

@@ -145,8 +145,8 @@ const char *const args[] = {
     "--strict-order", "--except-interface",
     "lo", "--domain", "localdomain", NULL
 };
-virCommandPtr cmd1 = virCommandNewArgs(cmd, args);
-virCommandPtr cmd2 = virCommandNewArgList("/usr/bin/dnsmasq",
+virCommand *cmd1 = virCommandNewArgs(cmd, args);
+virCommand *cmd2 = virCommandNewArgList("/usr/bin/dnsmasq",
                                           "--domain", "localdomain", NULL);
 
@@ -537,7 +537,7 @@ if (WEXITSTATUS(status)...) {

Once the command has been executed, or if execution has been abandoned, it is necessary to release - resources associated with the virCommandPtr + resources associated with the virCommand * object. This is done with:

@@ -566,7 +566,7 @@ int runhook(const char *drvstr, const char *id, { int ret; char *path; - virCommandPtr cmd; + virCommand *cmd; virBuildPath(&path, LIBVIRT_HOOK_DIR, drvstr); diff --git a/docs/internals/rpc.html.in b/docs/internals/rpc.html.in index e6f54cfa5d..ceb7dba5f2 100644 --- a/docs/internals/rpc.html.in +++ b/docs/internals/rpc.html.in @@ -444,21 +444,21 @@ C <-- |32| 8 | 1 | 3 | 1 | 1 | 0 | .o.oOo | <-- S (reply)

-
virNetSASLContextPtr (virnetsaslcontext.h)
+
virNetSASLContext * (virnetsaslcontext.h)
The virNetSASLContext APIs maintain SASL state for a network service (server or client). This is primarily used on the server to provide an access control list of SASL usernames permitted as clients.
-
virNetSASLSessionPtr (virnetsaslcontext.h)
+
virNetSASLSession * (virnetsaslcontext.h)
The virNetSASLSession APIs maintain SASL state for a single network connection (socket). This is used to perform the multi-step SASL handshake and perform encryption/decryption of data once authenticated, via integration with virNetSocket.
-
virNetTLSContextPtr (virnettlscontext.h)
+
virNetTLSContext * (virnettlscontext.h)
The virNetTLSContext APIs maintain TLS state for a network service (server or client). This is primarily used on the server to provide an access control list of x509 distinguished names, as @@ -467,29 +467,29 @@ C <-- |32| 8 | 1 | 3 | 1 | 1 | 0 | .o.oOo | <-- S (reply) to improve detection of configuration errors.
-
virNetTLSSessionPtr (virnettlscontext.h)
+
virNetTLSSession * (virnettlscontext.h)
The virNetTLSSession APIs maintain TLS state for a single network connection (socket). This is used to perform the multi-step TLS handshake and perform encryption/decryption of data once authenticated, via integration with virNetSocket.
-
virNetSocketPtr (virnetsocket.h)
+
virNetSocket * (virnetsocket.h)
The virNetSocket APIs provide a higher level wrapper around the raw BSD sockets and getaddrinfo APIs. They allow for creation of both server and client sockets. Data transports supported are TCP, UNIX, SSH tunnel or external command tunnel. Internally the TCP socket impl uses the getaddrinfo info APIs to ensure correct protocol-independent behaviour, thus supporting both IPv4 and IPv6. - The socket APIs can be associated with a virNetSASLSessionPtr or - virNetTLSSessionPtr object to allow seamless encryption/decryption + The socket APIs can be associated with a virNetSASLSession *or + virNetTLSSession *object to allow seamless encryption/decryption of all writes and reads. For UNIX sockets it is possible to obtain the remote client user ID and process ID. Integration with the libvirt event loop also allows use of callbacks for notification of various I/O conditions
-
virNetMessagePtr (virnetmessage.h)
+
virNetMessage * (virnetmessage.h)
The virNetMessage APIs provide a wrapper around the libxdr API calls, to facilitate processing and creation of RPC packets. There are convenience APIs for encoding/encoding the @@ -498,7 +498,7 @@ C <-- |32| 8 | 1 | 3 | 1 | 1 | 0 | .o.oOo | <-- S (reply) encoding a virErrorPtr object. There is also a means to add to/serve from a linked-list queue of messages.
-
virNetClientPtr (virnetclient.h)
+
virNetClient * (virnetclient.h)
The virNetClient APIs provide a way to connect to a remote server and run one or more RPC protocols over the connection. Connections can be made over TCP, UNIX @@ -510,7 +510,7 @@ C <-- |32| 8 | 1 | 3 | 1 | 1 | 0 | .o.oOo | <-- S (reply) being interleaved on the wire as required.
-
virNetClientProgramPtr (virnetclientprogram.h)
+
virNetClientProgram * (virnetclientprogram.h)
The virNetClientProgram APIs are used to register a program+version with the connection. This then enables invocation of method calls, receipt of asynchronous @@ -519,42 +519,42 @@ C <-- |32| 8 | 1 | 3 | 1 | 1 | 0 | .o.oOo | <-- S (reply) care of dispatching any incoming asynchronous events.
-
virNetClientStreamPtr (virnetclientstream.h)
+
virNetClientStream * (virnetclientstream.h)
The virNetClientStream APIs are used to control transmission and receipt of data over a stream active on a client. Streams provide a low latency, unlimited length, bi-directional raw data exchange mechanism layered over the RPC connection
-
virNetServerPtr (virnetserver.h)
+
virNetServer * (virnetserver.h)
The virNetServer APIs are used to manage a network server. A server exposed one or more programs, over one or more services. It manages multiple client connections invoking multiple RPC calls in parallel, with dispatch across multiple worker threads.
-
virNetDaemonPtr (virnetdaemon.h)
+
virNetDaemon * (virnetdaemon.h)
The virNetDaemon APIs are used to manage a daemon process. A daemon is a process that might expose one or more servers. It handles most process-related details, network-related should be part of the underlying server.
-
virNetServerClientPtr (virnetserverclient.h)
+
virNetServerClient * (virnetserverclient.h)
The virNetServerClient APIs are used to manage I/O related to a single client network connection. It handles initial validation and routing of incoming RPC packets, and transmission of outgoing packets.
-
virNetServerProgramPtr (virnetserverprogram.h)
+
virNetServerProgram * (virnetserverprogram.h)
The virNetServerProgram APIs are used to provide the implementation of a single program/version set. Primarily this includes a set of callbacks used to actually invoke the APIs corresponding to program procedure numbers. It is responsible for all the serialization of payloads to/from XDR.
-
virNetServerServicePtr (virnetserverservice.h)
+
virNetServerService * (virnetserverservice.h)
The virNetServerService APIs are used to connect the server to one or more network protocols. A single service may involve multiple sockets (ie both IPv4 and IPv6). A service also has an associated diff --git a/scripts/esx_vi_generator.py b/scripts/esx_vi_generator.py index c9bd8f4920..31c36f42e2 100755 --- a/scripts/esx_vi_generator.py +++ b/scripts/esx_vi_generator.py @@ -690,14 +690,14 @@ class Object(GenericObject): header += (( "int esxVI_%s_Serialize(esxVI_%s *item, " " const char *element, " - " virBufferPtr output);\n") % + " virBuffer *output);\n") % (self.name, self.name)) if self.features & Object.FEATURE__LIST: header += (( "int esxVI_%s_SerializeList(esxVI_%s *list, " " const char *element, " - " virBufferPtr output);\n") % + " virBuffer *output);\n") % (self.name, self.name)) if self.features & Object.FEATURE__DESERIALIZE: @@ -1083,7 +1083,7 @@ class Enum(Type): if self.features & Enum.FEATURE__SERIALIZE: header += ("int esxVI_%s_Serialize(esxVI_%s item, const char *element, " - " virBufferPtr output);\n") \ + " virBuffer *output);\n") \ % (self.name, self.name) if self.features & Enum.FEATURE__DESERIALIZE: diff --git a/scripts/hyperv_wmi_generator.py b/scripts/hyperv_wmi_generator.py index f26558cb56..d11dfb1809 100755 --- a/scripts/hyperv_wmi_generator.py +++ b/scripts/hyperv_wmi_generator.py @@ -54,7 +54,7 @@ class WmiClass: header += "#define %s_WQL_SELECT \\\n" % name_upper header += " \"SELECT * FROM %s \"\n" % self.name header += "\n" - header += "extern hypervWmiClassInfoPtr %s_WmiInfo;\n\n" % self.name + header += "extern hypervWmiClassInfo *%s_WmiInfo;\n\n" % self.name header += self._declare_data_structs() header += self._declare_hypervObject_struct() @@ -128,7 +128,7 @@ class WmiClass: header = "\n/* must match hypervObject */\n" header += "struct _%s {\n" % self.name header += " %s_Data *data;\n" % self.name - header += " hypervWmiClassInfoPtr info;\n" + header += " hypervWmiClassInfo *info;\n" header += " %s *next;\n" % self.name header += "};\n" @@ -142,7 +142,7 @@ class WmiClass: This struct holds info with meta-data needed to make wsman requests for the WMI class. """ - source = "hypervWmiClassInfoPtr %s_WmiInfo = &(hypervWmiClassInfo) {\n" % self.name + source = "hypervWmiClassInfo *%s_WmiInfo = &(hypervWmiClassInfo) {\n" % self.name source += " .name = \"%s\",\n" % self.name source += " .rootUri = %s,\n" % self.uri_info.rootUri source += " .resourceUri = %s_RESOURCE_URI,\n" % self.name.upper() diff --git a/src/access/viraccessdriver.h b/src/access/viraccessdriver.h index 363d75965c..c1bccfe90f 100644 --- a/src/access/viraccessdriver.h +++ b/src/access/viraccessdriver.h @@ -23,58 +23,56 @@ #include "conf/domain_conf.h" #include "access/viraccessmanager.h" -typedef int (*virAccessDriverCheckConnectDrv)(virAccessManagerPtr manager, +typedef int (*virAccessDriverCheckConnectDrv)(virAccessManager *manager, const char *driverName, virAccessPermConnect av); -typedef int (*virAccessDriverCheckDomainDrv)(virAccessManagerPtr manager, +typedef int (*virAccessDriverCheckDomainDrv)(virAccessManager *manager, const char *driverName, - virDomainDefPtr domain, + virDomainDef *domain, virAccessPermDomain av); -typedef int (*virAccessDriverCheckInterfaceDrv)(virAccessManagerPtr manager, +typedef int (*virAccessDriverCheckInterfaceDrv)(virAccessManager *manager, const char *driverName, - virInterfaceDefPtr iface, + virInterfaceDef *iface, virAccessPermInterface av); -typedef int (*virAccessDriverCheckNetworkDrv)(virAccessManagerPtr manager, +typedef int (*virAccessDriverCheckNetworkDrv)(virAccessManager *manager, const char *driverName, - virNetworkDefPtr network, + virNetworkDef *network, virAccessPermNetwork av); -typedef int (*virAccessDriverCheckNetworkPortDrv)(virAccessManagerPtr manager, +typedef int (*virAccessDriverCheckNetworkPortDrv)(virAccessManager *manager, const char *driverName, - virNetworkDefPtr network, - virNetworkPortDefPtr port, + virNetworkDef *network, + virNetworkPortDef *port, virAccessPermNetworkPort av); -typedef int (*virAccessDriverCheckNodeDeviceDrv)(virAccessManagerPtr manager, +typedef int (*virAccessDriverCheckNodeDeviceDrv)(virAccessManager *manager, const char *driverName, - virNodeDeviceDefPtr nodedev, + virNodeDeviceDef *nodedev, virAccessPermNodeDevice av); -typedef int (*virAccessDriverCheckNWFilterDrv)(virAccessManagerPtr manager, +typedef int (*virAccessDriverCheckNWFilterDrv)(virAccessManager *manager, const char *driverName, - virNWFilterDefPtr nwfilter, + virNWFilterDef *nwfilter, virAccessPermNWFilter av); -typedef int (*virAccessDriverCheckNWFilterBindingDrv)(virAccessManagerPtr manager, +typedef int (*virAccessDriverCheckNWFilterBindingDrv)(virAccessManager *manager, const char *driverName, - virNWFilterBindingDefPtr binding, + virNWFilterBindingDef *binding, virAccessPermNWFilterBinding av); -typedef int (*virAccessDriverCheckSecretDrv)(virAccessManagerPtr manager, +typedef int (*virAccessDriverCheckSecretDrv)(virAccessManager *manager, const char *driverName, - virSecretDefPtr secret, + virSecretDef *secret, virAccessPermSecret av); -typedef int (*virAccessDriverCheckStoragePoolDrv)(virAccessManagerPtr manager, +typedef int (*virAccessDriverCheckStoragePoolDrv)(virAccessManager *manager, const char *driverName, - virStoragePoolDefPtr pool, + virStoragePoolDef *pool, virAccessPermStoragePool av); -typedef int (*virAccessDriverCheckStorageVolDrv)(virAccessManagerPtr manager, +typedef int (*virAccessDriverCheckStorageVolDrv)(virAccessManager *manager, const char *driverName, - virStoragePoolDefPtr pool, - virStorageVolDefPtr vol, + virStoragePoolDef *pool, + virStorageVolDef *vol, virAccessPermStorageVol av); -typedef int (*virAccessDriverSetupDrv)(virAccessManagerPtr manager); -typedef void (*virAccessDriverCleanupDrv)(virAccessManagerPtr manager); +typedef int (*virAccessDriverSetupDrv)(virAccessManager *manager); +typedef void (*virAccessDriverCleanupDrv)(virAccessManager *manager); typedef struct _virAccessDriver virAccessDriver; -typedef virAccessDriver *virAccessDriverPtr; - struct _virAccessDriver { size_t privateDataLen; const char *name; diff --git a/src/access/viraccessdrivernop.c b/src/access/viraccessdrivernop.c index 5772a9c5c6..8e5f0eb5df 100644 --- a/src/access/viraccessdrivernop.c +++ b/src/access/viraccessdrivernop.c @@ -23,7 +23,7 @@ #include "access/viraccessdrivernop.h" static int -virAccessDriverNopCheckConnect(virAccessManagerPtr manager G_GNUC_UNUSED, +virAccessDriverNopCheckConnect(virAccessManager *manager G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, virAccessPermConnect perm G_GNUC_UNUSED) { @@ -31,92 +31,92 @@ virAccessDriverNopCheckConnect(virAccessManagerPtr manager G_GNUC_UNUSED, } static int -virAccessDriverNopCheckDomain(virAccessManagerPtr manager G_GNUC_UNUSED, +virAccessDriverNopCheckDomain(virAccessManager *manager G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, - virDomainDefPtr domain G_GNUC_UNUSED, + virDomainDef *domain G_GNUC_UNUSED, virAccessPermDomain perm G_GNUC_UNUSED) { return 1; /* Allow */ } static int -virAccessDriverNopCheckInterface(virAccessManagerPtr manager G_GNUC_UNUSED, +virAccessDriverNopCheckInterface(virAccessManager *manager G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, - virInterfaceDefPtr iface G_GNUC_UNUSED, + virInterfaceDef *iface G_GNUC_UNUSED, virAccessPermInterface perm G_GNUC_UNUSED) { return 1; /* Allow */ } static int -virAccessDriverNopCheckNetwork(virAccessManagerPtr manager G_GNUC_UNUSED, +virAccessDriverNopCheckNetwork(virAccessManager *manager G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, - virNetworkDefPtr network G_GNUC_UNUSED, + virNetworkDef *network G_GNUC_UNUSED, virAccessPermNetwork perm G_GNUC_UNUSED) { return 1; /* Allow */ } static int -virAccessDriverNopCheckNetworkPort(virAccessManagerPtr manager G_GNUC_UNUSED, +virAccessDriverNopCheckNetworkPort(virAccessManager *manager G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, - virNetworkDefPtr network G_GNUC_UNUSED, - virNetworkPortDefPtr port G_GNUC_UNUSED, + virNetworkDef *network G_GNUC_UNUSED, + virNetworkPortDef *port G_GNUC_UNUSED, virAccessPermNetworkPort perm G_GNUC_UNUSED) { return 1; /* Allow */ } static int -virAccessDriverNopCheckNodeDevice(virAccessManagerPtr manager G_GNUC_UNUSED, +virAccessDriverNopCheckNodeDevice(virAccessManager *manager G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, - virNodeDeviceDefPtr nodedev G_GNUC_UNUSED, + virNodeDeviceDef *nodedev G_GNUC_UNUSED, virAccessPermNodeDevice perm G_GNUC_UNUSED) { return 1; /* Allow */ } static int -virAccessDriverNopCheckNWFilter(virAccessManagerPtr manager G_GNUC_UNUSED, +virAccessDriverNopCheckNWFilter(virAccessManager *manager G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, - virNWFilterDefPtr nwfilter G_GNUC_UNUSED, + virNWFilterDef *nwfilter G_GNUC_UNUSED, virAccessPermNWFilter perm G_GNUC_UNUSED) { return 1; /* Allow */ } static int -virAccessDriverNopCheckNWFilterBinding(virAccessManagerPtr manager G_GNUC_UNUSED, +virAccessDriverNopCheckNWFilterBinding(virAccessManager *manager G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, - virNWFilterBindingDefPtr binding G_GNUC_UNUSED, + virNWFilterBindingDef *binding G_GNUC_UNUSED, virAccessPermNWFilterBinding perm G_GNUC_UNUSED) { return 1; /* Allow */ } static int -virAccessDriverNopCheckSecret(virAccessManagerPtr manager G_GNUC_UNUSED, +virAccessDriverNopCheckSecret(virAccessManager *manager G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, - virSecretDefPtr secret G_GNUC_UNUSED, + virSecretDef *secret G_GNUC_UNUSED, virAccessPermSecret perm G_GNUC_UNUSED) { return 1; /* Allow */ } static int -virAccessDriverNopCheckStoragePool(virAccessManagerPtr manager G_GNUC_UNUSED, +virAccessDriverNopCheckStoragePool(virAccessManager *manager G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, - virStoragePoolDefPtr pool G_GNUC_UNUSED, + virStoragePoolDef *pool G_GNUC_UNUSED, virAccessPermStoragePool perm G_GNUC_UNUSED) { return 1; /* Allow */ } static int -virAccessDriverNopCheckStorageVol(virAccessManagerPtr manager G_GNUC_UNUSED, +virAccessDriverNopCheckStorageVol(virAccessManager *manager G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, - virStoragePoolDefPtr pool G_GNUC_UNUSED, - virStorageVolDefPtr vol G_GNUC_UNUSED, + virStoragePoolDef *pool G_GNUC_UNUSED, + virStorageVolDef *vol G_GNUC_UNUSED, virAccessPermStorageVol perm G_GNUC_UNUSED) { return 1; /* Allow */ diff --git a/src/access/viraccessdriverpolkit.c b/src/access/viraccessdriverpolkit.c index 1d6ff81391..c8d1421ad8 100644 --- a/src/access/viraccessdriverpolkit.c +++ b/src/access/viraccessdriverpolkit.c @@ -40,14 +40,12 @@ VIR_LOG_INIT("access.accessdriverpolkit"); #define VIR_ACCESS_DRIVER_POLKIT_ACTION_PREFIX "org.libvirt.api" typedef struct _virAccessDriverPolkitPrivate virAccessDriverPolkitPrivate; -typedef virAccessDriverPolkitPrivate *virAccessDriverPolkitPrivatePtr; - struct _virAccessDriverPolkitPrivate { bool ignore; }; -static void virAccessDriverPolkitCleanup(virAccessManagerPtr manager G_GNUC_UNUSED) +static void virAccessDriverPolkitCleanup(virAccessManager *manager G_GNUC_UNUSED) { } @@ -118,7 +116,7 @@ virAccessDriverPolkitGetCaller(const char *actionid, static int -virAccessDriverPolkitCheck(virAccessManagerPtr manager G_GNUC_UNUSED, +virAccessDriverPolkitCheck(virAccessManager *manager G_GNUC_UNUSED, const char *typename, const char *permname, const char **attrs) @@ -161,7 +159,7 @@ virAccessDriverPolkitCheck(virAccessManagerPtr manager G_GNUC_UNUSED, static int -virAccessDriverPolkitCheckConnect(virAccessManagerPtr manager, +virAccessDriverPolkitCheckConnect(virAccessManager *manager, const char *driverName, virAccessPermConnect perm) { @@ -177,9 +175,9 @@ virAccessDriverPolkitCheckConnect(virAccessManagerPtr manager, } static int -virAccessDriverPolkitCheckDomain(virAccessManagerPtr manager, +virAccessDriverPolkitCheckDomain(virAccessManager *manager, const char *driverName, - virDomainDefPtr domain, + virDomainDef *domain, virAccessPermDomain perm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -198,9 +196,9 @@ virAccessDriverPolkitCheckDomain(virAccessManagerPtr manager, } static int -virAccessDriverPolkitCheckInterface(virAccessManagerPtr manager, +virAccessDriverPolkitCheckInterface(virAccessManager *manager, const char *driverName, - virInterfaceDefPtr iface, + virInterfaceDef *iface, virAccessPermInterface perm) { const char *attrs[] = { @@ -217,9 +215,9 @@ virAccessDriverPolkitCheckInterface(virAccessManagerPtr manager, } static int -virAccessDriverPolkitCheckNetwork(virAccessManagerPtr manager, +virAccessDriverPolkitCheckNetwork(virAccessManager *manager, const char *driverName, - virNetworkDefPtr network, + virNetworkDef *network, virAccessPermNetwork perm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -238,10 +236,10 @@ virAccessDriverPolkitCheckNetwork(virAccessManagerPtr manager, } static int -virAccessDriverPolkitCheckNetworkPort(virAccessManagerPtr manager, +virAccessDriverPolkitCheckNetworkPort(virAccessManager *manager, const char *driverName, - virNetworkDefPtr network, - virNetworkPortDefPtr port, + virNetworkDef *network, + virNetworkPortDef *port, virAccessPermNetworkPort perm) { char uuidstr1[VIR_UUID_STRING_BUFLEN]; @@ -263,9 +261,9 @@ virAccessDriverPolkitCheckNetworkPort(virAccessManagerPtr manager, } static int -virAccessDriverPolkitCheckNodeDevice(virAccessManagerPtr manager, +virAccessDriverPolkitCheckNodeDevice(virAccessManager *manager, const char *driverName, - virNodeDeviceDefPtr nodedev, + virNodeDeviceDef *nodedev, virAccessPermNodeDevice perm) { const char *attrs[] = { @@ -281,9 +279,9 @@ virAccessDriverPolkitCheckNodeDevice(virAccessManagerPtr manager, } static int -virAccessDriverPolkitCheckNWFilter(virAccessManagerPtr manager, +virAccessDriverPolkitCheckNWFilter(virAccessManager *manager, const char *driverName, - virNWFilterDefPtr nwfilter, + virNWFilterDef *nwfilter, virAccessPermNWFilter perm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -302,9 +300,9 @@ virAccessDriverPolkitCheckNWFilter(virAccessManagerPtr manager, } static int -virAccessDriverPolkitCheckNWFilterBinding(virAccessManagerPtr manager, +virAccessDriverPolkitCheckNWFilterBinding(virAccessManager *manager, const char *driverName, - virNWFilterBindingDefPtr binding, + virNWFilterBindingDef *binding, virAccessPermNWFilterBinding perm) { const char *attrs[] = { @@ -322,9 +320,9 @@ virAccessDriverPolkitCheckNWFilterBinding(virAccessManagerPtr manager, } static int -virAccessDriverPolkitCheckSecret(virAccessManagerPtr manager, +virAccessDriverPolkitCheckSecret(virAccessManager *manager, const char *driverName, - virSecretDefPtr secret, + virSecretDef *secret, virAccessPermSecret perm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -400,9 +398,9 @@ virAccessDriverPolkitCheckSecret(virAccessManagerPtr manager, } static int -virAccessDriverPolkitCheckStoragePool(virAccessManagerPtr manager, +virAccessDriverPolkitCheckStoragePool(virAccessManager *manager, const char *driverName, - virStoragePoolDefPtr pool, + virStoragePoolDef *pool, virAccessPermStoragePool perm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -421,10 +419,10 @@ virAccessDriverPolkitCheckStoragePool(virAccessManagerPtr manager, } static int -virAccessDriverPolkitCheckStorageVol(virAccessManagerPtr manager, +virAccessDriverPolkitCheckStorageVol(virAccessManager *manager, const char *driverName, - virStoragePoolDefPtr pool, - virStorageVolDefPtr vol, + virStoragePoolDef *pool, + virStorageVolDef *vol, virAccessPermStorageVol perm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; diff --git a/src/access/viraccessdriverstack.c b/src/access/viraccessdriverstack.c index 0f0858e96e..e6fe285a54 100644 --- a/src/access/viraccessdriverstack.c +++ b/src/access/viraccessdriverstack.c @@ -27,18 +27,16 @@ #define VIR_FROM_THIS VIR_FROM_ACCESS typedef struct _virAccessDriverStackPrivate virAccessDriverStackPrivate; -typedef virAccessDriverStackPrivate *virAccessDriverStackPrivatePtr; - struct _virAccessDriverStackPrivate { - virAccessManagerPtr *managers; + virAccessManager **managers; size_t managersLen; }; -int virAccessDriverStackAppend(virAccessManagerPtr manager, - virAccessManagerPtr child) +int virAccessDriverStackAppend(virAccessManager *manager, + virAccessManager *child) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); VIR_EXPAND_N(priv->managers, priv->managersLen, 1); @@ -48,9 +46,9 @@ int virAccessDriverStackAppend(virAccessManagerPtr manager, } -static void virAccessDriverStackCleanup(virAccessManagerPtr manager) +static void virAccessDriverStackCleanup(virAccessManager *manager) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); size_t i; for (i = 0; i < priv->managersLen; i++) @@ -60,11 +58,11 @@ static void virAccessDriverStackCleanup(virAccessManagerPtr manager) static int -virAccessDriverStackCheckConnect(virAccessManagerPtr manager, +virAccessDriverStackCheckConnect(virAccessManager *manager, const char *driverName, virAccessPermConnect perm) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); int ret = 1; size_t i; @@ -82,12 +80,12 @@ virAccessDriverStackCheckConnect(virAccessManagerPtr manager, } static int -virAccessDriverStackCheckDomain(virAccessManagerPtr manager, +virAccessDriverStackCheckDomain(virAccessManager *manager, const char *driverName, - virDomainDefPtr domain, + virDomainDef *domain, virAccessPermDomain perm) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); int ret = 1; size_t i; @@ -105,12 +103,12 @@ virAccessDriverStackCheckDomain(virAccessManagerPtr manager, } static int -virAccessDriverStackCheckInterface(virAccessManagerPtr manager, +virAccessDriverStackCheckInterface(virAccessManager *manager, const char *driverName, - virInterfaceDefPtr iface, + virInterfaceDef *iface, virAccessPermInterface perm) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); int ret = 1; size_t i; @@ -128,12 +126,12 @@ virAccessDriverStackCheckInterface(virAccessManagerPtr manager, } static int -virAccessDriverStackCheckNetwork(virAccessManagerPtr manager, +virAccessDriverStackCheckNetwork(virAccessManager *manager, const char *driverName, - virNetworkDefPtr network, + virNetworkDef *network, virAccessPermNetwork perm) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); int ret = 1; size_t i; @@ -151,13 +149,13 @@ virAccessDriverStackCheckNetwork(virAccessManagerPtr manager, } static int -virAccessDriverStackCheckNetworkPort(virAccessManagerPtr manager, +virAccessDriverStackCheckNetworkPort(virAccessManager *manager, const char *driverName, - virNetworkDefPtr network, - virNetworkPortDefPtr port, + virNetworkDef *network, + virNetworkPortDef *port, virAccessPermNetworkPort perm) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); int ret = 1; size_t i; @@ -175,12 +173,12 @@ virAccessDriverStackCheckNetworkPort(virAccessManagerPtr manager, } static int -virAccessDriverStackCheckNodeDevice(virAccessManagerPtr manager, +virAccessDriverStackCheckNodeDevice(virAccessManager *manager, const char *driverName, - virNodeDeviceDefPtr nodedev, + virNodeDeviceDef *nodedev, virAccessPermNodeDevice perm) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); int ret = 1; size_t i; @@ -198,12 +196,12 @@ virAccessDriverStackCheckNodeDevice(virAccessManagerPtr manager, } static int -virAccessDriverStackCheckNWFilter(virAccessManagerPtr manager, +virAccessDriverStackCheckNWFilter(virAccessManager *manager, const char *driverName, - virNWFilterDefPtr nwfilter, + virNWFilterDef *nwfilter, virAccessPermNWFilter perm) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); int ret = 1; size_t i; @@ -221,12 +219,12 @@ virAccessDriverStackCheckNWFilter(virAccessManagerPtr manager, } static int -virAccessDriverStackCheckNWFilterBinding(virAccessManagerPtr manager, +virAccessDriverStackCheckNWFilterBinding(virAccessManager *manager, const char *driverName, - virNWFilterBindingDefPtr binding, + virNWFilterBindingDef *binding, virAccessPermNWFilterBinding perm) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); int ret = 1; size_t i; @@ -244,12 +242,12 @@ virAccessDriverStackCheckNWFilterBinding(virAccessManagerPtr manager, } static int -virAccessDriverStackCheckSecret(virAccessManagerPtr manager, +virAccessDriverStackCheckSecret(virAccessManager *manager, const char *driverName, - virSecretDefPtr secret, + virSecretDef *secret, virAccessPermSecret perm) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); int ret = 1; size_t i; @@ -267,12 +265,12 @@ virAccessDriverStackCheckSecret(virAccessManagerPtr manager, } static int -virAccessDriverStackCheckStoragePool(virAccessManagerPtr manager, +virAccessDriverStackCheckStoragePool(virAccessManager *manager, const char *driverName, - virStoragePoolDefPtr pool, + virStoragePoolDef *pool, virAccessPermStoragePool perm) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); int ret = 1; size_t i; @@ -290,13 +288,13 @@ virAccessDriverStackCheckStoragePool(virAccessManagerPtr manager, } static int -virAccessDriverStackCheckStorageVol(virAccessManagerPtr manager, +virAccessDriverStackCheckStorageVol(virAccessManager *manager, const char *driverName, - virStoragePoolDefPtr pool, - virStorageVolDefPtr vol, + virStoragePoolDef *pool, + virStorageVolDef *vol, virAccessPermStorageVol perm) { - virAccessDriverStackPrivatePtr priv = virAccessManagerGetPrivateData(manager); + virAccessDriverStackPrivate *priv = virAccessManagerGetPrivateData(manager); int ret = 1; size_t i; diff --git a/src/access/viraccessdriverstack.h b/src/access/viraccessdriverstack.h index 078da697e8..abcfc30ec3 100644 --- a/src/access/viraccessdriverstack.h +++ b/src/access/viraccessdriverstack.h @@ -23,7 +23,7 @@ #include "access/viraccessdriver.h" -int virAccessDriverStackAppend(virAccessManagerPtr manager, - virAccessManagerPtr child); +int virAccessDriverStackAppend(virAccessManager *manager, + virAccessManager *child); extern virAccessDriver accessDriverStack; diff --git a/src/access/viraccessmanager.c b/src/access/viraccessmanager.c index c81d0840b3..6ce8a31f2f 100644 --- a/src/access/viraccessmanager.c +++ b/src/access/viraccessmanager.c @@ -43,12 +43,12 @@ VIR_LOG_INIT("access.accessmanager"); struct _virAccessManager { virObjectLockable parent; - virAccessDriverPtr drv; + virAccessDriver *drv; void *privateData; }; -static virClassPtr virAccessManagerClass; -static virAccessManagerPtr virAccessManagerDefault; +static virClass *virAccessManagerClass; +static virAccessManager *virAccessManagerDefault; static void virAccessManagerDispose(void *obj); @@ -63,7 +63,7 @@ static int virAccessManagerOnceInit(void) VIR_ONCE_GLOBAL_INIT(virAccessManager); -virAccessManagerPtr virAccessManagerGetDefault(void) +virAccessManager *virAccessManagerGetDefault(void) { if (virAccessManagerDefault == NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -75,7 +75,7 @@ virAccessManagerPtr virAccessManagerGetDefault(void) } -void virAccessManagerSetDefault(virAccessManagerPtr mgr) +void virAccessManagerSetDefault(virAccessManager *mgr) { virObjectUnref(virAccessManagerDefault); @@ -83,9 +83,9 @@ void virAccessManagerSetDefault(virAccessManagerPtr mgr) } -static virAccessManagerPtr virAccessManagerNewDriver(virAccessDriverPtr drv) +static virAccessManager *virAccessManagerNewDriver(virAccessDriver *drv) { - virAccessManagerPtr mgr; + virAccessManager *mgr; char *privateData; if (virAccessManagerInitialize() < 0) @@ -112,7 +112,7 @@ static virAccessManagerPtr virAccessManagerNewDriver(virAccessDriverPtr drv) } -static virAccessDriverPtr accessDrivers[] = { +static virAccessDriver *accessDrivers[] = { &accessDriverNop, #if WITH_POLKIT &accessDriverPolkit, @@ -120,7 +120,7 @@ static virAccessDriverPtr accessDrivers[] = { }; -static virAccessDriverPtr virAccessManagerFindDriver(const char *name) +static virAccessDriver *virAccessManagerFindDriver(const char *name) { size_t i; for (i = 0; i < G_N_ELEMENTS(accessDrivers); i++) { @@ -132,9 +132,9 @@ static virAccessDriverPtr virAccessManagerFindDriver(const char *name) } -virAccessManagerPtr virAccessManagerNew(const char *name) +virAccessManager *virAccessManagerNew(const char *name) { - virAccessDriverPtr drv; + virAccessDriver *drv; if (virAccessManagerInitialize() < 0) return NULL; @@ -150,16 +150,16 @@ virAccessManagerPtr virAccessManagerNew(const char *name) } -virAccessManagerPtr virAccessManagerNewStack(const char **names) +virAccessManager *virAccessManagerNewStack(const char **names) { - virAccessManagerPtr manager = virAccessManagerNewDriver(&accessDriverStack); + virAccessManager *manager = virAccessManagerNewDriver(&accessDriverStack); size_t i; if (!manager) return NULL; for (i = 0; names[i] != NULL; i++) { - virAccessManagerPtr child = virAccessManagerNew(names[i]); + virAccessManager *child = virAccessManagerNew(names[i]); if (!child) goto error; @@ -178,7 +178,7 @@ virAccessManagerPtr virAccessManagerNewStack(const char **names) } -void *virAccessManagerGetPrivateData(virAccessManagerPtr mgr) +void *virAccessManagerGetPrivateData(virAccessManager *mgr) { return mgr->privateData; } @@ -186,7 +186,7 @@ void *virAccessManagerGetPrivateData(virAccessManagerPtr mgr) static void virAccessManagerDispose(void *object) { - virAccessManagerPtr mgr = object; + virAccessManager *mgr = object; if (mgr->drv->cleanup) mgr->drv->cleanup(mgr); @@ -213,7 +213,7 @@ virAccessManagerSanitizeError(int ret, return ret; } -int virAccessManagerCheckConnect(virAccessManagerPtr manager, +int virAccessManagerCheckConnect(virAccessManager *manager, const char *driverName, virAccessPermConnect perm) { @@ -228,9 +228,9 @@ int virAccessManagerCheckConnect(virAccessManagerPtr manager, } -int virAccessManagerCheckDomain(virAccessManagerPtr manager, +int virAccessManagerCheckDomain(virAccessManager *manager, const char *driverName, - virDomainDefPtr domain, + virDomainDef *domain, virAccessPermDomain perm) { int ret = 0; @@ -243,9 +243,9 @@ int virAccessManagerCheckDomain(virAccessManagerPtr manager, return virAccessManagerSanitizeError(ret, driverName); } -int virAccessManagerCheckInterface(virAccessManagerPtr manager, +int virAccessManagerCheckInterface(virAccessManager *manager, const char *driverName, - virInterfaceDefPtr iface, + virInterfaceDef *iface, virAccessPermInterface perm) { int ret = 0; @@ -258,9 +258,9 @@ int virAccessManagerCheckInterface(virAccessManagerPtr manager, return virAccessManagerSanitizeError(ret, driverName); } -int virAccessManagerCheckNetwork(virAccessManagerPtr manager, +int virAccessManagerCheckNetwork(virAccessManager *manager, const char *driverName, - virNetworkDefPtr network, + virNetworkDef *network, virAccessPermNetwork perm) { int ret = 0; @@ -273,10 +273,10 @@ int virAccessManagerCheckNetwork(virAccessManagerPtr manager, return virAccessManagerSanitizeError(ret, driverName); } -int virAccessManagerCheckNetworkPort(virAccessManagerPtr manager, +int virAccessManagerCheckNetworkPort(virAccessManager *manager, const char *driverName, - virNetworkDefPtr network, - virNetworkPortDefPtr port, + virNetworkDef *network, + virNetworkPortDef *port, virAccessPermNetworkPort perm) { int ret = 0; @@ -289,9 +289,9 @@ int virAccessManagerCheckNetworkPort(virAccessManagerPtr manager, return virAccessManagerSanitizeError(ret, driverName); } -int virAccessManagerCheckNodeDevice(virAccessManagerPtr manager, +int virAccessManagerCheckNodeDevice(virAccessManager *manager, const char *driverName, - virNodeDeviceDefPtr nodedev, + virNodeDeviceDef *nodedev, virAccessPermNodeDevice perm) { int ret = 0; @@ -304,9 +304,9 @@ int virAccessManagerCheckNodeDevice(virAccessManagerPtr manager, return virAccessManagerSanitizeError(ret, driverName); } -int virAccessManagerCheckNWFilter(virAccessManagerPtr manager, +int virAccessManagerCheckNWFilter(virAccessManager *manager, const char *driverName, - virNWFilterDefPtr nwfilter, + virNWFilterDef *nwfilter, virAccessPermNWFilter perm) { int ret = 0; @@ -319,9 +319,9 @@ int virAccessManagerCheckNWFilter(virAccessManagerPtr manager, return virAccessManagerSanitizeError(ret, driverName); } -int virAccessManagerCheckNWFilterBinding(virAccessManagerPtr manager, +int virAccessManagerCheckNWFilterBinding(virAccessManager *manager, const char *driverName, - virNWFilterBindingDefPtr binding, + virNWFilterBindingDef *binding, virAccessPermNWFilterBinding perm) { int ret = 0; @@ -334,9 +334,9 @@ int virAccessManagerCheckNWFilterBinding(virAccessManagerPtr manager, return virAccessManagerSanitizeError(ret, driverName); } -int virAccessManagerCheckSecret(virAccessManagerPtr manager, +int virAccessManagerCheckSecret(virAccessManager *manager, const char *driverName, - virSecretDefPtr secret, + virSecretDef *secret, virAccessPermSecret perm) { int ret = 0; @@ -349,9 +349,9 @@ int virAccessManagerCheckSecret(virAccessManagerPtr manager, return virAccessManagerSanitizeError(ret, driverName); } -int virAccessManagerCheckStoragePool(virAccessManagerPtr manager, +int virAccessManagerCheckStoragePool(virAccessManager *manager, const char *driverName, - virStoragePoolDefPtr pool, + virStoragePoolDef *pool, virAccessPermStoragePool perm) { int ret = 0; @@ -364,10 +364,10 @@ int virAccessManagerCheckStoragePool(virAccessManagerPtr manager, return virAccessManagerSanitizeError(ret, driverName); } -int virAccessManagerCheckStorageVol(virAccessManagerPtr manager, +int virAccessManagerCheckStorageVol(virAccessManager *manager, const char *driverName, - virStoragePoolDefPtr pool, - virStorageVolDefPtr vol, + virStoragePoolDef *pool, + virStorageVolDef *vol, virAccessPermStorageVol perm) { int ret = 0; diff --git a/src/access/viraccessmanager.h b/src/access/viraccessmanager.h index 2c02db4bf2..9e3da355da 100644 --- a/src/access/viraccessmanager.h +++ b/src/access/viraccessmanager.h @@ -33,16 +33,15 @@ #include "access/viraccessperm.h" typedef struct _virAccessManager virAccessManager; -typedef virAccessManager *virAccessManagerPtr; -virAccessManagerPtr virAccessManagerGetDefault(void); -void virAccessManagerSetDefault(virAccessManagerPtr manager); +virAccessManager *virAccessManagerGetDefault(void); +void virAccessManagerSetDefault(virAccessManager *manager); -virAccessManagerPtr virAccessManagerNew(const char *name); -virAccessManagerPtr virAccessManagerNewStack(const char **names); +virAccessManager *virAccessManagerNew(const char *name); +virAccessManager *virAccessManagerNewStack(const char **names); -void *virAccessManagerGetPrivateData(virAccessManagerPtr manager); +void *virAccessManagerGetPrivateData(virAccessManager *manager); /* @@ -51,48 +50,48 @@ void *virAccessManagerGetPrivateData(virAccessManagerPtr manager); * Return 0 on auth deny * Return 1 on auth allow */ -int virAccessManagerCheckConnect(virAccessManagerPtr manager, +int virAccessManagerCheckConnect(virAccessManager *manager, const char *driverName, virAccessPermConnect perm); -int virAccessManagerCheckDomain(virAccessManagerPtr manager, +int virAccessManagerCheckDomain(virAccessManager *manager, const char *driverName, - virDomainDefPtr domain, + virDomainDef *domain, virAccessPermDomain perm); -int virAccessManagerCheckInterface(virAccessManagerPtr manager, +int virAccessManagerCheckInterface(virAccessManager *manager, const char *driverName, - virInterfaceDefPtr iface, + virInterfaceDef *iface, virAccessPermInterface perm); -int virAccessManagerCheckNetwork(virAccessManagerPtr manager, +int virAccessManagerCheckNetwork(virAccessManager *manager, const char *driverName, - virNetworkDefPtr network, + virNetworkDef *network, virAccessPermNetwork perm); -int virAccessManagerCheckNetworkPort(virAccessManagerPtr manager, +int virAccessManagerCheckNetworkPort(virAccessManager *manager, const char *driverName, - virNetworkDefPtr network, - virNetworkPortDefPtr port, + virNetworkDef *network, + virNetworkPortDef *port, virAccessPermNetworkPort perm); -int virAccessManagerCheckNodeDevice(virAccessManagerPtr manager, +int virAccessManagerCheckNodeDevice(virAccessManager *manager, const char *driverName, - virNodeDeviceDefPtr nodedev, + virNodeDeviceDef *nodedev, virAccessPermNodeDevice perm); -int virAccessManagerCheckNWFilter(virAccessManagerPtr manager, +int virAccessManagerCheckNWFilter(virAccessManager *manager, const char *driverName, - virNWFilterDefPtr nwfilter, + virNWFilterDef *nwfilter, virAccessPermNWFilter perm); -int virAccessManagerCheckNWFilterBinding(virAccessManagerPtr manager, +int virAccessManagerCheckNWFilterBinding(virAccessManager *manager, const char *driverName, - virNWFilterBindingDefPtr binding, + virNWFilterBindingDef *binding, virAccessPermNWFilterBinding perm); -int virAccessManagerCheckSecret(virAccessManagerPtr manager, +int virAccessManagerCheckSecret(virAccessManager *manager, const char *driverName, - virSecretDefPtr secret, + virSecretDef *secret, virAccessPermSecret perm); -int virAccessManagerCheckStoragePool(virAccessManagerPtr manager, +int virAccessManagerCheckStoragePool(virAccessManager *manager, const char *driverName, - virStoragePoolDefPtr pool, + virStoragePoolDef *pool, virAccessPermStoragePool perm); -int virAccessManagerCheckStorageVol(virAccessManagerPtr manager, +int virAccessManagerCheckStorageVol(virAccessManager *manager, const char *driverName, - virStoragePoolDefPtr pool, - virStorageVolDefPtr vol, + virStoragePoolDef *pool, + virStorageVolDef *vol, virAccessPermStorageVol perm); diff --git a/src/admin/admin_remote.c b/src/admin/admin_remote.c index ca5e0c9fe4..55ac81c5de 100644 --- a/src/admin/admin_remote.c +++ b/src/admin/admin_remote.c @@ -24,22 +24,20 @@ #include "admin_protocol.h" typedef struct _remoteAdminPriv remoteAdminPriv; -typedef remoteAdminPriv *remoteAdminPrivPtr; - struct _remoteAdminPriv { virObjectLockable parent; int counter; - virNetClientPtr client; - virNetClientProgramPtr program; + virNetClient *client; + virNetClientProgram *program; }; -static virClassPtr remoteAdminPrivClass; +static virClass *remoteAdminPrivClass; static void remoteAdminPrivDispose(void *opaque) { - remoteAdminPrivPtr priv = opaque; + remoteAdminPriv *priv = opaque; virObjectUnref(priv->program); virObjectUnref(priv->client); @@ -77,7 +75,7 @@ make_nonnull_client(admin_nonnull_client *client_dst, static int callFull(virAdmConnectPtr conn G_GNUC_UNUSED, - remoteAdminPrivPtr priv, + remoteAdminPriv *priv, int *fdin, size_t fdinlen, int **fdout, @@ -87,9 +85,9 @@ callFull(virAdmConnectPtr conn G_GNUC_UNUSED, xdrproc_t ret_filter, char *ret) { int rv; - virNetClientProgramPtr prog = priv->program; + virNetClientProgram *prog = priv->program; int counter = priv->counter++; - virNetClientPtr client = priv->client; + virNetClient *client = priv->client; /* Unlock, so that if we get any async events/stream data * while processing the RPC, we don't deadlock when our @@ -130,11 +128,11 @@ call(virAdmConnectPtr conn, #include "admin_client.h" static void -remoteAdminClientCloseFunc(virNetClientPtr client G_GNUC_UNUSED, +remoteAdminClientCloseFunc(virNetClient *client G_GNUC_UNUSED, int reason, void *opaque) { - virAdmConnectCloseCallbackDataPtr cbdata = opaque; + virAdmConnectCloseCallbackData *cbdata = opaque; virObjectLock(cbdata); @@ -151,7 +149,7 @@ static int remoteAdminConnectOpen(virAdmConnectPtr conn, unsigned int flags) { int rv = -1; - remoteAdminPrivPtr priv = conn->privateData; + remoteAdminPriv *priv = conn->privateData; admin_connect_open_args args; virObjectLock(priv); @@ -186,7 +184,7 @@ static int remoteAdminConnectClose(virAdmConnectPtr conn) { int rv = -1; - remoteAdminPrivPtr priv = conn->privateData; + remoteAdminPriv *priv = conn->privateData; virObjectLock(priv); @@ -216,10 +214,10 @@ remoteAdminPrivFree(void *opaque) virObjectUnref(conn->privateData); } -static remoteAdminPrivPtr +static remoteAdminPriv * remoteAdminPrivNew(const char *sock_path) { - remoteAdminPrivPtr priv = NULL; + remoteAdminPriv *priv = NULL; if (!(priv = virObjectLockableNew(remoteAdminPrivClass))) goto error; @@ -248,7 +246,7 @@ remoteAdminServerGetThreadPoolParameters(virAdmServerPtr srv, unsigned int flags) { int rv = -1; - remoteAdminPrivPtr priv = srv->conn->privateData; + remoteAdminPriv *priv = srv->conn->privateData; admin_server_get_threadpool_parameters_args args; admin_server_get_threadpool_parameters_ret ret; @@ -263,7 +261,7 @@ remoteAdminServerGetThreadPoolParameters(virAdmServerPtr srv, (xdrproc_t)xdr_admin_server_get_threadpool_parameters_ret, (char *) &ret) == -1) goto cleanup; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, ADMIN_SERVER_THREADPOOL_PARAMETERS_MAX, params, @@ -285,7 +283,7 @@ remoteAdminServerSetThreadPoolParameters(virAdmServerPtr srv, unsigned int flags) { int rv = -1; - remoteAdminPrivPtr priv = srv->conn->privateData; + remoteAdminPriv *priv = srv->conn->privateData; admin_server_set_threadpool_parameters_args args; args.flags = flags; @@ -295,7 +293,7 @@ remoteAdminServerSetThreadPoolParameters(virAdmServerPtr srv, if (virTypedParamsSerialize(params, nparams, ADMIN_SERVER_THREADPOOL_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &args.params.params_val, + (struct _virTypedParameterRemote **) &args.params.params_val, &args.params.params_len, 0) < 0) goto cleanup; @@ -308,7 +306,7 @@ remoteAdminServerSetThreadPoolParameters(virAdmServerPtr srv, rv = 0; cleanup: - virTypedParamsRemoteFree((virTypedParameterRemotePtr) args.params.params_val, + virTypedParamsRemoteFree((struct _virTypedParameterRemote *) args.params.params_val, args.params.params_len); virObjectUnlock(priv); return rv; @@ -321,7 +319,7 @@ remoteAdminClientGetInfo(virAdmClientPtr client, unsigned int flags) { int rv = -1; - remoteAdminPrivPtr priv = client->srv->conn->privateData; + remoteAdminPriv *priv = client->srv->conn->privateData; admin_client_get_info_args args; admin_client_get_info_ret ret; @@ -336,7 +334,7 @@ remoteAdminClientGetInfo(virAdmClientPtr client, (xdrproc_t)xdr_admin_client_get_info_ret, (char *) &ret) == -1) goto cleanup; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, ADMIN_CLIENT_INFO_PARAMETERS_MAX, params, @@ -360,7 +358,7 @@ remoteAdminServerGetClientLimits(virAdmServerPtr srv, int rv = -1; admin_server_get_client_limits_args args; admin_server_get_client_limits_ret ret; - remoteAdminPrivPtr priv = srv->conn->privateData; + remoteAdminPriv *priv = srv->conn->privateData; args.flags = flags; make_nonnull_server(&args.srv, srv); @@ -374,7 +372,7 @@ remoteAdminServerGetClientLimits(virAdmServerPtr srv, (char *) &ret) == -1) goto cleanup; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, ADMIN_SERVER_CLIENT_LIMITS_MAX, params, @@ -398,7 +396,7 @@ remoteAdminServerSetClientLimits(virAdmServerPtr srv, { int rv = -1; admin_server_set_client_limits_args args; - remoteAdminPrivPtr priv = srv->conn->privateData; + remoteAdminPriv *priv = srv->conn->privateData; args.flags = flags; make_nonnull_server(&args.srv, srv); @@ -407,7 +405,7 @@ remoteAdminServerSetClientLimits(virAdmServerPtr srv, if (virTypedParamsSerialize(params, nparams, ADMIN_SERVER_CLIENT_LIMITS_MAX, - (virTypedParameterRemotePtr *) &args.params.params_val, + (struct _virTypedParameterRemote **) &args.params.params_val, &args.params.params_len, 0) < 0) goto cleanup; @@ -420,7 +418,7 @@ remoteAdminServerSetClientLimits(virAdmServerPtr srv, rv = 0; cleanup: - virTypedParamsRemoteFree((virTypedParameterRemotePtr) args.params.params_val, + virTypedParamsRemoteFree((struct _virTypedParameterRemote *) args.params.params_val, args.params.params_len); virObjectUnlock(priv); return rv; @@ -432,7 +430,7 @@ remoteAdminConnectGetLoggingOutputs(virAdmConnectPtr conn, unsigned int flags) { int rv = -1; - remoteAdminPrivPtr priv = conn->privateData; + remoteAdminPriv *priv = conn->privateData; admin_connect_get_logging_outputs_args args; admin_connect_get_logging_outputs_ret ret; @@ -467,7 +465,7 @@ remoteAdminConnectGetLoggingFilters(virAdmConnectPtr conn, unsigned int flags) { int rv = -1; - remoteAdminPrivPtr priv = conn->privateData; + remoteAdminPriv *priv = conn->privateData; admin_connect_get_logging_filters_args args; admin_connect_get_logging_filters_ret ret; diff --git a/src/admin/admin_server.c b/src/admin/admin_server.c index 7d1a21a678..623c682b2d 100644 --- a/src/admin/admin_server.c +++ b/src/admin/admin_server.c @@ -37,12 +37,12 @@ VIR_LOG_INIT("daemon.admin_server"); int -adminConnectListServers(virNetDaemonPtr dmn, - virNetServerPtr **servers, +adminConnectListServers(virNetDaemon *dmn, + virNetServer ***servers, unsigned int flags) { int ret = -1; - virNetServerPtr *srvs = NULL; + virNetServer **srvs = NULL; virCheckFlags(0, -1); @@ -58,8 +58,8 @@ adminConnectListServers(virNetDaemonPtr dmn, return ret; } -virNetServerPtr -adminConnectLookupServer(virNetDaemonPtr dmn, +virNetServer * +adminConnectLookupServer(virNetDaemon *dmn, const char *name, unsigned int flags) { @@ -69,7 +69,7 @@ adminConnectLookupServer(virNetDaemonPtr dmn, } int -adminServerGetThreadPoolParameters(virNetServerPtr srv, +adminServerGetThreadPoolParameters(virNetServer *srv, virTypedParameterPtr *params, int *nparams, unsigned int flags) @@ -123,7 +123,7 @@ adminServerGetThreadPoolParameters(virNetServerPtr srv, } int -adminServerSetThreadPoolParameters(virNetServerPtr srv, +adminServerSetThreadPoolParameters(virNetServer *srv, virTypedParameterPtr params, int nparams, unsigned int flags) @@ -165,12 +165,12 @@ adminServerSetThreadPoolParameters(virNetServerPtr srv, } int -adminServerListClients(virNetServerPtr srv, - virNetServerClientPtr **clients, +adminServerListClients(virNetServer *srv, + virNetServerClient ***clients, unsigned int flags) { int ret = -1; - virNetServerClientPtr *clts; + virNetServerClient **clts; virCheckFlags(0, -1); @@ -185,8 +185,8 @@ adminServerListClients(virNetServerPtr srv, return ret; } -virNetServerClientPtr -adminServerLookupClient(virNetServerPtr srv, +virNetServerClient * +adminServerLookupClient(virNetServer *srv, unsigned long long id, unsigned int flags) { @@ -196,7 +196,7 @@ adminServerLookupClient(virNetServerPtr srv, } int -adminClientGetInfo(virNetServerClientPtr client, +adminClientGetInfo(virNetServerClient *client, virTypedParameterPtr *params, int *nparams, unsigned int flags) @@ -287,7 +287,7 @@ adminClientGetInfo(virNetServerClientPtr client, return 0; } -int adminClientClose(virNetServerClientPtr client, +int adminClientClose(virNetServerClient *client, unsigned int flags) { virCheckFlags(0, -1); @@ -297,7 +297,7 @@ int adminClientClose(virNetServerClientPtr client, } int -adminServerGetClientLimits(virNetServerPtr srv, +adminServerGetClientLimits(virNetServer *srv, virTypedParameterPtr *params, int *nparams, unsigned int flags) @@ -332,7 +332,7 @@ adminServerGetClientLimits(virNetServerPtr srv, } int -adminServerSetClientLimits(virNetServerPtr srv, +adminServerSetClientLimits(virNetServer *srv, virTypedParameterPtr params, int nparams, unsigned int flags) @@ -367,7 +367,7 @@ adminServerSetClientLimits(virNetServerPtr srv, } int -adminServerUpdateTlsFiles(virNetServerPtr srv, +adminServerUpdateTlsFiles(virNetServer *srv, unsigned int flags) { virCheckFlags(0, -1); diff --git a/src/admin/admin_server.h b/src/admin/admin_server.h index 08877a8edc..1c077af63b 100644 --- a/src/admin/admin_server.h +++ b/src/admin/admin_server.h @@ -23,50 +23,50 @@ #include "rpc/virnetdaemon.h" #include "rpc/virnetserver.h" -int adminConnectListServers(virNetDaemonPtr dmn, - virNetServerPtr **servers, +int adminConnectListServers(virNetDaemon *dmn, + virNetServer ***servers, unsigned int flags); -virNetServerPtr adminConnectLookupServer(virNetDaemonPtr dmn, +virNetServer *adminConnectLookupServer(virNetDaemon *dmn, const char *name, unsigned int flags); int -adminServerGetThreadPoolParameters(virNetServerPtr srv, +adminServerGetThreadPoolParameters(virNetServer *srv, virTypedParameterPtr *params, int *nparams, unsigned int flags); int -adminServerSetThreadPoolParameters(virNetServerPtr srv, +adminServerSetThreadPoolParameters(virNetServer *srv, virTypedParameterPtr params, int nparams, unsigned int flags); -int adminServerListClients(virNetServerPtr srv, - virNetServerClientPtr **clients, +int adminServerListClients(virNetServer *srv, + virNetServerClient ***clients, unsigned int flags); -virNetServerClientPtr adminServerLookupClient(virNetServerPtr srv, +virNetServerClient *adminServerLookupClient(virNetServer *srv, unsigned long long id, unsigned int flags); -int adminClientGetInfo(virNetServerClientPtr client, +int adminClientGetInfo(virNetServerClient *client, virTypedParameterPtr *params, int *nparams, unsigned int flags); -int adminClientClose(virNetServerClientPtr client, +int adminClientClose(virNetServerClient *client, unsigned int flags); -int adminServerGetClientLimits(virNetServerPtr srv, +int adminServerGetClientLimits(virNetServer *srv, virTypedParameterPtr *params, int *nparams, unsigned int flags); -int adminServerSetClientLimits(virNetServerPtr srv, +int adminServerSetClientLimits(virNetServer *srv, virTypedParameterPtr params, int nparams, unsigned int flags); -int adminServerUpdateTlsFiles(virNetServerPtr srv, +int adminServerUpdateTlsFiles(virNetServer *srv, unsigned int flags); diff --git a/src/admin/admin_server_dispatch.c b/src/admin/admin_server_dispatch.c index 57e8904f4c..f533fcf539 100644 --- a/src/admin/admin_server_dispatch.c +++ b/src/admin/admin_server_dispatch.c @@ -41,13 +41,12 @@ VIR_LOG_INIT("daemon.admin"); typedef struct daemonAdmClientPrivate daemonAdmClientPrivate; -typedef daemonAdmClientPrivate *daemonAdmClientPrivatePtr; /* Separate private data for admin connection */ struct daemonAdmClientPrivate { /* Just a placeholder, not that there is anything to be locked */ virMutex lock; - virNetDaemonPtr dmn; + virNetDaemon *dmn; }; void @@ -61,7 +60,7 @@ remoteAdmClientFree(void *data) } void * -remoteAdmClientNew(virNetServerClientPtr client G_GNUC_UNUSED, +remoteAdmClientNew(virNetServerClient *client G_GNUC_UNUSED, void *opaque) { struct daemonAdmClientPrivate *priv; @@ -106,17 +105,17 @@ remoteAdmClientNew(virNetServerClientPtr client G_GNUC_UNUSED, return priv; } -void *remoteAdmClientNewPostExecRestart(virNetServerClientPtr client, - virJSONValuePtr object G_GNUC_UNUSED, +void *remoteAdmClientNewPostExecRestart(virNetServerClient *client, + virJSONValue *object G_GNUC_UNUSED, void *opaque) { return remoteAdmClientNew(client, opaque); } -virJSONValuePtr remoteAdmClientPreExecRestart(virNetServerClientPtr client G_GNUC_UNUSED, - void *data G_GNUC_UNUSED) +virJSONValue *remoteAdmClientPreExecRestart(virNetServerClient *client G_GNUC_UNUSED, + void *data G_GNUC_UNUSED) { - virJSONValuePtr object = virJSONValueNewObject(); + virJSONValue *object = virJSONValueNewObject(); /* No content to add at this time - just need empty object */ @@ -126,28 +125,28 @@ virJSONValuePtr remoteAdmClientPreExecRestart(virNetServerClientPtr client G_GNU /* Helpers */ -static virNetServerPtr -get_nonnull_server(virNetDaemonPtr dmn, admin_nonnull_server srv) +static virNetServer * +get_nonnull_server(virNetDaemon *dmn, admin_nonnull_server srv) { return virNetDaemonGetServer(dmn, srv.name); } static void make_nonnull_server(admin_nonnull_server *srv_dst, - virNetServerPtr srv_src) + virNetServer *srv_src) { srv_dst->name = g_strdup(virNetServerGetName(srv_src)); } -static virNetServerClientPtr -get_nonnull_client(virNetServerPtr srv, admin_nonnull_client clnt) +static virNetServerClient * +get_nonnull_client(virNetServer *srv, admin_nonnull_client clnt) { return virNetServerGetClient(srv, clnt.id); } static void make_nonnull_client(admin_nonnull_client *clt_dst, - virNetServerClientPtr clt_src) + virNetServerClient *clt_src) { clt_dst->id = virNetServerClientGetID(clt_src); clt_dst->timestamp = virNetServerClientGetTimestamp(clt_src); @@ -156,10 +155,10 @@ make_nonnull_client(admin_nonnull_client *clt_dst, /* Functions */ static int -adminDispatchConnectOpen(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +adminDispatchConnectOpen(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, struct admin_connect_open_args *args) { unsigned int flags; @@ -182,17 +181,17 @@ adminDispatchConnectOpen(virNetServerPtr server G_GNUC_UNUSED, } static int -adminDispatchConnectClose(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED) +adminDispatchConnectClose(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED) { virNetServerClientDelayedClose(client); return 0; } static int -adminConnectGetLibVersion(virNetDaemonPtr dmn G_GNUC_UNUSED, +adminConnectGetLibVersion(virNetDaemon *dmn G_GNUC_UNUSED, unsigned long long *libVer) { if (libVer) @@ -200,8 +199,8 @@ adminConnectGetLibVersion(virNetDaemonPtr dmn G_GNUC_UNUSED, return 0; } -static virNetDaemonPtr -adminGetConn(virNetServerClientPtr client) +static virNetDaemon * +adminGetConn(virNetServerClient *client) { struct daemonAdmClientPrivate *priv = virNetServerClientGetPrivateData(client); @@ -210,15 +209,15 @@ adminGetConn(virNetServerClientPtr client) } static int -adminDispatchServerGetThreadpoolParameters(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +adminDispatchServerGetThreadpoolParameters(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, struct admin_server_get_threadpool_parameters_args *args, struct admin_server_get_threadpool_parameters_ret *ret) { int rv = -1; - virNetServerPtr srv = NULL; + virNetServer *srv = NULL; virTypedParameterPtr params = NULL; int nparams = 0; struct daemonAdmClientPrivate *priv = @@ -233,7 +232,7 @@ adminDispatchServerGetThreadpoolParameters(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, ADMIN_SERVER_THREADPOOL_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, 0) < 0) goto cleanup; @@ -248,14 +247,14 @@ adminDispatchServerGetThreadpoolParameters(virNetServerPtr server G_GNUC_UNUSED, } static int -adminDispatchServerSetThreadpoolParameters(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +adminDispatchServerSetThreadpoolParameters(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, struct admin_server_set_threadpool_parameters_args *args) { int rv = -1; - virNetServerPtr srv = NULL; + virNetServer *srv = NULL; virTypedParameterPtr params = NULL; int nparams = 0; struct daemonAdmClientPrivate *priv = @@ -268,7 +267,7 @@ adminDispatchServerSetThreadpoolParameters(virNetServerPtr server G_GNUC_UNUSED, goto cleanup; } - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) args->params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) args->params.params_val, args->params.params_len, ADMIN_SERVER_THREADPOOL_PARAMETERS_MAX, ¶ms, @@ -291,16 +290,16 @@ adminDispatchServerSetThreadpoolParameters(virNetServerPtr server G_GNUC_UNUSED, } static int -adminDispatchClientGetInfo(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +adminDispatchClientGetInfo(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, struct admin_client_get_info_args *args, struct admin_client_get_info_ret *ret) { int rv = -1; - virNetServerPtr srv = NULL; - virNetServerClientPtr clnt = NULL; + virNetServer *srv = NULL; + virNetServerClient *clnt = NULL; virTypedParameterPtr params = NULL; int nparams = 0; struct daemonAdmClientPrivate *priv = @@ -325,7 +324,7 @@ adminDispatchClientGetInfo(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, ADMIN_CLIENT_INFO_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) goto cleanup; @@ -343,15 +342,15 @@ adminDispatchClientGetInfo(virNetServerPtr server G_GNUC_UNUSED, } static int -adminDispatchServerGetClientLimits(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +adminDispatchServerGetClientLimits(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, admin_server_get_client_limits_args *args, admin_server_get_client_limits_ret *ret) { int rv = -1; - virNetServerPtr srv = NULL; + virNetServer *srv = NULL; virTypedParameterPtr params = NULL; int nparams = 0; struct daemonAdmClientPrivate *priv = @@ -365,7 +364,7 @@ adminDispatchServerGetClientLimits(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, ADMIN_SERVER_CLIENT_LIMITS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, 0) < 0) goto cleanup; @@ -380,14 +379,14 @@ adminDispatchServerGetClientLimits(virNetServerPtr server G_GNUC_UNUSED, } static int -adminDispatchServerSetClientLimits(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +adminDispatchServerSetClientLimits(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, admin_server_set_client_limits_args *args) { int rv = -1; - virNetServerPtr srv = NULL; + virNetServer *srv = NULL; virTypedParameterPtr params = NULL; int nparams = 0; struct daemonAdmClientPrivate *priv = @@ -400,7 +399,7 @@ adminDispatchServerSetClientLimits(virNetServerPtr server G_GNUC_UNUSED, goto cleanup; } - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) args->params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) args->params.params_val, args->params.params_len, ADMIN_SERVER_CLIENT_LIMITS_MAX, ¶ms, &nparams) < 0) goto cleanup; @@ -449,7 +448,7 @@ adminConnectGetLoggingFilters(char **filters, unsigned int flags) } static int -adminConnectSetLoggingOutputs(virNetDaemonPtr dmn G_GNUC_UNUSED, +adminConnectSetLoggingOutputs(virNetDaemon *dmn G_GNUC_UNUSED, const char *outputs, unsigned int flags) { @@ -459,7 +458,7 @@ adminConnectSetLoggingOutputs(virNetDaemonPtr dmn G_GNUC_UNUSED, } static int -adminConnectSetLoggingFilters(virNetDaemonPtr dmn G_GNUC_UNUSED, +adminConnectSetLoggingFilters(virNetDaemon *dmn G_GNUC_UNUSED, const char *filters, unsigned int flags) { @@ -469,10 +468,10 @@ adminConnectSetLoggingFilters(virNetDaemonPtr dmn G_GNUC_UNUSED, } static int -adminDispatchConnectGetLoggingOutputs(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client G_GNUC_UNUSED, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +adminDispatchConnectGetLoggingOutputs(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client G_GNUC_UNUSED, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, admin_connect_get_logging_outputs_args *args, admin_connect_get_logging_outputs_ret *ret) { @@ -491,10 +490,10 @@ adminDispatchConnectGetLoggingOutputs(virNetServerPtr server G_GNUC_UNUSED, } static int -adminDispatchConnectGetLoggingFilters(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client G_GNUC_UNUSED, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +adminDispatchConnectGetLoggingFilters(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client G_GNUC_UNUSED, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, admin_connect_get_logging_filters_args *args, admin_connect_get_logging_filters_ret *ret) { diff --git a/src/admin/admin_server_dispatch.h b/src/admin/admin_server_dispatch.h index f39757a13a..12e30b5f90 100644 --- a/src/admin/admin_server_dispatch.h +++ b/src/admin/admin_server_dispatch.h @@ -29,9 +29,9 @@ extern virNetServerProgramProc adminProcs[]; extern size_t adminNProcs; void remoteAdmClientFree(void *data); -void *remoteAdmClientNew(virNetServerClientPtr client, void *opaque); -void *remoteAdmClientNewPostExecRestart(virNetServerClientPtr client, - virJSONValuePtr object, +void *remoteAdmClientNew(virNetServerClient *client, void *opaque); +void *remoteAdmClientNewPostExecRestart(virNetServerClient *client, + virJSONValue *object, void *opaque); -virJSONValuePtr remoteAdmClientPreExecRestart(virNetServerClientPtr client, +virJSONValue *remoteAdmClientPreExecRestart(virNetServerClient *client, void *data); diff --git a/src/admin/libvirt-admin.c b/src/admin/libvirt-admin.c index ad70d4f108..a3164a2395 100644 --- a/src/admin/libvirt-admin.c +++ b/src/admin/libvirt-admin.c @@ -97,7 +97,7 @@ virAdmInitialize(void) } static char * -getSocketPath(virURIPtr uri) +getSocketPath(virURI *uri) { g_autofree char *rundir = virGetUserRuntimeDirectory(); g_autofree char *sock_path = NULL; @@ -108,7 +108,7 @@ getSocketPath(virURIPtr uri) for (i = 0; i < uri->paramsCount; i++) { - virURIParamPtr param = &uri->params[i]; + virURIParam *param = &uri->params[i]; if (STREQ(param->name, "socket")) { g_free(sock_path); @@ -160,7 +160,7 @@ getSocketPath(virURIPtr uri) } static int -virAdmGetDefaultURI(virConfPtr conf, char **uristr) +virAdmGetDefaultURI(virConf *conf, char **uristr) { const char *defname = getenv("LIBVIRT_ADMIN_DEFAULT_URI"); if (defname && *defname) { @@ -381,7 +381,7 @@ int virAdmConnectIsAlive(virAdmConnectPtr conn) { bool ret; - remoteAdminPrivPtr priv = NULL; + remoteAdminPriv *priv = NULL; VIR_DEBUG("conn=%p", conn); diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c index efd6a59aec..1c563c32e5 100644 --- a/src/bhyve/bhyve_capabilities.c +++ b/src/bhyve/bhyve_capabilities.c @@ -40,11 +40,11 @@ VIR_LOG_INIT("bhyve.bhyve_capabilities"); -virCapsPtr +virCaps * virBhyveCapsBuild(void) { - virCapsPtr caps; - virCapsGuestPtr guest; + virCaps *caps; + virCapsGuest *guest; if ((caps = virCapabilitiesNew(virArchFromHost(), false, false)) == NULL) @@ -71,9 +71,9 @@ virBhyveCapsBuild(void) } int -virBhyveDomainCapsFill(virDomainCapsPtr caps, +virBhyveDomainCapsFill(virDomainCaps *caps, unsigned int bhyvecaps, - virDomainCapsStringValuesPtr firmwares) + virDomainCapsStringValues *firmwares) { caps->disk.supported = VIR_TRISTATE_BOOL_YES; caps->disk.diskDevice.report = true; @@ -125,21 +125,21 @@ virBhyveDomainCapsFill(virDomainCapsPtr caps, } -virDomainCapsPtr -virBhyveDomainCapsBuild(bhyveConnPtr conn, +virDomainCaps * +virBhyveDomainCapsBuild(struct _bhyveConn *conn, const char *emulatorbin, const char *machine, virArch arch, virDomainVirtType virttype) { - virDomainCapsPtr caps = NULL; + virDomainCaps *caps = NULL; unsigned int bhyve_caps = 0; g_autoptr(DIR) dir = NULL; struct dirent *entry; size_t firmwares_alloc = 0; - virBhyveDriverConfigPtr cfg = virBhyveDriverGetConfig(conn); + struct _virBhyveDriverConfig *cfg = virBhyveDriverGetConfig(conn); const char *firmware_dir = cfg->firmwareDir; - virDomainCapsStringValuesPtr firmwares = NULL; + virDomainCapsStringValues *firmwares = NULL; if (!(caps = virDomainCapsNew(emulatorbin, machine, arch, virttype))) goto cleanup; @@ -176,7 +176,7 @@ int virBhyveProbeGrubCaps(virBhyveGrubCapsFlags *caps) { char *binary, *help; - virCommandPtr cmd; + virCommand *cmd; int ret, exit; ret = 0; @@ -215,7 +215,7 @@ bhyveProbeCapsDeviceHelper(unsigned int *caps, unsigned int flag) { char *error; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; int ret = -1, exit; cmd = virCommandNew(binary); @@ -238,7 +238,7 @@ static int bhyveProbeCapsFromHelp(unsigned int *caps, char *binary) { char *help; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; int ret = 0, exit; cmd = virCommandNew(binary); diff --git a/src/bhyve/bhyve_capabilities.h b/src/bhyve/bhyve_capabilities.h index 1b25c000b5..582eae083d 100644 --- a/src/bhyve/bhyve_capabilities.h +++ b/src/bhyve/bhyve_capabilities.h @@ -26,15 +26,15 @@ #include "bhyve_utils.h" -virCapsPtr virBhyveCapsBuild(void); -int virBhyveDomainCapsFill(virDomainCapsPtr caps, +virCaps *virBhyveCapsBuild(void); +int virBhyveDomainCapsFill(virDomainCaps *caps, unsigned int bhyvecaps, - virDomainCapsStringValuesPtr firmwares); -virDomainCapsPtr virBhyveDomainCapsBuild(bhyveConnPtr, - const char *emulatorbin, - const char *machine, - virArch arch, - virDomainVirtType virttype); + virDomainCapsStringValues *firmwares); +virDomainCaps *virBhyveDomainCapsBuild(bhyveConn *conn, + const char *emulatorbin, + const char *machine, + virArch arch, + virDomainVirtType virttype); /* These are bit flags: */ typedef enum { diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index e3c2921dea..b1558132e1 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -41,9 +41,9 @@ VIR_LOG_INIT("bhyve.bhyve_command"); static int bhyveBuildNetArgStr(const virDomainDef *def, - virDomainNetDefPtr net, - bhyveConnPtr driver, - virCommandPtr cmd, + virDomainNetDef *net, + struct _bhyveConn *driver, + virCommand *cmd, bool dryRun) { char macaddr[VIR_MAC_STRING_BUFLEN]; @@ -124,9 +124,9 @@ bhyveBuildNetArgStr(const virDomainDef *def, } static int -bhyveBuildConsoleArgStr(const virDomainDef *def, virCommandPtr cmd) +bhyveBuildConsoleArgStr(const virDomainDef *def, virCommand *cmd) { - virDomainChrDefPtr chr = NULL; + virDomainChrDef *chr = NULL; if (!def->nserials) return 0; @@ -155,9 +155,9 @@ bhyveBuildConsoleArgStr(const virDomainDef *def, virCommandPtr cmd) static int bhyveBuildAHCIControllerArgStr(const virDomainDef *def, - virDomainControllerDefPtr controller, - bhyveConnPtr driver, - virCommandPtr cmd) + virDomainControllerDef *controller, + struct _bhyveConn *driver, + virCommand *cmd) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char *disk_source; @@ -165,7 +165,7 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def, for (i = 0; i < def->ndisks; i++) { g_auto(virBuffer) device = VIR_BUFFER_INITIALIZER; - virDomainDiskDefPtr disk = def->disks[i]; + virDomainDiskDef *disk = def->disks[i]; if (disk->bus != VIR_DOMAIN_DISK_BUS_SATA) continue; @@ -226,14 +226,14 @@ bhyveBuildAHCIControllerArgStr(const virDomainDef *def, static int bhyveBuildUSBControllerArgStr(const virDomainDef *def, - virDomainControllerDefPtr controller, - virCommandPtr cmd) + virDomainControllerDef *controller, + virCommand *cmd) { size_t i; int ndevices = 0; for (i = 0; i < def->ninputs; i++) { - virDomainInputDefPtr input = def->inputs[i]; + virDomainInputDef *input = def->inputs[i]; if (input->bus != VIR_DOMAIN_INPUT_BUS_USB) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -265,8 +265,8 @@ bhyveBuildUSBControllerArgStr(const virDomainDef *def, static int bhyveBuildVirtIODiskArgStr(const virDomainDef *def G_GNUC_UNUSED, - virDomainDiskDefPtr disk, - virCommandPtr cmd) + virDomainDiskDef *disk, + virCommand *cmd) { const char *disk_source; @@ -298,8 +298,8 @@ bhyveBuildVirtIODiskArgStr(const virDomainDef *def G_GNUC_UNUSED, static int bhyveBuildDiskArgStr(const virDomainDef *def, - virDomainDiskDefPtr disk, - virCommandPtr cmd) + virDomainDiskDef *disk, + virCommand *cmd) { switch (disk->bus) { case VIR_DOMAIN_DISK_BUS_SATA: @@ -319,9 +319,9 @@ bhyveBuildDiskArgStr(const virDomainDef *def, static int bhyveBuildControllerArgStr(const virDomainDef *def, - virDomainControllerDefPtr controller, - bhyveConnPtr driver, - virCommandPtr cmd, + virDomainControllerDef *controller, + struct _bhyveConn *driver, + virCommand *cmd, unsigned *nusbcontrollers, unsigned *nisacontrollers) { @@ -364,14 +364,14 @@ bhyveBuildControllerArgStr(const virDomainDef *def, static int bhyveBuildGraphicsArgStr(const virDomainDef *def, - virDomainGraphicsDefPtr graphics, - virDomainVideoDefPtr video, - bhyveConnPtr driver, - virCommandPtr cmd, + virDomainGraphicsDef *graphics, + virDomainVideoDef *video, + struct _bhyveConn *driver, + virCommand *cmd, bool dryRun) { g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER; - virDomainGraphicsListenDefPtr glisten = NULL; + virDomainGraphicsListenDef *glisten = NULL; bool escapeAddr; unsigned short port; @@ -487,10 +487,10 @@ bhyveBuildGraphicsArgStr(const virDomainDef *def, static int bhyveBuildSoundArgStr(const virDomainDef *def G_GNUC_UNUSED, - virDomainSoundDefPtr sound, - virDomainAudioDefPtr audio, - bhyveConnPtr driver, - virCommandPtr cmd) + virDomainSoundDef *sound, + virDomainAudioDef *audio, + struct _bhyveConn *driver, + virCommand *cmd) { g_auto(virBuffer) params = VIR_BUFFER_INITIALIZER; @@ -560,8 +560,8 @@ bhyveBuildSoundArgStr(const virDomainDef *def G_GNUC_UNUSED, static int bhyveBuildFSArgStr(const virDomainDef *def G_GNUC_UNUSED, - virDomainFSDefPtr fs, - virCommandPtr cmd) + virDomainFSDef *fs, + virCommand *cmd) { g_auto(virBuffer) params = VIR_BUFFER_INITIALIZER; @@ -625,8 +625,8 @@ bhyveBuildFSArgStr(const virDomainDef *def G_GNUC_UNUSED, return 0; } -virCommandPtr -virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def, +virCommand * +virBhyveProcessBuildBhyveCmd(struct _bhyveConn *driver, virDomainDef *def, bool dryRun) { /* @@ -637,7 +637,7 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def, * -S 31,uart,stdio \ * vm0 */ - virCommandPtr cmd = virCommandNew(BHYVE); + virCommand *cmd = virCommandNew(BHYVE); size_t i; unsigned nusbcontrollers = 0; unsigned nisacontrollers = 0; @@ -786,7 +786,7 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def, goto error; if (def->namespaceData) { - bhyveDomainCmdlineDefPtr bhyvecmd; + bhyveDomainCmdlineDef *bhyvecmd; VIR_WARN("Booting the guest using command line pass-through feature, " "which could potentially cause inconsistent state and " @@ -806,11 +806,11 @@ virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, virDomainDefPtr def, return NULL; } -virCommandPtr -virBhyveProcessBuildDestroyCmd(bhyveConnPtr driver G_GNUC_UNUSED, - virDomainDefPtr def) +virCommand * +virBhyveProcessBuildDestroyCmd(struct _bhyveConn *driver G_GNUC_UNUSED, + virDomainDef *def) { - virCommandPtr cmd = virCommandNew(BHYVECTL); + virCommand *cmd = virCommandNew(BHYVECTL); virCommandAddArg(cmd, "--destroy"); virCommandAddArgPair(cmd, "--vm", def->name); @@ -819,7 +819,7 @@ virBhyveProcessBuildDestroyCmd(bhyveConnPtr driver G_GNUC_UNUSED, } static void -virAppendBootloaderArgs(virCommandPtr cmd, virDomainDefPtr def) +virAppendBootloaderArgs(virCommand *cmd, virDomainDef *def) { char **blargs; @@ -829,10 +829,10 @@ virAppendBootloaderArgs(virCommandPtr cmd, virDomainDefPtr def) g_strfreev(blargs); } -static virCommandPtr -virBhyveProcessBuildBhyveloadCmd(virDomainDefPtr def, virDomainDiskDefPtr disk) +static virCommand * +virBhyveProcessBuildBhyveloadCmd(virDomainDef *def, virDomainDiskDef *disk) { - virCommandPtr cmd; + virCommand *cmd; cmd = virCommandNew(BHYVELOAD); @@ -858,10 +858,10 @@ virBhyveProcessBuildBhyveloadCmd(virDomainDefPtr def, virDomainDiskDefPtr disk) return cmd; } -static virCommandPtr -virBhyveProcessBuildCustomLoaderCmd(virDomainDefPtr def) +static virCommand * +virBhyveProcessBuildCustomLoaderCmd(virDomainDef *def) { - virCommandPtr cmd; + virCommand *cmd; if (def->os.bootloaderArgs == NULL) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -878,7 +878,7 @@ virBhyveProcessBuildCustomLoaderCmd(virDomainDefPtr def) } static bool -virBhyveUsableDisk(virDomainDiskDefPtr disk) +virBhyveUsableDisk(virDomainDiskDef *disk) { if (virDomainDiskTranslateSourcePool(disk) < 0) return false; @@ -901,7 +901,7 @@ virBhyveUsableDisk(virDomainDiskDefPtr disk) } static void -virBhyveFormatGrubDevice(virBufferPtr devicemap, virDomainDiskDefPtr def) +virBhyveFormatGrubDevice(virBuffer *devicemap, virDomainDiskDef *def) { if (def->device == VIR_DOMAIN_DISK_DEVICE_CDROM) virBufferAsprintf(devicemap, "(cd) %s\n", @@ -911,17 +911,17 @@ virBhyveFormatGrubDevice(virBufferPtr devicemap, virDomainDiskDefPtr def) virDomainDiskGetSource(def)); } -static virCommandPtr -virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def, - bhyveConnPtr driver, +static virCommand * +virBhyveProcessBuildGrubbhyveCmd(virDomainDef *def, + struct _bhyveConn *driver, const char *devmap_file, char **devicesmap_out) { - virDomainDiskDefPtr hdd; - virDomainDiskDefPtr cd; - virDomainDiskDefPtr userdef; - virDomainDiskDefPtr diskdef; - virCommandPtr cmd; + virDomainDiskDef *hdd; + virDomainDiskDef *cd; + virDomainDiskDef *userdef; + virDomainDiskDef *diskdef; + virCommand *cmd; unsigned int best_idx = UINT_MAX; size_t i; @@ -1000,7 +1000,7 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def, if ((bhyveDriverGetGrubCaps(driver) & BHYVE_GRUB_CAP_CONSDEV) != 0 && def->nserials > 0) { - virDomainChrDefPtr chr; + virDomainChrDef *chr; chr = def->serials[0]; @@ -1020,11 +1020,11 @@ virBhyveProcessBuildGrubbhyveCmd(virDomainDefPtr def, return cmd; } -static virDomainDiskDefPtr -virBhyveGetBootDisk(virDomainDefPtr def) +static virDomainDiskDef * +virBhyveGetBootDisk(virDomainDef *def) { size_t i; - virDomainDiskDefPtr match = NULL; + virDomainDiskDef *match = NULL; int boot_dev = -1; if (def->ndisks < 1) { @@ -1106,11 +1106,11 @@ virBhyveGetBootDisk(virDomainDefPtr def) return match; } -virCommandPtr -virBhyveProcessBuildLoadCmd(bhyveConnPtr driver, virDomainDefPtr def, +virCommand * +virBhyveProcessBuildLoadCmd(struct _bhyveConn *driver, virDomainDef *def, const char *devmap_file, char **devicesmap_out) { - virDomainDiskDefPtr disk = NULL; + virDomainDiskDef *disk = NULL; if (def->os.bootloader == NULL) { disk = virBhyveGetBootDisk(def); diff --git a/src/bhyve/bhyve_command.h b/src/bhyve/bhyve_command.h index 5a934c4883..45c6a1a57c 100644 --- a/src/bhyve/bhyve_command.h +++ b/src/bhyve/bhyve_command.h @@ -29,14 +29,14 @@ #define BHYVE_CONFIG_FORMAT_ARGV "bhyve-argv" -virCommandPtr virBhyveProcessBuildBhyveCmd(bhyveConnPtr driver, - virDomainDefPtr def, - bool dryRun); +virCommand *virBhyveProcessBuildBhyveCmd(struct _bhyveConn *driver, + virDomainDef *def, + bool dryRun); -virCommandPtr -virBhyveProcessBuildDestroyCmd(bhyveConnPtr driver, - virDomainDefPtr def); +virCommand * +virBhyveProcessBuildDestroyCmd(struct _bhyveConn *driver, + virDomainDef *def); -virCommandPtr -virBhyveProcessBuildLoadCmd(bhyveConnPtr driver, virDomainDefPtr def, +virCommand * +virBhyveProcessBuildLoadCmd(struct _bhyveConn *driver, virDomainDef *def, const char *devmap_file, char **devicesmap_out); diff --git a/src/bhyve/bhyve_conf.c b/src/bhyve/bhyve_conf.c index 0f60aac9a0..5eca0855f0 100644 --- a/src/bhyve/bhyve_conf.c +++ b/src/bhyve/bhyve_conf.c @@ -32,7 +32,7 @@ VIR_LOG_INIT("bhyve.bhyve_conf"); -static virClassPtr virBhyveDriverConfigClass; +static virClass *virBhyveDriverConfigClass; static void virBhyveDriverConfigDispose(void *obj); static int virBhyveConfigOnceInit(void) @@ -45,10 +45,10 @@ static int virBhyveConfigOnceInit(void) VIR_ONCE_GLOBAL_INIT(virBhyveConfig); -virBhyveDriverConfigPtr +struct _virBhyveDriverConfig * virBhyveDriverConfigNew(void) { - virBhyveDriverConfigPtr cfg; + struct _virBhyveDriverConfig *cfg; if (virBhyveConfigInitialize() < 0) return NULL; @@ -62,7 +62,7 @@ virBhyveDriverConfigNew(void) } int -virBhyveLoadDriverConfig(virBhyveDriverConfigPtr cfg, +virBhyveLoadDriverConfig(struct _virBhyveDriverConfig *cfg, const char *filename) { g_autoptr(virConf) conf = NULL; @@ -82,10 +82,10 @@ virBhyveLoadDriverConfig(virBhyveDriverConfigPtr cfg, return 0; } -virBhyveDriverConfigPtr -virBhyveDriverGetConfig(bhyveConnPtr driver) +struct _virBhyveDriverConfig * +virBhyveDriverGetConfig(struct _bhyveConn *driver) { - virBhyveDriverConfigPtr cfg; + struct _virBhyveDriverConfig *cfg; bhyveDriverLock(driver); cfg = virObjectRef(driver->config); bhyveDriverUnlock(driver); @@ -95,13 +95,13 @@ virBhyveDriverGetConfig(bhyveConnPtr driver) static void virBhyveDriverConfigDispose(void *obj) { - virBhyveDriverConfigPtr cfg = obj; + struct _virBhyveDriverConfig *cfg = obj; g_free(cfg->firmwareDir); } void -bhyveDomainCmdlineDefFree(bhyveDomainCmdlineDefPtr def) +bhyveDomainCmdlineDefFree(bhyveDomainCmdlineDef *def) { size_t i; diff --git a/src/bhyve/bhyve_conf.h b/src/bhyve/bhyve_conf.h index 7dee377c76..d895f66bb7 100644 --- a/src/bhyve/bhyve_conf.h +++ b/src/bhyve/bhyve_conf.h @@ -23,16 +23,15 @@ #include "bhyve_utils.h" -virBhyveDriverConfigPtr virBhyveDriverConfigNew(void); -virBhyveDriverConfigPtr virBhyveDriverGetConfig(bhyveConnPtr driver); -int virBhyveLoadDriverConfig(virBhyveDriverConfigPtr cfg, +struct _virBhyveDriverConfig *virBhyveDriverConfigNew(void); +struct _virBhyveDriverConfig *virBhyveDriverGetConfig(struct _bhyveConn *driver); +int virBhyveLoadDriverConfig(struct _virBhyveDriverConfig *cfg, const char *filename); typedef struct _bhyveDomainCmdlineDef bhyveDomainCmdlineDef; -typedef bhyveDomainCmdlineDef *bhyveDomainCmdlineDefPtr; struct _bhyveDomainCmdlineDef { size_t num_args; char **args; }; -void bhyveDomainCmdlineDefFree(bhyveDomainCmdlineDefPtr def); +void bhyveDomainCmdlineDefFree(bhyveDomainCmdlineDef *def); diff --git a/src/bhyve/bhyve_device.c b/src/bhyve/bhyve_device.c index f8c7522d26..36b93c0d4c 100644 --- a/src/bhyve/bhyve_device.c +++ b/src/bhyve/bhyve_device.c @@ -31,16 +31,16 @@ VIR_LOG_INIT("bhyve.bhyve_device"); static int -bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr device G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +bhyveCollectPCIAddress(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *device G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *opaque) { if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) return 0; - virDomainPCIAddressSetPtr addrs = opaque; - virPCIDeviceAddressPtr addr = &info->addr.pci; + virDomainPCIAddressSet *addrs = opaque; + virPCIDeviceAddress *addr = &info->addr.pci; if (addr->domain == 0 && addr->bus == 0 && addr->slot == 0) { return 0; @@ -54,10 +54,10 @@ bhyveCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, return 0; } -virDomainPCIAddressSetPtr -bhyveDomainPCIAddressSetCreate(virDomainDefPtr def, unsigned int nbuses) +virDomainPCIAddressSet * +bhyveDomainPCIAddressSetCreate(virDomainDef *def, unsigned int nbuses) { - virDomainPCIAddressSetPtr addrs; + virDomainPCIAddressSet *addrs; if ((addrs = virDomainPCIAddressSetAlloc(nbuses, VIR_PCI_ADDRESS_EXTENSION_NONE)) == NULL) @@ -79,8 +79,8 @@ bhyveDomainPCIAddressSetCreate(virDomainDefPtr def, unsigned int nbuses) } static int -bhyveAssignDevicePCISlots(virDomainDefPtr def, - virDomainPCIAddressSetPtr addrs) +bhyveAssignDevicePCISlots(virDomainDef *def, + virDomainPCIAddressSet *addrs) { size_t i; virPCIDeviceAddress lpc_addr; @@ -188,11 +188,11 @@ bhyveAssignDevicePCISlots(virDomainDefPtr def, return 0; } -int bhyveDomainAssignPCIAddresses(virDomainDefPtr def, - virDomainObjPtr obj) +int bhyveDomainAssignPCIAddresses(virDomainDef *def, + virDomainObj *obj) { - virDomainPCIAddressSetPtr addrs = NULL; - bhyveDomainObjPrivatePtr priv = NULL; + virDomainPCIAddressSet *addrs = NULL; + bhyveDomainObjPrivate *priv = NULL; if (!(addrs = bhyveDomainPCIAddressSetCreate(def, 1))) return -1; @@ -214,7 +214,7 @@ int bhyveDomainAssignPCIAddresses(virDomainDefPtr def, return 0; } -int bhyveDomainAssignAddresses(virDomainDefPtr def, virDomainObjPtr obj) +int bhyveDomainAssignAddresses(virDomainDef *def, virDomainObj *obj) { return bhyveDomainAssignPCIAddresses(def, obj); } diff --git a/src/bhyve/bhyve_device.h b/src/bhyve/bhyve_device.h index 30c08c2a61..93c3a3a4bc 100644 --- a/src/bhyve/bhyve_device.h +++ b/src/bhyve/bhyve_device.h @@ -24,10 +24,10 @@ #include "virpci.h" #include "bhyve_domain.h" -int bhyveDomainAssignPCIAddresses(virDomainDefPtr def, virDomainObjPtr obj); +int bhyveDomainAssignPCIAddresses(virDomainDef *def, virDomainObj *obj); -virDomainPCIAddressSetPtr bhyveDomainPCIAddressSetCreate(virDomainDefPtr def, - unsigned int nbuses); +virDomainPCIAddressSet *bhyveDomainPCIAddressSetCreate(virDomainDef *def, + unsigned int nbuses); -int bhyveDomainAssignAddresses(virDomainDefPtr def, virDomainObjPtr obj) +int bhyveDomainAssignAddresses(virDomainDef *def, virDomainObj *obj) ATTRIBUTE_NONNULL(1); diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c index 209e4d3905..0213878f26 100644 --- a/src/bhyve/bhyve_domain.c +++ b/src/bhyve/bhyve_domain.c @@ -36,7 +36,7 @@ VIR_LOG_INIT("bhyve.bhyve_domain"); static void * bhyveDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED) { - bhyveDomainObjPrivatePtr priv; + bhyveDomainObjPrivate *priv; priv = g_new0(bhyveDomainObjPrivate, 1); @@ -46,7 +46,7 @@ bhyveDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED) static void bhyveDomainObjPrivateFree(void *data) { - bhyveDomainObjPrivatePtr priv = data; + bhyveDomainObjPrivate *priv = data; virDomainPCIAddressSetFree(priv->pciaddrs); @@ -59,7 +59,7 @@ virDomainXMLPrivateDataCallbacks virBhyveDriverPrivateDataCallbacks = { }; static bool -bhyveDomainDefNeedsISAController(virDomainDefPtr def) +bhyveDomainDefNeedsISAController(virDomainDef *def) { if (def->os.bootloader == NULL && def->os.loader) return true; @@ -77,12 +77,12 @@ bhyveDomainDefNeedsISAController(virDomainDefPtr def) } static int -bhyveDomainDefPostParse(virDomainDefPtr def, +bhyveDomainDefPostParse(virDomainDef *def, unsigned int parseFlags G_GNUC_UNUSED, void *opaque, void *parseOpaque G_GNUC_UNUSED) { - bhyveConnPtr driver = opaque; + struct _bhyveConn *driver = opaque; g_autoptr(virCaps) caps = bhyveDriverGetCapabilities(driver); if (!caps) return -1; @@ -106,8 +106,8 @@ bhyveDomainDefPostParse(virDomainDefPtr def, } static int -bhyveDomainDiskDefAssignAddress(bhyveConnPtr driver, - virDomainDiskDefPtr def, +bhyveDomainDiskDefAssignAddress(struct _bhyveConn *driver, + virDomainDiskDef *def, const virDomainDef *vmdef G_GNUC_UNUSED) { int idx = virDiskNameToIndex(def->dst); @@ -138,16 +138,16 @@ bhyveDomainDiskDefAssignAddress(bhyveConnPtr driver, } static int -bhyveDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, +bhyveDomainDeviceDefPostParse(virDomainDeviceDef *dev, const virDomainDef *def, unsigned int parseFlags G_GNUC_UNUSED, void *opaque, void *parseOpaque G_GNUC_UNUSED) { - bhyveConnPtr driver = opaque; + struct _bhyveConn *driver = opaque; if (dev->type == VIR_DOMAIN_DEVICE_DISK) { - virDomainDiskDefPtr disk = dev->data.disk; + virDomainDiskDef *disk = dev->data.disk; if (disk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && bhyveDomainDiskDefAssignAddress(driver, disk, def) < 0) @@ -155,7 +155,7 @@ bhyveDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, } if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER) { - virDomainControllerDefPtr cont = dev->data.controller; + virDomainControllerDef *cont = dev->data.controller; if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI && (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT || @@ -175,7 +175,7 @@ bhyveDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, if (dev->type == VIR_DOMAIN_DEVICE_CHR && dev->data.chr->source->type == VIR_DOMAIN_CHR_TYPE_NMDM) { - virDomainChrDefPtr chr = dev->data.chr; + virDomainChrDef *chr = dev->data.chr; if (!chr->source->data.nmdm.master) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -202,8 +202,8 @@ bhyveDomainDefAssignAddresses(virDomainDef *def, return 0; } -virDomainXMLOptionPtr -virBhyveDriverCreateXMLConf(bhyveConnPtr driver) +virDomainXMLOption * +virBhyveDriverCreateXMLConf(struct _bhyveConn *driver) { virBhyveDriverDomainDefParserConfig.priv = driver; return virDomainXMLOptionNew(&virBhyveDriverDomainDefParserConfig, @@ -240,7 +240,7 @@ virDomainDefParserConfig virBhyveDriverDomainDefParserConfig = { static void bhyveDomainDefNamespaceFree(void *nsdata) { - bhyveDomainCmdlineDefPtr cmd = nsdata; + bhyveDomainCmdlineDef *cmd = nsdata; bhyveDomainCmdlineDefFree(cmd); } @@ -249,7 +249,7 @@ static int bhyveDomainDefNamespaceParse(xmlXPathContextPtr ctxt, void **data) { - bhyveDomainCmdlineDefPtr cmd = NULL; + bhyveDomainCmdlineDef *cmd = NULL; xmlNodePtr *nodes = NULL; int n; size_t i; @@ -286,10 +286,10 @@ bhyveDomainDefNamespaceParse(xmlXPathContextPtr ctxt, } static int -bhyveDomainDefNamespaceFormatXML(virBufferPtr buf, +bhyveDomainDefNamespaceFormatXML(virBuffer *buf, void *nsdata) { - bhyveDomainCmdlineDefPtr cmd = nsdata; + bhyveDomainCmdlineDef *cmd = nsdata; size_t i; if (!cmd->num_args) diff --git a/src/bhyve/bhyve_domain.h b/src/bhyve/bhyve_domain.h index 4e2b11b8de..89a4a3c7cb 100644 --- a/src/bhyve/bhyve_domain.h +++ b/src/bhyve/bhyve_domain.h @@ -26,15 +26,14 @@ #include "bhyve_monitor.h" typedef struct _bhyveDomainObjPrivate bhyveDomainObjPrivate; -typedef bhyveDomainObjPrivate *bhyveDomainObjPrivatePtr; struct _bhyveDomainObjPrivate { - virDomainPCIAddressSetPtr pciaddrs; + virDomainPCIAddressSet *pciaddrs; bool persistentAddrs; - bhyveMonitorPtr mon; + bhyveMonitor *mon; }; -virDomainXMLOptionPtr virBhyveDriverCreateXMLConf(bhyveConnPtr); +virDomainXMLOption *virBhyveDriverCreateXMLConf(struct _bhyveConn *); extern virDomainXMLPrivateDataCallbacks virBhyveDriverPrivateDataCallbacks; extern virDomainDefParserConfig virBhyveDriverDomainDefParserConfig; diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 158fee4445..0fddf9533b 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -68,22 +68,22 @@ VIR_LOG_INIT("bhyve.bhyve_driver"); -bhyveConnPtr bhyve_driver = NULL; +struct _bhyveConn *bhyve_driver = NULL; void -bhyveDriverLock(bhyveConnPtr driver) +bhyveDriverLock(struct _bhyveConn *driver) { virMutexLock(&driver->lock); } void -bhyveDriverUnlock(bhyveConnPtr driver) +bhyveDriverUnlock(struct _bhyveConn *driver) { virMutexUnlock(&driver->lock); } static int -bhyveAutostartDomain(virDomainObjPtr vm, void *opaque) +bhyveAutostartDomain(virDomainObj *vm, void *opaque) { const struct bhyveAutostartData *data = opaque; int ret = 0; @@ -103,7 +103,7 @@ bhyveAutostartDomain(virDomainObjPtr vm, void *opaque) } static void -bhyveAutostartDomains(bhyveConnPtr driver) +bhyveAutostartDomains(struct _bhyveConn *driver) { /* XXX: Figure out a better way todo this. The domain * startup code needs a connection handle in order @@ -123,15 +123,15 @@ bhyveAutostartDomains(bhyveConnPtr driver) /** * bhyveDriverGetCapabilities: * - * Get a reference to the virCapsPtr instance for the + * Get a reference to the virCaps *instance for the * driver. * * The caller must release the reference with virObjetUnref * - * Returns: a reference to a virCapsPtr instance or NULL + * Returns: a reference to a virCaps *instance or NULL */ -virCapsPtr ATTRIBUTE_NONNULL(1) -bhyveDriverGetCapabilities(bhyveConnPtr driver) +virCaps *ATTRIBUTE_NONNULL(1) +bhyveDriverGetCapabilities(struct _bhyveConn *driver) { return virObjectRef(driver->caps); } @@ -139,8 +139,8 @@ bhyveDriverGetCapabilities(bhyveConnPtr driver) static char * bhyveConnectGetCapabilities(virConnectPtr conn) { - bhyveConnPtr privconn = conn->privateData; - virCapsPtr caps; + struct _bhyveConn *privconn = conn->privateData; + virCaps *caps; char *xml = NULL; if (virConnectGetCapabilitiesEnsureACL(conn) < 0) @@ -160,11 +160,11 @@ bhyveConnectGetCapabilities(virConnectPtr conn) return xml; } -static virDomainObjPtr +static virDomainObj * bhyveDomObjFromDomain(virDomainPtr domain) { - virDomainObjPtr vm; - bhyveConnPtr privconn = domain->conn->privateData; + virDomainObj *vm; + struct _bhyveConn *privconn = domain->conn->privateData; char uuidstr[VIR_UUID_STRING_BUFLEN]; vm = virDomainObjListFindByUUID(privconn->domains, domain->uuid); @@ -194,7 +194,7 @@ bhyveConnectURIProbe(char **uri) static virDrvOpenStatus bhyveConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -223,7 +223,7 @@ bhyveConnectOpen(virConnectPtr conn, static int bhyveConnectClose(virConnectPtr conn) { - bhyveConnPtr privconn = conn->privateData; + struct _bhyveConn *privconn = conn->privateData; virCloseCallbacksRun(privconn->closeCallbacks, conn, privconn->domains, privconn); conn->privateData = NULL; @@ -243,7 +243,7 @@ bhyveConnectGetHostname(virConnectPtr conn) static char * bhyveConnectGetSysinfo(virConnectPtr conn, unsigned int flags) { - bhyveConnPtr privconn = conn->privateData; + struct _bhyveConn *privconn = conn->privateData; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; virCheckFlags(0, NULL); @@ -285,7 +285,7 @@ bhyveConnectGetVersion(virConnectPtr conn, unsigned long *version) static int bhyveDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (!(vm = bhyveDomObjFromDomain(domain))) @@ -317,7 +317,7 @@ bhyveDomainGetState(virDomainPtr domain, int *reason, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -339,7 +339,7 @@ bhyveDomainGetState(virDomainPtr domain, static int bhyveDomainGetAutostart(virDomainPtr domain, int *autostart) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (!(vm = bhyveDomObjFromDomain(domain))) @@ -359,7 +359,7 @@ bhyveDomainGetAutostart(virDomainPtr domain, int *autostart) static int bhyveDomainSetAutostart(virDomainPtr domain, int autostart) { - virDomainObjPtr vm; + virDomainObj *vm; char *configFile = NULL; char *autostartLink = NULL; int ret = -1; @@ -422,7 +422,7 @@ bhyveDomainSetAutostart(virDomainPtr domain, int autostart) static int bhyveDomainIsActive(virDomainPtr domain) { - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = bhyveDomObjFromDomain(domain))) @@ -441,7 +441,7 @@ bhyveDomainIsActive(virDomainPtr domain) static int bhyveDomainIsPersistent(virDomainPtr domain) { - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = bhyveDomObjFromDomain(domain))) @@ -460,7 +460,7 @@ bhyveDomainIsPersistent(virDomainPtr domain) static char * bhyveDomainGetOSType(virDomainPtr dom) { - virDomainObjPtr vm; + virDomainObj *vm; char *ret = NULL; if (!(vm = bhyveDomObjFromDomain(dom))) @@ -479,8 +479,8 @@ bhyveDomainGetOSType(virDomainPtr dom) static char * bhyveDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) { - bhyveConnPtr privconn = domain->conn->privateData; - virDomainObjPtr vm; + struct _bhyveConn *privconn = domain->conn->privateData; + virDomainObj *vm; char *ret = NULL; virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS, NULL); @@ -502,13 +502,13 @@ bhyveDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) static virDomainPtr bhyveDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags) { - bhyveConnPtr privconn = conn->privateData; + struct _bhyveConn *privconn = conn->privateData; virDomainPtr dom = NULL; - virDomainDefPtr def = NULL; - virDomainDefPtr oldDef = NULL; - virDomainObjPtr vm = NULL; - virObjectEventPtr event = NULL; - virCapsPtr caps = NULL; + virDomainDef *def = NULL; + virDomainDef *oldDef = NULL; + virDomainObj *vm = NULL; + virObjectEvent *event = NULL; + virCaps *caps = NULL; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; virCheckFlags(VIR_DOMAIN_DEFINE_VALIDATE, NULL); @@ -573,9 +573,9 @@ bhyveDomainDefineXML(virConnectPtr conn, const char *xml) static int bhyveDomainUndefineFlags(virDomainPtr domain, unsigned int flags) { - bhyveConnPtr privconn = domain->conn->privateData; - virObjectEventPtr event = NULL; - virDomainObjPtr vm; + struct _bhyveConn *privconn = domain->conn->privateData; + virObjectEvent *event = NULL; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -622,7 +622,7 @@ bhyveDomainUndefine(virDomainPtr domain) static int bhyveConnectListDomains(virConnectPtr conn, int *ids, int maxids) { - bhyveConnPtr privconn = conn->privateData; + struct _bhyveConn *privconn = conn->privateData; if (virConnectListDomainsEnsureACL(conn) < 0) return -1; @@ -634,7 +634,7 @@ bhyveConnectListDomains(virConnectPtr conn, int *ids, int maxids) static int bhyveConnectNumOfDomains(virConnectPtr conn) { - bhyveConnPtr privconn = conn->privateData; + struct _bhyveConn *privconn = conn->privateData; if (virConnectNumOfDomainsEnsureACL(conn) < 0) return -1; @@ -647,7 +647,7 @@ static int bhyveConnectListDefinedDomains(virConnectPtr conn, char **const names, int maxnames) { - bhyveConnPtr privconn = conn->privateData; + struct _bhyveConn *privconn = conn->privateData; if (virConnectListDefinedDomainsEnsureACL(conn) < 0) return -1; @@ -662,7 +662,7 @@ bhyveConnectListDefinedDomains(virConnectPtr conn, char **const names, static int bhyveConnectNumOfDefinedDomains(virConnectPtr conn) { - bhyveConnPtr privconn = conn->privateData; + struct _bhyveConn *privconn = conn->privateData; if (virConnectNumOfDefinedDomainsEnsureACL(conn) < 0) return -1; @@ -679,10 +679,10 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn, unsigned int flags) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - bhyveConnPtr privconn = conn->privateData; - virDomainDefPtr def = NULL; - virCommandPtr cmd = NULL; - virCommandPtr loadcmd = NULL; + struct _bhyveConn *privconn = conn->privateData; + virDomainDef *def = NULL; + virCommand *cmd = NULL; + virCommand *loadcmd = NULL; char *ret = NULL; virCheckFlags(0, NULL); @@ -746,7 +746,7 @@ bhyveConnectListAllDomains(virConnectPtr conn, virDomainPtr **domains, unsigned int flags) { - bhyveConnPtr privconn = conn->privateData; + struct _bhyveConn *privconn = conn->privateData; virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1); @@ -761,8 +761,8 @@ static virDomainPtr bhyveDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - bhyveConnPtr privconn = conn->privateData; - virDomainObjPtr vm; + struct _bhyveConn *privconn = conn->privateData; + virDomainObj *vm; virDomainPtr dom = NULL; vm = virDomainObjListFindByUUID(privconn->domains, uuid); @@ -788,8 +788,8 @@ bhyveDomainLookupByUUID(virConnectPtr conn, static virDomainPtr bhyveDomainLookupByName(virConnectPtr conn, const char *name) { - bhyveConnPtr privconn = conn->privateData; - virDomainObjPtr vm; + struct _bhyveConn *privconn = conn->privateData; + virDomainObj *vm; virDomainPtr dom = NULL; vm = virDomainObjListFindByName(privconn->domains, name); @@ -814,8 +814,8 @@ static virDomainPtr bhyveDomainLookupByID(virConnectPtr conn, int id) { - bhyveConnPtr privconn = conn->privateData; - virDomainObjPtr vm; + struct _bhyveConn *privconn = conn->privateData; + virDomainObj *vm; virDomainPtr dom = NULL; vm = virDomainObjListFindByID(privconn->domains, id); @@ -840,9 +840,9 @@ static int bhyveDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) { - bhyveConnPtr privconn = dom->conn->privateData; - virDomainObjPtr vm; - virObjectEventPtr event = NULL; + struct _bhyveConn *privconn = dom->conn->privateData; + virDomainObj *vm; + virObjectEvent *event = NULL; unsigned int start_flags = 0; int ret = -1; @@ -889,11 +889,11 @@ bhyveDomainCreateXML(virConnectPtr conn, const char *xml, unsigned int flags) { - bhyveConnPtr privconn = conn->privateData; + struct _bhyveConn *privconn = conn->privateData; virDomainPtr dom = NULL; - virDomainDefPtr def = NULL; - virDomainObjPtr vm = NULL; - virObjectEventPtr event = NULL; + virDomainDef *def = NULL; + virDomainObj *vm = NULL; + virObjectEvent *event = NULL; unsigned int start_flags = 0; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; @@ -949,9 +949,9 @@ static int bhyveDomainDestroyFlags(virDomainPtr dom, unsigned int flags) { virConnectPtr conn = dom->conn; - bhyveConnPtr privconn = conn->privateData; - virDomainObjPtr vm; - virObjectEventPtr event = NULL; + struct _bhyveConn *privconn = conn->privateData; + virDomainObj *vm; + virObjectEvent *event = NULL; int ret = -1; virCheckFlags(0, -1); @@ -988,7 +988,7 @@ bhyveDomainDestroy(virDomainPtr dom) static int bhyveDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -1019,8 +1019,8 @@ static int bhyveDomainReboot(virDomainPtr dom, unsigned int flags) { virConnectPtr conn = dom->conn; - virDomainObjPtr vm; - bhyveDomainObjPrivatePtr priv; + virDomainObj *vm; + bhyveDomainObjPrivate *priv; int ret = -1; virCheckFlags(VIR_DOMAIN_REBOOT_ACPI_POWER_BTN, -1); @@ -1050,8 +1050,8 @@ bhyveDomainOpenConsole(virDomainPtr dom, virStreamPtr st, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainChrDefPtr chr = NULL; + virDomainObj *vm = NULL; + virDomainChrDef *chr = NULL; int ret = -1; virCheckFlags(0, -1); @@ -1093,8 +1093,8 @@ bhyveDomainSetMetadata(virDomainPtr dom, unsigned int flags) { virConnectPtr conn = dom->conn; - bhyveConnPtr privconn = conn->privateData; - virDomainObjPtr vm; + struct _bhyveConn *privconn = conn->privateData; + virDomainObj *vm; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -1111,7 +1111,7 @@ bhyveDomainSetMetadata(virDomainPtr dom, BHYVE_CONFIG_DIR, flags); if (ret == 0) { - virObjectEventPtr ev = NULL; + virObjectEvent *ev = NULL; ev = virDomainEventMetadataChangeNewFromObj(vm, type, uri); virObjectEventStateQueue(privconn->domainEventState, ev); } @@ -1128,7 +1128,7 @@ bhyveDomainGetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; char *ret = NULL; if (!(vm = bhyveDomObjFromDomain(dom))) @@ -1314,7 +1314,7 @@ bhyveStateInitialize(bool privileged, } unsigned -bhyveDriverGetBhyveCaps(bhyveConnPtr driver) +bhyveDriverGetBhyveCaps(struct _bhyveConn *driver) { if (driver != NULL) return driver->bhyvecaps; @@ -1322,7 +1322,7 @@ bhyveDriverGetBhyveCaps(bhyveConnPtr driver) } unsigned -bhyveDriverGetGrubCaps(bhyveConnPtr driver) +bhyveDriverGetGrubCaps(struct _bhyveConn *driver) { if (driver != NULL) return driver->grubcaps; @@ -1403,8 +1403,8 @@ bhyveConnectBaselineCPU(virConnectPtr conn, unsigned int ncpus, unsigned int flags) { - virCPUDefPtr *cpus = NULL; - virCPUDefPtr cpu = NULL; + virCPUDef **cpus = NULL; + virCPUDef *cpu = NULL; char *cpustr = NULL; virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES | @@ -1438,9 +1438,9 @@ bhyveConnectCompareCPU(virConnectPtr conn, const char *xmlDesc, unsigned int flags) { - bhyveConnPtr driver = conn->privateData; + struct _bhyveConn *driver = conn->privateData; int ret = VIR_CPU_COMPARE_ERROR; - virCapsPtr caps = NULL; + virCaps *caps = NULL; bool failIncompatible; bool validateXML; @@ -1484,7 +1484,7 @@ bhyveConnectDomainEventRegisterAny(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - bhyveConnPtr privconn = conn->privateData; + struct _bhyveConn *privconn = conn->privateData; int ret; if (virConnectDomainEventRegisterAnyEnsureACL(conn) < 0) @@ -1503,7 +1503,7 @@ static int bhyveConnectDomainEventDeregisterAny(virConnectPtr conn, int callbackID) { - bhyveConnPtr privconn = conn->privateData; + struct _bhyveConn *privconn = conn->privateData; if (virConnectDomainEventDeregisterAnyEnsureACL(conn) < 0) return -1; @@ -1519,7 +1519,7 @@ bhyveConnectDomainEventDeregisterAny(virConnectPtr conn, static int bhyveDomainHasManagedSaveImage(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; virCheckFlags(0, -1); @@ -1572,8 +1572,8 @@ bhyveConnectDomainXMLFromNative(virConnectPtr conn, unsigned int flags) { char *xml = NULL; - virDomainDefPtr def = NULL; - bhyveConnPtr privconn = conn->privateData; + virDomainDef *def = NULL; + struct _bhyveConn *privconn = conn->privateData; unsigned bhyveCaps = bhyveDriverGetBhyveCaps(privconn); virCheckFlags(0, NULL); @@ -1607,7 +1607,7 @@ bhyveConnectGetDomainCapabilities(virConnectPtr conn, const char *virttype_str, unsigned int flags) { - virDomainCapsPtr caps = NULL; + virDomainCaps *caps = NULL; char *ret = NULL; int virttype = VIR_DOMAIN_VIRT_BHYVE; int arch = virArchFromHost(); /* virArch */ diff --git a/src/bhyve/bhyve_driver.h b/src/bhyve/bhyve_driver.h index 75a63e0233..3f86081910 100644 --- a/src/bhyve/bhyve_driver.h +++ b/src/bhyve/bhyve_driver.h @@ -25,8 +25,8 @@ int bhyveRegister(void); -unsigned bhyveDriverGetBhyveCaps(bhyveConnPtr driver); +unsigned bhyveDriverGetBhyveCaps(struct _bhyveConn *driver); -unsigned bhyveDriverGetGrubCaps(bhyveConnPtr driver); +unsigned bhyveDriverGetGrubCaps(struct _bhyveConn *driver); -virCapsPtr bhyveDriverGetCapabilities(bhyveConnPtr driver); +virCaps *bhyveDriverGetCapabilities(struct _bhyveConn *driver); diff --git a/src/bhyve/bhyve_firmware.c b/src/bhyve/bhyve_firmware.c index 2055f34288..b0f3026c76 100644 --- a/src/bhyve/bhyve_firmware.c +++ b/src/bhyve/bhyve_firmware.c @@ -36,8 +36,8 @@ VIR_LOG_INIT("bhyve.bhyve_firmware"); #define BHYVE_DEFAULT_FIRMWARE "BHYVE_UEFI.fd" int -bhyveFirmwareFillDomain(bhyveConnPtr driver, - virDomainDefPtr def, +bhyveFirmwareFillDomain(bhyveConn *driver, + virDomainDef *def, unsigned int flags) { g_autoptr(DIR) dir = NULL; diff --git a/src/bhyve/bhyve_firmware.h b/src/bhyve/bhyve_firmware.h index ae4bc98676..ae7bd8a2b6 100644 --- a/src/bhyve/bhyve_firmware.h +++ b/src/bhyve/bhyve_firmware.h @@ -25,6 +25,6 @@ #include "bhyve_utils.h" int -bhyveFirmwareFillDomain(bhyveConnPtr driver, - virDomainDefPtr def, +bhyveFirmwareFillDomain(bhyveConn *driver, + virDomainDef *def, unsigned int flags); diff --git a/src/bhyve/bhyve_monitor.c b/src/bhyve/bhyve_monitor.c index e5cd39a086..6788b83c70 100644 --- a/src/bhyve/bhyve_monitor.c +++ b/src/bhyve/bhyve_monitor.c @@ -41,19 +41,19 @@ VIR_LOG_INIT("bhyve.bhyve_monitor"); struct _bhyveMonitor { virObject parent; - bhyveConnPtr driver; - virDomainObjPtr vm; + struct _bhyveConn *driver; + virDomainObj *vm; int kq; int watch; bool reboot; }; -static virClassPtr bhyveMonitorClass; +static virClass *bhyveMonitorClass; static void bhyveMonitorDispose(void *obj) { - bhyveMonitorPtr mon = obj; + bhyveMonitor *mon = obj; VIR_FORCE_CLOSE(mon->kq); virObjectUnref(mon->vm); @@ -73,7 +73,7 @@ VIR_ONCE_GLOBAL_INIT(bhyveMonitor); static void bhyveMonitorIO(int, int, int, void *); static bool -bhyveMonitorRegister(bhyveMonitorPtr mon) +bhyveMonitorRegister(bhyveMonitor *mon) { virObjectRef(mon); mon->watch = virEventAddHandle(mon->kq, @@ -92,7 +92,7 @@ bhyveMonitorRegister(bhyveMonitorPtr mon) } static void -bhyveMonitorUnregister(bhyveMonitorPtr mon) +bhyveMonitorUnregister(bhyveMonitor *mon) { if (mon->watch < 0) return; @@ -102,7 +102,7 @@ bhyveMonitorUnregister(bhyveMonitorPtr mon) } void -bhyveMonitorSetReboot(bhyveMonitorPtr mon) +bhyveMonitorSetReboot(bhyveMonitor *mon) { mon->reboot = true; } @@ -111,9 +111,9 @@ static void bhyveMonitorIO(int watch, int kq, int events G_GNUC_UNUSED, void *opaque) { const struct timespec zerowait = { 0, 0 }; - bhyveMonitorPtr mon = opaque; - virDomainObjPtr vm = mon->vm; - bhyveConnPtr driver = mon->driver; + bhyveMonitor *mon = opaque; + virDomainObj *vm = mon->vm; + struct _bhyveConn *driver = mon->driver; const char *name; struct kevent kev; int rc, status; @@ -172,10 +172,10 @@ bhyveMonitorIO(int watch, int kq, int events G_GNUC_UNUSED, void *opaque) } } -static bhyveMonitorPtr -bhyveMonitorOpenImpl(virDomainObjPtr vm, bhyveConnPtr driver) +static bhyveMonitor * +bhyveMonitorOpenImpl(virDomainObj *vm, struct _bhyveConn *driver) { - bhyveMonitorPtr mon; + bhyveMonitor *mon; struct kevent kev; if (bhyveMonitorInitialize() < 0) @@ -217,10 +217,10 @@ bhyveMonitorOpenImpl(virDomainObjPtr vm, bhyveConnPtr driver) return NULL; } -bhyveMonitorPtr -bhyveMonitorOpen(virDomainObjPtr vm, bhyveConnPtr driver) +bhyveMonitor * +bhyveMonitorOpen(virDomainObj *vm, struct _bhyveConn *driver) { - bhyveMonitorPtr mon; + bhyveMonitor *mon; virObjectRef(vm); mon = bhyveMonitorOpenImpl(vm, driver); @@ -230,7 +230,7 @@ bhyveMonitorOpen(virDomainObjPtr vm, bhyveConnPtr driver) } void -bhyveMonitorClose(bhyveMonitorPtr mon) +bhyveMonitorClose(bhyveMonitor *mon) { if (mon == NULL) return; diff --git a/src/bhyve/bhyve_monitor.h b/src/bhyve/bhyve_monitor.h index 175cc87192..b9c04232d7 100644 --- a/src/bhyve/bhyve_monitor.h +++ b/src/bhyve/bhyve_monitor.h @@ -25,9 +25,8 @@ #include "bhyve_utils.h" typedef struct _bhyveMonitor bhyveMonitor; -typedef bhyveMonitor *bhyveMonitorPtr; -bhyveMonitorPtr bhyveMonitorOpen(virDomainObjPtr vm, bhyveConnPtr driver); -void bhyveMonitorClose(bhyveMonitorPtr mon); +bhyveMonitor *bhyveMonitorOpen(virDomainObj *vm, struct _bhyveConn *driver); +void bhyveMonitorClose(bhyveMonitor *mon); -void bhyveMonitorSetReboot(bhyveMonitorPtr mon); +void bhyveMonitorSetReboot(bhyveMonitor *mon); diff --git a/src/bhyve/bhyve_parse_command.c b/src/bhyve/bhyve_parse_command.c index 53b1cca704..9b97c262ec 100644 --- a/src/bhyve/bhyve_parse_command.c +++ b/src/bhyve/bhyve_parse_command.c @@ -258,7 +258,7 @@ bhyveCommandLineToArgv(const char *nativeConfig, } static int -bhyveParseBhyveLPCArg(virDomainDefPtr def, +bhyveParseBhyveLPCArg(virDomainDef *def, unsigned caps G_GNUC_UNUSED, const char *arg) { @@ -266,7 +266,7 @@ bhyveParseBhyveLPCArg(virDomainDefPtr def, const char *separator = NULL; const char *param = NULL; size_t last = 0; - virDomainChrDefPtr chr = NULL; + virDomainChrDef *chr = NULL; char *type = NULL; separator = strchr(arg, ','); @@ -400,7 +400,7 @@ bhyveParsePCISlot(const char *slotdef, } static int -bhyveParsePCIDisk(virDomainDefPtr def, +bhyveParsePCIDisk(virDomainDef *def, unsigned caps G_GNUC_UNUSED, unsigned pcibus, unsigned pcislot, @@ -414,7 +414,7 @@ bhyveParsePCIDisk(virDomainDefPtr def, /* -s slot,virtio-blk|ahci-cd|ahci-hd,/path/to/file */ const char *separator = NULL; int idx = -1; - virDomainDiskDefPtr disk = NULL; + virDomainDiskDef *disk = NULL; if (!(disk = virDomainDiskDefNew(NULL))) return 0; @@ -470,8 +470,8 @@ bhyveParsePCIDisk(virDomainDefPtr def, } static int -bhyveParsePCINet(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, +bhyveParsePCINet(virDomainDef *def, + virDomainXMLOption *xmlopt, unsigned caps G_GNUC_UNUSED, unsigned bus, unsigned slot, @@ -481,7 +481,7 @@ bhyveParsePCINet(virDomainDefPtr def, { /* -s slot,virtio-net,tapN[,mac=xx:xx:xx:xx:xx:xx] */ - virDomainNetDefPtr net = NULL; + virDomainNetDef *net = NULL; const char *separator = NULL; const char *mac = NULL; @@ -546,8 +546,8 @@ bhyveParsePCINet(virDomainDefPtr def, } static int -bhyveParsePCIFbuf(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, +bhyveParsePCIFbuf(virDomainDef *def, + virDomainXMLOption *xmlopt, unsigned caps G_GNUC_UNUSED, unsigned bus, unsigned slot, @@ -556,8 +556,8 @@ bhyveParsePCIFbuf(virDomainDefPtr def, { /* -s slot,fbuf,wait,vga=on|io|off,rfb=:port,w=width,h=height */ - virDomainVideoDefPtr video = NULL; - virDomainGraphicsDefPtr graphics = NULL; + virDomainVideoDef *video = NULL; + virDomainGraphicsDef *graphics = NULL; g_auto(GStrv) params = NULL; GStrv next; @@ -657,8 +657,8 @@ bhyveParsePCIFbuf(virDomainDefPtr def, } static int -bhyveParseBhyvePCIArg(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, +bhyveParseBhyvePCIArg(virDomainDef *def, + virDomainXMLOption *xmlopt, unsigned caps, unsigned *nvirtiodisk, unsigned *nahcidisk, @@ -742,8 +742,8 @@ bhyveParseBhyvePCIArg(virDomainDefPtr def, * Parse the /usr/sbin/bhyve command line. */ static int -bhyveParseBhyveCommandLine(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, +bhyveParseBhyveCommandLine(virDomainDef *def, + virDomainXMLOption *xmlopt, unsigned caps, int argc, char **argv) { @@ -852,7 +852,7 @@ bhyveParseBhyveCommandLine(virDomainDefPtr def, * Parse the /usr/sbin/bhyveload command line. */ static int -bhyveParseBhyveLoadCommandLine(virDomainDefPtr def, +bhyveParseBhyveLoadCommandLine(virDomainDef *def, int argc, char **argv) { /* bhyveload called with default arguments when only -m and -d are given. @@ -932,7 +932,7 @@ bhyveParseBhyveLoadCommandLine(virDomainDefPtr def, #undef CONSUME_ARG static int -bhyveParseCustomLoaderCommandLine(virDomainDefPtr def, +bhyveParseCustomLoaderCommandLine(virDomainDef *def, int argc G_GNUC_UNUSED, char **argv) { @@ -945,12 +945,12 @@ bhyveParseCustomLoaderCommandLine(virDomainDefPtr def, return 0; } -virDomainDefPtr +virDomainDef * bhyveParseCommandLineString(const char* nativeConfig, unsigned caps, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; int bhyve_argc = 0; char **bhyve_argv = NULL; int loader_argc = 0; diff --git a/src/bhyve/bhyve_parse_command.h b/src/bhyve/bhyve_parse_command.h index 38521dcc55..7cf3e70b5e 100644 --- a/src/bhyve/bhyve_parse_command.h +++ b/src/bhyve/bhyve_parse_command.h @@ -20,6 +20,6 @@ #pragma once -virDomainDefPtr bhyveParseCommandLineString(const char* nativeConfig, - unsigned caps, - virDomainXMLOptionPtr xmlopt); +virDomainDef *bhyveParseCommandLineString(const char* nativeConfig, + unsigned caps, + virDomainXMLOption *xmlopt); diff --git a/src/bhyve/bhyve_process.c b/src/bhyve/bhyve_process.c index 0cfe69688c..8de5fe4838 100644 --- a/src/bhyve/bhyve_process.c +++ b/src/bhyve/bhyve_process.c @@ -55,11 +55,11 @@ VIR_LOG_INIT("bhyve.bhyve_process"); static void -bhyveProcessAutoDestroy(virDomainObjPtr vm, +bhyveProcessAutoDestroy(virDomainObj *vm, virConnectPtr conn G_GNUC_UNUSED, void *opaque) { - bhyveConnPtr driver = opaque; + struct _bhyveConn *driver = opaque; virBhyveProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED); @@ -68,12 +68,12 @@ bhyveProcessAutoDestroy(virDomainObjPtr vm, } static void -bhyveNetCleanup(virDomainObjPtr vm) +bhyveNetCleanup(virDomainObj *vm) { size_t i; for (i = 0; i < vm->def->nnets; i++) { - virDomainNetDefPtr net = vm->def->nets[i]; + virDomainNetDef *net = vm->def->nets[i]; virDomainNetType actualType = virDomainNetGetActualType(net); if (actualType == VIR_DOMAIN_NET_TYPE_BRIDGE) { @@ -94,7 +94,7 @@ virBhyveFormatDevMapFile(const char *vm_name, char **fn_out) } static int -bhyveProcessStartHook(virDomainObjPtr vm, virHookBhyveOpType op) +bhyveProcessStartHook(virDomainObj *vm, virHookBhyveOpType op) { if (!virHookPresent(VIR_HOOK_DRIVER_BHYVE)) return 0; @@ -104,7 +104,7 @@ bhyveProcessStartHook(virDomainObjPtr vm, virHookBhyveOpType op) } static void -bhyveProcessStopHook(virDomainObjPtr vm, virHookBhyveOpType op) +bhyveProcessStopHook(virDomainObj *vm, virHookBhyveOpType op) { if (virHookPresent(VIR_HOOK_DRIVER_BHYVE)) virHookCall(VIR_HOOK_DRIVER_BHYVE, vm->def->name, op, @@ -112,17 +112,17 @@ bhyveProcessStopHook(virDomainObjPtr vm, virHookBhyveOpType op) } static int -virBhyveProcessStartImpl(bhyveConnPtr driver, - virDomainObjPtr vm, +virBhyveProcessStartImpl(struct _bhyveConn *driver, + virDomainObj *vm, virDomainRunningReason reason) { char *devmap_file = NULL; char *devicemap = NULL; char *logfile = NULL; int logfd = -1; - virCommandPtr cmd = NULL; - virCommandPtr load_cmd = NULL; - bhyveDomainObjPrivatePtr priv = vm->privateData; + virCommand *cmd = NULL; + virCommand *load_cmd = NULL; + bhyveDomainObjPrivate *priv = vm->privateData; int ret = -1, rc; logfile = g_strdup_printf("%s/%s.log", BHYVE_LOG_DIR, vm->def->name); @@ -233,7 +233,7 @@ virBhyveProcessStartImpl(bhyveConnPtr driver, if (ret < 0) { int exitstatus; /* Needed to avoid logging non-zero status */ - virCommandPtr destroy_cmd; + virCommand *destroy_cmd; if ((destroy_cmd = virBhyveProcessBuildDestroyCmd(driver, vm->def)) != NULL) { virCommandSetOutputFD(load_cmd, &logfd); @@ -253,8 +253,8 @@ virBhyveProcessStartImpl(bhyveConnPtr driver, } int -bhyveProcessPrepareDomain(bhyveConnPtr driver, - virDomainObjPtr vm, +bhyveProcessPrepareDomain(bhyveConn *driver, + virDomainObj *vm, unsigned int flags) { if (bhyveFirmwareFillDomain(driver, vm->def, flags) < 0) @@ -265,11 +265,11 @@ bhyveProcessPrepareDomain(bhyveConnPtr driver, int virBhyveProcessStart(virConnectPtr conn, - virDomainObjPtr vm, + virDomainObj *vm, virDomainRunningReason reason, unsigned int flags) { - bhyveConnPtr driver = conn->privateData; + struct _bhyveConn *driver = conn->privateData; /* Run an early hook to setup missing devices. */ if (bhyveProcessStartHook(vm, VIR_HOOK_BHYVE_OP_PREPARE) < 0) @@ -287,13 +287,13 @@ virBhyveProcessStart(virConnectPtr conn, } int -virBhyveProcessStop(bhyveConnPtr driver, - virDomainObjPtr vm, +virBhyveProcessStop(struct _bhyveConn *driver, + virDomainObj *vm, virDomainShutoffReason reason) { int ret = -1; - virCommandPtr cmd = NULL; - bhyveDomainObjPrivatePtr priv = vm->privateData; + virCommand *cmd = NULL; + bhyveDomainObjPrivate *priv = vm->privateData; if (!virDomainObjIsActive(vm)) { VIR_DEBUG("VM '%s' not active", vm->def->name); @@ -351,7 +351,7 @@ virBhyveProcessStop(bhyveConnPtr driver, } int -virBhyveProcessShutdown(virDomainObjPtr vm) +virBhyveProcessShutdown(virDomainObj *vm) { if (vm->pid <= 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -374,8 +374,8 @@ virBhyveProcessShutdown(virDomainObjPtr vm) } int -virBhyveProcessRestart(bhyveConnPtr driver, - virDomainObjPtr vm) +virBhyveProcessRestart(struct _bhyveConn *driver, + virDomainObj *vm) { if (virBhyveProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_SHUTDOWN) < 0) return -1; @@ -387,7 +387,7 @@ virBhyveProcessRestart(bhyveConnPtr driver, } int -virBhyveGetDomainTotalCpuStats(virDomainObjPtr vm, +virBhyveGetDomainTotalCpuStats(virDomainObj *vm, unsigned long long *cpustats) { struct kinfo_proc *kp; @@ -423,12 +423,12 @@ virBhyveGetDomainTotalCpuStats(virDomainObjPtr vm, } struct bhyveProcessReconnectData { - bhyveConnPtr driver; + struct _bhyveConn *driver; kvm_t *kd; }; static int -virBhyveProcessReconnect(virDomainObjPtr vm, +virBhyveProcessReconnect(virDomainObj *vm, void *opaque) { struct bhyveProcessReconnectData *data = opaque; @@ -436,7 +436,7 @@ virBhyveProcessReconnect(virDomainObjPtr vm, int nprocs; char **proc_argv; char *expected_proctitle = NULL; - bhyveDomainObjPrivatePtr priv = vm->privateData; + bhyveDomainObjPrivate *priv = vm->privateData; int ret = -1; if (!virDomainObjIsActive(vm)) @@ -489,7 +489,7 @@ virBhyveProcessReconnect(virDomainObjPtr vm, } void -virBhyveProcessReconnectAll(bhyveConnPtr driver) +virBhyveProcessReconnectAll(struct _bhyveConn *driver) { kvm_t *kd; struct bhyveProcessReconnectData data; diff --git a/src/bhyve/bhyve_process.h b/src/bhyve/bhyve_process.h index 133863c1e0..668411db57 100644 --- a/src/bhyve/bhyve_process.h +++ b/src/bhyve/bhyve_process.h @@ -24,28 +24,28 @@ #include "bhyve_utils.h" int -bhyveProcessPrepareDomain(bhyveConnPtr driver, - virDomainObjPtr vm, +bhyveProcessPrepareDomain(bhyveConn *driver, + virDomainObj *vm, unsigned int flags); -int virBhyveProcessStart(virConnectPtr conn, - virDomainObjPtr vm, +int virBhyveProcessStart(virConnect *conn, + virDomainObj *vm, virDomainRunningReason reason, unsigned int flags); -int virBhyveProcessStop(bhyveConnPtr driver, - virDomainObjPtr vm, +int virBhyveProcessStop(struct _bhyveConn *driver, + virDomainObj *vm, virDomainShutoffReason reason); -int virBhyveProcessRestart(bhyveConnPtr driver, - virDomainObjPtr vm); +int virBhyveProcessRestart(struct _bhyveConn *driver, + virDomainObj *vm); -int virBhyveProcessShutdown(virDomainObjPtr vm); +int virBhyveProcessShutdown(virDomainObj *vm); -int virBhyveGetDomainTotalCpuStats(virDomainObjPtr vm, +int virBhyveGetDomainTotalCpuStats(virDomainObj *vm, unsigned long long *cpustats); -void virBhyveProcessReconnectAll(bhyveConnPtr driver); +void virBhyveProcessReconnectAll(struct _bhyveConn *driver); typedef enum { VIR_BHYVE_PROCESS_START_AUTODESTROY = 1 << 0, diff --git a/src/bhyve/bhyve_utils.h b/src/bhyve/bhyve_utils.h index 3bf5ae5daf..af7b15486a 100644 --- a/src/bhyve/bhyve_utils.h +++ b/src/bhyve/bhyve_utils.h @@ -35,8 +35,6 @@ #define BHYVE_LOG_DIR LOCALSTATEDIR "/log/libvirt/bhyve" typedef struct _virBhyveDriverConfig virBhyveDriverConfig; -typedef struct _virBhyveDriverConfig *virBhyveDriverConfigPtr; - struct _virBhyveDriverConfig { virObject parent; @@ -48,34 +46,33 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virBhyveDriverConfig, virObjectUnref); struct _bhyveConn { virMutex lock; - virBhyveDriverConfigPtr config; + struct _virBhyveDriverConfig *config; /* pid file FD, ensures two copies of the driver can't use the same root */ int lockFD; - virDomainObjListPtr domains; - virCapsPtr caps; - virDomainXMLOptionPtr xmlopt; + virDomainObjList *domains; + virCaps *caps; + virDomainXMLOption *xmlopt; char *pidfile; - virSysinfoDefPtr hostsysinfo; + virSysinfoDef *hostsysinfo; - virObjectEventStatePtr domainEventState; + virObjectEventState *domainEventState; - virCloseCallbacksPtr closeCallbacks; + virCloseCallbacks *closeCallbacks; - virPortAllocatorRangePtr remotePorts; + virPortAllocatorRange *remotePorts; unsigned bhyvecaps; unsigned grubcaps; }; typedef struct _bhyveConn bhyveConn; -typedef struct _bhyveConn *bhyveConnPtr; struct bhyveAutostartData { - bhyveConnPtr driver; + struct _bhyveConn *driver; virConnectPtr conn; }; -void bhyveDriverLock(bhyveConnPtr driver); -void bhyveDriverUnlock(bhyveConnPtr driver); +void bhyveDriverLock(struct _bhyveConn *driver); +void bhyveDriverUnlock(struct _bhyveConn *driver); diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c index 2d6d2d99f4..2de77a59c0 100644 --- a/src/conf/backup_conf.c +++ b/src/conf/backup_conf.c @@ -64,7 +64,7 @@ VIR_ENUM_IMPL(virDomainBackupDiskBackupMode, "incremental"); void -virDomainBackupDefFree(virDomainBackupDefPtr def) +virDomainBackupDefFree(virDomainBackupDef *def) { size_t i; @@ -76,7 +76,7 @@ virDomainBackupDefFree(virDomainBackupDefPtr def) virStorageNetHostDefFree(1, def->server); for (i = 0; i < def->ndisks; i++) { - virDomainBackupDiskDefPtr disk = def->disks + i; + virDomainBackupDiskDef *disk = def->disks + i; g_free(disk->name); g_free(disk->incremental); @@ -97,10 +97,10 @@ virDomainBackupDefFree(virDomainBackupDefPtr def) static int virDomainBackupDiskDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virDomainBackupDiskDefPtr def, + virDomainBackupDiskDef *def, bool push, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree char *type = NULL; @@ -200,7 +200,7 @@ virDomainBackupDiskDefParseXML(xmlNodePtr node, static void -virDomainBackupDefParsePrivate(virDomainBackupDefPtr def, +virDomainBackupDefParsePrivate(virDomainBackupDef *def, xmlXPathContextPtr ctxt, unsigned int flags) { @@ -212,9 +212,9 @@ virDomainBackupDefParsePrivate(virDomainBackupDefPtr def, } -static virDomainBackupDefPtr +static virDomainBackupDef * virDomainBackupDefParse(xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags) { g_autoptr(virDomainBackupDef) def = NULL; @@ -302,12 +302,12 @@ virDomainBackupDefParse(xmlXPathContextPtr ctxt, } -virDomainBackupDefPtr +virDomainBackupDef * virDomainBackupDefParseString(const char *xmlStr, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags) { - virDomainBackupDefPtr ret = NULL; + virDomainBackupDef *ret = NULL; g_autoptr(xmlDoc) xml = NULL; int keepBlanksDefault = xmlKeepBlanksDefault(0); @@ -322,10 +322,10 @@ virDomainBackupDefParseString(const char *xmlStr, } -virDomainBackupDefPtr +virDomainBackupDef * virDomainBackupDefParseNode(xmlDocPtr xml, xmlNodePtr root, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags) { g_autoptr(xmlXPathContext) ctxt = NULL; @@ -355,8 +355,8 @@ virDomainBackupDefParseNode(xmlDocPtr xml, static int -virDomainBackupDiskDefFormat(virBufferPtr buf, - virDomainBackupDiskDefPtr disk, +virDomainBackupDiskDefFormat(virBuffer *buf, + virDomainBackupDiskDef *disk, bool push, bool internal) { @@ -408,8 +408,8 @@ virDomainBackupDiskDefFormat(virBufferPtr buf, static void -virDomainBackupDefFormatPrivate(virBufferPtr buf, - virDomainBackupDefPtr def, +virDomainBackupDefFormatPrivate(virBuffer *buf, + virDomainBackupDef *def, bool internal) { g_auto(virBuffer) privChildBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -428,8 +428,8 @@ virDomainBackupDefFormatPrivate(virBufferPtr buf, int -virDomainBackupDefFormat(virBufferPtr buf, - virDomainBackupDefPtr def, +virDomainBackupDefFormat(virBuffer *buf, + virDomainBackupDef *def, bool internal) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; @@ -473,8 +473,8 @@ virDomainBackupDefFormat(virBufferPtr buf, static int -virDomainBackupDefAssignStore(virDomainBackupDiskDefPtr disk, - virStorageSourcePtr src, +virDomainBackupDefAssignStore(virDomainBackupDiskDef *disk, + virStorageSource *src, const char *suffix) { if (virStorageSourceIsEmpty(src)) { @@ -501,8 +501,8 @@ virDomainBackupDefAssignStore(virDomainBackupDiskDefPtr disk, int -virDomainBackupAlignDisks(virDomainBackupDefPtr def, - virDomainDefPtr dom, +virDomainBackupAlignDisks(virDomainBackupDef *def, + virDomainDef *dom, const char *suffix) { g_autoptr(GHashTable) disks = virHashNew(NULL); @@ -519,8 +519,8 @@ virDomainBackupAlignDisks(virDomainBackupDefPtr def, /* Double check requested disks. */ for (i = 0; i < def->ndisks; i++) { - virDomainBackupDiskDefPtr backupdisk = &def->disks[i]; - virDomainDiskDefPtr domdisk; + virDomainBackupDiskDef *backupdisk = &def->disks[i]; + virDomainDiskDef *domdisk; if (!(domdisk = virDomainDiskByTarget(dom, backupdisk->name))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -557,8 +557,8 @@ virDomainBackupAlignDisks(virDomainBackupDefPtr def, VIR_EXPAND_N(def->disks, def->ndisks, dom->ndisks - def->ndisks); for (i = 0; i < dom->ndisks; i++) { - virDomainBackupDiskDefPtr backupdisk = NULL; - virDomainDiskDefPtr domdisk = dom->disks[i]; + virDomainBackupDiskDef *backupdisk = NULL; + virDomainDiskDef *domdisk = dom->disks[i]; if (virHashHasEntry(disks, domdisk->dst)) continue; @@ -579,7 +579,7 @@ virDomainBackupAlignDisks(virDomainBackupDefPtr def, } for (i = 0; i < def->ndisks; i++) { - virDomainBackupDiskDefPtr backupdisk = &def->disks[i]; + virDomainBackupDiskDef *backupdisk = &def->disks[i]; if (backupdisk->backupmode == VIR_DOMAIN_BACKUP_DISK_BACKUP_MODE_DEFAULT) { if (def->incremental || backupdisk->incremental) { diff --git a/src/conf/backup_conf.h b/src/conf/backup_conf.h index 2902f39fb7..b682da1c95 100644 --- a/src/conf/backup_conf.h +++ b/src/conf/backup_conf.h @@ -57,7 +57,6 @@ typedef enum { /* Stores disk-backup information */ typedef struct _virDomainBackupDiskDef virDomainBackupDiskDef; -typedef virDomainBackupDiskDef *virDomainBackupDiskDefPtr; struct _virDomainBackupDiskDef { char *name; /* name matching the ndisks */ @@ -107,26 +105,26 @@ typedef enum { VIR_DOMAIN_BACKUP_PARSE_INTERNAL = 1 << 0, } virDomainBackupParseFlags; -virDomainBackupDefPtr +virDomainBackupDef * virDomainBackupDefParseString(const char *xmlStr, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags); -virDomainBackupDefPtr +virDomainBackupDef * virDomainBackupDefParseNode(xmlDocPtr xml, xmlNodePtr root, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags); void -virDomainBackupDefFree(virDomainBackupDefPtr def); +virDomainBackupDefFree(virDomainBackupDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainBackupDef, virDomainBackupDefFree); int -virDomainBackupDefFormat(virBufferPtr buf, - virDomainBackupDefPtr def, +virDomainBackupDefFormat(virBuffer *buf, + virDomainBackupDef *def, bool internal); int -virDomainBackupAlignDisks(virDomainBackupDefPtr backup, - virDomainDefPtr dom, +virDomainBackupAlignDisks(virDomainBackupDef *backup, + virDomainDef *dom, const char *suffix); diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 6c94d1c502..9bd59b3cbf 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -54,7 +54,7 @@ VIR_ENUM_IMPL(virCapsHostPMTarget, "suspend_mem", "suspend_disk", "suspend_hybrid", ); -static virClassPtr virCapsClass; +static virClass *virCapsClass; static void virCapsDispose(void *obj); static int virCapabilitiesOnceInit(void) @@ -75,12 +75,12 @@ VIR_ONCE_GLOBAL_INIT(virCapabilities); * * Allocate a new capabilities object */ -virCapsPtr +virCaps * virCapabilitiesNew(virArch hostarch, bool offlineMigrate, bool liveMigrate) { - virCapsPtr caps; + virCaps *caps; if (virCapabilitiesInitialize() < 0) return NULL; @@ -96,7 +96,7 @@ virCapabilitiesNew(virArch hostarch, } void -virCapabilitiesClearHostNUMACellCPUTopology(virCapsHostNUMACellCPUPtr cpus, +virCapabilitiesClearHostNUMACellCPUTopology(virCapsHostNUMACellCPU *cpus, size_t ncpus) { size_t i; @@ -111,7 +111,7 @@ virCapabilitiesClearHostNUMACellCPUTopology(virCapsHostNUMACellCPUPtr cpus, } static void -virCapabilitiesFreeHostNUMACell(virCapsHostNUMACellPtr cell) +virCapabilitiesFreeHostNUMACell(virCapsHostNUMACell *cell) { if (cell == NULL) return; @@ -125,7 +125,7 @@ virCapabilitiesFreeHostNUMACell(virCapsHostNUMACellPtr cell) } static void -virCapabilitiesFreeGuestMachine(virCapsGuestMachinePtr machine) +virCapabilitiesFreeGuestMachine(virCapsGuestMachine *machine) { if (machine == NULL) return; @@ -135,7 +135,7 @@ virCapabilitiesFreeGuestMachine(virCapsGuestMachinePtr machine) } static void -virCapabilitiesFreeGuestDomain(virCapsGuestDomainPtr dom) +virCapabilitiesFreeGuestDomain(virCapsGuestDomain *dom) { size_t i; if (dom == NULL) @@ -151,7 +151,7 @@ virCapabilitiesFreeGuestDomain(virCapsGuestDomainPtr dom) } void -virCapabilitiesFreeGuest(virCapsGuestPtr guest) +virCapabilitiesFreeGuest(virCapsGuest *guest) { size_t i; if (guest == NULL) @@ -172,7 +172,7 @@ virCapabilitiesFreeGuest(virCapsGuestPtr guest) static void -virCapabilitiesFreeStoragePool(virCapsStoragePoolPtr pool) +virCapabilitiesFreeStoragePool(virCapsStoragePool *pool) { if (!pool) return; @@ -182,7 +182,7 @@ virCapabilitiesFreeStoragePool(virCapsStoragePoolPtr pool) void -virCapabilitiesHostNUMAUnref(virCapsHostNUMAPtr caps) +virCapabilitiesHostNUMAUnref(virCapsHostNUMA *caps) { if (!caps) return; @@ -195,13 +195,13 @@ virCapabilitiesHostNUMAUnref(virCapsHostNUMAPtr caps) } void -virCapabilitiesHostNUMARef(virCapsHostNUMAPtr caps) +virCapabilitiesHostNUMARef(virCapsHostNUMA *caps) { g_atomic_int_inc(&caps->refs); } static void -virCapsHostMemBWNodeFree(virCapsHostMemBWNodePtr ptr) +virCapsHostMemBWNodeFree(virCapsHostMemBWNode *ptr) { if (!ptr) return; @@ -211,7 +211,7 @@ virCapsHostMemBWNodeFree(virCapsHostMemBWNodePtr ptr) } static void -virCapabilitiesClearSecModel(virCapsHostSecModelPtr secmodel) +virCapabilitiesClearSecModel(virCapsHostSecModel *secmodel) { size_t i; for (i = 0; i < secmodel->nlabels; i++) { @@ -227,7 +227,7 @@ virCapabilitiesClearSecModel(virCapsHostSecModelPtr secmodel) static void virCapsDispose(void *object) { - virCapsPtr caps = object; + virCaps *caps = object; size_t i; for (i = 0; i < caps->npools; i++) @@ -277,7 +277,7 @@ virCapsDispose(void *object) * Registers a new host CPU feature, eg 'pae', or 'vmx' */ int -virCapabilitiesAddHostFeature(virCapsPtr caps, +virCapabilitiesAddHostFeature(virCaps *caps, const char *name) { VIR_RESIZE_N(caps->host.features, caps->host.nfeatures_max, @@ -296,7 +296,7 @@ virCapabilitiesAddHostFeature(virCapsPtr caps, * Registers a new domain migration transport URI */ int -virCapabilitiesAddHostMigrateTransport(virCapsPtr caps, +virCapabilitiesAddHostMigrateTransport(virCaps *caps, const char *name) { VIR_RESIZE_N(caps->host.migrateTrans, caps->host.nmigrateTrans_max, @@ -315,7 +315,7 @@ virCapabilitiesAddHostMigrateTransport(virCapsPtr caps, * Registers the prefix that is used for generated network interfaces */ int -virCapabilitiesSetNetPrefix(virCapsPtr caps, +virCapabilitiesSetNetPrefix(virCaps *caps, const char *prefix) { caps->host.netprefix = g_strdup(prefix); @@ -340,17 +340,17 @@ virCapabilitiesSetNetPrefix(virCapsPtr caps, * array of CPU IDs belonging to the cell */ void -virCapabilitiesHostNUMAAddCell(virCapsHostNUMAPtr caps, +virCapabilitiesHostNUMAAddCell(virCapsHostNUMA *caps, int num, unsigned long long mem, int ncpus, - virCapsHostNUMACellCPUPtr cpus, + virCapsHostNUMACellCPU *cpus, int nsiblings, - virCapsHostNUMACellSiblingInfoPtr siblings, + virCapsHostNUMACellSiblingInfo *siblings, int npageinfo, - virCapsHostNUMACellPageInfoPtr pageinfo) + virCapsHostNUMACellPageInfo *pageinfo) { - virCapsHostNUMACellPtr cell = g_new0(virCapsHostNUMACell, 1); + virCapsHostNUMACell *cell = g_new0(virCapsHostNUMACell, 1); cell->num = num; cell->mem = mem; @@ -369,16 +369,16 @@ virCapabilitiesHostNUMAAddCell(virCapsHostNUMAPtr caps, * @machines: machine variants for emulator ('pc', or 'isapc', etc) * @nmachines: number of machine variants for emulator * - * Allocate a table of virCapsGuestMachinePtr from the supplied table + * Allocate a table of virCapsGuestMachine *from the supplied table * of machine names. */ -virCapsGuestMachinePtr * +virCapsGuestMachine ** virCapabilitiesAllocMachines(const char *const *names, int nnames) { - virCapsGuestMachinePtr *machines; + virCapsGuestMachine **machines; size_t i; - machines = g_new0(virCapsGuestMachinePtr, nnames); + machines = g_new0(virCapsGuestMachine *, nnames); for (i = 0; i < nnames; i++) { machines[i] = g_new0(virCapsGuestMachine, 1); @@ -392,10 +392,10 @@ virCapabilitiesAllocMachines(const char *const *names, int nnames) * virCapabilitiesFreeMachines: * @machines: table of vircapsGuestMachinePtr * - * Free a table of virCapsGuestMachinePtr + * Free a table of virCapsGuestMachine * */ void -virCapabilitiesFreeMachines(virCapsGuestMachinePtr *machines, +virCapabilitiesFreeMachines(virCapsGuestMachine **machines, int nmachines) { size_t i; @@ -423,16 +423,16 @@ virCapabilitiesFreeMachines(virCapsGuestMachinePtr *machines, * followed by registration of at least one domain for * running the guest */ -virCapsGuestPtr -virCapabilitiesAddGuest(virCapsPtr caps, +virCapsGuest * +virCapabilitiesAddGuest(virCaps *caps, int ostype, virArch arch, const char *emulator, const char *loader, int nmachines, - virCapsGuestMachinePtr *machines) + virCapsGuestMachine **machines) { - virCapsGuestPtr guest; + virCapsGuest *guest; guest = g_new0(virCapsGuest, 1); @@ -467,15 +467,15 @@ virCapabilitiesAddGuest(virCapsPtr caps, * Registers a virtual domain capable of running a * guest operating system */ -virCapsGuestDomainPtr -virCapabilitiesAddGuestDomain(virCapsGuestPtr guest, +virCapsGuestDomain * +virCapabilitiesAddGuestDomain(virCapsGuest *guest, int hvtype, const char *emulator, const char *loader, int nmachines, - virCapsGuestMachinePtr *machines) + virCapsGuestMachine **machines) { - virCapsGuestDomainPtr dom; + virCapsGuestDomain *dom; dom = g_new0(virCapsGuestDomain, 1); @@ -516,7 +516,7 @@ static const struct virCapsGuestFeatureInfo virCapsGuestFeatureInfos[VIR_CAPS_GU static void -virCapabilitiesAddGuestFeatureInternal(virCapsGuestPtr guest, +virCapabilitiesAddGuestFeatureInternal(virCapsGuest *guest, virCapsGuestFeatureType feature, bool defaultOn, bool toggle) @@ -538,7 +538,7 @@ virCapabilitiesAddGuestFeatureInternal(virCapsGuestPtr guest, * Registers a feature for a guest domain. */ void -virCapabilitiesAddGuestFeature(virCapsGuestPtr guest, +virCapabilitiesAddGuestFeature(virCapsGuest *guest, virCapsGuestFeatureType feature) { virCapabilitiesAddGuestFeatureInternal(guest, feature, false, false); @@ -555,7 +555,7 @@ virCapabilitiesAddGuestFeature(virCapsGuestPtr guest, * Registers a feature with toggles for a guest domain. */ void -virCapabilitiesAddGuestFeatureWithToggle(virCapsGuestPtr guest, +virCapabilitiesAddGuestFeatureWithToggle(virCapsGuest *guest, virCapsGuestFeatureType feature, bool defaultOn, bool toggle) @@ -573,7 +573,7 @@ virCapabilitiesAddGuestFeatureWithToggle(virCapsGuestPtr guest, * Returns non-zero on error. */ extern int -virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModelPtr secmodel, +virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModel *secmodel, const char *type, const char *label) { @@ -588,24 +588,24 @@ virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModelPtr secmodel, } -static virCapsDomainDataPtr -virCapabilitiesDomainDataLookupInternal(virCapsPtr caps, +static virCapsDomainData * +virCapabilitiesDomainDataLookupInternal(virCaps *caps, int ostype, virArch arch, virDomainVirtType domaintype, const char *emulator, const char *machinetype) { - virCapsGuestPtr foundguest = NULL; - virCapsGuestDomainPtr founddomain = NULL; - virCapsGuestMachinePtr foundmachine = NULL; - virCapsDomainDataPtr ret = NULL; + virCapsGuest *foundguest = NULL; + virCapsGuestDomain *founddomain = NULL; + virCapsGuestMachine *foundmachine = NULL; + virCapsDomainData *ret = NULL; size_t i, j, k; VIR_DEBUG("Lookup ostype=%d arch=%d domaintype=%d emulator=%s machine=%s", ostype, arch, domaintype, NULLSTR(emulator), NULLSTR(machinetype)); for (i = 0; i < caps->nguests; i++) { - virCapsGuestPtr guest = caps->guests[i]; + virCapsGuest *guest = caps->guests[i]; if (ostype != -1 && guest->ostype != ostype) { VIR_DEBUG("Skip os type want=%d vs got=%d", ostype, guest->ostype); @@ -620,8 +620,8 @@ virCapabilitiesDomainDataLookupInternal(virCapsPtr caps, VIR_DEBUG("Match arch %d", arch); for (j = 0; j < guest->arch.ndomains; j++) { - virCapsGuestDomainPtr domain = guest->arch.domains[j]; - virCapsGuestMachinePtr *machinelist; + virCapsGuestDomain *domain = guest->arch.domains[j]; + virCapsGuestMachine **machinelist; int nmachines; const char *check_emulator = NULL; @@ -651,7 +651,7 @@ virCapabilitiesDomainDataLookupInternal(virCapsPtr caps, } for (k = 0; k < nmachines; k++) { - virCapsGuestMachinePtr machine = machinelist[k]; + virCapsGuestMachine *machine = machinelist[k]; if (machinetype && STRNEQ(machine->name, machinetype) && @@ -733,15 +733,15 @@ virCapabilitiesDomainDataLookupInternal(virCapsPtr caps, * Search capabilities for the passed values, and if found return * virCapabilitiesDomainDataLookup filled in with the default values */ -virCapsDomainDataPtr -virCapabilitiesDomainDataLookup(virCapsPtr caps, +virCapsDomainData * +virCapabilitiesDomainDataLookup(virCaps *caps, int ostype, virArch arch, int domaintype, const char *emulator, const char *machinetype) { - virCapsDomainDataPtr ret; + virCapsDomainData *ret; if (arch == VIR_ARCH_NONE) { /* Prefer host arch if its available */ @@ -760,12 +760,12 @@ virCapabilitiesDomainDataLookup(virCapsPtr caps, bool -virCapabilitiesDomainSupported(virCapsPtr caps, +virCapabilitiesDomainSupported(virCaps *caps, int ostype, virArch arch, int virttype) { - g_autofree virCapsDomainDataPtr capsdata = NULL; + g_autofree virCapsDomainData *capsdata = NULL; capsdata = virCapabilitiesDomainDataLookup(caps, ostype, arch, @@ -777,10 +777,10 @@ virCapabilitiesDomainSupported(virCapsPtr caps, int -virCapabilitiesAddStoragePool(virCapsPtr caps, +virCapabilitiesAddStoragePool(virCaps *caps, int poolType) { - virCapsStoragePoolPtr pool; + virCapsStoragePool *pool; pool = g_new0(virCapsStoragePool, 1); @@ -794,8 +794,8 @@ virCapabilitiesAddStoragePool(virCapsPtr caps, static int -virCapabilitiesHostNUMAFormat(virCapsHostNUMAPtr caps, - virBufferPtr buf) +virCapabilitiesHostNUMAFormat(virCapsHostNUMA *caps, + virBuffer *buf) { size_t i; size_t j; @@ -806,7 +806,7 @@ virCapabilitiesHostNUMAFormat(virCapsHostNUMAPtr caps, virBufferAsprintf(buf, "\n", caps->cells->len); virBufferAdjustIndent(buf, 2); for (i = 0; i < caps->cells->len; i++) { - virCapsHostNUMACellPtr cell = g_ptr_array_index(caps->cells, i); + virCapsHostNUMACell *cell = g_ptr_array_index(caps->cells, i); virBufferAsprintf(buf, "\n", cell->num); virBufferAdjustIndent(buf, 2); @@ -866,8 +866,8 @@ virCapabilitiesHostNUMAFormat(virCapsHostNUMAPtr caps, static int -virCapabilitiesFormatResctrlMonitor(virBufferPtr buf, - virResctrlInfoMonPtr monitor) +virCapabilitiesFormatResctrlMonitor(virBuffer *buf, + virResctrlInfoMon *monitor) { size_t i = 0; g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -905,8 +905,8 @@ virCapabilitiesFormatResctrlMonitor(virBufferPtr buf, } static int -virCapabilitiesFormatCaches(virBufferPtr buf, - virCapsHostCachePtr cache) +virCapabilitiesFormatCaches(virBuffer *buf, + virCapsHostCache *cache) { size_t i = 0; size_t j = 0; @@ -920,7 +920,7 @@ virCapabilitiesFormatCaches(virBufferPtr buf, for (i = 0; i < cache->nbanks; i++) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf); - virCapsHostCacheBankPtr bank = cache->banks[i]; + virCapsHostCacheBank *bank = cache->banks[i]; g_autofree char *cpus_str = virBitmapFormat(bank->cpus); const char *unit = NULL; unsigned long long short_size = virFormatIntPretty(bank->size, &unit); @@ -941,7 +941,7 @@ virCapabilitiesFormatCaches(virBufferPtr buf, for (j = 0; j < bank->ncontrols; j++) { const char *min_unit; - virResctrlInfoPerCachePtr controls = bank->controls[j]; + virResctrlInfoPerCache *controls = bank->controls[j]; unsigned long long gran_short_size = controls->granularity; unsigned long long min_short_size = controls->min; @@ -991,8 +991,8 @@ virCapabilitiesFormatCaches(virBufferPtr buf, } static int -virCapabilitiesFormatMemoryBandwidth(virBufferPtr buf, - virCapsHostMemBWPtr memBW) +virCapabilitiesFormatMemoryBandwidth(virBuffer *buf, + virCapsHostMemBW *memBW) { size_t i = 0; @@ -1005,8 +1005,8 @@ virCapabilitiesFormatMemoryBandwidth(virBufferPtr buf, for (i = 0; i < memBW->nnodes; i++) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf); - virCapsHostMemBWNodePtr node = memBW->nodes[i]; - virResctrlInfoMemBWPerNodePtr control = &node->control; + virCapsHostMemBWNode *node = memBW->nodes[i]; + virResctrlInfoMemBWPerNode *control = &node->control; g_autofree char *cpus_str = virBitmapFormat(node->cpus); if (!cpus_str) @@ -1036,8 +1036,8 @@ virCapabilitiesFormatMemoryBandwidth(virBufferPtr buf, static int -virCapabilitiesFormatHostXML(virCapsHostPtr host, - virBufferPtr buf) +virCapabilitiesFormatHostXML(virCapsHost *host, + virBuffer *buf) { size_t i, j; char host_uuid[VIR_UUID_STRING_BUFLEN]; @@ -1159,14 +1159,14 @@ virCapabilitiesFormatHostXML(virCapsHostPtr host, static void -virCapabilitiesFormatGuestFeatures(virCapsGuestPtr guest, - virBufferPtr buf) +virCapabilitiesFormatGuestFeatures(virCapsGuest *guest, + virBuffer *buf) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); size_t i; for (i = 0; i < VIR_CAPS_GUEST_FEATURE_TYPE_LAST; i++) { - virCapsGuestFeaturePtr feature = guest->features + i; + virCapsGuestFeature *feature = guest->features + i; if (!feature->present) continue; @@ -1191,9 +1191,9 @@ virCapabilitiesFormatGuestFeatures(virCapsGuestPtr guest, static void -virCapabilitiesFormatGuestXML(virCapsGuestPtr *guests, +virCapabilitiesFormatGuestXML(virCapsGuest **guests, size_t nguests, - virBufferPtr buf) + virBuffer *buf) { size_t i, j, k; @@ -1216,7 +1216,7 @@ virCapabilitiesFormatGuestXML(virCapsGuestPtr *guests, guests[i]->arch.defaultInfo.loader); for (j = 0; j < guests[i]->arch.defaultInfo.nmachines; j++) { - virCapsGuestMachinePtr machine = guests[i]->arch.defaultInfo.machines[j]; + virCapsGuestMachine *machine = guests[i]->arch.defaultInfo.machines[j]; virBufferAddLit(buf, "canonical) virBufferAsprintf(buf, " canonical='%s'", machine->canonical); @@ -1246,7 +1246,7 @@ virCapabilitiesFormatGuestXML(virCapsGuestPtr *guests, guests[i]->arch.domains[j]->info.loader); for (k = 0; k < guests[i]->arch.domains[j]->info.nmachines; k++) { - virCapsGuestMachinePtr machine = guests[i]->arch.domains[j]->info.machines[k]; + virCapsGuestMachine *machine = guests[i]->arch.domains[j]->info.machines[k]; virBufferAddLit(buf, "canonical) virBufferAsprintf(buf, " canonical='%s'", machine->canonical); @@ -1270,9 +1270,9 @@ virCapabilitiesFormatGuestXML(virCapsGuestPtr *guests, static void -virCapabilitiesFormatStoragePoolXML(virCapsStoragePoolPtr *pools, +virCapabilitiesFormatStoragePoolXML(virCapsStoragePool **pools, size_t npools, - virBufferPtr buf) + virBuffer *buf) { size_t i; @@ -1304,7 +1304,7 @@ virCapabilitiesFormatStoragePoolXML(virCapsStoragePoolPtr *pools, * Returns the XML document as a string */ char * -virCapabilitiesFormatXML(virCapsPtr caps) +virCapabilitiesFormatXML(virCaps *caps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -1326,15 +1326,14 @@ virCapabilitiesFormatXML(virCapsPtr caps) /* get the maximum ID of cpus in the host */ static unsigned int -virCapabilitiesHostNUMAGetMaxcpu(virCapsHostNUMAPtr caps) +virCapabilitiesHostNUMAGetMaxcpu(virCapsHostNUMA *caps) { unsigned int maxcpu = 0; size_t node; size_t cpu; for (node = 0; node < caps->cells->len; node++) { - virCapsHostNUMACellPtr cell = - g_ptr_array_index(caps->cells, node); + virCapsHostNUMACell *cell = g_ptr_array_index(caps->cells, node); for (cpu = 0; cpu < cell->ncpus; cpu++) { if (cell->cpus[cpu].id > maxcpu) @@ -1347,11 +1346,11 @@ virCapabilitiesHostNUMAGetMaxcpu(virCapsHostNUMAPtr caps) /* set cpus of a numa node in the bitmask */ static int -virCapabilitiesHostNUMAGetCellCpus(virCapsHostNUMAPtr caps, +virCapabilitiesHostNUMAGetCellCpus(virCapsHostNUMA *caps, size_t node, - virBitmapPtr cpumask) + virBitmap *cpumask) { - virCapsHostNUMACellPtr cell = NULL; + virCapsHostNUMACell *cell = NULL; size_t cpu; size_t i; /* The numa node numbers can be non-contiguous. Ex: 0,1,16,17. */ @@ -1375,11 +1374,11 @@ virCapabilitiesHostNUMAGetCellCpus(virCapsHostNUMAPtr caps, return 0; } -virBitmapPtr -virCapabilitiesHostNUMAGetCpus(virCapsHostNUMAPtr caps, - virBitmapPtr nodemask) +virBitmap * +virCapabilitiesHostNUMAGetCpus(virCapsHostNUMA *caps, + virBitmap *nodemask) { - virBitmapPtr ret = NULL; + virBitmap *ret = NULL; unsigned int maxcpu = virCapabilitiesHostNUMAGetMaxcpu(caps); ssize_t node = -1; @@ -1423,7 +1422,7 @@ virCapabilitiesGetNodeInfo(virNodeInfoPtr nodeinfo) /* returns 1 on success, 0 if the detection failed and -1 on hard error */ static int virCapabilitiesFillCPUInfo(int cpu_id G_GNUC_UNUSED, - virCapsHostNUMACellCPUPtr cpu G_GNUC_UNUSED) + virCapsHostNUMACellCPU *cpu G_GNUC_UNUSED) { #ifdef __linux__ cpu->id = cpu_id; @@ -1446,10 +1445,10 @@ virCapabilitiesFillCPUInfo(int cpu_id G_GNUC_UNUSED, static int virCapabilitiesGetNUMASiblingInfo(int node, - virCapsHostNUMACellSiblingInfoPtr *siblings, + virCapsHostNUMACellSiblingInfo **siblings, int *nsiblings) { - virCapsHostNUMACellSiblingInfoPtr tmp = NULL; + virCapsHostNUMACellSiblingInfo *tmp = NULL; int tmp_size = 0; int ret = -1; int *distances = NULL; @@ -1490,7 +1489,7 @@ virCapabilitiesGetNUMASiblingInfo(int node, static int virCapabilitiesGetNUMAPagesInfo(int node, - virCapsHostNUMACellPageInfoPtr *pageinfo, + virCapsHostNUMACellPageInfo **pageinfo, int *npageinfo) { int ret = -1; @@ -1519,10 +1518,10 @@ virCapabilitiesGetNUMAPagesInfo(int node, static int -virCapabilitiesHostNUMAInitFake(virCapsHostNUMAPtr caps) +virCapabilitiesHostNUMAInitFake(virCapsHostNUMA *caps) { virNodeInfo nodeinfo; - virCapsHostNUMACellCPUPtr cpus; + virCapsHostNUMACellCPU *cpus; int ncpus; int n, s, c, t; int id, cid; @@ -1583,15 +1582,15 @@ virCapabilitiesHostNUMAInitFake(virCapsHostNUMAPtr caps) static int -virCapabilitiesHostNUMAInitReal(virCapsHostNUMAPtr caps) +virCapabilitiesHostNUMAInitReal(virCapsHostNUMA *caps) { int n; unsigned long long memory; - virCapsHostNUMACellCPUPtr cpus = NULL; - virBitmapPtr cpumap = NULL; - virCapsHostNUMACellSiblingInfoPtr siblings = NULL; + virCapsHostNUMACellCPU *cpus = NULL; + virBitmap *cpumap = NULL; + virCapsHostNUMACellSiblingInfo *siblings = NULL; int nsiblings = 0; - virCapsHostNUMACellPageInfoPtr pageinfo = NULL; + virCapsHostNUMACellPageInfo *pageinfo = NULL; int npageinfo; int ret = -1; int ncpus = 0; @@ -1654,10 +1653,10 @@ virCapabilitiesHostNUMAInitReal(virCapsHostNUMAPtr caps) } -virCapsHostNUMAPtr +virCapsHostNUMA * virCapabilitiesHostNUMANew(void) { - virCapsHostNUMAPtr caps = NULL; + virCapsHostNUMA *caps = NULL; caps = g_new0(virCapsHostNUMA, 1); caps->refs = 1; @@ -1668,10 +1667,10 @@ virCapabilitiesHostNUMANew(void) } -virCapsHostNUMAPtr +virCapsHostNUMA * virCapabilitiesHostNUMANewHost(void) { - virCapsHostNUMAPtr caps = virCapabilitiesHostNUMANew(); + virCapsHostNUMA *caps = virCapabilitiesHostNUMANew(); if (virNumaIsAvailable()) { if (virCapabilitiesHostNUMAInitReal(caps) == 0) @@ -1692,7 +1691,7 @@ virCapabilitiesHostNUMANewHost(void) int -virCapabilitiesInitPages(virCapsPtr caps) +virCapabilitiesInitPages(virCaps *caps) { int ret = -1; unsigned int *pages_size = NULL; @@ -1714,8 +1713,8 @@ virCapabilitiesInitPages(virCapsPtr caps) bool -virCapsHostCacheBankEquals(virCapsHostCacheBankPtr a, - virCapsHostCacheBankPtr b) +virCapsHostCacheBankEquals(virCapsHostCacheBank *a, + virCapsHostCacheBank *b) { return (a->id == b->id && a->level == b->level && @@ -1725,7 +1724,7 @@ virCapsHostCacheBankEquals(virCapsHostCacheBankPtr a, } void -virCapsHostCacheBankFree(virCapsHostCacheBankPtr ptr) +virCapsHostCacheBankFree(virCapsHostCacheBank *ptr) { size_t i; @@ -1744,8 +1743,8 @@ static int virCapsHostCacheBankSorter(const void *a, const void *b) { - virCapsHostCacheBankPtr ca = *(virCapsHostCacheBankPtr *)a; - virCapsHostCacheBankPtr cb = *(virCapsHostCacheBankPtr *)b; + virCapsHostCacheBank *ca = *(virCapsHostCacheBank **)a; + virCapsHostCacheBank *cb = *(virCapsHostCacheBank **)b; if (ca->level < cb->level) return -1; @@ -1757,7 +1756,7 @@ virCapsHostCacheBankSorter(const void *a, static int -virCapabilitiesInitResctrl(virCapsPtr caps) +virCapabilitiesInitResctrl(virCaps *caps) { if (caps->host.resctrl) return 0; @@ -1771,16 +1770,16 @@ virCapabilitiesInitResctrl(virCapsPtr caps) static int -virCapabilitiesInitResctrlMemory(virCapsPtr caps) +virCapabilitiesInitResctrlMemory(virCaps *caps) { - virCapsHostMemBWNodePtr node = NULL; + virCapsHostMemBWNode *node = NULL; size_t i = 0; int ret = -1; const virResctrlMonitorType montype = VIR_RESCTRL_MONITOR_TYPE_MEMBW; const char *prefix = virResctrlMonitorPrefixTypeToString(montype); for (i = 0; i < caps->host.cache.nbanks; i++) { - virCapsHostCacheBankPtr bank = caps->host.cache.banks[i]; + virCapsHostCacheBank *bank = caps->host.cache.banks[i]; node = g_new0(virCapsHostMemBWNode, 1); if (virResctrlInfoGetMemoryBandwidth(caps->host.resctrl, @@ -1809,16 +1808,16 @@ virCapabilitiesInitResctrlMemory(virCapsPtr caps) int -virCapabilitiesInitCaches(virCapsPtr caps) +virCapabilitiesInitCaches(virCaps *caps) { size_t i = 0; - virBitmapPtr cpus = NULL; + virBitmap *cpus = NULL; ssize_t pos = -1; int ret = -1; char *path = NULL; char *type = NULL; struct dirent *ent = NULL; - virCapsHostCacheBankPtr bank = NULL; + virCapsHostCacheBank *bank = NULL; const virResctrlMonitorType montype = VIR_RESCTRL_MONITOR_TYPE_CACHE; const char *prefix = virResctrlMonitorPrefixTypeToString(montype); @@ -1952,7 +1951,7 @@ virCapabilitiesInitCaches(virCapsPtr caps) void -virCapabilitiesHostInitIOMMU(virCapsPtr caps) +virCapabilitiesHostInitIOMMU(virCaps *caps) { caps->host.iommu = virHostHasIOMMU(); } diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h index 5fd59efc05..66cae4b902 100644 --- a/src/conf/capabilities.h +++ b/src/conf/capabilities.h @@ -63,7 +63,7 @@ struct _virCapsGuestDomainInfo { char *emulator; char *loader; int nmachines; - virCapsGuestMachinePtr *machines; + virCapsGuestMachine **machines; }; struct _virCapsGuestDomain { @@ -77,7 +77,7 @@ struct _virCapsGuestArch { virCapsGuestDomainInfo defaultInfo; size_t ndomains; size_t ndomains_max; - virCapsGuestDomainPtr *domains; + virCapsGuestDomain **domains; }; struct _virCapsGuest { @@ -91,7 +91,7 @@ struct _virCapsHostNUMACellCPU { unsigned int socket_id; unsigned int die_id; unsigned int core_id; - virBitmapPtr siblings; + virBitmap *siblings; }; struct _virCapsHostNUMACellSiblingInfo { @@ -108,11 +108,11 @@ struct _virCapsHostNUMACell { int num; int ncpus; unsigned long long mem; /* in kibibytes */ - virCapsHostNUMACellCPUPtr cpus; + virCapsHostNUMACellCPU *cpus; int nsiblings; - virCapsHostNUMACellSiblingInfoPtr siblings; + virCapsHostNUMACellSiblingInfo *siblings; int npageinfo; - virCapsHostNUMACellPageInfoPtr pageinfo; + virCapsHostNUMACellPageInfo *pageinfo; }; struct _virCapsHostNUMA { @@ -129,7 +129,7 @@ struct _virCapsHostSecModel { char *model; char *doi; size_t nlabels; - virCapsHostSecModelLabelPtr labels; + virCapsHostSecModelLabel *labels; }; struct _virCapsHostCacheBank { @@ -137,29 +137,29 @@ struct _virCapsHostCacheBank { unsigned int level; /* 1=L1, 2=L2, 3=L3, etc. */ unsigned long long size; /* B */ virCacheType type; /* Data, Instruction or Unified */ - virBitmapPtr cpus; /* All CPUs that share this bank */ + virBitmap *cpus; /* All CPUs that share this bank */ size_t ncontrols; - virResctrlInfoPerCachePtr *controls; + virResctrlInfoPerCache **controls; }; struct _virCapsHostCache { size_t nbanks; - virCapsHostCacheBankPtr *banks; + virCapsHostCacheBank **banks; - virResctrlInfoMonPtr monitor; + virResctrlInfoMon *monitor; }; struct _virCapsHostMemBWNode { unsigned int id; - virBitmapPtr cpus; /* All CPUs that belong to this node */ + virBitmap *cpus; /* All CPUs that belong to this node */ virResctrlInfoMemBWPerNode control; }; struct _virCapsHostMemBW { size_t nnodes; - virCapsHostMemBWNodePtr *nodes; + virCapsHostMemBWNode **nodes; - virResctrlInfoMonPtr monitor; + virResctrlInfoMon *monitor; }; struct _virCapsHost { @@ -176,19 +176,19 @@ struct _virCapsHost { size_t nmigrateTrans_max; char **migrateTrans; - virCapsHostNUMAPtr numa; + virCapsHostNUMA *numa; - virResctrlInfoPtr resctrl; + virResctrlInfo *resctrl; virCapsHostCache cache; virCapsHostMemBW memBW; size_t nsecModels; - virCapsHostSecModelPtr secModels; + virCapsHostSecModel *secModels; char *netprefix; - virCPUDefPtr cpu; + virCPUDef *cpu; int nPagesSize; /* size of pagesSize array */ unsigned int *pagesSize; /* page sizes support on the system */ unsigned char host_uuid[VIR_UUID_BUFLEN]; @@ -206,11 +206,11 @@ struct _virCaps { virCapsHost host; size_t nguests; size_t nguests_max; - virCapsGuestPtr *guests; + virCapsGuest **guests; size_t npools; size_t npools_max; - virCapsStoragePoolPtr *pools; + virCapsStoragePool **pools; }; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCaps, virObjectUnref); @@ -225,88 +225,88 @@ struct _virCapsDomainData { }; -virCapsPtr +virCaps * virCapabilitiesNew(virArch hostarch, bool offlineMigrate, bool liveMigrate); void -virCapabilitiesHostNUMAUnref(virCapsHostNUMAPtr caps); +virCapabilitiesHostNUMAUnref(virCapsHostNUMA *caps); void -virCapabilitiesHostNUMARef(virCapsHostNUMAPtr caps); +virCapabilitiesHostNUMARef(virCapsHostNUMA *caps); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCapsHostNUMA, virCapabilitiesHostNUMAUnref); int -virCapabilitiesAddHostFeature(virCapsPtr caps, +virCapabilitiesAddHostFeature(virCaps *caps, const char *name); int -virCapabilitiesAddHostMigrateTransport(virCapsPtr caps, +virCapabilitiesAddHostMigrateTransport(virCaps *caps, const char *name); int -virCapabilitiesSetNetPrefix(virCapsPtr caps, +virCapabilitiesSetNetPrefix(virCaps *caps, const char *prefix); void -virCapabilitiesHostNUMAAddCell(virCapsHostNUMAPtr caps, +virCapabilitiesHostNUMAAddCell(virCapsHostNUMA *caps, int num, unsigned long long mem, int ncpus, - virCapsHostNUMACellCPUPtr cpus, + virCapsHostNUMACellCPU *cpus, int nsiblings, - virCapsHostNUMACellSiblingInfoPtr siblings, + virCapsHostNUMACellSiblingInfo *siblings, int npageinfo, - virCapsHostNUMACellPageInfoPtr pageinfo); + virCapsHostNUMACellPageInfo *pageinfo); -virCapsGuestMachinePtr * +virCapsGuestMachine ** virCapabilitiesAllocMachines(const char *const *names, int nnames); void -virCapabilitiesFreeMachines(virCapsGuestMachinePtr *machines, +virCapabilitiesFreeMachines(virCapsGuestMachine **machines, int nmachines); void -virCapabilitiesFreeGuest(virCapsGuestPtr guest); +virCapabilitiesFreeGuest(virCapsGuest *guest); -virCapsGuestPtr -virCapabilitiesAddGuest(virCapsPtr caps, +virCapsGuest * +virCapabilitiesAddGuest(virCaps *caps, int ostype, virArch arch, const char *emulator, const char *loader, int nmachines, - virCapsGuestMachinePtr *machines); + virCapsGuestMachine **machines); -virCapsGuestDomainPtr -virCapabilitiesAddGuestDomain(virCapsGuestPtr guest, +virCapsGuestDomain * +virCapabilitiesAddGuestDomain(virCapsGuest *guest, int hvtype, const char *emulator, const char *loader, int nmachines, - virCapsGuestMachinePtr *machines); + virCapsGuestMachine **machines); void -virCapabilitiesAddGuestFeature(virCapsGuestPtr guest, +virCapabilitiesAddGuestFeature(virCapsGuest *guest, virCapsGuestFeatureType feature); void -virCapabilitiesAddGuestFeatureWithToggle(virCapsGuestPtr guest, +virCapabilitiesAddGuestFeatureWithToggle(virCapsGuest *guest, virCapsGuestFeatureType feature, bool defaultOn, bool toggle); int -virCapabilitiesAddStoragePool(virCapsPtr caps, +virCapabilitiesAddStoragePool(virCaps *caps, int poolType); int -virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModelPtr secmodel, +virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModel *secmodel, const char *type, const char *label); -virCapsDomainDataPtr -virCapabilitiesDomainDataLookup(virCapsPtr caps, +virCapsDomainData * +virCapabilitiesDomainDataLookup(virCaps *caps, int ostype, virArch arch, int domaintype, @@ -314,33 +314,33 @@ virCapabilitiesDomainDataLookup(virCapsPtr caps, const char *machinetype); bool -virCapabilitiesDomainSupported(virCapsPtr caps, +virCapabilitiesDomainSupported(virCaps *caps, int ostype, virArch arch, int domaintype); void -virCapabilitiesClearHostNUMACellCPUTopology(virCapsHostNUMACellCPUPtr cpu, +virCapabilitiesClearHostNUMACellCPUTopology(virCapsHostNUMACellCPU *cpu, size_t ncpus); char * -virCapabilitiesFormatXML(virCapsPtr caps); +virCapabilitiesFormatXML(virCaps *caps); -virBitmapPtr virCapabilitiesHostNUMAGetCpus(virCapsHostNUMAPtr caps, - virBitmapPtr nodemask); +virBitmap *virCapabilitiesHostNUMAGetCpus(virCapsHostNUMA *caps, + virBitmap *nodemask); int virCapabilitiesGetNodeInfo(virNodeInfoPtr nodeinfo); -int virCapabilitiesInitPages(virCapsPtr caps); +int virCapabilitiesInitPages(virCaps *caps); -virCapsHostNUMAPtr virCapabilitiesHostNUMANew(void); -virCapsHostNUMAPtr virCapabilitiesHostNUMANewHost(void); +virCapsHostNUMA *virCapabilitiesHostNUMANew(void); +virCapsHostNUMA *virCapabilitiesHostNUMANewHost(void); -bool virCapsHostCacheBankEquals(virCapsHostCacheBankPtr a, - virCapsHostCacheBankPtr b); -void virCapsHostCacheBankFree(virCapsHostCacheBankPtr ptr); +bool virCapsHostCacheBankEquals(virCapsHostCacheBank *a, + virCapsHostCacheBank *b); +void virCapsHostCacheBankFree(virCapsHostCacheBank *ptr); -int virCapabilitiesInitCaches(virCapsPtr caps); +int virCapabilitiesInitCaches(virCaps *caps); -void virCapabilitiesHostInitIOMMU(virCapsPtr caps); +void virCapabilitiesHostInitIOMMU(virCaps *caps); diff --git a/src/conf/checkpoint_conf.c b/src/conf/checkpoint_conf.c index cd48570b51..7b26da416b 100644 --- a/src/conf/checkpoint_conf.c +++ b/src/conf/checkpoint_conf.c @@ -42,7 +42,7 @@ VIR_LOG_INIT("conf.checkpoint_conf"); -static virClassPtr virDomainCheckpointDefClass; +static virClass *virDomainCheckpointDefClass; static void virDomainCheckpointDefDispose(void *obj); static int @@ -63,14 +63,14 @@ VIR_ENUM_IMPL(virDomainCheckpoint, /* Checkpoint Def functions */ static void -virDomainCheckpointDiskDefClear(virDomainCheckpointDiskDefPtr disk) +virDomainCheckpointDiskDefClear(virDomainCheckpointDiskDef *disk) { VIR_FREE(disk->name); VIR_FREE(disk->bitmap); } /* Allocate a new virDomainCheckpointDef; free with virObjectUnref() */ -virDomainCheckpointDefPtr +virDomainCheckpointDef * virDomainCheckpointDefNew(void) { if (virDomainCheckpointInitialize() < 0) @@ -82,7 +82,7 @@ virDomainCheckpointDefNew(void) static void virDomainCheckpointDefDispose(void *obj) { - virDomainCheckpointDefPtr def = obj; + virDomainCheckpointDef *def = obj; size_t i; for (i = 0; i < def->ndisks; i++) @@ -93,7 +93,7 @@ virDomainCheckpointDefDispose(void *obj) static int virDomainCheckpointDiskDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virDomainCheckpointDiskDefPtr def) + virDomainCheckpointDiskDef *def) { g_autofree char *checkpoint = NULL; VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -117,13 +117,13 @@ virDomainCheckpointDiskDefParseXML(xmlNodePtr node, /* flags is bitwise-or of virDomainCheckpointParseFlags. */ -static virDomainCheckpointDefPtr +static virDomainCheckpointDef * virDomainCheckpointDefParse(xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque, unsigned int flags) { - virDomainCheckpointDefPtr ret = NULL; + virDomainCheckpointDef *ret = NULL; size_t i; int n; g_autofree xmlNodePtr *nodes = NULL; @@ -185,10 +185,10 @@ virDomainCheckpointDefParse(xmlXPathContextPtr ctxt, return ret; } -static virDomainCheckpointDefPtr +static virDomainCheckpointDef * virDomainCheckpointDefParseNode(xmlDocPtr xml, xmlNodePtr root, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque, unsigned int flags) { @@ -216,13 +216,13 @@ virDomainCheckpointDefParseNode(xmlDocPtr xml, return virDomainCheckpointDefParse(ctxt, xmlopt, parseOpaque, flags); } -virDomainCheckpointDefPtr +virDomainCheckpointDef * virDomainCheckpointDefParseString(const char *xmlStr, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque, unsigned int flags) { - virDomainCheckpointDefPtr ret = NULL; + virDomainCheckpointDef *ret = NULL; xmlDocPtr xml; int keepBlanksDefault = xmlKeepBlanksDefault(0); @@ -246,12 +246,12 @@ virDomainCheckpointDefParseString(const char *xmlStr, * success, -1 on error. */ static int -virDomainCheckpointDefAssignBitmapNames(virDomainCheckpointDefPtr def) +virDomainCheckpointDefAssignBitmapNames(virDomainCheckpointDef *def) { size_t i; for (i = 0; i < def->ndisks; i++) { - virDomainCheckpointDiskDefPtr disk = &def->disks[i]; + virDomainCheckpointDiskDef *disk = &def->disks[i]; if (disk->type != VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP || disk->bitmap) @@ -270,11 +270,11 @@ virDomainCheckpointDefAssignBitmapNames(virDomainCheckpointDefPtr def) * if any def->disks[n]->name appears more than once or does not map * to dom->disks. */ int -virDomainCheckpointAlignDisks(virDomainCheckpointDefPtr chkdef) +virDomainCheckpointAlignDisks(virDomainCheckpointDef *chkdef) { - virDomainDefPtr domdef = chkdef->parent.dom; + virDomainDef *domdef = chkdef->parent.dom; g_autoptr(GHashTable) map = virHashNew(NULL); - g_autofree virDomainCheckpointDiskDefPtr olddisks = NULL; + g_autofree virDomainCheckpointDiskDef *olddisks = NULL; size_t i; int checkpoint_default = VIR_DOMAIN_CHECKPOINT_TYPE_NONE; @@ -304,8 +304,8 @@ virDomainCheckpointAlignDisks(virDomainCheckpointDefPtr chkdef) /* Double check requested disks. */ for (i = 0; i < chkdef->ndisks; i++) { - virDomainCheckpointDiskDefPtr chkdisk = &chkdef->disks[i]; - virDomainDiskDefPtr domdisk = virDomainDiskByName(domdef, chkdisk->name, false); + virDomainCheckpointDiskDef *chkdisk = &chkdef->disks[i]; + virDomainDiskDef *domdisk = virDomainDiskByName(domdef, chkdisk->name, false); if (!domdisk) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -343,9 +343,9 @@ virDomainCheckpointAlignDisks(virDomainCheckpointDefPtr chkdef) chkdef->ndisks = domdef->ndisks; for (i = 0; i < domdef->ndisks; i++) { - virDomainDiskDefPtr domdisk = domdef->disks[i]; - virDomainCheckpointDiskDefPtr chkdisk = chkdef->disks + i; - virDomainCheckpointDiskDefPtr existing; + virDomainDiskDef *domdisk = domdef->disks[i]; + virDomainCheckpointDiskDef *chkdisk = chkdef->disks + i; + virDomainCheckpointDiskDef *existing; /* copy existing disks */ if ((existing = virHashLookup(map, domdisk->dst))) { @@ -391,8 +391,8 @@ unsigned int virDomainCheckpointFormatConvertXMLFlags(unsigned int flags) static int -virDomainCheckpointDiskDefFormat(virBufferPtr buf, - virDomainCheckpointDiskDefPtr disk, +virDomainCheckpointDiskDefFormat(virBuffer *buf, + virDomainCheckpointDiskDef *disk, unsigned int flags) { if (!disk->name) @@ -413,9 +413,9 @@ virDomainCheckpointDiskDefFormat(virBufferPtr buf, static int -virDomainCheckpointDefFormatInternal(virBufferPtr buf, - virDomainCheckpointDefPtr def, - virDomainXMLOptionPtr xmlopt, +virDomainCheckpointDefFormatInternal(virBuffer *buf, + virDomainCheckpointDef *def, + virDomainXMLOption *xmlopt, unsigned int flags) { size_t i; @@ -469,8 +469,8 @@ virDomainCheckpointDefFormatInternal(virBufferPtr buf, char * -virDomainCheckpointDefFormat(virDomainCheckpointDefPtr def, - virDomainXMLOptionPtr xmlopt, +virDomainCheckpointDefFormat(virDomainCheckpointDef *def, + virDomainXMLOption *xmlopt, unsigned int flags) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -487,11 +487,11 @@ virDomainCheckpointDefFormat(virDomainCheckpointDefPtr def, int -virDomainCheckpointRedefinePrep(virDomainObjPtr vm, - virDomainCheckpointDefPtr def, +virDomainCheckpointRedefinePrep(virDomainObj *vm, + virDomainCheckpointDef *def, bool *update_current) { - virDomainMomentObjPtr parent = NULL; + virDomainMomentObj *parent = NULL; if (virDomainCheckpointCheckCycles(vm->checkpoints, def, vm->def->name) < 0) return -1; @@ -528,14 +528,14 @@ virDomainCheckpointRedefinePrep(virDomainObjPtr vm, } -virDomainMomentObjPtr -virDomainCheckpointRedefineCommit(virDomainObjPtr vm, - virDomainCheckpointDefPtr *defptr) +virDomainMomentObj * +virDomainCheckpointRedefineCommit(virDomainObj *vm, + virDomainCheckpointDef **defptr) { - virDomainCheckpointDefPtr def = *defptr; - virDomainMomentObjPtr other = NULL; - virDomainCheckpointDefPtr otherdef = NULL; - virDomainMomentObjPtr chk = NULL; + virDomainCheckpointDef *def = *defptr; + virDomainMomentObj *other = NULL; + virDomainCheckpointDef *otherdef = NULL; + virDomainMomentObj *chk = NULL; other = virDomainCheckpointFindByName(vm->checkpoints, def->parent.name); if (other) { diff --git a/src/conf/checkpoint_conf.h b/src/conf/checkpoint_conf.h index 9cb5155998..b11ec07b68 100644 --- a/src/conf/checkpoint_conf.h +++ b/src/conf/checkpoint_conf.h @@ -39,7 +39,6 @@ typedef enum { /* Stores disk-checkpoint information */ typedef struct _virDomainCheckpointDiskDef virDomainCheckpointDiskDef; -typedef virDomainCheckpointDiskDef *virDomainCheckpointDiskDefPtr; struct _virDomainCheckpointDiskDef { char *name; /* name matching the refs = 1; return cpu; } void -virCPUDefFreeFeatures(virCPUDefPtr def) +virCPUDefFreeFeatures(virCPUDef *def) { size_t i; @@ -106,7 +106,7 @@ virCPUDefFreeFeatures(virCPUDefPtr def) void ATTRIBUTE_NONNULL(1) -virCPUDefFreeModel(virCPUDefPtr def) +virCPUDefFreeModel(virCPUDef *def) { VIR_FREE(def->model); VIR_FREE(def->vendor); @@ -115,13 +115,13 @@ virCPUDefFreeModel(virCPUDefPtr def) } void -virCPUDefRef(virCPUDefPtr def) +virCPUDefRef(virCPUDef *def) { g_atomic_int_inc(&def->refs); } void -virCPUDefFree(virCPUDefPtr def) +virCPUDefFree(virCPUDef *def) { if (!def) return; @@ -136,7 +136,7 @@ virCPUDefFree(virCPUDefPtr def) int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) -virCPUDefCopyModel(virCPUDefPtr dst, +virCPUDefCopyModel(virCPUDef *dst, const virCPUDef *src, bool resetPolicy) { @@ -145,7 +145,7 @@ virCPUDefCopyModel(virCPUDefPtr dst, int -virCPUDefCopyModelFilter(virCPUDefPtr dst, +virCPUDefCopyModelFilter(virCPUDef *dst, const virCPUDef *src, bool resetPolicy, virCPUDefFeatureFilter filter, @@ -193,8 +193,8 @@ virCPUDefCopyModelFilter(virCPUDefPtr dst, * than overwriting it with the values from @src. */ void -virCPUDefStealModel(virCPUDefPtr dst, - virCPUDefPtr src, +virCPUDefStealModel(virCPUDef *dst, + virCPUDef *src, bool keepVendor) { char *vendor = NULL; @@ -225,7 +225,7 @@ virCPUDefStealModel(virCPUDefPtr dst, } -virCPUDefPtr +virCPUDef * virCPUDefCopyWithoutModel(const virCPUDef *cpu) { g_autoptr(virCPUDef) copy = NULL; @@ -260,7 +260,7 @@ virCPUDefCopyWithoutModel(const virCPUDef *cpu) } -virCPUDefPtr +virCPUDef * virCPUDefCopy(const virCPUDef *cpu) { g_autoptr(virCPUDef) copy = NULL; @@ -278,7 +278,7 @@ virCPUDefCopy(const virCPUDef *cpu) int virCPUDefParseXMLString(const char *xml, virCPUType type, - virCPUDefPtr *cpu, + virCPUDef **cpu, bool validateXML) { xmlDocPtr doc = NULL; @@ -321,7 +321,7 @@ int virCPUDefParseXML(xmlXPathContextPtr ctxt, const char *xpath, virCPUType type, - virCPUDefPtr *cpu, + virCPUDef **cpu, bool validateXML) { g_autoptr(virCPUDef) def = NULL; @@ -334,7 +334,7 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, g_autofree char *vendor_id = NULL; g_autofree char *tscScaling = NULL; g_autofree char *migratable = NULL; - g_autofree virHostCPUTscInfoPtr tsc = NULL; + g_autofree virHostCPUTscInfo *tsc = NULL; *cpu = NULL; @@ -676,8 +676,8 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, char * -virCPUDefFormat(virCPUDefPtr def, - virDomainNumaPtr numa) +virCPUDefFormat(virCPUDef *def, + virDomainNuma *numa) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -689,9 +689,9 @@ virCPUDefFormat(virCPUDefPtr def, int -virCPUDefFormatBufFull(virBufferPtr buf, - virCPUDefPtr def, - virDomainNumaPtr numa) +virCPUDefFormatBufFull(virBuffer *buf, + virCPUDef *def, + virDomainNuma *numa) { g_auto(virBuffer) attributeBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -751,8 +751,8 @@ virCPUDefFormatBufFull(virBufferPtr buf, } int -virCPUDefFormatBuf(virBufferPtr buf, - virCPUDefPtr def) +virCPUDefFormatBuf(virBuffer *buf, + virCPUDef *def) { size_t i; bool formatModel; @@ -830,7 +830,7 @@ virCPUDefFormatBuf(virBufferPtr buf, } for (i = 0; i < def->nfeatures; i++) { - virCPUFeatureDefPtr feature = def->features + i; + virCPUFeatureDef *feature = def->features + i; if (!feature->name) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -867,12 +867,12 @@ typedef enum { } virCPUDefAddFeatureMode; static int -virCPUDefAddFeatureInternal(virCPUDefPtr def, +virCPUDefAddFeatureInternal(virCPUDef *def, const char *name, int policy, virCPUDefAddFeatureMode mode) { - virCPUFeatureDefPtr feat; + virCPUFeatureDef *feat; if (def->type == VIR_CPU_TYPE_HOST) policy = -1; @@ -904,7 +904,7 @@ virCPUDefAddFeatureInternal(virCPUDefPtr def, } int -virCPUDefUpdateFeature(virCPUDefPtr def, +virCPUDefUpdateFeature(virCPUDef *def, const char *name, int policy) { @@ -913,7 +913,7 @@ virCPUDefUpdateFeature(virCPUDefPtr def, } int -virCPUDefAddFeature(virCPUDefPtr def, +virCPUDefAddFeature(virCPUDef *def, const char *name, int policy) { @@ -923,7 +923,7 @@ virCPUDefAddFeature(virCPUDefPtr def, int -virCPUDefAddFeatureIfMissing(virCPUDefPtr def, +virCPUDefAddFeatureIfMissing(virCPUDef *def, const char *name, int policy) { @@ -932,7 +932,7 @@ virCPUDefAddFeatureIfMissing(virCPUDefPtr def, } -virCPUFeatureDefPtr +virCPUFeatureDef * virCPUDefFindFeature(const virCPUDef *def, const char *name) { @@ -948,7 +948,7 @@ virCPUDefFindFeature(const virCPUDef *def, int -virCPUDefFilterFeatures(virCPUDefPtr cpu, +virCPUDefFilterFeatures(virCPUDef *cpu, virCPUDefFeatureFilter filter, void *opaque) { @@ -978,7 +978,7 @@ virCPUDefFilterFeatures(virCPUDefPtr cpu, * Returns the number of features matching @filter or -1 on error. */ int -virCPUDefCheckFeatures(virCPUDefPtr cpu, +virCPUDefCheckFeatures(virCPUDef *cpu, virCPUDefFeatureFilter filter, void *opaque, char ***features) @@ -1003,8 +1003,8 @@ virCPUDefCheckFeatures(virCPUDefPtr cpu, bool -virCPUDefIsEqual(virCPUDefPtr src, - virCPUDefPtr dst, +virCPUDefIsEqual(virCPUDef *src, + virCPUDef *dst, bool reportError) { size_t i; @@ -1130,14 +1130,14 @@ virCPUDefIsEqual(virCPUDefPtr src, /* * Parses a list of CPU XMLs into a NULL-terminated list of CPU defs. */ -virCPUDefPtr * +virCPUDef ** virCPUDefListParse(const char **xmlCPUs, unsigned int ncpus, virCPUType cpuType) { xmlDocPtr doc = NULL; xmlXPathContextPtr ctxt = NULL; - virCPUDefPtr *cpus = NULL; + virCPUDef **cpus = NULL; size_t i; VIR_DEBUG("xmlCPUs=%p, ncpus=%u", xmlCPUs, ncpus); @@ -1158,7 +1158,7 @@ virCPUDefListParse(const char **xmlCPUs, goto error; } - cpus = g_new0(virCPUDefPtr, ncpus + 1); + cpus = g_new0(virCPUDef *, ncpus + 1); for (i = 0; i < ncpus; i++) { if (!(doc = virXMLParseStringCtxt(xmlCPUs[i], _("(CPU_definition)"), &ctxt))) @@ -1187,9 +1187,9 @@ virCPUDefListParse(const char **xmlCPUs, * Frees NULL-terminated list of CPUs created by virCPUDefListParse. */ void -virCPUDefListFree(virCPUDefPtr *cpus) +virCPUDefListFree(virCPUDef **cpus) { - virCPUDefPtr *cpu; + virCPUDef **cpu; if (!cpus) return; diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h index ee4b34007e..b0a81895be 100644 --- a/src/conf/cpu_conf.h +++ b/src/conf/cpu_conf.h @@ -94,7 +94,6 @@ typedef enum { VIR_ENUM_DECL(virCPUFeaturePolicy); typedef struct _virCPUFeatureDef virCPUFeatureDef; -typedef virCPUFeatureDef *virCPUFeatureDefPtr; struct _virCPUFeatureDef { char *name; int policy; /* enum virCPUFeaturePolicy */ @@ -112,7 +111,6 @@ typedef enum { VIR_ENUM_DECL(virCPUCacheMode); typedef struct _virCPUCacheDef virCPUCacheDef; -typedef virCPUCacheDef *virCPUCacheDefPtr; struct _virCPUCacheDef { int level; /* -1 for unspecified */ virCPUCacheMode mode; @@ -120,7 +118,6 @@ struct _virCPUCacheDef { typedef struct _virCPUDef virCPUDef; -typedef virCPUDef *virCPUDefPtr; struct _virCPUDef { int refs; int type; /* enum virCPUType */ @@ -139,28 +136,28 @@ struct _virCPUDef { unsigned int threads; size_t nfeatures; size_t nfeatures_max; - virCPUFeatureDefPtr features; - virCPUCacheDefPtr cache; - virHostCPUTscInfoPtr tsc; + virCPUFeatureDef *features; + virCPUCacheDef *cache; + virHostCPUTscInfo *tsc; virTristateSwitch migratable; /* for host-passthrough mode */ }; -virCPUDefPtr virCPUDefNew(void); +virCPUDef *virCPUDefNew(void); void ATTRIBUTE_NONNULL(1) -virCPUDefFreeFeatures(virCPUDefPtr def); +virCPUDefFreeFeatures(virCPUDef *def); void ATTRIBUTE_NONNULL(1) -virCPUDefFreeModel(virCPUDefPtr def); +virCPUDefFreeModel(virCPUDef *def); void -virCPUDefRef(virCPUDefPtr def); +virCPUDefRef(virCPUDef *def); void -virCPUDefFree(virCPUDefPtr def); +virCPUDefFree(virCPUDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUDef, virCPUDefFree); int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) -virCPUDefCopyModel(virCPUDefPtr dst, +virCPUDefCopyModel(virCPUDef *dst, const virCPUDef *src, bool resetPolicy); @@ -172,7 +169,7 @@ typedef bool (*virCPUDefFeatureFilter)(const char *name, void *opaque); int -virCPUDefCopyModelFilter(virCPUDefPtr dst, +virCPUDefCopyModelFilter(virCPUDef *dst, const virCPUDef *src, bool resetPolicy, virCPUDefFeatureFilter filter, @@ -180,79 +177,79 @@ virCPUDefCopyModelFilter(virCPUDefPtr dst, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); void -virCPUDefStealModel(virCPUDefPtr dst, - virCPUDefPtr src, +virCPUDefStealModel(virCPUDef *dst, + virCPUDef *src, bool keepVendor); -virCPUDefPtr +virCPUDef * virCPUDefCopy(const virCPUDef *cpu); -virCPUDefPtr +virCPUDef * virCPUDefCopyWithoutModel(const virCPUDef *cpu); int virCPUDefParseXMLString(const char *xml, virCPUType type, - virCPUDefPtr *cpu, + virCPUDef **cpu, bool validateXML); int virCPUDefParseXML(xmlXPathContextPtr ctxt, const char *xpath, virCPUType mode, - virCPUDefPtr *cpu, + virCPUDef **cpu, bool validateXML); bool -virCPUDefIsEqual(virCPUDefPtr src, - virCPUDefPtr dst, +virCPUDefIsEqual(virCPUDef *src, + virCPUDef *dst, bool reportError); char * -virCPUDefFormat(virCPUDefPtr def, - virDomainNumaPtr numa); +virCPUDefFormat(virCPUDef *def, + virDomainNuma *numa); int -virCPUDefFormatBuf(virBufferPtr buf, - virCPUDefPtr def); +virCPUDefFormatBuf(virBuffer *buf, + virCPUDef *def); int -virCPUDefFormatBufFull(virBufferPtr buf, - virCPUDefPtr def, - virDomainNumaPtr numa); +virCPUDefFormatBufFull(virBuffer *buf, + virCPUDef *def, + virDomainNuma *numa); int -virCPUDefAddFeature(virCPUDefPtr cpu, +virCPUDefAddFeature(virCPUDef *cpu, const char *name, int policy); int -virCPUDefUpdateFeature(virCPUDefPtr cpu, +virCPUDefUpdateFeature(virCPUDef *cpu, const char *name, int policy); int -virCPUDefAddFeatureIfMissing(virCPUDefPtr def, +virCPUDefAddFeatureIfMissing(virCPUDef *def, const char *name, int policy); -virCPUFeatureDefPtr +virCPUFeatureDef * virCPUDefFindFeature(const virCPUDef *def, const char *name); int -virCPUDefFilterFeatures(virCPUDefPtr cpu, +virCPUDefFilterFeatures(virCPUDef *cpu, virCPUDefFeatureFilter filter, void *opaque); int -virCPUDefCheckFeatures(virCPUDefPtr cpu, +virCPUDefCheckFeatures(virCPUDef *cpu, virCPUDefFeatureFilter filter, void *opaque, char ***features); -virCPUDefPtr * +virCPUDef ** virCPUDefListParse(const char **xmlCPUs, unsigned int ncpus, virCPUType cpuType); void -virCPUDefListFree(virCPUDefPtr *cpus); +virCPUDefListFree(virCPUDef **cpus); diff --git a/src/conf/device_conf.c b/src/conf/device_conf.c index 714ac50762..1a0c126212 100644 --- a/src/conf/device_conf.c +++ b/src/conf/device_conf.c @@ -50,7 +50,7 @@ VIR_ENUM_IMPL(virDomainDeviceAddress, static int virZPCIDeviceAddressParseXML(xmlNodePtr node, - virPCIDeviceAddressPtr addr) + virPCIDeviceAddress *addr) { virZPCIDeviceAddress def = { .uid = { 0 }, .fid = { 0 } }; g_autofree char *uid = NULL; @@ -83,7 +83,7 @@ virZPCIDeviceAddressParseXML(xmlNodePtr node, } void -virDomainDeviceInfoClear(virDomainDeviceInfoPtr info) +virDomainDeviceInfoClear(virDomainDeviceInfo *info) { VIR_FREE(info->alias); memset(&info->addr, 0, sizeof(info->addr)); @@ -95,7 +95,7 @@ virDomainDeviceInfoClear(virDomainDeviceInfoPtr info) } void -virDomainDeviceInfoFree(virDomainDeviceInfoPtr info) +virDomainDeviceInfoFree(virDomainDeviceInfo *info) { if (info) { virDomainDeviceInfoClear(info); @@ -206,7 +206,7 @@ virDeviceInfoPCIAddressExtensionIsPresent(const virDomainDeviceInfo *info) int virPCIDeviceAddressParseXML(xmlNodePtr node, - virPCIDeviceAddressPtr addr) + virPCIDeviceAddress *addr) { xmlNodePtr cur; xmlNodePtr zpci = NULL; @@ -273,7 +273,7 @@ virPCIDeviceAddressParseXML(xmlNodePtr node, } void -virPCIDeviceAddressFormat(virBufferPtr buf, +virPCIDeviceAddressFormat(virBuffer *buf, virPCIDeviceAddress addr, bool includeTypeInAddr) { @@ -287,7 +287,7 @@ virPCIDeviceAddressFormat(virBufferPtr buf, } bool -virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddressPtr addr) +virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddress *addr) { return addr->cssid <= VIR_DOMAIN_DEVICE_CCW_MAX_CSSID && addr->ssid <= VIR_DOMAIN_DEVICE_CCW_MAX_SSID && @@ -296,7 +296,7 @@ virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddressPtr addr) int virDomainDeviceCCWAddressParseXML(xmlNodePtr node, - virDomainDeviceCCWAddressPtr addr) + virDomainDeviceCCWAddress *addr) { g_autofree char *cssid = virXMLPropString(node, "cssid"); g_autofree char *ssid = virXMLPropString(node, "ssid"); @@ -342,8 +342,8 @@ virDomainDeviceCCWAddressParseXML(xmlNodePtr node, } bool -virDomainDeviceCCWAddressEqual(virDomainDeviceCCWAddressPtr addr1, - virDomainDeviceCCWAddressPtr addr2) +virDomainDeviceCCWAddressEqual(virDomainDeviceCCWAddress *addr1, + virDomainDeviceCCWAddress *addr2) { if (addr1->cssid == addr2->cssid && addr1->ssid == addr2->ssid && @@ -355,7 +355,7 @@ virDomainDeviceCCWAddressEqual(virDomainDeviceCCWAddressPtr addr1, int virDomainDeviceDriveAddressParseXML(xmlNodePtr node, - virDomainDeviceDriveAddressPtr addr) + virDomainDeviceDriveAddress *addr) { g_autofree char *controller = virXMLPropString(node, "controller"); g_autofree char *bus = virXMLPropString(node, "bus"); @@ -397,7 +397,7 @@ virDomainDeviceDriveAddressParseXML(xmlNodePtr node, int virDomainDeviceVirtioSerialAddressParseXML(xmlNodePtr node, - virDomainDeviceVirtioSerialAddressPtr addr) + virDomainDeviceVirtioSerialAddress *addr) { g_autofree char *controller = virXMLPropString(node, "controller"); g_autofree char *bus = virXMLPropString(node, "bus"); @@ -431,7 +431,7 @@ virDomainDeviceVirtioSerialAddressParseXML(xmlNodePtr node, int virDomainDeviceCcidAddressParseXML(xmlNodePtr node, - virDomainDeviceCcidAddressPtr addr) + virDomainDeviceCcidAddress *addr) { g_autofree char *controller = virXMLPropString(node, "controller"); g_autofree char *slot = virXMLPropString(node, "slot"); @@ -456,7 +456,7 @@ virDomainDeviceCcidAddressParseXML(xmlNodePtr node, } static int -virDomainDeviceUSBAddressParsePort(virDomainDeviceUSBAddressPtr addr, +virDomainDeviceUSBAddressParsePort(virDomainDeviceUSBAddress *addr, char *port) { char *tmp = port; @@ -480,7 +480,7 @@ virDomainDeviceUSBAddressParsePort(virDomainDeviceUSBAddressPtr addr, int virDomainDeviceUSBAddressParseXML(xmlNodePtr node, - virDomainDeviceUSBAddressPtr addr) + virDomainDeviceUSBAddress *addr) { g_autofree char *port = virXMLPropString(node, "port"); g_autofree char *bus = virXMLPropString(node, "bus"); @@ -501,7 +501,7 @@ virDomainDeviceUSBAddressParseXML(xmlNodePtr node, int virDomainDeviceSpaprVioAddressParseXML(xmlNodePtr node, - virDomainDeviceSpaprVioAddressPtr addr) + virDomainDeviceSpaprVioAddress *addr) { g_autofree char *reg = virXMLPropString(node, "reg"); @@ -520,7 +520,7 @@ virDomainDeviceSpaprVioAddressParseXML(xmlNodePtr node, } bool -virDomainDeviceAddressIsValid(virDomainDeviceInfoPtr info, +virDomainDeviceAddressIsValid(virDomainDeviceInfo *info, int type) { if (info->type != type) @@ -549,7 +549,7 @@ virDomainDeviceAddressIsValid(virDomainDeviceInfoPtr info, int virInterfaceLinkParseXML(xmlNodePtr node, - virNetDevIfLinkPtr lnk) + virNetDevIfLink *lnk) { int state; @@ -577,7 +577,7 @@ virInterfaceLinkParseXML(xmlNodePtr node, } int -virInterfaceLinkFormat(virBufferPtr buf, +virInterfaceLinkFormat(virBuffer *buf, const virNetDevIfLink *lnk) { if (!lnk->speed && !lnk->state) { diff --git a/src/conf/device_conf.h b/src/conf/device_conf.h index af9a43bff2..cec34ededd 100644 --- a/src/conf/device_conf.h +++ b/src/conf/device_conf.h @@ -52,7 +52,6 @@ typedef enum { VIR_ENUM_DECL(virDomainDeviceAddress); typedef struct _virDomainDeviceDriveAddress virDomainDeviceDriveAddress; -typedef virDomainDeviceDriveAddress *virDomainDeviceDriveAddressPtr; struct _virDomainDeviceDriveAddress { unsigned int controller; unsigned int bus; @@ -61,7 +60,6 @@ struct _virDomainDeviceDriveAddress { }; typedef struct _virDomainDeviceVirtioSerialAddress virDomainDeviceVirtioSerialAddress; -typedef virDomainDeviceVirtioSerialAddress *virDomainDeviceVirtioSerialAddressPtr; struct _virDomainDeviceVirtioSerialAddress { unsigned int controller; unsigned int bus; @@ -73,7 +71,6 @@ struct _virDomainDeviceVirtioSerialAddress { #define VIR_DOMAIN_DEVICE_CCW_MAX_DEVNO 65535 typedef struct _virDomainDeviceCCWAddress virDomainDeviceCCWAddress; -typedef virDomainDeviceCCWAddress *virDomainDeviceCCWAddressPtr; struct _virDomainDeviceCCWAddress { unsigned int cssid; unsigned int ssid; @@ -82,7 +79,6 @@ struct _virDomainDeviceCCWAddress { }; typedef struct _virDomainDeviceCcidAddress virDomainDeviceCcidAddress; -typedef virDomainDeviceCcidAddress *virDomainDeviceCcidAddressPtr; struct _virDomainDeviceCcidAddress { unsigned int controller; unsigned int slot; @@ -91,14 +87,12 @@ struct _virDomainDeviceCcidAddress { #define VIR_DOMAIN_DEVICE_USB_MAX_PORT_DEPTH 4 typedef struct _virDomainDeviceUSBAddress virDomainDeviceUSBAddress; -typedef virDomainDeviceUSBAddress *virDomainDeviceUSBAddressPtr; struct _virDomainDeviceUSBAddress { unsigned int bus; unsigned int port[VIR_DOMAIN_DEVICE_USB_MAX_PORT_DEPTH]; }; typedef struct _virDomainDeviceSpaprVioAddress virDomainDeviceSpaprVioAddress; -typedef virDomainDeviceSpaprVioAddress *virDomainDeviceSpaprVioAddressPtr; struct _virDomainDeviceSpaprVioAddress { unsigned long long reg; bool has_reg; @@ -112,27 +106,23 @@ typedef enum { } virDomainControllerMaster; typedef struct _virDomainDeviceUSBMaster virDomainDeviceUSBMaster; -typedef virDomainDeviceUSBMaster *virDomainDeviceUSBMasterPtr; struct _virDomainDeviceUSBMaster { unsigned int startport; }; typedef struct _virDomainDeviceISAAddress virDomainDeviceISAAddress; -typedef virDomainDeviceISAAddress *virDomainDeviceISAAddressPtr; struct _virDomainDeviceISAAddress { unsigned int iobase; unsigned int irq; }; typedef struct _virDomainDeviceDimmAddress virDomainDeviceDimmAddress; -typedef virDomainDeviceDimmAddress *virDomainDeviceDimmAddressPtr; struct _virDomainDeviceDimmAddress { unsigned int slot; unsigned long long base; }; typedef struct _virDomainDeviceInfo virDomainDeviceInfo; -typedef virDomainDeviceInfo *virDomainDeviceInfoPtr; struct _virDomainDeviceInfo { char *alias; int type; /* virDomainDeviceAddressType */ @@ -184,14 +174,14 @@ struct _virDomainDeviceInfo { bool isolationGroupLocked; }; -void virDomainDeviceInfoClear(virDomainDeviceInfoPtr info); -void virDomainDeviceInfoFree(virDomainDeviceInfoPtr info); +void virDomainDeviceInfoClear(virDomainDeviceInfo *info); +void virDomainDeviceInfoFree(virDomainDeviceInfo *info); bool virDomainDeviceInfoAddressIsEqual(const virDomainDeviceInfo *a, const virDomainDeviceInfo *b) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -bool virDomainDeviceAddressIsValid(virDomainDeviceInfoPtr info, +bool virDomainDeviceAddressIsValid(virDomainDeviceInfo *info, int type); bool virDeviceInfoPCIAddressIsWanted(const virDomainDeviceInfo *info); @@ -201,36 +191,36 @@ bool virDeviceInfoPCIAddressExtensionIsWanted(const virDomainDeviceInfo *info); bool virDeviceInfoPCIAddressExtensionIsPresent(const virDomainDeviceInfo *info); int virPCIDeviceAddressParseXML(xmlNodePtr node, - virPCIDeviceAddressPtr addr); + virPCIDeviceAddress *addr); -void virPCIDeviceAddressFormat(virBufferPtr buf, +void virPCIDeviceAddressFormat(virBuffer *buf, virPCIDeviceAddress addr, bool includeTypeInAddr); -bool virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddressPtr addr); +bool virDomainDeviceCCWAddressIsValid(virDomainDeviceCCWAddress *addr); int virDomainDeviceCCWAddressParseXML(xmlNodePtr node, - virDomainDeviceCCWAddressPtr addr); -bool virDomainDeviceCCWAddressEqual(virDomainDeviceCCWAddressPtr addr1, - virDomainDeviceCCWAddressPtr addr2); + virDomainDeviceCCWAddress *addr); +bool virDomainDeviceCCWAddressEqual(virDomainDeviceCCWAddress *addr1, + virDomainDeviceCCWAddress *addr2); #define VIR_CCW_DEVICE_ADDRESS_FMT "%x.%x.%04x" int virDomainDeviceDriveAddressParseXML(xmlNodePtr node, - virDomainDeviceDriveAddressPtr addr); + virDomainDeviceDriveAddress *addr); int virDomainDeviceVirtioSerialAddressParseXML(xmlNodePtr node, - virDomainDeviceVirtioSerialAddressPtr addr); + virDomainDeviceVirtioSerialAddress *addr); int virDomainDeviceCcidAddressParseXML(xmlNodePtr node, - virDomainDeviceCcidAddressPtr addr); + virDomainDeviceCcidAddress *addr); int virDomainDeviceUSBAddressParseXML(xmlNodePtr node, - virDomainDeviceUSBAddressPtr addr); + virDomainDeviceUSBAddress *addr); int virDomainDeviceSpaprVioAddressParseXML(xmlNodePtr node, - virDomainDeviceSpaprVioAddressPtr addr); + virDomainDeviceSpaprVioAddress *addr); int virInterfaceLinkParseXML(xmlNodePtr node, - virNetDevIfLinkPtr lnk); + virNetDevIfLink *lnk); -int virInterfaceLinkFormat(virBufferPtr buf, +int virInterfaceLinkFormat(virBuffer *buf, const virNetDevIfLink *lnk); diff --git a/src/conf/domain_addr.c b/src/conf/domain_addr.c index 0dcd690a5f..f011721beb 100644 --- a/src/conf/domain_addr.c +++ b/src/conf/domain_addr.c @@ -62,7 +62,7 @@ virDomainZPCIAddressReserveId(GHashTable *set, static int virDomainZPCIAddressReserveUid(GHashTable *set, - virZPCIDeviceAddressPtr addr) + virZPCIDeviceAddress *addr) { return virDomainZPCIAddressReserveId(set, &addr->uid, "uid"); } @@ -70,7 +70,7 @@ virDomainZPCIAddressReserveUid(GHashTable *set, static int virDomainZPCIAddressReserveFid(GHashTable *set, - virZPCIDeviceAddressPtr addr) + virZPCIDeviceAddress *addr) { return virDomainZPCIAddressReserveId(set, &addr->fid, "fid"); } @@ -105,7 +105,7 @@ virDomainZPCIAddressAssignId(GHashTable *set, static int virDomainZPCIAddressAssignUid(GHashTable *set, - virZPCIDeviceAddressPtr addr) + virZPCIDeviceAddress *addr) { return virDomainZPCIAddressAssignId(set, &addr->uid, 1, VIR_DOMAIN_DEVICE_ZPCI_MAX_UID, "uid"); @@ -114,7 +114,7 @@ virDomainZPCIAddressAssignUid(GHashTable *set, static int virDomainZPCIAddressAssignFid(GHashTable *set, - virZPCIDeviceAddressPtr addr) + virZPCIDeviceAddress *addr) { return virDomainZPCIAddressAssignId(set, &addr->fid, 0, VIR_DOMAIN_DEVICE_ZPCI_MAX_FID, "fid"); @@ -136,8 +136,8 @@ virDomainZPCIAddressReleaseId(GHashTable *set, static void -virDomainZPCIAddressReleaseIds(virDomainZPCIAddressIdsPtr zpciIds, - virZPCIDeviceAddressPtr addr) +virDomainZPCIAddressReleaseIds(virDomainZPCIAddressIds *zpciIds, + virZPCIDeviceAddress *addr) { if (!zpciIds) return; @@ -148,8 +148,8 @@ virDomainZPCIAddressReleaseIds(virDomainZPCIAddressIdsPtr zpciIds, static int -virDomainZPCIAddressEnsureAddr(virDomainZPCIAddressIdsPtr zpciIds, - virZPCIDeviceAddressPtr addr) +virDomainZPCIAddressEnsureAddr(virDomainZPCIAddressIds *zpciIds, + virZPCIDeviceAddress *addr) { if (virDomainZPCIAddressAssignUid(zpciIds->uids, addr) < 0) return -1; @@ -170,8 +170,8 @@ virDomainZPCIAddressEnsureAddr(virDomainZPCIAddressIdsPtr zpciIds, int -virDomainPCIAddressExtensionReserveAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) +virDomainPCIAddressExtensionReserveAddr(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr) { if (addr->extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) { /* Reserve uid/fid to ZPCI device which has defined uid/fid @@ -185,8 +185,8 @@ virDomainPCIAddressExtensionReserveAddr(virDomainPCIAddressSetPtr addrs, int -virDomainPCIAddressExtensionReserveNextAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) +virDomainPCIAddressExtensionReserveNextAddr(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr) { if (addr->extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) { virZPCIDeviceAddress zpci = addr->zpci; @@ -203,11 +203,11 @@ virDomainPCIAddressExtensionReserveNextAddr(virDomainPCIAddressSetPtr addrs, static int -virDomainPCIAddressExtensionEnsureAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) +virDomainPCIAddressExtensionEnsureAddr(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr) { if (addr->extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) { - virZPCIDeviceAddressPtr zpci = &addr->zpci; + virZPCIDeviceAddress *zpci = &addr->zpci; if (virDomainZPCIAddressEnsureAddr(addrs->zpciIds, zpci) < 0) return -1; @@ -293,7 +293,7 @@ virDomainPCIControllerConnectTypeToModel(virDomainPCIConnectFlags flags) static bool -virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr, +virDomainPCIAddressFlagsCompatible(virPCIDeviceAddress *addr, const char *addrStr, virDomainPCIConnectFlags busFlags, virDomainPCIConnectFlags devFlags, @@ -398,13 +398,13 @@ virDomainPCIAddressFlagsCompatible(virPCIDeviceAddressPtr addr, * comparing the flags). */ bool -virDomainPCIAddressValidate(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr, +virDomainPCIAddressValidate(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr, const char *addrStr, virDomainPCIConnectFlags flags, bool fromConfig) { - virDomainPCIAddressBusPtr bus; + virDomainPCIAddressBus *bus; virErrorNumber errType = (fromConfig ? VIR_ERR_XML_ERROR : VIR_ERR_INTERNAL_ERROR); @@ -460,7 +460,7 @@ virDomainPCIAddressValidate(virDomainPCIAddressSetPtr addrs, int -virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, +virDomainPCIAddressBusSetModel(virDomainPCIAddressBus *bus, virDomainControllerModelPCI model, bool allowHotplug) { @@ -574,7 +574,7 @@ virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, bool -virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus) +virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBus *bus) { size_t i; @@ -588,7 +588,7 @@ virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus) static bool ATTRIBUTE_NONNULL(1) -virDomainPCIAddressBusIsEmpty(virDomainPCIAddressBusPtr bus) +virDomainPCIAddressBusIsEmpty(virDomainPCIAddressBus *bus) { size_t i; @@ -609,8 +609,8 @@ virDomainPCIAddressBusIsEmpty(virDomainPCIAddressBusPtr bus) * >0 = number of buses added */ static int -virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr, +virDomainPCIAddressSetGrow(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr, virDomainPCIConnectFlags flags) { int add; @@ -777,8 +777,8 @@ virDomainPCIAddressSetGrow(virDomainPCIAddressSetPtr addrs, * Check if the PCI slot is used by another device. */ bool -virDomainPCIAddressSlotInUse(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) +virDomainPCIAddressSlotInUse(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr) { return !!addrs->buses[addr->bus].slot[addr->slot].functions; } @@ -792,14 +792,14 @@ virDomainPCIAddressSlotInUse(virDomainPCIAddressSetPtr addrs, * XML). */ static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) -virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr, +virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr, virDomainPCIConnectFlags flags, unsigned int isolationGroup, bool fromConfig) { g_autofree char *addrStr = NULL; - virDomainPCIAddressBusPtr bus; + virDomainPCIAddressBus *bus; virErrorNumber errType = (fromConfig ? VIR_ERR_XML_ERROR : VIR_ERR_INTERNAL_ERROR); @@ -862,8 +862,8 @@ virDomainPCIAddressReserveAddrInternal(virDomainPCIAddressSetPtr addrs, int -virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr, +virDomainPCIAddressReserveAddr(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr, virDomainPCIConnectFlags flags, unsigned int isolationGroup) { @@ -872,8 +872,8 @@ virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs, } int -virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs, - virDomainDeviceInfoPtr dev, +virDomainPCIAddressEnsureAddr(virDomainPCIAddressSet *addrs, + virDomainDeviceInfo *dev, virDomainPCIConnectFlags flags) { g_autofree char *addrStr = NULL; @@ -926,8 +926,8 @@ virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs, void -virDomainPCIAddressExtensionReleaseAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) +virDomainPCIAddressExtensionReleaseAddr(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr) { if (addr->extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) virDomainZPCIAddressReleaseIds(addrs->zpciIds, &addr->zpci); @@ -935,15 +935,15 @@ virDomainPCIAddressExtensionReleaseAddr(virDomainPCIAddressSetPtr addrs, void -virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) +virDomainPCIAddressReleaseAddr(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr) { addrs->buses[addr->bus].slot[addr->slot].functions &= ~(1 << addr->function); } static void -virDomainPCIAddressSetExtensionFree(virDomainZPCIAddressIdsPtr zpciIds) +virDomainPCIAddressSetExtensionFree(virDomainZPCIAddressIds *zpciIds) { if (!zpciIds) return; @@ -956,7 +956,7 @@ virDomainPCIAddressSetExtensionFree(virDomainZPCIAddressIdsPtr zpciIds) static int -virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSetPtr addrs, +virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSet *addrs, virPCIDeviceAddressExtensionFlags extFlags) { if (extFlags & VIR_PCI_ADDRESS_EXTENSION_ZPCI) { @@ -973,11 +973,11 @@ virDomainPCIAddressSetExtensionAlloc(virDomainPCIAddressSetPtr addrs, } -virDomainPCIAddressSetPtr +virDomainPCIAddressSet * virDomainPCIAddressSetAlloc(unsigned int nbuses, virPCIDeviceAddressExtensionFlags extFlags) { - virDomainPCIAddressSetPtr addrs; + virDomainPCIAddressSet *addrs; addrs = g_new0(virDomainPCIAddressSet, 1); addrs->buses = g_new0(virDomainPCIAddressBus, nbuses); @@ -995,7 +995,7 @@ virDomainPCIAddressSetAlloc(unsigned int nbuses, void -virDomainPCIAddressSetFree(virDomainPCIAddressSetPtr addrs) +virDomainPCIAddressSetFree(virDomainPCIAddressSet *addrs) { if (!addrs) return; @@ -1007,8 +1007,8 @@ virDomainPCIAddressSetFree(virDomainPCIAddressSetPtr addrs) static int -virDomainPCIAddressFindUnusedFunctionOnBus(virDomainPCIAddressBusPtr bus, - virPCIDeviceAddressPtr searchAddr, +virDomainPCIAddressFindUnusedFunctionOnBus(virDomainPCIAddressBus *bus, + virPCIDeviceAddress *searchAddr, int function, virDomainPCIConnectFlags flags, bool *found) @@ -1069,8 +1069,8 @@ virDomainPCIAddressFindUnusedFunctionOnBus(virDomainPCIAddressBusPtr bus, static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) -virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr next_addr, +virDomainPCIAddressGetNextAddr(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *next_addr, virDomainPCIConnectFlags flags, unsigned int isolationGroup, int function) @@ -1093,7 +1093,7 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs, * don't match. This ensures all devices sharing the same isolation * group will end up on the same bus */ for (a.bus = 0; a.bus < addrs->nbuses; a.bus++) { - virDomainPCIAddressBusPtr bus = &addrs->buses[a.bus]; + virDomainPCIAddressBus *bus = &addrs->buses[a.bus]; bool found = false; if (bus->isolationGroup != isolationGroup) @@ -1114,7 +1114,7 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs, * might still be able to make this work by altering the isolation * group for a bus that's currently empty. So let's try that */ for (a.bus = 0; a.bus < addrs->nbuses; a.bus++) { - virDomainPCIAddressBusPtr bus = &addrs->buses[a.bus]; + virDomainPCIAddressBus *bus = &addrs->buses[a.bus]; bool found = false; /* We can only change the isolation group for a bus when @@ -1176,8 +1176,8 @@ virDomainPCIAddressGetNextAddr(virDomainPCIAddressSetPtr addrs, * returns 0 on success, or -1 on failure. */ int -virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, - virDomainDeviceInfoPtr dev, +virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSet *addrs, + virDomainDeviceInfo *dev, virDomainPCIConnectFlags flags, int function) { @@ -1204,13 +1204,13 @@ virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, static int -virDomainPCIAddressSetMultiIter(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr dev G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +virDomainPCIAddressSetMultiIter(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *dev G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *data) { - virPCIDeviceAddressPtr testAddr = data; - virPCIDeviceAddressPtr thisAddr; + virPCIDeviceAddress *testAddr = data; + virPCIDeviceAddress *thisAddr; if (!info || info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) return 0; @@ -1237,12 +1237,12 @@ virDomainPCIAddressSetMultiIter(virDomainDefPtr def G_GNUC_UNUSED, static int -virDomainPCIAddressSetAllMultiIter(virDomainDefPtr def, - virDomainDeviceDefPtr dev G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +virDomainPCIAddressSetAllMultiIter(virDomainDef *def, + virDomainDeviceDef *dev G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *data G_GNUC_UNUSED) { - virPCIDeviceAddressPtr testAddr; + virPCIDeviceAddress *testAddr; if (!info || info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) return 0; @@ -1272,7 +1272,7 @@ virDomainPCIAddressSetAllMultiIter(virDomainDefPtr def, * No return code, since there is no possibility of failure. */ void -virDomainPCIAddressSetAllMulti(virDomainDefPtr def) +virDomainPCIAddressSetAllMulti(virDomainDef *def) { /* Use nested iterators over all the devices - the outer iterator * scans through all the devices looking for those whose address @@ -1287,13 +1287,13 @@ virDomainPCIAddressSetAllMulti(virDomainDefPtr def) char* -virDomainCCWAddressAsString(virDomainDeviceCCWAddressPtr addr) +virDomainCCWAddressAsString(virDomainDeviceCCWAddress *addr) { return g_strdup_printf("%x.%x.%04x", addr->cssid, addr->ssid, addr->devno); } static int -virDomainCCWAddressIncrement(virDomainDeviceCCWAddressPtr addr) +virDomainCCWAddressIncrement(virDomainDeviceCCWAddress *addr) { virDomainDeviceCCWAddress ccwaddr = *addr; @@ -1307,8 +1307,8 @@ virDomainCCWAddressIncrement(virDomainDeviceCCWAddressPtr addr) int -virDomainCCWAddressAssign(virDomainDeviceInfoPtr dev, - virDomainCCWAddressSetPtr addrs, +virDomainCCWAddressAssign(virDomainDeviceInfo *dev, + virDomainCCWAddressSet *addrs, bool autoassign) { g_autofree char *addr = NULL; @@ -1355,24 +1355,24 @@ virDomainCCWAddressAssign(virDomainDeviceInfoPtr dev, } static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) -virDomainCCWAddressAllocate(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr dev G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +virDomainCCWAddressAllocate(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *dev G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *data) { return virDomainCCWAddressAssign(info, data, true); } static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) -virDomainCCWAddressValidate(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr dev G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +virDomainCCWAddressValidate(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *dev G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *data) { return virDomainCCWAddressAssign(info, data, false); } -void virDomainCCWAddressSetFree(virDomainCCWAddressSetPtr addrs) +void virDomainCCWAddressSetFree(virDomainCCWAddressSet *addrs) { if (!addrs) return; @@ -1381,10 +1381,10 @@ void virDomainCCWAddressSetFree(virDomainCCWAddressSetPtr addrs) g_free(addrs); } -static virDomainCCWAddressSetPtr +static virDomainCCWAddressSet * virDomainCCWAddressSetCreate(void) { - virDomainCCWAddressSetPtr addrs = NULL; + virDomainCCWAddressSet *addrs = NULL; addrs = g_new0(virDomainCCWAddressSet, 1); @@ -1404,10 +1404,10 @@ virDomainCCWAddressSetCreate(void) } -virDomainCCWAddressSetPtr -virDomainCCWAddressSetCreateFromDomain(virDomainDefPtr def) +virDomainCCWAddressSet * +virDomainCCWAddressSetCreateFromDomain(virDomainDef *def) { - virDomainCCWAddressSetPtr addrs = NULL; + virDomainCCWAddressSet *addrs = NULL; if (!(addrs = virDomainCCWAddressSetCreate())) goto error; @@ -1435,10 +1435,10 @@ virDomainCCWAddressSetCreateFromDomain(virDomainDefPtr def) * * Allocates an address set for virtio serial addresses */ -static virDomainVirtioSerialAddrSetPtr +static virDomainVirtioSerialAddrSet * virDomainVirtioSerialAddrSetCreate(void) { - virDomainVirtioSerialAddrSetPtr ret = NULL; + virDomainVirtioSerialAddrSet *ret = NULL; ret = g_new0(virDomainVirtioSerialAddrSet, 1); @@ -1446,7 +1446,7 @@ virDomainVirtioSerialAddrSetCreate(void) } static void -virDomainVirtioSerialControllerFree(virDomainVirtioSerialControllerPtr cont) +virDomainVirtioSerialControllerFree(virDomainVirtioSerialController *cont) { if (cont) { virBitmapFree(cont->ports); @@ -1455,8 +1455,8 @@ virDomainVirtioSerialControllerFree(virDomainVirtioSerialControllerPtr cont) } static ssize_t -virDomainVirtioSerialAddrPlaceController(virDomainVirtioSerialAddrSetPtr addrs, - virDomainVirtioSerialControllerPtr cont) +virDomainVirtioSerialAddrPlaceController(virDomainVirtioSerialAddrSet *addrs, + virDomainVirtioSerialController *cont) { size_t i; @@ -1475,7 +1475,7 @@ virDomainVirtioSerialAddrPlaceController(virDomainVirtioSerialAddrSetPtr addrs, } static ssize_t -virDomainVirtioSerialAddrFindController(virDomainVirtioSerialAddrSetPtr addrs, +virDomainVirtioSerialAddrFindController(virDomainVirtioSerialAddrSet *addrs, unsigned int idx) { size_t i; @@ -1493,12 +1493,12 @@ virDomainVirtioSerialAddrFindController(virDomainVirtioSerialAddrSetPtr addrs, * to the address set. */ static int -virDomainVirtioSerialAddrSetAddController(virDomainVirtioSerialAddrSetPtr addrs, - virDomainControllerDefPtr cont) +virDomainVirtioSerialAddrSetAddController(virDomainVirtioSerialAddrSet *addrs, + virDomainControllerDef *cont) { int ret = -1; int ports; - virDomainVirtioSerialControllerPtr cnt = NULL; + virDomainVirtioSerialController *cnt = NULL; ssize_t insertAt; if (cont->type != VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL) @@ -1535,8 +1535,8 @@ virDomainVirtioSerialAddrSetAddController(virDomainVirtioSerialAddrSetPtr addrs, * to the address set. */ static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) -virDomainVirtioSerialAddrSetAddControllers(virDomainVirtioSerialAddrSetPtr addrs, - virDomainDefPtr def) +virDomainVirtioSerialAddrSetAddControllers(virDomainVirtioSerialAddrSet *addrs, + virDomainDef *def) { size_t i; @@ -1551,7 +1551,7 @@ virDomainVirtioSerialAddrSetAddControllers(virDomainVirtioSerialAddrSetPtr addrs void -virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSetPtr addrs) +virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSet *addrs) { size_t i; if (addrs) { @@ -1570,13 +1570,13 @@ virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSetPtr addrs) * opaque should be the address set */ static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) -virDomainVirtioSerialAddrReserve(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr dev G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +virDomainVirtioSerialAddrReserve(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *dev G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *data) { - virDomainVirtioSerialAddrSetPtr addrs = data; - virBitmapPtr map = NULL; + virDomainVirtioSerialAddrSet *addrs = data; + virBitmap *map = NULL; bool b; ssize_t i; @@ -1623,11 +1623,11 @@ virDomainVirtioSerialAddrReserve(virDomainDefPtr def G_GNUC_UNUSED, * Inspect the domain definition and return an address set containing * every virtio serial address we find */ -virDomainVirtioSerialAddrSetPtr -virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDefPtr def) +virDomainVirtioSerialAddrSet * +virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDef *def) { - virDomainVirtioSerialAddrSetPtr addrs = NULL; - virDomainVirtioSerialAddrSetPtr ret = NULL; + virDomainVirtioSerialAddrSet *addrs = NULL; + virDomainVirtioSerialAddrSet *ret = NULL; if (!(addrs = virDomainVirtioSerialAddrSetCreate())) goto cleanup; @@ -1646,8 +1646,8 @@ virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDefPtr def) } static int -virDomainVirtioSerialAddrSetAutoaddController(virDomainDefPtr def, - virDomainVirtioSerialAddrSetPtr addrs, +virDomainVirtioSerialAddrSetAutoaddController(virDomainDef *def, + virDomainVirtioSerialAddrSet *addrs, unsigned int idx) { int contidx; @@ -1666,8 +1666,8 @@ virDomainVirtioSerialAddrSetAutoaddController(virDomainDefPtr def, } static int -virDomainVirtioSerialAddrNext(virDomainDefPtr def, - virDomainVirtioSerialAddrSetPtr addrs, +virDomainVirtioSerialAddrNext(virDomainDef *def, + virDomainVirtioSerialAddrSet *addrs, virDomainDeviceVirtioSerialAddress *addr, bool allowZero) { @@ -1686,7 +1686,7 @@ virDomainVirtioSerialAddrNext(virDomainDefPtr def, } for (i = 0; i < addrs->ncontrollers; i++) { - virBitmapPtr map = addrs->controllers[i]->ports; + virBitmap *map = addrs->controllers[i]->ports; if ((port = virBitmapNextClearBit(map, startPort)) >= 0) { controller = addrs->controllers[i]->idx; goto success; @@ -1722,12 +1722,12 @@ virDomainVirtioSerialAddrNext(virDomainDefPtr def, } static int -virDomainVirtioSerialAddrNextFromController(virDomainVirtioSerialAddrSetPtr addrs, +virDomainVirtioSerialAddrNextFromController(virDomainVirtioSerialAddrSet *addrs, virDomainDeviceVirtioSerialAddress *addr) { ssize_t port; ssize_t i; - virBitmapPtr map; + virBitmap *map; i = virDomainVirtioSerialAddrFindController(addrs, addr->controller); if (i < 0) { @@ -1753,14 +1753,14 @@ virDomainVirtioSerialAddrNextFromController(virDomainVirtioSerialAddrSetPtr addr } static int ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) -virDomainVirtioSerialAddrAssign(virDomainDefPtr def, - virDomainVirtioSerialAddrSetPtr addrs, - virDomainDeviceInfoPtr info, +virDomainVirtioSerialAddrAssign(virDomainDef *def, + virDomainVirtioSerialAddrSet *addrs, + virDomainDeviceInfo *info, bool allowZero, bool portOnly) { virDomainDeviceInfo nfo = { 0 }; - virDomainDeviceInfoPtr ptr = allowZero ? &nfo : info; + virDomainDeviceInfo *ptr = allowZero ? &nfo : info; ptr->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL; @@ -1786,9 +1786,9 @@ virDomainVirtioSerialAddrAssign(virDomainDefPtr def, * or assign a virtio serial address to the device */ int -virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDefPtr def, - virDomainVirtioSerialAddrSetPtr addrs, - virDomainDeviceInfoPtr info, +virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDef *def, + virDomainVirtioSerialAddrSet *addrs, + virDomainDeviceInfo *info, bool allowZero) { bool portOnly = info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL; @@ -1800,11 +1800,11 @@ virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDefPtr def, } int -virDomainVirtioSerialAddrAutoAssign(virDomainDefPtr def, - virDomainDeviceInfoPtr info, +virDomainVirtioSerialAddrAutoAssign(virDomainDef *def, + virDomainDeviceInfo *info, bool allowZero) { - virDomainVirtioSerialAddrSetPtr addrs = NULL; + virDomainVirtioSerialAddrSet *addrs = NULL; int ret = -1; if (!(addrs = virDomainVirtioSerialAddrSetCreateFromDomain(def))) @@ -1826,7 +1826,7 @@ virDomainVirtioSerialAddrAutoAssign(virDomainDefPtr def, * Check if the address is complete, or it needs auto-assignment */ bool -virDomainVirtioSerialAddrIsComplete(virDomainDeviceInfoPtr info) +virDomainVirtioSerialAddrIsComplete(virDomainDeviceInfo *info) { return info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL && info->addr.vioserial.port != 0; @@ -1841,7 +1841,7 @@ virDomainUSBAddressPortIsValid(unsigned int *port) void -virDomainUSBAddressPortFormatBuf(virBufferPtr buf, +virDomainUSBAddressPortFormatBuf(virBuffer *buf, unsigned int *port) { size_t i; @@ -1864,10 +1864,10 @@ virDomainUSBAddressPortFormat(unsigned int *port) } -virDomainUSBAddressSetPtr +virDomainUSBAddressSet * virDomainUSBAddressSetCreate(void) { - virDomainUSBAddressSetPtr addrs; + virDomainUSBAddressSet *addrs; addrs = g_new0(virDomainUSBAddressSet, 1); @@ -1876,7 +1876,7 @@ virDomainUSBAddressSetCreate(void) static void -virDomainUSBAddressHubFree(virDomainUSBAddressHubPtr hub) +virDomainUSBAddressHubFree(virDomainUSBAddressHub *hub) { size_t i; @@ -1892,7 +1892,7 @@ virDomainUSBAddressHubFree(virDomainUSBAddressHubPtr hub) void -virDomainUSBAddressSetFree(virDomainUSBAddressSetPtr addrs) +virDomainUSBAddressSetFree(virDomainUSBAddressSet *addrs) { size_t i; @@ -1907,7 +1907,7 @@ virDomainUSBAddressSetFree(virDomainUSBAddressSetPtr addrs) static size_t -virDomainUSBAddressControllerModelToPorts(virDomainControllerDefPtr cont) +virDomainUSBAddressControllerModelToPorts(virDomainControllerDef *cont) { switch ((virDomainControllerModelUSB) cont->model) { case VIR_DOMAIN_CONTROLLER_MODEL_USB_DEFAULT: @@ -1951,16 +1951,16 @@ virDomainUSBAddressControllerModelToPorts(virDomainControllerDefPtr cont) } -static virDomainUSBAddressHubPtr +static virDomainUSBAddressHub * virDomainUSBAddressHubNew(size_t nports) { - virDomainUSBAddressHubPtr hub; + virDomainUSBAddressHub *hub; hub = g_new0(virDomainUSBAddressHub, 1); hub->portmap = virBitmapNew(nports); - hub->ports = g_new0(virDomainUSBAddressHubPtr, nports); + hub->ports = g_new0(virDomainUSBAddressHub *, nports); hub->nports = nports; return hub; @@ -1968,11 +1968,11 @@ virDomainUSBAddressHubNew(size_t nports) static int -virDomainUSBAddressSetAddController(virDomainUSBAddressSetPtr addrs, - virDomainControllerDefPtr cont) +virDomainUSBAddressSetAddController(virDomainUSBAddressSet *addrs, + virDomainControllerDef *cont) { size_t nports = virDomainUSBAddressControllerModelToPorts(cont); - virDomainUSBAddressHubPtr hub = NULL; + virDomainUSBAddressHub *hub = NULL; int ret = -1; VIR_DEBUG("Adding a USB controller model=%s with %zu ports", @@ -2005,7 +2005,7 @@ virDomainUSBAddressSetAddController(virDomainUSBAddressSetPtr addrs, static ssize_t -virDomainUSBAddressGetLastIdx(virDomainDeviceInfoPtr info) +virDomainUSBAddressGetLastIdx(virDomainDeviceInfo *info) { ssize_t i; for (i = VIR_DOMAIN_DEVICE_USB_MAX_PORT_DEPTH - 1; i > 0; i--) { @@ -2020,13 +2020,13 @@ virDomainUSBAddressGetLastIdx(virDomainDeviceInfoPtr info) * that corresponds to the bus/port path specified by info. * Returns the index of the requested port in targetIdx. */ -static virDomainUSBAddressHubPtr -virDomainUSBAddressFindPort(virDomainUSBAddressSetPtr addrs, - virDomainDeviceInfoPtr info, +static virDomainUSBAddressHub * +virDomainUSBAddressFindPort(virDomainUSBAddressSet *addrs, + virDomainDeviceInfo *info, int *targetIdx, const char *portStr) { - virDomainUSBAddressHubPtr hub = NULL; + virDomainUSBAddressHub *hub = NULL; ssize_t i, lastIdx, targetPort; if (info->addr.usb.bus >= addrs->nbuses || @@ -2076,11 +2076,11 @@ virDomainUSBAddressFindPort(virDomainUSBAddressSetPtr addrs, int -virDomainUSBAddressSetAddHub(virDomainUSBAddressSetPtr addrs, - virDomainHubDefPtr hub) +virDomainUSBAddressSetAddHub(virDomainUSBAddressSet *addrs, + virDomainHubDef *hub) { - virDomainUSBAddressHubPtr targetHub = NULL; - virDomainUSBAddressHubPtr newHub = NULL; + virDomainUSBAddressHub *targetHub = NULL; + virDomainUSBAddressHub *newHub = NULL; int ret = -1; int targetPort; g_autofree char *portStr = NULL; @@ -2121,13 +2121,13 @@ virDomainUSBAddressSetAddHub(virDomainUSBAddressSetPtr addrs, int -virDomainUSBAddressSetAddControllers(virDomainUSBAddressSetPtr addrs, - virDomainDefPtr def) +virDomainUSBAddressSetAddControllers(virDomainUSBAddressSet *addrs, + virDomainDef *def) { size_t i; for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) { if (virDomainUSBAddressSetAddController(addrs, cont) < 0) return -1; @@ -2135,7 +2135,7 @@ virDomainUSBAddressSetAddControllers(virDomainUSBAddressSetPtr addrs, } for (i = 0; i < def->nhubs; i++) { - virDomainHubDefPtr hub = def->hubs[i]; + virDomainHubDef *hub = def->hubs[i]; if (hub->type == VIR_DOMAIN_HUB_TYPE_USB && hub->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB && virDomainUSBAddressPortIsValid(hub->info.addr.usb.port)) { @@ -2150,7 +2150,7 @@ virDomainUSBAddressSetAddControllers(virDomainUSBAddressSetPtr addrs, static int -virDomainUSBAddressFindFreePort(virDomainUSBAddressHubPtr hub, +virDomainUSBAddressFindFreePort(virDomainUSBAddressHub *hub, unsigned int *portpath, unsigned int level) { @@ -2190,18 +2190,18 @@ virDomainUSBAddressFindFreePort(virDomainUSBAddressHubPtr hub, size_t -virDomainUSBAddressCountAllPorts(virDomainDefPtr def) +virDomainUSBAddressCountAllPorts(virDomainDef *def) { size_t i, ret = 0; for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) ret += virDomainUSBAddressControllerModelToPorts(cont); } for (i = 0; i < def->nhubs; i++) { - virDomainHubDefPtr hub = def->hubs[i]; + virDomainHubDef *hub = def->hubs[i]; if (hub->type == VIR_DOMAIN_HUB_TYPE_USB) ret += VIR_DOMAIN_USB_HUB_PORTS; } @@ -2216,12 +2216,12 @@ virDomainUSBAddressCountAllPorts(virDomainDefPtr def) * -2 if there is no bus at @bus or no free port on this bus */ static int -virDomainUSBAddressAssignFromBus(virDomainUSBAddressSetPtr addrs, - virDomainDeviceInfoPtr info, +virDomainUSBAddressAssignFromBus(virDomainUSBAddressSet *addrs, + virDomainDeviceInfo *info, size_t bus) { unsigned int portpath[VIR_DOMAIN_DEVICE_USB_MAX_PORT_DEPTH] = { 0 }; - virDomainUSBAddressHubPtr hub = addrs->buses[bus]; + virDomainUSBAddressHub *hub = addrs->buses[bus]; g_autofree char *portStr = NULL; if (!hub) @@ -2247,8 +2247,8 @@ virDomainUSBAddressAssignFromBus(virDomainUSBAddressSetPtr addrs, int -virDomainUSBAddressAssign(virDomainUSBAddressSetPtr addrs, - virDomainDeviceInfoPtr info) +virDomainUSBAddressAssign(virDomainUSBAddressSet *addrs, + virDomainDeviceInfo *info) { size_t i; int rc; @@ -2280,7 +2280,7 @@ virDomainUSBAddressAssign(virDomainUSBAddressSetPtr addrs, int -virDomainUSBAddressPresent(virDomainDeviceInfoPtr info, +virDomainUSBAddressPresent(virDomainDeviceInfo *info, void *data G_GNUC_UNUSED) { if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB && @@ -2292,11 +2292,11 @@ virDomainUSBAddressPresent(virDomainDeviceInfoPtr info, int -virDomainUSBAddressReserve(virDomainDeviceInfoPtr info, +virDomainUSBAddressReserve(virDomainDeviceInfo *info, void *data) { - virDomainUSBAddressSetPtr addrs = data; - virDomainUSBAddressHubPtr targetHub = NULL; + virDomainUSBAddressSet *addrs = data; + virDomainUSBAddressHub *targetHub = NULL; g_autofree char *portStr = NULL; int targetPort; @@ -2329,8 +2329,8 @@ virDomainUSBAddressReserve(virDomainDeviceInfoPtr info, int -virDomainUSBAddressEnsure(virDomainUSBAddressSetPtr addrs, - virDomainDeviceInfoPtr info) +virDomainUSBAddressEnsure(virDomainUSBAddressSet *addrs, + virDomainDeviceInfo *info) { if (!addrs) return 0; @@ -2350,10 +2350,10 @@ virDomainUSBAddressEnsure(virDomainUSBAddressSetPtr addrs, int -virDomainUSBAddressRelease(virDomainUSBAddressSetPtr addrs, - virDomainDeviceInfoPtr info) +virDomainUSBAddressRelease(virDomainUSBAddressSet *addrs, + virDomainDeviceInfo *info) { - virDomainUSBAddressHubPtr targetHub = NULL; + virDomainUSBAddressHub *targetHub = NULL; g_autofree char *portStr = NULL; int targetPort; diff --git a/src/conf/domain_addr.h b/src/conf/domain_addr.h index 4fbc1d7f22..3f8fcf8acb 100644 --- a/src/conf/domain_addr.h +++ b/src/conf/domain_addr.h @@ -112,13 +112,11 @@ typedef struct { /* See virDomainDeviceInfo::isolationGroupLocked */ bool isolationGroupLocked; } virDomainPCIAddressBus; -typedef virDomainPCIAddressBus *virDomainPCIAddressBusPtr; typedef struct { GHashTable *uids; GHashTable *fids; } virDomainZPCIAddressIds; -typedef virDomainZPCIAddressIds *virDomainZPCIAddressIdsPtr; struct _virDomainPCIAddressSet { virDomainPCIAddressBus *buses; @@ -129,70 +127,70 @@ struct _virDomainPCIAddressSet { bool areMultipleRootsSupported; /* If true, the guest can use the pcie-to-pci-bridge controller */ bool isPCIeToPCIBridgeSupported; - virDomainZPCIAddressIdsPtr zpciIds; + virDomainZPCIAddressIds *zpciIds; }; typedef struct _virDomainPCIAddressSet virDomainPCIAddressSet; -typedef virDomainPCIAddressSet *virDomainPCIAddressSetPtr; -virDomainPCIAddressSetPtr virDomainPCIAddressSetAlloc(unsigned int nbuses, - virPCIDeviceAddressExtensionFlags extFlags); +virDomainPCIAddressSet * +virDomainPCIAddressSetAlloc(unsigned int nbuses, + virPCIDeviceAddressExtensionFlags extFlags); -void virDomainPCIAddressSetFree(virDomainPCIAddressSetPtr addrs); +void virDomainPCIAddressSetFree(virDomainPCIAddressSet *addrs); -bool virDomainPCIAddressValidate(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr, +bool virDomainPCIAddressValidate(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr, const char *addrStr, virDomainPCIConnectFlags flags, bool fromConfig) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int virDomainPCIAddressBusSetModel(virDomainPCIAddressBusPtr bus, +int virDomainPCIAddressBusSetModel(virDomainPCIAddressBus *bus, virDomainControllerModelPCI model, bool allowHotplug) ATTRIBUTE_NONNULL(1); -bool virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBusPtr bus) +bool virDomainPCIAddressBusIsFullyReserved(virDomainPCIAddressBus *bus) ATTRIBUTE_NONNULL(1); -bool virDomainPCIAddressSlotInUse(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) +bool virDomainPCIAddressSlotInUse(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virDomainPCIAddressExtensionReserveAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) +int virDomainPCIAddressExtensionReserveAddr(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virDomainPCIAddressExtensionReserveNextAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) +int virDomainPCIAddressExtensionReserveNextAddr(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virDomainPCIAddressReserveAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr, +int virDomainPCIAddressReserveAddr(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr, virDomainPCIConnectFlags flags, unsigned int isolationGroup) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, - virDomainDeviceInfoPtr dev, +int virDomainPCIAddressReserveNextAddr(virDomainPCIAddressSet *addrs, + virDomainDeviceInfo *dev, virDomainPCIConnectFlags flags, int function) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virDomainPCIAddressEnsureAddr(virDomainPCIAddressSetPtr addrs, - virDomainDeviceInfoPtr dev, +int virDomainPCIAddressEnsureAddr(virDomainPCIAddressSet *addrs, + virDomainDeviceInfo *dev, virDomainPCIConnectFlags flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void virDomainPCIAddressReleaseAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) +void virDomainPCIAddressReleaseAddr(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void virDomainPCIAddressExtensionReleaseAddr(virDomainPCIAddressSetPtr addrs, - virPCIDeviceAddressPtr addr) +void virDomainPCIAddressExtensionReleaseAddr(virDomainPCIAddressSet *addrs, + virPCIDeviceAddress *addr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void virDomainPCIAddressSetAllMulti(virDomainDefPtr def) +void virDomainPCIAddressSetAllMulti(virDomainDef *def) ATTRIBUTE_NONNULL(1); struct _virDomainCCWAddressSet { @@ -200,53 +198,50 @@ struct _virDomainCCWAddressSet { virDomainDeviceCCWAddress next; }; typedef struct _virDomainCCWAddressSet virDomainCCWAddressSet; -typedef virDomainCCWAddressSet *virDomainCCWAddressSetPtr; -int virDomainCCWAddressAssign(virDomainDeviceInfoPtr dev, - virDomainCCWAddressSetPtr addrs, +int virDomainCCWAddressAssign(virDomainDeviceInfo *dev, + virDomainCCWAddressSet *addrs, bool autoassign) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void virDomainCCWAddressSetFree(virDomainCCWAddressSetPtr addrs); +void virDomainCCWAddressSetFree(virDomainCCWAddressSet *addrs); -char* virDomainCCWAddressAsString(virDomainDeviceCCWAddressPtr addr) +char* virDomainCCWAddressAsString(virDomainDeviceCCWAddress *addr) ATTRIBUTE_NONNULL(1); -virDomainCCWAddressSetPtr -virDomainCCWAddressSetCreateFromDomain(virDomainDefPtr def) +virDomainCCWAddressSet * +virDomainCCWAddressSetCreateFromDomain(virDomainDef *def) ATTRIBUTE_NONNULL(1); struct _virDomainVirtioSerialController { unsigned int idx; - virBitmapPtr ports; + virBitmap *ports; }; typedef struct _virDomainVirtioSerialController virDomainVirtioSerialController; -typedef virDomainVirtioSerialController *virDomainVirtioSerialControllerPtr; struct _virDomainVirtioSerialAddrSet { - virDomainVirtioSerialControllerPtr *controllers; + virDomainVirtioSerialController **controllers; size_t ncontrollers; }; typedef struct _virDomainVirtioSerialAddrSet virDomainVirtioSerialAddrSet; -typedef virDomainVirtioSerialAddrSet *virDomainVirtioSerialAddrSetPtr; void -virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSetPtr addrs); -virDomainVirtioSerialAddrSetPtr -virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDefPtr def) +virDomainVirtioSerialAddrSetFree(virDomainVirtioSerialAddrSet *addrs); +virDomainVirtioSerialAddrSet * +virDomainVirtioSerialAddrSetCreateFromDomain(virDomainDef *def) ATTRIBUTE_NONNULL(1); bool -virDomainVirtioSerialAddrIsComplete(virDomainDeviceInfoPtr info); +virDomainVirtioSerialAddrIsComplete(virDomainDeviceInfo *info); int -virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDefPtr def, - virDomainVirtioSerialAddrSetPtr addrs, - virDomainDeviceInfoPtr info, +virDomainVirtioSerialAddrAutoAssignFromCache(virDomainDef *def, + virDomainVirtioSerialAddrSet *addrs, + virDomainDeviceInfo *info, bool allowZero) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int -virDomainVirtioSerialAddrAutoAssign(virDomainDefPtr def, - virDomainDeviceInfoPtr info, +virDomainVirtioSerialAddrAutoAssign(virDomainDef *def, + virDomainDeviceInfo *info, bool allowZero) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); @@ -255,64 +250,62 @@ virDomainUSBAddressPortIsValid(unsigned int *port) ATTRIBUTE_NONNULL(1); void -virDomainUSBAddressPortFormatBuf(virBufferPtr buf, +virDomainUSBAddressPortFormatBuf(virBuffer *buf, unsigned int *port) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); #define VIR_DOMAIN_USB_HUB_PORTS 8 typedef struct _virDomainUSBAddressHub virDomainUSBAddressHub; -typedef virDomainUSBAddressHub *virDomainUSBAddressHubPtr; struct _virDomainUSBAddressHub { /* indexes are shifted by one: * ports[0] represents port 1, because ports are numbered from 1 */ - virBitmapPtr portmap; + virBitmap *portmap; size_t nports; - virDomainUSBAddressHubPtr *ports; + virDomainUSBAddressHub **ports; }; struct _virDomainUSBAddressSet { /* every is represented * as a hub at buses[i] */ - virDomainUSBAddressHubPtr *buses; + virDomainUSBAddressHub **buses; size_t nbuses; }; typedef struct _virDomainUSBAddressSet virDomainUSBAddressSet; -typedef virDomainUSBAddressSet *virDomainUSBAddressSetPtr; -virDomainUSBAddressSetPtr virDomainUSBAddressSetCreate(void); +virDomainUSBAddressSet *virDomainUSBAddressSetCreate(void); -int virDomainUSBAddressSetAddControllers(virDomainUSBAddressSetPtr addrs, - virDomainDefPtr def) +int virDomainUSBAddressSetAddControllers(virDomainUSBAddressSet *addrs, + virDomainDef *def) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int -virDomainUSBAddressSetAddHub(virDomainUSBAddressSetPtr addrs, - virDomainHubDefPtr hub) +virDomainUSBAddressSetAddHub(virDomainUSBAddressSet *addrs, + virDomainHubDef *hub) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); size_t -virDomainUSBAddressCountAllPorts(virDomainDefPtr def); -void virDomainUSBAddressSetFree(virDomainUSBAddressSetPtr addrs); +virDomainUSBAddressCountAllPorts(virDomainDef *def); +void virDomainUSBAddressSetFree(virDomainUSBAddressSet *addrs); int -virDomainUSBAddressPresent(virDomainDeviceInfoPtr info, +virDomainUSBAddressPresent(virDomainDeviceInfo *info, void *data) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int -virDomainUSBAddressReserve(virDomainDeviceInfoPtr info, +virDomainUSBAddressReserve(virDomainDeviceInfo *info, void *data) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int -virDomainUSBAddressAssign(virDomainUSBAddressSetPtr addrs, - virDomainDeviceInfoPtr info) +virDomainUSBAddressAssign(virDomainUSBAddressSet *addrs, + virDomainDeviceInfo *info) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int -virDomainUSBAddressEnsure(virDomainUSBAddressSetPtr addrs, - virDomainDeviceInfoPtr info) +virDomainUSBAddressEnsure(virDomainUSBAddressSet *addrs, + virDomainDeviceInfo *info) ATTRIBUTE_NONNULL(2); int -virDomainUSBAddressRelease(virDomainUSBAddressSetPtr addrs, - virDomainDeviceInfoPtr info) +virDomainUSBAddressRelease(virDomainUSBAddressSet *addrs, + virDomainDeviceInfo *info) ATTRIBUTE_NONNULL(2); diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c index 5fa65a8078..b1226fd5dc 100644 --- a/src/conf/domain_audit.c +++ b/src/conf/domain_audit.c @@ -65,7 +65,7 @@ virDomainAuditGetRdev(const char *path G_GNUC_UNUSED) static const char * -virDomainAuditGetVirtType(virDomainDefPtr def) +virDomainAuditGetVirtType(virDomainDef *def) { const char *virt; @@ -80,7 +80,7 @@ virDomainAuditGetVirtType(virDomainDefPtr def) static void -virDomainAuditGenericDev(virDomainObjPtr vm, +virDomainAuditGenericDev(virDomainObj *vm, const char *type, const char *oldsrcpath, const char *newsrcpath, @@ -120,14 +120,14 @@ virDomainAuditGenericDev(virDomainObjPtr vm, void -virDomainAuditChardev(virDomainObjPtr vm, - virDomainChrDefPtr oldDef, - virDomainChrDefPtr newDef, +virDomainAuditChardev(virDomainObj *vm, + virDomainChrDef *oldDef, + virDomainChrDef *newDef, const char *reason, bool success) { - virDomainChrSourceDefPtr oldsrc = NULL; - virDomainChrSourceDefPtr newsrc = NULL; + virDomainChrSourceDef *oldsrc = NULL; + virDomainChrSourceDef *newsrc = NULL; if (oldDef) oldsrc = oldDef->source; @@ -143,8 +143,8 @@ virDomainAuditChardev(virDomainObjPtr vm, static void -virDomainAuditSmartcard(virDomainObjPtr vm, - virDomainSmartcardDefPtr def, +virDomainAuditSmartcard(virDomainObj *vm, + virDomainSmartcardDef *def, const char *reason, bool success) { @@ -188,9 +188,9 @@ virDomainAuditSmartcard(virDomainObjPtr vm, void -virDomainAuditDisk(virDomainObjPtr vm, - virStorageSourcePtr oldDef, - virStorageSourcePtr newDef, +virDomainAuditDisk(virDomainObj *vm, + virStorageSource *oldDef, + virStorageSource *newDef, const char *reason, bool success) { @@ -208,8 +208,8 @@ virDomainAuditDisk(virDomainObjPtr vm, void -virDomainAuditRNG(virDomainObjPtr vm, - virDomainRNGDefPtr oldDef, virDomainRNGDefPtr newDef, +virDomainAuditRNG(virDomainObj *vm, + virDomainRNGDef *oldDef, virDomainRNGDef *newDef, const char *reason, bool success) { const char *newsrcpath = NULL; @@ -252,8 +252,8 @@ virDomainAuditRNG(virDomainObjPtr vm, void -virDomainAuditFS(virDomainObjPtr vm, - virDomainFSDefPtr oldDef, virDomainFSDefPtr newDef, +virDomainAuditFS(virDomainObj *vm, + virDomainFSDef *oldDef, virDomainFSDef *newDef, const char *reason, bool success) { virDomainAuditGenericDev(vm, "fs", @@ -264,8 +264,8 @@ virDomainAuditFS(virDomainObjPtr vm, void -virDomainAuditNet(virDomainObjPtr vm, - virDomainNetDefPtr oldDef, virDomainNetDefPtr newDef, +virDomainAuditNet(virDomainObj *vm, + virDomainNetDef *oldDef, virDomainNetDef *newDef, const char *reason, bool success) { char newMacstr[VIR_MAC_STRING_BUFLEN]; @@ -296,7 +296,7 @@ virDomainAuditNet(virDomainObjPtr vm, * Log an audit message about an attempted network device open. */ void -virDomainAuditNetDevice(virDomainDefPtr vmDef, virDomainNetDefPtr netDef, +virDomainAuditNetDevice(virDomainDef *vmDef, virDomainNetDef *netDef, const char *device, bool success) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -336,7 +336,7 @@ virDomainAuditNetDevice(virDomainDefPtr vmDef, virDomainNetDefPtr netDef, * Log an audit message about an attempted device passthrough change. */ void -virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev, +virDomainAuditHostdev(virDomainObj *vm, virDomainHostdevDef *hostdev, const char *reason, bool success) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -345,11 +345,11 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev, char *device = NULL; const char *virt = virDomainAuditGetVirtType(vm->def); - virDomainHostdevSubsysUSBPtr usbsrc = &hostdev->source.subsys.u.usb; - virDomainHostdevSubsysPCIPtr pcisrc = &hostdev->source.subsys.u.pci; - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIVHostPtr hostsrc = &hostdev->source.subsys.u.scsi_host; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &hostdev->source.subsys.u.mdev; + virDomainHostdevSubsysUSB *usbsrc = &hostdev->source.subsys.u.usb; + virDomainHostdevSubsysPCI *pcisrc = &hostdev->source.subsys.u.pci; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIVHost *hostsrc = &hostdev->source.subsys.u.scsi_host; + virDomainHostdevSubsysMediatedDev *mdevsrc = &hostdev->source.subsys.u.mdev; virUUIDFormat(vm->def->uuid, uuidstr); if (!(vmname = virAuditEncode("vm", vm->def->name))) { @@ -374,8 +374,8 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev, */ goto cleanup; } else { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = - &scsisrc->u.host; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; + address = g_strdup_printf("%s:%u:%u:%llu", scsihostsrc->adapter, scsihostsrc->bus, scsihostsrc->target, @@ -465,7 +465,7 @@ virDomainAuditHostdev(virDomainObjPtr vm, virDomainHostdevDefPtr hostdev, * Log an audit message about an attempted device passthrough change. */ void -virDomainAuditRedirdev(virDomainObjPtr vm, virDomainRedirdevDefPtr redirdev, +virDomainAuditRedirdev(virDomainObj *vm, virDomainRedirdevDef *redirdev, const char *reason, bool success) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -519,7 +519,7 @@ virDomainAuditRedirdev(virDomainObjPtr vm, virDomainRedirdevDefPtr redirdev, * change. */ static void -virDomainAuditTPM(virDomainObjPtr vm, virDomainTPMDefPtr tpm, +virDomainAuditTPM(virDomainObj *vm, virDomainTPMDef *tpm, const char *reason, bool success) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -582,7 +582,7 @@ virDomainAuditTPM(virDomainObjPtr vm, virDomainTPMDefPtr tpm, * Log an audit message about an attempted cgroup device ACL change. */ void -virDomainAuditCgroup(virDomainObjPtr vm, virCgroupPtr cgroup, +virDomainAuditCgroup(virDomainObj *vm, virCgroup *cgroup, const char *reason, const char *extra, bool success) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -625,7 +625,7 @@ virDomainAuditCgroup(virDomainObjPtr vm, virCgroupPtr cgroup, * Log an audit message about an attempted cgroup device ACL change. */ void -virDomainAuditCgroupMajor(virDomainObjPtr vm, virCgroupPtr cgroup, +virDomainAuditCgroupMajor(virDomainObj *vm, virCgroup *cgroup, const char *reason, int maj, const char *name, const char *perms, bool success) { @@ -652,7 +652,7 @@ virDomainAuditCgroupMajor(virDomainObjPtr vm, virCgroupPtr cgroup, * a specific device. */ void -virDomainAuditCgroupPath(virDomainObjPtr vm, virCgroupPtr cgroup, +virDomainAuditCgroupPath(virDomainObj *vm, virCgroup *cgroup, const char *reason, const char *path, const char *perms, int rc) { @@ -694,7 +694,7 @@ virDomainAuditCgroupPath(virDomainObjPtr vm, virCgroupPtr cgroup, * Log an audit message about an attempted resource change. */ static void -virDomainAuditResource(virDomainObjPtr vm, const char *resource, +virDomainAuditResource(virDomainObj *vm, const char *resource, unsigned long long oldval, unsigned long long newval, const char *reason, bool success) { @@ -717,7 +717,7 @@ virDomainAuditResource(virDomainObjPtr vm, const char *resource, } void -virDomainAuditMemory(virDomainObjPtr vm, +virDomainAuditMemory(virDomainObj *vm, unsigned long long oldmem, unsigned long long newmem, const char *reason, bool success) { @@ -725,7 +725,7 @@ virDomainAuditMemory(virDomainObjPtr vm, } void -virDomainAuditVcpu(virDomainObjPtr vm, +virDomainAuditVcpu(virDomainObj *vm, unsigned int oldvcpu, unsigned int newvcpu, const char *reason, bool success) { @@ -733,7 +733,7 @@ virDomainAuditVcpu(virDomainObjPtr vm, } void -virDomainAuditIOThread(virDomainObjPtr vm, +virDomainAuditIOThread(virDomainObj *vm, unsigned int oldiothread, unsigned int newiothread, const char *reason, bool success) { @@ -742,7 +742,7 @@ virDomainAuditIOThread(virDomainObjPtr vm, } static void -virDomainAuditLifecycle(virDomainObjPtr vm, const char *op, +virDomainAuditLifecycle(virDomainObj *vm, const char *op, const char *reason, bool success) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -765,7 +765,7 @@ virDomainAuditLifecycle(virDomainObjPtr vm, const char *op, void -virDomainAuditStart(virDomainObjPtr vm, const char *reason, bool success) +virDomainAuditStart(virDomainObj *vm, const char *reason, bool success) { size_t i; @@ -773,22 +773,22 @@ virDomainAuditStart(virDomainObjPtr vm, const char *reason, bool success) virDomainAuditDisk(vm, NULL, vm->def->disks[i]->src, "start", true); for (i = 0; i < vm->def->nfss; i++) { - virDomainFSDefPtr fs = vm->def->fss[i]; + virDomainFSDef *fs = vm->def->fss[i]; virDomainAuditFS(vm, NULL, fs, "start", true); } for (i = 0; i < vm->def->nnets; i++) { - virDomainNetDefPtr net = vm->def->nets[i]; + virDomainNetDef *net = vm->def->nets[i]; virDomainAuditNet(vm, NULL, net, "start", true); } for (i = 0; i < vm->def->nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = vm->def->hostdevs[i]; + virDomainHostdevDef *hostdev = vm->def->hostdevs[i]; virDomainAuditHostdev(vm, hostdev, "start", true); } for (i = 0; i < vm->def->nredirdevs; i++) { - virDomainRedirdevDefPtr redirdev = vm->def->redirdevs[i]; + virDomainRedirdevDef *redirdev = vm->def->redirdevs[i]; virDomainAuditRedirdev(vm, redirdev, "start", true); } @@ -836,7 +836,7 @@ virDomainAuditStart(virDomainObjPtr vm, const char *reason, bool success) } void -virDomainAuditInit(virDomainObjPtr vm, +virDomainAuditInit(virDomainObj *vm, pid_t initpid, ino_t pidns) { @@ -860,13 +860,13 @@ virDomainAuditInit(virDomainObjPtr vm, } void -virDomainAuditStop(virDomainObjPtr vm, const char *reason) +virDomainAuditStop(virDomainObj *vm, const char *reason) { virDomainAuditLifecycle(vm, "stop", reason, true); } void -virDomainAuditSecurityLabel(virDomainObjPtr vm, bool success) +virDomainAuditSecurityLabel(virDomainObj *vm, bool success) { char uuidstr[VIR_UUID_STRING_BUFLEN]; char *vmname; @@ -892,8 +892,8 @@ virDomainAuditSecurityLabel(virDomainObjPtr vm, bool success) } void -virDomainAuditShmem(virDomainObjPtr vm, - virDomainShmemDefPtr def, +virDomainAuditShmem(virDomainObj *vm, + virDomainShmemDef *def, const char *reason, bool success) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -935,8 +935,8 @@ virDomainAuditShmem(virDomainObjPtr vm, void -virDomainAuditInput(virDomainObjPtr vm, - virDomainInputDefPtr input, +virDomainAuditInput(virDomainObj *vm, + virDomainInputDef *input, const char *reason, bool success) { diff --git a/src/conf/domain_audit.h b/src/conf/domain_audit.h index d34c750427..75afda05d7 100644 --- a/src/conf/domain_audit.h +++ b/src/conf/domain_audit.h @@ -24,54 +24,54 @@ #include "domain_conf.h" #include "vircgroup.h" -void virDomainAuditStart(virDomainObjPtr vm, +void virDomainAuditStart(virDomainObj *vm, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void virDomainAuditInit(virDomainObjPtr vm, +void virDomainAuditInit(virDomainObj *vm, pid_t pid, ino_t pidns) ATTRIBUTE_NONNULL(1); -void virDomainAuditStop(virDomainObjPtr vm, +void virDomainAuditStop(virDomainObj *vm, const char *reason) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void virDomainAuditDisk(virDomainObjPtr vm, - virStorageSourcePtr oldDef, - virStorageSourcePtr newDef, +void virDomainAuditDisk(virDomainObj *vm, + virStorageSource *oldDef, + virStorageSource *newDef, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); -void virDomainAuditFS(virDomainObjPtr vm, - virDomainFSDefPtr oldDef, - virDomainFSDefPtr newDef, +void virDomainAuditFS(virDomainObj *vm, + virDomainFSDef *oldDef, + virDomainFSDef *newDef, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); -void virDomainAuditNet(virDomainObjPtr vm, - virDomainNetDefPtr oldDef, - virDomainNetDefPtr newDef, +void virDomainAuditNet(virDomainObj *vm, + virDomainNetDef *oldDef, + virDomainNetDef *newDef, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); -void virDomainAuditNetDevice(virDomainDefPtr vmDef, - virDomainNetDefPtr netDef, +void virDomainAuditNetDevice(virDomainDef *vmDef, + virDomainNetDef *netDef, const char *device, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -void virDomainAuditHostdev(virDomainObjPtr vm, - virDomainHostdevDefPtr def, +void virDomainAuditHostdev(virDomainObj *vm, + virDomainHostdevDef *def, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -void virDomainAuditCgroup(virDomainObjPtr vm, - virCgroupPtr group, +void virDomainAuditCgroup(virDomainObj *vm, + virCgroup *group, const char *reason, const char *extra, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -void virDomainAuditCgroupMajor(virDomainObjPtr vm, - virCgroupPtr group, +void virDomainAuditCgroupMajor(virDomainObj *vm, + virCgroup *group, const char *reason, int maj, const char *name, @@ -79,59 +79,59 @@ void virDomainAuditCgroupMajor(virDomainObjPtr vm, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6); -void virDomainAuditCgroupPath(virDomainObjPtr vm, - virCgroupPtr group, +void virDomainAuditCgroupPath(virDomainObj *vm, + virCgroup *group, const char *reason, const char *path, const char *perms, int rc) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5); -void virDomainAuditMemory(virDomainObjPtr vm, +void virDomainAuditMemory(virDomainObj *vm, unsigned long long oldmem, unsigned long long newmem, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); -void virDomainAuditVcpu(virDomainObjPtr vm, +void virDomainAuditVcpu(virDomainObj *vm, unsigned int oldvcpu, unsigned int newvcpu, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); -void virDomainAuditIOThread(virDomainObjPtr vm, +void virDomainAuditIOThread(virDomainObj *vm, unsigned int oldiothread, unsigned int newiothread, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); -void virDomainAuditSecurityLabel(virDomainObjPtr vm, +void virDomainAuditSecurityLabel(virDomainObj *vm, bool success) ATTRIBUTE_NONNULL(1); -void virDomainAuditRedirdev(virDomainObjPtr vm, - virDomainRedirdevDefPtr def, +void virDomainAuditRedirdev(virDomainObj *vm, + virDomainRedirdevDef *def, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -void virDomainAuditChardev(virDomainObjPtr vm, - virDomainChrDefPtr oldDef, - virDomainChrDefPtr newDef, +void virDomainAuditChardev(virDomainObj *vm, + virDomainChrDef *oldDef, + virDomainChrDef *newDef, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); -void virDomainAuditRNG(virDomainObjPtr vm, - virDomainRNGDefPtr oldDef, - virDomainRNGDefPtr newDef, +void virDomainAuditRNG(virDomainObj *vm, + virDomainRNGDef *oldDef, + virDomainRNGDef *newDef, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); -void virDomainAuditShmem(virDomainObjPtr vm, - virDomainShmemDefPtr def, +void virDomainAuditShmem(virDomainObj *vm, + virDomainShmemDef *def, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -void virDomainAuditInput(virDomainObjPtr vm, - virDomainInputDefPtr input, +void virDomainAuditInput(virDomainObj *vm, + virDomainInputDef *input, const char *reason, bool success) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index e0d7eddd2c..d0586362ae 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -44,8 +44,8 @@ VIR_ENUM_IMPL(virDomainCapsFeature, "backup", ); -static virClassPtr virDomainCapsClass; -static virClassPtr virDomainCapsCPUModelsClass; +static virClass *virDomainCapsClass; +static virClass *virDomainCapsCPUModelsClass; static void virDomainCapsDispose(void *obj); static void virDomainCapsCPUModelsDispose(void *obj); @@ -80,8 +80,8 @@ virSEVCapabilitiesFree(virSEVCapability *cap) static void virDomainCapsDispose(void *obj) { - virDomainCapsPtr caps = obj; - virDomainCapsStringValuesPtr values; + virDomainCaps *caps = obj; + virDomainCapsStringValues *values; size_t i; g_free(caps->path); @@ -100,7 +100,7 @@ virDomainCapsDispose(void *obj) static void virDomainCapsCPUModelsDispose(void *obj) { - virDomainCapsCPUModelsPtr cpuModels = obj; + virDomainCapsCPUModels *cpuModels = obj; size_t i; for (i = 0; i < cpuModels->nmodels; i++) { @@ -112,13 +112,13 @@ virDomainCapsCPUModelsDispose(void *obj) } -virDomainCapsPtr +virDomainCaps * virDomainCapsNew(const char *path, const char *machine, virArch arch, virDomainVirtType virttype) { - virDomainCapsPtr caps = NULL; + virDomainCaps *caps = NULL; if (virDomainCapsInitialize() < 0) return NULL; @@ -135,10 +135,10 @@ virDomainCapsNew(const char *path, } -virDomainCapsCPUModelsPtr +virDomainCapsCPUModels * virDomainCapsCPUModelsNew(size_t nmodels) { - virDomainCapsCPUModelsPtr cpuModels = NULL; + virDomainCapsCPUModels *cpuModels = NULL; if (virDomainCapsInitialize() < 0) return NULL; @@ -153,10 +153,10 @@ virDomainCapsCPUModelsNew(size_t nmodels) } -virDomainCapsCPUModelsPtr -virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr old) +virDomainCapsCPUModels * +virDomainCapsCPUModelsCopy(virDomainCapsCPUModels *old) { - virDomainCapsCPUModelsPtr cpuModels; + virDomainCapsCPUModels *cpuModels; size_t i; if (!(cpuModels = virDomainCapsCPUModelsNew(old->nmodels))) @@ -180,14 +180,14 @@ virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr old) int -virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, +virDomainCapsCPUModelsAdd(virDomainCapsCPUModels *cpuModels, const char *name, virDomainCapsCPUUsable usable, char **blockers, bool deprecated) { g_autofree char * nameCopy = NULL; - virDomainCapsCPUModelPtr cpu; + virDomainCapsCPUModel *cpu; nameCopy = g_strdup(name); @@ -206,8 +206,8 @@ virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, } -virDomainCapsCPUModelPtr -virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels, +virDomainCapsCPUModel * +virDomainCapsCPUModelsGet(virDomainCapsCPUModels *cpuModels, const char *name) { size_t i; @@ -225,7 +225,7 @@ virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels, int -virDomainCapsEnumSet(virDomainCapsEnumPtr capsEnum, +virDomainCapsEnumSet(virDomainCapsEnum *capsEnum, const char *capsEnumName, size_t nvalues, unsigned int *values) @@ -252,14 +252,14 @@ virDomainCapsEnumSet(virDomainCapsEnumPtr capsEnum, void -virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum) +virDomainCapsEnumClear(virDomainCapsEnum *capsEnum) { capsEnum->values = 0; } static int -virDomainCapsEnumFormat(virBufferPtr buf, +virDomainCapsEnumFormat(virBuffer *buf, const virDomainCapsEnum *capsEnum, const char *capsEnumName, virDomainCapsValToStr valToStr) @@ -294,7 +294,7 @@ virDomainCapsEnumFormat(virBufferPtr buf, static void -virDomainCapsStringValuesFormat(virBufferPtr buf, +virDomainCapsStringValuesFormat(virBuffer *buf, const virDomainCapsStringValues *values) { size_t i; @@ -330,7 +330,7 @@ virDomainCapsStringValuesFormat(virBufferPtr buf, static void -qemuDomainCapsFeatureFormatSimple(virBufferPtr buf, +qemuDomainCapsFeatureFormatSimple(virBuffer *buf, const char *featurename, virTristateBool supported) { @@ -343,7 +343,7 @@ qemuDomainCapsFeatureFormatSimple(virBufferPtr buf, static void -virDomainCapsLoaderFormat(virBufferPtr buf, +virDomainCapsLoaderFormat(virBuffer *buf, const virDomainCapsLoader *loader) { FORMAT_PROLOGUE(loader); @@ -357,7 +357,7 @@ virDomainCapsLoaderFormat(virBufferPtr buf, } static void -virDomainCapsOSFormat(virBufferPtr buf, +virDomainCapsOSFormat(virBuffer *buf, const virDomainCapsOS *os) { const virDomainCapsLoader *loader = &os->loader; @@ -372,15 +372,15 @@ virDomainCapsOSFormat(virBufferPtr buf, } static void -virDomainCapsCPUCustomFormat(virBufferPtr buf, - virDomainCapsCPUModelsPtr custom) +virDomainCapsCPUCustomFormat(virBuffer *buf, + virDomainCapsCPUModels *custom) { size_t i; virBufferAdjustIndent(buf, 2); for (i = 0; i < custom->nmodels; i++) { - virDomainCapsCPUModelPtr model = custom->models + i; + virDomainCapsCPUModel *model = custom->models + i; virBufferAsprintf(buf, "usable)); if (model->deprecated) @@ -393,7 +393,7 @@ virDomainCapsCPUCustomFormat(virBufferPtr buf, } static void -virDomainCapsCPUFormat(virBufferPtr buf, +virDomainCapsCPUFormat(virBuffer *buf, const virDomainCapsCPU *cpu) { virBufferAddLit(buf, "\n"); @@ -458,7 +458,7 @@ virDomainCapsCPUFormat(virBufferPtr buf, } static void -virDomainCapsDeviceDiskFormat(virBufferPtr buf, +virDomainCapsDeviceDiskFormat(virBuffer *buf, const virDomainCapsDeviceDisk *disk) { FORMAT_PROLOGUE(disk); @@ -472,7 +472,7 @@ virDomainCapsDeviceDiskFormat(virBufferPtr buf, static void -virDomainCapsDeviceGraphicsFormat(virBufferPtr buf, +virDomainCapsDeviceGraphicsFormat(virBuffer *buf, const virDomainCapsDeviceGraphics *graphics) { FORMAT_PROLOGUE(graphics); @@ -484,7 +484,7 @@ virDomainCapsDeviceGraphicsFormat(virBufferPtr buf, static void -virDomainCapsDeviceVideoFormat(virBufferPtr buf, +virDomainCapsDeviceVideoFormat(virBuffer *buf, const virDomainCapsDeviceVideo *video) { FORMAT_PROLOGUE(video); @@ -496,7 +496,7 @@ virDomainCapsDeviceVideoFormat(virBufferPtr buf, static void -virDomainCapsDeviceHostdevFormat(virBufferPtr buf, +virDomainCapsDeviceHostdevFormat(virBuffer *buf, const virDomainCapsDeviceHostdev *hostdev) { FORMAT_PROLOGUE(hostdev); @@ -512,7 +512,7 @@ virDomainCapsDeviceHostdevFormat(virBufferPtr buf, static void -virDomainCapsDeviceRNGFormat(virBufferPtr buf, +virDomainCapsDeviceRNGFormat(virBuffer *buf, const virDomainCapsDeviceRNG *rng) { FORMAT_PROLOGUE(rng); @@ -541,7 +541,7 @@ virDomainCapsDeviceRNGFormat(virBufferPtr buf, * */ static void -virDomainCapsFeatureGICFormat(virBufferPtr buf, +virDomainCapsFeatureGICFormat(virBuffer *buf, const virDomainCapsFeatureGIC *gic) { FORMAT_PROLOGUE(gic); @@ -552,7 +552,7 @@ virDomainCapsFeatureGICFormat(virBufferPtr buf, } static void -virDomainCapsFeatureSEVFormat(virBufferPtr buf, +virDomainCapsFeatureSEVFormat(virBuffer *buf, const virSEVCapability *sev) { if (!sev) { @@ -573,7 +573,7 @@ virDomainCapsFeatureSEVFormat(virBufferPtr buf, static void virDomainCapsFormatFeatures(const virDomainCaps *caps, - virBufferPtr buf) + virBuffer *buf) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); size_t i; diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 128b91fc8d..04be34765b 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -27,10 +27,8 @@ typedef const char * (*virDomainCapsValToStr)(int value); typedef struct _virDomainCaps virDomainCaps; -typedef virDomainCaps *virDomainCapsPtr; typedef struct _virDomainCapsEnum virDomainCapsEnum; -typedef virDomainCapsEnum *virDomainCapsEnumPtr; struct _virDomainCapsEnum { bool report; /* Whether the format the enum at all */ unsigned int values; /* Bitmask of values supported in the corresponding enum */ @@ -40,7 +38,6 @@ struct _virDomainCapsEnum { G_STATIC_ASSERT(last <= sizeof(unsigned int) * CHAR_BIT) typedef struct _virDomainCapsStringValues virDomainCapsStringValues; -typedef virDomainCapsStringValues *virDomainCapsStringValuesPtr; struct _virDomainCapsStringValues { char **values; /* raw string values */ size_t nvalues; /* number of strings */ @@ -49,7 +46,6 @@ struct _virDomainCapsStringValues { STATIC_ASSERT_ENUM(VIR_DOMAIN_LOADER_TYPE_LAST); STATIC_ASSERT_ENUM(VIR_TRISTATE_BOOL_LAST); typedef struct _virDomainCapsLoader virDomainCapsLoader; -typedef virDomainCapsLoader *virDomainCapsLoaderPtr; struct _virDomainCapsLoader { virTristateBool supported; virDomainCapsStringValues values; /* Info about values for the element */ @@ -60,7 +56,6 @@ struct _virDomainCapsLoader { STATIC_ASSERT_ENUM(VIR_DOMAIN_OS_DEF_FIRMWARE_LAST); typedef struct _virDomainCapsOS virDomainCapsOS; -typedef virDomainCapsOS *virDomainCapsOSPtr; struct _virDomainCapsOS { virTristateBool supported; virDomainCapsEnum firmware; /* Info about virDomainOsDefFirmware */ @@ -71,7 +66,6 @@ STATIC_ASSERT_ENUM(VIR_DOMAIN_DISK_DEVICE_LAST); STATIC_ASSERT_ENUM(VIR_DOMAIN_DISK_BUS_LAST); STATIC_ASSERT_ENUM(VIR_DOMAIN_DISK_MODEL_LAST); typedef struct _virDomainCapsDeviceDisk virDomainCapsDeviceDisk; -typedef virDomainCapsDeviceDisk *virDomainCapsDeviceDiskPtr; struct _virDomainCapsDeviceDisk { virTristateBool supported; virDomainCapsEnum diskDevice; /* Info about virDomainDiskDevice enum values */ @@ -82,7 +76,6 @@ struct _virDomainCapsDeviceDisk { STATIC_ASSERT_ENUM(VIR_DOMAIN_GRAPHICS_TYPE_LAST); typedef struct _virDomainCapsDeviceGraphics virDomainCapsDeviceGraphics; -typedef virDomainCapsDeviceGraphics *virDomainCapsDeviceGraphicsPtr; struct _virDomainCapsDeviceGraphics { virTristateBool supported; virDomainCapsEnum type; /* virDomainGraphicsType */ @@ -90,7 +83,6 @@ struct _virDomainCapsDeviceGraphics { STATIC_ASSERT_ENUM(VIR_DOMAIN_VIDEO_TYPE_LAST); typedef struct _virDomainCapsDeviceVideo virDomainCapsDeviceVideo; -typedef virDomainCapsDeviceVideo *virDomainCapsDeviceVideoPtr; struct _virDomainCapsDeviceVideo { virTristateBool supported; virDomainCapsEnum modelType; /* virDomainVideoType */ @@ -102,7 +94,6 @@ STATIC_ASSERT_ENUM(VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST); STATIC_ASSERT_ENUM(VIR_DOMAIN_HOSTDEV_CAPS_TYPE_LAST); STATIC_ASSERT_ENUM(VIR_DOMAIN_HOSTDEV_PCI_BACKEND_TYPE_LAST); typedef struct _virDomainCapsDeviceHostdev virDomainCapsDeviceHostdev; -typedef virDomainCapsDeviceHostdev *virDomainCapsDeviceHostdevPtr; struct _virDomainCapsDeviceHostdev { virTristateBool supported; virDomainCapsEnum mode; /* Info about virDomainHostdevMode */ @@ -116,7 +107,6 @@ struct _virDomainCapsDeviceHostdev { STATIC_ASSERT_ENUM(VIR_DOMAIN_RNG_MODEL_LAST); STATIC_ASSERT_ENUM(VIR_DOMAIN_RNG_BACKEND_LAST); typedef struct _virDomainCapsDeviceRNG virDomainCapsDeviceRNG; -typedef virDomainCapsDeviceRNG *virDomainCapsDeviceRNGPtr; struct _virDomainCapsDeviceRNG { virTristateBool supported; virDomainCapsEnum model; /* virDomainRNGModel */ @@ -125,7 +115,6 @@ struct _virDomainCapsDeviceRNG { STATIC_ASSERT_ENUM(VIR_GIC_VERSION_LAST); typedef struct _virDomainCapsFeatureGIC virDomainCapsFeatureGIC; -typedef virDomainCapsFeatureGIC *virDomainCapsFeatureGICPtr; struct _virDomainCapsFeatureGIC { virTristateBool supported; virDomainCapsEnum version; /* Info about virGICVersion */ @@ -141,7 +130,6 @@ typedef enum { VIR_ENUM_DECL(virDomainCapsCPUUsable); typedef struct _virDomainCapsCPUModel virDomainCapsCPUModel; -typedef virDomainCapsCPUModel *virDomainCapsCPUModelPtr; struct _virDomainCapsCPUModel { char *name; virDomainCapsCPUUsable usable; @@ -150,30 +138,27 @@ struct _virDomainCapsCPUModel { }; typedef struct _virDomainCapsCPUModels virDomainCapsCPUModels; -typedef virDomainCapsCPUModels *virDomainCapsCPUModelsPtr; struct _virDomainCapsCPUModels { virObject parent; size_t nmodels_max; size_t nmodels; - virDomainCapsCPUModelPtr models; + virDomainCapsCPUModel *models; }; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainCapsCPUModels, virObjectUnref); typedef struct _virDomainCapsCPU virDomainCapsCPU; -typedef virDomainCapsCPU *virDomainCapsCPUPtr; struct _virDomainCapsCPU { bool hostPassthrough; virDomainCapsEnum hostPassthroughMigratable; bool maximum; virDomainCapsEnum maximumMigratable; - virCPUDefPtr hostModel; - virDomainCapsCPUModelsPtr custom; + virCPUDef *hostModel; + virDomainCapsCPUModels *custom; }; typedef struct _virSEVCapability virSEVCapability; -typedef virSEVCapability *virSEVCapabilityPtr; struct _virSEVCapability { char *pdh; char *cert_chain; @@ -212,7 +197,7 @@ struct _virDomainCaps { /* add new domain devices here */ virDomainCapsFeatureGIC gic; - virSEVCapabilityPtr sev; + virSEVCapability *sev; /* add new domain features here */ virTristateBool features[VIR_DOMAIN_CAPS_FEATURE_LAST]; @@ -221,20 +206,20 @@ struct _virDomainCaps { G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainCaps, virObjectUnref); -virDomainCapsPtr virDomainCapsNew(const char *path, +virDomainCaps *virDomainCapsNew(const char *path, const char *machine, virArch arch, virDomainVirtType virttype); -virDomainCapsCPUModelsPtr virDomainCapsCPUModelsNew(size_t nmodels); -virDomainCapsCPUModelsPtr virDomainCapsCPUModelsCopy(virDomainCapsCPUModelsPtr old); -int virDomainCapsCPUModelsAdd(virDomainCapsCPUModelsPtr cpuModels, +virDomainCapsCPUModels *virDomainCapsCPUModelsNew(size_t nmodels); +virDomainCapsCPUModels *virDomainCapsCPUModelsCopy(virDomainCapsCPUModels *old); +int virDomainCapsCPUModelsAdd(virDomainCapsCPUModels *cpuModels, const char *name, virDomainCapsCPUUsable usable, char **blockers, bool deprecated); -virDomainCapsCPUModelPtr -virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels, +virDomainCapsCPUModel * +virDomainCapsCPUModelsGet(virDomainCapsCPUModels *cpuModels, const char *name); #define VIR_DOMAIN_CAPS_ENUM_IS_SET(capsEnum, value) \ @@ -249,11 +234,11 @@ virDomainCapsCPUModelsGet(virDomainCapsCPUModelsPtr cpuModels, } while (0) -int virDomainCapsEnumSet(virDomainCapsEnumPtr capsEnum, +int virDomainCapsEnumSet(virDomainCapsEnum *capsEnum, const char *capsEnumName, size_t nvalues, unsigned int *values); -void virDomainCapsEnumClear(virDomainCapsEnumPtr capsEnum); +void virDomainCapsEnumClear(virDomainCapsEnum *capsEnum); char * virDomainCapsFormat(const virDomainCaps *caps); diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e2427848ed..029f2d8d9c 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1386,20 +1386,20 @@ VIR_ENUM_IMPL(virDomainLaunchSecurity, "sev", ); -static virClassPtr virDomainObjClass; -static virClassPtr virDomainXMLOptionClass; +static virClass *virDomainObjClass; +static virClass *virDomainXMLOptionClass; static void virDomainObjDispose(void *obj); static void virDomainXMLOptionDispose(void *obj); static void -virDomainChrSourceDefFormat(virBufferPtr buf, - virDomainChrSourceDefPtr def, +virDomainChrSourceDefFormat(virBuffer *buf, + virDomainChrSourceDef *def, unsigned int flags); static int -virDomainChrSourceReconnectDefParseXML(virDomainChrSourceReconnectDefPtr def, +virDomainChrSourceReconnectDefParseXML(virDomainChrSourceReconnectDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt); @@ -1421,7 +1421,7 @@ VIR_ONCE_GLOBAL_INIT(virDomainObj); static void virDomainXMLOptionDispose(void *obj) { - virDomainXMLOptionPtr xmlopt = obj; + virDomainXMLOption *xmlopt = obj; if (xmlopt->config.privFree) (xmlopt->config.privFree)(xmlopt->config.priv); @@ -1444,7 +1444,7 @@ virDomainXMLOptionDispose(void *obj) * -1 otherwise */ static int -virDomainKeyWrapCipherDefParseXML(virDomainKeyWrapDefPtr keywrap, +virDomainKeyWrapCipherDefParseXML(virDomainKeyWrapDef *keywrap, xmlNodePtr node) { int state_type; @@ -1509,12 +1509,12 @@ virDomainKeyWrapCipherDefParseXML(virDomainKeyWrapDefPtr keywrap, } static int -virDomainKeyWrapDefParseXML(virDomainDefPtr def, xmlXPathContextPtr ctxt) +virDomainKeyWrapDefParseXML(virDomainDef *def, xmlXPathContextPtr ctxt) { size_t i; int n; g_autofree xmlNodePtr *nodes = NULL; - g_autofree virDomainKeyWrapDefPtr keywrap = NULL; + g_autofree virDomainKeyWrapDef *keywrap = NULL; if ((n = virXPathNodeSet("./keywrap/cipher", ctxt, &nodes)) < 0) return n; @@ -1538,14 +1538,14 @@ virDomainKeyWrapDefParseXML(virDomainDefPtr def, xmlXPathContextPtr ctxt) * * Allocate a new domain XML configuration */ -virDomainXMLOptionPtr -virDomainXMLOptionNew(virDomainDefParserConfigPtr config, - virDomainXMLPrivateDataCallbacksPtr priv, - virXMLNamespacePtr xmlns, - virDomainABIStabilityPtr abi, - virSaveCookieCallbacksPtr saveCookie) +virDomainXMLOption * +virDomainXMLOptionNew(virDomainDefParserConfig *config, + virDomainXMLPrivateDataCallbacks *priv, + virXMLNamespace *xmlns, + virDomainABIStability *abi, + virSaveCookieCallbacks *saveCookie) { - virDomainXMLOptionPtr xmlopt; + virDomainXMLOption *xmlopt; if (virDomainObjInitialize() < 0) return NULL; @@ -1591,18 +1591,18 @@ virDomainXMLOptionNew(virDomainDefParserConfigPtr config, * Returns a pointer to the stored namespace structure. * The lifetime of the pointer is equal to @xmlopt; */ -virXMLNamespacePtr -virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt) +virXMLNamespace * +virDomainXMLOptionGetNamespace(virDomainXMLOption *xmlopt) { return &xmlopt->ns; } static int virDomainVirtioOptionsParseXML(xmlNodePtr driver, - virDomainVirtioOptionsPtr *virtio) + virDomainVirtioOptions **virtio) { int val; - virDomainVirtioOptionsPtr res; + virDomainVirtioOptions *res; g_autofree char *str = NULL; if (*virtio || !driver) @@ -1645,15 +1645,15 @@ virDomainVirtioOptionsParseXML(xmlNodePtr driver, } -virSaveCookieCallbacksPtr -virDomainXMLOptionGetSaveCookie(virDomainXMLOptionPtr xmlopt) +virSaveCookieCallbacks * +virDomainXMLOptionGetSaveCookie(virDomainXMLOption *xmlopt) { return &xmlopt->saveCookie; } void -virDomainXMLOptionSetMomentPostParse(virDomainXMLOptionPtr xmlopt, +virDomainXMLOptionSetMomentPostParse(virDomainXMLOption *xmlopt, virDomainMomentPostParseCallback cb) { xmlopt->momentPostParse = cb; @@ -1661,8 +1661,8 @@ virDomainXMLOptionSetMomentPostParse(virDomainXMLOptionPtr xmlopt, int -virDomainXMLOptionRunMomentPostParse(virDomainXMLOptionPtr xmlopt, - virDomainMomentDefPtr def) +virDomainXMLOptionRunMomentPostParse(virDomainXMLOption *xmlopt, + virDomainMomentDef *def) { if (!xmlopt->momentPostParse) return virDomainMomentDefPostParse(def); @@ -1671,7 +1671,7 @@ virDomainXMLOptionRunMomentPostParse(virDomainXMLOptionPtr xmlopt, void -virBlkioDeviceArrayClear(virBlkioDevicePtr devices, +virBlkioDeviceArrayClear(virBlkioDevice *devices, int ndevices) { size_t i; @@ -1694,11 +1694,11 @@ virBlkioDeviceArrayClear(virBlkioDevicePtr devices, * iops * * - * and fills a virBlkioDevicePtr struct. + * and fills a virBlkioDevice *struct. */ static int virDomainBlkioDeviceParseXML(xmlNodePtr root, - virBlkioDevicePtr dev) + virBlkioDevice *dev) { xmlNodePtr node; g_autofree char *path = NULL; @@ -1792,7 +1792,7 @@ virDomainBlkioDeviceParseXML(xmlNodePtr root, * tunable and reports an error. Otherwise returns 0. */ static int -virDomainDefCheckUnsupportedMemoryHotplug(virDomainDefPtr def) +virDomainDefCheckUnsupportedMemoryHotplug(virDomainDef *def) { /* memory hotplug tunables are not supported by this driver */ if (virDomainDefHasMemoryHotplug(def)) { @@ -1814,7 +1814,7 @@ virDomainDefCheckUnsupportedMemoryHotplug(virDomainDefPtr def) * error. Otherwise returns 0. */ static int -virDomainDeviceDefCheckUnsupportedMemoryDevice(virDomainDeviceDefPtr dev) +virDomainDeviceDefCheckUnsupportedMemoryDevice(virDomainDeviceDef *dev) { /* This driver doesn't yet know how to handle memory devices */ if (dev->type == VIR_DOMAIN_DEVICE_MEMORY) { @@ -1827,7 +1827,7 @@ virDomainDeviceDefCheckUnsupportedMemoryDevice(virDomainDeviceDefPtr dev) } -bool virDomainObjTaint(virDomainObjPtr obj, +bool virDomainObjTaint(virDomainObj *obj, virDomainTaintFlags taint) { unsigned int flag = (1 << taint); @@ -1840,7 +1840,7 @@ bool virDomainObjTaint(virDomainObjPtr obj, } -void virDomainObjDeprecation(virDomainObjPtr obj, +void virDomainObjDeprecation(virDomainObj *obj, const char *msg) { obj->deprecations = g_renew(char *, obj->deprecations, @@ -1850,7 +1850,7 @@ void virDomainObjDeprecation(virDomainObjPtr obj, static void -virDomainGraphicsAuthDefClear(virDomainGraphicsAuthDefPtr def) +virDomainGraphicsAuthDefClear(virDomainGraphicsAuthDef *def) { if (!def) return; @@ -1861,7 +1861,7 @@ virDomainGraphicsAuthDefClear(virDomainGraphicsAuthDefPtr def) } static void -virDomainGraphicsListenDefClear(virDomainGraphicsListenDefPtr def) +virDomainGraphicsListenDefClear(virDomainGraphicsListenDef *def) { if (!def) return; @@ -1873,7 +1873,7 @@ virDomainGraphicsListenDefClear(virDomainGraphicsListenDefPtr def) } -void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def) +void virDomainGraphicsDefFree(virDomainGraphicsDef *def) { size_t i; @@ -1920,7 +1920,7 @@ void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def) g_free(def); } -const char *virDomainInputDefGetPath(virDomainInputDefPtr input) +const char *virDomainInputDefGetPath(virDomainInputDef *input) { switch ((virDomainInputType) input->type) { case VIR_DOMAIN_INPUT_TYPE_MOUSE: @@ -1935,7 +1935,7 @@ const char *virDomainInputDefGetPath(virDomainInputDefPtr input) return NULL; } -void virDomainInputDefFree(virDomainInputDefPtr def) +void virDomainInputDefFree(virDomainInputDef *def) { if (!def) return; @@ -1946,7 +1946,7 @@ void virDomainInputDefFree(virDomainInputDefPtr def) g_free(def); } -void virDomainLeaseDefFree(virDomainLeaseDefPtr def) +void virDomainLeaseDefFree(virDomainLeaseDef *def) { if (!def) return; @@ -1959,10 +1959,10 @@ void virDomainLeaseDefFree(virDomainLeaseDefPtr def) } -static virDomainVcpuDefPtr -virDomainVcpuDefNew(virDomainXMLOptionPtr xmlopt) +static virDomainVcpuDef * +virDomainVcpuDefNew(virDomainXMLOption *xmlopt) { - virDomainVcpuDefPtr ret = NULL; + virDomainVcpuDef *ret = NULL; g_autoptr(virObject) priv = NULL; if (xmlopt && xmlopt->privateData.vcpuNew && @@ -1978,7 +1978,7 @@ virDomainVcpuDefNew(virDomainXMLOptionPtr xmlopt) static void -virDomainVcpuDefFree(virDomainVcpuDefPtr info) +virDomainVcpuDefFree(virDomainVcpuDef *info) { if (!info) return; @@ -1990,9 +1990,9 @@ virDomainVcpuDefFree(virDomainVcpuDefPtr info) int -virDomainDefSetVcpusMax(virDomainDefPtr def, +virDomainDefSetVcpusMax(virDomainDef *def, unsigned int maxvcpus, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { size_t oldmax = def->maxvcpus; size_t i; @@ -2040,7 +2040,7 @@ virDomainDefGetVcpusMax(const virDomainDef *def) int -virDomainDefSetVcpus(virDomainDefPtr def, +virDomainDefSetVcpus(virDomainDef *def, unsigned int vcpus) { size_t i; @@ -2083,10 +2083,10 @@ virDomainDefGetVcpus(const virDomainDef *def) * * Returns a bitmap representing state of individual vcpus. */ -virBitmapPtr +virBitmap * virDomainDefGetOnlineVcpumap(const virDomainDef *def) { - virBitmapPtr ret = virBitmapNew(def->maxvcpus); + virBitmap *ret = virBitmapNew(def->maxvcpus); size_t i; for (i = 0; i < def->maxvcpus; i++) { @@ -2098,8 +2098,8 @@ virDomainDefGetOnlineVcpumap(const virDomainDef *def) } -virDomainVcpuDefPtr -virDomainDefGetVcpu(virDomainDefPtr def, +virDomainVcpuDef * +virDomainDefGetVcpu(virDomainDef *def, unsigned int vcpu) { if (vcpu >= def->maxvcpus) @@ -2109,11 +2109,11 @@ virDomainDefGetVcpu(virDomainDefPtr def, } -static virDomainThreadSchedParamPtr -virDomainDefGetVcpuSched(virDomainDefPtr def, +static virDomainThreadSchedParam * +virDomainDefGetVcpuSched(virDomainDef *def, unsigned int vcpu) { - virDomainVcpuDefPtr vcpuinfo; + virDomainVcpuDef *vcpuinfo; if (!(vcpuinfo = virDomainDefGetVcpu(def, vcpu))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -2162,19 +2162,19 @@ virDomainDefHasVcpuPin(const virDomainDef *def) * Returns number of filled entries. */ int -virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def, +virDomainDefGetVcpuPinInfoHelper(virDomainDef *def, int maplen, int ncpumaps, unsigned char *cpumaps, - virBitmapPtr hostcpus, - virBitmapPtr autoCpuset) + virBitmap *hostcpus, + virBitmap *autoCpuset) { int maxvcpus = virDomainDefGetVcpusMax(def); size_t i; for (i = 0; i < maxvcpus && i < ncpumaps; i++) { - virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(def, i); - virBitmapPtr bitmap = NULL; + virDomainVcpuDef *vcpu = virDomainDefGetVcpu(def, i); + virBitmap *bitmap = NULL; if (vcpu && vcpu->cpumask) bitmap = vcpu->cpumask; @@ -2230,10 +2230,10 @@ virDomainDefGetVcpusTopology(const virDomainDef *def, } -virDomainDiskDefPtr -virDomainDiskDefNew(virDomainXMLOptionPtr xmlopt) +virDomainDiskDef * +virDomainDiskDefNew(virDomainXMLOption *xmlopt) { - virDomainDiskDefPtr ret; + virDomainDiskDef *ret; ret = g_new0(virDomainDiskDef, 1); @@ -2253,7 +2253,7 @@ virDomainDiskDefNew(virDomainXMLOptionPtr xmlopt) void -virDomainDiskDefFree(virDomainDiskDefPtr def) +virDomainDiskDefFree(virDomainDiskDef *def) { if (!def) return; @@ -2277,14 +2277,14 @@ virDomainDiskDefFree(virDomainDiskDefPtr def) int -virDomainDiskGetType(virDomainDiskDefPtr def) +virDomainDiskGetType(virDomainDiskDef *def) { return def->src->type; } void -virDomainDiskSetType(virDomainDiskDefPtr def, int type) +virDomainDiskSetType(virDomainDiskDef *def, int type) { def->src->type = type; } @@ -2298,7 +2298,7 @@ virDomainDiskGetSource(virDomainDiskDef const *def) void -virDomainDiskSetSource(virDomainDiskDefPtr def, const char *src) +virDomainDiskSetSource(virDomainDiskDef *def, const char *src) { char *tmp = g_strdup(src); g_free(def->src->path); @@ -2307,9 +2307,9 @@ virDomainDiskSetSource(virDomainDiskDefPtr def, const char *src) void -virDomainDiskEmptySource(virDomainDiskDefPtr def) +virDomainDiskEmptySource(virDomainDiskDef *def) { - virStorageSourcePtr src = def->src; + virStorageSource *src = def->src; bool readonly = src->readonly; virStorageSourceClear(src); @@ -2327,7 +2327,7 @@ virDomainDiskGetDriver(const virDomainDiskDef *def) void -virDomainDiskSetDriver(virDomainDiskDefPtr def, const char *name) +virDomainDiskSetDriver(virDomainDiskDef *def, const char *name) { char *tmp = g_strdup(name); g_free(def->driverName); @@ -2336,23 +2336,23 @@ virDomainDiskSetDriver(virDomainDiskDefPtr def, const char *name) int -virDomainDiskGetFormat(virDomainDiskDefPtr def) +virDomainDiskGetFormat(virDomainDiskDef *def) { return def->src->format; } void -virDomainDiskSetFormat(virDomainDiskDefPtr def, int format) +virDomainDiskSetFormat(virDomainDiskDef *def, int format) { def->src->format = format; } -virDomainControllerDefPtr +virDomainControllerDef * virDomainControllerDefNew(virDomainControllerType type) { - virDomainControllerDefPtr def; + virDomainControllerDef *def; def = g_new0(virDomainControllerDef, 1); @@ -2396,7 +2396,7 @@ virDomainControllerDefNew(virDomainControllerType type) } -void virDomainControllerDefFree(virDomainControllerDefPtr def) +void virDomainControllerDefFree(virDomainControllerDef *def) { if (!def) return; @@ -2438,10 +2438,10 @@ virDomainControllerIsPSeriesPHB(const virDomainControllerDef *cont) } -virDomainFSDefPtr -virDomainFSDefNew(virDomainXMLOptionPtr xmlopt) +virDomainFSDef * +virDomainFSDefNew(virDomainXMLOption *xmlopt) { - virDomainFSDefPtr ret; + virDomainFSDef *ret; ret = g_new0(virDomainFSDef, 1); @@ -2460,7 +2460,7 @@ virDomainFSDefNew(virDomainXMLOptionPtr xmlopt) } -void virDomainFSDefFree(virDomainFSDefPtr def) +void virDomainFSDefFree(virDomainFSDef *def) { if (!def) return; @@ -2476,7 +2476,7 @@ void virDomainFSDefFree(virDomainFSDefPtr def) } void -virDomainActualNetDefFree(virDomainActualNetDefPtr def) +virDomainActualNetDefFree(virDomainActualNetDef *def) { if (!def) return; @@ -2503,11 +2503,11 @@ virDomainActualNetDefFree(virDomainActualNetDefPtr def) } -virDomainVsockDefPtr -virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt) +virDomainVsockDef * +virDomainVsockDefNew(virDomainXMLOption *xmlopt) { - virDomainVsockDefPtr ret = NULL; - virDomainVsockDefPtr vsock; + virDomainVsockDef *ret = NULL; + virDomainVsockDef *vsock; vsock = g_new0(virDomainVsockDef, 1); @@ -2524,7 +2524,7 @@ virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt) void -virDomainVsockDefFree(virDomainVsockDefPtr vsock) +virDomainVsockDefFree(virDomainVsockDef *vsock) { if (!vsock) return; @@ -2537,7 +2537,7 @@ virDomainVsockDefFree(virDomainVsockDefPtr vsock) void -virDomainNetTeamingInfoFree(virDomainNetTeamingInfoPtr teaming) +virDomainNetTeamingInfoFree(virDomainNetTeamingInfo *teaming) { if (!teaming) return; @@ -2548,7 +2548,7 @@ virDomainNetTeamingInfoFree(virDomainNetTeamingInfoPtr teaming) void -virDomainNetDefFree(virDomainNetDefPtr def) +virDomainNetDefFree(virDomainNetDef *def) { if (!def) return; @@ -2629,7 +2629,7 @@ virDomainNetDefFree(virDomainNetDefPtr def) const char * -virDomainChrSourceDefGetPath(virDomainChrSourceDefPtr chr) +virDomainChrSourceDefGetPath(virDomainChrSourceDef *chr) { if (!chr) return NULL; @@ -2661,7 +2661,7 @@ virDomainChrSourceDefGetPath(virDomainChrSourceDefPtr chr) void ATTRIBUTE_NONNULL(1) -virDomainChrSourceDefClear(virDomainChrSourceDefPtr def) +virDomainChrSourceDefClear(virDomainChrSourceDef *def) { switch (def->type) { case VIR_DOMAIN_CHR_TYPE_PTY: @@ -2703,8 +2703,8 @@ virDomainChrSourceDefClear(virDomainChrSourceDefPtr def) /* Deep copies the contents of src into dest. Return -1 and report * error on failure. */ int -virDomainChrSourceDefCopy(virDomainChrSourceDefPtr dest, - virDomainChrSourceDefPtr src) +virDomainChrSourceDefCopy(virDomainChrSourceDef *dest, + virDomainChrSourceDef *src) { if (!dest || !src) return -1; @@ -2761,7 +2761,7 @@ virDomainChrSourceDefCopy(virDomainChrSourceDefPtr dest, static void virDomainChrSourceDefDispose(void *obj) { - virDomainChrSourceDefPtr def = obj; + virDomainChrSourceDef *def = obj; size_t i; virDomainChrSourceDefClear(def); @@ -2841,7 +2841,7 @@ virDomainChrSourceDefIsEqual(const virDomainChrSourceDef *src, return true; } -void virDomainChrDefFree(virDomainChrDefPtr def) +void virDomainChrDefFree(virDomainChrDef *def) { if (!def) return; @@ -2870,7 +2870,7 @@ void virDomainChrDefFree(virDomainChrDefPtr def) g_free(def); } -void virDomainSmartcardDefFree(virDomainSmartcardDefPtr def) +void virDomainSmartcardDefFree(virDomainSmartcardDef *def) { size_t i; if (!def) @@ -2899,7 +2899,7 @@ void virDomainSmartcardDefFree(virDomainSmartcardDefPtr def) g_free(def); } -void virDomainSoundCodecDefFree(virDomainSoundCodecDefPtr def) +void virDomainSoundCodecDefFree(virDomainSoundCodecDef *def) { if (!def) return; @@ -2907,7 +2907,7 @@ void virDomainSoundCodecDefFree(virDomainSoundCodecDefPtr def) g_free(def); } -void virDomainSoundDefFree(virDomainSoundDefPtr def) +void virDomainSoundDefFree(virDomainSoundDef *def) { size_t i; @@ -2924,13 +2924,13 @@ void virDomainSoundDefFree(virDomainSoundDefPtr def) } static void -virDomainAudioIOALSAFree(virDomainAudioIOALSAPtr def) +virDomainAudioIOALSAFree(virDomainAudioIOALSA *def) { g_free(def->dev); } static void -virDomainAudioIOJackFree(virDomainAudioIOJackPtr def) +virDomainAudioIOJackFree(virDomainAudioIOJack *def) { g_free(def->serverName); g_free(def->clientName); @@ -2938,20 +2938,20 @@ virDomainAudioIOJackFree(virDomainAudioIOJackPtr def) } static void -virDomainAudioIOOSSFree(virDomainAudioIOOSSPtr def) +virDomainAudioIOOSSFree(virDomainAudioIOOSS *def) { g_free(def->dev); } static void -virDomainAudioIOPulseAudioFree(virDomainAudioIOPulseAudioPtr def) +virDomainAudioIOPulseAudioFree(virDomainAudioIOPulseAudio *def) { g_free(def->name); g_free(def->streamName); } void -virDomainAudioDefFree(virDomainAudioDefPtr def) +virDomainAudioDefFree(virDomainAudioDef *def) { if (!def) return; @@ -3001,15 +3001,15 @@ virDomainAudioDefFree(virDomainAudioDefPtr def) g_free(def); } -virDomainSoundDefPtr -virDomainSoundDefRemove(virDomainDefPtr def, size_t idx) +virDomainSoundDef * +virDomainSoundDefRemove(virDomainDef *def, size_t idx) { - virDomainSoundDefPtr ret = def->sounds[idx]; + virDomainSoundDef *ret = def->sounds[idx]; VIR_DELETE_ELEMENT(def->sounds, idx, def->nsounds); return ret; } -void virDomainMemballoonDefFree(virDomainMemballoonDefPtr def) +void virDomainMemballoonDefFree(virDomainMemballoonDef *def) { if (!def) return; @@ -3020,7 +3020,7 @@ void virDomainMemballoonDefFree(virDomainMemballoonDefPtr def) g_free(def); } -void virDomainNVRAMDefFree(virDomainNVRAMDefPtr def) +void virDomainNVRAMDefFree(virDomainNVRAMDef *def) { if (!def) return; @@ -3030,7 +3030,7 @@ void virDomainNVRAMDefFree(virDomainNVRAMDefPtr def) g_free(def); } -void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def) +void virDomainWatchdogDefFree(virDomainWatchdogDef *def) { if (!def) return; @@ -3040,7 +3040,7 @@ void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def) g_free(def); } -void virDomainShmemDefFree(virDomainShmemDefPtr def) +void virDomainShmemDefFree(virDomainShmemDef *def) { if (!def) return; @@ -3052,10 +3052,10 @@ void virDomainShmemDefFree(virDomainShmemDefPtr def) } -virDomainVideoDefPtr -virDomainVideoDefNew(virDomainXMLOptionPtr xmlopt) +virDomainVideoDef * +virDomainVideoDefNew(virDomainXMLOption *xmlopt) { - virDomainVideoDefPtr def; + virDomainVideoDef *def; def = g_new0(virDomainVideoDef, 1); @@ -3071,7 +3071,7 @@ virDomainVideoDefNew(virDomainXMLOptionPtr xmlopt) void -virDomainVideoDefClear(virDomainVideoDefPtr def) +virDomainVideoDefClear(virDomainVideoDef *def) { if (!def) return; @@ -3092,7 +3092,7 @@ virDomainVideoDefClear(virDomainVideoDefPtr def) } -void virDomainVideoDefFree(virDomainVideoDefPtr def) +void virDomainVideoDefFree(virDomainVideoDef *def) { if (!def) return; @@ -3102,10 +3102,10 @@ void virDomainVideoDefFree(virDomainVideoDefPtr def) } -virDomainHostdevDefPtr +virDomainHostdevDef * virDomainHostdevDefNew(void) { - virDomainHostdevDefPtr def; + virDomainHostdevDef *def; def = g_new0(virDomainHostdevDef, 1); @@ -3116,7 +3116,7 @@ virDomainHostdevDefNew(void) static void -virDomainHostdevSubsysSCSIClear(virDomainHostdevSubsysSCSIPtr scsisrc) +virDomainHostdevSubsysSCSIClear(virDomainHostdevSubsysSCSI *scsisrc) { if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) { virObjectUnref(scsisrc->u.iscsi.src); @@ -3129,7 +3129,7 @@ virDomainHostdevSubsysSCSIClear(virDomainHostdevSubsysSCSIPtr scsisrc) } -void virDomainHostdevDefClear(virDomainHostdevDefPtr def) +void virDomainHostdevDefClear(virDomainHostdevDef *def) { if (!def) return; @@ -3181,7 +3181,7 @@ void virDomainHostdevDefClear(virDomainHostdevDefPtr def) } } -void virDomainTPMDefFree(virDomainTPMDefPtr def) +void virDomainTPMDefFree(virDomainTPMDef *def) { if (!def) return; @@ -3203,7 +3203,7 @@ void virDomainTPMDefFree(virDomainTPMDefPtr def) g_free(def); } -void virDomainHostdevDefFree(virDomainHostdevDefPtr def) +void virDomainHostdevDefFree(virDomainHostdevDef *def) { if (!def) return; @@ -3218,7 +3218,7 @@ void virDomainHostdevDefFree(virDomainHostdevDefPtr def) g_free(def); } -void virDomainHubDefFree(virDomainHubDefPtr def) +void virDomainHubDefFree(virDomainHubDef *def) { if (!def) return; @@ -3227,7 +3227,7 @@ void virDomainHubDefFree(virDomainHubDefPtr def) g_free(def); } -void virDomainRedirdevDefFree(virDomainRedirdevDefPtr def) +void virDomainRedirdevDefFree(virDomainRedirdevDef *def) { if (!def) return; @@ -3238,7 +3238,7 @@ void virDomainRedirdevDefFree(virDomainRedirdevDefPtr def) g_free(def); } -void virDomainRedirFilterDefFree(virDomainRedirFilterDefPtr def) +void virDomainRedirFilterDefFree(virDomainRedirFilterDef *def) { size_t i; @@ -3252,7 +3252,7 @@ void virDomainRedirFilterDefFree(virDomainRedirFilterDefPtr def) g_free(def); } -void virDomainMemoryDefFree(virDomainMemoryDefPtr def) +void virDomainMemoryDefFree(virDomainMemoryDef *def) { if (!def) return; @@ -3264,7 +3264,7 @@ void virDomainMemoryDefFree(virDomainMemoryDefPtr def) g_free(def); } -void virDomainDeviceDefFree(virDomainDeviceDefPtr def) +void virDomainDeviceDefFree(virDomainDeviceDef *def) { if (!def) return; @@ -3354,7 +3354,7 @@ void virDomainDeviceDefFree(virDomainDeviceDefPtr def) } static void -virDomainClockDefClear(virDomainClockDefPtr def) +virDomainClockDefClear(virDomainClockDef *def) { size_t i; @@ -3368,7 +3368,7 @@ virDomainClockDefClear(virDomainClockDefPtr def) static bool -virDomainIOThreadIDArrayHasPin(virDomainDefPtr def) +virDomainIOThreadIDArrayHasPin(virDomainDef *def) { size_t i; @@ -3381,7 +3381,7 @@ virDomainIOThreadIDArrayHasPin(virDomainDefPtr def) void -virDomainIOThreadIDDefFree(virDomainIOThreadIDDefPtr def) +virDomainIOThreadIDDefFree(virDomainIOThreadIDDef *def) { if (!def) return; @@ -3391,7 +3391,7 @@ virDomainIOThreadIDDefFree(virDomainIOThreadIDDefPtr def) static void -virDomainIOThreadIDDefArrayFree(virDomainIOThreadIDDefPtr *def, +virDomainIOThreadIDDefArrayFree(virDomainIOThreadIDDef **def, int nids) { size_t i; @@ -3407,12 +3407,12 @@ virDomainIOThreadIDDefArrayFree(virDomainIOThreadIDDefPtr *def, static int -virDomainIOThreadIDDefArrayInit(virDomainDefPtr def, +virDomainIOThreadIDDefArrayInit(virDomainDef *def, unsigned int iothreads) { size_t i; ssize_t nxt = -1; - virDomainIOThreadIDDefPtr iothrid = NULL; + virDomainIOThreadIDDef *iothrid = NULL; g_autoptr(virBitmap) thrmap = NULL; /* Same value (either 0 or some number), then we have none to fill in or @@ -3453,7 +3453,7 @@ virDomainIOThreadIDDefArrayInit(virDomainDefPtr def, void -virDomainResourceDefFree(virDomainResourceDefPtr resource) +virDomainResourceDefFree(virDomainResourceDef *resource) { if (!resource) return; @@ -3463,7 +3463,7 @@ virDomainResourceDefFree(virDomainResourceDefPtr resource) } void -virDomainPanicDefFree(virDomainPanicDefPtr panic) +virDomainPanicDefFree(virDomainPanicDef *panic) { if (!panic) return; @@ -3473,7 +3473,7 @@ virDomainPanicDefFree(virDomainPanicDefPtr panic) } void -virDomainLoaderDefFree(virDomainLoaderDefPtr loader) +virDomainLoaderDefFree(virDomainLoaderDef *loader) { if (!loader) return; @@ -3486,7 +3486,7 @@ virDomainLoaderDefFree(virDomainLoaderDefPtr loader) static void -virDomainResctrlMonDefFree(virDomainResctrlMonDefPtr domresmon) +virDomainResctrlMonDefFree(virDomainResctrlMonDef *domresmon) { if (!domresmon) return; @@ -3498,7 +3498,7 @@ virDomainResctrlMonDefFree(virDomainResctrlMonDefPtr domresmon) static void -virDomainResctrlDefFree(virDomainResctrlDefPtr resctrl) +virDomainResctrlDefFree(virDomainResctrlDef *resctrl) { size_t i = 0; @@ -3516,7 +3516,7 @@ virDomainResctrlDefFree(virDomainResctrlDefPtr resctrl) static void -virDomainSEVDefFree(virDomainSEVDefPtr def) +virDomainSEVDefFree(virDomainSEVDef *def) { if (!def) return; @@ -3559,7 +3559,7 @@ virDomainOSDefClear(virDomainOSDef *os) } -void virDomainDefFree(virDomainDefPtr def) +void virDomainDefFree(virDomainDef *def) { size_t i; @@ -3737,7 +3737,7 @@ void virDomainDefFree(virDomainDefPtr def) static void virDomainObjDispose(void *obj) { - virDomainObjPtr dom = obj; + virDomainObj *dom = obj; VIR_DEBUG("obj=%p", dom); virCondDestroy(&dom->cond); @@ -3751,10 +3751,10 @@ static void virDomainObjDispose(void *obj) virDomainCheckpointObjListFree(dom->checkpoints); } -virDomainObjPtr -virDomainObjNew(virDomainXMLOptionPtr xmlopt) +virDomainObj * +virDomainObjNew(virDomainXMLOption *xmlopt) { - virDomainObjPtr domain; + virDomainObj *domain; if (virDomainObjInitialize() < 0) return NULL; @@ -3794,10 +3794,10 @@ virDomainObjNew(virDomainXMLOptionPtr xmlopt) } -virDomainDefPtr +virDomainDef * virDomainDefNew(void) { - virDomainDefPtr ret; + virDomainDef *ret; ret = g_new0(virDomainDef, 1); @@ -3816,10 +3816,10 @@ virDomainDefNew(void) } -void virDomainObjAssignDef(virDomainObjPtr domain, - virDomainDefPtr def, +void virDomainObjAssignDef(virDomainObj *domain, + virDomainDef *def, bool live, - virDomainDefPtr *oldDef) + virDomainDef **oldDef) { if (oldDef) *oldDef = NULL; @@ -3860,7 +3860,7 @@ void virDomainObjAssignDef(virDomainObjPtr domain, * cleared. */ void -virDomainObjEndAPI(virDomainObjPtr *vm) +virDomainObjEndAPI(virDomainObj **vm) { if (!*vm) return; @@ -3872,14 +3872,14 @@ virDomainObjEndAPI(virDomainObjPtr *vm) void -virDomainObjBroadcast(virDomainObjPtr vm) +virDomainObjBroadcast(virDomainObj *vm) { virCondBroadcast(&vm->cond); } int -virDomainObjWait(virDomainObjPtr vm) +virDomainObjWait(virDomainObj *vm) { if (virCondWait(&vm->cond, &vm->parent.lock) < 0) { virReportSystemError(errno, "%s", @@ -3906,7 +3906,7 @@ virDomainObjWait(virDomainObjPtr vm) * 1 on timeout */ int -virDomainObjWaitUntil(virDomainObjPtr vm, +virDomainObjWaitUntil(virDomainObj *vm, unsigned long long whenms) { if (virCondWaitUntil(&vm->cond, &vm->parent.lock, whenms) < 0) { @@ -3931,8 +3931,8 @@ virDomainObjWaitUntil(virDomainObjPtr vm, * @return 0 on success, -1 on failure */ int -virDomainObjSetDefTransient(virDomainXMLOptionPtr xmlopt, - virDomainObjPtr domain, +virDomainObjSetDefTransient(virDomainXMLOption *xmlopt, + virDomainObj *domain, void *parseOpaque) { if (!domain->persistent) @@ -3955,7 +3955,7 @@ virDomainObjSetDefTransient(virDomainXMLOptionPtr xmlopt, * @param domain domain object pointer */ void -virDomainObjRemoveTransientDef(virDomainObjPtr domain) +virDomainObjRemoveTransientDef(virDomainObj *domain) { if (!domain->newDef) return; @@ -3973,11 +3973,11 @@ virDomainObjRemoveTransientDef(virDomainObjPtr domain) * @param caps pointer to capabilities info * @param xmlopt pointer to XML parser configuration object * @param domain domain object pointer - * @return NULL on error, virDOmainDefPtr on success + * @return NULL on error, virDomainDef * on success */ -virDomainDefPtr -virDomainObjGetPersistentDef(virDomainXMLOptionPtr xmlopt, - virDomainObjPtr domain, +virDomainDef * +virDomainObjGetPersistentDef(virDomainXMLOption *xmlopt, + virDomainObj *domain, void *parseOpaque) { if (virDomainObjIsActive(domain) && @@ -4005,7 +4005,7 @@ virDomainObjGetPersistentDef(virDomainXMLOptionPtr xmlopt, * error. */ int -virDomainObjUpdateModificationImpact(virDomainObjPtr vm, +virDomainObjUpdateModificationImpact(virDomainObj *vm, unsigned int *flags) { bool isActive = virDomainObjIsActive(vm); @@ -4054,10 +4054,10 @@ virDomainObjUpdateModificationImpact(virDomainObjPtr vm, * inappropriate. */ int -virDomainObjGetDefs(virDomainObjPtr vm, +virDomainObjGetDefs(virDomainObj *vm, unsigned int flags, - virDomainDefPtr *liveDef, - virDomainDefPtr *persDef) + virDomainDef **liveDef, + virDomainDef **persDef) { if (liveDef) *liveDef = NULL; @@ -4099,8 +4099,8 @@ virDomainObjGetDefs(virDomainObjPtr vm, * * Returns the correct definition pointer or NULL on error. */ -virDomainDefPtr -virDomainObjGetOneDefState(virDomainObjPtr vm, +virDomainDef * +virDomainObjGetOneDefState(virDomainObj *vm, unsigned int flags, bool *live) { @@ -4144,15 +4144,15 @@ virDomainObjGetOneDefState(virDomainObjPtr vm, * * Returns the correct definition pointer or NULL on error. */ -virDomainDefPtr -virDomainObjGetOneDef(virDomainObjPtr vm, +virDomainDef * +virDomainObjGetOneDef(virDomainObj *vm, unsigned int flags) { return virDomainObjGetOneDefState(vm, flags, NULL); } -virDomainDeviceInfoPtr -virDomainDeviceGetInfo(virDomainDeviceDefPtr device) +virDomainDeviceInfo * +virDomainDeviceGetInfo(virDomainDeviceDef *device) { switch ((virDomainDeviceType) device->type) { case VIR_DOMAIN_DEVICE_DISK: @@ -4213,15 +4213,15 @@ virDomainDeviceGetInfo(virDomainDeviceDefPtr device) /** * virDomainDeviceSetData - * @device: virDomainDeviceDefPtr with ->type filled in - * @devicedata: *DefPtr data for a device. Ex: virDomainDiskDefPtr + * @device: virDomainDeviceDef * with ->type filled in + * @devicedata: *Def * data for a device. Ex: virDomainDiskDef * * * Set the data.X variable for the device->type value. Basically * a mapping of virDomainDeviceType to the associated name in * the virDomainDeviceDef union */ void -virDomainDeviceSetData(virDomainDeviceDefPtr device, +virDomainDeviceSetData(virDomainDeviceDef *device, void *devicedata) { switch ((virDomainDeviceType) device->type) { @@ -4308,12 +4308,12 @@ virDomainDeviceSetData(virDomainDeviceDefPtr device, static int -virDomainDefHasDeviceAddressIterator(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr dev G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +virDomainDefHasDeviceAddressIterator(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *dev G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *opaque) { - virDomainDeviceInfoPtr needle = opaque; + virDomainDeviceInfo *needle = opaque; /* break iteration if the info was found */ if (virDomainDeviceInfoAddressIsEqual(info, needle)) @@ -4324,11 +4324,11 @@ virDomainDefHasDeviceAddressIterator(virDomainDefPtr def G_GNUC_UNUSED, static bool -virDomainSkipBackcompatConsole(virDomainDefPtr def, +virDomainSkipBackcompatConsole(virDomainDef *def, size_t idx, bool all) { - virDomainChrDefPtr console = def->consoles[idx]; + virDomainChrDef *console = def->consoles[idx]; if (!all && idx == 0 && (console->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL || @@ -4346,7 +4346,7 @@ virDomainSkipBackcompatConsole(virDomainDefPtr def, * behaviour can be altered with virDomainDeviceIterateFlags. */ int -virDomainDeviceInfoIterateFlags(virDomainDefPtr def, +virDomainDeviceInfoIterateFlags(virDomainDef *def, virDomainDeviceInfoCallback cb, unsigned int iteratorFlags, void *opaque) @@ -4577,7 +4577,7 @@ virDomainDeviceInfoIterateFlags(virDomainDefPtr def, int -virDomainDeviceInfoIterate(virDomainDefPtr def, +virDomainDeviceInfoIterate(virDomainDef *def, virDomainDeviceInfoCallback cb, void *opaque) { @@ -4586,8 +4586,8 @@ virDomainDeviceInfoIterate(virDomainDefPtr def, bool -virDomainDefHasDeviceAddress(virDomainDefPtr def, - virDomainDeviceInfoPtr info) +virDomainDefHasDeviceAddress(virDomainDef *def, + virDomainDeviceInfo *info) { if (virDomainDeviceInfoIterateFlags(def, virDomainDefHasDeviceAddressIterator, @@ -4600,11 +4600,11 @@ virDomainDefHasDeviceAddress(virDomainDefPtr def, static int -virDomainDefRejectDuplicateControllers(virDomainDefPtr def) +virDomainDefRejectDuplicateControllers(virDomainDef *def) { int max_idx[VIR_DOMAIN_CONTROLLER_TYPE_LAST]; - virBitmapPtr bitmaps[VIR_DOMAIN_CONTROLLER_TYPE_LAST] = { NULL }; - virDomainControllerDefPtr cont; + virBitmap *bitmaps[VIR_DOMAIN_CONTROLLER_TYPE_LAST] = { NULL }; + virDomainControllerDef *cont; size_t nbitmaps = 0; int ret = -1; size_t i; @@ -4650,7 +4650,7 @@ virDomainDefRejectDuplicateControllers(virDomainDefPtr def) } static int -virDomainDefRejectDuplicatePanics(virDomainDefPtr def) +virDomainDefRejectDuplicatePanics(virDomainDef *def) { bool exists[VIR_DOMAIN_PANIC_MODEL_LAST]; size_t i; @@ -4674,7 +4674,7 @@ virDomainDefRejectDuplicatePanics(virDomainDefPtr def) static int -virDomainDefPostParseMemory(virDomainDefPtr def, +virDomainDefPostParseMemory(virDomainDef *def, unsigned int parseFlags) { size_t i; @@ -4740,7 +4740,7 @@ virDomainDefPostParseMemory(virDomainDefPtr def, static void -virDomainDefPostParseOs(virDomainDefPtr def) +virDomainDefPostParseOs(virDomainDef *def) { if (!def->os.loader) return; @@ -4754,7 +4754,7 @@ virDomainDefPostParseOs(virDomainDefPtr def) static void -virDomainDefPostParseMemtune(virDomainDefPtr def) +virDomainDefPostParseMemtune(virDomainDef *def) { size_t i; @@ -4779,7 +4779,7 @@ virDomainDefPostParseMemtune(virDomainDefPtr def) static int -virDomainDefAddConsoleCompat(virDomainDefPtr def) +virDomainDefAddConsoleCompat(virDomainDef *def) { size_t i; @@ -4802,7 +4802,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) * verify that no other console is of type serial */ for (i = 1; i < def->nconsoles; i++) { - virDomainChrDefPtr cons = def->consoles[i]; + virDomainChrDef *cons = def->consoles[i]; if (cons->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -4866,7 +4866,7 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) * console[0] either does not exist * or has a different type than SERIAL or NONE. */ - virDomainChrDefPtr chr; + virDomainChrDef *chr; if (!(chr = virDomainChrDefNew(NULL))) return -1; @@ -4897,13 +4897,13 @@ virDomainDefAddConsoleCompat(virDomainDefPtr def) static int -virDomainDefPostParseTimer(virDomainDefPtr def) +virDomainDefPostParseTimer(virDomainDef *def) { size_t i; /* verify settings of guest timers */ for (i = 0; i < def->clock.ntimers; i++) { - virDomainTimerDefPtr timer = def->clock.timers[i]; + virDomainTimerDef *timer = def->clock.timers[i]; if (timer->name == VIR_DOMAIN_TIMER_NAME_KVMCLOCK || timer->name == VIR_DOMAIN_TIMER_NAME_HYPERVCLOCK) { @@ -4966,14 +4966,14 @@ virDomainDefPostParseGraphics(virDomainDef *def) size_t i; for (i = 0; i < def->ngraphics; i++) { - virDomainGraphicsDefPtr graphics = def->graphics[i]; + virDomainGraphicsDef *graphics = def->graphics[i]; /* If spice graphics is configured without ports and with autoport='no' * then we start qemu with Spice to not listen anywhere. Let's convert * this configuration to the new listen type='none' which does the * same. */ if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) { - virDomainGraphicsListenDefPtr glisten = &graphics->listens[0]; + virDomainGraphicsListenDef *glisten = &graphics->listens[0]; if (glisten->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS && graphics->data.spice.port == 0 && @@ -5001,7 +5001,7 @@ virDomainDriveAddressIsUsedByDisk(const virDomainDef *def, virDomainDiskBus bus_type, const virDomainDeviceDriveAddress *addr) { - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; size_t i; for (i = 0; i < def->ndisks; i++) { @@ -5036,7 +5036,7 @@ virDomainDriveAddressIsUsedByHostdev(const virDomainDef *def, virDomainHostdevSubsysType type, const virDomainDeviceDriveAddress *addr) { - virDomainHostdevDefPtr hostdev; + virDomainHostdevDef *hostdev; size_t i; for (i = 0; i < def->nhostdevs; i++) { @@ -5156,9 +5156,9 @@ virDomainControllerSCSINextUnit(const virDomainDef *def, #define SCSI_NARROW_BUS_MAX_CONT_UNIT 7 static void -virDomainHostdevAssignAddress(virDomainXMLOptionPtr xmlopt, +virDomainHostdevAssignAddress(virDomainXMLOption *xmlopt, const virDomainDef *def, - virDomainHostdevDefPtr hostdev) + virDomainHostdevDef *hostdev) { int next_unit = 0; int controller = 0; @@ -5221,12 +5221,12 @@ virDomainPostParseCheckISCSIPath(char **srcpath) static int -virDomainHostdevDefPostParse(virDomainHostdevDefPtr dev, +virDomainHostdevDefPostParse(virDomainHostdevDef *dev, const virDomainDef *def, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { - virDomainHostdevSubsysSCSIPtr scsisrc; - virDomainDeviceDriveAddressPtr addr = NULL; + virDomainHostdevSubsysSCSI *scsisrc; + virDomainDeviceDriveAddress *addr = NULL; if (dev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) return 0; @@ -5235,7 +5235,7 @@ virDomainHostdevDefPostParse(virDomainHostdevDefPtr dev, case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: scsisrc = &dev->source.subsys.u.scsi; if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) { - virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &scsisrc->u.iscsi; + virDomainHostdevSubsysSCSIiSCSI *iscsisrc = &scsisrc->u.iscsi; virDomainPostParseCheckISCSIPath(&iscsisrc->src->path); } @@ -5289,7 +5289,7 @@ virDomainHostdevDefPostParse(virDomainHostdevDefPtr dev, static void -virDomainChrDefPostParse(virDomainChrDefPtr chr, +virDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def) { const virDomainChrDef **arrPtr; @@ -5319,7 +5319,7 @@ virDomainChrDefPostParse(virDomainChrDefPtr chr, static void -virDomainRNGDefPostParse(virDomainRNGDefPtr rng) +virDomainRNGDefPostParse(virDomainRNGDef *rng) { /* set default path for virtio-rng "random" backend to /dev/random */ if (rng->backend == VIR_DOMAIN_RNG_BACKEND_RANDOM && @@ -5330,7 +5330,7 @@ virDomainRNGDefPostParse(virDomainRNGDefPtr rng) static void -virDomainDiskExpandGroupIoTune(virDomainDiskDefPtr disk, +virDomainDiskExpandGroupIoTune(virDomainDiskDef *disk, const virDomainDef *def) { size_t i; @@ -5340,7 +5340,7 @@ virDomainDiskExpandGroupIoTune(virDomainDiskDefPtr disk, return; for (i = 0; i < def->ndisks; i++) { - virDomainDiskDefPtr d = def->disks[i]; + virDomainDiskDef *d = def->disks[i]; if (STRNEQ_NULLABLE(disk->blkdeviotune.group_name, d->blkdeviotune.group_name) || !virDomainBlockIoTuneInfoHasAny(&d->blkdeviotune)) @@ -5356,9 +5356,9 @@ virDomainDiskExpandGroupIoTune(virDomainDiskDefPtr disk, static int -virDomainDiskDefPostParse(virDomainDiskDefPtr disk, +virDomainDiskDefPostParse(virDomainDiskDef *disk, const virDomainDef *def, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { /* internal snapshots and config files are currently supported * only with rbd: */ @@ -5407,7 +5407,7 @@ virDomainDiskDefPostParse(virDomainDiskDefPtr disk, static void -virDomainVideoDefPostParse(virDomainVideoDefPtr video, +virDomainVideoDefPostParse(virDomainVideoDef *video, const virDomainDef *def) { /* Fill out (V)RAM if the driver-specific callback did not do so */ @@ -5422,7 +5422,7 @@ virDomainVideoDefPostParse(virDomainVideoDefPtr video, static int -virDomainControllerDefPostParse(virDomainControllerDefPtr cdev) +virDomainControllerDefPostParse(virDomainControllerDef *cdev) { if (cdev->iothread && cdev->model != VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI && @@ -5439,7 +5439,7 @@ virDomainControllerDefPostParse(virDomainControllerDefPtr cdev) static void -virDomainVsockDefPostParse(virDomainVsockDefPtr vsock) +virDomainVsockDefPostParse(virDomainVsockDef *vsock) { if (vsock->auto_cid == VIR_TRISTATE_BOOL_ABSENT) { if (vsock->guest_cid != 0) @@ -5451,7 +5451,7 @@ virDomainVsockDefPostParse(virDomainVsockDefPtr vsock) static int -virDomainMemoryDefPostParse(virDomainMemoryDefPtr mem, +virDomainMemoryDefPostParse(virDomainMemoryDef *mem, const virDomainDef *def) { switch (mem->model) { @@ -5487,10 +5487,10 @@ virDomainMemoryDefPostParse(virDomainMemoryDefPtr mem, static int -virDomainDeviceDefPostParseCommon(virDomainDeviceDefPtr dev, +virDomainDeviceDefPostParseCommon(virDomainDeviceDef *dev, const virDomainDef *def, unsigned int parseFlags G_GNUC_UNUSED, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { int ret = -1; @@ -5574,10 +5574,10 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDefPtr dev, * designed to be used for drivers which don't support offline vcpupin. */ static void -virDomainDefRemoveOfflineVcpuPin(virDomainDefPtr def) +virDomainDefRemoveOfflineVcpuPin(virDomainDef *def) { size_t i; - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; for (i = 0; i < virDomainDefGetVcpusMax(def); i++) { vcpu = virDomainDefGetVcpu(def, i); @@ -5593,7 +5593,7 @@ virDomainDefRemoveOfflineVcpuPin(virDomainDefPtr def) static void -virDomainAssignControllerIndexes(virDomainDefPtr def) +virDomainAssignControllerIndexes(virDomainDef *def) { /* the index attribute of a controller is optional in the XML, but * is required to be valid at any time after parse. When no index @@ -5605,8 +5605,8 @@ virDomainAssignControllerIndexes(virDomainDefPtr def) size_t outer; for (outer = 0; outer < def->ncontrollers; outer++) { - virDomainControllerDefPtr cont = def->controllers[outer]; - virDomainControllerDefPtr prev = NULL; + virDomainControllerDef *cont = def->controllers[outer]; + virDomainControllerDef *prev = NULL; size_t inner; if (cont->idx != -1) @@ -5683,8 +5683,8 @@ virDomainAssignControllerIndexes(virDomainDefPtr def) * Returns 0 on success and -1 on error with an appropriate libvirt error. */ static int -virDomainDefPostParseCheckFeatures(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt) +virDomainDefPostParseCheckFeatures(virDomainDef *def, + virDomainXMLOption *xmlopt) { if (UNSUPPORTED(VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG) && virDomainDefCheckUnsupportedMemoryHotplug(def) < 0) @@ -5724,8 +5724,8 @@ virDomainDefPostParseCheckFeatures(virDomainDefPtr def, * Returns 0 on success and -1 on error with an appropriate libvirt error. */ static int -virDomainDeviceDefPostParseCheckFeatures(virDomainDeviceDefPtr dev, - virDomainXMLOptionPtr xmlopt) +virDomainDeviceDefPostParseCheckFeatures(virDomainDeviceDef *dev, + virDomainXMLOption *xmlopt) { if (UNSUPPORTED(VIR_DOMAIN_DEF_FEATURE_MEMORY_HOTPLUG) && virDomainDeviceDefCheckUnsupportedMemoryDevice(dev) < 0) @@ -5746,10 +5746,10 @@ virDomainDeviceDefPostParseCheckFeatures(virDomainDeviceDefPtr dev, static int -virDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, +virDomainDeviceDefPostParse(virDomainDeviceDef *dev, const virDomainDef *def, unsigned int flags, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque) { int ret; @@ -5772,10 +5772,10 @@ virDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, } static int -virDomainDeviceDefPostParseOne(virDomainDeviceDefPtr dev, +virDomainDeviceDefPostParseOne(virDomainDeviceDef *dev, const virDomainDef *def, unsigned int flags, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque) { void *data = NULL; @@ -5799,9 +5799,9 @@ virDomainDeviceDefPostParseOne(virDomainDeviceDefPtr dev, static int -virDomainDefPostParseDeviceIterator(virDomainDefPtr def, - virDomainDeviceDefPtr dev, - virDomainDeviceInfoPtr info G_GNUC_UNUSED, +virDomainDefPostParseDeviceIterator(virDomainDef *def, + virDomainDeviceDef *dev, + virDomainDeviceInfo *info G_GNUC_UNUSED, void *opaque) { struct virDomainDefPostParseDeviceIteratorData *data = opaque; @@ -5812,9 +5812,9 @@ virDomainDefPostParseDeviceIterator(virDomainDefPtr def, static int -virDomainVcpuDefPostParse(virDomainDefPtr def) +virDomainVcpuDefPostParse(virDomainDef *def) { - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; size_t maxvcpus = virDomainDefGetVcpusMax(def); size_t i; @@ -5853,7 +5853,7 @@ virDomainVcpuDefPostParse(virDomainDefPtr def) static int -virDomainDefPostParseCPU(virDomainDefPtr def) +virDomainDefPostParseCPU(virDomainDef *def) { if (!def->cpu) return 0; @@ -5871,9 +5871,9 @@ virDomainDefPostParseCPU(virDomainDefPtr def) static int -virDomainDefCollectBootOrder(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr dev G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +virDomainDefCollectBootOrder(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *dev G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *data) { GHashTable *bootHash = data; @@ -5907,7 +5907,7 @@ virDomainDefCollectBootOrder(virDomainDefPtr def G_GNUC_UNUSED, static int -virDomainDefBootOrderPostParse(virDomainDefPtr def) +virDomainDefBootOrderPostParse(virDomainDef *def) { g_autoptr(GHashTable) bootHash = NULL; @@ -5934,7 +5934,7 @@ virDomainDefBootOrderPostParse(virDomainDefPtr def) static int -virDomainDefPostParseVideo(virDomainDefPtr def, +virDomainDefPostParseVideo(virDomainDef *def, void *opaque) { if (def->nvideos == 0) @@ -5974,9 +5974,9 @@ virDomainDefPostParseVideo(virDomainDefPtr def, static int -virDomainDefPostParseCommon(virDomainDefPtr def, +virDomainDefPostParseCommon(virDomainDef *def, struct virDomainDefPostParseDeviceIteratorData *data, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { size_t i; @@ -6057,7 +6057,7 @@ virDomainDefPostParseCommon(virDomainDefPtr def, static int -virDomainDefPostParseCheckFailure(virDomainDefPtr def, +virDomainDefPostParseCheckFailure(virDomainDef *def, unsigned int parseFlags, int ret) { @@ -6076,9 +6076,9 @@ virDomainDefPostParseCheckFailure(virDomainDefPtr def, int -virDomainDefPostParse(virDomainDefPtr def, +virDomainDefPostParse(virDomainDef *def, unsigned int parseFlags, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque) { int ret = -1; @@ -6210,7 +6210,7 @@ virDomainDefLifecycleActionAllowed(virDomainLifecycle type, int -virDomainObjCheckActive(virDomainObjPtr dom) +virDomainObjCheckActive(virDomainObj *dom) { if (!virDomainObjIsActive(dom)) { virReportError(VIR_ERR_OPERATION_INVALID, @@ -6266,8 +6266,8 @@ virDomainDeviceLoadparmIsValid(const char *loadparm) static void -virDomainVirtioOptionsFormat(virBufferPtr buf, - virDomainVirtioOptionsPtr virtio) +virDomainVirtioOptionsFormat(virBuffer *buf, + virDomainVirtioOptions *virtio) { if (!virtio) return; @@ -6288,8 +6288,8 @@ virDomainVirtioOptionsFormat(virBufferPtr buf, static void ATTRIBUTE_NONNULL(2) -virDomainDeviceInfoFormat(virBufferPtr buf, - virDomainDeviceInfoPtr info, +virDomainDeviceInfoFormat(virBuffer *buf, + virDomainDeviceInfo *info, unsigned int flags) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; @@ -6440,7 +6440,7 @@ virDomainDeviceInfoFormat(virBufferPtr buf, static int virDomainDeviceUSBMasterParseXML(xmlNodePtr node, - virDomainDeviceUSBMasterPtr master) + virDomainDeviceUSBMaster *master) { g_autofree char *startport = NULL; @@ -6460,7 +6460,7 @@ virDomainDeviceUSBMasterParseXML(xmlNodePtr node, static int virDomainDeviceBootParseXML(xmlNodePtr node, - virDomainDeviceInfoPtr info) + virDomainDeviceInfo *info) { g_autofree char *order = NULL; g_autofree char *loadparm = NULL; @@ -6499,7 +6499,7 @@ virDomainDeviceBootParseXML(xmlNodePtr node, static int virDomainDeviceISAAddressParseXML(xmlNodePtr node, - virDomainDeviceISAAddressPtr addr) + virDomainDeviceISAAddress *addr) { g_autofree char *iobase = NULL; g_autofree char *irq = NULL; @@ -6529,7 +6529,7 @@ virDomainDeviceISAAddressParseXML(xmlNodePtr node, static int virDomainDeviceDimmAddressParseXML(xmlNodePtr node, - virDomainDeviceDimmAddressPtr addr) + virDomainDeviceDimmAddress *addr) { g_autofree char *tmp = NULL; @@ -6556,7 +6556,7 @@ virDomainDeviceDimmAddressParseXML(xmlNodePtr node, static int virDomainDeviceAddressParseXML(xmlNodePtr address, - virDomainDeviceInfoPtr info) + virDomainDeviceInfo *info) { g_autofree char *type = virXMLPropString(address, "type"); @@ -6650,10 +6650,10 @@ virDomainDeviceAliasIsUserAlias(const char *aliasStr) static int -virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xmlopt, +virDomainDeviceInfoParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, - virDomainDeviceInfoPtr info, + virDomainDeviceInfo *info, unsigned int flags) { xmlNodePtr address = NULL; @@ -6735,11 +6735,11 @@ virDomainDeviceInfoParseXML(virDomainXMLOptionPtr xmlopt, static int virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr node, - virDomainHostdevDefPtr def) + virDomainHostdevDef *def) { bool got_product, got_vendor; xmlNodePtr cur; - virDomainHostdevSubsysUSBPtr usbsrc = &def->source.subsys.u.usb; + virDomainHostdevSubsysUSB *usbsrc = &def->source.subsys.u.usb; g_autofree char *startupPolicy = NULL; g_autofree char *autoAddress = NULL; @@ -6867,7 +6867,7 @@ virDomainHostdevSubsysUSBDefParseXML(xmlNodePtr node, */ static int virDomainHostdevSubsysPCIOrigStatesDefParseXML(xmlNodePtr node, - virDomainHostdevOrigStatesPtr def) + virDomainHostdevOrigStates *def) { xmlNodePtr cur; cur = node->children; @@ -6895,7 +6895,7 @@ virDomainHostdevSubsysPCIOrigStatesDefParseXML(xmlNodePtr node, static int virDomainHostdevSubsysPCIDefParseXML(xmlNodePtr node, - virDomainHostdevDefPtr def, + virDomainHostdevDef *def, unsigned int flags) { g_autofree char *filtering = NULL; @@ -6916,14 +6916,14 @@ virDomainHostdevSubsysPCIDefParseXML(xmlNodePtr node, while (cur != NULL) { if (cur->type == XML_ELEMENT_NODE) { if (virXMLNodeNameEqual(cur, "address")) { - virPCIDeviceAddressPtr addr = + virPCIDeviceAddress *addr = &def->source.subsys.u.pci.addr; if (virPCIDeviceAddressParseXML(cur, addr) < 0) return -1; } else if ((flags & VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES) && virXMLNodeNameEqual(cur, "origstates")) { - virDomainHostdevOrigStatesPtr states = &def->origstates; + virDomainHostdevOrigStates *states = &def->origstates; if (virDomainHostdevSubsysPCIOrigStatesDefParseXML(cur, states) < 0) return -1; } else { @@ -6942,7 +6942,7 @@ virDomainHostdevSubsysPCIDefParseXML(xmlNodePtr node, int virDomainStorageNetworkParseHost(xmlNodePtr hostnode, - virStorageNetHostDefPtr host) + virStorageNetHostDef *host) { int ret = -1; g_autofree char *transport = NULL; @@ -7005,7 +7005,7 @@ virDomainStorageNetworkParseHost(xmlNodePtr hostnode, static int virDomainStorageNetworkParseHosts(xmlNodePtr node, xmlXPathContextPtr ctxt, - virStorageNetHostDefPtr *hosts, + virStorageNetHostDef **hosts, size_t *nhosts) { g_autofree xmlNodePtr *hostnodes = NULL; @@ -7033,7 +7033,7 @@ virDomainStorageNetworkParseHosts(xmlNodePtr node, static void virDomainStorageNetworkParseNFS(xmlNodePtr node, xmlXPathContextPtr ctxt, - virStorageSourcePtr src) + virStorageSource *src) { xmlNodePtr nfsIdentityNode = NULL; VIR_XPATH_NODE_AUTORESTORE(ctxt); @@ -7050,11 +7050,11 @@ virDomainStorageNetworkParseNFS(xmlNodePtr node, static int virDomainHostdevSubsysSCSIHostDefParseXML(xmlNodePtr sourcenode, xmlXPathContextPtr ctxt, - virDomainHostdevSubsysSCSIPtr scsisrc, + virDomainHostdevSubsysSCSI *scsisrc, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; g_autofree char *bus = NULL; g_autofree char *target = NULL; g_autofree char *unit = NULL; @@ -7117,13 +7117,13 @@ virDomainHostdevSubsysSCSIHostDefParseXML(xmlNodePtr sourcenode, static int virDomainHostdevSubsysSCSIiSCSIDefParseXML(xmlNodePtr sourcenode, - virDomainHostdevSubsysSCSIPtr def, + virDomainHostdevSubsysSCSI *def, xmlXPathContextPtr ctxt, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { int auth_secret_usage = -1; - virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &def->u.iscsi; + virDomainHostdevSubsysSCSIiSCSI *iscsisrc = &def->u.iscsi; g_autoptr(virStorageAuthDef) authdef = NULL; xmlNodePtr node; VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -7190,10 +7190,10 @@ virDomainHostdevSubsysSCSIiSCSIDefParseXML(xmlNodePtr sourcenode, static int virDomainHostdevSubsysSCSIDefParseXML(xmlNodePtr sourcenode, - virDomainHostdevSubsysSCSIPtr scsisrc, + virDomainHostdevSubsysSCSI *scsisrc, xmlXPathContextPtr ctxt, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { g_autofree char *protocol = NULL; @@ -7228,9 +7228,9 @@ virDomainHostdevSubsysSCSIDefParseXML(xmlNodePtr sourcenode, static int virDomainHostdevSubsysSCSIVHostDefParseXML(xmlNodePtr sourcenode, - virDomainHostdevDefPtr def) + virDomainHostdevDef *def) { - virDomainHostdevSubsysSCSIVHostPtr hostsrc = &def->source.subsys.u.scsi_host; + virDomainHostdevSubsysSCSIVHost *hostsrc = &def->source.subsys.u.scsi_host; g_autofree char *protocol = NULL; g_autofree char *wwpn = NULL; @@ -7275,12 +7275,12 @@ virDomainHostdevSubsysSCSIVHostDefParseXML(xmlNodePtr sourcenode, } static int -virDomainHostdevSubsysMediatedDevDefParseXML(virDomainHostdevDefPtr def, +virDomainHostdevSubsysMediatedDevDefParseXML(virDomainHostdevDef *def, xmlXPathContextPtr ctxt) { unsigned char uuid[VIR_UUID_BUFLEN] = {0}; xmlNodePtr node = NULL; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &def->source.subsys.u.mdev; + virDomainHostdevSubsysMediatedDev *mdevsrc = &def->source.subsys.u.mdev; g_autofree char *uuidxml = NULL; if (!(node = virXPathNode("./source/address", ctxt))) { @@ -7310,16 +7310,16 @@ static int virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, xmlXPathContextPtr ctxt, const char *type, - virDomainHostdevDefPtr def, + virDomainHostdevDef *def, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { xmlNodePtr sourcenode; int backend; - virDomainHostdevSubsysPCIPtr pcisrc = &def->source.subsys.u.pci; - virDomainHostdevSubsysSCSIPtr scsisrc = &def->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIVHostPtr scsihostsrc = &def->source.subsys.u.scsi_host; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &def->source.subsys.u.mdev; + virDomainHostdevSubsysPCI *pcisrc = &def->source.subsys.u.pci; + virDomainHostdevSubsysSCSI *scsisrc = &def->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIVHost *scsihostsrc = &def->source.subsys.u.scsi_host; + virDomainHostdevSubsysMediatedDev *mdevsrc = &def->source.subsys.u.mdev; g_autofree char *managed = NULL; g_autofree char *sgio = NULL; g_autofree char *rawio = NULL; @@ -7507,13 +7507,13 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, return 0; } -static virNetDevIPAddrPtr +static virNetDevIPAddr * virDomainNetIPParseXML(xmlNodePtr node) { /* Parse the prefix in every case */ unsigned int prefixValue = 0; int family = AF_UNSPEC; - g_autofree virNetDevIPAddrPtr ip = NULL; + g_autofree virNetDevIPAddr *ip = NULL; g_autofree char *prefixStr = NULL; g_autofree char *familyStr = NULL; g_autofree char *address = NULL; @@ -7565,7 +7565,7 @@ virDomainNetIPParseXML(xmlNodePtr node) } -/* fill in a virNetDevIPInfoPtr from the and +/* fill in a virNetDevIPInfo *from the and * elements found in the given XML context. * * return 0 on success (including none found) and -1 on failure. @@ -7573,14 +7573,14 @@ virDomainNetIPParseXML(xmlNodePtr node) static int virDomainNetIPInfoParseXML(const char *source, xmlXPathContextPtr ctxt, - virNetDevIPInfoPtr def) + virNetDevIPInfo *def) { g_autoptr(virNetDevIPRoute) route = NULL; int nnodes; int ret = -1; size_t i; g_autofree xmlNodePtr *nodes = NULL; - g_autofree virNetDevIPAddrPtr ip = NULL; + g_autofree virNetDevIPAddr *ip = NULL; if ((nnodes = virXPathNodeSet("./ip", ctxt, &nodes)) < 0) goto cleanup; @@ -7612,7 +7612,7 @@ virDomainNetIPInfoParseXML(const char *source, static int virDomainNetDefCoalesceParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virNetDevCoalescePtr *coalesce) + virNetDevCoalesce **coalesce) { VIR_XPATH_NODE_AUTORESTORE(ctxt) unsigned long long tmp = 0; @@ -7646,8 +7646,8 @@ virDomainNetDefCoalesceParseXML(xmlNodePtr node, } static void -virDomainNetDefCoalesceFormatXML(virBufferPtr buf, - virNetDevCoalescePtr coalesce) +virDomainNetDefCoalesceFormatXML(virBuffer *buf, + virNetDevCoalesce *coalesce) { if (!coalesce || !coalesce->rx_max_coalesced_frames) return; @@ -7673,7 +7673,7 @@ static int virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_GNUC_UNUSED, xmlXPathContextPtr ctxt, const char *type, - virDomainHostdevDefPtr def) + virDomainHostdevDef *def) { /* @type is passed in from the caller rather than read from the * xml document, because it is specified in different places for @@ -7742,7 +7742,7 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_GNUC_UNUSED, } -virDomainControllerDefPtr +virDomainControllerDef * virDomainDeviceFindSCSIController(const virDomainDef *def, const virDomainDeviceDriveAddress *addr) { @@ -7758,8 +7758,8 @@ virDomainDeviceFindSCSIController(const virDomainDef *def, } int -virDomainDiskDefAssignAddress(virDomainXMLOptionPtr xmlopt, - virDomainDiskDefPtr def, +virDomainDiskDefAssignAddress(virDomainXMLOption *xmlopt, + virDomainDiskDef *def, const virDomainDef *vmdef) { int idx = virDiskNameToIndex(def->dst); @@ -7850,12 +7850,12 @@ virDomainDiskDefAssignAddress(virDomainXMLOptionPtr xmlopt, return 0; } -static virSecurityLabelDefPtr +static virSecurityLabelDef * virSecurityLabelDefParseXML(xmlXPathContextPtr ctxt, unsigned int flags) { char *p; - virSecurityLabelDefPtr seclabel = NULL; + virSecurityLabelDef *seclabel = NULL; p = virXMLPropStringLimit(ctxt->node, "model", VIR_SECURITY_MODEL_BUFLEN - 1); @@ -7973,9 +7973,9 @@ virSecurityLabelDefParseXML(xmlXPathContextPtr ctxt, } static int -virSecurityLabelDefsParseXML(virDomainDefPtr def, +virSecurityLabelDefsParseXML(virDomainDef *def, xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags) { VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -7989,11 +7989,11 @@ virSecurityLabelDefsParseXML(virDomainDefPtr def, if (n == 0) return 0; - def->seclabels = g_new0(virSecurityLabelDefPtr, n); + def->seclabels = g_new0(virSecurityLabelDef *, n); /* Parse each "seclabel" tag */ for (i = 0; i < n; i++) { - virSecurityLabelDefPtr seclabel; + virSecurityLabelDef *seclabel; ctxt->node = list[i]; if (!(seclabel = virSecurityLabelDefParseXML(ctxt, flags))) @@ -8070,13 +8070,13 @@ virSecurityLabelDefsParseXML(virDomainDefPtr def, /* Parse the from a disk or character device. */ static int -virSecurityDeviceLabelDefParseXML(virSecurityDeviceLabelDefPtr **seclabels_rtn, +virSecurityDeviceLabelDefParseXML(virSecurityDeviceLabelDef ***seclabels_rtn, size_t *nseclabels_rtn, xmlXPathContextPtr ctxt, unsigned int flags) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virSecurityDeviceLabelDefPtr *seclabels = NULL; + virSecurityDeviceLabelDef **seclabels = NULL; size_t nseclabels = 0; int n; size_t i, j; @@ -8088,7 +8088,7 @@ virSecurityDeviceLabelDefParseXML(virSecurityDeviceLabelDefPtr **seclabels_rtn, if (n == 0) return 0; - seclabels = g_new0(virSecurityDeviceLabelDefPtr, n); + seclabels = g_new0(virSecurityDeviceLabelDef *, n); nseclabels = n; for (i = 0; i < n; i++) seclabels[i] = g_new0(virSecurityDeviceLabelDef, 1); @@ -8158,10 +8158,10 @@ virSecurityDeviceLabelDefParseXML(virSecurityDeviceLabelDefPtr **seclabels_rtn, /* Parse the XML definition for a lease */ -static virDomainLeaseDefPtr +static virDomainLeaseDef * virDomainLeaseDefParseXML(xmlNodePtr node) { - virDomainLeaseDefPtr def; + virDomainLeaseDef *def; xmlNodePtr cur; g_autofree char *lockspace = NULL; g_autofree char *key = NULL; @@ -8220,9 +8220,9 @@ virDomainLeaseDefParseXML(xmlNodePtr node) static int virDomainDiskSourcePoolDefParse(xmlNodePtr node, - virStorageSourcePoolDefPtr *srcpool) + virStorageSourcePoolDef **srcpool) { - virStorageSourcePoolDefPtr source; + virStorageSourcePoolDef *source; int ret = -1; g_autofree char *mode = NULL; @@ -8264,7 +8264,7 @@ virDomainDiskSourcePoolDefParse(xmlNodePtr node, } -static virStorageNetCookieDefPtr +static virStorageNetCookieDef * virDomainStorageNetCookieParse(xmlNodePtr node, xmlXPathContextPtr ctxt) { @@ -8293,7 +8293,7 @@ virDomainStorageNetCookieParse(xmlNodePtr node, static int virDomainStorageNetCookiesParse(xmlNodePtr node, xmlXPathContextPtr ctxt, - virStorageSourcePtr src) + virStorageSource *src) { VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree xmlNodePtr *nodes = NULL; @@ -8305,7 +8305,7 @@ virDomainStorageNetCookiesParse(xmlNodePtr node, if ((nnodes = virXPathNodeSet("./cookie", ctxt, &nodes)) < 0) return -1; - src->cookies = g_new0(virStorageNetCookieDefPtr, nnodes); + src->cookies = g_new0(virStorageNetCookieDef *, nnodes); src->ncookies = nnodes; for (i = 0; i < nnodes; i++) { @@ -8323,7 +8323,7 @@ virDomainStorageNetCookiesParse(xmlNodePtr node, static int virDomainDiskSourceNetworkParse(xmlNodePtr node, xmlXPathContextPtr ctxt, - virStorageSourcePtr src, + virStorageSource *src, unsigned int flags) { int tlsCfgVal; @@ -8451,7 +8451,7 @@ virDomainDiskSourceNetworkParse(xmlNodePtr node, static int virDomainDiskSourceNVMeParse(xmlNodePtr node, xmlXPathContextPtr ctxt, - virStorageSourcePtr src) + virStorageSource *src) { g_autoptr(virStorageSourceNVMeDef) nvme = NULL; g_autofree char *type = NULL; @@ -8512,8 +8512,8 @@ virDomainDiskSourceNVMeParse(xmlNodePtr node, static int virDomainDiskSourceVHostUserParse(xmlNodePtr node, - virStorageSourcePtr src, - virDomainXMLOptionPtr xmlopt, + virStorageSource *src, + virDomainXMLOption *xmlopt, xmlXPathContextPtr ctxt) { g_autofree char *type = virXMLPropString(node, "type"); @@ -8556,7 +8556,7 @@ virDomainDiskSourceVHostUserParse(xmlNodePtr node, static int virDomainDiskSourcePRParse(xmlNodePtr node, xmlXPathContextPtr ctxt, - virStoragePRDefPtr *pr) + virStoragePRDef **pr) { VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -8572,7 +8572,7 @@ virDomainDiskSourcePRParse(xmlNodePtr node, } -virStorageSourcePtr +virStorageSource * virDomainStorageSourceParseBase(const char *type, const char *format, const char *index) @@ -8607,14 +8607,14 @@ virDomainStorageSourceParseBase(const char *type, } -static virStorageSourceSlicePtr +static virStorageSourceSlice * virDomainStorageSourceParseSlice(xmlNodePtr node, xmlXPathContextPtr ctxt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree char *offset = NULL; g_autofree char *size = NULL; - g_autofree virStorageSourceSlicePtr ret = g_new0(virStorageSourceSlice, 1); + g_autofree virStorageSourceSlice *ret = g_new0(virStorageSourceSlice, 1); ctxt->node = node; @@ -8644,7 +8644,7 @@ virDomainStorageSourceParseSlice(xmlNodePtr node, static int -virDomainStorageSourceParseSlices(virStorageSourcePtr src, +virDomainStorageSourceParseSlices(virStorageSource *src, xmlXPathContextPtr ctxt) { xmlNodePtr node; @@ -8673,9 +8673,9 @@ virDomainStorageSourceParseSlices(virStorageSourcePtr src, int virDomainStorageSourceParse(xmlNodePtr node, xmlXPathContextPtr ctxt, - virStorageSourcePtr src, + virStorageSource *src, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr tmp; @@ -8755,9 +8755,9 @@ virDomainStorageSourceParse(xmlNodePtr node, int virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt, - virStorageSourcePtr src, + virStorageSource *src, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr source; @@ -8820,7 +8820,7 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt, } static int -virDomainDiskDefIotuneParse(virDomainDiskDefPtr def, +virDomainDiskDefIotuneParse(virDomainDiskDef *def, xmlXPathContextPtr ctxt) { PARSE_IOTUNE(total_bytes_sec); @@ -8895,11 +8895,11 @@ virDomainDiskDefIotuneParse(virDomainDiskDefPtr def, static int -virDomainDiskDefMirrorParse(virDomainDiskDefPtr def, +virDomainDiskDefMirrorParse(virDomainDiskDef *def, xmlNodePtr cur, xmlXPathContextPtr ctxt, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { xmlNodePtr mirrorNode; VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -8979,7 +8979,7 @@ virDomainDiskDefMirrorParse(virDomainDiskDefPtr def, static int -virDomainDiskDefGeometryParse(virDomainDiskDefPtr def, +virDomainDiskDefGeometryParse(virDomainDiskDef *def, xmlNodePtr cur) { g_autofree char *tmp = NULL; @@ -9028,7 +9028,7 @@ virDomainDiskDefGeometryParse(virDomainDiskDefPtr def, static int virDomainDiskSourceDefParseAuthValidate(const virStorageSource *src) { - virStorageAuthDefPtr authdef = src->auth; + virStorageAuthDef *authdef = src->auth; int actUsage; if (src->type != VIR_STORAGE_TYPE_NETWORK || !authdef) @@ -9059,7 +9059,7 @@ static int virDomainDiskDefParseValidate(const virDomainDiskDef *def) { - virStorageSourcePtr next; + virStorageSource *next; if (def->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) { if (def->event_idx != VIR_TRISTATE_SWITCH_ABSENT) { @@ -9136,7 +9136,7 @@ virDomainDiskDefParseValidate(const virDomainDiskDef *def) return -1; if (next->encryption) { - virStorageEncryptionPtr encryption = next->encryption; + virStorageEncryption *encryption = next->encryption; if (encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS && encryption->encinfo.cipher_name) { @@ -9154,7 +9154,7 @@ virDomainDiskDefParseValidate(const virDomainDiskDef *def) static int -virDomainDiskDefDriverParseXML(virDomainDiskDefPtr def, +virDomainDiskDefDriverParseXML(virDomainDiskDef *def, xmlNodePtr cur, xmlXPathContextPtr ctxt) { @@ -9283,8 +9283,8 @@ virDomainDiskDefDriverParseXML(virDomainDiskDefPtr def, static int virDomainDiskDefParsePrivateData(xmlXPathContextPtr ctxt, - virDomainDiskDefPtr disk, - virDomainXMLOptionPtr xmlopt) + virDomainDiskDef *disk, + virDomainXMLOption *xmlopt) { xmlNodePtr private_node = virXPathNode("./privateData", ctxt); VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -9303,8 +9303,8 @@ virDomainDiskDefParsePrivateData(xmlXPathContextPtr ctxt, } -static virDomainDiskDefPtr -virDomainDiskDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainDiskDef * +virDomainDiskDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) @@ -9829,7 +9829,7 @@ virDomainDefGetMemoryInitial(const virDomainDef *def) * additional memory modules. */ void -virDomainDefSetMemoryTotal(virDomainDefPtr def, +virDomainDefSetMemoryTotal(virDomainDef *def, unsigned long long size) { def->mem.total_memory = size; @@ -9872,7 +9872,7 @@ virDomainControllerModelTypeFromString(const virDomainControllerDef *def, static const char * -virDomainControllerModelTypeToString(virDomainControllerDefPtr def, +virDomainControllerModelTypeToString(virDomainControllerDef *def, int model) { if (def->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) @@ -9892,8 +9892,8 @@ virDomainControllerModelTypeToString(virDomainControllerDefPtr def, } -static virDomainControllerDefPtr -virDomainControllerDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainControllerDef * +virDomainControllerDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) @@ -10230,21 +10230,21 @@ virDomainControllerDefParseXML(virDomainXMLOptionPtr xmlopt, void -virDomainNetGenerateMAC(virDomainXMLOptionPtr xmlopt, - virMacAddrPtr mac) +virDomainNetGenerateMAC(virDomainXMLOption *xmlopt, + virMacAddr *mac) { virMacAddrGenerate(xmlopt->config.macPrefix, mac); } -static virDomainFSDefPtr -virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainFSDef * +virDomainFSDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virDomainFSDefPtr def; + virDomainFSDef *def; xmlNodePtr cur; g_autofree char *type = NULL; g_autofree char *fsdriver = NULL; @@ -10511,12 +10511,12 @@ virDomainFSDefParseXML(virDomainXMLOptionPtr xmlopt, static int virDomainActualNetDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virDomainNetDefPtr parent, - virDomainActualNetDefPtr *def, + virDomainNetDef *parent, + virDomainActualNetDef **def, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { - virDomainActualNetDefPtr actual = NULL; + virDomainActualNetDef *actual = NULL; int ret = -1; VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr bandwidth_node = NULL; @@ -10604,7 +10604,7 @@ virDomainActualNetDefParseXML(xmlNodePtr node, } } } else if (actual->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) { - virDomainHostdevDefPtr hostdev = &actual->data.hostdev.def; + virDomainHostdevDef *hostdev = &actual->data.hostdev.def; hostdev->parentnet = parent; hostdev->info = &parent->info; @@ -10687,12 +10687,12 @@ virDomainActualNetDefParseXML(xmlNodePtr node, int -virDomainNetAppendIPAddress(virDomainNetDefPtr def, +virDomainNetAppendIPAddress(virDomainNetDef *def, const char *address, int family, unsigned int prefix) { - virNetDevIPAddrPtr ipDef = NULL; + virNetDevIPAddr *ipDef = NULL; ipDef = g_new0(virNetDevIPAddr, 1); if (virSocketAddrParse(&ipDef->address, address, family) < 0) @@ -10711,7 +10711,7 @@ virDomainNetAppendIPAddress(virDomainNetDefPtr def, static int -virDomainChrSourceReconnectDefParseXML(virDomainChrSourceReconnectDefPtr def, +virDomainChrSourceReconnectDefParseXML(virDomainChrSourceReconnectDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt) { @@ -10757,7 +10757,7 @@ virDomainChrSourceReconnectDefParseXML(virDomainChrSourceReconnectDefPtr def, static int virDomainNetTeamingInfoParseXML(xmlXPathContextPtr ctxt, - virDomainNetTeamingInfoPtr *teaming) + virDomainNetTeamingInfo **teaming) { g_autofree char *typeStr = virXPathString("string(./teaming/@type)", ctxt); g_autofree char *persistentStr = virXPathString("string(./teaming/@persistent)", ctxt); @@ -10783,18 +10783,18 @@ virDomainNetTeamingInfoParseXML(xmlXPathContextPtr ctxt, } -static virDomainNetDefPtr -virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainNetDef * +virDomainNetDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { - virDomainNetDefPtr def; - virDomainHostdevDefPtr hostdev; + virDomainNetDef *def; + virDomainHostdevDef *hostdev; xmlNodePtr cur; xmlNodePtr tmpNode; GHashTable *filterparams = NULL; - virDomainActualNetDefPtr actual = NULL; + virDomainActualNetDef *actual = NULL; VIR_XPATH_NODE_AUTORESTORE(ctxt) virDomainChrSourceReconnectDef reconnect = {0}; int rv, val; @@ -11717,7 +11717,7 @@ virDomainChrTargetModelFromString(int devtype, } static int -virDomainChrDefParseTargetXML(virDomainChrDefPtr def, +virDomainChrDefParseTargetXML(virDomainChrDef *def, xmlNodePtr cur, unsigned int flags) { @@ -11873,7 +11873,7 @@ virDomainChrSourceDefParseMode(xmlNodePtr source) static int -virDomainChrSourceDefParseTCP(virDomainChrSourceDefPtr def, +virDomainChrSourceDefParseTCP(virDomainChrSourceDef *def, xmlNodePtr source, xmlXPathContextPtr ctxt, unsigned int flags) @@ -11921,7 +11921,7 @@ virDomainChrSourceDefParseTCP(virDomainChrSourceDefPtr def, static int -virDomainChrSourceDefParseUDP(virDomainChrSourceDefPtr def, +virDomainChrSourceDefParseUDP(virDomainChrSourceDef *def, xmlNodePtr source) { int mode; @@ -11944,7 +11944,7 @@ virDomainChrSourceDefParseUDP(virDomainChrSourceDefPtr def, static int -virDomainChrSourceDefParseUnix(virDomainChrSourceDefPtr def, +virDomainChrSourceDefParseUnix(virDomainChrSourceDef *def, xmlNodePtr source, xmlXPathContextPtr ctxt) { @@ -11967,7 +11967,7 @@ virDomainChrSourceDefParseUnix(virDomainChrSourceDefPtr def, static int -virDomainChrSourceDefParseFile(virDomainChrSourceDefPtr def, +virDomainChrSourceDefParseFile(virDomainChrSourceDef *def, xmlNodePtr source) { g_autofree char *append = NULL; @@ -11987,7 +11987,7 @@ virDomainChrSourceDefParseFile(virDomainChrSourceDefPtr def, static int -virDomainChrSourceDefParseProtocol(virDomainChrSourceDefPtr def, +virDomainChrSourceDefParseProtocol(virDomainChrSourceDef *def, xmlNodePtr protocol) { g_autofree char *prot = NULL; @@ -12008,7 +12008,7 @@ virDomainChrSourceDefParseProtocol(virDomainChrSourceDefPtr def, static int -virDomainChrSourceDefParseLog(virDomainChrSourceDefPtr def, +virDomainChrSourceDefParseLog(virDomainChrSourceDef *def, xmlNodePtr log) { g_autofree char *append = NULL; @@ -12033,9 +12033,9 @@ virDomainChrSourceDefParseLog(virDomainChrSourceDefPtr def, * * Return -1 on failure, 0 on success. */ static int -virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def, +virDomainChrSourceDefParseXML(virDomainChrSourceDef *def, xmlNodePtr cur, unsigned int flags, - virDomainChrDefPtr chr_def, + virDomainChrDef *chr_def, xmlXPathContextPtr ctxt) { bool logParsed = false; @@ -12154,7 +12154,7 @@ virDomainChrSourceDefParseXML(virDomainChrSourceDefPtr def, } -static virClassPtr virDomainChrSourceDefClass; +static virClass *virDomainChrSourceDefClass; static int virDomainChrSourceDefOnceInit(void) @@ -12167,10 +12167,10 @@ virDomainChrSourceDefOnceInit(void) VIR_ONCE_GLOBAL_INIT(virDomainChrSourceDef); -virDomainChrSourceDefPtr -virDomainChrSourceDefNew(virDomainXMLOptionPtr xmlopt) +virDomainChrSourceDef * +virDomainChrSourceDefNew(virDomainXMLOption *xmlopt) { - virDomainChrSourceDefPtr def = NULL; + virDomainChrSourceDef *def = NULL; if (virDomainChrSourceDefInitialize() < 0) return NULL; @@ -12191,10 +12191,10 @@ virDomainChrSourceDefNew(virDomainXMLOptionPtr xmlopt) /* Create a new character device definition and set * default port. */ -virDomainChrDefPtr -virDomainChrDefNew(virDomainXMLOptionPtr xmlopt) +virDomainChrDef * +virDomainChrDefNew(virDomainXMLOption *xmlopt) { - virDomainChrDefPtr def = NULL; + virDomainChrDef *def = NULL; def = g_new0(virDomainChrDef, 1); @@ -12248,15 +12248,15 @@ virDomainChrDefNew(virDomainXMLOptionPtr xmlopt) * * */ -static virDomainChrDefPtr -virDomainChrDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainChrDef * +virDomainChrDefParseXML(virDomainXMLOption *xmlopt, xmlXPathContextPtr ctxt, xmlNodePtr node, unsigned int flags) { xmlNodePtr cur; const char *nodeName; - virDomainChrDefPtr def; + virDomainChrDef *def; bool seenTarget = false; g_autofree char *type = NULL; @@ -12331,8 +12331,8 @@ virDomainChrDefParseXML(virDomainXMLOptionPtr xmlopt, return NULL; } -static virDomainSmartcardDefPtr -virDomainSmartcardDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainSmartcardDef * +virDomainSmartcardDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) @@ -12474,13 +12474,13 @@ virDomainSmartcardDefParseXML(virDomainXMLOptionPtr xmlopt, * * */ -static virDomainTPMDefPtr -virDomainTPMDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainTPMDef * +virDomainTPMDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { - virDomainTPMDefPtr def; + virDomainTPMDef *def; VIR_XPATH_NODE_AUTORESTORE(ctxt) int nbackends; g_autofree char *path = NULL; @@ -12586,13 +12586,13 @@ virDomainTPMDefParseXML(virDomainXMLOptionPtr xmlopt, return NULL; } -static virDomainPanicDefPtr -virDomainPanicDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainPanicDef * +virDomainPanicDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { - virDomainPanicDefPtr panic; + virDomainPanicDef *panic; g_autofree char *model = NULL; panic = g_new0(virDomainPanicDef, 1); @@ -12617,15 +12617,15 @@ virDomainPanicDefParseXML(virDomainXMLOptionPtr xmlopt, } /* Parse the XML definition for an input device */ -static virDomainInputDefPtr -virDomainInputDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainInputDef * +virDomainInputDefParseXML(virDomainXMLOption *xmlopt, const virDomainDef *dom, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virDomainInputDefPtr def; + virDomainInputDef *def; g_autofree char *evdev = NULL; g_autofree char *type = NULL; g_autofree char *bus = NULL; @@ -12776,13 +12776,13 @@ virDomainInputDefParseXML(virDomainXMLOptionPtr xmlopt, /* Parse the XML definition for a hub device */ -static virDomainHubDefPtr -virDomainHubDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainHubDef * +virDomainHubDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { - virDomainHubDefPtr def; + virDomainHubDef *def; g_autofree char *type = NULL; def = g_new0(virDomainHubDef, 1); @@ -12813,11 +12813,11 @@ virDomainHubDefParseXML(virDomainXMLOptionPtr xmlopt, /* Parse the XML definition for a clock timer */ -static virDomainTimerDefPtr +static virDomainTimerDef * virDomainTimerDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt) { - virDomainTimerDefPtr def; + virDomainTimerDef *def; VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr catchup; int ret; @@ -12934,7 +12934,7 @@ virDomainTimerDefParseXML(xmlNodePtr node, static int virDomainGraphicsAuthDefParseXML(xmlNodePtr node, - virDomainGraphicsAuthDefPtr def, + virDomainGraphicsAuthDef *def, int type) { g_autofree char *validTo = NULL; @@ -13015,8 +13015,8 @@ virDomainGraphicsAuthDefParseXML(xmlNodePtr node, * elements. */ static int -virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def, - virDomainGraphicsDefPtr graphics, +virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDef *def, + virDomainGraphicsDef *graphics, xmlNodePtr node, xmlNodePtr parent, unsigned int flags) @@ -13159,7 +13159,7 @@ virDomainGraphicsListenDefParseXML(virDomainGraphicsListenDefPtr def, static int -virDomainGraphicsListensParseXML(virDomainGraphicsDefPtr def, +virDomainGraphicsListensParseXML(virDomainGraphicsDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) @@ -13216,7 +13216,7 @@ virDomainGraphicsListensParseXML(virDomainGraphicsDefPtr def, if (VIR_APPEND_ELEMENT(def->listens, def->nListens, newListen) < 0) goto cleanup; } else { - virDomainGraphicsListenDefPtr glisten = &def->listens[0]; + virDomainGraphicsListenDef *glisten = &def->listens[0]; /* If the first element is 'address' or 'network' and we found * 'socket' attribute inside element for backward @@ -13239,7 +13239,7 @@ virDomainGraphicsListensParseXML(virDomainGraphicsDefPtr def, static int -virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def, +virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) @@ -13347,7 +13347,7 @@ virDomainGraphicsDefParseXMLVNC(virDomainGraphicsDefPtr def, static int -virDomainGraphicsDefParseXMLSDL(virDomainGraphicsDefPtr def, +virDomainGraphicsDefParseXMLSDL(virDomainGraphicsDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt) { @@ -13395,7 +13395,7 @@ virDomainGraphicsDefParseXMLSDL(virDomainGraphicsDefPtr def, static int -virDomainGraphicsDefParseXMLRDP(virDomainGraphicsDefPtr def, +virDomainGraphicsDefParseXMLRDP(virDomainGraphicsDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) @@ -13440,7 +13440,7 @@ virDomainGraphicsDefParseXMLRDP(virDomainGraphicsDefPtr def, static int -virDomainGraphicsDefParseXMLDesktop(virDomainGraphicsDefPtr def, +virDomainGraphicsDefParseXMLDesktop(virDomainGraphicsDef *def, xmlNodePtr node) { g_autofree char *fullscreen = virXMLPropString(node, "fullscreen"); @@ -13462,7 +13462,7 @@ virDomainGraphicsDefParseXMLDesktop(virDomainGraphicsDefPtr def, static int -virDomainGraphicsDefParseXMLSpice(virDomainGraphicsDefPtr def, +virDomainGraphicsDefParseXMLSpice(virDomainGraphicsDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) @@ -13736,7 +13736,7 @@ virDomainGraphicsDefParseXMLSpice(virDomainGraphicsDefPtr def, static void -virDomainGraphicsDefParseXMLEGLHeadless(virDomainGraphicsDefPtr def, +virDomainGraphicsDefParseXMLEGLHeadless(virDomainGraphicsDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt) { @@ -13751,10 +13751,10 @@ virDomainGraphicsDefParseXMLEGLHeadless(virDomainGraphicsDefPtr def, } -virDomainGraphicsDefPtr -virDomainGraphicsDefNew(virDomainXMLOptionPtr xmlopt) +virDomainGraphicsDef * +virDomainGraphicsDefNew(virDomainXMLOption *xmlopt) { - virDomainGraphicsDefPtr def = NULL; + virDomainGraphicsDef *def = NULL; def = g_new0(virDomainGraphicsDef, 1); @@ -13768,10 +13768,10 @@ virDomainGraphicsDefNew(virDomainXMLOptionPtr xmlopt) } -virDomainNetDefPtr -virDomainNetDefNew(virDomainXMLOptionPtr xmlopt) +virDomainNetDef * +virDomainNetDefNew(virDomainXMLOption *xmlopt) { - virDomainNetDefPtr def = NULL; + virDomainNetDef *def = NULL; def = g_new0(virDomainNetDef, 1); @@ -13786,13 +13786,13 @@ virDomainNetDefNew(virDomainXMLOptionPtr xmlopt) /* Parse the XML definition for a graphics device */ -static virDomainGraphicsDefPtr -virDomainGraphicsDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainGraphicsDef * +virDomainGraphicsDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { - virDomainGraphicsDefPtr def; + virDomainGraphicsDef *def; int typeVal; g_autofree char *type = NULL; @@ -13850,10 +13850,10 @@ virDomainGraphicsDefParseXML(virDomainXMLOptionPtr xmlopt, } -static virDomainSoundCodecDefPtr +static virDomainSoundCodecDef * virDomainSoundCodecDefParseXML(xmlNodePtr node) { - virDomainSoundCodecDefPtr def; + virDomainSoundCodecDef *def; g_autofree char *type = NULL; def = g_new0(virDomainSoundCodecDef, 1); @@ -13873,13 +13873,13 @@ virDomainSoundCodecDefParseXML(xmlNodePtr node) } -static virDomainSoundDefPtr -virDomainSoundDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainSoundDef * +virDomainSoundDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { - virDomainSoundDefPtr def; + virDomainSoundDef *def; VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree char *model = NULL; xmlNodePtr audioNode; @@ -13906,10 +13906,10 @@ virDomainSoundDefParseXML(virDomainXMLOptionPtr xmlopt, if (ncodecs > 0) { size_t i; - def->codecs = g_new0(virDomainSoundCodecDefPtr, ncodecs); + def->codecs = g_new0(virDomainSoundCodecDef *, ncodecs); for (i = 0; i < ncodecs; i++) { - virDomainSoundCodecDefPtr codec = virDomainSoundCodecDefParseXML(codecNodes[i]); + virDomainSoundCodecDef *codec = virDomainSoundCodecDefParseXML(codecNodes[i]); if (codec == NULL) goto error; @@ -13988,7 +13988,7 @@ virDomainSoundDefFind(const virDomainDef *def, static int -virDomainAudioCommonParse(virDomainAudioIOCommonPtr def, +virDomainAudioCommonParse(virDomainAudioIOCommon *def, xmlNodePtr node, xmlXPathContextPtr ctxt) { @@ -14081,7 +14081,7 @@ virDomainAudioCommonParse(virDomainAudioIOCommonPtr def, static void -virDomainAudioALSAParse(virDomainAudioIOALSAPtr def, +virDomainAudioALSAParse(virDomainAudioIOALSA *def, xmlNodePtr node) { def->dev = virXMLPropString(node, "dev"); @@ -14089,7 +14089,7 @@ virDomainAudioALSAParse(virDomainAudioIOALSAPtr def, static int -virDomainAudioCoreAudioParse(virDomainAudioIOCoreAudioPtr def, +virDomainAudioCoreAudioParse(virDomainAudioIOCoreAudio *def, xmlNodePtr node) { g_autofree char *bufferCount = virXMLPropString(node, "bufferCount"); @@ -14107,7 +14107,7 @@ virDomainAudioCoreAudioParse(virDomainAudioIOCoreAudioPtr def, static int -virDomainAudioJackParse(virDomainAudioIOJackPtr def, +virDomainAudioJackParse(virDomainAudioIOJack *def, xmlNodePtr node) { g_autofree char *exactName = virXMLPropString(node, "exactName"); @@ -14129,7 +14129,7 @@ virDomainAudioJackParse(virDomainAudioIOJackPtr def, static int -virDomainAudioOSSParse(virDomainAudioIOOSSPtr def, +virDomainAudioOSSParse(virDomainAudioIOOSS *def, xmlNodePtr node) { g_autofree char *tryPoll = virXMLPropString(node, "tryPoll"); @@ -14158,7 +14158,7 @@ virDomainAudioOSSParse(virDomainAudioIOOSSPtr def, static int -virDomainAudioPulseAudioParse(virDomainAudioIOPulseAudioPtr def, +virDomainAudioPulseAudioParse(virDomainAudioIOPulseAudio *def, xmlNodePtr node) { g_autofree char *latency = virXMLPropString(node, "latency"); @@ -14179,7 +14179,7 @@ virDomainAudioPulseAudioParse(virDomainAudioIOPulseAudioPtr def, static int -virDomainAudioSDLParse(virDomainAudioIOSDLPtr def, +virDomainAudioSDLParse(virDomainAudioIOSDL *def, xmlNodePtr node) { g_autofree char *bufferCount = virXMLPropString(node, "bufferCount"); @@ -14196,12 +14196,12 @@ virDomainAudioSDLParse(virDomainAudioIOSDLPtr def, } -static virDomainAudioDefPtr -virDomainAudioDefParseXML(virDomainXMLOptionPtr xmlopt G_GNUC_UNUSED, +static virDomainAudioDef * +virDomainAudioDefParseXML(virDomainXMLOption *xmlopt G_GNUC_UNUSED, xmlNodePtr node, xmlXPathContextPtr ctxt) { - virDomainAudioDefPtr def; + virDomainAudioDef *def; VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree char *tmp = NULL; g_autofree char *type = NULL; @@ -14350,13 +14350,13 @@ virDomainAudioDefParseXML(virDomainXMLOptionPtr xmlopt G_GNUC_UNUSED, virDomainAudioDefFree(def); return NULL; } -static virDomainWatchdogDefPtr -virDomainWatchdogDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainWatchdogDef * +virDomainWatchdogDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { - virDomainWatchdogDefPtr def; + virDomainWatchdogDef *def; g_autofree char *model = NULL; g_autofree char *action = NULL; @@ -14398,13 +14398,13 @@ virDomainWatchdogDefParseXML(virDomainXMLOptionPtr xmlopt, } -static virDomainRNGDefPtr -virDomainRNGDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainRNGDef * +virDomainRNGDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { - virDomainRNGDefPtr def; + virDomainRNGDef *def; VIR_XPATH_NODE_AUTORESTORE(ctxt) int nbackends; g_autofree xmlNodePtr *backends = NULL; @@ -14510,13 +14510,13 @@ virDomainRNGDefParseXML(virDomainXMLOptionPtr xmlopt, } -static virDomainMemballoonDefPtr -virDomainMemballoonDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainMemballoonDef * +virDomainMemballoonDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { - virDomainMemballoonDefPtr def; + virDomainMemballoonDef *def; VIR_XPATH_NODE_AUTORESTORE(ctxt) unsigned int period = 0; g_autofree char *model = NULL; @@ -14580,13 +14580,13 @@ virDomainMemballoonDefParseXML(virDomainXMLOptionPtr xmlopt, return NULL; } -static virDomainNVRAMDefPtr -virDomainNVRAMDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainNVRAMDef * +virDomainNVRAMDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { - virDomainNVRAMDefPtr def; + virDomainNVRAMDef *def; def = g_new0(virDomainNVRAMDef, 1); @@ -14600,14 +14600,14 @@ virDomainNVRAMDefParseXML(virDomainXMLOptionPtr xmlopt, return NULL; } -static virDomainShmemDefPtr -virDomainShmemDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainShmemDef * +virDomainShmemDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { - virDomainShmemDefPtr def = NULL; - virDomainShmemDefPtr ret = NULL; + virDomainShmemDef *def = NULL; + virDomainShmemDef *ret = NULL; xmlNodePtr msi = NULL; VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr server = NULL; @@ -14709,11 +14709,11 @@ virDomainShmemDefParseXML(virDomainXMLOptionPtr xmlopt, static int virSysinfoBIOSParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virSysinfoBIOSDefPtr *bios) + virSysinfoBIOSDef **bios) { VIR_XPATH_NODE_AUTORESTORE(ctxt) int ret = -1; - virSysinfoBIOSDefPtr def; + virSysinfoBIOSDef *def; ctxt->node = node; @@ -14769,13 +14769,13 @@ virSysinfoBIOSParseXML(xmlNodePtr node, static int virSysinfoSystemParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virSysinfoSystemDefPtr *sysdef, + virSysinfoSystemDef **sysdef, unsigned char *domUUID, bool uuid_generated) { VIR_XPATH_NODE_AUTORESTORE(ctxt) int ret = -1; - virSysinfoSystemDefPtr def; + virSysinfoSystemDef *def; g_autofree char *tmpUUID = NULL; ctxt->node = node; @@ -14842,13 +14842,13 @@ virSysinfoSystemParseXML(xmlNodePtr node, static int virSysinfoBaseBoardParseXML(xmlXPathContextPtr ctxt, - virSysinfoBaseBoardDefPtr *baseBoard, + virSysinfoBaseBoardDef **baseBoard, size_t *nbaseBoard) { size_t i, nboards = 0; VIR_XPATH_NODE_AUTORESTORE(ctxt) int n; - g_autofree virSysinfoBaseBoardDefPtr boards = NULL; + g_autofree virSysinfoBaseBoardDef *boards = NULL; g_autofree xmlNodePtr *nodes = NULL; if ((n = virXPathNodeSet("./baseBoard", ctxt, &nodes)) < 0) @@ -14858,7 +14858,7 @@ virSysinfoBaseBoardParseXML(xmlXPathContextPtr ctxt, boards = g_new0(virSysinfoBaseBoardDef, n); for (i = 0; i < n; i++) { - virSysinfoBaseBoardDefPtr def = boards + nboards; + virSysinfoBaseBoardDef *def = boards + nboards; ctxt->node = nodes[i]; @@ -14893,11 +14893,11 @@ virSysinfoBaseBoardParseXML(xmlXPathContextPtr ctxt, static int virSysinfoOEMStringsParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virSysinfoOEMStringsDefPtr *oem) + virSysinfoOEMStringsDef **oem) { VIR_XPATH_NODE_AUTORESTORE(ctxt) int ret = -1; - virSysinfoOEMStringsDefPtr def; + virSysinfoOEMStringsDef *def; int nstrings; size_t i; g_autofree xmlNodePtr *strings = NULL; @@ -14931,11 +14931,11 @@ virSysinfoOEMStringsParseXML(xmlNodePtr node, static int virSysinfoChassisParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virSysinfoChassisDefPtr *chassisdef) + virSysinfoChassisDef **chassisdef) { VIR_XPATH_NODE_AUTORESTORE(ctxt) int ret = -1; - virSysinfoChassisDefPtr def; + virSysinfoChassisDef *def; ctxt->node = node; @@ -14972,7 +14972,7 @@ virSysinfoChassisParseXML(xmlNodePtr node, static int -virSysinfoParseSMBIOSDef(virSysinfoDefPtr def, +virSysinfoParseSMBIOSDef(virSysinfoDef *def, xmlXPathContextPtr ctxt, unsigned char *domUUID, bool uuid_generated) @@ -15013,7 +15013,7 @@ virSysinfoParseSMBIOSDef(virSysinfoDefPtr def, static int -virSysinfoParseFWCfgDef(virSysinfoDefPtr def, +virSysinfoParseFWCfgDef(virSysinfoDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt) { @@ -15072,14 +15072,14 @@ virSysinfoParseFWCfgDef(virSysinfoDefPtr def, } -static virSysinfoDefPtr +static virSysinfoDef * virSysinfoParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned char *domUUID, bool uuid_generated) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virSysinfoDefPtr def; + virSysinfoDef *def; g_autofree char *typeStr = NULL; int type; @@ -15169,10 +15169,10 @@ virDomainVideoDefaultRAM(const virDomainDef *def, } -static virDomainVideoAccelDefPtr +static virDomainVideoAccelDef * virDomainVideoAccelDefParseXML(xmlNodePtr node) { - g_autofree virDomainVideoAccelDefPtr def = NULL; + g_autofree virDomainVideoAccelDef *def = NULL; int val; g_autofree char *accel2d = NULL; g_autofree char *accel3d = NULL; @@ -15214,10 +15214,10 @@ virDomainVideoAccelDefParseXML(xmlNodePtr node) return g_steal_pointer(&def); } -static virDomainVideoResolutionDefPtr +static virDomainVideoResolutionDef * virDomainVideoResolutionDefParseXML(xmlNodePtr node) { - g_autofree virDomainVideoResolutionDefPtr def = NULL; + g_autofree virDomainVideoResolutionDef *def = NULL; g_autofree char *x = NULL; g_autofree char *y = NULL; @@ -15247,11 +15247,11 @@ virDomainVideoResolutionDefParseXML(xmlNodePtr node) return g_steal_pointer(&def); } -static virDomainVideoDriverDefPtr +static virDomainVideoDriverDef * virDomainVideoDriverDefParseXML(xmlNodePtr node) { xmlNodePtr cur; - virDomainVideoDriverDefPtr def; + virDomainVideoDriverDef *def; int val; g_autofree char *vgaconf = NULL; @@ -15281,8 +15281,8 @@ virDomainVideoDriverDefParseXML(xmlNodePtr node) return def; } -static virDomainVideoDefPtr -virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainVideoDef * +virDomainVideoDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) @@ -15418,13 +15418,13 @@ virDomainVideoDefParseXML(virDomainXMLOptionPtr xmlopt, return g_steal_pointer(&def); } -static virDomainHostdevDefPtr -virDomainHostdevDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainHostdevDef * +virDomainHostdevDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { - virDomainHostdevDefPtr def; + virDomainHostdevDef *def; VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree char *mode = virXMLPropString(node, "mode"); g_autofree char *type = virXMLPropString(node, "type"); @@ -15496,14 +15496,14 @@ virDomainHostdevDefParseXML(virDomainXMLOptionPtr xmlopt, } -static virDomainRedirdevDefPtr -virDomainRedirdevDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainRedirdevDef * +virDomainRedirdevDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) { xmlNodePtr cur; - virDomainRedirdevDefPtr def; + virDomainRedirdevDef *def; g_autofree char *bus = NULL; g_autofree char *type = NULL; @@ -15575,7 +15575,7 @@ virDomainRedirdevDefParseXML(virDomainXMLOptionPtr xmlopt, */ static int virDomainRedirFilterUSBVersionHelper(const char *version, - virDomainRedirFilterUSBDevDefPtr def) + virDomainRedirFilterUSBDevDef *def) { unsigned int major, minor; char *s = NULL; @@ -15603,10 +15603,10 @@ virDomainRedirFilterUSBVersionHelper(const char *version, return -1; } -static virDomainRedirFilterUSBDevDefPtr +static virDomainRedirFilterUSBDevDef * virDomainRedirFilterUSBDevDefParseXML(xmlNodePtr node) { - virDomainRedirFilterUSBDevDefPtr def; + virDomainRedirFilterUSBDevDef *def; g_autofree char *class = NULL; g_autofree char *vendor = NULL; g_autofree char *product = NULL; @@ -15684,14 +15684,14 @@ virDomainRedirFilterUSBDevDefParseXML(xmlNodePtr node) return NULL; } -static virDomainRedirFilterDefPtr +static virDomainRedirFilterDef * virDomainRedirFilterDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt) { int n; size_t i; VIR_XPATH_NODE_AUTORESTORE(ctxt) - virDomainRedirFilterDefPtr def = NULL; + virDomainRedirFilterDef *def = NULL; g_autofree xmlNodePtr *nodes = NULL; def = g_new0(virDomainRedirFilterDef, 1); @@ -15701,10 +15701,10 @@ virDomainRedirFilterDefParseXML(xmlNodePtr node, goto error; if (n) - def->usbdevs = g_new0(virDomainRedirFilterUSBDevDefPtr, n); + def->usbdevs = g_new0(virDomainRedirFilterUSBDevDef *, n); for (i = 0; i < n; i++) { - virDomainRedirFilterUSBDevDefPtr usbdev = + virDomainRedirFilterUSBDevDef *usbdev = virDomainRedirFilterUSBDevDefParseXML(nodes[i]); if (!usbdev) @@ -15763,7 +15763,7 @@ virDomainPMStateParseXML(xmlXPathContextPtr ctxt, static int -virDomainPerfEventDefParseXML(virDomainPerfDefPtr perf, +virDomainPerfEventDefParseXML(virDomainPerfDef *perf, xmlNodePtr node) { int event; @@ -15804,7 +15804,7 @@ virDomainPerfEventDefParseXML(virDomainPerfDefPtr perf, } static int -virDomainPerfDefParseXML(virDomainDefPtr def, +virDomainPerfDefParseXML(virDomainDef *def, xmlXPathContextPtr ctxt) { size_t i; @@ -15825,7 +15825,7 @@ virDomainPerfDefParseXML(virDomainDefPtr def, static int virDomainMemorySourceDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virDomainMemoryDefPtr def) + virDomainMemoryDef *def) { VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree char *nodemask = NULL; @@ -15879,7 +15879,7 @@ virDomainMemorySourceDefParseXML(xmlNodePtr node, static int virDomainMemoryTargetDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virDomainMemoryDefPtr def) + virDomainMemoryDef *def) { VIR_XPATH_NODE_AUTORESTORE(ctxt) int rv; @@ -15925,12 +15925,12 @@ virDomainMemoryTargetDefParseXML(xmlNodePtr node, } -static virDomainSEVDefPtr +static virDomainSEVDef * virDomainSEVDefParseXML(xmlNodePtr sevNode, xmlXPathContextPtr ctxt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virDomainSEVDefPtr def; + virDomainSEVDef *def; unsigned long policy; g_autofree char *type = NULL; int rc = -1; @@ -15999,15 +15999,15 @@ virDomainSEVDefParseXML(xmlNodePtr sevNode, } -static virDomainMemoryDefPtr -virDomainMemoryDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainMemoryDef * +virDomainMemoryDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr memdevNode, xmlXPathContextPtr ctxt, unsigned int flags) { VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr node; - virDomainMemoryDefPtr def; + virDomainMemoryDef *def; int val; g_autofree char *tmp = NULL; @@ -16091,7 +16091,7 @@ virDomainMemoryDefParseXML(virDomainXMLOptionPtr xmlopt, } -static virDomainIOMMUDefPtr +static virDomainIOMMUDef * virDomainIOMMUDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt) { @@ -16099,7 +16099,7 @@ virDomainIOMMUDefParseXML(xmlNodePtr node, xmlNodePtr driver; int val; g_autofree char *tmp = NULL; - g_autofree virDomainIOMMUDefPtr iommu = NULL; + g_autofree virDomainIOMMUDef *iommu = NULL; ctxt->node = node; @@ -16168,8 +16168,8 @@ virDomainIOMMUDefParseXML(xmlNodePtr node, } -static virDomainVsockDefPtr -virDomainVsockDefParseXML(virDomainXMLOptionPtr xmlopt, +static virDomainVsockDef * +virDomainVsockDefParseXML(virDomainXMLOption *xmlopt, xmlNodePtr node, xmlXPathContextPtr ctxt, unsigned int flags) @@ -16231,10 +16231,10 @@ virDomainVsockDefParseXML(virDomainXMLOptionPtr xmlopt, return g_steal_pointer(&vsock); } -virDomainDeviceDefPtr +virDomainDeviceDef * virDomainDeviceDefParse(const char *xmlStr, const virDomainDef *def, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque, unsigned int flags) { @@ -16409,9 +16409,9 @@ virDomainDeviceDefParse(const char *xmlStr, } -virDomainDiskDefPtr +virDomainDiskDef * virDomainDiskDefParse(const char *xmlStr, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags) { g_autoptr(xmlDoc) xml = NULL; @@ -16455,15 +16455,15 @@ virDomainChrTargetTypeToString(int deviceType, } int -virDomainHostdevInsert(virDomainDefPtr def, virDomainHostdevDefPtr hostdev) +virDomainHostdevInsert(virDomainDef *def, virDomainHostdevDef *hostdev) { return VIR_APPEND_ELEMENT(def->hostdevs, def->nhostdevs, hostdev); } -virDomainHostdevDefPtr -virDomainHostdevRemove(virDomainDefPtr def, size_t i) +virDomainHostdevDef * +virDomainHostdevRemove(virDomainDef *def, size_t i) { - virDomainHostdevDefPtr hostdev = def->hostdevs[i]; + virDomainHostdevDef *hostdev = def->hostdevs[i]; VIR_DELETE_ELEMENT(def->hostdevs, i, def->nhostdevs); return hostdev; @@ -16471,11 +16471,11 @@ virDomainHostdevRemove(virDomainDefPtr def, size_t i) static int -virDomainHostdevMatchSubsysUSB(virDomainHostdevDefPtr first, - virDomainHostdevDefPtr second) +virDomainHostdevMatchSubsysUSB(virDomainHostdevDef *first, + virDomainHostdevDef *second) { - virDomainHostdevSubsysUSBPtr first_usbsrc = &first->source.subsys.u.usb; - virDomainHostdevSubsysUSBPtr second_usbsrc = &second->source.subsys.u.usb; + virDomainHostdevSubsysUSB *first_usbsrc = &first->source.subsys.u.usb; + virDomainHostdevSubsysUSB *second_usbsrc = &second->source.subsys.u.usb; if (first_usbsrc->bus && first_usbsrc->device) { /* specified by bus location on host */ @@ -16492,11 +16492,11 @@ virDomainHostdevMatchSubsysUSB(virDomainHostdevDefPtr first, } static int -virDomainHostdevMatchSubsysPCI(virDomainHostdevDefPtr first, - virDomainHostdevDefPtr second) +virDomainHostdevMatchSubsysPCI(virDomainHostdevDef *first, + virDomainHostdevDef *second) { - virDomainHostdevSubsysPCIPtr first_pcisrc = &first->source.subsys.u.pci; - virDomainHostdevSubsysPCIPtr second_pcisrc = &second->source.subsys.u.pci; + virDomainHostdevSubsysPCI *first_pcisrc = &first->source.subsys.u.pci; + virDomainHostdevSubsysPCI *second_pcisrc = &second->source.subsys.u.pci; if (first_pcisrc->addr.domain == second_pcisrc->addr.domain && first_pcisrc->addr.bus == second_pcisrc->addr.bus && @@ -16507,12 +16507,12 @@ virDomainHostdevMatchSubsysPCI(virDomainHostdevDefPtr first, } static int -virDomainHostdevMatchSubsysSCSIHost(virDomainHostdevDefPtr first, - virDomainHostdevDefPtr second) +virDomainHostdevMatchSubsysSCSIHost(virDomainHostdevDef *first, + virDomainHostdevDef *second) { - virDomainHostdevSubsysSCSIHostPtr first_scsihostsrc = + virDomainHostdevSubsysSCSIHost *first_scsihostsrc = &first->source.subsys.u.scsi.u.host; - virDomainHostdevSubsysSCSIHostPtr second_scsihostsrc = + virDomainHostdevSubsysSCSIHost *second_scsihostsrc = &second->source.subsys.u.scsi.u.host; if (STREQ(first_scsihostsrc->adapter, second_scsihostsrc->adapter) && @@ -16524,12 +16524,12 @@ virDomainHostdevMatchSubsysSCSIHost(virDomainHostdevDefPtr first, } static int -virDomainHostdevMatchSubsysSCSIiSCSI(virDomainHostdevDefPtr first, - virDomainHostdevDefPtr second) +virDomainHostdevMatchSubsysSCSIiSCSI(virDomainHostdevDef *first, + virDomainHostdevDef *second) { - virDomainHostdevSubsysSCSIiSCSIPtr first_iscsisrc = + virDomainHostdevSubsysSCSIiSCSI *first_iscsisrc = &first->source.subsys.u.scsi.u.iscsi; - virDomainHostdevSubsysSCSIiSCSIPtr second_iscsisrc = + virDomainHostdevSubsysSCSIiSCSI *second_iscsisrc = &second->source.subsys.u.scsi.u.iscsi; if (STREQ(first_iscsisrc->src->hosts[0].name, second_iscsisrc->src->hosts[0].name) && @@ -16540,11 +16540,11 @@ virDomainHostdevMatchSubsysSCSIiSCSI(virDomainHostdevDefPtr first, } static int -virDomainHostdevMatchSubsysMediatedDev(virDomainHostdevDefPtr a, - virDomainHostdevDefPtr b) +virDomainHostdevMatchSubsysMediatedDev(virDomainHostdevDef *a, + virDomainHostdevDef *b) { - virDomainHostdevSubsysMediatedDevPtr src_a = &a->source.subsys.u.mdev; - virDomainHostdevSubsysMediatedDevPtr src_b = &b->source.subsys.u.mdev; + virDomainHostdevSubsysMediatedDev *src_a = &a->source.subsys.u.mdev; + virDomainHostdevSubsysMediatedDev *src_b = &b->source.subsys.u.mdev; if (STREQ(src_a->uuidstr, src_b->uuidstr)) return 1; @@ -16553,8 +16553,8 @@ virDomainHostdevMatchSubsysMediatedDev(virDomainHostdevDefPtr a, } static int -virDomainHostdevMatchSubsys(virDomainHostdevDefPtr a, - virDomainHostdevDefPtr b) +virDomainHostdevMatchSubsys(virDomainHostdevDef *a, + virDomainHostdevDef *b) { if (a->source.subsys.type != b->source.subsys.type) return 0; @@ -16592,8 +16592,8 @@ virDomainHostdevMatchSubsys(virDomainHostdevDefPtr a, static int -virDomainHostdevMatchCapsStorage(virDomainHostdevDefPtr a, - virDomainHostdevDefPtr b) +virDomainHostdevMatchCapsStorage(virDomainHostdevDef *a, + virDomainHostdevDef *b) { return STREQ_NULLABLE(a->source.caps.u.storage.block, b->source.caps.u.storage.block); @@ -16601,16 +16601,16 @@ virDomainHostdevMatchCapsStorage(virDomainHostdevDefPtr a, static int -virDomainHostdevMatchCapsMisc(virDomainHostdevDefPtr a, - virDomainHostdevDefPtr b) +virDomainHostdevMatchCapsMisc(virDomainHostdevDef *a, + virDomainHostdevDef *b) { return STREQ_NULLABLE(a->source.caps.u.misc.chardev, b->source.caps.u.misc.chardev); } static int -virDomainHostdevMatchCapsNet(virDomainHostdevDefPtr a, - virDomainHostdevDefPtr b) +virDomainHostdevMatchCapsNet(virDomainHostdevDef *a, + virDomainHostdevDef *b) { return STREQ_NULLABLE(a->source.caps.u.net.ifname, b->source.caps.u.net.ifname); @@ -16618,8 +16618,8 @@ virDomainHostdevMatchCapsNet(virDomainHostdevDefPtr a, static int -virDomainHostdevMatchCaps(virDomainHostdevDefPtr a, - virDomainHostdevDefPtr b) +virDomainHostdevMatchCaps(virDomainHostdevDef *a, + virDomainHostdevDef *b) { if (a->source.caps.type != b->source.caps.type) return 0; @@ -16637,8 +16637,8 @@ virDomainHostdevMatchCaps(virDomainHostdevDefPtr a, static int -virDomainHostdevMatch(virDomainHostdevDefPtr a, - virDomainHostdevDefPtr b) +virDomainHostdevMatch(virDomainHostdevDef *a, + virDomainHostdevDef *b) { if (a->mode != b->mode) return 0; @@ -16658,11 +16658,11 @@ virDomainHostdevMatch(virDomainHostdevDefPtr a, * if no match was found. */ int -virDomainHostdevFind(virDomainDefPtr def, - virDomainHostdevDefPtr match, - virDomainHostdevDefPtr *found) +virDomainHostdevFind(virDomainDef *def, + virDomainHostdevDef *match, + virDomainHostdevDef **found) { - virDomainHostdevDefPtr local_found; + virDomainHostdevDef *local_found; size_t i; if (!found) @@ -16702,14 +16702,14 @@ virDomainDiskControllerMatch(int controller_type, int disk_bus) int -virDomainDiskIndexByAddress(virDomainDefPtr def, - virPCIDeviceAddressPtr pci_address, - virDomainDeviceCCWAddressPtr ccw_addr, +virDomainDiskIndexByAddress(virDomainDef *def, + virPCIDeviceAddress *pci_address, + virDomainDeviceCCWAddress *ccw_addr, unsigned int bus, unsigned int target, unsigned int unit) { - virDomainDiskDefPtr vdisk; - virDomainControllerDefPtr controller = NULL; + virDomainDiskDef *vdisk; + virDomainControllerDef *controller = NULL; size_t i; int cidx; @@ -16733,7 +16733,7 @@ virDomainDiskIndexByAddress(virDomainDefPtr def, return i; } if (vdisk->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) { - virDomainDeviceDriveAddressPtr drive = &vdisk->info.addr.drive; + virDomainDeviceDriveAddress *drive = &vdisk->info.addr.drive; if (controller && virDomainDiskControllerMatch(controller->type, vdisk->bus) && drive->controller == controller->idx && @@ -16745,10 +16745,10 @@ virDomainDiskIndexByAddress(virDomainDefPtr def, return -1; } -virDomainDiskDefPtr -virDomainDiskByAddress(virDomainDefPtr def, - virPCIDeviceAddressPtr pci_address, - virDomainDeviceCCWAddressPtr ccw_addr, +virDomainDiskDef * +virDomainDiskByAddress(virDomainDef *def, + virPCIDeviceAddress *pci_address, + virDomainDeviceCCWAddress *ccw_addr, unsigned int bus, unsigned int target, unsigned int unit) @@ -16759,10 +16759,10 @@ virDomainDiskByAddress(virDomainDefPtr def, } int -virDomainDiskIndexByName(virDomainDefPtr def, const char *name, +virDomainDiskIndexByName(virDomainDef *def, const char *name, bool allow_ambiguous) { - virDomainDiskDefPtr vdisk; + virDomainDiskDef *vdisk; size_t i; int candidate = -1; @@ -16786,8 +16786,8 @@ virDomainDiskIndexByName(virDomainDefPtr def, const char *name, return candidate; } -virDomainDiskDefPtr -virDomainDiskByName(virDomainDefPtr def, +virDomainDiskDef * +virDomainDiskByName(virDomainDef *def, const char *name, bool allow_ambiguous) { @@ -16800,8 +16800,8 @@ virDomainDiskByName(virDomainDefPtr def, } -virDomainDiskDefPtr -virDomainDiskByTarget(virDomainDefPtr def, +virDomainDiskDef * +virDomainDiskByTarget(virDomainDef *def, const char *dst) { size_t i; @@ -16815,15 +16815,15 @@ virDomainDiskByTarget(virDomainDefPtr def, } -void virDomainDiskInsert(virDomainDefPtr def, - virDomainDiskDefPtr disk) +void virDomainDiskInsert(virDomainDef *def, + virDomainDiskDef *disk) { - def->disks = g_renew(virDomainDiskDefPtr, def->disks, def->ndisks + 1); + def->disks = g_renew(virDomainDiskDef *, def->disks, def->ndisks + 1); virDomainDiskInsertPreAlloced(def, disk); } -void virDomainDiskInsertPreAlloced(virDomainDefPtr def, - virDomainDiskDefPtr disk) +void virDomainDiskInsertPreAlloced(virDomainDef *def, + virDomainDiskDef *disk) { int idx; /* Tentatively plan to insert disk at the end. */ @@ -16856,17 +16856,17 @@ void virDomainDiskInsertPreAlloced(virDomainDefPtr def, } -virDomainDiskDefPtr -virDomainDiskRemove(virDomainDefPtr def, size_t i) +virDomainDiskDef * +virDomainDiskRemove(virDomainDef *def, size_t i) { - virDomainDiskDefPtr disk = def->disks[i]; + virDomainDiskDef *disk = def->disks[i]; VIR_DELETE_ELEMENT(def->disks, i, def->ndisks); return disk; } -virDomainDiskDefPtr -virDomainDiskRemoveByName(virDomainDefPtr def, const char *name) +virDomainDiskDef * +virDomainDiskRemoveByName(virDomainDef *def, const char *name) { int idx = virDomainDiskIndexByName(def, name, false); if (idx < 0) @@ -16874,7 +16874,7 @@ virDomainDiskRemoveByName(virDomainDefPtr def, const char *name) return virDomainDiskRemove(def, idx); } -int virDomainNetInsert(virDomainDefPtr def, virDomainNetDefPtr net) +int virDomainNetInsert(virDomainDef *def, virDomainNetDef *net) { /* hostdev net devices must also exist in the hostdevs array */ if (net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV && @@ -16904,7 +16904,7 @@ int virDomainNetInsert(virDomainDefPtr def, virDomainNetDefPtr net) * -1 otherwise and an error is logged. */ int -virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net) +virDomainNetFindIdx(virDomainDef *def, virDomainNetDef *net) { size_t i; int matchidx = -1; @@ -17001,7 +17001,7 @@ virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net) } bool -virDomainHasNet(virDomainDefPtr def, virDomainNetDefPtr net) +virDomainHasNet(virDomainDef *def, virDomainNetDef *net) { size_t i; bool PCIAddrSpecified = virDomainDeviceAddressIsValid(&net->info, @@ -17023,12 +17023,12 @@ virDomainHasNet(virDomainDefPtr def, virDomainNetDefPtr net) } void -virDomainNetRemoveHostdev(virDomainDefPtr def, - virDomainNetDefPtr net) +virDomainNetRemoveHostdev(virDomainDef *def, + virDomainNetDef *net) { /* hostdev net devices are normally in the hostdevs array, but * might have already been removed by the time we get here */ - virDomainHostdevDefPtr hostdev = virDomainNetGetActualHostdev(net); + virDomainHostdevDef *hostdev = virDomainNetGetActualHostdev(net); size_t i; if (hostdev) { @@ -17042,10 +17042,10 @@ virDomainNetRemoveHostdev(virDomainDefPtr def, } -virDomainNetDefPtr -virDomainNetRemove(virDomainDefPtr def, size_t i) +virDomainNetDef * +virDomainNetRemove(virDomainDef *def, size_t i) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; virDomainNetRemoveHostdev(def, net); VIR_DELETE_ELEMENT(def->nets, i, def->nnets); @@ -17054,14 +17054,14 @@ virDomainNetRemove(virDomainDefPtr def, size_t i) int -virDomainNetUpdate(virDomainDefPtr def, +virDomainNetUpdate(virDomainDef *def, size_t netidx, - virDomainNetDefPtr newnet) + virDomainNetDef *newnet) { size_t hostdevidx; - virDomainNetDefPtr oldnet = def->nets[netidx]; - virDomainHostdevDefPtr oldhostdev = virDomainNetGetActualHostdev(oldnet); - virDomainHostdevDefPtr newhostdev = virDomainNetGetActualHostdev(newnet); + virDomainNetDef *oldnet = def->nets[netidx]; + virDomainHostdevDef *oldhostdev = virDomainNetGetActualHostdev(oldnet); + virDomainHostdevDef *newhostdev = virDomainNetGetActualHostdev(newnet); /* * if newnet or oldnet has a valid hostdev*, we need to update the @@ -17094,7 +17094,7 @@ virDomainNetUpdate(virDomainDefPtr def, int -virDomainNetDHCPInterfaces(virDomainDefPtr def, +virDomainNetDHCPInterfaces(virDomainDef *def, virDomainInterfacePtr **ifaces) { g_autoptr(virConnect) conn = NULL; @@ -17169,7 +17169,7 @@ virDomainNetDHCPInterfaces(virDomainDefPtr def, int -virDomainNetARPInterfaces(virDomainDefPtr def, +virDomainNetARPInterfaces(virDomainDef *def, virDomainInterfacePtr **ifaces) { size_t i, j; @@ -17178,7 +17178,7 @@ virDomainNetARPInterfaces(virDomainDefPtr def, char macaddr[VIR_MAC_STRING_BUFLEN]; virDomainInterfacePtr *ifaces_ret = NULL; virDomainInterfacePtr iface = NULL; - virArpTablePtr table; + virArpTable *table; table = virArpTableGet(); if (!table) @@ -17224,20 +17224,20 @@ virDomainNetARPInterfaces(virDomainDefPtr def, } -void virDomainControllerInsert(virDomainDefPtr def, - virDomainControllerDefPtr controller) +void virDomainControllerInsert(virDomainDef *def, + virDomainControllerDef *controller) { - def->controllers = g_renew(virDomainControllerDefPtr, def->controllers, def->ncontrollers + 1); + def->controllers = g_renew(virDomainControllerDef *, def->controllers, def->ncontrollers + 1); virDomainControllerInsertPreAlloced(def, controller); } -void virDomainControllerInsertPreAlloced(virDomainDefPtr def, - virDomainControllerDefPtr controller) +void virDomainControllerInsertPreAlloced(virDomainDef *def, + virDomainControllerDef *controller) { int idx; /* Tentatively plan to insert controller at the end. */ int insertAt = -1; - virDomainControllerDefPtr current = NULL; + virDomainControllerDef *current = NULL; /* Then work backwards looking for controllers of * the same type. If we find a controller with a @@ -17347,7 +17347,7 @@ virDomainControllerAliasFind(const virDomainDef *def, int -virDomainControllerFindByType(virDomainDefPtr def, +virDomainControllerFindByType(virDomainDef *def, int type) { size_t i; @@ -17361,13 +17361,13 @@ virDomainControllerFindByType(virDomainDefPtr def, } int -virDomainControllerFindByCCWAddress(virDomainDefPtr def, - virDomainDeviceCCWAddressPtr addr) +virDomainControllerFindByCCWAddress(virDomainDef *def, + virDomainDeviceCCWAddress *addr) { size_t i; for (i = 0; i < def->ncontrollers; i++) { - virDomainDeviceInfoPtr info = &def->controllers[i]->info; + virDomainDeviceInfo *info = &def->controllers[i]->info; if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW && virDomainDeviceCCWAddressEqual(&info->addr.ccw, addr)) @@ -17378,13 +17378,13 @@ virDomainControllerFindByCCWAddress(virDomainDefPtr def, } int -virDomainControllerFindByPCIAddress(virDomainDefPtr def, - virPCIDeviceAddressPtr addr) +virDomainControllerFindByPCIAddress(virDomainDef *def, + virPCIDeviceAddress *addr) { size_t i; for (i = 0; i < def->ncontrollers; i++) { - virDomainDeviceInfoPtr info = &def->controllers[i]->info; + virDomainDeviceInfo *info = &def->controllers[i]->info; if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI && virPCIDeviceAddressEqual(&info->addr.pci, addr)) @@ -17394,19 +17394,19 @@ virDomainControllerFindByPCIAddress(virDomainDefPtr def, return -1; } -virDomainControllerDefPtr -virDomainControllerRemove(virDomainDefPtr def, size_t i) +virDomainControllerDef * +virDomainControllerRemove(virDomainDef *def, size_t i) { - virDomainControllerDefPtr controller = def->controllers[i]; + virDomainControllerDef *controller = def->controllers[i]; VIR_DELETE_ELEMENT(def->controllers, i, def->ncontrollers); return controller; } -int virDomainLeaseIndex(virDomainDefPtr def, - virDomainLeaseDefPtr lease) +int virDomainLeaseIndex(virDomainDef *def, + virDomainLeaseDef *lease) { - virDomainLeaseDefPtr vlease; + virDomainLeaseDef *vlease; size_t i; for (i = 0; i < def->nleases; i++) { @@ -17427,20 +17427,20 @@ int virDomainLeaseIndex(virDomainDefPtr def, } -void virDomainLeaseInsertPreAlloc(virDomainDefPtr def) +void virDomainLeaseInsertPreAlloc(virDomainDef *def) { - def->leases = g_renew(virDomainLeaseDefPtr, def->leases, def->nleases + 1); + def->leases = g_renew(virDomainLeaseDef *, def->leases, def->nleases + 1); } -void virDomainLeaseInsert(virDomainDefPtr def, virDomainLeaseDefPtr lease) +void virDomainLeaseInsert(virDomainDef *def, virDomainLeaseDef *lease) { virDomainLeaseInsertPreAlloc(def); virDomainLeaseInsertPreAlloced(def, lease); } -void virDomainLeaseInsertPreAlloced(virDomainDefPtr def, - virDomainLeaseDefPtr lease) +void virDomainLeaseInsertPreAlloced(virDomainDef *def, + virDomainLeaseDef *lease) { if (lease == NULL) VIR_SHRINK_N(def->leases, def->nleases, 1); @@ -17449,19 +17449,19 @@ void virDomainLeaseInsertPreAlloced(virDomainDefPtr def, } -virDomainLeaseDefPtr -virDomainLeaseRemoveAt(virDomainDefPtr def, size_t i) +virDomainLeaseDef * +virDomainLeaseRemoveAt(virDomainDef *def, size_t i) { - virDomainLeaseDefPtr lease = def->leases[i]; + virDomainLeaseDef *lease = def->leases[i]; VIR_DELETE_ELEMENT(def->leases, i, def->nleases); return lease; } -virDomainLeaseDefPtr -virDomainLeaseRemove(virDomainDefPtr def, - virDomainLeaseDefPtr lease) +virDomainLeaseDef * +virDomainLeaseRemove(virDomainDef *def, + virDomainLeaseDef *lease) { int idx = virDomainLeaseIndex(def, lease); if (idx < 0) @@ -17470,8 +17470,8 @@ virDomainLeaseRemove(virDomainDefPtr def, } bool -virDomainChrEquals(virDomainChrDefPtr src, - virDomainChrDefPtr tgt) +virDomainChrEquals(virDomainChrDef *src, + virDomainChrDef *tgt) { if (!src || !tgt) return src == tgt; @@ -17517,11 +17517,11 @@ virDomainChrEquals(virDomainChrDefPtr src, return false; } -virDomainChrDefPtr -virDomainChrFind(virDomainDefPtr def, - virDomainChrDefPtr target) +virDomainChrDef * +virDomainChrFind(virDomainDef *def, + virDomainChrDef *target) { - virDomainChrDefPtr chr; + virDomainChrDef *chr; const virDomainChrDef **arrPtr; size_t i, cnt; @@ -17529,7 +17529,7 @@ virDomainChrFind(virDomainDefPtr def, for (i = 0; i < cnt; i++) { /* Cast away const */ - chr = (virDomainChrDefPtr) arrPtr[i]; + chr = (virDomainChrDef *) arrPtr[i]; if (virDomainChrEquals(chr, target)) return chr; } @@ -17540,9 +17540,9 @@ virDomainChrFind(virDomainDefPtr def, /* Return the address within vmdef to be modified when working with a * chrdefptr of the given type. */ static int G_GNUC_WARN_UNUSED_RESULT -virDomainChrGetDomainPtrsInternal(virDomainDefPtr vmdef, +virDomainChrGetDomainPtrsInternal(virDomainDef *vmdef, virDomainChrDeviceType type, - virDomainChrDefPtr ***arrPtr, + virDomainChrDef ****arrPtr, size_t **cntPtr) { switch (type) { @@ -17588,7 +17588,7 @@ virDomainChrGetDomainPtrs(const virDomainDef *vmdef, size_t *cntVar = NULL; /* Cast away const; we add it back in the final assignment. */ - if (virDomainChrGetDomainPtrsInternal((virDomainDefPtr) vmdef, type, + if (virDomainChrGetDomainPtrsInternal((virDomainDef *) vmdef, type, &arrVar, &cntVar) < 0) { *arrPtr = NULL; *cntPtr = 0; @@ -17600,10 +17600,10 @@ virDomainChrGetDomainPtrs(const virDomainDef *vmdef, int -virDomainChrPreAlloc(virDomainDefPtr vmdef, - virDomainChrDefPtr chr) +virDomainChrPreAlloc(virDomainDef *vmdef, + virDomainChrDef *chr) { - virDomainChrDefPtr **arrPtr = NULL; + virDomainChrDef ***arrPtr = NULL; size_t *cntPtr = NULL; if (virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType, @@ -17615,10 +17615,10 @@ virDomainChrPreAlloc(virDomainDefPtr vmdef, } void -virDomainChrInsertPreAlloced(virDomainDefPtr vmdef, - virDomainChrDefPtr chr) +virDomainChrInsertPreAlloced(virDomainDef *vmdef, + virDomainChrDef *chr) { - virDomainChrDefPtr **arrPtr = NULL; + virDomainChrDef ***arrPtr = NULL; size_t *cntPtr = NULL; if (virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType, @@ -17628,12 +17628,12 @@ virDomainChrInsertPreAlloced(virDomainDefPtr vmdef, VIR_APPEND_ELEMENT_INPLACE(*arrPtr, *cntPtr, chr); } -virDomainChrDefPtr -virDomainChrRemove(virDomainDefPtr vmdef, - virDomainChrDefPtr chr) +virDomainChrDef * +virDomainChrRemove(virDomainDef *vmdef, + virDomainChrDef *chr) { - virDomainChrDefPtr ret = NULL; - virDomainChrDefPtr **arrPtr = NULL; + virDomainChrDef *ret = NULL; + virDomainChrDef ***arrPtr = NULL; size_t i, *cntPtr = NULL; if (virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType, @@ -17656,13 +17656,13 @@ virDomainChrRemove(virDomainDefPtr vmdef, ssize_t -virDomainRNGFind(virDomainDefPtr def, - virDomainRNGDefPtr rng) +virDomainRNGFind(virDomainDef *def, + virDomainRNGDef *rng) { size_t i; for (i = 0; i < def->nrngs; i++) { - virDomainRNGDefPtr tmp = def->rngs[i]; + virDomainRNGDef *tmp = def->rngs[i]; if (rng->model != tmp->model || rng->backend != tmp->backend) continue; @@ -17701,11 +17701,11 @@ virDomainRNGFind(virDomainDefPtr def, } -virDomainRNGDefPtr -virDomainRNGRemove(virDomainDefPtr def, +virDomainRNGDef * +virDomainRNGRemove(virDomainDef *def, size_t idx) { - virDomainRNGDefPtr ret = def->rngs[idx]; + virDomainRNGDef *ret = def->rngs[idx]; VIR_DELETE_ELEMENT(def->rngs, idx, def->nrngs); @@ -17714,14 +17714,14 @@ virDomainRNGRemove(virDomainDefPtr def, static int -virDomainMemoryFindByDefInternal(virDomainDefPtr def, - virDomainMemoryDefPtr mem, +virDomainMemoryFindByDefInternal(virDomainDef *def, + virDomainMemoryDef *mem, bool allowAddressFallback) { size_t i; for (i = 0; i < def->nmems; i++) { - virDomainMemoryDefPtr tmp = def->mems[i]; + virDomainMemoryDef *tmp = def->mems[i]; /* address, if present */ if (allowAddressFallback) { @@ -17780,16 +17780,16 @@ virDomainMemoryFindByDefInternal(virDomainDefPtr def, int -virDomainMemoryFindByDef(virDomainDefPtr def, - virDomainMemoryDefPtr mem) +virDomainMemoryFindByDef(virDomainDef *def, + virDomainMemoryDef *mem) { return virDomainMemoryFindByDefInternal(def, mem, false); } int -virDomainMemoryFindInactiveByDef(virDomainDefPtr def, - virDomainMemoryDefPtr mem) +virDomainMemoryFindInactiveByDef(virDomainDef *def, + virDomainMemoryDef *mem) { int ret; @@ -17808,8 +17808,8 @@ virDomainMemoryFindInactiveByDef(virDomainDefPtr def, * total memory size. */ int -virDomainMemoryInsert(virDomainDefPtr def, - virDomainMemoryDefPtr mem) +virDomainMemoryInsert(virDomainDef *def, + virDomainMemoryDef *mem) { unsigned long long memory = virDomainDefGetMemoryTotal(def); int id = def->nmems; @@ -17838,12 +17838,12 @@ virDomainMemoryInsert(virDomainDefPtr def, * should be used only in hot/cold-plug cases as it's blindly modifying the * total memory size. */ -virDomainMemoryDefPtr -virDomainMemoryRemove(virDomainDefPtr def, +virDomainMemoryDef * +virDomainMemoryRemove(virDomainDef *def, int idx) { unsigned long long memory = virDomainDefGetMemoryTotal(def); - virDomainMemoryDefPtr ret = def->mems[idx]; + virDomainMemoryDef *ret = def->mems[idx]; VIR_DELETE_ELEMENT(def->mems, idx, def->nmems); @@ -17855,13 +17855,13 @@ virDomainMemoryRemove(virDomainDefPtr def, ssize_t -virDomainRedirdevDefFind(virDomainDefPtr def, - virDomainRedirdevDefPtr redirdev) +virDomainRedirdevDefFind(virDomainDef *def, + virDomainRedirdevDef *redirdev) { size_t i; for (i = 0; i < def->nredirdevs; i++) { - virDomainRedirdevDefPtr tmp = def->redirdevs[i]; + virDomainRedirdevDef *tmp = def->redirdevs[i]; if (redirdev->bus != tmp->bus) continue; @@ -17884,10 +17884,10 @@ virDomainRedirdevDefFind(virDomainDefPtr def, } -virDomainRedirdevDefPtr -virDomainRedirdevDefRemove(virDomainDefPtr def, size_t idx) +virDomainRedirdevDef * +virDomainRedirdevDefRemove(virDomainDef *def, size_t idx) { - virDomainRedirdevDefPtr ret = def->redirdevs[idx]; + virDomainRedirdevDef *ret = def->redirdevs[idx]; VIR_DELETE_ELEMENT(def->redirdevs, idx, def->nredirdevs); @@ -17896,16 +17896,16 @@ virDomainRedirdevDefRemove(virDomainDefPtr def, size_t idx) int -virDomainShmemDefInsert(virDomainDefPtr def, - virDomainShmemDefPtr shmem) +virDomainShmemDefInsert(virDomainDef *def, + virDomainShmemDef *shmem) { return VIR_APPEND_ELEMENT(def->shmems, def->nshmems, shmem); } bool -virDomainShmemDefEquals(virDomainShmemDefPtr src, - virDomainShmemDefPtr dst) +virDomainShmemDefEquals(virDomainShmemDef *src, + virDomainShmemDef *dst) { if (STRNEQ_NULLABLE(src->name, dst->name)) return false; @@ -17947,8 +17947,8 @@ virDomainShmemDefEquals(virDomainShmemDefPtr src, ssize_t -virDomainShmemDefFind(virDomainDefPtr def, - virDomainShmemDefPtr shmem) +virDomainShmemDefFind(virDomainDef *def, + virDomainShmemDef *shmem) { size_t i; @@ -17961,11 +17961,11 @@ virDomainShmemDefFind(virDomainDefPtr def, } -virDomainShmemDefPtr -virDomainShmemDefRemove(virDomainDefPtr def, +virDomainShmemDef * +virDomainShmemDefRemove(virDomainDef *def, size_t idx) { - virDomainShmemDefPtr ret = def->shmems[idx]; + virDomainShmemDef *ret = def->shmems[idx]; VIR_DELETE_ELEMENT(def->shmems, idx, def->nshmems); @@ -18029,11 +18029,11 @@ virDomainVsockDefEquals(const virDomainVsockDef *a, char * -virDomainDefGetDefaultEmulator(virDomainDefPtr def, - virCapsPtr caps) +virDomainDefGetDefaultEmulator(virDomainDef *def, + virCaps *caps) { char *retemu; - g_autofree virCapsDomainDataPtr capsdata = NULL; + g_autofree virCapsDomainData *capsdata = NULL; if (!(capsdata = virCapabilitiesDomainDataLookup(caps, def->os.type, def->os.arch, def->virtType, NULL, NULL))) @@ -18046,7 +18046,7 @@ virDomainDefGetDefaultEmulator(virDomainDefPtr def, static int virDomainDefParseBootXML(xmlXPathContextPtr ctxt, - virDomainDefPtr def) + virDomainDef *def) { xmlNodePtr node; size_t i; @@ -18148,13 +18148,13 @@ static int virDomainIdMapEntrySort(const void *a, const void *b) * * */ -static virDomainIdMapEntryPtr +static virDomainIdMapEntry * virDomainIdmapDefParseXML(xmlXPathContextPtr ctxt, xmlNodePtr *node, size_t num) { size_t i; - virDomainIdMapEntryPtr idmap = NULL; + virDomainIdMapEntry *idmap = NULL; VIR_XPATH_NODE_AUTORESTORE(ctxt) idmap = g_new0(virDomainIdMapEntry, num); @@ -18188,10 +18188,10 @@ virDomainIdmapDefParseXML(xmlXPathContextPtr ctxt, * * */ -static virDomainIOThreadIDDefPtr +static virDomainIOThreadIDDef * virDomainIOThreadIDDefParseXML(xmlNodePtr node) { - virDomainIOThreadIDDefPtr iothrid; + virDomainIOThreadIDDef *iothrid; g_autofree char *tmp = NULL; iothrid = g_new0(virDomainIOThreadIDDef, 1); @@ -18218,7 +18218,7 @@ virDomainIOThreadIDDefParseXML(xmlNodePtr node) static int -virDomainDefParseIOThreads(virDomainDefPtr def, +virDomainDefParseIOThreads(virDomainDef *def, xmlXPathContextPtr ctxt) { size_t i; @@ -18242,10 +18242,10 @@ virDomainDefParseIOThreads(virDomainDefPtr def, iothreads = n; if (n) - def->iothreadids = g_new0(virDomainIOThreadIDDefPtr, n); + def->iothreadids = g_new0(virDomainIOThreadIDDef *, n); for (i = 0; i < n; i++) { - virDomainIOThreadIDDefPtr iothrid = NULL; + virDomainIOThreadIDDef *iothrid = NULL; if (!(iothrid = virDomainIOThreadIDDefParseXML(nodes[i]))) return -1; @@ -18269,10 +18269,10 @@ virDomainDefParseIOThreads(virDomainDefPtr def, * */ static int -virDomainVcpuPinDefParseXML(virDomainDefPtr def, +virDomainVcpuPinDefParseXML(virDomainDef *def, xmlNodePtr node) { - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; unsigned int vcpuid; g_autofree char *tmp = NULL; @@ -18324,9 +18324,9 @@ virDomainVcpuPinDefParseXML(virDomainDefPtr def, */ static int virDomainIOThreadPinDefParseXML(xmlNodePtr node, - virDomainDefPtr def) + virDomainDef *def) { - virDomainIOThreadIDDefPtr iothrid; + virDomainIOThreadIDDef *iothrid; unsigned int iothreadid; g_autofree char *tmp = NULL; g_autoptr(virBitmap) cpumask = NULL; @@ -18389,7 +18389,7 @@ virDomainIOThreadPinDefParseXML(xmlNodePtr node, * emulatorpin has the form of * */ -static virBitmapPtr +static virBitmap * virDomainEmulatorPinDefParseXML(xmlNodePtr node) { g_autofree char *tmp = NULL; @@ -18414,10 +18414,10 @@ virDomainEmulatorPinDefParseXML(xmlNodePtr node) } -virDomainControllerDefPtr -virDomainDefAddController(virDomainDefPtr def, int type, int idx, int model) +virDomainControllerDef * +virDomainDefAddController(virDomainDef *def, int type, int idx, int model) { - virDomainControllerDefPtr cont; + virDomainControllerDef *cont; if (!(cont = virDomainControllerDefNew(type))) return NULL; @@ -18451,9 +18451,9 @@ virDomainDefAddController(virDomainDefPtr def, int type, int idx, int model) * Returns 0 on success, -1 on failure. */ int -virDomainDefAddUSBController(virDomainDefPtr def, int idx, int model) +virDomainDefAddUSBController(virDomainDef *def, int idx, int model) { - virDomainControllerDefPtr cont; /* this is a *copy* of the DefPtr */ + virDomainControllerDef *cont; /* this is a *copy* of the virDomainControllerDef */ cont = virDomainDefAddController(def, VIR_DOMAIN_CONTROLLER_TYPE_USB, idx, model); @@ -18492,7 +18492,7 @@ virDomainDefAddUSBController(virDomainDefPtr def, int idx, int model) int -virDomainDefMaybeAddController(virDomainDefPtr def, +virDomainDefMaybeAddController(virDomainDef *def, int type, int idx, int model) @@ -18510,12 +18510,12 @@ virDomainDefMaybeAddController(virDomainDefPtr def, int -virDomainDefMaybeAddInput(virDomainDefPtr def, +virDomainDefMaybeAddInput(virDomainDef *def, int type, int bus) { size_t i; - virDomainInputDefPtr input; + virDomainInputDef *input; for (i = 0; i < def->ninputs; i++) { if (def->inputs[i]->type == type && @@ -18540,7 +18540,7 @@ virDomainDefMaybeAddInput(virDomainDefPtr def, static int virDomainHugepagesParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virDomainHugePagePtr hugepage) + virDomainHugePage *hugepage) { VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree char *nodeset = NULL; @@ -18573,12 +18573,12 @@ virDomainHugepagesParseXML(xmlNodePtr node, } -static virDomainResourceDefPtr +static virDomainResourceDef * virDomainResourceDefParse(xmlNodePtr node, xmlXPathContextPtr ctxt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virDomainResourceDefPtr def = NULL; + virDomainResourceDef *def = NULL; ctxt->node = node; @@ -18600,7 +18600,7 @@ virDomainResourceDefParse(xmlNodePtr node, static int -virDomainFeaturesDefParse(virDomainDefPtr def, +virDomainFeaturesDefParse(virDomainDef *def, xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodes = NULL; @@ -19126,19 +19126,19 @@ virDomainFeaturesDefParse(virDomainDefPtr def, static int -virDomainDefMaybeAddHostdevSCSIcontroller(virDomainDefPtr def) +virDomainDefMaybeAddHostdevSCSIcontroller(virDomainDef *def) { /* Look for any hostdev scsi dev */ size_t i; int maxController = -1; - virDomainHostdevDefPtr hostdev; + virDomainHostdevDef *hostdev; int newModel = -1; for (i = 0; i < def->nhostdevs; i++) { hostdev = def->hostdevs[i]; if (virHostdevIsSCSIDevice(hostdev) && (int)hostdev->info->addr.drive.controller > maxController) { - virDomainControllerDefPtr cont; + virDomainControllerDef *cont; maxController = hostdev->info->addr.drive.controller; /* We may be creating a new controller because this one is full. @@ -19165,7 +19165,7 @@ virDomainDefMaybeAddHostdevSCSIcontroller(virDomainDefPtr def) static int virDomainLoaderDefParseXML(xmlNodePtr node, - virDomainLoaderDefPtr loader, + virDomainLoaderDef *loader, bool fwAutoSelect) { g_autofree char *readonly_str = NULL; @@ -19256,9 +19256,9 @@ virDomainSchedulerParseCommonAttrs(xmlNodePtr node, static int virDomainEmulatorSchedParse(xmlNodePtr node, - virDomainDefPtr def) + virDomainDef *def) { - g_autofree virDomainThreadSchedParamPtr sched = NULL; + g_autofree virDomainThreadSchedParam *sched = NULL; sched = g_new0(virDomainThreadSchedParam, 1); @@ -19272,14 +19272,14 @@ virDomainEmulatorSchedParse(xmlNodePtr node, } -static virBitmapPtr +static virBitmap * virDomainSchedulerParse(xmlNodePtr node, const char *elementName, const char *attributeName, virProcessSchedPolicy *policy, int *priority) { - virBitmapPtr ret = NULL; + virBitmap *ret = NULL; g_autofree char *tmp = NULL; if (!(tmp = virXMLPropString(node, attributeName))) { @@ -19314,11 +19314,11 @@ static int virDomainThreadSchedParseHelper(xmlNodePtr node, const char *elementName, const char *attributeName, - virDomainThreadSchedParamPtr (*func)(virDomainDefPtr, unsigned int), - virDomainDefPtr def) + virDomainThreadSchedParam *(*func)(virDomainDef *, unsigned int), + virDomainDef *def) { ssize_t next = -1; - virDomainThreadSchedParamPtr sched = NULL; + virDomainThreadSchedParam *sched = NULL; virProcessSchedPolicy policy = 0; int priority = 0; g_autoptr(virBitmap) map = NULL; @@ -19348,7 +19348,7 @@ virDomainThreadSchedParseHelper(xmlNodePtr node, static int virDomainVcpuThreadSchedParse(xmlNodePtr node, - virDomainDefPtr def) + virDomainDef *def) { return virDomainThreadSchedParseHelper(node, "vcpusched", @@ -19358,11 +19358,11 @@ virDomainVcpuThreadSchedParse(xmlNodePtr node, } -static virDomainThreadSchedParamPtr -virDomainDefGetIOThreadSched(virDomainDefPtr def, +static virDomainThreadSchedParam * +virDomainDefGetIOThreadSched(virDomainDef *def, unsigned int iothread) { - virDomainIOThreadIDDefPtr iothrinfo; + virDomainIOThreadIDDef *iothrinfo; if (!(iothrinfo = virDomainIOThreadIDFind(def, iothread))) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -19377,7 +19377,7 @@ virDomainDefGetIOThreadSched(virDomainDefPtr def, static int virDomainIOThreadSchedParse(xmlNodePtr node, - virDomainDefPtr def) + virDomainDef *def) { return virDomainThreadSchedParseHelper(node, "iothreadsched", @@ -19388,9 +19388,9 @@ virDomainIOThreadSchedParse(xmlNodePtr node, static int -virDomainVcpuParse(virDomainDefPtr def, +virDomainVcpuParse(virDomainDef *def, xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { int n; xmlNodePtr vcpuNode; @@ -19466,7 +19466,7 @@ virDomainVcpuParse(virDomainDefPtr def, def->individualvcpus = true; for (i = 0; i < n; i++) { - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; int state; unsigned int id; unsigned int order; @@ -19535,7 +19535,7 @@ virDomainVcpuParse(virDomainDefPtr def, static int -virDomainDefParseBootInitOptions(virDomainDefPtr def, +virDomainDefParseBootInitOptions(virDomainDef *def, xmlXPathContextPtr ctxt) { char *name = NULL; @@ -19568,7 +19568,7 @@ virDomainDefParseBootInitOptions(virDomainDefPtr def, if ((n = virXPathNodeSet("./os/initenv", ctxt, &nodes)) < 0) return -1; - def->os.initenv = g_new0(virDomainOSEnvPtr, n+1); + def->os.initenv = g_new0(virDomainOSEnv *, n + 1); for (i = 0; i < n; i++) { if (!(name = virXMLPropString(nodes[i], "name"))) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -19595,7 +19595,7 @@ virDomainDefParseBootInitOptions(virDomainDefPtr def, static void -virDomainDefParseBootKernelOptions(virDomainDefPtr def, +virDomainDefParseBootKernelOptions(virDomainDef *def, xmlXPathContextPtr ctxt) { def->os.kernel = virXPathString("string(./os/kernel[1])", ctxt); @@ -19607,7 +19607,7 @@ virDomainDefParseBootKernelOptions(virDomainDefPtr def, static int -virDomainDefParseBootFirmwareOptions(virDomainDefPtr def, +virDomainDefParseBootFirmwareOptions(virDomainDef *def, xmlXPathContextPtr ctxt) { g_autofree char *firmware = virXPathString("string(./os/@firmware)", ctxt); @@ -19667,7 +19667,7 @@ virDomainDefParseBootFirmwareOptions(virDomainDefPtr def, static int -virDomainDefParseBootLoaderOptions(virDomainDefPtr def, +virDomainDefParseBootLoaderOptions(virDomainDef *def, xmlXPathContextPtr ctxt) { xmlNodePtr loader_node = virXPathNode("./os/loader[1]", ctxt); @@ -19692,7 +19692,7 @@ virDomainDefParseBootLoaderOptions(virDomainDefPtr def, static int -virDomainDefParseBootAcpiOptions(virDomainDefPtr def, +virDomainDefParseBootAcpiOptions(virDomainDef *def, xmlXPathContextPtr ctxt) { int n; @@ -19736,7 +19736,7 @@ virDomainDefParseBootAcpiOptions(virDomainDefPtr def, static int -virDomainDefParseBootOptions(virDomainDefPtr def, +virDomainDefParseBootOptions(virDomainDef *def, xmlXPathContextPtr ctxt) { /* @@ -19792,9 +19792,9 @@ virDomainDefParseBootOptions(virDomainDefPtr def, static int -virDomainResctrlParseVcpus(virDomainDefPtr def, +virDomainResctrlParseVcpus(virDomainDef *def, xmlNodePtr node, - virBitmapPtr *vcpus) + virBitmap **vcpus) { g_autofree char *vcpus_str = NULL; @@ -19820,9 +19820,9 @@ virDomainResctrlParseVcpus(virDomainDefPtr def, static int -virDomainResctrlVcpuMatch(virDomainDefPtr def, - virBitmapPtr vcpus, - virDomainResctrlDefPtr *resctrl) +virDomainResctrlVcpuMatch(virDomainDef *def, + virBitmap *vcpus, + virDomainResctrlDef **resctrl) { ssize_t i = 0; @@ -19847,7 +19847,7 @@ virDomainResctrlVcpuMatch(virDomainDefPtr def, static int virDomainCachetuneDefParseCache(xmlXPathContextPtr ctxt, xmlNodePtr node, - virResctrlAllocPtr alloc) + virResctrlAlloc *alloc) { VIR_XPATH_NODE_AUTORESTORE(ctxt) unsigned int level; @@ -19921,8 +19921,8 @@ virDomainCachetuneDefParseCache(xmlXPathContextPtr ctxt, * not equal to @resctrl->vcpus. */ static int -virDomainResctrlValidateMonitor(virDomainResctrlDefPtr resctrl, - virDomainResctrlMonDefPtr monitor) +virDomainResctrlValidateMonitor(virDomainResctrlDef *resctrl, + virDomainResctrlMonDef *monitor) { size_t i = 0; int vcpu = -1; @@ -19986,13 +19986,13 @@ virDomainResctrlValidateMonitor(virDomainResctrlDefPtr resctrl, #define VIR_DOMAIN_RESCTRL_MONITOR_CACHELEVEL 3 static int -virDomainResctrlMonDefParse(virDomainDefPtr def, +virDomainResctrlMonDefParse(virDomainDef *def, xmlXPathContextPtr ctxt, xmlNodePtr node, virResctrlMonitorType tag, - virDomainResctrlDefPtr resctrl) + virDomainResctrlDef *resctrl) { - virDomainResctrlMonDefPtr domresmon = NULL; + virDomainResctrlMonDef *domresmon = NULL; VIR_XPATH_NODE_AUTORESTORE(ctxt) unsigned int level = 0; size_t i = 0; @@ -20090,13 +20090,13 @@ virDomainResctrlMonDefParse(virDomainDefPtr def, } -static virDomainResctrlDefPtr +static virDomainResctrlDef * virDomainResctrlNew(xmlNodePtr node, - virResctrlAllocPtr alloc, - virBitmapPtr vcpus, + virResctrlAlloc *alloc, + virBitmap *vcpus, unsigned int flags) { - virDomainResctrlDefPtr resctrl = NULL; + virDomainResctrlDef *resctrl = NULL; g_autofree char *vcpus_str = NULL; g_autofree char *alloc_id = NULL; @@ -20130,13 +20130,13 @@ virDomainResctrlNew(xmlNodePtr node, static int -virDomainCachetuneDefParse(virDomainDefPtr def, +virDomainCachetuneDefParse(virDomainDef *def, xmlXPathContextPtr ctxt, xmlNodePtr node, unsigned int flags) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virDomainResctrlDefPtr resctrl = NULL; + virDomainResctrlDef *resctrl = NULL; ssize_t i = 0; int n; int ret = -1; @@ -20201,7 +20201,7 @@ virDomainCachetuneDefParse(virDomainDefPtr def, static int -virDomainDefParseIDs(virDomainDefPtr def, +virDomainDefParseIDs(virDomainDef *def, xmlXPathContextPtr ctxt, unsigned int flags, bool *uuid_generated) @@ -20278,9 +20278,9 @@ virDomainDefParseIDs(virDomainDefPtr def, static int -virDomainDefParseCaps(virDomainDefPtr def, +virDomainDefParseCaps(virDomainDef *def, xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { g_autofree char *virttype = NULL; g_autofree char *arch = NULL; @@ -20350,7 +20350,7 @@ virDomainDefParseCaps(virDomainDefPtr def, static int -virDomainDefParseMemory(virDomainDefPtr def, +virDomainDefParseMemory(virDomainDef *def, xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodes = NULL; @@ -20462,7 +20462,7 @@ virDomainDefParseMemory(virDomainDefPtr def, static int virDomainMemorytuneDefParseMemory(xmlXPathContextPtr ctxt, xmlNodePtr node, - virResctrlAllocPtr alloc) + virResctrlAlloc *alloc) { VIR_XPATH_NODE_AUTORESTORE(ctxt) unsigned int id; @@ -20505,14 +20505,14 @@ virDomainMemorytuneDefParseMemory(xmlXPathContextPtr ctxt, static int -virDomainMemorytuneDefParse(virDomainDefPtr def, +virDomainMemorytuneDefParse(virDomainDef *def, xmlXPathContextPtr ctxt, xmlNodePtr node, unsigned int flags) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virDomainResctrlDefPtr resctrl = NULL; - virDomainResctrlDefPtr newresctrl = NULL; + virDomainResctrlDef *resctrl = NULL; + virDomainResctrlDef *newresctrl = NULL; g_autoptr(virBitmap) vcpus = NULL; g_autofree xmlNodePtr *nodes = NULL; g_autoptr(virResctrlAlloc) alloc = NULL; @@ -20588,9 +20588,9 @@ virDomainMemorytuneDefParse(virDomainDefPtr def, static int -virDomainDefTunablesParse(virDomainDefPtr def, +virDomainDefTunablesParse(virDomainDef *def, xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags) { g_autofree xmlNodePtr *nodes = NULL; @@ -20819,7 +20819,7 @@ virDomainDefTunablesParse(virDomainDefPtr def, static int -virDomainDefLifecycleParse(virDomainDefPtr def, +virDomainDefLifecycleParse(virDomainDef *def, xmlXPathContextPtr ctxt) { if (virDomainEventActionParseXML(ctxt, "on_reboot", @@ -20868,7 +20868,7 @@ virDomainDefLifecycleParse(virDomainDefPtr def, static int -virDomainDefClockParse(virDomainDefPtr def, +virDomainDefClockParse(virDomainDef *def, xmlXPathContextPtr ctxt) { size_t i; @@ -20949,11 +20949,11 @@ virDomainDefClockParse(virDomainDefPtr def, goto error; if (n) - def->clock.timers = g_new0(virDomainTimerDefPtr, n); + def->clock.timers = g_new0(virDomainTimerDef *, n); for (i = 0; i < n; i++) { - virDomainTimerDefPtr timer = virDomainTimerDefParseXML(nodes[i], - ctxt); + virDomainTimerDef *timer = virDomainTimerDefParseXML(nodes[i], ctxt); + if (!timer) goto error; @@ -20968,9 +20968,9 @@ virDomainDefClockParse(virDomainDefPtr def, } static int -virDomainDefControllersParse(virDomainDefPtr def, +virDomainDefControllersParse(virDomainDef *def, xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags, bool *usb_none) { @@ -20984,7 +20984,7 @@ virDomainDefControllersParse(virDomainDefPtr def, return -1; if (n) - def->controllers = g_new0(virDomainControllerDefPtr, n); + def->controllers = g_new0(virDomainControllerDef *, n); for (i = 0; i < n; i++) { g_autoptr(virDomainControllerDef) controller = NULL; @@ -21031,16 +21031,16 @@ virDomainDefControllersParse(virDomainDefPtr def, return 0; } -static virDomainDefPtr +static virDomainDef * virDomainDefParseXML(xmlDocPtr xml, xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags) { xmlNodePtr node = NULL; size_t i, j; int n; - virDomainDefPtr def; + virDomainDef *def; bool uuid_generated = false; bool usb_none = false; g_autofree xmlNodePtr *nodes = NULL; @@ -21160,13 +21160,13 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; if (n) - def->disks = g_new0(virDomainDiskDefPtr, n); + def->disks = g_new0(virDomainDiskDef *, n); for (i = 0; i < n; i++) { - virDomainDiskDefPtr disk = virDomainDiskDefParseXML(xmlopt, - nodes[i], - ctxt, - flags); + virDomainDiskDef *disk = virDomainDiskDefParseXML(xmlopt, + nodes[i], + ctxt, + flags); if (!disk) goto error; @@ -21184,9 +21184,9 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; } if (n) - def->leases = g_new0(virDomainLeaseDefPtr, n); + def->leases = g_new0(virDomainLeaseDef *, n); for (i = 0; i < n; i++) { - virDomainLeaseDefPtr lease = virDomainLeaseDefParseXML(nodes[i]); + virDomainLeaseDef *lease = virDomainLeaseDefParseXML(nodes[i]); if (!lease) goto error; @@ -21198,12 +21198,12 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/filesystem", ctxt, &nodes)) < 0) goto error; if (n) - def->fss = g_new0(virDomainFSDefPtr, n); + def->fss = g_new0(virDomainFSDef *, n); for (i = 0; i < n; i++) { - virDomainFSDefPtr fs = virDomainFSDefParseXML(xmlopt, - nodes[i], - ctxt, - flags); + virDomainFSDef *fs = virDomainFSDefParseXML(xmlopt, + nodes[i], + ctxt, + flags); if (!fs) goto error; @@ -21215,12 +21215,12 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/interface", ctxt, &nodes)) < 0) goto error; if (n) - def->nets = g_new0(virDomainNetDefPtr, n); + def->nets = g_new0(virDomainNetDef *, n); for (i = 0; i < n; i++) { - virDomainNetDefPtr net = virDomainNetDefParseXML(xmlopt, - nodes[i], - ctxt, - flags); + virDomainNetDef *net = virDomainNetDefParseXML(xmlopt, + nodes[i], + ctxt, + flags); if (!net) goto error; @@ -21242,13 +21242,13 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/smartcard", ctxt, &nodes)) < 0) goto error; if (n) - def->smartcards = g_new0(virDomainSmartcardDefPtr, n); + def->smartcards = g_new0(virDomainSmartcardDef *, n); for (i = 0; i < n; i++) { - virDomainSmartcardDefPtr card = virDomainSmartcardDefParseXML(xmlopt, - nodes[i], - ctxt, - flags); + virDomainSmartcardDef *card = virDomainSmartcardDefParseXML(xmlopt, + nodes[i], + ctxt, + flags); if (!card) goto error; @@ -21261,13 +21261,13 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/parallel", ctxt, &nodes)) < 0) goto error; if (n) - def->parallels = g_new0(virDomainChrDefPtr, n); + def->parallels = g_new0(virDomainChrDef *, n); for (i = 0; i < n; i++) { - virDomainChrDefPtr chr = virDomainChrDefParseXML(xmlopt, - ctxt, - nodes[i], - flags); + virDomainChrDef *chr = virDomainChrDefParseXML(xmlopt, + ctxt, + nodes[i], + flags); if (!chr) goto error; @@ -21287,13 +21287,13 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; if (n) - def->serials = g_new0(virDomainChrDefPtr, n); + def->serials = g_new0(virDomainChrDef *, n); for (i = 0; i < n; i++) { - virDomainChrDefPtr chr = virDomainChrDefParseXML(xmlopt, - ctxt, - nodes[i], - flags); + virDomainChrDef *chr = virDomainChrDefParseXML(xmlopt, + ctxt, + nodes[i], + flags); if (!chr) goto error; @@ -21315,13 +21315,13 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; } if (n) - def->consoles = g_new0(virDomainChrDefPtr, n); + def->consoles = g_new0(virDomainChrDef *, n); for (i = 0; i < n; i++) { - virDomainChrDefPtr chr = virDomainChrDefParseXML(xmlopt, - ctxt, - nodes[i], - flags); + virDomainChrDef *chr = virDomainChrDefParseXML(xmlopt, + ctxt, + nodes[i], + flags); if (!chr) goto error; @@ -21333,13 +21333,13 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/channel", ctxt, &nodes)) < 0) goto error; if (n) - def->channels = g_new0(virDomainChrDefPtr, n); + def->channels = g_new0(virDomainChrDef *, n); for (i = 0; i < n; i++) { - virDomainChrDefPtr chr = virDomainChrDefParseXML(xmlopt, - ctxt, - nodes[i], - flags); + virDomainChrDef *chr = virDomainChrDefParseXML(xmlopt, + ctxt, + nodes[i], + flags); if (!chr) goto error; @@ -21352,14 +21352,14 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/input", ctxt, &nodes)) < 0) goto error; if (n) - def->inputs = g_new0(virDomainInputDefPtr, n); + def->inputs = g_new0(virDomainInputDef *, n); for (i = 0; i < n; i++) { - virDomainInputDefPtr input = virDomainInputDefParseXML(xmlopt, - def, - nodes[i], - ctxt, - flags); + virDomainInputDef *input = virDomainInputDefParseXML(xmlopt, + def, + nodes[i], + ctxt, + flags); if (!input) goto error; @@ -21380,12 +21380,12 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/graphics", ctxt, &nodes)) < 0) goto error; if (n) - def->graphics = g_new0(virDomainGraphicsDefPtr, n); + def->graphics = g_new0(virDomainGraphicsDef *, n); for (i = 0; i < n; i++) { - virDomainGraphicsDefPtr graphics = virDomainGraphicsDefParseXML(xmlopt, - nodes[i], - ctxt, - flags); + virDomainGraphicsDef *graphics = virDomainGraphicsDefParseXML(xmlopt, + nodes[i], + ctxt, + flags); if (!graphics) goto error; @@ -21397,12 +21397,12 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/sound", ctxt, &nodes)) < 0) goto error; if (n) - def->sounds = g_new0(virDomainSoundDefPtr, n); + def->sounds = g_new0(virDomainSoundDef *, n); for (i = 0; i < n; i++) { - virDomainSoundDefPtr sound = virDomainSoundDefParseXML(xmlopt, - nodes[i], - ctxt, - flags); + virDomainSoundDef *sound = virDomainSoundDefParseXML(xmlopt, + nodes[i], + ctxt, + flags); if (!sound) goto error; @@ -21414,11 +21414,11 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/audio", ctxt, &nodes)) < 0) goto error; if (n) - def->audios = g_new0(virDomainAudioDefPtr, n); + def->audios = g_new0(virDomainAudioDef *, n); for (i = 0; i < n; i++) { - virDomainAudioDefPtr audio = virDomainAudioDefParseXML(xmlopt, - nodes[i], - ctxt); + virDomainAudioDef *audio = virDomainAudioDefParseXML(xmlopt, + nodes[i], + ctxt); if (!audio) goto error; @@ -21430,7 +21430,7 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/video", ctxt, &nodes)) < 0) goto error; if (n) - def->videos = g_new0(virDomainVideoDefPtr, n); + def->videos = g_new0(virDomainVideoDef *, n); for (i = 0; i < n; i++) { g_autoptr(virDomainVideoDef) video = NULL; ssize_t insertAt = -1; @@ -21460,7 +21460,7 @@ virDomainDefParseXML(xmlDocPtr xml, VIR_REALLOC_N(def->hostdevs, def->nhostdevs + n); for (i = 0; i < n; i++) { - virDomainHostdevDefPtr hostdev; + virDomainHostdevDef *hostdev; hostdev = virDomainHostdevDefParseXML(xmlopt, nodes[i], ctxt, flags); @@ -21499,7 +21499,7 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; } if (n > 0) { - virDomainWatchdogDefPtr watchdog; + virDomainWatchdogDef *watchdog; watchdog = virDomainWatchdogDefParseXML(xmlopt, nodes[0], ctxt, flags); if (!watchdog) @@ -21519,7 +21519,7 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; } if (n > 0) { - virDomainMemballoonDefPtr memballoon; + virDomainMemballoonDef *memballoon; memballoon = virDomainMemballoonDefParseXML(xmlopt, nodes[0], ctxt, flags); if (!memballoon) @@ -21533,10 +21533,10 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/rng", ctxt, &nodes)) < 0) goto error; if (n) - def->rngs = g_new0(virDomainRNGDefPtr, n); + def->rngs = g_new0(virDomainRNGDef *, n); for (i = 0; i < n; i++) { - virDomainRNGDefPtr rng = virDomainRNGDefParseXML(xmlopt, nodes[i], - ctxt, flags); + virDomainRNGDef *rng = virDomainRNGDefParseXML(xmlopt, nodes[i], + ctxt, flags); if (!rng) goto error; @@ -21556,11 +21556,11 @@ virDomainDefParseXML(xmlDocPtr xml, } if (n) - def->tpms = g_new0(virDomainTPMDefPtr, n); + def->tpms = g_new0(virDomainTPMDef *, n); for (i = 0; i < n; i++) { - virDomainTPMDefPtr tpm = virDomainTPMDefParseXML(xmlopt, nodes[i], - ctxt, flags); + virDomainTPMDef *tpm = virDomainTPMDefParseXML(xmlopt, nodes[i], + ctxt, flags); if (!tpm) goto error; @@ -21576,7 +21576,7 @@ virDomainDefParseXML(xmlDocPtr xml, _("only a single nvram device is supported")); goto error; } else if (n == 1) { - virDomainNVRAMDefPtr nvram = + virDomainNVRAMDef *nvram = virDomainNVRAMDefParseXML(xmlopt, nodes[0], ctxt, flags); if (!nvram) goto error; @@ -21588,9 +21588,9 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/hub", ctxt, &nodes)) < 0) goto error; if (n) - def->hubs = g_new0(virDomainHubDefPtr, n); + def->hubs = g_new0(virDomainHubDef *, n); for (i = 0; i < n; i++) { - virDomainHubDefPtr hub; + virDomainHubDef *hub; hub = virDomainHubDefParseXML(xmlopt, nodes[i], ctxt, flags); if (!hub) @@ -21612,9 +21612,9 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/redirdev", ctxt, &nodes)) < 0) goto error; if (n) - def->redirdevs = g_new0(virDomainRedirdevDefPtr, n); + def->redirdevs = g_new0(virDomainRedirdevDef *, n); for (i = 0; i < n; i++) { - virDomainRedirdevDefPtr redirdev = + virDomainRedirdevDef *redirdev = virDomainRedirdevDefParseXML(xmlopt, nodes[i], ctxt, flags); if (!redirdev) goto error; @@ -21633,7 +21633,7 @@ virDomainDefParseXML(xmlDocPtr xml, } if (n) { - virDomainRedirFilterDefPtr redirfilter = + virDomainRedirFilterDef *redirfilter = virDomainRedirFilterDefParseXML(nodes[0], ctxt); if (!redirfilter) goto error; @@ -21646,9 +21646,9 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/panic", ctxt, &nodes)) < 0) goto error; if (n) - def->panics = g_new0(virDomainPanicDefPtr, n); + def->panics = g_new0(virDomainPanicDef *, n); for (i = 0; i < n; i++) { - virDomainPanicDefPtr panic; + virDomainPanicDef *panic; panic = virDomainPanicDefParseXML(xmlopt, nodes[i], ctxt, flags); if (!panic) @@ -21662,11 +21662,11 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/shmem", ctxt, &nodes)) < 0) goto error; if (n) - def->shmems = g_new0(virDomainShmemDefPtr, n); + def->shmems = g_new0(virDomainShmemDef *, n); node = ctxt->node; for (i = 0; i < n; i++) { - virDomainShmemDefPtr shmem; + virDomainShmemDef *shmem; ctxt->node = nodes[i]; shmem = virDomainShmemDefParseXML(xmlopt, nodes[i], ctxt, flags); if (!shmem) @@ -21688,13 +21688,13 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./devices/memory", ctxt, &nodes)) < 0) goto error; if (n) - def->mems = g_new0(virDomainMemoryDefPtr, n); + def->mems = g_new0(virDomainMemoryDef *, n); for (i = 0; i < n; i++) { - virDomainMemoryDefPtr mem = virDomainMemoryDefParseXML(xmlopt, - nodes[i], - ctxt, - flags); + virDomainMemoryDef *mem = virDomainMemoryDefParseXML(xmlopt, + nodes[i], + ctxt, + flags); if (!mem) goto error; @@ -21761,11 +21761,11 @@ virDomainDefParseXML(xmlDocPtr xml, if ((n = virXPathNodeSet("./sysinfo", ctxt, &nodes)) < 0) goto error; - def->sysinfo = g_new0(virSysinfoDefPtr, n); + def->sysinfo = g_new0(virSysinfoDef *, n); for (i = 0; i < n; i++) { - virSysinfoDefPtr sysinfo = virSysinfoParseXML(nodes[i], ctxt, - def->uuid, uuid_generated); + virSysinfoDef *sysinfo = virSysinfoParseXML(nodes[i], ctxt, + def->uuid, uuid_generated); if (!sysinfo) goto error; @@ -21812,16 +21812,16 @@ virDomainDefParseXML(xmlDocPtr xml, } -static virDomainObjPtr +static virDomainObj * virDomainObjParseXML(xmlDocPtr xml, xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags) { long val; xmlNodePtr config; xmlNodePtr oldnode; - virDomainObjPtr obj; + virDomainObj *obj; size_t i; int n; int state; @@ -21923,15 +21923,15 @@ virDomainObjParseXML(xmlDocPtr xml, } -static virDomainDefPtr +static virDomainDef * virDomainDefParse(const char *xmlStr, const char *filename, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque, unsigned int flags) { xmlDocPtr xml = NULL; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; int keepBlanksDefault = xmlKeepBlanksDefault(0); xmlNodePtr root; if (!(xml = virXMLParse(filename, xmlStr, _("(domain_definition)")))) @@ -21954,18 +21954,18 @@ virDomainDefParse(const char *xmlStr, return def; } -virDomainDefPtr +virDomainDef * virDomainDefParseString(const char *xmlStr, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque, unsigned int flags) { return virDomainDefParse(xmlStr, NULL, xmlopt, parseOpaque, flags); } -virDomainDefPtr +virDomainDef * virDomainDefParseFile(const char *filename, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque, unsigned int flags) { @@ -21973,10 +21973,10 @@ virDomainDefParseFile(const char *filename, } -virDomainDefPtr +virDomainDef * virDomainDefParseNode(xmlDocPtr xml, xmlNodePtr root, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque, unsigned int flags) { @@ -22003,10 +22003,10 @@ virDomainDefParseNode(xmlDocPtr xml, } -virDomainObjPtr +virDomainObj * virDomainObjParseNode(xmlDocPtr xml, xmlNodePtr root, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags) { g_autoptr(xmlXPathContext) ctxt = NULL; @@ -22027,13 +22027,13 @@ virDomainObjParseNode(xmlDocPtr xml, } -virDomainObjPtr +virDomainObj * virDomainObjParseFile(const char *filename, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, unsigned int flags) { xmlDocPtr xml; - virDomainObjPtr obj = NULL; + virDomainObj *obj = NULL; int keepBlanksDefault = xmlKeepBlanksDefault(0); if ((xml = virXMLParseFile(filename))) { @@ -22048,8 +22048,8 @@ virDomainObjParseFile(const char *filename, static bool -virDomainTimerDefCheckABIStability(virDomainTimerDefPtr src, - virDomainTimerDefPtr dst) +virDomainTimerDefCheckABIStability(virDomainTimerDef *src, + virDomainTimerDef *dst) { if (src->name != dst->name) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22088,8 +22088,8 @@ virDomainTimerDefCheckABIStability(virDomainTimerDefPtr src, static bool -virDomainDeviceInfoCheckABIStability(virDomainDeviceInfoPtr src, - virDomainDeviceInfoPtr dst) +virDomainDeviceInfoCheckABIStability(virDomainDeviceInfo *src, + virDomainDeviceInfo *dst) { if (src->type != dst->type) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22217,8 +22217,8 @@ virDomainDeviceInfoCheckABIStability(virDomainDeviceInfoPtr src, static bool -virDomainVirtioOptionsCheckABIStability(virDomainVirtioOptionsPtr src, - virDomainVirtioOptionsPtr dst) +virDomainVirtioOptionsCheckABIStability(virDomainVirtioOptions *src, + virDomainVirtioOptions *dst) { if (!src && !dst) return true; @@ -22258,8 +22258,8 @@ virDomainVirtioOptionsCheckABIStability(virDomainVirtioOptionsPtr src, static bool -virDomainDiskDefCheckABIStability(virDomainDiskDefPtr src, - virDomainDiskDefPtr dst) +virDomainDiskDefCheckABIStability(virDomainDiskDef *src, + virDomainDiskDef *dst) { if (src->device != dst->device) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22331,8 +22331,8 @@ virDomainDiskDefCheckABIStability(virDomainDiskDefPtr src, static bool -virDomainControllerDefCheckABIStability(virDomainControllerDefPtr src, - virDomainControllerDefPtr dst) +virDomainControllerDefCheckABIStability(virDomainControllerDef *src, + virDomainControllerDef *dst) { if (src->type != dst->type) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22390,8 +22390,8 @@ virDomainControllerDefCheckABIStability(virDomainControllerDefPtr src, static bool -virDomainFsDefCheckABIStability(virDomainFSDefPtr src, - virDomainFSDefPtr dst) +virDomainFsDefCheckABIStability(virDomainFSDef *src, + virDomainFSDef *dst) { if (STRNEQ(src->dst, dst->dst)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22423,8 +22423,8 @@ virDomainFsDefCheckABIStability(virDomainFSDefPtr src, static bool -virDomainNetDefCheckABIStability(virDomainNetDefPtr src, - virDomainNetDefPtr dst) +virDomainNetDefCheckABIStability(virDomainNetDef *src, + virDomainNetDef *dst) { char srcmac[VIR_MAC_STRING_BUFLEN]; char dstmac[VIR_MAC_STRING_BUFLEN]; @@ -22471,8 +22471,8 @@ virDomainNetDefCheckABIStability(virDomainNetDefPtr src, static bool -virDomainInputDefCheckABIStability(virDomainInputDefPtr src, - virDomainInputDefPtr dst) +virDomainInputDefCheckABIStability(virDomainInputDef *src, + virDomainInputDef *dst) { if (src->type != dst->type) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22509,8 +22509,8 @@ virDomainInputDefCheckABIStability(virDomainInputDefPtr src, static bool -virDomainSoundDefCheckABIStability(virDomainSoundDefPtr src, - virDomainSoundDefPtr dst) +virDomainSoundDefCheckABIStability(virDomainSoundDef *src, + virDomainSoundDef *dst) { if (src->model != dst->model) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22528,8 +22528,8 @@ virDomainSoundDefCheckABIStability(virDomainSoundDefPtr src, static bool -virDomainVideoDefCheckABIStability(virDomainVideoDefPtr src, - virDomainVideoDefPtr dst) +virDomainVideoDefCheckABIStability(virDomainVideoDef *src, + virDomainVideoDef *dst) { if (src->type != dst->type) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22608,8 +22608,8 @@ virDomainVideoDefCheckABIStability(virDomainVideoDefPtr src, static bool -virDomainHostdevDefCheckABIStability(virDomainHostdevDefPtr src, - virDomainHostdevDefPtr dst) +virDomainHostdevDefCheckABIStability(virDomainHostdevDef *src, + virDomainHostdevDef *dst) { if (src->mode != dst->mode) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22636,8 +22636,8 @@ virDomainHostdevDefCheckABIStability(virDomainHostdevDefPtr src, static bool -virDomainSmartcardDefCheckABIStability(virDomainSmartcardDefPtr src, - virDomainSmartcardDefPtr dst) +virDomainSmartcardDefCheckABIStability(virDomainSmartcardDef *src, + virDomainSmartcardDef *dst) { if (!virDomainDeviceInfoCheckABIStability(&src->info, &dst->info)) return false; @@ -22647,8 +22647,8 @@ virDomainSmartcardDefCheckABIStability(virDomainSmartcardDefPtr src, static bool -virDomainSerialDefCheckABIStability(virDomainChrDefPtr src, - virDomainChrDefPtr dst) +virDomainSerialDefCheckABIStability(virDomainChrDef *src, + virDomainChrDef *dst) { if (src->targetType != dst->targetType) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22673,8 +22673,8 @@ virDomainSerialDefCheckABIStability(virDomainChrDefPtr src, static bool -virDomainParallelDefCheckABIStability(virDomainChrDefPtr src, - virDomainChrDefPtr dst) +virDomainParallelDefCheckABIStability(virDomainChrDef *src, + virDomainChrDef *dst) { if (src->target.port != dst->target.port) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22691,8 +22691,8 @@ virDomainParallelDefCheckABIStability(virDomainChrDefPtr src, static bool -virDomainChannelDefCheckABIStability(virDomainChrDefPtr src, - virDomainChrDefPtr dst) +virDomainChannelDefCheckABIStability(virDomainChrDef *src, + virDomainChrDef *dst) { if (src->targetType != dst->targetType) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22743,8 +22743,8 @@ virDomainChannelDefCheckABIStability(virDomainChrDefPtr src, static bool -virDomainConsoleDefCheckABIStability(virDomainChrDefPtr src, - virDomainChrDefPtr dst) +virDomainConsoleDefCheckABIStability(virDomainChrDef *src, + virDomainChrDef *dst) { if (src->targetType != dst->targetType) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22762,8 +22762,8 @@ virDomainConsoleDefCheckABIStability(virDomainChrDefPtr src, static bool -virDomainWatchdogDefCheckABIStability(virDomainWatchdogDefPtr src, - virDomainWatchdogDefPtr dst) +virDomainWatchdogDefCheckABIStability(virDomainWatchdogDef *src, + virDomainWatchdogDef *dst) { if (src->model != dst->model) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22781,8 +22781,8 @@ virDomainWatchdogDefCheckABIStability(virDomainWatchdogDefPtr src, static bool -virDomainMemballoonDefCheckABIStability(virDomainMemballoonDefPtr src, - virDomainMemballoonDefPtr dst) +virDomainMemballoonDefCheckABIStability(virDomainMemballoonDef *src, + virDomainMemballoonDef *dst) { if (src->model != dst->model) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22821,8 +22821,8 @@ virDomainMemballoonDefCheckABIStability(virDomainMemballoonDefPtr src, static bool -virDomainRNGDefCheckABIStability(virDomainRNGDefPtr src, - virDomainRNGDefPtr dst) +virDomainRNGDefCheckABIStability(virDomainRNGDef *src, + virDomainRNGDef *dst) { if (src->model != dst->model) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22843,8 +22843,8 @@ virDomainRNGDefCheckABIStability(virDomainRNGDefPtr src, static bool -virDomainHubDefCheckABIStability(virDomainHubDefPtr src, - virDomainHubDefPtr dst) +virDomainHubDefCheckABIStability(virDomainHubDef *src, + virDomainHubDef *dst) { if (src->type != dst->type) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22862,8 +22862,8 @@ virDomainHubDefCheckABIStability(virDomainHubDefPtr src, static bool -virDomainRedirdevDefCheckABIStability(virDomainRedirdevDefPtr src, - virDomainRedirdevDefPtr dst) +virDomainRedirdevDefCheckABIStability(virDomainRedirdevDef *src, + virDomainRedirdevDef *dst) { if (src->bus != dst->bus) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -22897,8 +22897,8 @@ virDomainRedirdevDefCheckABIStability(virDomainRedirdevDefPtr src, static bool -virDomainRedirFilterDefCheckABIStability(virDomainRedirFilterDefPtr src, - virDomainRedirFilterDefPtr dst) +virDomainRedirFilterDefCheckABIStability(virDomainRedirFilterDef *src, + virDomainRedirFilterDef *dst) { size_t i; @@ -22911,8 +22911,8 @@ virDomainRedirFilterDefCheckABIStability(virDomainRedirFilterDefPtr src, } for (i = 0; i < src->nusbdevs; i++) { - virDomainRedirFilterUSBDevDefPtr srcUSBDev = src->usbdevs[i]; - virDomainRedirFilterUSBDevDefPtr dstUSBDev = dst->usbdevs[i]; + virDomainRedirFilterUSBDevDef *srcUSBDev = src->usbdevs[i]; + virDomainRedirFilterUSBDevDef *dstUSBDev = dst->usbdevs[i]; if (srcUSBDev->usbClass != dstUSBDev->usbClass) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("Target USB Class code does not match source")); @@ -22951,8 +22951,8 @@ virDomainRedirFilterDefCheckABIStability(virDomainRedirFilterDefPtr src, static bool -virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, - virDomainDefPtr dst) +virDomainDefFeaturesCheckABIStability(virDomainDef *src, + virDomainDef *dst) { size_t i; @@ -23266,8 +23266,8 @@ virDomainDefFeaturesCheckABIStability(virDomainDefPtr src, } static bool -virDomainPanicDefCheckABIStability(virDomainPanicDefPtr src, - virDomainPanicDefPtr dst) +virDomainPanicDefCheckABIStability(virDomainPanicDef *src, + virDomainPanicDef *dst) { if (src->model != dst->model) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -23282,8 +23282,8 @@ virDomainPanicDefCheckABIStability(virDomainPanicDefPtr src, static bool -virDomainShmemDefCheckABIStability(virDomainShmemDefPtr src, - virDomainShmemDefPtr dst) +virDomainShmemDefCheckABIStability(virDomainShmemDef *src, + virDomainShmemDef *dst) { if (src->role != dst->role) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -23331,8 +23331,8 @@ virDomainShmemDefCheckABIStability(virDomainShmemDefPtr src, static bool -virDomainTPMDefCheckABIStability(virDomainTPMDefPtr src, - virDomainTPMDefPtr dst) +virDomainTPMDefCheckABIStability(virDomainTPMDef *src, + virDomainTPMDef *dst) { if (src->type != dst->type) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -23403,8 +23403,8 @@ virDomainMemtuneCheckABIStability(const virDomainDef *src, static bool -virDomainMemoryDefCheckABIStability(virDomainMemoryDefPtr src, - virDomainMemoryDefPtr dst) +virDomainMemoryDefCheckABIStability(virDomainMemoryDef *src, + virDomainMemoryDef *dst) { if (src->model != dst->model) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -23476,8 +23476,8 @@ virDomainMemoryDefCheckABIStability(virDomainMemoryDefPtr src, static bool -virDomainIOMMUDefCheckABIStability(virDomainIOMMUDefPtr src, - virDomainIOMMUDefPtr dst) +virDomainIOMMUDefCheckABIStability(virDomainIOMMUDef *src, + virDomainIOMMUDef *dst) { if (src->model != dst->model) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -23532,8 +23532,8 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUDefPtr src, static bool -virDomainVsockDefCheckABIStability(virDomainVsockDefPtr src, - virDomainVsockDefPtr dst) +virDomainVsockDefCheckABIStability(virDomainVsockDef *src, + virDomainVsockDef *dst) { if (src->model != dst->model) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -23555,8 +23555,8 @@ virDomainVsockDefCheckABIStability(virDomainVsockDefPtr src, static bool -virDomainDefVcpuCheckAbiStability(virDomainDefPtr src, - virDomainDefPtr dst) +virDomainDefVcpuCheckAbiStability(virDomainDef *src, + virDomainDef *dst) { size_t i; @@ -23568,8 +23568,8 @@ virDomainDefVcpuCheckAbiStability(virDomainDefPtr src, } for (i = 0; i < src->maxvcpus; i++) { - virDomainVcpuDefPtr svcpu = src->vcpus[i]; - virDomainVcpuDefPtr dvcpu = dst->vcpus[i]; + virDomainVcpuDef *svcpu = src->vcpus[i]; + virDomainVcpuDef *dvcpu = dst->vcpus[i]; if (svcpu->online != dvcpu->online) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -23595,9 +23595,9 @@ virDomainDefVcpuCheckAbiStability(virDomainDefPtr src, * validation of custom XML config passed in during migration */ bool -virDomainDefCheckABIStabilityFlags(virDomainDefPtr src, - virDomainDefPtr dst, - virDomainXMLOptionPtr xmlopt, +virDomainDefCheckABIStabilityFlags(virDomainDef *src, + virDomainDef *dst, + virDomainXMLOption *xmlopt, unsigned int flags) { size_t i; @@ -24091,16 +24091,16 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr src, bool -virDomainDefCheckABIStability(virDomainDefPtr src, - virDomainDefPtr dst, - virDomainXMLOptionPtr xmlopt) +virDomainDefCheckABIStability(virDomainDef *src, + virDomainDef *dst, + virDomainXMLOption *xmlopt) { return virDomainDefCheckABIStabilityFlags(src, dst, xmlopt, 0); } static int -virDomainDefAddDiskControllersForType(virDomainDefPtr def, +virDomainDefAddDiskControllersForType(virDomainDef *def, int controllerType, int diskBus) { @@ -24131,13 +24131,13 @@ virDomainDefAddDiskControllersForType(virDomainDefPtr def, static int -virDomainDefMaybeAddVirtioSerialController(virDomainDefPtr def) +virDomainDefMaybeAddVirtioSerialController(virDomainDef *def) { /* Look for any virtio serial or virtio console devs */ size_t i; for (i = 0; i < def->nchannels; i++) { - virDomainChrDefPtr channel = def->channels[i]; + virDomainChrDef *channel = def->channels[i]; if (channel->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO) { int idx = 0; @@ -24151,7 +24151,7 @@ virDomainDefMaybeAddVirtioSerialController(virDomainDefPtr def) } for (i = 0; i < def->nconsoles; i++) { - virDomainChrDefPtr console = def->consoles[i]; + virDomainChrDef *console = def->consoles[i]; if (console->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO) { int idx = 0; @@ -24170,13 +24170,13 @@ virDomainDefMaybeAddVirtioSerialController(virDomainDefPtr def) static int -virDomainDefMaybeAddSmartcardController(virDomainDefPtr def) +virDomainDefMaybeAddSmartcardController(virDomainDef *def) { /* Look for any smartcard devs */ size_t i; for (i = 0; i < def->nsmartcards; i++) { - virDomainSmartcardDefPtr smartcard = def->smartcards[i]; + virDomainSmartcardDef *smartcard = def->smartcards[i]; int idx = 0; if (smartcard->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID) { @@ -24187,7 +24187,7 @@ virDomainDefMaybeAddSmartcardController(virDomainDefPtr def) int max = -1; for (j = 0; j < def->nsmartcards; j++) { - virDomainDeviceInfoPtr info = &def->smartcards[j]->info; + virDomainDeviceInfo *info = &def->smartcards[j]->info; if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID && info->addr.ccid.controller == 0 && (int) info->addr.ccid.slot > max) @@ -24214,7 +24214,7 @@ virDomainDefMaybeAddSmartcardController(virDomainDefPtr def) * not know/care about info in the XML */ static int -virDomainDefAddImplicitControllers(virDomainDefPtr def) +virDomainDefAddImplicitControllers(virDomainDef *def) { if (virDomainDefAddDiskControllersForType(def, VIR_DOMAIN_CONTROLLER_TYPE_SCSI, @@ -24249,7 +24249,7 @@ virDomainDefAddImplicitControllers(virDomainDefPtr def) } static int -virDomainDefAddImplicitVideo(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt) +virDomainDefAddImplicitVideo(virDomainDef *def, virDomainXMLOption *xmlopt) { g_autoptr(virDomainVideoDef) video = NULL; @@ -24268,7 +24268,7 @@ virDomainDefAddImplicitVideo(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt) } int -virDomainDefAddImplicitDevices(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt) +virDomainDefAddImplicitDevices(virDomainDef *def, virDomainXMLOption *xmlopt) { if (virDomainDefAddConsoleCompat(def) < 0) return -1; @@ -24282,7 +24282,7 @@ virDomainDefAddImplicitDevices(virDomainDefPtr def, virDomainXMLOptionPtr xmlopt return 0; } -virDomainIOThreadIDDefPtr +virDomainIOThreadIDDef * virDomainIOThreadIDFind(const virDomainDef *def, unsigned int iothread_id) { @@ -24299,11 +24299,11 @@ virDomainIOThreadIDFind(const virDomainDef *def, return NULL; } -virDomainIOThreadIDDefPtr -virDomainIOThreadIDAdd(virDomainDefPtr def, +virDomainIOThreadIDDef * +virDomainIOThreadIDAdd(virDomainDef *def, unsigned int iothread_id) { - virDomainIOThreadIDDefPtr iothrid = NULL; + virDomainIOThreadIDDef *iothrid = NULL; iothrid = g_new0(virDomainIOThreadIDDef, 1); @@ -24322,7 +24322,7 @@ virDomainIOThreadIDAdd(virDomainDefPtr def, void -virDomainIOThreadIDDel(virDomainDefPtr def, +virDomainIOThreadIDDel(virDomainDef *def, unsigned int iothread_id) { size_t i, j; @@ -24347,7 +24347,7 @@ virDomainIOThreadIDDel(virDomainDefPtr def, static int -virDomainEventActionDefFormat(virBufferPtr buf, +virDomainEventActionDefFormat(virBuffer *buf, int type, const char *name, virEventActionToStringFunc convFunc) @@ -24366,8 +24366,8 @@ virDomainEventActionDefFormat(virBufferPtr buf, static void -virSecurityLabelDefFormat(virBufferPtr buf, - virSecurityLabelDefPtr def, +virSecurityLabelDefFormat(virBuffer *buf, + virSecurityLabelDef *def, unsigned int flags) { const char *sectype = virDomainSeclabelTypeToString(def->type); @@ -24420,8 +24420,8 @@ virSecurityLabelDefFormat(virBufferPtr buf, static void -virSecurityDeviceLabelDefFormat(virBufferPtr buf, - virSecurityDeviceLabelDefPtr def, +virSecurityDeviceLabelDefFormat(virBuffer *buf, + virSecurityDeviceLabelDef *def, unsigned int flags) { /* For offline output, skip elements that allow labels but have no @@ -24453,8 +24453,8 @@ virSecurityDeviceLabelDefFormat(virBufferPtr buf, static void -virDomainLeaseDefFormat(virBufferPtr buf, - virDomainLeaseDefPtr def) +virDomainLeaseDefFormat(virBuffer *buf, + virDomainLeaseDef *def) { virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); @@ -24469,8 +24469,8 @@ virDomainLeaseDefFormat(virBufferPtr buf, } static void -virDomainDiskGeometryDefFormat(virBufferPtr buf, - virDomainDiskDefPtr def) +virDomainDiskGeometryDefFormat(virBuffer *buf, + virDomainDiskDef *def) { const char *trans = virDomainDiskGeometryTransTypeToString(def->geometry.trans); @@ -24492,8 +24492,8 @@ virDomainDiskGeometryDefFormat(virBufferPtr buf, } static void -virDomainDiskBlockIoDefFormat(virBufferPtr buf, - virDomainDiskDefPtr def) +virDomainDiskBlockIoDefFormat(virBuffer *buf, + virDomainDiskDef *def) { if (def->blockio.logical_block_size > 0 || def->blockio.physical_block_size > 0) { @@ -24514,9 +24514,9 @@ virDomainDiskBlockIoDefFormat(virBufferPtr buf, static void -virDomainSourceDefFormatSeclabel(virBufferPtr buf, +virDomainSourceDefFormatSeclabel(virBuffer *buf, size_t nseclabels, - virSecurityDeviceLabelDefPtr *seclabels, + virSecurityDeviceLabelDef **seclabels, unsigned int flags) { size_t n; @@ -24527,8 +24527,8 @@ virDomainSourceDefFormatSeclabel(virBufferPtr buf, static void -virDomainDiskSourceFormatNetworkCookies(virBufferPtr buf, - virStorageSourcePtr src, +virDomainDiskSourceFormatNetworkCookies(virBuffer *buf, + virStorageSource *src, unsigned int flags) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -24547,9 +24547,9 @@ virDomainDiskSourceFormatNetworkCookies(virBufferPtr buf, static void -virDomainDiskSourceFormatNetwork(virBufferPtr attrBuf, - virBufferPtr childBuf, - virStorageSourcePtr src, +virDomainDiskSourceFormatNetwork(virBuffer *attrBuf, + virBuffer *childBuf, + virStorageSource *src, unsigned int flags) { size_t n; @@ -24619,8 +24619,8 @@ virDomainDiskSourceFormatNetwork(virBufferPtr attrBuf, static void -virDomainDiskSourceNVMeFormat(virBufferPtr attrBuf, - virBufferPtr childBuf, +virDomainDiskSourceNVMeFormat(virBuffer *attrBuf, + virBuffer *childBuf, const virStorageSourceNVMeDef *nvme) { virBufferAddLit(attrBuf, " type='pci'"); @@ -24633,14 +24633,14 @@ virDomainDiskSourceNVMeFormat(virBufferPtr attrBuf, static void -virDomainChrSourceReconnectDefFormat(virBufferPtr buf, - virDomainChrSourceReconnectDefPtr def); +virDomainChrSourceReconnectDefFormat(virBuffer *buf, + virDomainChrSourceReconnectDef *def); static void -virDomainDiskSourceVhostuserFormat(virBufferPtr attrBuf, - virBufferPtr childBuf, - virDomainChrSourceDefPtr vhostuser) +virDomainDiskSourceVhostuserFormat(virBuffer *attrBuf, + virBuffer *childBuf, + virDomainChrSourceDef *vhostuser) { virBufferAddLit(attrBuf, " type='unix'"); virBufferAsprintf(attrBuf, " path='%s'", vhostuser->data.nix.path); @@ -24650,10 +24650,10 @@ virDomainDiskSourceVhostuserFormat(virBufferPtr attrBuf, static int -virDomainDiskSourceFormatPrivateData(virBufferPtr buf, - virStorageSourcePtr src, +virDomainDiskSourceFormatPrivateData(virBuffer *buf, + virStorageSource *src, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -24670,9 +24670,9 @@ virDomainDiskSourceFormatPrivateData(virBufferPtr buf, static void -virDomainDiskSourceFormatSlice(virBufferPtr buf, +virDomainDiskSourceFormatSlice(virBuffer *buf, const char *slicetype, - virStorageSourceSlicePtr slice) + virStorageSourceSlice *slice) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; @@ -24688,8 +24688,8 @@ virDomainDiskSourceFormatSlice(virBufferPtr buf, static void -virDomainDiskSourceFormatSlices(virBufferPtr buf, - virStorageSourcePtr src) +virDomainDiskSourceFormatSlices(virBuffer *buf, + virStorageSource *src) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -24716,15 +24716,15 @@ virDomainDiskSourceFormatSlices(virBufferPtr buf, * 'type' and 'format' properties of @src. */ int -virDomainDiskSourceFormat(virBufferPtr buf, - virStorageSourcePtr src, +virDomainDiskSourceFormat(virBuffer *buf, + virStorageSource *src, const char *element, int policy, bool attrIndex, unsigned int flags, bool skipAuth, bool skipEnc, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -24811,9 +24811,9 @@ virDomainDiskSourceFormat(virBufferPtr buf, int -virDomainDiskBackingStoreFormat(virBufferPtr buf, - virStorageSourcePtr src, - virDomainXMLOptionPtr xmlopt, +virDomainDiskBackingStoreFormat(virBuffer *buf, + virStorageSource *src, + virDomainXMLOption *xmlopt, unsigned int flags) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; @@ -24821,7 +24821,7 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf, g_auto(virBuffer) formatAttrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) formatChildBuf = VIR_BUFFER_INIT_CHILD(&childBuf); bool inactive = flags & VIR_DOMAIN_DEF_FORMAT_INACTIVE; - virStorageSourcePtr backingStore = src->backingStore; + virStorageSource *backingStore = src->backingStore; if (!backingStore) return 0; @@ -24883,8 +24883,8 @@ virDomainDiskBackingStoreFormat(virBufferPtr buf, } static void -virDomainDiskDefFormatIotune(virBufferPtr buf, - virDomainDiskDefPtr disk) +virDomainDiskDefFormatIotune(virBuffer *buf, + virDomainDiskDef *disk) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -24926,8 +24926,8 @@ virDomainDiskDefFormatIotune(virBufferPtr buf, static void -virDomainDiskDefFormatDriver(virBufferPtr buf, - virDomainDiskDefPtr disk) +virDomainDiskDefFormatDriver(virBuffer *buf, + virDomainDiskDef *disk) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -24997,10 +24997,10 @@ virDomainDiskDefFormatDriver(virBufferPtr buf, static int -virDomainDiskDefFormatMirror(virBufferPtr buf, - virDomainDiskDefPtr disk, +virDomainDiskDefFormatMirror(virBuffer *buf, + virDomainDiskDef *disk, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -25061,10 +25061,10 @@ virDomainDiskDefFormatMirror(virBufferPtr buf, static int -virDomainDiskDefFormatPrivateData(virBufferPtr buf, - virDomainDiskDefPtr disk, +virDomainDiskDefFormatPrivateData(virBuffer *buf, + virDomainDiskDef *disk, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -25082,10 +25082,10 @@ virDomainDiskDefFormatPrivateData(virBufferPtr buf, static int -virDomainDiskDefFormat(virBufferPtr buf, - virDomainDiskDefPtr def, +virDomainDiskDefFormat(virBuffer *buf, + virDomainDiskDef *def, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { const char *type = virStorageTypeToString(def->src->type); const char *device = virDomainDiskDeviceTypeToString(def->device); @@ -25223,8 +25223,8 @@ virDomainDiskDefFormat(virBufferPtr buf, static void -virDomainControllerDriverFormat(virBufferPtr buf, - virDomainControllerDefPtr def) +virDomainControllerDriverFormat(virBuffer *buf, + virDomainControllerDef *def) { g_auto(virBuffer) driverBuf = VIR_BUFFER_INITIALIZER; @@ -25252,8 +25252,8 @@ virDomainControllerDriverFormat(virBufferPtr buf, static int -virDomainControllerDefFormat(virBufferPtr buf, - virDomainControllerDefPtr def, +virDomainControllerDefFormat(virBuffer *buf, + virDomainControllerDef *def, unsigned int flags) { const char *type = virDomainControllerTypeToString(def->type); @@ -25411,9 +25411,9 @@ virDomainControllerDefFormat(virBufferPtr buf, int -virDomainFSIndexByName(virDomainDefPtr def, const char *name) +virDomainFSIndexByName(virDomainDef *def, const char *name) { - virDomainFSDefPtr fs; + virDomainFSDef *fs; size_t i; for (i = 0; i < def->nfss; i++) { @@ -25426,8 +25426,8 @@ virDomainFSIndexByName(virDomainDefPtr def, const char *name) static int -virDomainFSDefFormat(virBufferPtr buf, - virDomainFSDefPtr def, +virDomainFSDefFormat(virBuffer *buf, + virDomainFSDef *def, unsigned int flags) { const char *type = virDomainFSTypeToString(def->type); @@ -25586,14 +25586,14 @@ virDomainFSDefFormat(virBufferPtr buf, static int -virDomainNetIPInfoFormat(virBufferPtr buf, - virNetDevIPInfoPtr def) +virDomainNetIPInfoFormat(virBuffer *buf, + virNetDevIPInfo *def) { size_t i; /* Output IP addresses */ for (i = 0; i < def->nips; i++) { - virSocketAddrPtr address = &def->ips[i]->address; + virSocketAddr *address = &def->ips[i]->address; char *ipStr = virSocketAddrFormat(address); const char *familyStr = NULL; @@ -25627,14 +25627,14 @@ virDomainNetIPInfoFormat(virBufferPtr buf, static void -virDomainHostdevDefFormatSubsysUSB(virBufferPtr buf, - virDomainHostdevDefPtr def, +virDomainHostdevDefFormatSubsysUSB(virBuffer *buf, + virDomainHostdevDef *def, unsigned int flags, bool includeTypeInAddr) { g_auto(virBuffer) sourceAttrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) sourceChildBuf = VIR_BUFFER_INIT_CHILD(buf); - virDomainHostdevSubsysUSBPtr usbsrc = &def->source.subsys.u.usb; + virDomainHostdevSubsysUSB *usbsrc = &def->source.subsys.u.usb; if (def->startupPolicy) virBufferAsprintf(&sourceAttrBuf, " startupPolicy='%s'", @@ -25661,15 +25661,15 @@ virDomainHostdevDefFormatSubsysUSB(virBufferPtr buf, static int -virDomainHostdevDefFormatSubsysPCI(virBufferPtr buf, - virDomainHostdevDefPtr def, +virDomainHostdevDefFormatSubsysPCI(virBuffer *buf, + virDomainHostdevDef *def, unsigned int flags, bool includeTypeInAddr) { g_auto(virBuffer) sourceAttrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) sourceChildBuf = VIR_BUFFER_INIT_CHILD(buf); g_auto(virBuffer) origstatesChildBuf = VIR_BUFFER_INIT_CHILD(&sourceChildBuf); - virDomainHostdevSubsysPCIPtr pcisrc = &def->source.subsys.u.pci; + virDomainHostdevSubsysPCI *pcisrc = &def->source.subsys.u.pci; if (def->writeFiltering != VIR_TRISTATE_BOOL_ABSENT) virBufferAsprintf(&sourceAttrBuf, " writeFiltering='%s'", @@ -25709,17 +25709,17 @@ virDomainHostdevDefFormatSubsysPCI(virBufferPtr buf, static int -virDomainHostdevDefFormatSubsysSCSI(virBufferPtr buf, - virDomainHostdevDefPtr def, +virDomainHostdevDefFormatSubsysSCSI(virBuffer *buf, + virDomainHostdevDef *def, unsigned int flags, bool includeTypeInAddr, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { g_auto(virBuffer) sourceAttrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) sourceChildBuf = VIR_BUFFER_INIT_CHILD(buf); - virDomainHostdevSubsysSCSIPtr scsisrc = &def->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; - virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &scsisrc->u.iscsi; + virDomainHostdevSubsysSCSI *scsisrc = &def->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; + virDomainHostdevSubsysSCSIiSCSI *iscsisrc = &scsisrc->u.iscsi; if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) { virBufferAsprintf(&sourceAttrBuf, " protocol='%s' name='%s'", @@ -25764,11 +25764,11 @@ virDomainHostdevDefFormatSubsysSCSI(virBufferPtr buf, static void -virDomainHostdevDefFormatSubsysSCSIHost(virBufferPtr buf, - virDomainHostdevDefPtr def) +virDomainHostdevDefFormatSubsysSCSIHost(virBuffer *buf, + virDomainHostdevDef *def) { g_auto(virBuffer) sourceAttrBuf = VIR_BUFFER_INITIALIZER; - virDomainHostdevSubsysSCSIVHostPtr hostsrc = &def->source.subsys.u.scsi_host; + virDomainHostdevSubsysSCSIVHost *hostsrc = &def->source.subsys.u.scsi_host; virBufferAsprintf(&sourceAttrBuf, " protocol='%s' wwpn='%s'", virDomainHostdevSubsysSCSIHostProtocolTypeToString(hostsrc->protocol), @@ -25779,11 +25779,11 @@ virDomainHostdevDefFormatSubsysSCSIHost(virBufferPtr buf, static void -virDomainHostdevDefFormatSubsysMdev(virBufferPtr buf, - virDomainHostdevDefPtr def) +virDomainHostdevDefFormatSubsysMdev(virBuffer *buf, + virDomainHostdevDef *def) { g_auto(virBuffer) sourceChildBuf = VIR_BUFFER_INIT_CHILD(buf); - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &def->source.subsys.u.mdev; + virDomainHostdevSubsysMediatedDev *mdevsrc = &def->source.subsys.u.mdev; virBufferAsprintf(&sourceChildBuf, "
\n", mdevsrc->uuidstr); @@ -25792,11 +25792,11 @@ virDomainHostdevDefFormatSubsysMdev(virBufferPtr buf, static int -virDomainHostdevDefFormatSubsys(virBufferPtr buf, - virDomainHostdevDefPtr def, +virDomainHostdevDefFormatSubsys(virBuffer *buf, + virDomainHostdevDef *def, unsigned int flags, bool includeTypeInAddr, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { switch ((virDomainHostdevSubsysType) def->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: @@ -25827,8 +25827,8 @@ virDomainHostdevDefFormatSubsys(virBufferPtr buf, } static int -virDomainHostdevDefFormatCaps(virBufferPtr buf, - virDomainHostdevDefPtr def) +virDomainHostdevDefFormatCaps(virBuffer *buf, + virDomainHostdevDef *def) { virBufferAddLit(buf, "\n"); @@ -25869,11 +25869,11 @@ virDomainHostdevDefFormatCaps(virBufferPtr buf, * than enclosed in an subelement. */ static int -virDomainActualNetDefContentsFormat(virBufferPtr buf, - virDomainNetDefPtr def, +virDomainActualNetDefContentsFormat(virBuffer *buf, + virDomainNetDef *def, bool inSubelement, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { virDomainNetType actualType = virDomainNetGetActualType(def); @@ -25957,10 +25957,10 @@ virDomainActualNetDefContentsFormat(virBufferPtr buf, * of domain status */ static int -virDomainActualNetDefFormat(virBufferPtr buf, - virDomainNetDefPtr def, +virDomainActualNetDefFormat(virBuffer *buf, + virDomainNetDef *def, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { virDomainNetType type; const char *typeStr; @@ -25978,7 +25978,7 @@ virDomainActualNetDefFormat(virBufferPtr buf, virBufferAsprintf(buf, "managed) virBufferAddLit(buf, " managed='yes'"); } @@ -25997,8 +25997,8 @@ virDomainActualNetDefFormat(virBufferPtr buf, static void -virDomainVirtioNetGuestOptsFormat(virBufferPtr buf, - virDomainNetDefPtr def) +virDomainVirtioNetGuestOptsFormat(virBuffer *buf, + virDomainNetDef *def) { if (def->driver.virtio.guest.csum) { virBufferAsprintf(buf, " csum='%s'", @@ -26024,8 +26024,8 @@ virDomainVirtioNetGuestOptsFormat(virBufferPtr buf, static void -virDomainVirtioNetHostOptsFormat(virBufferPtr buf, - virDomainNetDefPtr def) +virDomainVirtioNetHostOptsFormat(virBuffer *buf, + virDomainNetDef *def) { if (def->driver.virtio.host.csum) { virBufferAsprintf(buf, " csum='%s'", @@ -26059,8 +26059,8 @@ virDomainVirtioNetHostOptsFormat(virBufferPtr buf, static void -virDomainVirtioNetDriverFormat(virBufferPtr buf, - virDomainNetDefPtr def) +virDomainVirtioNetDriverFormat(virBuffer *buf, + virDomainNetDef *def) { if (def->driver.virtio.name) { virBufferAsprintf(buf, " name='%s'", @@ -26092,8 +26092,8 @@ virDomainVirtioNetDriverFormat(virBufferPtr buf, static void -virDomainChrSourceReconnectDefFormat(virBufferPtr buf, - virDomainChrSourceReconnectDefPtr def) +virDomainChrSourceReconnectDefFormat(virBuffer *buf, + virDomainChrSourceReconnectDef *def) { if (def->enabled == VIR_TRISTATE_BOOL_ABSENT) return; @@ -26109,8 +26109,8 @@ virDomainChrSourceReconnectDefFormat(virBufferPtr buf, static void -virDomainNetTeamingInfoFormat(virDomainNetTeamingInfoPtr teaming, - virBufferPtr buf) +virDomainNetTeamingInfoFormat(virDomainNetTeamingInfo *teaming, + virBuffer *buf) { if (teaming && teaming->type != VIR_DOMAIN_NET_TEAMING_TYPE_NONE) { virBufferAsprintf(buf, "config.netPrefix : NULL; @@ -26450,8 +26450,8 @@ virDomainNetDefFormat(virBufferPtr buf, /* Assumes that "". */ static int -virDomainChrAttrsDefFormat(virBufferPtr buf, - virDomainChrSourceDefPtr def, +virDomainChrAttrsDefFormat(virBuffer *buf, + virDomainChrSourceDef *def, bool tty_compat) { const char *type = virDomainChrTypeToString(def->type); @@ -26472,8 +26472,8 @@ virDomainChrAttrsDefFormat(virBufferPtr buf, } static void -virDomainChrSourceDefFormat(virBufferPtr buf, - virDomainChrSourceDefPtr def, +virDomainChrSourceDefFormat(virBuffer *buf, + virDomainChrSourceDef *def, unsigned int flags) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; @@ -26588,7 +26588,7 @@ virDomainChrSourceDefFormat(virBufferPtr buf, static int -virDomainChrTargetDefFormat(virBufferPtr buf, +virDomainChrTargetDefFormat(virBuffer *buf, const virDomainChrDef *def, unsigned int flags) { @@ -26705,8 +26705,8 @@ virDomainChrTargetDefFormat(virBufferPtr buf, static int -virDomainChrDefFormat(virBufferPtr buf, - virDomainChrDefPtr def, +virDomainChrDefFormat(virBuffer *buf, + virDomainChrDef *def, unsigned int flags) { const char *elementName = virDomainChrDeviceTypeToString(def->deviceType); @@ -26744,8 +26744,8 @@ virDomainChrDefFormat(virBufferPtr buf, } static int -virDomainSmartcardDefFormat(virBufferPtr buf, - virDomainSmartcardDefPtr def, +virDomainSmartcardDefFormat(virBuffer *buf, + virDomainSmartcardDef *def, unsigned int flags) { const char *mode = virDomainSmartcardTypeToString(def->type); @@ -26800,8 +26800,8 @@ virDomainSmartcardDefFormat(virBufferPtr buf, } static int -virDomainSoundCodecDefFormat(virBufferPtr buf, - virDomainSoundCodecDefPtr def) +virDomainSoundCodecDefFormat(virBuffer *buf, + virDomainSoundCodecDef *def) { const char *type = virDomainSoundCodecTypeToString(def->type); @@ -26817,8 +26817,8 @@ virDomainSoundCodecDefFormat(virBufferPtr buf, } static int -virDomainTPMDefFormat(virBufferPtr buf, - virDomainTPMDefPtr def, +virDomainTPMDefFormat(virBuffer *buf, + virDomainTPMDef *def, unsigned int flags) { virBufferAsprintf(buf, "\n", @@ -26867,8 +26867,8 @@ virDomainTPMDefFormat(virBufferPtr buf, static int -virDomainSoundDefFormat(virBufferPtr buf, - virDomainSoundDefPtr def, +virDomainSoundDefFormat(virBuffer *buf, + virDomainSoundDef *def, unsigned int flags) { const char *model = virDomainSoundModelTypeToString(def->model); @@ -26903,9 +26903,9 @@ virDomainSoundDefFormat(virBufferPtr buf, static void -virDomainAudioCommonFormat(virDomainAudioIOCommonPtr def, - virBufferPtr childBuf, - virBufferPtr backendAttrBuf, +virDomainAudioCommonFormat(virDomainAudioIOCommon *def, + virBuffer *childBuf, + virBuffer *backendAttrBuf, const char *direction) { g_auto(virBuffer) settingsBuf = VIR_BUFFER_INITIALIZER; @@ -26958,16 +26958,16 @@ virDomainAudioCommonFormat(virDomainAudioIOCommonPtr def, static void -virDomainAudioALSAFormat(virDomainAudioIOALSAPtr def, - virBufferPtr buf) +virDomainAudioALSAFormat(virDomainAudioIOALSA *def, + virBuffer *buf) { virBufferEscapeString(buf, " dev='%s'", def->dev); } static void -virDomainAudioCoreAudioFormat(virDomainAudioIOCoreAudioPtr def, - virBufferPtr buf) +virDomainAudioCoreAudioFormat(virDomainAudioIOCoreAudio *def, + virBuffer *buf) { if (def->bufferCount) virBufferAsprintf(buf, " bufferCount='%u'", def->bufferCount); @@ -26975,8 +26975,8 @@ virDomainAudioCoreAudioFormat(virDomainAudioIOCoreAudioPtr def, static void -virDomainAudioJackFormat(virDomainAudioIOJackPtr def, - virBufferPtr buf) +virDomainAudioJackFormat(virDomainAudioIOJack *def, + virBuffer *buf) { virBufferEscapeString(buf, " serverName='%s'", def->serverName); virBufferEscapeString(buf, " clientName='%s'", def->clientName); @@ -26988,8 +26988,8 @@ virDomainAudioJackFormat(virDomainAudioIOJackPtr def, static void -virDomainAudioOSSFormat(virDomainAudioIOOSSPtr def, - virBufferPtr buf) +virDomainAudioOSSFormat(virDomainAudioIOOSS *def, + virBuffer *buf) { virBufferEscapeString(buf, " dev='%s'", def->dev); if (def->bufferCount) @@ -27001,8 +27001,8 @@ virDomainAudioOSSFormat(virDomainAudioIOOSSPtr def, static void -virDomainAudioPulseAudioFormat(virDomainAudioIOPulseAudioPtr def, - virBufferPtr buf) +virDomainAudioPulseAudioFormat(virDomainAudioIOPulseAudio *def, + virBuffer *buf) { virBufferEscapeString(buf, " name='%s'", def->name); virBufferEscapeString(buf, " streamName='%s'", def->streamName); @@ -27013,8 +27013,8 @@ virDomainAudioPulseAudioFormat(virDomainAudioIOPulseAudioPtr def, static void -virDomainAudioSDLFormat(virDomainAudioIOSDLPtr def, - virBufferPtr buf) +virDomainAudioSDLFormat(virDomainAudioIOSDL *def, + virBuffer *buf) { if (def->bufferCount) virBufferAsprintf(buf, " bufferCount='%u'", def->bufferCount); @@ -27022,8 +27022,8 @@ virDomainAudioSDLFormat(virDomainAudioIOSDLPtr def, static int -virDomainAudioDefFormat(virBufferPtr buf, - virDomainAudioDefPtr def) +virDomainAudioDefFormat(virBuffer *buf, + virDomainAudioDef *def) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); g_auto(virBuffer) inputBuf = VIR_BUFFER_INITIALIZER; @@ -27118,8 +27118,8 @@ virDomainAudioDefFormat(virBufferPtr buf, static int -virDomainMemballoonDefFormat(virBufferPtr buf, - virDomainMemballoonDefPtr def, +virDomainMemballoonDefFormat(virBuffer *buf, + virDomainMemballoonDef *def, unsigned int flags) { const char *model = virDomainMemballoonModelTypeToString(def->model); @@ -27157,8 +27157,8 @@ virDomainMemballoonDefFormat(virBufferPtr buf, } static void -virDomainNVRAMDefFormat(virBufferPtr buf, - virDomainNVRAMDefPtr def, +virDomainNVRAMDefFormat(virBuffer *buf, + virDomainNVRAMDef *def, unsigned int flags) { virBufferAddLit(buf, "\n"); @@ -27171,8 +27171,8 @@ virDomainNVRAMDefFormat(virBufferPtr buf, static int -virDomainWatchdogDefFormat(virBufferPtr buf, - virDomainWatchdogDefPtr def, +virDomainWatchdogDefFormat(virBuffer *buf, + virDomainWatchdogDef *def, unsigned int flags) { const char *model = virDomainWatchdogModelTypeToString(def->model); @@ -27201,7 +27201,7 @@ virDomainWatchdogDefFormat(virBufferPtr buf, return 0; } -static void virDomainPanicDefFormat(virBufferPtr buf, virDomainPanicDefPtr def) +static void virDomainPanicDefFormat(virBuffer *buf, virDomainPanicDef *def) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -27216,8 +27216,8 @@ static void virDomainPanicDefFormat(virBufferPtr buf, virDomainPanicDefPtr def) } static void -virDomainShmemDefFormat(virBufferPtr buf, - virDomainShmemDefPtr def, +virDomainShmemDefFormat(virBuffer *buf, + virDomainShmemDef *def, unsigned int flags) { virBufferEscapeString(buf, "name); @@ -27257,8 +27257,8 @@ virDomainShmemDefFormat(virBufferPtr buf, } static int -virDomainRNGDefFormat(virBufferPtr buf, - virDomainRNGDefPtr def, +virDomainRNGDefFormat(virBuffer *buf, + virDomainRNGDef *def, unsigned int flags) { const char *model = virDomainRNGModelTypeToString(def->model); @@ -27311,7 +27311,7 @@ virDomainRNGDefFormat(virBufferPtr buf, } void -virDomainRNGDefFree(virDomainRNGDefPtr def) +virDomainRNGDefFree(virDomainRNGDef *def) { if (!def) return; @@ -27335,8 +27335,8 @@ virDomainRNGDefFree(virDomainRNGDefPtr def) static int -virDomainMemorySourceDefFormat(virBufferPtr buf, - virDomainMemoryDefPtr def) +virDomainMemorySourceDefFormat(virBuffer *buf, + virDomainMemoryDef *def) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); g_autofree char *bitmap = NULL; @@ -27382,8 +27382,8 @@ virDomainMemorySourceDefFormat(virBufferPtr buf, static void -virDomainMemoryTargetDefFormat(virBufferPtr buf, - virDomainMemoryDefPtr def) +virDomainMemoryTargetDefFormat(virBuffer *buf, + virDomainMemoryDef *def) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -27403,8 +27403,8 @@ virDomainMemoryTargetDefFormat(virBufferPtr buf, } static int -virDomainMemoryDefFormat(virBufferPtr buf, - virDomainMemoryDefPtr def, +virDomainMemoryDefFormat(virBuffer *buf, + virDomainMemoryDef *def, unsigned int flags) { const char *model = virDomainMemoryModelTypeToString(def->model); @@ -27439,8 +27439,8 @@ virDomainMemoryDefFormat(virBufferPtr buf, } static void -virDomainVideoAccelDefFormat(virBufferPtr buf, - virDomainVideoAccelDefPtr def) +virDomainVideoAccelDefFormat(virBuffer *buf, + virDomainVideoAccelDef *def) { virBufferAddLit(buf, "accel3d) { @@ -27456,8 +27456,8 @@ virDomainVideoAccelDefFormat(virBufferPtr buf, } static void -virDomainVideoResolutionDefFormat(virBufferPtr buf, - virDomainVideoResolutionDefPtr def) +virDomainVideoResolutionDefFormat(virBuffer *buf, + virDomainVideoResolutionDef *def) { virBufferAddLit(buf, "x && def->y) { @@ -27468,8 +27468,8 @@ virDomainVideoResolutionDefFormat(virBufferPtr buf, } static int -virDomainVideoDefFormat(virBufferPtr buf, - virDomainVideoDefPtr def, +virDomainVideoDefFormat(virBuffer *buf, + virDomainVideoDef *def, unsigned int flags) { const char *model = virDomainVideoTypeToString(def->type); @@ -27533,8 +27533,8 @@ virDomainVideoDefFormat(virBufferPtr buf, } static int -virDomainInputDefFormat(virBufferPtr buf, - virDomainInputDefPtr def, +virDomainInputDefFormat(virBuffer *buf, + virDomainInputDef *def, unsigned int flags) { const char *type = virDomainInputTypeToString(def->type); @@ -27589,8 +27589,8 @@ virDomainInputDefFormat(virBufferPtr buf, static int -virDomainTimerDefFormat(virBufferPtr buf, - virDomainTimerDefPtr def) +virDomainTimerDefFormat(virBuffer *buf, + virDomainTimerDef *def) { const char *name = virDomainTimerNameTypeToString(def->name); @@ -27673,8 +27673,8 @@ virDomainTimerDefFormat(virBufferPtr buf, } static void -virDomainGraphicsAuthDefFormatAttr(virBufferPtr buf, - virDomainGraphicsAuthDefPtr def, +virDomainGraphicsAuthDefFormatAttr(virBuffer *buf, + virDomainGraphicsAuthDef *def, unsigned int flags) { if (!def->passwd) @@ -27700,8 +27700,8 @@ virDomainGraphicsAuthDefFormatAttr(virBufferPtr buf, static void -virDomainGraphicsListenDefFormat(virBufferPtr buf, - virDomainGraphicsListenDefPtr def, +virDomainGraphicsListenDefFormat(virBuffer *buf, + virDomainGraphicsListenDef *def, unsigned int flags) { /* If generating migratable XML, skip listen address @@ -27754,8 +27754,8 @@ virDomainGraphicsListenDefFormat(virBufferPtr buf, * improve backward compatibility. */ static void -virDomainGraphicsListenDefFormatAddr(virBufferPtr buf, - virDomainGraphicsListenDefPtr glisten, +virDomainGraphicsListenDefFormatAddr(virBuffer *buf, + virDomainGraphicsListenDef *glisten, unsigned int flags) { if (!glisten) @@ -27774,7 +27774,7 @@ virDomainGraphicsListenDefFormatAddr(virBufferPtr buf, } static void -virDomainSpiceGLDefFormat(virBufferPtr buf, virDomainGraphicsDefPtr def) +virDomainSpiceGLDefFormat(virBuffer *buf, virDomainGraphicsDef *def) { if (def->data.spice.gl == VIR_TRISTATE_BOOL_ABSENT) return; @@ -27786,11 +27786,11 @@ virDomainSpiceGLDefFormat(virBufferPtr buf, virDomainGraphicsDefPtr def) } static int -virDomainGraphicsDefFormat(virBufferPtr buf, - virDomainGraphicsDefPtr def, +virDomainGraphicsDefFormat(virBuffer *buf, + virDomainGraphicsDef *def, unsigned int flags) { - virDomainGraphicsListenDefPtr glisten = virDomainGraphicsGetListen(def, 0); + virDomainGraphicsListenDef *glisten = virDomainGraphicsGetListen(def, 0); const char *type = virDomainGraphicsTypeToString(def->type); bool children = false; size_t i; @@ -28111,15 +28111,15 @@ virDomainGraphicsDefFormat(virBufferPtr buf, static int -virDomainHostdevDefFormat(virBufferPtr buf, - virDomainHostdevDefPtr def, +virDomainHostdevDefFormat(virBuffer *buf, + virDomainHostdevDef *def, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { const char *mode = virDomainHostdevModeTypeToString(def->mode); - virDomainHostdevSubsysSCSIPtr scsisrc = &def->source.subsys.u.scsi; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &def->source.subsys.u.mdev; - virDomainHostdevSubsysSCSIVHostPtr scsihostsrc = &def->source.subsys.u.scsi_host; + virDomainHostdevSubsysSCSI *scsisrc = &def->source.subsys.u.scsi; + virDomainHostdevSubsysMediatedDev *mdevsrc = &def->source.subsys.u.mdev; + virDomainHostdevSubsysSCSIVHost *scsihostsrc = &def->source.subsys.u.scsi_host; const char *type; if (!mode) { @@ -28219,8 +28219,8 @@ virDomainHostdevDefFormat(virBufferPtr buf, } static int -virDomainRedirdevDefFormat(virBufferPtr buf, - virDomainRedirdevDefPtr def, +virDomainRedirdevDefFormat(virBuffer *buf, + virDomainRedirdevDef *def, unsigned int flags) { const char *bus; @@ -28242,8 +28242,8 @@ virDomainRedirdevDefFormat(virBufferPtr buf, } static void -virDomainRedirFilterDefFormat(virBufferPtr buf, - virDomainRedirFilterDefPtr filter) +virDomainRedirFilterDefFormat(virBuffer *buf, + virDomainRedirFilterDef *filter) { size_t i; @@ -28254,7 +28254,7 @@ virDomainRedirFilterDefFormat(virBufferPtr buf, virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); for (i = 0; i < filter->nusbdevs; i++) { - virDomainRedirFilterUSBDevDefPtr usbdev = filter->usbdevs[i]; + virDomainRedirFilterUSBDevDef *usbdev = filter->usbdevs[i]; virBufferAddLit(buf, "usbClass >= 0) virBufferAsprintf(buf, " class='0x%02X'", usbdev->usbClass); @@ -28280,8 +28280,8 @@ virDomainRedirFilterDefFormat(virBufferPtr buf, } static int -virDomainHubDefFormat(virBufferPtr buf, - virDomainHubDefPtr def, +virDomainHubDefFormat(virBuffer *buf, + virDomainHubDef *def, unsigned int flags) { const char *type = virDomainHubTypeToString(def->type); @@ -28305,8 +28305,8 @@ virDomainHubDefFormat(virBufferPtr buf, static void -virDomainResourceDefFormat(virBufferPtr buf, - virDomainResourceDefPtr def) +virDomainResourceDefFormat(virBuffer *buf, + virDomainResourceDef *def) { virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); @@ -28317,8 +28317,8 @@ virDomainResourceDefFormat(virBufferPtr buf, static int -virDomainHugepagesFormatBuf(virBufferPtr buf, - virDomainHugePagePtr hugepage) +virDomainHugepagesFormatBuf(virBuffer *buf, + virDomainHugePage *hugepage) { virBufferAsprintf(buf, "size); @@ -28336,8 +28336,8 @@ virDomainHugepagesFormatBuf(virBufferPtr buf, } static void -virDomainHugepagesFormat(virBufferPtr buf, - virDomainHugePagePtr hugepages, +virDomainHugepagesFormat(virBuffer *buf, + virDomainHugePage *hugepages, size_t nhugepages) { size_t i; @@ -28359,8 +28359,8 @@ virDomainHugepagesFormat(virBufferPtr buf, } static void -virDomainLoaderDefFormat(virBufferPtr buf, - virDomainLoaderDefPtr loader) +virDomainLoaderDefFormat(virBuffer *buf, + virDomainLoaderDef *loader) { const char *readonly = virTristateBoolTypeToString(loader->readonly); const char *secure = virTristateBoolTypeToString(loader->secure); @@ -28393,7 +28393,7 @@ virDomainLoaderDefFormat(virBufferPtr buf, } static void -virDomainKeyWrapDefFormat(virBufferPtr buf, virDomainKeyWrapDefPtr keywrap) +virDomainKeyWrapDefFormat(virBuffer *buf, virDomainKeyWrapDef *keywrap) { virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); @@ -28412,7 +28412,7 @@ virDomainKeyWrapDefFormat(virBufferPtr buf, virDomainKeyWrapDefPtr keywrap) static void -virDomainSEVDefFormat(virBufferPtr buf, virDomainSEVDefPtr sev) +virDomainSEVDefFormat(virBuffer *buf, virDomainSEVDef *sev) { if (!sev) return; @@ -28440,7 +28440,7 @@ virDomainSEVDefFormat(virBufferPtr buf, virDomainSEVDefPtr sev) static void -virDomainPerfDefFormat(virBufferPtr buf, virDomainPerfDefPtr perf) +virDomainPerfDefFormat(virBuffer *buf, virDomainPerfDef *perf) { size_t i; bool wantPerf = false; @@ -28468,9 +28468,9 @@ virDomainPerfDefFormat(virBufferPtr buf, virDomainPerfDefPtr perf) static void -virDomainSchedulerFormat(virBufferPtr buf, +virDomainSchedulerFormat(virBuffer *buf, const char *name, - virDomainThreadSchedParamPtr sched, + virDomainThreadSchedParam *sched, size_t id, bool multiple_threads) { @@ -28510,7 +28510,7 @@ virDomainCachetuneDefFormatHelper(unsigned int level, void *opaque) { const char *unit; - virBufferPtr buf = opaque; + virBuffer *buf = opaque; unsigned long long short_size = virFormatIntPretty(size, &unit); virBufferAsprintf(buf, @@ -28524,9 +28524,9 @@ virDomainCachetuneDefFormatHelper(unsigned int level, static int -virDomainResctrlMonDefFormatHelper(virDomainResctrlMonDefPtr domresmon, +virDomainResctrlMonDefFormatHelper(virDomainResctrlMonDef *domresmon, virResctrlMonitorType tag, - virBufferPtr buf) + virBuffer *buf) { g_autofree char *vcpus = NULL; @@ -28551,8 +28551,8 @@ virDomainResctrlMonDefFormatHelper(virDomainResctrlMonDefPtr domresmon, static int -virDomainCachetuneDefFormat(virBufferPtr buf, - virDomainResctrlDefPtr resctrl, +virDomainCachetuneDefFormat(virBuffer *buf, + virDomainResctrlDef *resctrl, unsigned int flags) { g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -28601,7 +28601,7 @@ virDomainMemorytuneDefFormatHelper(unsigned int id, unsigned int bandwidth, void *opaque) { - virBufferPtr buf = opaque; + virBuffer *buf = opaque; virBufferAsprintf(buf, "\n", @@ -28611,8 +28611,8 @@ virDomainMemorytuneDefFormatHelper(unsigned int id, static int -virDomainMemorytuneDefFormat(virBufferPtr buf, - virDomainResctrlDefPtr resctrl, +virDomainMemorytuneDefFormat(virBuffer *buf, + virDomainResctrlDef *resctrl, unsigned int flags) { g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -28656,8 +28656,8 @@ virDomainMemorytuneDefFormat(virBufferPtr buf, } static int -virDomainCputuneDefFormat(virBufferPtr buf, - virDomainDefPtr def, +virDomainCputuneDefFormat(virBuffer *buf, + virDomainDef *def, unsigned int flags) { size_t i; @@ -28702,7 +28702,7 @@ virDomainCputuneDefFormat(virBufferPtr buf, for (i = 0; i < def->maxvcpus; i++) { char *cpumask; - virDomainVcpuDefPtr vcpu = def->vcpus[i]; + virDomainVcpuDef *vcpu = def->vcpus[i]; if (!vcpu->cpumask) continue; @@ -28778,10 +28778,10 @@ virDomainCputuneDefFormat(virBufferPtr buf, static int -virDomainCpuDefFormat(virBufferPtr buf, +virDomainCpuDefFormat(virBuffer *buf, const virDomainDef *def) { - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; size_t i; g_autofree char *cpumask = NULL; @@ -28824,7 +28824,7 @@ virDomainCpuDefFormat(virBufferPtr buf, static bool -virDomainDefIothreadShouldFormat(virDomainDefPtr def) +virDomainDefIothreadShouldFormat(virDomainDef *def) { size_t i; @@ -28838,7 +28838,7 @@ virDomainDefIothreadShouldFormat(virDomainDefPtr def) static void -virDomainIOMMUDefFormat(virBufferPtr buf, +virDomainIOMMUDefFormat(virBuffer *buf, const virDomainIOMMUDef *iommu) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -28876,7 +28876,7 @@ virDomainIOMMUDefFormat(virBufferPtr buf, static void -virDomainMemtuneFormat(virBufferPtr buf, +virDomainMemtuneFormat(virBuffer *buf, const virDomainMemtune *mem) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -28907,7 +28907,7 @@ virDomainMemtuneFormat(virBufferPtr buf, static void -virDomainMemorybackingFormat(virBufferPtr buf, +virDomainMemorybackingFormat(virBuffer *buf, const virDomainMemtune *mem) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -28935,8 +28935,8 @@ virDomainMemorybackingFormat(virBufferPtr buf, static void -virDomainVsockDefFormat(virBufferPtr buf, - virDomainVsockDefPtr vsock) +virDomainVsockDefFormat(virBuffer *buf, + virDomainVsockDef *vsock) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; @@ -28966,8 +28966,8 @@ virDomainVsockDefFormat(virBufferPtr buf, static void -virDomainDefFormatBlkiotune(virBufferPtr buf, - virDomainDefPtr def) +virDomainDefFormatBlkiotune(virBuffer *buf, + virDomainDef *def) { g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf); ssize_t n; @@ -28977,7 +28977,7 @@ virDomainDefFormatBlkiotune(virBufferPtr buf, def->blkio.weight); for (n = 0; n < def->blkio.ndevices; n++) { - virBlkioDevicePtr dev = &def->blkio.devices[n]; + virBlkioDevice *dev = &def->blkio.devices[n]; if (!dev->weight && !dev->riops && !dev->wiops && !dev->rbps && !dev->wbps) @@ -29010,8 +29010,8 @@ virDomainDefFormatBlkiotune(virBufferPtr buf, static int -virDomainDefFormatFeatures(virBufferPtr buf, - virDomainDefPtr def) +virDomainDefFormatFeatures(virBuffer *buf, + virDomainDef *def) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); size_t i; @@ -29342,9 +29342,9 @@ virDomainDefFormatFeatures(virBufferPtr buf, } int -virDomainDefFormatInternal(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, - virBufferPtr buf, +virDomainDefFormatInternal(virDomainDef *def, + virDomainXMLOption *xmlopt, + virBuffer *buf, unsigned int flags) { return virDomainDefFormatInternalSetRootName(def, xmlopt, buf, @@ -29357,9 +29357,9 @@ virDomainDefFormatInternal(virDomainDefPtr def, * to string. * Return -1 on failure. */ int -virDomainDefFormatInternalSetRootName(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, - virBufferPtr buf, +virDomainDefFormatInternalSetRootName(virDomainDef *def, + virDomainXMLOption *xmlopt, + virBuffer *buf, const char *rootname, unsigned int flags) { @@ -29908,8 +29908,8 @@ unsigned int virDomainDefFormatConvertXMLFlags(unsigned int flags) char * -virDomainDefFormat(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, +virDomainDefFormat(virDomainDef *def, + virDomainXMLOption *xmlopt, unsigned int flags) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -29923,8 +29923,8 @@ virDomainDefFormat(virDomainDefPtr def, char * -virDomainObjFormat(virDomainObjPtr obj, - virDomainXMLOptionPtr xmlopt, +virDomainObjFormat(virDomainObj *obj, + virDomainXMLOption *xmlopt, unsigned int flags) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -29964,7 +29964,7 @@ virDomainObjFormat(virDomainObjPtr obj, } static bool -virDomainDeviceIsUSB(virDomainDeviceDefPtr dev) +virDomainDeviceIsUSB(virDomainDeviceDef *dev) { int t = dev->type; if ((t == VIR_DOMAIN_DEVICE_DISK && @@ -29986,19 +29986,18 @@ virDomainDeviceIsUSB(virDomainDeviceDefPtr dev) typedef struct _virDomainCompatibleDeviceData virDomainCompatibleDeviceData; -typedef virDomainCompatibleDeviceData *virDomainCompatibleDeviceDataPtr; struct _virDomainCompatibleDeviceData { - virDomainDeviceInfoPtr newInfo; - virDomainDeviceInfoPtr oldInfo; + virDomainDeviceInfo *newInfo; + virDomainDeviceInfo *oldInfo; }; static int -virDomainDeviceInfoCheckBootIndex(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr device G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +virDomainDeviceInfoCheckBootIndex(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *device G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *opaque) { - virDomainCompatibleDeviceDataPtr data = opaque; + virDomainCompatibleDeviceData *data = opaque; /* Ignore the device we're about to update */ if (data->oldInfo == info) @@ -30014,9 +30013,9 @@ virDomainDeviceInfoCheckBootIndex(virDomainDefPtr def G_GNUC_UNUSED, } int -virDomainDefCompatibleDevice(virDomainDefPtr def, - virDomainDeviceDefPtr dev, - virDomainDeviceDefPtr oldDev, +virDomainDefCompatibleDevice(virDomainDef *def, + virDomainDeviceDef *dev, + virDomainDeviceDef *oldDev, virDomainDeviceAction action, bool live) { @@ -30083,7 +30082,7 @@ virDomainDefCompatibleDevice(virDomainDefPtr def, } static int -virDomainDefSaveXML(virDomainDefPtr def, +virDomainDefSaveXML(virDomainDef *def, const char *configDir, const char *xml) { @@ -30110,8 +30109,8 @@ virDomainDefSaveXML(virDomainDefPtr def, } int -virDomainDefSave(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, +virDomainDefSave(virDomainDef *def, + virDomainXMLOption *xmlopt, const char *configDir) { g_autofree char *xml = NULL; @@ -30123,8 +30122,8 @@ virDomainDefSave(virDomainDefPtr def, } int -virDomainObjSave(virDomainObjPtr obj, - virDomainXMLOptionPtr xmlopt, +virDomainObjSave(virDomainObj *obj, + virDomainXMLOption *xmlopt, const char *statusDir) { unsigned int flags = (VIR_DOMAIN_DEF_FORMAT_SECURE | @@ -30145,7 +30144,7 @@ virDomainObjSave(virDomainObjPtr obj, int virDomainDeleteConfig(const char *configDir, const char *autostartDir, - virDomainObjPtr dom) + virDomainObj *dom) { g_autofree char *configFile = NULL; g_autofree char *autostartLink = NULL; @@ -30190,7 +30189,7 @@ char * @return 0 on success, -1 on failure */ int -virDiskNameToBusDeviceIndex(virDomainDiskDefPtr disk, +virDiskNameToBusDeviceIndex(virDomainDiskDef *disk, int *busIdx, int *devIdx) { @@ -30222,22 +30221,22 @@ virDiskNameToBusDeviceIndex(virDomainDiskDefPtr disk, } int -virDomainFSInsert(virDomainDefPtr def, virDomainFSDefPtr fs) +virDomainFSInsert(virDomainDef *def, virDomainFSDef *fs) { return VIR_APPEND_ELEMENT(def->fss, def->nfss, fs); } -virDomainFSDefPtr -virDomainFSRemove(virDomainDefPtr def, size_t i) +virDomainFSDef * +virDomainFSRemove(virDomainDef *def, size_t i) { - virDomainFSDefPtr fs = def->fss[i]; + virDomainFSDef *fs = def->fss[i]; VIR_DELETE_ELEMENT(def->fss, i, def->nfss); return fs; } -virDomainFSDefPtr -virDomainGetFilesystemForTarget(virDomainDefPtr def, +virDomainFSDef * +virDomainGetFilesystemForTarget(virDomainDef *def, const char *target) { size_t i; @@ -30252,7 +30251,7 @@ virDomainGetFilesystemForTarget(virDomainDefPtr def, int -virDomainChrDefForeach(virDomainDefPtr def, +virDomainChrDefForeach(virDomainDef *def, bool abortOnError, virDomainChrDefIterator iter, void *opaque) @@ -30306,7 +30305,7 @@ virDomainChrDefForeach(virDomainDefPtr def, int -virDomainSmartcardDefForeach(virDomainDefPtr def, +virDomainSmartcardDefForeach(virDomainDef *def, bool abortOnError, virDomainSmartcardDefIterator iter, void *opaque) @@ -30329,7 +30328,7 @@ virDomainSmartcardDefForeach(virDomainDefPtr def, int -virDomainUSBDeviceDefForeach(virDomainDefPtr def, +virDomainUSBDeviceDefForeach(virDomainDef *def, virDomainUSBDeviceDefIterator iter, void *opaque, bool skipHubs) @@ -30339,7 +30338,7 @@ virDomainUSBDeviceDefForeach(virDomainDefPtr def, /* usb-hub */ if (!skipHubs) { for (i = 0; i < def->nhubs; i++) { - virDomainHubDefPtr hub = def->hubs[i]; + virDomainHubDef *hub = def->hubs[i]; if (hub->type == VIR_DOMAIN_HUB_TYPE_USB) { if (iter(&hub->info, opaque) < 0) return -1; @@ -30349,7 +30348,7 @@ virDomainUSBDeviceDefForeach(virDomainDefPtr def, /* usb-host */ for (i = 0; i < def->nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = def->hostdevs[i]; + virDomainHostdevDef *hostdev = def->hostdevs[i]; if (hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) { if (iter(hostdev->info, opaque) < 0) return -1; @@ -30358,7 +30357,7 @@ virDomainUSBDeviceDefForeach(virDomainDefPtr def, /* usb-storage */ for (i = 0; i < def->ndisks; i++) { - virDomainDiskDefPtr disk = def->disks[i]; + virDomainDiskDef *disk = def->disks[i]; if (disk->bus == VIR_DOMAIN_DISK_BUS_USB) { if (iter(&disk->info, opaque) < 0) return -1; @@ -30369,7 +30368,7 @@ virDomainUSBDeviceDefForeach(virDomainDefPtr def, /* usb-ccid */ for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_CCID) { if (iter(&cont->info, opaque) < 0) return -1; @@ -30378,7 +30377,7 @@ virDomainUSBDeviceDefForeach(virDomainDefPtr def, /* usb-kbd, usb-mouse, usb-tablet */ for (i = 0; i < def->ninputs; i++) { - virDomainInputDefPtr input = def->inputs[i]; + virDomainInputDef *input = def->inputs[i]; if (input->bus == VIR_DOMAIN_INPUT_BUS_USB) { if (iter(&input->info, opaque) < 0) @@ -30388,7 +30387,7 @@ virDomainUSBDeviceDefForeach(virDomainDefPtr def, /* usb-serial */ for (i = 0; i < def->nserials; i++) { - virDomainChrDefPtr serial = def->serials[i]; + virDomainChrDef *serial = def->serials[i]; if (serial->targetType == VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_USB) { if (iter(&serial->info, opaque) < 0) return -1; @@ -30397,7 +30396,7 @@ virDomainUSBDeviceDefForeach(virDomainDefPtr def, /* usb-audio model=usb */ for (i = 0; i < def->nsounds; i++) { - virDomainSoundDefPtr sound = def->sounds[i]; + virDomainSoundDef *sound = def->sounds[i]; if (sound->model == VIR_DOMAIN_SOUND_MODEL_USB) { if (iter(&sound->info, opaque) < 0) return -1; @@ -30406,7 +30405,7 @@ virDomainUSBDeviceDefForeach(virDomainDefPtr def, /* usb-redir */ for (i = 0; i < def->nredirdevs; i++) { - virDomainRedirdevDefPtr redirdev = def->redirdevs[i]; + virDomainRedirdevDef *redirdev = def->redirdevs[i]; if (redirdev->bus == VIR_DOMAIN_REDIRDEV_BUS_USB) { if (iter(&redirdev->info, opaque) < 0) return -1; @@ -30421,9 +30420,9 @@ virDomainUSBDeviceDefForeach(virDomainDefPtr def, * depending on the migratable flag (false for transitions between * persistent and active, true for transitions across save files or * snapshots). */ -virDomainDefPtr -virDomainDefCopy(virDomainDefPtr src, - virDomainXMLOptionPtr xmlopt, +virDomainDef * +virDomainDefCopy(virDomainDef *src, + virDomainXMLOption *xmlopt, void *parseOpaque, bool migratable) { @@ -30442,12 +30441,12 @@ virDomainDefCopy(virDomainDefPtr src, return virDomainDefParseString(xml, xmlopt, parseOpaque, parse_flags); } -virDomainDefPtr -virDomainObjCopyPersistentDef(virDomainObjPtr dom, - virDomainXMLOptionPtr xmlopt, +virDomainDef * +virDomainObjCopyPersistentDef(virDomainObj *dom, + virDomainXMLOption *xmlopt, void *parseOpaque) { - virDomainDefPtr cur; + virDomainDef *cur; cur = virDomainObjGetPersistentDef(xmlopt, dom, parseOpaque); if (!cur) { @@ -30461,7 +30460,7 @@ virDomainObjCopyPersistentDef(virDomainObjPtr dom, virDomainState -virDomainObjGetState(virDomainObjPtr dom, int *reason) +virDomainObjGetState(virDomainObj *dom, int *reason) { if (reason) *reason = dom->state.reason; @@ -30471,7 +30470,7 @@ virDomainObjGetState(virDomainObjPtr dom, int *reason) void -virDomainObjSetState(virDomainObjPtr dom, virDomainState state, int reason) +virDomainObjSetState(virDomainObj *dom, virDomainState state, int reason) { int last; @@ -30634,8 +30633,8 @@ virDomainNetGetActualDirectMode(const virDomainNetDef *iface) return 0; } -virDomainHostdevDefPtr -virDomainNetGetActualHostdev(virDomainNetDefPtr iface) +virDomainHostdevDef * +virDomainNetGetActualHostdev(virDomainNetDef *iface) { if (iface->type == VIR_DOMAIN_NET_TYPE_HOSTDEV) return &iface->data.hostdev.def; @@ -30740,7 +30739,7 @@ virDomainNetGetModelString(const virDomainNetDef *net) } int -virDomainNetSetModelString(virDomainNetDefPtr net, +virDomainNetSetModelString(virDomainNetDef *net, const char *model) { size_t i; @@ -30780,8 +30779,8 @@ virDomainNetIsVirtioModel(const virDomainNetDef *net) * type, or NULL if this is an unsuitable type, or the index is out of * bounds. If force0 is TRUE, i == 0, and there is no listen array, * allocate one with a single item. */ -virDomainGraphicsListenDefPtr -virDomainGraphicsGetListen(virDomainGraphicsDefPtr def, size_t i) +virDomainGraphicsListenDef * +virDomainGraphicsGetListen(virDomainGraphicsDef *def, size_t i) { if (!def->listens || (def->nListens <= i)) return NULL; @@ -30791,7 +30790,7 @@ virDomainGraphicsGetListen(virDomainGraphicsDefPtr def, size_t i) int -virDomainGraphicsListenAppendAddress(virDomainGraphicsDefPtr def, +virDomainGraphicsListenAppendAddress(virDomainGraphicsDef *def, const char *address) { virDomainGraphicsListenDef glisten; @@ -30813,7 +30812,7 @@ virDomainGraphicsListenAppendAddress(virDomainGraphicsDefPtr def, int -virDomainGraphicsListenAppendSocket(virDomainGraphicsDefPtr def, +virDomainGraphicsListenAppendSocket(virDomainGraphicsDef *def, const char *socketPath) { virDomainGraphicsListenDef glisten; @@ -30844,8 +30843,8 @@ virDomainGraphicsListenAppendSocket(virDomainGraphicsDefPtr def, * * Returns a pointer to the net def or NULL if not found (error is reported). */ -virDomainNetDefPtr -virDomainNetFind(virDomainDefPtr def, const char *device) +virDomainNetDef * +virDomainNetFind(virDomainDef *def, const char *device) { bool isMac = false; virMacAddr mac; @@ -30860,7 +30859,7 @@ virDomainNetFind(virDomainDefPtr def, const char *device) return def->nets[i]; } } else { /* ifname */ - virDomainNetDefPtr net = NULL; + virDomainNetDef *net = NULL; if ((net = virDomainNetFindByName(def, device))) return net; @@ -30881,8 +30880,8 @@ virDomainNetFind(virDomainDefPtr def, const char *device) * * Returns a pointer to the net def or NULL if not found. */ -virDomainNetDefPtr -virDomainNetFindByName(virDomainDefPtr def, +virDomainNetDef * +virDomainNetFindByName(virDomainDef *def, const char *ifname) { size_t i; @@ -30910,10 +30909,10 @@ virDomainNetFindByName(virDomainDefPtr def, * * Returns a pointer to copied @src or NULL in case of error. */ -virDomainDeviceDefPtr -virDomainDeviceDefCopy(virDomainDeviceDefPtr src, +virDomainDeviceDef * +virDomainDeviceDefCopy(virDomainDeviceDef *src, const virDomainDef *def, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -31013,11 +31012,11 @@ virDomainDeviceDefCopy(virDomainDeviceDefPtr src, } -virSecurityLabelDefPtr -virDomainDefGetSecurityLabelDef(virDomainDefPtr def, const char *model) +virSecurityLabelDef * +virDomainDefGetSecurityLabelDef(virDomainDef *def, const char *model) { size_t i; - virSecurityLabelDefPtr seclabel = NULL; + virSecurityLabelDef *seclabel = NULL; if (def == NULL || model == NULL) return NULL; @@ -31033,8 +31032,8 @@ virDomainDefGetSecurityLabelDef(virDomainDefPtr def, const char *model) } -virSecurityDeviceLabelDefPtr -virDomainChrSourceDefGetSecurityLabelDef(virDomainChrSourceDefPtr def, +virSecurityDeviceLabelDef * +virDomainChrSourceDefGetSecurityLabelDef(virDomainChrSourceDef *def, const char *model) { size_t i; @@ -31052,13 +31051,13 @@ virDomainChrSourceDefGetSecurityLabelDef(virDomainChrSourceDefPtr def, typedef struct { const char *devAlias; - virDomainDeviceDefPtr dev; + virDomainDeviceDef *dev; } virDomainDefFindDeviceCallbackData; static int -virDomainDefFindDeviceCallback(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr dev, - virDomainDeviceInfoPtr info, +virDomainDefFindDeviceCallback(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *dev, + virDomainDeviceInfo *info, void *opaque) { virDomainDefFindDeviceCallbackData *data = opaque; @@ -31071,9 +31070,9 @@ virDomainDefFindDeviceCallback(virDomainDefPtr def G_GNUC_UNUSED, } int -virDomainDefFindDevice(virDomainDefPtr def, +virDomainDefFindDevice(virDomainDef *def, const char *devAlias, - virDomainDeviceDefPtr dev, + virDomainDeviceDef *dev, bool reportError) { virDomainDefFindDeviceCallbackData data = { devAlias, dev }; @@ -31097,7 +31096,7 @@ virDomainDefFindDevice(virDomainDefPtr def, } -virDomainAudioDefPtr +virDomainAudioDef * virDomainDefFindAudioByID(const virDomainDef *def, int id) { @@ -31115,14 +31114,14 @@ virDomainDefFindAudioByID(const virDomainDef *def, bool -virDomainSoundModelSupportsCodecs(virDomainSoundDefPtr def) +virDomainSoundModelSupportsCodecs(virDomainSoundDef *def) { return def->model == VIR_DOMAIN_SOUND_MODEL_ICH6 || def->model == VIR_DOMAIN_SOUND_MODEL_ICH9; } bool -virDomainAudioIOCommonIsSet(virDomainAudioIOCommonPtr common) +virDomainAudioIOCommonIsSet(virDomainAudioIOCommon *common) { return common->mixingEngine || common->fixedSettings || @@ -31134,12 +31133,12 @@ virDomainAudioIOCommonIsSet(virDomainAudioIOCommonPtr common) } char * -virDomainObjGetMetadata(virDomainObjPtr vm, +virDomainObjGetMetadata(virDomainObj *vm, int type, const char *uri, unsigned int flags) { - virDomainDefPtr def; + virDomainDef *def; char *ret = NULL; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -31185,7 +31184,7 @@ virDomainObjGetMetadata(virDomainObjPtr vm, static int -virDomainDefSetMetadata(virDomainDefPtr def, +virDomainDefSetMetadata(virDomainDef *def, int type, const char *metadata, const char *key, @@ -31263,18 +31262,18 @@ virDomainDefSetMetadata(virDomainDefPtr def, int -virDomainObjSetMetadata(virDomainObjPtr vm, +virDomainObjSetMetadata(virDomainObj *vm, int type, const char *metadata, const char *key, const char *uri, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, const char *stateDir, const char *configDir, unsigned int flags) { - virDomainDefPtr def; - virDomainDefPtr persistentDef; + virDomainDef *def; + virDomainDef *persistentDef; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -31304,7 +31303,7 @@ virDomainObjSetMetadata(virDomainObjPtr vm, bool -virDomainDefNeedsPlacementAdvice(virDomainDefPtr def) +virDomainDefNeedsPlacementAdvice(virDomainDef *def) { if (def->placement_mode == VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) return true; @@ -31413,7 +31412,7 @@ virDomainDefGetShortName(const virDomainDef *def) #undef VIR_DOMAIN_SHORT_NAME_MAX int -virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def, +virDomainGetBlkioParametersAssignFromDef(virDomainDef *def, virTypedParameterPtr params, int *nparams, int maxparams) @@ -31461,7 +31460,7 @@ virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def, void -virDomainDefVcpuOrderClear(virDomainDefPtr def) +virDomainDefVcpuOrderClear(virDomainDef *def) { size_t i; @@ -31479,7 +31478,7 @@ virDomainDefVcpuOrderClear(virDomainDefPtr def) * in case of any error. That is to make sure nothing will fail half-way. */ void -virDomainDiskSetBlockIOTune(virDomainDiskDefPtr disk, +virDomainDiskSetBlockIOTune(virDomainDiskDef *disk, virDomainBlockIoTuneInfo *info) { char *tmp_group = NULL; @@ -31528,9 +31527,9 @@ virDomainNetTypeSharesHostView(const virDomainNetDef *net) return false; } -virNetworkPortDefPtr -virDomainNetDefToNetworkPort(virDomainDefPtr dom, - virDomainNetDefPtr iface) +virNetworkPortDef * +virDomainNetDefToNetworkPort(virDomainDef *dom, + virDomainNetDef *iface) { g_autoptr(virNetworkPortDef) port = NULL; @@ -31572,10 +31571,10 @@ virDomainNetDefToNetworkPort(virDomainDefPtr dom, } int -virDomainNetDefActualFromNetworkPort(virDomainNetDefPtr iface, - virNetworkPortDefPtr port) +virDomainNetDefActualFromNetworkPort(virDomainNetDef *iface, + virNetworkPortDef *port) { - virDomainActualNetDefPtr actual = NULL; + virDomainActualNetDef *actual = NULL; if (iface->type != VIR_DOMAIN_NET_TYPE_NETWORK) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -31678,11 +31677,11 @@ virDomainNetDefActualFromNetworkPort(virDomainNetDefPtr iface, return -1; } -virNetworkPortDefPtr -virDomainNetDefActualToNetworkPort(virDomainDefPtr dom, - virDomainNetDefPtr iface) +virNetworkPortDef * +virDomainNetDefActualToNetworkPort(virDomainDef *dom, + virDomainNetDef *iface) { - virDomainActualNetDefPtr actual; + virDomainActualNetDef *actual; g_autoptr(virNetworkPortDef) port = NULL; if (!iface->data.network.actual) { @@ -31814,8 +31813,8 @@ virDomainNetDefActualToNetworkPort(virDomainDefPtr dom, static int virDomainNetCreatePort(virConnectPtr conn, - virDomainDefPtr dom, - virDomainNetDefPtr iface, + virDomainDef *dom, + virDomainNetDef *iface, unsigned int flags) { virErrorPtr save_err; @@ -31880,16 +31879,16 @@ virDomainNetCreatePort(virConnectPtr conn, int virDomainNetAllocateActualDevice(virConnectPtr conn, - virDomainDefPtr dom, - virDomainNetDefPtr iface) + virDomainDef *dom, + virDomainNetDef *iface) { return virDomainNetCreatePort(conn, dom, iface, 0); } void virDomainNetNotifyActualDevice(virConnectPtr conn, - virDomainDefPtr dom, - virDomainNetDefPtr iface) + virDomainDef *dom, + virDomainNetDef *iface) { virDomainNetType actualType = virDomainNetGetActualType(iface); @@ -31919,8 +31918,8 @@ virDomainNetNotifyActualDevice(virConnectPtr conn, int virDomainNetReleaseActualDevice(virConnectPtr conn, - virDomainDefPtr dom G_GNUC_UNUSED, - virDomainNetDefPtr iface) + virDomainDef *dom G_GNUC_UNUSED, + virDomainNetDef *iface) { virNetworkPtr net = NULL; virNetworkPortPtr port = NULL; @@ -31949,7 +31948,7 @@ virDomainNetReleaseActualDevice(virConnectPtr conn, static int -virDomainNetBandwidthToTypedParams(virNetDevBandwidthPtr bandwidth, +virDomainNetBandwidthToTypedParams(virNetDevBandwidth *bandwidth, virTypedParameterPtr *params, int *nparams) { @@ -31993,8 +31992,8 @@ virDomainNetBandwidthToTypedParams(virNetDevBandwidthPtr bandwidth, int -virDomainNetBandwidthUpdate(virDomainNetDefPtr iface, - virNetDevBandwidthPtr newBandwidth) +virDomainNetBandwidthUpdate(virDomainNetDef *iface, + virNetDevBandwidth *newBandwidth) { virNetworkPtr net = NULL; virNetworkPortPtr port = NULL; @@ -32035,9 +32034,9 @@ virDomainNetBandwidthUpdate(virDomainNetDefPtr iface, * Returns 0 on success, -1 on failure. */ int -virDomainNetResolveActualType(virDomainNetDefPtr iface) +virDomainNetResolveActualType(virDomainNetDef *iface) { - virNetworkDefPtr def = NULL; + virNetworkDef *def = NULL; int ret = -1; g_autofree char *xml = NULL; g_autoptr(virConnect) conn = NULL; @@ -32113,8 +32112,8 @@ virDomainNetResolveActualType(virDomainNetDefPtr iface) static int -virDomainDiskAddISCSIPoolSourceHost(virStorageSourcePtr src, - virStoragePoolDefPtr pooldef) +virDomainDiskAddISCSIPoolSourceHost(virStorageSource *src, + virStoragePoolDef *pooldef) { g_auto(GStrv) tokens = NULL; @@ -32164,8 +32163,8 @@ virDomainDiskAddISCSIPoolSourceHost(virStorageSourcePtr src, static int -virDomainDiskTranslateSourcePoolAuth(virStorageSourcePtr src, - virStoragePoolSourcePtr source) +virDomainDiskTranslateSourcePoolAuth(virStorageSource *src, + virStoragePoolSource *source) { /* Only necessary when authentication set */ if (!source->auth) @@ -32181,8 +32180,8 @@ virDomainDiskTranslateSourcePoolAuth(virStorageSourcePtr src, static int -virDomainDiskTranslateISCSIDirect(virStorageSourcePtr src, - virStoragePoolDefPtr pooldef) +virDomainDiskTranslateISCSIDirect(virStorageSource *src, + virStoragePoolDef *pooldef) { src->srcpool->actualtype = VIR_STORAGE_TYPE_NETWORK; src->protocol = VIR_STORAGE_NET_PROTOCOL_ISCSI; @@ -32214,7 +32213,7 @@ virDomainDiskTranslateISCSIDirect(virStorageSourcePtr src, static int -virDomainStorageSourceTranslateSourcePool(virStorageSourcePtr src, +virDomainStorageSourceTranslateSourcePool(virStorageSource *src, virConnectPtr conn) { virStorageVolInfo info; @@ -32346,10 +32345,10 @@ virDomainStorageSourceTranslateSourcePool(virStorageSourcePtr src, int -virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def) +virDomainDiskTranslateSourcePool(virDomainDiskDef *def) { g_autoptr(virConnect) conn = NULL; - virStorageSourcePtr n; + virStorageSource *n; for (n = def->src; virStorageSourceIsBacking(n); n = n->backingStore) { if (n->type != VIR_STORAGE_TYPE_VOLUME || !n->srcpool) @@ -32503,7 +32502,7 @@ virDomainGraphicsDefHasOpenGL(const virDomainDef *def) size_t i; for (i = 0; i < def->ngraphics; i++) { - virDomainGraphicsDefPtr graphics = def->graphics[i]; + virDomainGraphicsDef *graphics = def->graphics[i]; /* we only care about OpenGL support for a given type here */ switch (graphics->type) { @@ -32635,7 +32634,7 @@ virDomainBlockIoTuneInfoHasAny(const virDomainBlockIoTuneInfo *iotune) void virDomainBlockIoTuneInfoCopy(const virDomainBlockIoTuneInfo *src, - virDomainBlockIoTuneInfoPtr dst) + virDomainBlockIoTuneInfo *dst) { *dst = *src; dst->group_name = g_strdup(src->group_name); diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 3da9ba01bf..3de1fd6f2a 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -93,31 +93,31 @@ typedef enum { struct _virDomainDeviceDef { int type; /* enum virDomainDeviceType */ union { - virDomainDiskDefPtr disk; - virDomainControllerDefPtr controller; - virDomainLeaseDefPtr lease; - virDomainFSDefPtr fs; - virDomainNetDefPtr net; - virDomainInputDefPtr input; - virDomainSoundDefPtr sound; - virDomainVideoDefPtr video; - virDomainHostdevDefPtr hostdev; - virDomainWatchdogDefPtr watchdog; - virDomainGraphicsDefPtr graphics; - virDomainHubDefPtr hub; - virDomainRedirdevDefPtr redirdev; - virDomainSmartcardDefPtr smartcard; - virDomainChrDefPtr chr; - virDomainMemballoonDefPtr memballoon; - virDomainNVRAMDefPtr nvram; - virDomainRNGDefPtr rng; - virDomainShmemDefPtr shmem; - virDomainTPMDefPtr tpm; - virDomainPanicDefPtr panic; - virDomainMemoryDefPtr memory; - virDomainIOMMUDefPtr iommu; - virDomainVsockDefPtr vsock; - virDomainAudioDefPtr audio; + virDomainDiskDef *disk; + virDomainControllerDef *controller; + virDomainLeaseDef *lease; + virDomainFSDef *fs; + virDomainNetDef *net; + virDomainInputDef *input; + virDomainSoundDef *sound; + virDomainVideoDef *video; + virDomainHostdevDef *hostdev; + virDomainWatchdogDef *watchdog; + virDomainGraphicsDef *graphics; + virDomainHubDef *hub; + virDomainRedirdevDef *redirdev; + virDomainSmartcardDef *smartcard; + virDomainChrDef *chr; + virDomainMemballoonDef *memballoon; + virDomainNVRAMDef *nvram; + virDomainRNGDef *rng; + virDomainShmemDef *shmem; + virDomainTPMDef *tpm; + virDomainPanicDef *panic; + virDomainMemoryDef *memory; + virDomainIOMMUDef *iommu; + virDomainVsockDef *vsock; + virDomainAudioDef *audio; } data; }; @@ -245,11 +245,11 @@ struct _virDomainHostdevSubsysSCSIHost { unsigned bus; unsigned target; unsigned long long unit; - virStorageSourcePtr src; + virStorageSource *src; }; struct _virDomainHostdevSubsysSCSIiSCSI { - virStorageSourcePtr src; + virStorageSource *src; }; struct _virDomainHostdevSubsysSCSI { @@ -340,7 +340,7 @@ struct _virDomainHostdevDef { * hostdevs internally. This hostdev should never be * visible to the user except as part of the interface */ - virDomainNetDefPtr parentnet; + virDomainNetDef *parentnet; int mode; /* enum virDomainHostdevMode */ int startupPolicy; /* enum virDomainStartupPolicy */ @@ -354,8 +354,8 @@ struct _virDomainHostdevDef { virDomainHostdevCaps caps; } source; virDomainHostdevOrigStates origstates; - virDomainNetTeamingInfoPtr teaming; - virDomainDeviceInfoPtr info; /* Guest address */ + virDomainNetTeamingInfo *teaming; + virDomainDeviceInfo *info; /* Guest address */ }; @@ -530,9 +530,9 @@ typedef enum { /* Stores the virtual disk configuration */ struct _virDomainDiskDef { - virStorageSourcePtr src; /* non-NULL. XXX Allow NULL for empty cdrom? */ + virStorageSource *src; /* non-NULL. XXX Allow NULL for empty cdrom? */ - virObjectPtr privateData; + virObject *privateData; int device; /* enum virDomainDiskDevice */ int bus; /* enum virDomainDiskBus */ @@ -541,7 +541,7 @@ struct _virDomainDiskDef { int removable; /* enum virTristateSwitch */ unsigned int rotation_rate; - virStorageSourcePtr mirror; + virStorageSource *mirror; int mirrorState; /* enum virDomainDiskMirrorState */ int mirrorJob; /* virDomainBlockJobType */ @@ -584,7 +584,7 @@ struct _virDomainDiskDef { char *domain_name; /* backend domain name */ unsigned int queues; int model; /* enum virDomainDiskModel */ - virDomainVirtioOptionsPtr virtio; + virDomainVirtioOptions *virtio; bool diskElementAuth; bool diskElementEnc; @@ -771,7 +771,7 @@ struct _virDomainControllerDef { virDomainXenbusControllerOpts xenbusopts; } opts; virDomainDeviceInfo info; - virDomainVirtioOptionsPtr virtio; + virDomainVirtioOptions *virtio; }; @@ -858,7 +858,7 @@ struct _virDomainFSDef { unsigned int dmode; int multidevs; /* virDomainFSMultidevs */ unsigned long long usage; /* in bytes */ - virStorageSourcePtr src; + virStorageSource *src; char *dst; bool readonly; virDomainDeviceInfo info; @@ -871,8 +871,8 @@ struct _virDomainFSDef { virDomainFSCacheMode cache; virTristateSwitch posix_lock; virTristateSwitch flock; - virDomainVirtioOptionsPtr virtio; - virObjectPtr privateData; + virDomainVirtioOptions *virtio; + virObject *privateData; }; @@ -992,8 +992,8 @@ struct _virDomainActualNetDef { virDomainHostdevDef def; } hostdev; } data; - virNetDevVPortProfilePtr virtPortProfile; - virNetDevBandwidthPtr bandwidth; + virNetDevVPortProfile *virtPortProfile; + virNetDevBandwidth *bandwidth; virNetDevVlan vlan; int trustGuestRxFilters; /* enum virTristateBool */ virTristateBool isolatedPort; @@ -1040,9 +1040,9 @@ struct _virDomainNetDef { char *tap; char *vhost; } backend; - virDomainNetTeamingInfoPtr teaming; + virDomainNetTeamingInfo *teaming; union { - virDomainChrSourceDefPtr vhostuser; + virDomainChrSourceDef *vhostuser; struct { char *address; int port; @@ -1064,7 +1064,7 @@ struct _virDomainNetDef { * This information is populated from the virNetworkPort * object associated with the portid UUID above. */ - virDomainActualNetDefPtr actual; + virDomainActualNetDef *actual; } network; struct { char *devicepath; @@ -1084,7 +1084,7 @@ struct _virDomainNetDef { } hostdev; } data; /* virtPortProfile is used by network/bridge/direct/hostdev */ - virNetDevVPortProfilePtr virtPortProfile; + virNetDevVPortProfile *virtPortProfile; struct { bool sndbuf_specified; unsigned long sndbuf; @@ -1101,15 +1101,15 @@ struct _virDomainNetDef { virDomainDeviceInfo info; char *filter; GHashTable *filterparams; - virNetDevBandwidthPtr bandwidth; + virNetDevBandwidth *bandwidth; virNetDevVlan vlan; int trustGuestRxFilters; /* enum virTristateBool */ virTristateBool isolatedPort; int linkstate; unsigned int mtu; - virNetDevCoalescePtr coalesce; - virDomainVirtioOptionsPtr virtio; - virObjectPtr privateData; + virNetDevCoalesce *coalesce; + virDomainVirtioOptions *virtio; + virObject *privateData; }; typedef enum { @@ -1228,7 +1228,7 @@ struct _virDomainChrSourceReconnectDef { struct _virDomainChrSourceDef { virObject parent; int type; /* virDomainChrType */ - virObjectPtr privateData; + virObject *privateData; union { /* no for null, vc, stdio */ struct { @@ -1269,7 +1269,7 @@ struct _virDomainChrSourceDef { int logappend; size_t nseclabels; - virSecurityDeviceLabelDefPtr *seclabels; + virSecurityDeviceLabelDef **seclabels; }; /* A complete character device, both host and domain views. */ @@ -1283,13 +1283,13 @@ struct _virDomainChrDef { union { int port; /* parallel, serial, console */ - virSocketAddrPtr addr; /* guestfwd */ + virSocketAddr *addr; /* guestfwd */ char *name; /* virtio */ } target; virDomainChrDeviceState state; - virDomainChrSourceDefPtr source; + virDomainChrSourceDef *source; virDomainDeviceInfo info; }; @@ -1313,7 +1313,7 @@ struct _virDomainSmartcardDef { char *file[VIR_DOMAIN_SMARTCARD_NUM_CERTIFICATES]; char *database; } cert; /* 'host-certificates' */ - virDomainChrSourceDefPtr passthru; /* 'passthrough' */ + virDomainChrSourceDef *passthru; /* 'passthrough' */ } data; virDomainDeviceInfo info; @@ -1407,7 +1407,7 @@ struct _virDomainInputDef { char *evdev; } source; virDomainDeviceInfo info; - virDomainVirtioOptionsPtr virtio; + virDomainVirtioOptions *virtio; }; typedef enum { @@ -1441,7 +1441,7 @@ struct _virDomainSoundDef { virDomainDeviceInfo info; size_t ncodecs; - virDomainSoundCodecDefPtr *codecs; + virDomainSoundCodecDef **codecs; unsigned int audioId; }; @@ -1484,7 +1484,6 @@ typedef enum { } virDomainAudioFormat; typedef struct _virDomainAudioIOCommon virDomainAudioIOCommon; -typedef virDomainAudioIOCommon *virDomainAudioIOCommonPtr; struct _virDomainAudioIOCommon { virTristateBool mixingEngine; virTristateBool fixedSettings; @@ -1496,19 +1495,16 @@ struct _virDomainAudioIOCommon { }; typedef struct _virDomainAudioIOALSA virDomainAudioIOALSA; -typedef virDomainAudioIOALSA *virDomainAudioIOALSAPtr; struct _virDomainAudioIOALSA { char *dev; }; typedef struct _virDomainAudioIOCoreAudio virDomainAudioIOCoreAudio; -typedef virDomainAudioIOCoreAudio *virDomainAudioIOCoreAudioPtr; struct _virDomainAudioIOCoreAudio { unsigned int bufferCount; }; typedef struct _virDomainAudioIOJack virDomainAudioIOJack; -typedef virDomainAudioIOJack *virDomainAudioIOJackPtr; struct _virDomainAudioIOJack { char *serverName; char *clientName; @@ -1517,7 +1513,6 @@ struct _virDomainAudioIOJack { }; typedef struct _virDomainAudioIOOSS virDomainAudioIOOSS; -typedef virDomainAudioIOOSS *virDomainAudioIOOSSPtr; struct _virDomainAudioIOOSS { char *dev; unsigned int bufferCount; @@ -1525,7 +1520,6 @@ struct _virDomainAudioIOOSS { }; typedef struct _virDomainAudioIOPulseAudio virDomainAudioIOPulseAudio; -typedef virDomainAudioIOPulseAudio *virDomainAudioIOPulseAudioPtr; struct _virDomainAudioIOPulseAudio { char *name; char *streamName; @@ -1533,7 +1527,6 @@ struct _virDomainAudioIOPulseAudio { }; typedef struct _virDomainAudioIOSDL virDomainAudioIOSDL; -typedef virDomainAudioIOSDL *virDomainAudioIOSDLPtr; struct _virDomainAudioIOSDL { unsigned int bufferCount; }; @@ -1665,7 +1658,7 @@ struct _virDomainVideoDriverDef { }; struct _virDomainVideoDef { - virObjectPtr privateData; + virObject *privateData; int type; /* enum virDomainVideoType */ unsigned int ram; /* kibibytes (multiples of 1024) */ @@ -1674,11 +1667,11 @@ struct _virDomainVideoDef { unsigned int vgamem; /* kibibytes (multiples of 1024) */ unsigned int heads; bool primary; - virDomainVideoAccelDefPtr accel; - virDomainVideoResolutionDefPtr res; - virDomainVideoDriverDefPtr driver; + virDomainVideoAccelDef *accel; + virDomainVideoResolutionDef *res; + virDomainVideoDriverDef *driver; virDomainDeviceInfo info; - virDomainVirtioOptionsPtr virtio; + virDomainVirtioOptions *virtio; virDomainVideoBackendType backend; }; @@ -1812,7 +1805,7 @@ struct _virDomainGraphicsListenDef { }; struct _virDomainGraphicsDef { - virObjectPtr privateData; + virObject *privateData; /* Port value discipline: * Value -1 is legacy syntax indicating that it should be auto-allocated. @@ -1878,7 +1871,7 @@ struct _virDomainGraphicsDef { * rdp, or spice. They've been extracted from the union only to * simplify parsing code.*/ size_t nListens; - virDomainGraphicsListenDefPtr listens; + virDomainGraphicsListenDef *listens; }; typedef enum { @@ -1890,7 +1883,7 @@ typedef enum { struct _virDomainRedirdevDef { int bus; /* enum virDomainRedirdevBus */ - virDomainChrSourceDefPtr source; + virDomainChrSourceDef *source; virDomainDeviceInfo info; /* Guest address */ }; @@ -1905,7 +1898,7 @@ struct _virDomainRedirFilterUSBDevDef { struct _virDomainRedirFilterDef { size_t nusbdevs; - virDomainRedirFilterUSBDevDefPtr *usbdevs; + virDomainRedirFilterUSBDevDef **usbdevs; }; typedef enum { @@ -1924,7 +1917,7 @@ struct _virDomainMemballoonDef { int period; /* seconds between collections */ int autodeflate; /* enum virTristateSwitch */ int free_page_reporting; /* enum virTristateSwitch */ - virDomainVirtioOptionsPtr virtio; + virDomainVirtioOptions *virtio; }; struct _virDomainNVRAMDef { @@ -2160,7 +2153,7 @@ struct _virDomainLoaderDef { char *templt; /* user override of path to master nvram */ }; -void virDomainLoaderDefFree(virDomainLoaderDefPtr loader); +void virDomainLoaderDefFree(virDomainLoaderDef *loader); typedef enum { VIR_DOMAIN_IOAPIC_NONE = 0, @@ -2258,7 +2251,7 @@ struct _virDomainOSDef { bool bm_timeout_set; char *init; char **initargv; - virDomainOSEnvPtr *initenv; + virDomainOSEnv **initenv; char *initdir; char *inituser; char *initgroup; @@ -2268,7 +2261,7 @@ struct _virDomainOSDef { char *dtb; char *root; char *slic_table; - virDomainLoaderDefPtr loader; + virDomainLoaderDef *loader; char *bootloader; char *bootloaderArgs; int smbios_mode; @@ -2392,7 +2385,7 @@ struct _virDomainClockDef { } data; size_t ntimers; - virDomainTimerDefPtr *timers; + virDomainTimerDef **timers; }; @@ -2429,12 +2422,11 @@ struct _virDomainRNGDef { union { char *file; /* file name for 'random' source */ - virDomainChrSourceDefPtr chardev; /* a char backend for - the EGD source */ + virDomainChrSourceDef *chardev; /* a char backend for the EGD source */ } source; virDomainDeviceInfo info; - virDomainVirtioOptionsPtr virtio; + virDomainVirtioOptions *virtio; }; typedef enum { @@ -2451,7 +2443,7 @@ struct _virDomainMemoryDef { virTristateBool discard; /* source */ - virBitmapPtr sourceNodes; + virBitmap *sourceNodes; unsigned long long pagesize; /* kibibytes */ char *nvdimmPath; /* valid for NVDIMM an VIRTIO_PMEM */ unsigned long long alignsize; /* kibibytes; valid only for NVDIMM */ @@ -2470,7 +2462,7 @@ struct _virDomainMemoryDef { virDomainDeviceInfo info; }; -void virDomainMemoryDefFree(virDomainMemoryDefPtr def); +void virDomainMemoryDefFree(virDomainMemoryDef *def); struct _virDomainIdMapEntry { unsigned int start; @@ -2480,10 +2472,10 @@ struct _virDomainIdMapEntry { struct _virDomainIdMapDef { size_t nuidmap; - virDomainIdMapEntryPtr uidmap; + virDomainIdMapEntry *uidmap; size_t ngidmap; - virDomainIdMapEntryPtr gidmap; + virDomainIdMapEntry *gidmap; }; @@ -2503,7 +2495,7 @@ struct _virDomainPanicDef { }; -void virBlkioDeviceArrayClear(virBlkioDevicePtr deviceWeights, +void virBlkioDeviceArrayClear(virBlkioDevice *deviceWeights, int ndevices); struct _virDomainResourceDef { @@ -2511,7 +2503,7 @@ struct _virDomainResourceDef { }; struct _virDomainHugePage { - virBitmapPtr nodemask; /* guest's NUMA node mask */ + virBitmap *nodemask; /* guest's NUMA node mask */ unsigned long long size; /* hugepage size in KiB */ }; @@ -2521,12 +2513,12 @@ struct _virDomainIOThreadIDDef { bool autofill; unsigned int iothread_id; int thread_id; - virBitmapPtr cpumask; + virBitmap *cpumask; virDomainThreadSchedParam sched; }; -void virDomainIOThreadIDDefFree(virDomainIOThreadIDDefPtr def); +void virDomainIOThreadIDDefFree(virDomainIOThreadIDDef *def); struct _virDomainCputune { @@ -2540,22 +2532,22 @@ struct _virDomainCputune { long long emulator_quota; unsigned long long iothread_period; long long iothread_quota; - virBitmapPtr emulatorpin; - virDomainThreadSchedParamPtr emulatorsched; + virBitmap *emulatorpin; + virDomainThreadSchedParam *emulatorsched; }; struct _virDomainResctrlMonDef { - virBitmapPtr vcpus; + virBitmap *vcpus; virResctrlMonitorType tag; - virResctrlMonitorPtr instance; + virResctrlMonitor *instance; }; struct _virDomainResctrlDef { - virBitmapPtr vcpus; - virResctrlAllocPtr alloc; + virBitmap *vcpus; + virResctrlAlloc *alloc; - virDomainResctrlMonDefPtr *monitors; + virDomainResctrlMonDef **monitors; size_t nmonitors; }; @@ -2565,18 +2557,18 @@ struct _virDomainVcpuDef { virTristateBool hotpluggable; unsigned int order; - virBitmapPtr cpumask; + virBitmap *cpumask; virDomainThreadSchedParam sched; - virObjectPtr privateData; + virObject *privateData; }; struct _virDomainBlkiotune { unsigned int weight; size_t ndevices; - virBlkioDevicePtr devices; + virBlkioDevice *devices; }; struct _virDomainMemtune { @@ -2586,7 +2578,7 @@ struct _virDomainMemtune { unsigned long long cur_balloon; /* in kibibytes, capped at ulong thanks to virDomainGetInfo */ - virDomainHugePagePtr hugepages; + virDomainHugePage *hugepages; size_t nhugepages; /* maximum supported memory for a guest, for hotplugging */ @@ -2670,14 +2662,14 @@ typedef enum { } virDomainVsockModel; struct _virDomainVsockDef { - virObjectPtr privateData; + virObject *privateData; virDomainVsockModel model; unsigned int guest_cid; virTristateBool auto_cid; virDomainDeviceInfo info; - virDomainVirtioOptionsPtr virtio; + virDomainVirtioOptions *virtio; }; struct _virDomainVirtioOptions { @@ -2708,23 +2700,23 @@ struct _virDomainDef { virDomainBlkiotune blkio; virDomainMemtune mem; - virDomainVcpuDefPtr *vcpus; + virDomainVcpuDef **vcpus; size_t maxvcpus; /* set if the vcpu definition was specified individually */ bool individualvcpus; int placement_mode; - virBitmapPtr cpumask; + virBitmap *cpumask; size_t niothreadids; - virDomainIOThreadIDDefPtr *iothreadids; + virDomainIOThreadIDDef **iothreadids; virDomainCputune cputune; - virDomainResctrlDefPtr *resctrls; + virDomainResctrlDef **resctrls; size_t nresctrls; - virDomainNumaPtr numa; - virDomainResourceDefPtr resource; + virDomainNuma *numa; + virDomainResourceDef *resource; virDomainIdMapDef idmap; /* These 3 are based on virDomainLifeCycleAction enum flags */ @@ -2764,97 +2756,97 @@ struct _virDomainDef { virDomainClockDef clock; size_t ngraphics; - virDomainGraphicsDefPtr *graphics; + virDomainGraphicsDef **graphics; size_t ndisks; - virDomainDiskDefPtr *disks; + virDomainDiskDef **disks; size_t ncontrollers; - virDomainControllerDefPtr *controllers; + virDomainControllerDef **controllers; size_t nfss; - virDomainFSDefPtr *fss; + virDomainFSDef **fss; size_t nnets; - virDomainNetDefPtr *nets; + virDomainNetDef **nets; size_t ninputs; - virDomainInputDefPtr *inputs; + virDomainInputDef **inputs; size_t nsounds; - virDomainSoundDefPtr *sounds; + virDomainSoundDef **sounds; size_t naudios; - virDomainAudioDefPtr *audios; + virDomainAudioDef **audios; size_t nvideos; - virDomainVideoDefPtr *videos; + virDomainVideoDef **videos; size_t nhostdevs; - virDomainHostdevDefPtr *hostdevs; + virDomainHostdevDef **hostdevs; size_t nredirdevs; - virDomainRedirdevDefPtr *redirdevs; + virDomainRedirdevDef **redirdevs; size_t nsmartcards; - virDomainSmartcardDefPtr *smartcards; + virDomainSmartcardDef **smartcards; size_t nserials; - virDomainChrDefPtr *serials; + virDomainChrDef **serials; size_t nparallels; - virDomainChrDefPtr *parallels; + virDomainChrDef **parallels; size_t nchannels; - virDomainChrDefPtr *channels; + virDomainChrDef **channels; size_t nconsoles; - virDomainChrDefPtr *consoles; + virDomainChrDef **consoles; size_t nleases; - virDomainLeaseDefPtr *leases; + virDomainLeaseDef **leases; size_t nhubs; - virDomainHubDefPtr *hubs; + virDomainHubDef **hubs; size_t nseclabels; - virSecurityLabelDefPtr *seclabels; + virSecurityLabelDef **seclabels; size_t nrngs; - virDomainRNGDefPtr *rngs; + virDomainRNGDef **rngs; size_t nshmems; - virDomainShmemDefPtr *shmems; + virDomainShmemDef **shmems; size_t nmems; - virDomainMemoryDefPtr *mems; + virDomainMemoryDef **mems; size_t npanics; - virDomainPanicDefPtr *panics; + virDomainPanicDef **panics; size_t nsysinfo; - virSysinfoDefPtr *sysinfo; + virSysinfoDef **sysinfo; /* At maximum 2 TPMs on the domain if a TPM Proxy is present. */ size_t ntpms; - virDomainTPMDefPtr *tpms; + virDomainTPMDef **tpms; /* Only 1 */ - virDomainWatchdogDefPtr watchdog; - virDomainMemballoonDefPtr memballoon; - virDomainNVRAMDefPtr nvram; - virCPUDefPtr cpu; - virDomainRedirFilterDefPtr redirfilter; - virDomainIOMMUDefPtr iommu; - virDomainVsockDefPtr vsock; + virDomainWatchdogDef *watchdog; + virDomainMemballoonDef *memballoon; + virDomainNVRAMDef *nvram; + virCPUDef *cpu; + virDomainRedirFilterDef *redirfilter; + virDomainIOMMUDef *iommu; + virDomainVsockDef *vsock; void *namespaceData; virXMLNamespace ns; - virDomainKeyWrapDefPtr keywrap; + virDomainKeyWrapDef *keywrap; /* SEV-specific domain */ - virDomainSEVDefPtr sev; + virDomainSEVDef *sev; /* Application-specific custom metadata */ xmlNodePtr metadata; @@ -2868,7 +2860,7 @@ struct _virDomainDef { unsigned long long virDomainDefGetMemoryInitial(const virDomainDef *def); -void virDomainDefSetMemoryTotal(virDomainDefPtr def, unsigned long long size); +void virDomainDefSetMemoryTotal(virDomainDef *def, unsigned long long size); unsigned long long virDomainDefGetMemoryTotal(const virDomainDef *def); bool virDomainDefHasMemoryHotplug(const virDomainDef *def); @@ -2921,14 +2913,14 @@ struct _virDomainObj { unsigned int updated : 1; unsigned int removing : 1; - virDomainDefPtr def; /* The current definition */ - virDomainDefPtr newDef; /* New definition to activate at shutdown */ + virDomainDef *def; /* The current definition */ + virDomainDef *newDef; /* New definition to activate at shutdown */ - virDomainSnapshotObjListPtr snapshots; + virDomainSnapshotObjList *snapshots; bool hasManagedSave; - virDomainCheckpointObjListPtr checkpoints; + virDomainCheckpointObjList *checkpoints; void *privateData; void (*privateDataFreeFunc)(void *); @@ -2945,7 +2937,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainObj, virObjectUnref); typedef bool (*virDomainObjListACLFilter)(virConnectPtr conn, - virDomainDefPtr def); + virDomainDef *def); /* NB: Any new flag to this list be considered to be set in @@ -2967,7 +2959,7 @@ typedef enum { * This has similar semantics to virDomainDefPostParseCallback, but no * parseOpaque is used. This callback is run prior to * virDomainDefPostParseCallback. */ -typedef int (*virDomainDefPostParseBasicCallback)(virDomainDefPtr def, +typedef int (*virDomainDefPostParseBasicCallback)(virDomainDef *def, void *opaque); /* Called once after everything else has been parsed, for adjusting @@ -2978,7 +2970,7 @@ typedef int (*virDomainDefPostParseBasicCallback)(virDomainDefPtr def, * cases when that is allowed, such failure is translated to a success return * value and the failure is noted in def->postParseFailed. Drivers should then * re-run the post parse callback when attempting to use such definition. */ -typedef int (*virDomainDefPostParseCallback)(virDomainDefPtr def, +typedef int (*virDomainDefPostParseCallback)(virDomainDef *def, unsigned int parseFlags, void *opaque, void *parseOpaque); @@ -2987,7 +2979,7 @@ typedef int (*virDomainDefPostParseCallback)(virDomainDefPtr def, * @parseOpaque is opaque data passed by virDomainDefParse* caller, * @opaque is opaque data set by driver (usually pointer to driver * private data). */ -typedef int (*virDomainDeviceDefPostParseCallback)(virDomainDeviceDefPtr dev, +typedef int (*virDomainDeviceDefPostParseCallback)(virDomainDeviceDef *dev, const virDomainDef *def, unsigned int parseFlags, void *opaque, @@ -3049,24 +3041,24 @@ struct _virDomainDefParserConfig { typedef void *(*virDomainXMLPrivateDataAllocFunc)(void *); typedef void (*virDomainXMLPrivateDataFreeFunc)(void *); -typedef virObjectPtr (*virDomainXMLPrivateDataNewFunc)(void); -typedef int (*virDomainXMLPrivateDataFormatFunc)(virBufferPtr, - virDomainObjPtr); +typedef virObject *(*virDomainXMLPrivateDataNewFunc)(void); +typedef int (*virDomainXMLPrivateDataFormatFunc)(virBuffer *, + virDomainObj *); typedef int (*virDomainXMLPrivateDataParseFunc)(xmlXPathContextPtr, - virDomainObjPtr, - virDomainDefParserConfigPtr); + virDomainObj *, + virDomainDefParserConfig *); -typedef void *(*virDomainXMLPrivateDataGetParseOpaqueFunc)(virDomainObjPtr vm); +typedef void *(*virDomainXMLPrivateDataGetParseOpaqueFunc)(virDomainObj *vm); typedef int (*virDomainXMLPrivateDataDiskParseFunc)(xmlXPathContextPtr ctxt, - virDomainDiskDefPtr disk); -typedef int (*virDomainXMLPrivateDataDiskFormatFunc)(virDomainDiskDefPtr disk, - virBufferPtr buf); + virDomainDiskDef *disk); +typedef int (*virDomainXMLPrivateDataDiskFormatFunc)(virDomainDiskDef *disk, + virBuffer *buf); typedef int (*virDomainXMLPrivateDataStorageSourceParseFunc)(xmlXPathContextPtr ctxt, - virStorageSourcePtr src); -typedef int (*virDomainXMLPrivateDataStorageSourceFormatFunc)(virStorageSourcePtr src, - virBufferPtr buf); + virStorageSource *src); +typedef int (*virDomainXMLPrivateDataStorageSourceFormatFunc)(virStorageSource *src, + virBuffer *buf); struct _virDomainXMLPrivateDataCallbacks { @@ -3100,26 +3092,26 @@ struct _virDomainABIStability { virDomainABIStabilityDomain domain; }; -virDomainXMLOptionPtr virDomainXMLOptionNew(virDomainDefParserConfigPtr config, - virDomainXMLPrivateDataCallbacksPtr priv, - virXMLNamespacePtr xmlns, - virDomainABIStabilityPtr abi, - virSaveCookieCallbacksPtr saveCookie); +virDomainXMLOption *virDomainXMLOptionNew(virDomainDefParserConfig *config, + virDomainXMLPrivateDataCallbacks *priv, + virXMLNamespace *xmlns, + virDomainABIStability *abi, + virSaveCookieCallbacks *saveCookie); -virSaveCookieCallbacksPtr -virDomainXMLOptionGetSaveCookie(virDomainXMLOptionPtr xmlopt); +virSaveCookieCallbacks * +virDomainXMLOptionGetSaveCookie(virDomainXMLOption *xmlopt); -typedef int (*virDomainMomentPostParseCallback)(virDomainMomentDefPtr def); +typedef int (*virDomainMomentPostParseCallback)(virDomainMomentDef *def); -void virDomainXMLOptionSetMomentPostParse(virDomainXMLOptionPtr xmlopt, +void virDomainXMLOptionSetMomentPostParse(virDomainXMLOption *xmlopt, virDomainMomentPostParseCallback cb); -int virDomainXMLOptionRunMomentPostParse(virDomainXMLOptionPtr xmlopt, - virDomainMomentDefPtr def); +int virDomainXMLOptionRunMomentPostParse(virDomainXMLOption *xmlopt, + virDomainMomentDef *def); -void virDomainNetGenerateMAC(virDomainXMLOptionPtr xmlopt, virMacAddrPtr mac); +void virDomainNetGenerateMAC(virDomainXMLOption *xmlopt, virMacAddr *mac); -virXMLNamespacePtr -virDomainXMLOptionGetNamespace(virDomainXMLOptionPtr xmlopt) +virXMLNamespace * +virDomainXMLOptionGetNamespace(virDomainXMLOption *xmlopt) ATTRIBUTE_NONNULL(1); /* This structure holds various callbacks and data needed @@ -3147,7 +3139,7 @@ struct _virDomainXMLOption { }; struct virDomainDefPostParseDeviceIteratorData { - virDomainXMLOptionPtr xmlopt; + virDomainXMLOption *xmlopt; void *parseOpaque; unsigned int parseFlags; }; @@ -3156,194 +3148,194 @@ bool virDomainSCSIDriveAddressIsUsed(const virDomainDef *def, const virDomainDeviceDriveAddress *addr); -int virDomainDefPostParse(virDomainDefPtr def, +int virDomainDefPostParse(virDomainDef *def, unsigned int parseFlags, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque); bool virDomainDefHasUSB(const virDomainDef *def); bool virDomainDeviceAliasIsUserAlias(const char *aliasStr); static inline bool -virDomainObjIsActive(virDomainObjPtr dom) +virDomainObjIsActive(virDomainObj *dom) { return dom->def->id != -1; } -int virDomainObjCheckActive(virDomainObjPtr dom); +int virDomainObjCheckActive(virDomainObj *dom); -int virDomainDefSetVcpusMax(virDomainDefPtr def, +int virDomainDefSetVcpusMax(virDomainDef *def, unsigned int vcpus, - virDomainXMLOptionPtr xmlopt); + virDomainXMLOption *xmlopt); bool virDomainDefHasVcpusOffline(const virDomainDef *def); unsigned int virDomainDefGetVcpusMax(const virDomainDef *def); -int virDomainDefSetVcpus(virDomainDefPtr def, unsigned int vcpus); +int virDomainDefSetVcpus(virDomainDef *def, unsigned int vcpus); unsigned int virDomainDefGetVcpus(const virDomainDef *def); -virBitmapPtr virDomainDefGetOnlineVcpumap(const virDomainDef *def); -virDomainVcpuDefPtr virDomainDefGetVcpu(virDomainDefPtr def, unsigned int vcpu) +virBitmap *virDomainDefGetOnlineVcpumap(const virDomainDef *def); +virDomainVcpuDef *virDomainDefGetVcpu(virDomainDef *def, unsigned int vcpu) G_GNUC_WARN_UNUSED_RESULT; -void virDomainDefVcpuOrderClear(virDomainDefPtr def); +void virDomainDefVcpuOrderClear(virDomainDef *def); int virDomainDefGetVcpusTopology(const virDomainDef *def, unsigned int *maxvcpus); -virDomainObjPtr virDomainObjNew(virDomainXMLOptionPtr caps) +virDomainObj *virDomainObjNew(virDomainXMLOption *caps) ATTRIBUTE_NONNULL(1); -void virDomainObjEndAPI(virDomainObjPtr *vm); +void virDomainObjEndAPI(virDomainObj **vm); -bool virDomainObjTaint(virDomainObjPtr obj, +bool virDomainObjTaint(virDomainObj *obj, virDomainTaintFlags taint); -void virDomainObjDeprecation(virDomainObjPtr obj, +void virDomainObjDeprecation(virDomainObj *obj, const char *msg); -void virDomainObjBroadcast(virDomainObjPtr vm); -int virDomainObjWait(virDomainObjPtr vm); -int virDomainObjWaitUntil(virDomainObjPtr vm, +void virDomainObjBroadcast(virDomainObj *vm); +int virDomainObjWait(virDomainObj *vm); +int virDomainObjWaitUntil(virDomainObj *vm, unsigned long long whenms); -void virDomainPanicDefFree(virDomainPanicDefPtr panic); -void virDomainResourceDefFree(virDomainResourceDefPtr resource); -void virDomainGraphicsDefFree(virDomainGraphicsDefPtr def); -const char *virDomainInputDefGetPath(virDomainInputDefPtr input); -void virDomainInputDefFree(virDomainInputDefPtr def); -virDomainDiskDefPtr virDomainDiskDefNew(virDomainXMLOptionPtr xmlopt); -void virDomainDiskDefFree(virDomainDiskDefPtr def); +void virDomainPanicDefFree(virDomainPanicDef *panic); +void virDomainResourceDefFree(virDomainResourceDef *resource); +void virDomainGraphicsDefFree(virDomainGraphicsDef *def); +const char *virDomainInputDefGetPath(virDomainInputDef *input); +void virDomainInputDefFree(virDomainInputDef *def); +virDomainDiskDef *virDomainDiskDefNew(virDomainXMLOption *xmlopt); +void virDomainDiskDefFree(virDomainDiskDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainDiskDef, virDomainDiskDefFree); -void virDomainLeaseDefFree(virDomainLeaseDefPtr def); -int virDomainDiskGetType(virDomainDiskDefPtr def); -void virDomainDiskSetType(virDomainDiskDefPtr def, int type); +void virDomainLeaseDefFree(virDomainLeaseDef *def); +int virDomainDiskGetType(virDomainDiskDef *def); +void virDomainDiskSetType(virDomainDiskDef *def, int type); const char *virDomainDiskGetSource(virDomainDiskDef const *def); -void virDomainDiskSetSource(virDomainDiskDefPtr def, const char *src); -void virDomainDiskEmptySource(virDomainDiskDefPtr def); +void virDomainDiskSetSource(virDomainDiskDef *def, const char *src); +void virDomainDiskEmptySource(virDomainDiskDef *def); const char *virDomainDiskGetDriver(const virDomainDiskDef *def); -void virDomainDiskSetDriver(virDomainDiskDefPtr def, const char *name); -int virDomainDiskGetFormat(virDomainDiskDefPtr def); -void virDomainDiskSetFormat(virDomainDiskDefPtr def, int format); -virDomainControllerDefPtr +void virDomainDiskSetDriver(virDomainDiskDef *def, const char *name); +int virDomainDiskGetFormat(virDomainDiskDef *def); +void virDomainDiskSetFormat(virDomainDiskDef *def, int format); +virDomainControllerDef * virDomainDeviceFindSCSIController(const virDomainDef *def, const virDomainDeviceDriveAddress *addr); -virDomainDiskDefPtr virDomainDiskFindByBusAndDst(virDomainDefPtr def, - int bus, - char *dst); +virDomainDiskDef *virDomainDiskFindByBusAndDst(virDomainDef *def, + int bus, + char *dst); -virDomainControllerDefPtr virDomainControllerDefNew(virDomainControllerType type); -void virDomainControllerDefFree(virDomainControllerDefPtr def); +virDomainControllerDef *virDomainControllerDefNew(virDomainControllerType type); +void virDomainControllerDefFree(virDomainControllerDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainControllerDef, virDomainControllerDefFree); bool virDomainControllerIsPSeriesPHB(const virDomainControllerDef *cont); -virDomainFSDefPtr virDomainFSDefNew(virDomainXMLOptionPtr xmlopt); -void virDomainFSDefFree(virDomainFSDefPtr def); -void virDomainActualNetDefFree(virDomainActualNetDefPtr def); -virDomainVsockDefPtr virDomainVsockDefNew(virDomainXMLOptionPtr xmlopt); -void virDomainVsockDefFree(virDomainVsockDefPtr vsock); +virDomainFSDef *virDomainFSDefNew(virDomainXMLOption *xmlopt); +void virDomainFSDefFree(virDomainFSDef *def); +void virDomainActualNetDefFree(virDomainActualNetDef *def); +virDomainVsockDef *virDomainVsockDefNew(virDomainXMLOption *xmlopt); +void virDomainVsockDefFree(virDomainVsockDef *vsock); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainVsockDef, virDomainVsockDefFree); -void virDomainNetTeamingInfoFree(virDomainNetTeamingInfoPtr teaming); +void virDomainNetTeamingInfoFree(virDomainNetTeamingInfo *teaming); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainNetTeamingInfo, virDomainNetTeamingInfoFree); -void virDomainNetDefFree(virDomainNetDefPtr def); +void virDomainNetDefFree(virDomainNetDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainNetDef, virDomainNetDefFree); -void virDomainSmartcardDefFree(virDomainSmartcardDefPtr def); +void virDomainSmartcardDefFree(virDomainSmartcardDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainSmartcardDef, virDomainSmartcardDefFree); -void virDomainChrDefFree(virDomainChrDefPtr def); -int virDomainChrSourceDefCopy(virDomainChrSourceDefPtr dest, - virDomainChrSourceDefPtr src); -void virDomainSoundCodecDefFree(virDomainSoundCodecDefPtr def); +void virDomainChrDefFree(virDomainChrDef *def); +int virDomainChrSourceDefCopy(virDomainChrSourceDef *dest, + virDomainChrSourceDef *src); +void virDomainSoundCodecDefFree(virDomainSoundCodecDef *def); ssize_t virDomainSoundDefFind(const virDomainDef *def, const virDomainSoundDef *sound); -void virDomainSoundDefFree(virDomainSoundDefPtr def); -virDomainSoundDefPtr virDomainSoundDefRemove(virDomainDefPtr def, size_t idx); -void virDomainAudioDefFree(virDomainAudioDefPtr def); -void virDomainMemballoonDefFree(virDomainMemballoonDefPtr def); -void virDomainNVRAMDefFree(virDomainNVRAMDefPtr def); -void virDomainWatchdogDefFree(virDomainWatchdogDefPtr def); -virDomainVideoDefPtr virDomainVideoDefNew(virDomainXMLOptionPtr xmlopt); -void virDomainVideoDefFree(virDomainVideoDefPtr def); +void virDomainSoundDefFree(virDomainSoundDef *def); +virDomainSoundDef *virDomainSoundDefRemove(virDomainDef *def, size_t idx); +void virDomainAudioDefFree(virDomainAudioDef *def); +void virDomainMemballoonDefFree(virDomainMemballoonDef *def); +void virDomainNVRAMDefFree(virDomainNVRAMDef *def); +void virDomainWatchdogDefFree(virDomainWatchdogDef *def); +virDomainVideoDef *virDomainVideoDefNew(virDomainXMLOption *xmlopt); +void virDomainVideoDefFree(virDomainVideoDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainVideoDef, virDomainVideoDefFree); -void virDomainVideoDefClear(virDomainVideoDefPtr def); -virDomainHostdevDefPtr virDomainHostdevDefNew(void); -void virDomainHostdevDefClear(virDomainHostdevDefPtr def); -void virDomainHostdevDefFree(virDomainHostdevDefPtr def); -void virDomainHubDefFree(virDomainHubDefPtr def); -void virDomainRedirdevDefFree(virDomainRedirdevDefPtr def); -void virDomainRedirFilterDefFree(virDomainRedirFilterDefPtr def); -void virDomainShmemDefFree(virDomainShmemDefPtr def); -void virDomainDeviceDefFree(virDomainDeviceDefPtr def); +void virDomainVideoDefClear(virDomainVideoDef *def); +virDomainHostdevDef *virDomainHostdevDefNew(void); +void virDomainHostdevDefClear(virDomainHostdevDef *def); +void virDomainHostdevDefFree(virDomainHostdevDef *def); +void virDomainHubDefFree(virDomainHubDef *def); +void virDomainRedirdevDefFree(virDomainRedirdevDef *def); +void virDomainRedirFilterDefFree(virDomainRedirFilterDef *def); +void virDomainShmemDefFree(virDomainShmemDef *def); +void virDomainDeviceDefFree(virDomainDeviceDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainDeviceDef, virDomainDeviceDefFree); -virDomainDeviceDefPtr virDomainDeviceDefCopy(virDomainDeviceDefPtr src, - const virDomainDef *def, - virDomainXMLOptionPtr xmlopt, - void *parseOpaque); -virDomainDeviceInfoPtr virDomainDeviceGetInfo(virDomainDeviceDefPtr device); -void virDomainDeviceSetData(virDomainDeviceDefPtr device, +virDomainDeviceDef *virDomainDeviceDefCopy(virDomainDeviceDef *src, + const virDomainDef *def, + virDomainXMLOption *xmlopt, + void *parseOpaque); +virDomainDeviceInfo *virDomainDeviceGetInfo(virDomainDeviceDef *device); +void virDomainDeviceSetData(virDomainDeviceDef *device, void *devicedata); -void virDomainTPMDefFree(virDomainTPMDefPtr def); +void virDomainTPMDefFree(virDomainTPMDef *def); -typedef int (*virDomainDeviceInfoCallback)(virDomainDefPtr def, - virDomainDeviceDefPtr dev, - virDomainDeviceInfoPtr info, +typedef int (*virDomainDeviceInfoCallback)(virDomainDef *def, + virDomainDeviceDef *dev, + virDomainDeviceInfo *info, void *opaque); -int virDomainDeviceInfoIterate(virDomainDefPtr def, +int virDomainDeviceInfoIterate(virDomainDef *def, virDomainDeviceInfoCallback cb, void *opaque); -bool virDomainDefHasDeviceAddress(virDomainDefPtr def, - virDomainDeviceInfoPtr info) +bool virDomainDefHasDeviceAddress(virDomainDef *def, + virDomainDeviceInfo *info) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -void virDomainDefFree(virDomainDefPtr vm); +void virDomainDefFree(virDomainDef *vm); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainDef, virDomainDefFree); -virDomainChrSourceDefPtr -virDomainChrSourceDefNew(virDomainXMLOptionPtr xmlopt); +virDomainChrSourceDef * +virDomainChrSourceDefNew(virDomainXMLOption *xmlopt); -virDomainChrDefPtr virDomainChrDefNew(virDomainXMLOptionPtr xmlopt); +virDomainChrDef *virDomainChrDefNew(virDomainXMLOption *xmlopt); -int virDomainDeviceInfoIterateFlags(virDomainDefPtr def, +int virDomainDeviceInfoIterateFlags(virDomainDef *def, virDomainDeviceInfoCallback cb, unsigned int iteratorFlags, void *opaque); -virDomainGraphicsDefPtr -virDomainGraphicsDefNew(virDomainXMLOptionPtr xmlopt); +virDomainGraphicsDef * +virDomainGraphicsDefNew(virDomainXMLOption *xmlopt); -virDomainNetDefPtr -virDomainNetDefNew(virDomainXMLOptionPtr xmlopt); +virDomainNetDef * +virDomainNetDefNew(virDomainXMLOption *xmlopt); -virDomainDefPtr virDomainDefNew(void); +virDomainDef *virDomainDefNew(void); -void virDomainObjAssignDef(virDomainObjPtr domain, - virDomainDefPtr def, +void virDomainObjAssignDef(virDomainObj *domain, + virDomainDef *def, bool live, - virDomainDefPtr *oldDef); -int virDomainObjSetDefTransient(virDomainXMLOptionPtr xmlopt, - virDomainObjPtr domain, + virDomainDef **oldDef); +int virDomainObjSetDefTransient(virDomainXMLOption *xmlopt, + virDomainObj *domain, void *parseOpaque); -void virDomainObjRemoveTransientDef(virDomainObjPtr domain); -virDomainDefPtr -virDomainObjGetPersistentDef(virDomainXMLOptionPtr xmlopt, - virDomainObjPtr domain, +void virDomainObjRemoveTransientDef(virDomainObj *domain); +virDomainDef * +virDomainObjGetPersistentDef(virDomainXMLOption *xmlopt, + virDomainObj *domain, void *parseOpaque); -int virDomainObjUpdateModificationImpact(virDomainObjPtr vm, +int virDomainObjUpdateModificationImpact(virDomainObj *vm, unsigned int *flags); -int virDomainObjGetDefs(virDomainObjPtr vm, +int virDomainObjGetDefs(virDomainObj *vm, unsigned int flags, - virDomainDefPtr *liveDef, - virDomainDefPtr *persDef); -virDomainDefPtr virDomainObjGetOneDefState(virDomainObjPtr vm, - unsigned int flags, - bool *state); -virDomainDefPtr virDomainObjGetOneDef(virDomainObjPtr vm, unsigned int flags); + virDomainDef **liveDef, + virDomainDef **persDef); +virDomainDef *virDomainObjGetOneDefState(virDomainObj *vm, + unsigned int flags, + bool *state); +virDomainDef *virDomainObjGetOneDef(virDomainObj *vm, unsigned int flags); -virDomainDefPtr virDomainDefCopy(virDomainDefPtr src, - virDomainXMLOptionPtr xmlopt, - void *parseOpaque, - bool migratable); -virDomainDefPtr virDomainObjCopyPersistentDef(virDomainObjPtr dom, - virDomainXMLOptionPtr xmlopt, - void *parseOpaque); +virDomainDef *virDomainDefCopy(virDomainDef *src, + virDomainXMLOption *xmlopt, + void *parseOpaque, + bool migratable); +virDomainDef *virDomainObjCopyPersistentDef(virDomainObj *dom, + virDomainXMLOption *xmlopt, + void *parseOpaque); typedef enum { /* parse internal domain status information */ @@ -3406,52 +3398,52 @@ typedef enum { VIR_DOMAIN_DEF_ABI_CHECK_SKIP_VOLATILE = 1 << 0, } virDomainDefABICheckFlags; -virDomainDeviceDefPtr virDomainDeviceDefParse(const char *xmlStr, - const virDomainDef *def, - virDomainXMLOptionPtr xmlopt, - void *parseOpaque, - unsigned int flags); -virDomainDiskDefPtr virDomainDiskDefParse(const char *xmlStr, - virDomainXMLOptionPtr xmlopt, - unsigned int flags); -virDomainDefPtr virDomainDefParseString(const char *xmlStr, - virDomainXMLOptionPtr xmlopt, - void *parseOpaque, +virDomainDeviceDef *virDomainDeviceDefParse(const char *xmlStr, + const virDomainDef *def, + virDomainXMLOption *xmlopt, + void *parseOpaque, + unsigned int flags); +virDomainDiskDef *virDomainDiskDefParse(const char *xmlStr, + virDomainXMLOption *xmlopt, unsigned int flags); -virDomainDefPtr virDomainDefParseFile(const char *filename, - virDomainXMLOptionPtr xmlopt, +virDomainDef *virDomainDefParseString(const char *xmlStr, + virDomainXMLOption *xmlopt, void *parseOpaque, unsigned int flags); -virDomainDefPtr virDomainDefParseNode(xmlDocPtr doc, - xmlNodePtr root, - virDomainXMLOptionPtr xmlopt, - void *parseOpaque, - unsigned int flags); -virDomainObjPtr virDomainObjParseNode(xmlDocPtr xml, - xmlNodePtr root, - virDomainXMLOptionPtr xmlopt, - unsigned int flags); -virDomainObjPtr virDomainObjParseFile(const char *filename, - virDomainXMLOptionPtr xmlopt, - unsigned int flags); +virDomainDef *virDomainDefParseFile(const char *filename, + virDomainXMLOption *xmlopt, + void *parseOpaque, + unsigned int flags); +virDomainDef *virDomainDefParseNode(xmlDocPtr doc, + xmlNodePtr root, + virDomainXMLOption *xmlopt, + void *parseOpaque, + unsigned int flags); +virDomainObj *virDomainObjParseNode(xmlDocPtr xml, + xmlNodePtr root, + virDomainXMLOption *xmlopt, + unsigned int flags); +virDomainObj *virDomainObjParseFile(const char *filename, + virDomainXMLOption *xmlopt, + unsigned int flags); -bool virDomainDefCheckABIStability(virDomainDefPtr src, - virDomainDefPtr dst, - virDomainXMLOptionPtr xmlopt); +bool virDomainDefCheckABIStability(virDomainDef *src, + virDomainDef *dst, + virDomainXMLOption *xmlopt); -bool virDomainDefCheckABIStabilityFlags(virDomainDefPtr src, - virDomainDefPtr dst, - virDomainXMLOptionPtr xmlopt, +bool virDomainDefCheckABIStabilityFlags(virDomainDef *src, + virDomainDef *dst, + virDomainXMLOption *xmlopt, unsigned int flags); -int virDomainDefAddImplicitDevices(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt); +int virDomainDefAddImplicitDevices(virDomainDef *def, + virDomainXMLOption *xmlopt); -virDomainIOThreadIDDefPtr virDomainIOThreadIDFind(const virDomainDef *def, - unsigned int iothread_id); -virDomainIOThreadIDDefPtr virDomainIOThreadIDAdd(virDomainDefPtr def, - unsigned int iothread_id); -void virDomainIOThreadIDDel(virDomainDefPtr def, unsigned int iothread_id); +virDomainIOThreadIDDef *virDomainIOThreadIDFind(const virDomainDef *def, + unsigned int iothread_id); +virDomainIOThreadIDDef *virDomainIOThreadIDAdd(virDomainDef *def, + unsigned int iothread_id); +void virDomainIOThreadIDDel(virDomainDef *def, unsigned int iothread_id); /* When extending this list, remember that libvirt 1.2.12-5.0.0 had a * bug that silently ignored unknown flags. A new flag to add @@ -3464,47 +3456,47 @@ void virDomainIOThreadIDDel(virDomainDefPtr def, unsigned int iothread_id); VIR_DOMAIN_XML_MIGRATABLE) unsigned int virDomainDefFormatConvertXMLFlags(unsigned int flags); -char *virDomainDefFormat(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, +char *virDomainDefFormat(virDomainDef *def, + virDomainXMLOption *xmlopt, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -char *virDomainObjFormat(virDomainObjPtr obj, - virDomainXMLOptionPtr xmlopt, +char *virDomainObjFormat(virDomainObj *obj, + virDomainXMLOption *xmlopt, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virDomainDefFormatInternal(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, - virBufferPtr buf, +int virDomainDefFormatInternal(virDomainDef *def, + virDomainXMLOption *xmlopt, + virBuffer *buf, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int virDomainDefFormatInternalSetRootName(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, - virBufferPtr buf, +int virDomainDefFormatInternalSetRootName(virDomainDef *def, + virDomainXMLOption *xmlopt, + virBuffer *buf, const char *rootname, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -int virDomainDiskSourceFormat(virBufferPtr buf, - virStorageSourcePtr src, +int virDomainDiskSourceFormat(virBuffer *buf, + virStorageSource *src, const char *element, int policy, bool attrIndex, unsigned int flags, bool skipAuth, bool skipEnc, - virDomainXMLOptionPtr xmlopt); + virDomainXMLOption *xmlopt); int -virDomainDiskBackingStoreFormat(virBufferPtr buf, - virStorageSourcePtr src, - virDomainXMLOptionPtr xmlopt, +virDomainDiskBackingStoreFormat(virBuffer *buf, + virStorageSource *src, + virDomainXMLOption *xmlopt, unsigned int flags); -int virDomainNetDefFormat(virBufferPtr buf, - virDomainNetDefPtr def, - virDomainXMLOptionPtr xmlopt, +int virDomainNetDefFormat(virBuffer *buf, + virDomainNetDef *def, + virDomainXMLOption *xmlopt, unsigned int flags); typedef enum { @@ -3513,71 +3505,71 @@ typedef enum { VIR_DOMAIN_DEVICE_ACTION_UPDATE, } virDomainDeviceAction; -int virDomainDefCompatibleDevice(virDomainDefPtr def, - virDomainDeviceDefPtr dev, - virDomainDeviceDefPtr oldDev, +int virDomainDefCompatibleDevice(virDomainDef *def, + virDomainDeviceDef *dev, + virDomainDeviceDef *oldDev, virDomainDeviceAction action, bool live); -void virDomainRNGDefFree(virDomainRNGDefPtr def); +void virDomainRNGDefFree(virDomainRNGDef *def); -int virDomainDiskIndexByAddress(virDomainDefPtr def, - virPCIDeviceAddressPtr pci_controller, - virDomainDeviceCCWAddressPtr ccw_addr, +int virDomainDiskIndexByAddress(virDomainDef *def, + virPCIDeviceAddress *pci_controller, + virDomainDeviceCCWAddress *ccw_addr, unsigned int bus, unsigned int target, unsigned int unit); -virDomainDiskDefPtr virDomainDiskByAddress(virDomainDefPtr def, - virPCIDeviceAddressPtr pci_controller, - virDomainDeviceCCWAddressPtr ccw_addr, - unsigned int bus, - unsigned int target, - unsigned int unit); -int virDomainDiskIndexByName(virDomainDefPtr def, const char *name, +virDomainDiskDef *virDomainDiskByAddress(virDomainDef *def, + virPCIDeviceAddress *pci_controller, + virDomainDeviceCCWAddress *ccw_addr, + unsigned int bus, + unsigned int target, + unsigned int unit); +int virDomainDiskIndexByName(virDomainDef *def, const char *name, bool allow_ambiguous); -virDomainDiskDefPtr virDomainDiskByName(virDomainDefPtr def, - const char *name, - bool allow_ambiguous); -virDomainDiskDefPtr -virDomainDiskByTarget(virDomainDefPtr def, +virDomainDiskDef *virDomainDiskByName(virDomainDef *def, + const char *name, + bool allow_ambiguous); +virDomainDiskDef * +virDomainDiskByTarget(virDomainDef *def, const char *dst); -void virDomainDiskInsert(virDomainDefPtr def, virDomainDiskDefPtr disk); -void virDomainDiskInsertPreAlloced(virDomainDefPtr def, - virDomainDiskDefPtr disk); +void virDomainDiskInsert(virDomainDef *def, virDomainDiskDef *disk); +void virDomainDiskInsertPreAlloced(virDomainDef *def, + virDomainDiskDef *disk); int virDomainStorageNetworkParseHost(xmlNodePtr hostnode, - virStorageNetHostDefPtr host); -int virDomainDiskDefAssignAddress(virDomainXMLOptionPtr xmlopt, - virDomainDiskDefPtr def, + virStorageNetHostDef *host); +int virDomainDiskDefAssignAddress(virDomainXMLOption *xmlopt, + virDomainDiskDef *def, const virDomainDef *vmdef); -virDomainDiskDefPtr -virDomainDiskRemove(virDomainDefPtr def, size_t i); -virDomainDiskDefPtr -virDomainDiskRemoveByName(virDomainDefPtr def, const char *name); +virDomainDiskDef * +virDomainDiskRemove(virDomainDef *def, size_t i); +virDomainDiskDef * +virDomainDiskRemoveByName(virDomainDef *def, const char *name); -int virDomainNetFindIdx(virDomainDefPtr def, virDomainNetDefPtr net); -virDomainNetDefPtr virDomainNetFind(virDomainDefPtr def, const char *device); -virDomainNetDefPtr virDomainNetFindByName(virDomainDefPtr def, const char *ifname); -bool virDomainHasNet(virDomainDefPtr def, virDomainNetDefPtr net); -int virDomainNetInsert(virDomainDefPtr def, virDomainNetDefPtr net); -int virDomainNetUpdate(virDomainDefPtr def, size_t netidx, virDomainNetDefPtr newnet); -int virDomainNetDHCPInterfaces(virDomainDefPtr def, virDomainInterfacePtr **ifaces); -int virDomainNetARPInterfaces(virDomainDefPtr def, virDomainInterfacePtr **ifaces); -virDomainNetDefPtr virDomainNetRemove(virDomainDefPtr def, size_t i); -void virDomainNetRemoveHostdev(virDomainDefPtr def, virDomainNetDefPtr net); +int virDomainNetFindIdx(virDomainDef *def, virDomainNetDef *net); +virDomainNetDef *virDomainNetFind(virDomainDef *def, const char *device); +virDomainNetDef *virDomainNetFindByName(virDomainDef *def, const char *ifname); +bool virDomainHasNet(virDomainDef *def, virDomainNetDef *net); +int virDomainNetInsert(virDomainDef *def, virDomainNetDef *net); +int virDomainNetUpdate(virDomainDef *def, size_t netidx, virDomainNetDef *newnet); +int virDomainNetDHCPInterfaces(virDomainDef *def, virDomainInterfacePtr **ifaces); +int virDomainNetARPInterfaces(virDomainDef *def, virDomainInterfacePtr **ifaces); +virDomainNetDef *virDomainNetRemove(virDomainDef *def, size_t i); +void virDomainNetRemoveHostdev(virDomainDef *def, virDomainNetDef *net); -int virDomainHostdevInsert(virDomainDefPtr def, virDomainHostdevDefPtr hostdev); -virDomainHostdevDefPtr -virDomainHostdevRemove(virDomainDefPtr def, size_t i); -int virDomainHostdevFind(virDomainDefPtr def, virDomainHostdevDefPtr match, - virDomainHostdevDefPtr *found); +int virDomainHostdevInsert(virDomainDef *def, virDomainHostdevDef *hostdev); +virDomainHostdevDef * +virDomainHostdevRemove(virDomainDef *def, size_t i); +int virDomainHostdevFind(virDomainDef *def, virDomainHostdevDef *match, + virDomainHostdevDef **found); -virDomainGraphicsListenDefPtr -virDomainGraphicsGetListen(virDomainGraphicsDefPtr def, size_t i); -int virDomainGraphicsListenAppendAddress(virDomainGraphicsDefPtr def, +virDomainGraphicsListenDef * +virDomainGraphicsGetListen(virDomainGraphicsDef *def, size_t i); +int virDomainGraphicsListenAppendAddress(virDomainGraphicsDef *def, const char *address) ATTRIBUTE_NONNULL(1); -int virDomainGraphicsListenAppendSocket(virDomainGraphicsDefPtr def, +int virDomainGraphicsListenAppendSocket(virDomainGraphicsDef *def, const char *socket) ATTRIBUTE_NONNULL(1); @@ -3586,7 +3578,7 @@ const char *virDomainNetGetActualBridgeName(const virDomainNetDef *iface); int virDomainNetGetActualBridgeMACTableManager(const virDomainNetDef *iface); const char *virDomainNetGetActualDirectDev(const virDomainNetDef *iface); int virDomainNetGetActualDirectMode(const virDomainNetDef *iface); -virDomainHostdevDefPtr virDomainNetGetActualHostdev(virDomainNetDefPtr iface); +virDomainHostdevDef *virDomainNetGetActualHostdev(virDomainNetDef *iface); const virNetDevVPortProfile * virDomainNetGetActualVirtPortProfile(const virDomainNetDef *iface); const virNetDevBandwidth * @@ -3596,40 +3588,40 @@ bool virDomainNetGetActualTrustGuestRxFilters(const virDomainNetDef *iface); virTristateBool virDomainNetGetActualPortOptionsIsolated(const virDomainNetDef *iface); const char *virDomainNetGetModelString(const virDomainNetDef *net); -int virDomainNetSetModelString(virDomainNetDefPtr et, +int virDomainNetSetModelString(virDomainNetDef *et, const char *model); bool virDomainNetIsVirtioModel(const virDomainNetDef *net); -int virDomainNetAppendIPAddress(virDomainNetDefPtr def, +int virDomainNetAppendIPAddress(virDomainNetDef *def, const char *address, int family, unsigned int prefix); -void virDomainControllerInsert(virDomainDefPtr def, virDomainControllerDefPtr controller); -void virDomainControllerInsertPreAlloced(virDomainDefPtr def, - virDomainControllerDefPtr controller); +void virDomainControllerInsert(virDomainDef *def, virDomainControllerDef *controller); +void virDomainControllerInsertPreAlloced(virDomainDef *def, + virDomainControllerDef *controller); int virDomainControllerFind(const virDomainDef *def, int type, int idx); -int virDomainControllerFindByType(virDomainDefPtr def, int type); -int virDomainControllerFindByCCWAddress(virDomainDefPtr def, - virDomainDeviceCCWAddressPtr addr); -int virDomainControllerFindByPCIAddress(virDomainDefPtr def, - virPCIDeviceAddressPtr addr); +int virDomainControllerFindByType(virDomainDef *def, int type); +int virDomainControllerFindByCCWAddress(virDomainDef *def, + virDomainDeviceCCWAddress *addr); +int virDomainControllerFindByPCIAddress(virDomainDef *def, + virPCIDeviceAddress *addr); int virDomainControllerFindUnusedIndex(virDomainDef const *def, int type); -virDomainControllerDefPtr virDomainControllerRemove(virDomainDefPtr def, size_t i); +virDomainControllerDef *virDomainControllerRemove(virDomainDef *def, size_t i); const char *virDomainControllerAliasFind(const virDomainDef *def, int type, int idx) ATTRIBUTE_NONNULL(1); -int virDomainLeaseIndex(virDomainDefPtr def, - virDomainLeaseDefPtr lease); -void virDomainLeaseInsert(virDomainDefPtr def, virDomainLeaseDefPtr lease); -void virDomainLeaseInsertPreAlloc(virDomainDefPtr def); -void virDomainLeaseInsertPreAlloced(virDomainDefPtr def, - virDomainLeaseDefPtr lease); -virDomainLeaseDefPtr -virDomainLeaseRemoveAt(virDomainDefPtr def, size_t i); -virDomainLeaseDefPtr -virDomainLeaseRemove(virDomainDefPtr def, - virDomainLeaseDefPtr lease); +int virDomainLeaseIndex(virDomainDef *def, + virDomainLeaseDef *lease); +void virDomainLeaseInsert(virDomainDef *def, virDomainLeaseDef *lease); +void virDomainLeaseInsertPreAlloc(virDomainDef *def); +void virDomainLeaseInsertPreAlloced(virDomainDef *def, + virDomainLeaseDef *lease); +virDomainLeaseDef * +virDomainLeaseRemoveAt(virDomainDef *def, size_t i); +virDomainLeaseDef * +virDomainLeaseRemove(virDomainDef *def, + virDomainLeaseDef *lease); void virDomainChrGetDomainPtrs(const virDomainDef *vmdef, @@ -3637,126 +3629,126 @@ virDomainChrGetDomainPtrs(const virDomainDef *vmdef, const virDomainChrDef ***arrPtr, size_t *cntPtr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -virDomainChrDefPtr -virDomainChrFind(virDomainDefPtr def, - virDomainChrDefPtr target); +virDomainChrDef * +virDomainChrFind(virDomainDef *def, + virDomainChrDef *target); bool -virDomainChrEquals(virDomainChrDefPtr src, - virDomainChrDefPtr tgt); +virDomainChrEquals(virDomainChrDef *src, + virDomainChrDef *tgt); int -virDomainChrPreAlloc(virDomainDefPtr vmdef, - virDomainChrDefPtr chr); +virDomainChrPreAlloc(virDomainDef *vmdef, + virDomainChrDef *chr); void -virDomainChrInsertPreAlloced(virDomainDefPtr vmdef, - virDomainChrDefPtr chr); -virDomainChrDefPtr -virDomainChrRemove(virDomainDefPtr vmdef, - virDomainChrDefPtr chr); +virDomainChrInsertPreAlloced(virDomainDef *vmdef, + virDomainChrDef *chr); +virDomainChrDef * +virDomainChrRemove(virDomainDef *vmdef, + virDomainChrDef *chr); -ssize_t virDomainRNGFind(virDomainDefPtr def, virDomainRNGDefPtr rng); -virDomainRNGDefPtr virDomainRNGRemove(virDomainDefPtr def, size_t idx); +ssize_t virDomainRNGFind(virDomainDef *def, virDomainRNGDef *rng); +virDomainRNGDef *virDomainRNGRemove(virDomainDef *def, size_t idx); -ssize_t virDomainRedirdevDefFind(virDomainDefPtr def, - virDomainRedirdevDefPtr redirdev); -virDomainRedirdevDefPtr virDomainRedirdevDefRemove(virDomainDefPtr def, size_t idx); +ssize_t virDomainRedirdevDefFind(virDomainDef *def, + virDomainRedirdevDef *redirdev); +virDomainRedirdevDef *virDomainRedirdevDefRemove(virDomainDef *def, size_t idx); -int virDomainDefSave(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, +int virDomainDefSave(virDomainDef *def, + virDomainXMLOption *xmlopt, const char *configDir) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int virDomainObjSave(virDomainObjPtr obj, - virDomainXMLOptionPtr xmlopt, +int virDomainObjSave(virDomainObj *obj, + virDomainXMLOption *xmlopt, const char *statusDir) G_GNUC_WARN_UNUSED_RESULT ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -typedef void (*virDomainLoadConfigNotify)(virDomainObjPtr dom, +typedef void (*virDomainLoadConfigNotify)(virDomainObj *dom, int newDomain, void *opaque); int virDomainDeleteConfig(const char *configDir, const char *autostartDir, - virDomainObjPtr dom); + virDomainObj *dom); char *virDomainConfigFile(const char *dir, const char *name); -int virDiskNameToBusDeviceIndex(virDomainDiskDefPtr disk, +int virDiskNameToBusDeviceIndex(virDomainDiskDef *disk, int *busIdx, int *devIdx); -virDomainFSDefPtr virDomainGetFilesystemForTarget(virDomainDefPtr def, +virDomainFSDef *virDomainGetFilesystemForTarget(virDomainDef *def, const char *target); -int virDomainFSInsert(virDomainDefPtr def, virDomainFSDefPtr fs); -int virDomainFSIndexByName(virDomainDefPtr def, const char *name); -virDomainFSDefPtr virDomainFSRemove(virDomainDefPtr def, size_t i); +int virDomainFSInsert(virDomainDef *def, virDomainFSDef *fs); +int virDomainFSIndexByName(virDomainDef *def, const char *name); +virDomainFSDef *virDomainFSRemove(virDomainDef *def, size_t i); unsigned int virDomainVideoDefaultRAM(const virDomainDef *def, const virDomainVideoType type); -typedef int (*virDomainSmartcardDefIterator)(virDomainDefPtr def, - virDomainSmartcardDefPtr dev, +typedef int (*virDomainSmartcardDefIterator)(virDomainDef *def, + virDomainSmartcardDef *dev, void *opaque); -int virDomainSmartcardDefForeach(virDomainDefPtr def, +int virDomainSmartcardDefForeach(virDomainDef *def, bool abortOnError, virDomainSmartcardDefIterator iter, void *opaque); -typedef int (*virDomainChrDefIterator)(virDomainDefPtr def, - virDomainChrDefPtr dev, +typedef int (*virDomainChrDefIterator)(virDomainDef *def, + virDomainChrDef *dev, void *opaque); -int virDomainChrDefForeach(virDomainDefPtr def, +int virDomainChrDefForeach(virDomainDef *def, bool abortOnError, virDomainChrDefIterator iter, void *opaque); -typedef int (*virDomainUSBDeviceDefIterator)(virDomainDeviceInfoPtr info, +typedef int (*virDomainUSBDeviceDefIterator)(virDomainDeviceInfo *info, void *opaque); -int virDomainUSBDeviceDefForeach(virDomainDefPtr def, +int virDomainUSBDeviceDefForeach(virDomainDef *def, virDomainUSBDeviceDefIterator iter, void *opaque, bool skipHubs); void -virDomainObjSetState(virDomainObjPtr obj, virDomainState state, int reason) +virDomainObjSetState(virDomainObj *obj, virDomainState state, int reason) ATTRIBUTE_NONNULL(1); virDomainState -virDomainObjGetState(virDomainObjPtr obj, int *reason) +virDomainObjGetState(virDomainObj *obj, int *reason) ATTRIBUTE_NONNULL(1); -virSecurityLabelDefPtr -virDomainDefGetSecurityLabelDef(virDomainDefPtr def, const char *model); +virSecurityLabelDef * +virDomainDefGetSecurityLabelDef(virDomainDef *def, const char *model); -virSecurityDeviceLabelDefPtr -virDomainChrSourceDefGetSecurityLabelDef(virDomainChrSourceDefPtr def, +virSecurityDeviceLabelDef * +virDomainChrSourceDefGetSecurityLabelDef(virDomainChrSourceDef *def, const char *model); typedef const char* (*virEventActionToStringFunc)(int type); typedef int (*virEventActionFromStringFunc)(const char *type); -int virDomainMemoryInsert(virDomainDefPtr def, virDomainMemoryDefPtr mem) +int virDomainMemoryInsert(virDomainDef *def, virDomainMemoryDef *mem) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -virDomainMemoryDefPtr virDomainMemoryRemove(virDomainDefPtr def, int idx) +virDomainMemoryDef *virDomainMemoryRemove(virDomainDef *def, int idx) ATTRIBUTE_NONNULL(1); -int virDomainMemoryFindByDef(virDomainDefPtr def, virDomainMemoryDefPtr mem) +int virDomainMemoryFindByDef(virDomainDef *def, virDomainMemoryDef *mem) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int virDomainMemoryFindInactiveByDef(virDomainDefPtr def, - virDomainMemoryDefPtr mem) +int virDomainMemoryFindInactiveByDef(virDomainDef *def, + virDomainMemoryDef *mem) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int virDomainShmemDefInsert(virDomainDefPtr def, virDomainShmemDefPtr shmem) +int virDomainShmemDefInsert(virDomainDef *def, virDomainShmemDef *shmem) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -bool virDomainShmemDefEquals(virDomainShmemDefPtr src, virDomainShmemDefPtr dst) +bool virDomainShmemDefEquals(virDomainShmemDef *src, virDomainShmemDef *dst) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -ssize_t virDomainShmemDefFind(virDomainDefPtr def, virDomainShmemDefPtr shmem) +ssize_t virDomainShmemDefFind(virDomainDef *def, virDomainShmemDef *shmem) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -virDomainShmemDefPtr virDomainShmemDefRemove(virDomainDefPtr def, size_t idx) +virDomainShmemDef *virDomainShmemDefRemove(virDomainDef *def, size_t idx) ATTRIBUTE_NONNULL(1); ssize_t virDomainInputDefFind(const virDomainDef *def, const virDomainInputDef *input) @@ -3893,50 +3885,50 @@ VIR_ENUM_DECL(virDomainCpuPlacementMode); VIR_ENUM_DECL(virDomainStartupPolicy); -virDomainControllerDefPtr -virDomainDefAddController(virDomainDefPtr def, int type, int idx, int model); +virDomainControllerDef * +virDomainDefAddController(virDomainDef *def, int type, int idx, int model); int -virDomainDefAddUSBController(virDomainDefPtr def, int idx, int model); +virDomainDefAddUSBController(virDomainDef *def, int idx, int model); int -virDomainDefMaybeAddController(virDomainDefPtr def, +virDomainDefMaybeAddController(virDomainDef *def, int type, int idx, int model); int -virDomainDefMaybeAddInput(virDomainDefPtr def, +virDomainDefMaybeAddInput(virDomainDef *def, int type, int bus); -char *virDomainDefGetDefaultEmulator(virDomainDefPtr def, virCapsPtr caps); +char *virDomainDefGetDefaultEmulator(virDomainDef *def, virCaps *caps); -int virDomainDefFindDevice(virDomainDefPtr def, +int virDomainDefFindDevice(virDomainDef *def, const char *devAlias, - virDomainDeviceDefPtr dev, + virDomainDeviceDef *dev, bool reportError); -virDomainAudioDefPtr +virDomainAudioDef * virDomainDefFindAudioByID(const virDomainDef *def, int id); bool -virDomainSoundModelSupportsCodecs(virDomainSoundDefPtr def); +virDomainSoundModelSupportsCodecs(virDomainSoundDef *def); bool -virDomainAudioIOCommonIsSet(virDomainAudioIOCommonPtr common); +virDomainAudioIOCommonIsSet(virDomainAudioIOCommon *common); -const char *virDomainChrSourceDefGetPath(virDomainChrSourceDefPtr chr); +const char *virDomainChrSourceDefGetPath(virDomainChrSourceDef *chr); -void virDomainChrSourceDefClear(virDomainChrSourceDefPtr def); +void virDomainChrSourceDefClear(virDomainChrSourceDef *def); -char *virDomainObjGetMetadata(virDomainObjPtr vm, +char *virDomainObjGetMetadata(virDomainObj *vm, int type, const char *uri, unsigned int flags); -int virDomainObjSetMetadata(virDomainObjPtr vm, +int virDomainObjSetMetadata(virDomainObj *vm, int type, const char *metadata, const char *key, const char *uri, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, const char *stateDir, const char *configDir, unsigned int flags); @@ -3949,14 +3941,14 @@ virDomainParseMemory(const char *xpath, bool required, bool capped); -bool virDomainDefNeedsPlacementAdvice(virDomainDefPtr def) +bool virDomainDefNeedsPlacementAdvice(virDomainDef *def) ATTRIBUTE_NONNULL(1); int virDomainDiskDefCheckDuplicateInfo(const virDomainDiskDef *a, const virDomainDiskDef *b) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -virStorageSourcePtr +virStorageSource * virDomainStorageSourceParseBase(const char *type, const char *format, const char *index) @@ -3964,24 +3956,24 @@ virDomainStorageSourceParseBase(const char *type, int virDomainStorageSourceParse(xmlNodePtr node, xmlXPathContextPtr ctxt, - virStorageSourcePtr src, + virStorageSource *src, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt, - virStorageSourcePtr src, + virStorageSource *src, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int virDomainDefGetVcpuPinInfoHelper(virDomainDefPtr def, +int virDomainDefGetVcpuPinInfoHelper(virDomainDef *def, int maplen, int ncpumaps, unsigned char *cpumaps, - virBitmapPtr hostcpus, - virBitmapPtr autoCpuset) + virBitmap *hostcpus, + virBitmap *autoCpuset) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) G_GNUC_WARN_UNUSED_RESULT; bool virDomainDefHasMemballoon(const virDomainDef *def) ATTRIBUTE_NONNULL(1); @@ -3989,12 +3981,12 @@ bool virDomainDefHasMemballoon(const virDomainDef *def) ATTRIBUTE_NONNULL(1); char *virDomainDefGetShortName(const virDomainDef *def) ATTRIBUTE_NONNULL(1); int -virDomainGetBlkioParametersAssignFromDef(virDomainDefPtr def, +virDomainGetBlkioParametersAssignFromDef(virDomainDef *def, virTypedParameterPtr params, int *nparams, int maxparams); -void virDomainDiskSetBlockIOTune(virDomainDiskDefPtr disk, +void virDomainDiskSetBlockIOTune(virDomainDiskDef *disk, virDomainBlockIoTuneInfo *info); bool @@ -4004,47 +3996,47 @@ bool virDomainDefLifecycleActionAllowed(virDomainLifecycle type, virDomainLifecycleAction action); -virNetworkPortDefPtr -virDomainNetDefToNetworkPort(virDomainDefPtr dom, - virDomainNetDefPtr iface); +virNetworkPortDef * +virDomainNetDefToNetworkPort(virDomainDef *dom, + virDomainNetDef *iface); int -virDomainNetDefActualFromNetworkPort(virDomainNetDefPtr iface, - virNetworkPortDefPtr port); +virDomainNetDefActualFromNetworkPort(virDomainNetDef *iface, + virNetworkPortDef *port); -virNetworkPortDefPtr -virDomainNetDefActualToNetworkPort(virDomainDefPtr dom, - virDomainNetDefPtr iface); +virNetworkPortDef * +virDomainNetDefActualToNetworkPort(virDomainDef *dom, + virDomainNetDef *iface); int virDomainNetAllocateActualDevice(virConnectPtr conn, - virDomainDefPtr dom, - virDomainNetDefPtr iface) + virDomainDef *dom, + virDomainNetDef *iface) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); void virDomainNetNotifyActualDevice(virConnectPtr conn, - virDomainDefPtr dom, - virDomainNetDefPtr iface) + virDomainDef *dom, + virDomainNetDef *iface) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int virDomainNetReleaseActualDevice(virConnectPtr conn, - virDomainDefPtr dom, - virDomainNetDefPtr iface) + virDomainDef *dom, + virDomainNetDef *iface) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int -virDomainNetBandwidthUpdate(virDomainNetDefPtr iface, - virNetDevBandwidthPtr newBandwidth) +virDomainNetBandwidthUpdate(virDomainNetDef *iface, + virNetDevBandwidth *newBandwidth) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int -virDomainNetResolveActualType(virDomainNetDefPtr iface) +virDomainNetResolveActualType(virDomainNetDef *iface) ATTRIBUTE_NONNULL(1); -int virDomainDiskTranslateSourcePool(virDomainDiskDefPtr def); +int virDomainDiskTranslateSourcePool(virDomainDiskDef *def); int virDomainDiskGetDetectZeroesMode(virDomainDiskDiscard discard, @@ -4097,7 +4089,7 @@ virDomainBlockIoTuneInfoHasAny(const virDomainBlockIoTuneInfo *iotune); void virDomainBlockIoTuneInfoCopy(const virDomainBlockIoTuneInfo *src, - virDomainBlockIoTuneInfoPtr dst); + virDomainBlockIoTuneInfo *dst); bool virDomainBlockIoTuneInfoEqual(const virDomainBlockIoTuneInfo *a, diff --git a/src/conf/domain_event.c b/src/conf/domain_event.c index 726a792dae..15a3baedf7 100644 --- a/src/conf/domain_event.c +++ b/src/conf/domain_event.c @@ -36,28 +36,28 @@ VIR_LOG_INIT("util.domain_event"); -static virClassPtr virDomainEventClass; -static virClassPtr virDomainEventLifecycleClass; -static virClassPtr virDomainEventRTCChangeClass; -static virClassPtr virDomainEventWatchdogClass; -static virClassPtr virDomainEventIOErrorClass; -static virClassPtr virDomainEventGraphicsClass; -static virClassPtr virDomainEventBlockJobClass; -static virClassPtr virDomainEventDiskChangeClass; -static virClassPtr virDomainEventTrayChangeClass; -static virClassPtr virDomainEventBalloonChangeClass; -static virClassPtr virDomainEventDeviceRemovedClass; -static virClassPtr virDomainEventPMClass; -static virClassPtr virDomainQemuMonitorEventClass; -static virClassPtr virDomainEventTunableClass; -static virClassPtr virDomainEventAgentLifecycleClass; -static virClassPtr virDomainEventDeviceAddedClass; -static virClassPtr virDomainEventMigrationIterationClass; -static virClassPtr virDomainEventJobCompletedClass; -static virClassPtr virDomainEventDeviceRemovalFailedClass; -static virClassPtr virDomainEventMetadataChangeClass; -static virClassPtr virDomainEventBlockThresholdClass; -static virClassPtr virDomainEventMemoryFailureClass; +static virClass *virDomainEventClass; +static virClass *virDomainEventLifecycleClass; +static virClass *virDomainEventRTCChangeClass; +static virClass *virDomainEventWatchdogClass; +static virClass *virDomainEventIOErrorClass; +static virClass *virDomainEventGraphicsClass; +static virClass *virDomainEventBlockJobClass; +static virClass *virDomainEventDiskChangeClass; +static virClass *virDomainEventTrayChangeClass; +static virClass *virDomainEventBalloonChangeClass; +static virClass *virDomainEventDeviceRemovedClass; +static virClass *virDomainEventPMClass; +static virClass *virDomainQemuMonitorEventClass; +static virClass *virDomainEventTunableClass; +static virClass *virDomainEventAgentLifecycleClass; +static virClass *virDomainEventDeviceAddedClass; +static virClass *virDomainEventMigrationIterationClass; +static virClass *virDomainEventJobCompletedClass; +static virClass *virDomainEventDeviceRemovalFailedClass; +static virClass *virDomainEventMetadataChangeClass; +static virClass *virDomainEventBlockThresholdClass; +static virClass *virDomainEventMemoryFailureClass; static void virDomainEventDispose(void *obj); static void virDomainEventLifecycleDispose(void *obj); @@ -84,13 +84,13 @@ static void virDomainEventMemoryFailureDispose(void *obj); static void virDomainEventDispatchDefaultFunc(virConnectPtr conn, - virObjectEventPtr event, + virObjectEvent *event, virConnectObjectEventGenericCallback cb, void *cbopaque); static void virDomainQemuMonitorEventDispatchFunc(virConnectPtr conn, - virObjectEventPtr event, + virObjectEvent *event, virConnectObjectEventGenericCallback cb, void *cbopaque); @@ -101,7 +101,6 @@ struct _virDomainEvent { bool dummy; }; typedef struct _virDomainEvent virDomainEvent; -typedef virDomainEvent *virDomainEventPtr; struct _virDomainEventLifecycle { virDomainEvent parent; @@ -110,7 +109,6 @@ struct _virDomainEventLifecycle { int detail; }; typedef struct _virDomainEventLifecycle virDomainEventLifecycle; -typedef virDomainEventLifecycle *virDomainEventLifecyclePtr; struct _virDomainEventRTCChange { virDomainEvent parent; @@ -118,7 +116,6 @@ struct _virDomainEventRTCChange { long long offset; }; typedef struct _virDomainEventRTCChange virDomainEventRTCChange; -typedef virDomainEventRTCChange *virDomainEventRTCChangePtr; struct _virDomainEventWatchdog { virDomainEvent parent; @@ -126,7 +123,6 @@ struct _virDomainEventWatchdog { int action; }; typedef struct _virDomainEventWatchdog virDomainEventWatchdog; -typedef virDomainEventWatchdog *virDomainEventWatchdogPtr; struct _virDomainEventIOError { virDomainEvent parent; @@ -137,7 +133,6 @@ struct _virDomainEventIOError { char *reason; }; typedef struct _virDomainEventIOError virDomainEventIOError; -typedef virDomainEventIOError *virDomainEventIOErrorPtr; struct _virDomainEventBlockJob { virDomainEvent parent; @@ -147,7 +142,6 @@ struct _virDomainEventBlockJob { int status; }; typedef struct _virDomainEventBlockJob virDomainEventBlockJob; -typedef virDomainEventBlockJob *virDomainEventBlockJobPtr; struct _virDomainEventGraphics { virDomainEvent parent; @@ -159,7 +153,6 @@ struct _virDomainEventGraphics { virDomainEventGraphicsSubjectPtr subject; }; typedef struct _virDomainEventGraphics virDomainEventGraphics; -typedef virDomainEventGraphics *virDomainEventGraphicsPtr; struct _virDomainEventDiskChange { virDomainEvent parent; @@ -170,7 +163,6 @@ struct _virDomainEventDiskChange { int reason; }; typedef struct _virDomainEventDiskChange virDomainEventDiskChange; -typedef virDomainEventDiskChange *virDomainEventDiskChangePtr; struct _virDomainEventTrayChange { virDomainEvent parent; @@ -179,7 +171,6 @@ struct _virDomainEventTrayChange { int reason; }; typedef struct _virDomainEventTrayChange virDomainEventTrayChange; -typedef virDomainEventTrayChange *virDomainEventTrayChangePtr; struct _virDomainEventBalloonChange { virDomainEvent parent; @@ -188,7 +179,6 @@ struct _virDomainEventBalloonChange { unsigned long long actual; }; typedef struct _virDomainEventBalloonChange virDomainEventBalloonChange; -typedef virDomainEventBalloonChange *virDomainEventBalloonChangePtr; struct _virDomainEventDeviceRemoved { virDomainEvent parent; @@ -196,7 +186,6 @@ struct _virDomainEventDeviceRemoved { char *devAlias; }; typedef struct _virDomainEventDeviceRemoved virDomainEventDeviceRemoved; -typedef virDomainEventDeviceRemoved *virDomainEventDeviceRemovedPtr; struct _virDomainEventDeviceAdded { virDomainEvent parent; @@ -204,7 +193,6 @@ struct _virDomainEventDeviceAdded { char *devAlias; }; typedef struct _virDomainEventDeviceAdded virDomainEventDeviceAdded; -typedef virDomainEventDeviceAdded *virDomainEventDeviceAddedPtr; struct _virDomainEventPM { virDomainEvent parent; @@ -212,7 +200,6 @@ struct _virDomainEventPM { int reason; }; typedef struct _virDomainEventPM virDomainEventPM; -typedef virDomainEventPM *virDomainEventPMPtr; struct _virDomainQemuMonitorEvent { virObjectEvent parent; @@ -223,7 +210,6 @@ struct _virDomainQemuMonitorEvent { char *details; }; typedef struct _virDomainQemuMonitorEvent virDomainQemuMonitorEvent; -typedef virDomainQemuMonitorEvent *virDomainQemuMonitorEventPtr; struct _virDomainEventTunable { virDomainEvent parent; @@ -232,7 +218,6 @@ struct _virDomainEventTunable { int nparams; }; typedef struct _virDomainEventTunable virDomainEventTunable; -typedef virDomainEventTunable *virDomainEventTunablePtr; struct _virDomainEventAgentLifecycle { virDomainEvent parent; @@ -241,7 +226,6 @@ struct _virDomainEventAgentLifecycle { int reason; }; typedef struct _virDomainEventAgentLifecycle virDomainEventAgentLifecycle; -typedef virDomainEventAgentLifecycle *virDomainEventAgentLifecyclePtr; struct _virDomainEventMigrationIteration { virDomainEvent parent; @@ -249,7 +233,6 @@ struct _virDomainEventMigrationIteration { int iteration; }; typedef struct _virDomainEventMigrationIteration virDomainEventMigrationIteration; -typedef virDomainEventMigrationIteration *virDomainEventMigrationIterationPtr; struct _virDomainEventJobCompleted { virDomainEvent parent; @@ -258,7 +241,6 @@ struct _virDomainEventJobCompleted { int nparams; }; typedef struct _virDomainEventJobCompleted virDomainEventJobCompleted; -typedef virDomainEventJobCompleted *virDomainEventJobCompletedPtr; struct _virDomainEventDeviceRemovalFailed { virDomainEvent parent; @@ -266,7 +248,6 @@ struct _virDomainEventDeviceRemovalFailed { char *devAlias; }; typedef struct _virDomainEventDeviceRemovalFailed virDomainEventDeviceRemovalFailed; -typedef virDomainEventDeviceRemovalFailed *virDomainEventDeviceRemovalFailedPtr; struct _virDomainEventMetadataChange { virDomainEvent parent; @@ -275,7 +256,6 @@ struct _virDomainEventMetadataChange { char *nsuri; }; typedef struct _virDomainEventMetadataChange virDomainEventMetadataChange; -typedef virDomainEventMetadataChange *virDomainEventMetadataChangePtr; struct _virDomainEventBlockThreshold { virDomainEvent parent; @@ -287,7 +267,6 @@ struct _virDomainEventBlockThreshold { unsigned long long excess; }; typedef struct _virDomainEventBlockThreshold virDomainEventBlockThreshold; -typedef virDomainEventBlockThreshold *virDomainEventBlockThresholdPtr; struct _virDomainEventMemoryFailure { virDomainEvent parent; @@ -297,7 +276,6 @@ struct _virDomainEventMemoryFailure { unsigned int flags; }; typedef struct _virDomainEventMemoryFailure virDomainEventMemoryFailure; -typedef virDomainEventMemoryFailure *virDomainEventMemoryFailurePtr; static int virDomainEventsOnceInit(void) @@ -355,7 +333,7 @@ VIR_ONCE_GLOBAL_INIT(virDomainEvents); static void virDomainEventDispose(void *obj) { - virDomainEventPtr event = obj; + virDomainEvent *event = obj; VIR_DEBUG("obj=%p", event); } @@ -363,28 +341,28 @@ virDomainEventDispose(void *obj) static void virDomainEventLifecycleDispose(void *obj) { - virDomainEventLifecyclePtr event = obj; + virDomainEventLifecycle *event = obj; VIR_DEBUG("obj=%p", event); } static void virDomainEventRTCChangeDispose(void *obj) { - virDomainEventRTCChangePtr event = obj; + virDomainEventRTCChange *event = obj; VIR_DEBUG("obj=%p", event); } static void virDomainEventWatchdogDispose(void *obj) { - virDomainEventWatchdogPtr event = obj; + virDomainEventWatchdog *event = obj; VIR_DEBUG("obj=%p", event); } static void virDomainEventIOErrorDispose(void *obj) { - virDomainEventIOErrorPtr event = obj; + virDomainEventIOError *event = obj; VIR_DEBUG("obj=%p", event); g_free(event->srcPath); @@ -395,7 +373,7 @@ virDomainEventIOErrorDispose(void *obj) static void virDomainEventGraphicsDispose(void *obj) { - virDomainEventGraphicsPtr event = obj; + virDomainEventGraphics *event = obj; VIR_DEBUG("obj=%p", event); if (event->local) { @@ -422,7 +400,7 @@ virDomainEventGraphicsDispose(void *obj) static void virDomainEventBlockJobDispose(void *obj) { - virDomainEventBlockJobPtr event = obj; + virDomainEventBlockJob *event = obj; VIR_DEBUG("obj=%p", event); g_free(event->disk); @@ -431,7 +409,7 @@ virDomainEventBlockJobDispose(void *obj) static void virDomainEventDiskChangeDispose(void *obj) { - virDomainEventDiskChangePtr event = obj; + virDomainEventDiskChange *event = obj; VIR_DEBUG("obj=%p", event); g_free(event->oldSrcPath); @@ -442,7 +420,7 @@ virDomainEventDiskChangeDispose(void *obj) static void virDomainEventTrayChangeDispose(void *obj) { - virDomainEventTrayChangePtr event = obj; + virDomainEventTrayChange *event = obj; VIR_DEBUG("obj=%p", event); g_free(event->devAlias); @@ -451,14 +429,14 @@ virDomainEventTrayChangeDispose(void *obj) static void virDomainEventBalloonChangeDispose(void *obj) { - virDomainEventBalloonChangePtr event = obj; + virDomainEventBalloonChange *event = obj; VIR_DEBUG("obj=%p", event); } static void virDomainEventDeviceRemovedDispose(void *obj) { - virDomainEventDeviceRemovedPtr event = obj; + virDomainEventDeviceRemoved *event = obj; VIR_DEBUG("obj=%p", event); g_free(event->devAlias); @@ -467,7 +445,7 @@ virDomainEventDeviceRemovedDispose(void *obj) static void virDomainEventDeviceAddedDispose(void *obj) { - virDomainEventDeviceAddedPtr event = obj; + virDomainEventDeviceAdded *event = obj; VIR_DEBUG("obj=%p", event); g_free(event->devAlias); @@ -477,7 +455,7 @@ virDomainEventDeviceAddedDispose(void *obj) static void virDomainEventDeviceRemovalFailedDispose(void *obj) { - virDomainEventDeviceRemovalFailedPtr event = obj; + virDomainEventDeviceRemovalFailed *event = obj; VIR_DEBUG("obj=%p", event); g_free(event->devAlias); @@ -487,14 +465,14 @@ virDomainEventDeviceRemovalFailedDispose(void *obj) static void virDomainEventPMDispose(void *obj) { - virDomainEventPMPtr event = obj; + virDomainEventPM *event = obj; VIR_DEBUG("obj=%p", event); } static void virDomainQemuMonitorEventDispose(void *obj) { - virDomainQemuMonitorEventPtr event = obj; + virDomainQemuMonitorEvent *event = obj; VIR_DEBUG("obj=%p", event); g_free(event->event); @@ -504,7 +482,7 @@ virDomainQemuMonitorEventDispose(void *obj) static void virDomainEventTunableDispose(void *obj) { - virDomainEventTunablePtr event = obj; + virDomainEventTunable *event = obj; VIR_DEBUG("obj=%p", event); virTypedParamsFree(event->params, event->nparams); @@ -513,21 +491,21 @@ virDomainEventTunableDispose(void *obj) static void virDomainEventAgentLifecycleDispose(void *obj) { - virDomainEventAgentLifecyclePtr event = obj; + virDomainEventAgentLifecycle *event = obj; VIR_DEBUG("obj=%p", event); }; static void virDomainEventMigrationIterationDispose(void *obj) { - virDomainEventMigrationIterationPtr event = obj; + virDomainEventMigrationIteration *event = obj; VIR_DEBUG("obj=%p", event); }; static void virDomainEventJobCompletedDispose(void *obj) { - virDomainEventJobCompletedPtr event = obj; + virDomainEventJobCompleted *event = obj; VIR_DEBUG("obj=%p", event); virTypedParamsFree(event->params, event->nparams); @@ -537,7 +515,7 @@ virDomainEventJobCompletedDispose(void *obj) static void virDomainEventMetadataChangeDispose(void *obj) { - virDomainEventMetadataChangePtr event = obj; + virDomainEventMetadataChange *event = obj; VIR_DEBUG("obj=%p", event); g_free(event->nsuri); @@ -547,7 +525,7 @@ virDomainEventMetadataChangeDispose(void *obj) static void virDomainEventBlockThresholdDispose(void *obj) { - virDomainEventBlockThresholdPtr event = obj; + virDomainEventBlockThreshold *event = obj; VIR_DEBUG("obj=%p", event); g_free(event->dev); @@ -558,19 +536,19 @@ virDomainEventBlockThresholdDispose(void *obj) static void virDomainEventMemoryFailureDispose(void *obj) { - virDomainEventMemoryFailurePtr event = obj; + virDomainEventMemoryFailure *event = obj; VIR_DEBUG("obj=%p", event); } static void * -virDomainEventNew(virClassPtr klass, +virDomainEventNew(virClass *klass, int eventID, int id, const char *name, const unsigned char *uuid) { - virDomainEventPtr event; + virDomainEvent *event; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (virDomainEventsInitialize() < 0) @@ -593,17 +571,17 @@ virDomainEventNew(virClassPtr klass, id, name, uuid, uuidstr))) return NULL; - return (virObjectEventPtr)event; + return (virObjectEvent *)event; } -virObjectEventPtr +virObjectEvent * virDomainEventLifecycleNew(int id, const char *name, const unsigned char *uuid, int type, int detail) { - virDomainEventLifecyclePtr event; + virDomainEventLifecycle *event; if (virDomainEventsInitialize() < 0) return NULL; @@ -616,10 +594,10 @@ virDomainEventLifecycleNew(int id, event->type = type; event->detail = detail; - return (virObjectEventPtr)event; + return (virObjectEvent *)event; } -virObjectEventPtr +virObjectEvent * virDomainEventLifecycleNewFromDom(virDomainPtr dom, int type, int detail) @@ -628,16 +606,16 @@ virDomainEventLifecycleNewFromDom(virDomainPtr dom, type, detail); } -virObjectEventPtr -virDomainEventLifecycleNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventLifecycleNewFromObj(virDomainObj *obj, int type, int detail) { return virDomainEventLifecycleNewFromDef(obj->def, type, detail); } -virObjectEventPtr -virDomainEventLifecycleNewFromDef(virDomainDefPtr def, +virObjectEvent * +virDomainEventLifecycleNewFromDef(virDomainDef *def, int type, int detail) { @@ -645,7 +623,7 @@ virDomainEventLifecycleNewFromDef(virDomainDefPtr def, type, detail); } -virObjectEventPtr +virObjectEvent * virDomainEventRebootNew(int id, const char *name, const unsigned char *uuid) @@ -658,7 +636,7 @@ virDomainEventRebootNew(int id, id, name, uuid); } -virObjectEventPtr +virObjectEvent * virDomainEventRebootNewFromDom(virDomainPtr dom) { if (virDomainEventsInitialize() < 0) @@ -669,8 +647,8 @@ virDomainEventRebootNewFromDom(virDomainPtr dom) dom->id, dom->name, dom->uuid); } -virObjectEventPtr -virDomainEventRebootNewFromObj(virDomainObjPtr obj) +virObjectEvent * +virDomainEventRebootNewFromObj(virDomainObj *obj) { if (virDomainEventsInitialize() < 0) return NULL; @@ -680,11 +658,11 @@ virDomainEventRebootNewFromObj(virDomainObjPtr obj) obj->def->id, obj->def->name, obj->def->uuid); } -virObjectEventPtr +virObjectEvent * virDomainEventRTCChangeNewFromDom(virDomainPtr dom, long long offset) { - virDomainEventRTCChangePtr ev; + virDomainEventRTCChange *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -696,13 +674,13 @@ virDomainEventRTCChangeNewFromDom(virDomainPtr dom, ev->offset = offset; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventRTCChangeNewFromObj(virDomainObj *obj, long long offset) { - virDomainEventRTCChangePtr ev; + virDomainEventRTCChange *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -715,14 +693,14 @@ virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj, ev->offset = offset; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr +virObjectEvent * virDomainEventWatchdogNewFromDom(virDomainPtr dom, int action) { - virDomainEventWatchdogPtr ev; + virDomainEventWatchdog *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -734,13 +712,13 @@ virDomainEventWatchdogNewFromDom(virDomainPtr dom, ev->action = action; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventWatchdogNewFromObj(virDomainObj *obj, int action) { - virDomainEventWatchdogPtr ev; + virDomainEventWatchdog *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -753,10 +731,10 @@ virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, ev->action = action; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -static virObjectEventPtr +static virObjectEvent * virDomainEventIOErrorNewFromDomImpl(int event, virDomainPtr dom, const char *srcPath, @@ -764,7 +742,7 @@ virDomainEventIOErrorNewFromDomImpl(int event, int action, const char *reason) { - virDomainEventIOErrorPtr ev; + virDomainEventIOError *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -778,18 +756,18 @@ virDomainEventIOErrorNewFromDomImpl(int event, ev->devAlias = g_strdup(devAlias); ev->reason = g_strdup(reason); - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -static virObjectEventPtr +static virObjectEvent * virDomainEventIOErrorNewFromObjImpl(int event, - virDomainObjPtr obj, + virDomainObj *obj, const char *srcPath, const char *devAlias, int action, const char *reason) { - virDomainEventIOErrorPtr ev; + virDomainEventIOError *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -804,10 +782,10 @@ virDomainEventIOErrorNewFromObjImpl(int event, ev->devAlias = g_strdup(devAlias); ev->reason = g_strdup(reason); - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr +virObjectEvent * virDomainEventIOErrorNewFromDom(virDomainPtr dom, const char *srcPath, const char *devAlias, @@ -818,8 +796,8 @@ virDomainEventIOErrorNewFromDom(virDomainPtr dom, action, NULL); } -virObjectEventPtr -virDomainEventIOErrorNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventIOErrorNewFromObj(virDomainObj *obj, const char *srcPath, const char *devAlias, int action) @@ -829,7 +807,7 @@ virDomainEventIOErrorNewFromObj(virDomainObjPtr obj, action, NULL); } -virObjectEventPtr +virObjectEvent * virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom, const char *srcPath, const char *devAlias, @@ -841,8 +819,8 @@ virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom, action, reason); } -virObjectEventPtr -virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventIOErrorReasonNewFromObj(virDomainObj *obj, const char *srcPath, const char *devAlias, int action, @@ -854,7 +832,7 @@ virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj, } -virObjectEventPtr +virObjectEvent * virDomainEventGraphicsNewFromDom(virDomainPtr dom, int phase, virDomainEventGraphicsAddressPtr local, @@ -862,7 +840,7 @@ virDomainEventGraphicsNewFromDom(virDomainPtr dom, const char *authScheme, virDomainEventGraphicsSubjectPtr subject) { - virDomainEventGraphicsPtr ev; + virDomainEventGraphics *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -878,18 +856,18 @@ virDomainEventGraphicsNewFromDom(virDomainPtr dom, ev->remote = remote; ev->subject = subject; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventGraphicsNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventGraphicsNewFromObj(virDomainObj *obj, int phase, virDomainEventGraphicsAddressPtr local, virDomainEventGraphicsAddressPtr remote, const char *authScheme, virDomainEventGraphicsSubjectPtr subject) { - virDomainEventGraphicsPtr ev; + virDomainEventGraphics *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -906,10 +884,10 @@ virDomainEventGraphicsNewFromObj(virDomainObjPtr obj, ev->remote = remote; ev->subject = subject; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -static virObjectEventPtr +static virObjectEvent * virDomainEventBlockJobNew(int event, int id, const char *name, @@ -918,7 +896,7 @@ virDomainEventBlockJobNew(int event, int type, int status) { - virDomainEventBlockJobPtr ev; + virDomainEventBlockJob *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -932,11 +910,11 @@ virDomainEventBlockJobNew(int event, ev->type = type; ev->status = status; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventBlockJobNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventBlockJobNewFromObj(virDomainObj *obj, const char *path, int type, int status) @@ -946,7 +924,7 @@ virDomainEventBlockJobNewFromObj(virDomainObjPtr obj, obj->def->uuid, path, type, status); } -virObjectEventPtr +virObjectEvent * virDomainEventBlockJobNewFromDom(virDomainPtr dom, const char *path, int type, @@ -957,8 +935,8 @@ virDomainEventBlockJobNewFromDom(virDomainPtr dom, path, type, status); } -virObjectEventPtr -virDomainEventBlockJob2NewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventBlockJob2NewFromObj(virDomainObj *obj, const char *dst, int type, int status) @@ -968,7 +946,7 @@ virDomainEventBlockJob2NewFromObj(virDomainObjPtr obj, obj->def->uuid, dst, type, status); } -virObjectEventPtr +virObjectEvent * virDomainEventBlockJob2NewFromDom(virDomainPtr dom, const char *dst, int type, @@ -979,10 +957,10 @@ virDomainEventBlockJob2NewFromDom(virDomainPtr dom, dst, type, status); } -virObjectEventPtr +virObjectEvent * virDomainEventControlErrorNewFromDom(virDomainPtr dom) { - virObjectEventPtr ev; + virObjectEvent *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -995,10 +973,10 @@ virDomainEventControlErrorNewFromDom(virDomainPtr dom) } -virObjectEventPtr -virDomainEventControlErrorNewFromObj(virDomainObjPtr obj) +virObjectEvent * +virDomainEventControlErrorNewFromObj(virDomainObj *obj) { - virObjectEventPtr ev; + virObjectEvent *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1011,7 +989,7 @@ virDomainEventControlErrorNewFromObj(virDomainObjPtr obj) return ev; } -static virObjectEventPtr +static virObjectEvent * virDomainEventDiskChangeNew(int id, const char *name, unsigned char *uuid, @@ -1020,7 +998,7 @@ virDomainEventDiskChangeNew(int id, const char *devAlias, int reason) { - virDomainEventDiskChangePtr ev; + virDomainEventDiskChange *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1036,11 +1014,11 @@ virDomainEventDiskChangeNew(int id, ev->reason = reason; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventDiskChangeNewFromObj(virDomainObj *obj, const char *oldSrcPath, const char *newSrcPath, const char *devAlias, @@ -1051,7 +1029,7 @@ virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj, newSrcPath, devAlias, reason); } -virObjectEventPtr +virObjectEvent * virDomainEventDiskChangeNewFromDom(virDomainPtr dom, const char *oldSrcPath, const char *newSrcPath, @@ -1063,14 +1041,14 @@ virDomainEventDiskChangeNewFromDom(virDomainPtr dom, devAlias, reason); } -static virObjectEventPtr +static virObjectEvent * virDomainEventTrayChangeNew(int id, const char *name, unsigned char *uuid, const char *devAlias, int reason) { - virDomainEventTrayChangePtr ev; + virDomainEventTrayChange *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1084,11 +1062,11 @@ virDomainEventTrayChangeNew(int id, ev->reason = reason; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventTrayChangeNewFromObj(virDomainObj *obj, const char *devAlias, int reason) { @@ -1099,7 +1077,7 @@ virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj, reason); } -virObjectEventPtr +virObjectEvent * virDomainEventTrayChangeNewFromDom(virDomainPtr dom, const char *devAlias, int reason) @@ -1108,13 +1086,13 @@ virDomainEventTrayChangeNewFromDom(virDomainPtr dom, devAlias, reason); } -static virObjectEventPtr +static virObjectEvent * virDomainEventPMWakeupNew(int id, const char *name, unsigned char *uuid, int reason) { - virDomainEventPMPtr ev; + virDomainEventPM *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1125,11 +1103,11 @@ virDomainEventPMWakeupNew(int id, return NULL; ev->reason = reason; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj) +virObjectEvent * +virDomainEventPMWakeupNewFromObj(virDomainObj *obj) { return virDomainEventPMWakeupNew(obj->def->id, obj->def->name, @@ -1137,19 +1115,19 @@ virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj) 0); } -virObjectEventPtr +virObjectEvent * virDomainEventPMWakeupNewFromDom(virDomainPtr dom, int reason) { return virDomainEventPMWakeupNew(dom->id, dom->name, dom->uuid, reason); } -static virObjectEventPtr +static virObjectEvent * virDomainEventPMSuspendNew(int id, const char *name, unsigned char *uuid, int reason) { - virDomainEventPMPtr ev; + virDomainEventPM *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1160,11 +1138,11 @@ virDomainEventPMSuspendNew(int id, return NULL; ev->reason = reason; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj) +virObjectEvent * +virDomainEventPMSuspendNewFromObj(virDomainObj *obj) { return virDomainEventPMSuspendNew(obj->def->id, obj->def->name, @@ -1172,19 +1150,19 @@ virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj) 0); } -virObjectEventPtr +virObjectEvent * virDomainEventPMSuspendNewFromDom(virDomainPtr dom, int reason) { return virDomainEventPMSuspendNew(dom->id, dom->name, dom->uuid, reason); } -static virObjectEventPtr +static virObjectEvent * virDomainEventPMSuspendDiskNew(int id, const char *name, unsigned char *uuid, int reason) { - virDomainEventPMPtr ev; + virDomainEventPM *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1195,11 +1173,11 @@ virDomainEventPMSuspendDiskNew(int id, return NULL; ev->reason = reason; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj) +virObjectEvent * +virDomainEventPMSuspendDiskNewFromObj(virDomainObj *obj) { return virDomainEventPMSuspendDiskNew(obj->def->id, obj->def->name, @@ -1207,18 +1185,18 @@ virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj) 0); } -virObjectEventPtr +virObjectEvent * virDomainEventPMSuspendDiskNewFromDom(virDomainPtr dom, int reason) { return virDomainEventPMSuspendDiskNew(dom->id, dom->name, dom->uuid, reason); } -virObjectEventPtr +virObjectEvent * virDomainEventBalloonChangeNewFromDom(virDomainPtr dom, unsigned long long actual) { - virDomainEventBalloonChangePtr ev; + virDomainEventBalloonChange *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1230,13 +1208,13 @@ virDomainEventBalloonChangeNewFromDom(virDomainPtr dom, ev->actual = actual; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventBalloonChangeNewFromObj(virDomainObj *obj, unsigned long long actual) { - virDomainEventBalloonChangePtr ev; + virDomainEventBalloonChange *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1248,16 +1226,16 @@ virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj, ev->actual = actual; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -static virObjectEventPtr +static virObjectEvent * virDomainEventDeviceRemovedNew(int id, const char *name, unsigned char *uuid, const char *devAlias) { - virDomainEventDeviceRemovedPtr ev; + virDomainEventDeviceRemoved *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1269,18 +1247,18 @@ virDomainEventDeviceRemovedNew(int id, ev->devAlias = g_strdup(devAlias); - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventDeviceRemovedNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventDeviceRemovedNewFromObj(virDomainObj *obj, const char *devAlias) { return virDomainEventDeviceRemovedNew(obj->def->id, obj->def->name, obj->def->uuid, devAlias); } -virObjectEventPtr +virObjectEvent * virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, const char *devAlias) { @@ -1288,13 +1266,13 @@ virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, devAlias); } -static virObjectEventPtr +static virObjectEvent * virDomainEventDeviceAddedNew(int id, const char *name, unsigned char *uuid, const char *devAlias) { - virDomainEventDeviceAddedPtr ev; + virDomainEventDeviceAdded *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1306,33 +1284,33 @@ virDomainEventDeviceAddedNew(int id, ev->devAlias = g_strdup(devAlias); - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventDeviceAddedNewFromObj(virDomainObjPtr obj, - const char *devAlias) +virObjectEvent * +virDomainEventDeviceAddedNewFromObj(virDomainObj *obj, + const char *devAlias) { return virDomainEventDeviceAddedNew(obj->def->id, obj->def->name, obj->def->uuid, devAlias); } -virObjectEventPtr +virObjectEvent * virDomainEventDeviceAddedNewFromDom(virDomainPtr dom, - const char *devAlias) + const char *devAlias) { return virDomainEventDeviceAddedNew(dom->id, dom->name, dom->uuid, devAlias); } -static virObjectEventPtr +static virObjectEvent * virDomainEventDeviceRemovalFailedNew(int id, const char *name, unsigned char *uuid, const char *devAlias) { - virDomainEventDeviceRemovalFailedPtr ev; + virDomainEventDeviceRemovalFailed *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1344,18 +1322,18 @@ virDomainEventDeviceRemovalFailedNew(int id, ev->devAlias = g_strdup(devAlias); - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventDeviceRemovalFailedNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventDeviceRemovalFailedNewFromObj(virDomainObj *obj, const char *devAlias) { return virDomainEventDeviceRemovalFailedNew(obj->def->id, obj->def->name, obj->def->uuid, devAlias); } -virObjectEventPtr +virObjectEvent * virDomainEventDeviceRemovalFailedNewFromDom(virDomainPtr dom, const char *devAlias) { @@ -1364,14 +1342,14 @@ virDomainEventDeviceRemovalFailedNewFromDom(virDomainPtr dom, } -static virObjectEventPtr +static virObjectEvent * virDomainEventAgentLifecycleNew(int id, const char *name, const unsigned char *uuid, int state, int reason) { - virDomainEventAgentLifecyclePtr ev; + virDomainEventAgentLifecycle *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1384,11 +1362,11 @@ virDomainEventAgentLifecycleNew(int id, ev->state = state; ev->reason = reason; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventAgentLifecycleNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventAgentLifecycleNewFromObj(virDomainObj *obj, int state, int reason) { @@ -1396,7 +1374,7 @@ virDomainEventAgentLifecycleNewFromObj(virDomainObjPtr obj, obj->def->uuid, state, reason); } -virObjectEventPtr +virObjectEvent * virDomainEventAgentLifecycleNewFromDom(virDomainPtr dom, int state, int reason) @@ -1405,13 +1383,13 @@ virDomainEventAgentLifecycleNewFromDom(virDomainPtr dom, state, reason); } -static virObjectEventPtr +static virObjectEvent * virDomainEventMigrationIterationNew(int id, const char *name, const unsigned char *uuid, int iteration) { - virDomainEventMigrationIterationPtr ev; + virDomainEventMigrationIteration *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1423,18 +1401,18 @@ virDomainEventMigrationIterationNew(int id, ev->iteration = iteration; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventMigrationIterationNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventMigrationIterationNewFromObj(virDomainObj *obj, int iteration) { return virDomainEventMigrationIterationNew(obj->def->id, obj->def->name, obj->def->uuid, iteration); } -virObjectEventPtr +virObjectEvent * virDomainEventMigrationIterationNewFromDom(virDomainPtr dom, int iteration) { @@ -1444,14 +1422,14 @@ virDomainEventMigrationIterationNewFromDom(virDomainPtr dom, /* This function consumes @params, the caller must not free it. */ -static virObjectEventPtr +static virObjectEvent * virDomainEventJobCompletedNew(int id, const char *name, const unsigned char *uuid, virTypedParameterPtr params, int nparams) { - virDomainEventJobCompletedPtr ev; + virDomainEventJobCompleted *ev; if (virDomainEventsInitialize() < 0) goto error; @@ -1464,15 +1442,15 @@ virDomainEventJobCompletedNew(int id, ev->params = params; ev->nparams = nparams; - return (virObjectEventPtr) ev; + return (virObjectEvent *) ev; error: virTypedParamsFree(params, nparams); return NULL; } -virObjectEventPtr -virDomainEventJobCompletedNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventJobCompletedNewFromObj(virDomainObj *obj, virTypedParameterPtr params, int nparams) { @@ -1480,7 +1458,7 @@ virDomainEventJobCompletedNewFromObj(virDomainObjPtr obj, obj->def->uuid, params, nparams); } -virObjectEventPtr +virObjectEvent * virDomainEventJobCompletedNewFromDom(virDomainPtr dom, virTypedParameterPtr params, int nparams) @@ -1494,14 +1472,14 @@ virDomainEventJobCompletedNewFromDom(virDomainPtr dom, * freeing it even if error occurs. The reason is to not have to do deep * copy of params. */ -static virObjectEventPtr +static virObjectEvent * virDomainEventTunableNew(int id, const char *name, unsigned char *uuid, virTypedParameterPtr params, int nparams) { - virDomainEventTunablePtr ev; + virDomainEventTunable *ev; if (virDomainEventsInitialize() < 0) goto error; @@ -1514,15 +1492,15 @@ virDomainEventTunableNew(int id, ev->params = params; ev->nparams = nparams; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; error: virTypedParamsFree(params, nparams); return NULL; } -virObjectEventPtr -virDomainEventTunableNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventTunableNewFromObj(virDomainObj *obj, virTypedParameterPtr params, int nparams) { @@ -1533,7 +1511,7 @@ virDomainEventTunableNewFromObj(virDomainObjPtr obj, nparams); } -virObjectEventPtr +virObjectEvent * virDomainEventTunableNewFromDom(virDomainPtr dom, virTypedParameterPtr params, int nparams) @@ -1546,14 +1524,14 @@ virDomainEventTunableNewFromDom(virDomainPtr dom, } -static virObjectEventPtr +static virObjectEvent * virDomainEventMetadataChangeNew(int id, const char *name, unsigned char *uuid, int type, const char *nsuri) { - virDomainEventMetadataChangePtr ev; + virDomainEventMetadataChange *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1567,11 +1545,11 @@ virDomainEventMetadataChangeNew(int id, if (nsuri) ev->nsuri = g_strdup(nsuri); - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventMetadataChangeNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventMetadataChangeNewFromObj(virDomainObj *obj, int type, const char *nsuri) { @@ -1579,7 +1557,7 @@ virDomainEventMetadataChangeNewFromObj(virDomainObjPtr obj, obj->def->uuid, type, nsuri); } -virObjectEventPtr +virObjectEvent * virDomainEventMetadataChangeNewFromDom(virDomainPtr dom, int type, const char *nsuri) @@ -1589,7 +1567,7 @@ virDomainEventMetadataChangeNewFromDom(virDomainPtr dom, } -static virObjectEventPtr +static virObjectEvent * virDomainEventBlockThresholdNew(int id, const char *name, unsigned char *uuid, @@ -1598,7 +1576,7 @@ virDomainEventBlockThresholdNew(int id, unsigned long long threshold, unsigned long long excess) { - virDomainEventBlockThresholdPtr ev; + virDomainEventBlockThreshold *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1613,11 +1591,11 @@ virDomainEventBlockThresholdNew(int id, ev->threshold = threshold; ev->excess = excess; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventBlockThresholdNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventBlockThresholdNewFromObj(virDomainObj *obj, const char *dev, const char *path, unsigned long long threshold, @@ -1628,7 +1606,7 @@ virDomainEventBlockThresholdNewFromObj(virDomainObjPtr obj, threshold, excess); } -virObjectEventPtr +virObjectEvent * virDomainEventBlockThresholdNewFromDom(virDomainPtr dom, const char *dev, const char *path, @@ -1640,7 +1618,7 @@ virDomainEventBlockThresholdNewFromDom(virDomainPtr dom, } -static virObjectEventPtr +static virObjectEvent * virDomainEventMemoryFailureNew(int id, const char *name, unsigned char *uuid, @@ -1648,7 +1626,7 @@ virDomainEventMemoryFailureNew(int id, int action, unsigned int flags) { - virDomainEventMemoryFailurePtr ev; + virDomainEventMemoryFailure *ev; if (virDomainEventsInitialize() < 0) return NULL; @@ -1662,11 +1640,11 @@ virDomainEventMemoryFailureNew(int id, ev->action = action; ev->flags = flags; - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } -virObjectEventPtr -virDomainEventMemoryFailureNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventMemoryFailureNewFromObj(virDomainObj *obj, int recipient, int action, unsigned int flags) @@ -1676,7 +1654,7 @@ virDomainEventMemoryFailureNewFromObj(virDomainObjPtr obj, flags); } -virObjectEventPtr +virObjectEvent * virDomainEventMemoryFailureNewFromDom(virDomainPtr dom, int recipient, int action, @@ -1688,7 +1666,7 @@ virDomainEventMemoryFailureNewFromDom(virDomainPtr dom, static void virDomainEventDispatchDefaultFunc(virConnectPtr conn, - virObjectEventPtr event, + virObjectEvent *event, virConnectObjectEventGenericCallback cb, void *cbopaque) { @@ -1701,9 +1679,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, switch ((virDomainEventID) event->eventID) { case VIR_DOMAIN_EVENT_ID_LIFECYCLE: { - virDomainEventLifecyclePtr lifecycleEvent; + virDomainEventLifecycle *lifecycleEvent; - lifecycleEvent = (virDomainEventLifecyclePtr)event; + lifecycleEvent = (virDomainEventLifecycle *)event; ((virConnectDomainEventCallback)cb)(conn, dom, lifecycleEvent->type, lifecycleEvent->detail, @@ -1718,9 +1696,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_RTC_CHANGE: { - virDomainEventRTCChangePtr rtcChangeEvent; + virDomainEventRTCChange *rtcChangeEvent; - rtcChangeEvent = (virDomainEventRTCChangePtr)event; + rtcChangeEvent = (virDomainEventRTCChange *)event; ((virConnectDomainEventRTCChangeCallback)cb)(conn, dom, rtcChangeEvent->offset, cbopaque); @@ -1729,9 +1707,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_WATCHDOG: { - virDomainEventWatchdogPtr watchdogEvent; + virDomainEventWatchdog *watchdogEvent; - watchdogEvent = (virDomainEventWatchdogPtr)event; + watchdogEvent = (virDomainEventWatchdog *)event; ((virConnectDomainEventWatchdogCallback)cb)(conn, dom, watchdogEvent->action, cbopaque); @@ -1740,9 +1718,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_IO_ERROR: { - virDomainEventIOErrorPtr ioErrorEvent; + virDomainEventIOError *ioErrorEvent; - ioErrorEvent = (virDomainEventIOErrorPtr)event; + ioErrorEvent = (virDomainEventIOError *)event; ((virConnectDomainEventIOErrorCallback)cb)(conn, dom, ioErrorEvent->srcPath, ioErrorEvent->devAlias, @@ -1753,9 +1731,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON: { - virDomainEventIOErrorPtr ioErrorEvent; + virDomainEventIOError *ioErrorEvent; - ioErrorEvent = (virDomainEventIOErrorPtr)event; + ioErrorEvent = (virDomainEventIOError *)event; ((virConnectDomainEventIOErrorReasonCallback)cb)(conn, dom, ioErrorEvent->srcPath, ioErrorEvent->devAlias, @@ -1767,9 +1745,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_GRAPHICS: { - virDomainEventGraphicsPtr graphicsEvent; + virDomainEventGraphics *graphicsEvent; - graphicsEvent = (virDomainEventGraphicsPtr)event; + graphicsEvent = (virDomainEventGraphics *)event; ((virConnectDomainEventGraphicsCallback)cb)(conn, dom, graphicsEvent->phase, graphicsEvent->local, @@ -1788,9 +1766,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_BLOCK_JOB: case VIR_DOMAIN_EVENT_ID_BLOCK_JOB_2: { - virDomainEventBlockJobPtr blockJobEvent; + virDomainEventBlockJob *blockJobEvent; - blockJobEvent = (virDomainEventBlockJobPtr)event; + blockJobEvent = (virDomainEventBlockJob *)event; ((virConnectDomainEventBlockJobCallback)cb)(conn, dom, blockJobEvent->disk, blockJobEvent->type, @@ -1801,9 +1779,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_DISK_CHANGE: { - virDomainEventDiskChangePtr diskChangeEvent; + virDomainEventDiskChange *diskChangeEvent; - diskChangeEvent = (virDomainEventDiskChangePtr)event; + diskChangeEvent = (virDomainEventDiskChange *)event; ((virConnectDomainEventDiskChangeCallback)cb)(conn, dom, diskChangeEvent->oldSrcPath, diskChangeEvent->newSrcPath, @@ -1815,9 +1793,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_TRAY_CHANGE: { - virDomainEventTrayChangePtr trayChangeEvent; + virDomainEventTrayChange *trayChangeEvent; - trayChangeEvent = (virDomainEventTrayChangePtr)event; + trayChangeEvent = (virDomainEventTrayChange *)event; ((virConnectDomainEventTrayChangeCallback)cb)(conn, dom, trayChangeEvent->devAlias, trayChangeEvent->reason, @@ -1827,7 +1805,7 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_PMWAKEUP: { - virDomainEventPMPtr pmEvent = (virDomainEventPMPtr)event; + virDomainEventPM *pmEvent = (virDomainEventPM *)event; ((virConnectDomainEventPMWakeupCallback)cb)(conn, dom, pmEvent->reason, @@ -1837,7 +1815,7 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_PMSUSPEND: { - virDomainEventPMPtr pmEvent = (virDomainEventPMPtr)event; + virDomainEventPM *pmEvent = (virDomainEventPM *)event; ((virConnectDomainEventPMSuspendCallback)cb)(conn, dom, pmEvent->reason, @@ -1847,9 +1825,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_BALLOON_CHANGE: { - virDomainEventBalloonChangePtr balloonChangeEvent; + virDomainEventBalloonChange *balloonChangeEvent; - balloonChangeEvent = (virDomainEventBalloonChangePtr)event; + balloonChangeEvent = (virDomainEventBalloonChange *)event; ((virConnectDomainEventBalloonChangeCallback)cb)(conn, dom, balloonChangeEvent->actual, cbopaque); @@ -1858,7 +1836,7 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_PMSUSPEND_DISK: { - virDomainEventPMPtr pmEvent = (virDomainEventPMPtr)event; + virDomainEventPM *pmEvent = (virDomainEventPM *)event; ((virConnectDomainEventPMSuspendDiskCallback)cb)(conn, dom, pmEvent->reason, @@ -1868,9 +1846,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_DEVICE_REMOVED: { - virDomainEventDeviceRemovedPtr deviceRemovedEvent; + virDomainEventDeviceRemoved *deviceRemovedEvent; - deviceRemovedEvent = (virDomainEventDeviceRemovedPtr)event; + deviceRemovedEvent = (virDomainEventDeviceRemoved *)event; ((virConnectDomainEventDeviceRemovedCallback)cb)(conn, dom, deviceRemovedEvent->devAlias, cbopaque); @@ -1879,8 +1857,8 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_TUNABLE: { - virDomainEventTunablePtr tunableEvent; - tunableEvent = (virDomainEventTunablePtr)event; + virDomainEventTunable *tunableEvent; + tunableEvent = (virDomainEventTunable *)event; ((virConnectDomainEventTunableCallback)cb)(conn, dom, tunableEvent->params, tunableEvent->nparams, @@ -1890,8 +1868,8 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_AGENT_LIFECYCLE: { - virDomainEventAgentLifecyclePtr agentLifecycleEvent; - agentLifecycleEvent = (virDomainEventAgentLifecyclePtr)event; + virDomainEventAgentLifecycle *agentLifecycleEvent; + agentLifecycleEvent = (virDomainEventAgentLifecycle *)event; ((virConnectDomainEventAgentLifecycleCallback)cb)(conn, dom, agentLifecycleEvent->state, agentLifecycleEvent->reason, @@ -1901,9 +1879,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_DEVICE_ADDED: { - virDomainEventDeviceAddedPtr deviceAddedEvent; + virDomainEventDeviceAdded *deviceAddedEvent; - deviceAddedEvent = (virDomainEventDeviceAddedPtr)event; + deviceAddedEvent = (virDomainEventDeviceAdded *)event; ((virConnectDomainEventDeviceAddedCallback)cb)(conn, dom, deviceAddedEvent->devAlias, cbopaque); @@ -1912,9 +1890,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_MIGRATION_ITERATION: { - virDomainEventMigrationIterationPtr ev; + virDomainEventMigrationIteration *ev; - ev = (virDomainEventMigrationIterationPtr) event; + ev = (virDomainEventMigrationIteration *) event; ((virConnectDomainEventMigrationIterationCallback)cb)(conn, dom, ev->iteration, cbopaque); @@ -1923,9 +1901,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_JOB_COMPLETED: { - virDomainEventJobCompletedPtr ev; + virDomainEventJobCompleted *ev; - ev = (virDomainEventJobCompletedPtr) event; + ev = (virDomainEventJobCompleted *) event; ((virConnectDomainEventJobCompletedCallback) cb)(conn, dom, ev->params, ev->nparams, @@ -1935,9 +1913,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_DEVICE_REMOVAL_FAILED: { - virDomainEventDeviceRemovalFailedPtr deviceRemovalFailedEvent; + virDomainEventDeviceRemovalFailed *deviceRemovalFailedEvent; - deviceRemovalFailedEvent = (virDomainEventDeviceRemovalFailedPtr)event; + deviceRemovalFailedEvent = (virDomainEventDeviceRemovalFailed *)event; ((virConnectDomainEventDeviceRemovalFailedCallback)cb)(conn, dom, deviceRemovalFailedEvent->devAlias, cbopaque); @@ -1946,9 +1924,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_METADATA_CHANGE: { - virDomainEventMetadataChangePtr metadataChangeEvent; + virDomainEventMetadataChange *metadataChangeEvent; - metadataChangeEvent = (virDomainEventMetadataChangePtr)event; + metadataChangeEvent = (virDomainEventMetadataChange *)event; ((virConnectDomainEventMetadataChangeCallback)cb)(conn, dom, metadataChangeEvent->type, metadataChangeEvent->nsuri, @@ -1958,9 +1936,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, case VIR_DOMAIN_EVENT_ID_BLOCK_THRESHOLD: { - virDomainEventBlockThresholdPtr blockThresholdEvent; + virDomainEventBlockThreshold *blockThresholdEvent; - blockThresholdEvent = (virDomainEventBlockThresholdPtr)event; + blockThresholdEvent = (virDomainEventBlockThreshold *)event; ((virConnectDomainEventBlockThresholdCallback)cb)(conn, dom, blockThresholdEvent->dev, blockThresholdEvent->path, @@ -1971,9 +1949,9 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, } case VIR_DOMAIN_EVENT_ID_MEMORY_FAILURE: { - virDomainEventMemoryFailurePtr memoryFailureEvent; + virDomainEventMemoryFailure *memoryFailureEvent; - memoryFailureEvent = (virDomainEventMemoryFailurePtr)event; + memoryFailureEvent = (virDomainEventMemoryFailure *)event; ((virConnectDomainEventMemoryFailureCallback)cb)(conn, dom, memoryFailureEvent->recipient, memoryFailureEvent->action, @@ -1993,7 +1971,7 @@ virDomainEventDispatchDefaultFunc(virConnectPtr conn, } -virObjectEventPtr +virObjectEvent * virDomainQemuMonitorEventNew(int id, const char *name, const unsigned char *uuid, @@ -2002,7 +1980,7 @@ virDomainQemuMonitorEventNew(int id, unsigned int micros, const char *details) { - virDomainQemuMonitorEventPtr ev; + virDomainQemuMonitorEvent *ev; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (virDomainEventsInitialize() < 0) @@ -2019,7 +1997,7 @@ virDomainQemuMonitorEventNew(int id, ev->micros = micros; ev->details = g_strdup(details); - return (virObjectEventPtr)ev; + return (virObjectEvent *)ev; } @@ -2039,19 +2017,19 @@ typedef struct virDomainQemuMonitorEventData virDomainQemuMonitorEventData; static void virDomainQemuMonitorEventDispatchFunc(virConnectPtr conn, - virObjectEventPtr event, + virObjectEvent *event, virConnectObjectEventGenericCallback cb, void *cbopaque) { virDomainPtr dom; - virDomainQemuMonitorEventPtr qemuMonitorEvent; + virDomainQemuMonitorEvent *qemuMonitorEvent; virDomainQemuMonitorEventData *data = cbopaque; if (!(dom = virGetDomain(conn, event->meta.name, event->meta.uuid, event->meta.id))) return; - qemuMonitorEvent = (virDomainQemuMonitorEventPtr)event; + qemuMonitorEvent = (virDomainQemuMonitorEvent *)event; ((virConnectDomainQemuMonitorEventCallback)cb)(conn, dom, qemuMonitorEvent->event, qemuMonitorEvent->seconds, @@ -2077,7 +2055,7 @@ virDomainQemuMonitorEventDispatchFunc(virConnectPtr conn, */ int virDomainEventStateRegister(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virConnectDomainEventCallback callback, void *opaque, virFreeCallback freecb) @@ -2115,7 +2093,7 @@ virDomainEventStateRegister(virConnectPtr conn, */ int virDomainEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virDomainPtr dom, int eventID, virConnectDomainEventGenericCallback cb, @@ -2161,7 +2139,7 @@ virDomainEventStateRegisterID(virConnectPtr conn, */ int virDomainEventStateRegisterClient(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virDomainPtr dom, int eventID, virConnectDomainEventGenericCallback cb, @@ -2199,7 +2177,7 @@ virDomainEventStateRegisterClient(virConnectPtr conn, */ int virDomainEventStateCallbackID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virConnectDomainEventCallback cb, int *remoteID) { @@ -2223,7 +2201,7 @@ virDomainEventStateCallbackID(virConnectPtr conn, */ int virDomainEventStateDeregister(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virConnectDomainEventCallback cb) { int callbackID; @@ -2250,13 +2228,13 @@ virDomainEventStateDeregister(virConnectPtr conn, */ static bool virDomainQemuMonitorEventFilter(virConnectPtr conn G_GNUC_UNUSED, - virObjectEventPtr event, + virObjectEvent *event, void *opaque) { virDomainQemuMonitorEventData *data = opaque; - virDomainQemuMonitorEventPtr monitorEvent; + virDomainQemuMonitorEvent *monitorEvent; - monitorEvent = (virDomainQemuMonitorEventPtr) event; + monitorEvent = (virDomainQemuMonitorEvent *) event; if (data->flags == -1) return true; @@ -2302,7 +2280,7 @@ virDomainQemuMonitorEventCleanup(void *opaque) */ int virDomainQemuMonitorEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virDomainPtr dom, const char *event, virConnectDomainQemuMonitorEventCallback cb, diff --git a/src/conf/domain_event.h b/src/conf/domain_event.h index 13a1c56ce1..2a59e613cd 100644 --- a/src/conf/domain_event.h +++ b/src/conf/domain_event.h @@ -27,241 +27,241 @@ #include "domain_conf.h" -virObjectEventPtr +virObjectEvent * virDomainEventLifecycleNew(int id, const char *name, const unsigned char *uuid, int type, int detail); -virObjectEventPtr +virObjectEvent * virDomainEventLifecycleNewFromDom(virDomainPtr dom, int type, int detail); -virObjectEventPtr -virDomainEventLifecycleNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventLifecycleNewFromObj(virDomainObj *obj, int type, int detail); -virObjectEventPtr -virDomainEventLifecycleNewFromDef(virDomainDefPtr def, +virObjectEvent * +virDomainEventLifecycleNewFromDef(virDomainDef *def, int type, int detail); -virObjectEventPtr +virObjectEvent * virDomainEventRebootNew(int id, const char *name, const unsigned char *uuid); -virObjectEventPtr +virObjectEvent * virDomainEventRebootNewFromDom(virDomainPtr dom); -virObjectEventPtr -virDomainEventRebootNewFromObj(virDomainObjPtr obj); +virObjectEvent * +virDomainEventRebootNewFromObj(virDomainObj *obj); -virObjectEventPtr +virObjectEvent * virDomainEventRTCChangeNewFromDom(virDomainPtr dom, long long offset); -virObjectEventPtr -virDomainEventRTCChangeNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventRTCChangeNewFromObj(virDomainObj *obj, long long offset); -virObjectEventPtr +virObjectEvent * virDomainEventWatchdogNewFromDom(virDomainPtr dom, int action); -virObjectEventPtr -virDomainEventWatchdogNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventWatchdogNewFromObj(virDomainObj *obj, int action); -virObjectEventPtr +virObjectEvent * virDomainEventIOErrorNewFromDom(virDomainPtr dom, const char *srcPath, const char *devAlias, int action); -virObjectEventPtr -virDomainEventIOErrorNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventIOErrorNewFromObj(virDomainObj *obj, const char *srcPath, const char *devAlias, int action); -virObjectEventPtr +virObjectEvent * virDomainEventIOErrorReasonNewFromDom(virDomainPtr dom, const char *srcPath, const char *devAlias, int action, const char *reason); -virObjectEventPtr -virDomainEventIOErrorReasonNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventIOErrorReasonNewFromObj(virDomainObj *obj, const char *srcPath, const char *devAlias, int action, const char *reason); -virObjectEventPtr +virObjectEvent * virDomainEventGraphicsNewFromDom(virDomainPtr dom, int phase, virDomainEventGraphicsAddressPtr local, virDomainEventGraphicsAddressPtr remote, const char *authScheme, virDomainEventGraphicsSubjectPtr subject); -virObjectEventPtr -virDomainEventGraphicsNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventGraphicsNewFromObj(virDomainObj *obj, int phase, virDomainEventGraphicsAddressPtr local, virDomainEventGraphicsAddressPtr remote, const char *authScheme, virDomainEventGraphicsSubjectPtr subject); -virObjectEventPtr +virObjectEvent * virDomainEventControlErrorNewFromDom(virDomainPtr dom); -virObjectEventPtr -virDomainEventControlErrorNewFromObj(virDomainObjPtr obj); +virObjectEvent * +virDomainEventControlErrorNewFromObj(virDomainObj *obj); -virObjectEventPtr -virDomainEventBlockJobNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventBlockJobNewFromObj(virDomainObj *obj, const char *path, int type, int status); -virObjectEventPtr +virObjectEvent * virDomainEventBlockJobNewFromDom(virDomainPtr dom, const char *path, int type, int status); -virObjectEventPtr -virDomainEventBlockJob2NewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventBlockJob2NewFromObj(virDomainObj *obj, const char *dst, int type, int status); -virObjectEventPtr +virObjectEvent * virDomainEventBlockJob2NewFromDom(virDomainPtr dom, const char *dst, int type, int status); -virObjectEventPtr -virDomainEventDiskChangeNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventDiskChangeNewFromObj(virDomainObj *obj, const char *oldSrcPath, const char *newSrcPath, const char *devAlias, int reason); -virObjectEventPtr +virObjectEvent * virDomainEventDiskChangeNewFromDom(virDomainPtr dom, const char *oldSrcPath, const char *newSrcPath, const char *devAlias, int reason); -virObjectEventPtr -virDomainEventTrayChangeNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventTrayChangeNewFromObj(virDomainObj *obj, const char *devAlias, int reason); -virObjectEventPtr +virObjectEvent * virDomainEventTrayChangeNewFromDom(virDomainPtr dom, const char *devAlias, int reason); -virObjectEventPtr -virDomainEventPMWakeupNewFromObj(virDomainObjPtr obj); -virObjectEventPtr +virObjectEvent * +virDomainEventPMWakeupNewFromObj(virDomainObj *obj); +virObjectEvent * virDomainEventPMWakeupNewFromDom(virDomainPtr dom, int reason); -virObjectEventPtr -virDomainEventPMSuspendNewFromObj(virDomainObjPtr obj); -virObjectEventPtr +virObjectEvent * +virDomainEventPMSuspendNewFromObj(virDomainObj *obj); +virObjectEvent * virDomainEventPMSuspendNewFromDom(virDomainPtr dom, int reason); -virObjectEventPtr +virObjectEvent * virDomainEventBalloonChangeNewFromDom(virDomainPtr dom, unsigned long long actual); -virObjectEventPtr -virDomainEventBalloonChangeNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventBalloonChangeNewFromObj(virDomainObj *obj, unsigned long long actual); -virObjectEventPtr -virDomainEventPMSuspendDiskNewFromObj(virDomainObjPtr obj); -virObjectEventPtr +virObjectEvent * +virDomainEventPMSuspendDiskNewFromObj(virDomainObj *obj); +virObjectEvent * virDomainEventPMSuspendDiskNewFromDom(virDomainPtr dom, int reason); -virObjectEventPtr -virDomainEventDeviceRemovedNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventDeviceRemovedNewFromObj(virDomainObj *obj, const char *devAlias); -virObjectEventPtr +virObjectEvent * virDomainEventDeviceRemovedNewFromDom(virDomainPtr dom, const char *devAlias); -virObjectEventPtr -virDomainEventDeviceAddedNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventDeviceAddedNewFromObj(virDomainObj *obj, const char *devAlias); -virObjectEventPtr +virObjectEvent * virDomainEventDeviceAddedNewFromDom(virDomainPtr dom, const char *devAlias); -virObjectEventPtr -virDomainEventDeviceRemovalFailedNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventDeviceRemovalFailedNewFromObj(virDomainObj *obj, const char *devAlias); -virObjectEventPtr +virObjectEvent * virDomainEventDeviceRemovalFailedNewFromDom(virDomainPtr dom, const char *devAlias); -virObjectEventPtr -virDomainEventTunableNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventTunableNewFromObj(virDomainObj *obj, virTypedParameterPtr params, int nparams); -virObjectEventPtr +virObjectEvent * virDomainEventTunableNewFromDom(virDomainPtr dom, virTypedParameterPtr params, int nparams); -virObjectEventPtr -virDomainEventAgentLifecycleNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventAgentLifecycleNewFromObj(virDomainObj *obj, int state, int reason); -virObjectEventPtr +virObjectEvent * virDomainEventAgentLifecycleNewFromDom(virDomainPtr dom, int state, int reason); -virObjectEventPtr -virDomainEventMigrationIterationNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventMigrationIterationNewFromObj(virDomainObj *obj, int iteration); -virObjectEventPtr +virObjectEvent * virDomainEventMigrationIterationNewFromDom(virDomainPtr dom, int iteration); -virObjectEventPtr -virDomainEventJobCompletedNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventJobCompletedNewFromObj(virDomainObj *obj, virTypedParameterPtr params, int nparams); -virObjectEventPtr +virObjectEvent * virDomainEventJobCompletedNewFromDom(virDomainPtr dom, virTypedParameterPtr params, int nparams); -virObjectEventPtr -virDomainEventMetadataChangeNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventMetadataChangeNewFromObj(virDomainObj *obj, int type, const char *nsuri); -virObjectEventPtr +virObjectEvent * virDomainEventMetadataChangeNewFromDom(virDomainPtr dom, int type, const char *nsuri); -virObjectEventPtr -virDomainEventBlockThresholdNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventBlockThresholdNewFromObj(virDomainObj *obj, const char *dev, const char *path, unsigned long long threshold, unsigned long long excess); -virObjectEventPtr +virObjectEvent * virDomainEventBlockThresholdNewFromDom(virDomainPtr dom, const char *dev, const char *path, unsigned long long threshold, unsigned long long excess); -virObjectEventPtr -virDomainEventMemoryFailureNewFromObj(virDomainObjPtr obj, +virObjectEvent * +virDomainEventMemoryFailureNewFromObj(virDomainObj *obj, int recipient, int action, unsigned int flags); -virObjectEventPtr +virObjectEvent * virDomainEventMemoryFailureNewFromDom(virDomainPtr dom, int recipient, int action, @@ -269,14 +269,14 @@ virDomainEventMemoryFailureNewFromDom(virDomainPtr dom, int virDomainEventStateRegister(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virConnectDomainEventCallback callback, void *opaque, virFreeCallback freecb) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int virDomainEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virDomainPtr dom, int eventID, virConnectDomainEventGenericCallback cb, @@ -286,7 +286,7 @@ virDomainEventStateRegisterID(virConnectPtr conn, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5); int virDomainEventStateRegisterClient(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virDomainPtr dom, int eventID, virConnectDomainEventGenericCallback cb, @@ -300,7 +300,7 @@ virDomainEventStateRegisterClient(virConnectPtr conn, int virDomainEventStateCallbackID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virConnectDomainEventCallback callback, int *remoteID) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) @@ -308,13 +308,13 @@ virDomainEventStateCallbackID(virConnectPtr conn, int virDomainEventStateDeregister(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virConnectDomainEventCallback callback) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int virDomainQemuMonitorEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virDomainPtr dom, const char *event, virConnectDomainQemuMonitorEventCallback cb, @@ -325,7 +325,7 @@ virDomainQemuMonitorEventStateRegisterID(virConnectPtr conn, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(9); -virObjectEventPtr +virObjectEvent * virDomainQemuMonitorEventNew(int id, const char *name, const unsigned char *uuid, diff --git a/src/conf/domain_nwfilter.c b/src/conf/domain_nwfilter.c index f32122b8a3..1c62353fa1 100644 --- a/src/conf/domain_nwfilter.c +++ b/src/conf/domain_nwfilter.c @@ -37,12 +37,12 @@ VIR_LOG_INIT("conf.domain_nwfilter"); #define VIR_FROM_THIS VIR_FROM_NWFILTER -static virNWFilterBindingDefPtr +static virNWFilterBindingDef * virNWFilterBindingDefForNet(const char *vmname, const unsigned char *vmuuid, - virDomainNetDefPtr net) + virDomainNetDef *net) { - virNWFilterBindingDefPtr ret; + virNWFilterBindingDef *ret; ret = g_new0(virNWFilterBindingDef, 1); @@ -77,11 +77,11 @@ virNWFilterBindingDefForNet(const char *vmname, int virDomainConfNWFilterInstantiate(const char *vmname, const unsigned char *vmuuid, - virDomainNetDefPtr net, + virDomainNetDef *net, bool ignoreExists) { virConnectPtr conn = virGetConnectNWFilter(); - virNWFilterBindingDefPtr def = NULL; + virNWFilterBindingDef *def = NULL; virNWFilterBindingPtr binding = NULL; char *xml = NULL; int ret = -1; @@ -122,7 +122,7 @@ virDomainConfNWFilterInstantiate(const char *vmname, static void virDomainConfNWFilterTeardownImpl(virConnectPtr conn, - virDomainNetDefPtr net) + virDomainNetDef *net) { virNWFilterBindingPtr binding; @@ -140,7 +140,7 @@ virDomainConfNWFilterTeardownImpl(virConnectPtr conn, void -virDomainConfNWFilterTeardown(virDomainNetDefPtr net) +virDomainConfNWFilterTeardown(virDomainNetDef *net) { virConnectPtr conn; @@ -156,13 +156,13 @@ virDomainConfNWFilterTeardown(virDomainNetDefPtr net) } void -virDomainConfVMNWFilterTeardown(virDomainObjPtr vm) +virDomainConfVMNWFilterTeardown(virDomainObj *vm) { size_t i; virConnectPtr conn = NULL; for (i = 0; i < vm->def->nnets; i++) { - virDomainNetDefPtr net = vm->def->nets[i]; + virDomainNetDef *net = vm->def->nets[i]; if (!net->filter) continue; diff --git a/src/conf/domain_nwfilter.h b/src/conf/domain_nwfilter.h index f44fbcce7d..20c67f2984 100644 --- a/src/conf/domain_nwfilter.h +++ b/src/conf/domain_nwfilter.h @@ -23,7 +23,7 @@ int virDomainConfNWFilterInstantiate(const char *vmname, const unsigned char *vmuuid, - virDomainNetDefPtr net, + virDomainNetDef *net, bool ignoreExists); -void virDomainConfNWFilterTeardown(virDomainNetDefPtr net); -void virDomainConfVMNWFilterTeardown(virDomainObjPtr vm); +void virDomainConfNWFilterTeardown(virDomainNetDef *net); +void virDomainConfVMNWFilterTeardown(virDomainObj *vm); diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index a455c30737..570279cd92 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -79,7 +79,7 @@ virDomainDefVideoValidate(const virDomainDef *def) static int -virDomainCheckVirtioOptionsAreAbsent(virDomainVirtioOptionsPtr virtio) +virDomainCheckVirtioOptionsAreAbsent(virDomainVirtioOptions *virtio) { if (!virtio) return 0; @@ -238,12 +238,12 @@ virDomainDiskAddressDiskBusCompatibility(virDomainDiskBus bus, static int -virSecurityDeviceLabelDefValidate(virSecurityDeviceLabelDefPtr *seclabels, +virSecurityDeviceLabelDefValidate(virSecurityDeviceLabelDef **seclabels, size_t nseclabels, - virSecurityLabelDefPtr *vmSeclabels, + virSecurityLabelDef **vmSeclabels, size_t nvmSeclabels) { - virSecurityDeviceLabelDefPtr seclabel; + virSecurityDeviceLabelDef *seclabel; size_t i; size_t j; @@ -437,7 +437,7 @@ static int virDomainDiskDefValidate(const virDomainDef *def, const virDomainDiskDef *disk) { - virStorageSourcePtr next; + virStorageSource *next; /* Validate LUN configuration */ if (disk->device == VIR_DOMAIN_DISK_DEVICE_LUN) { @@ -884,15 +884,15 @@ virDomainDefDuplicateDriveAddressesValidate(const virDomainDef *def) size_t j; for (i = 0; i < def->ndisks; i++) { - virDomainDiskDefPtr disk_i = def->disks[i]; - virDomainDeviceInfoPtr disk_info_i = &disk_i->info; + virDomainDiskDef *disk_i = def->disks[i]; + virDomainDeviceInfo *disk_info_i = &disk_i->info; if (disk_info_i->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) continue; for (j = i + 1; j < def->ndisks; j++) { - virDomainDiskDefPtr disk_j = def->disks[j]; - virDomainDeviceInfoPtr disk_info_j = &disk_j->info; + virDomainDiskDef *disk_j = def->disks[j]; + virDomainDeviceInfo *disk_info_j = &disk_j->info; if (disk_i->bus != disk_j->bus) continue; @@ -921,9 +921,9 @@ virDomainDefDuplicateDriveAddressesValidate(const virDomainDef *def) } for (i = 0; i < def->nhostdevs; i++) { - virDomainHostdevDefPtr hdev_i = def->hostdevs[i]; - virDomainDeviceInfoPtr hdev_info_i = hdev_i->info; - virDomainDeviceDriveAddressPtr hdev_addr_i; + virDomainHostdevDef *hdev_i = def->hostdevs[i]; + virDomainDeviceInfo *hdev_info_i = hdev_i->info; + virDomainDeviceDriveAddress *hdev_addr_i; if (!virHostdevIsSCSIDevice(hdev_i)) continue; @@ -933,8 +933,8 @@ virDomainDefDuplicateDriveAddressesValidate(const virDomainDef *def) hdev_addr_i = &hdev_info_i->addr.drive; for (j = i + 1; j < def->nhostdevs; j++) { - virDomainHostdevDefPtr hdev_j = def->hostdevs[j]; - virDomainDeviceInfoPtr hdev_info_j = hdev_j->info; + virDomainHostdevDef *hdev_j = def->hostdevs[j]; + virDomainDeviceInfo *hdev_info_j = hdev_j->info; if (!virHostdevIsSCSIDevice(hdev_j)) continue; @@ -980,9 +980,9 @@ struct virDomainDefValidateAliasesData { static int -virDomainDeviceDefValidateAliasesIterator(virDomainDefPtr def, - virDomainDeviceDefPtr dev, - virDomainDeviceInfoPtr info, +virDomainDeviceDefValidateAliasesIterator(virDomainDef *def, + virDomainDeviceDef *dev, + virDomainDeviceInfo *info, void *opaque) { struct virDomainDefValidateAliasesData *data = opaque; @@ -1043,7 +1043,7 @@ virDomainDefValidateAliases(const virDomainDef *def, if (!(data.aliases = virHashNew(NULL))) goto cleanup; - if (virDomainDeviceInfoIterateFlags((virDomainDefPtr) def, + if (virDomainDeviceInfoIterateFlags((virDomainDef *) def, virDomainDeviceDefValidateAliasesIterator, DOMAIN_DEVICE_ITERATE_ALL_CONSOLES, &data) < 0) @@ -1061,10 +1061,10 @@ virDomainDefValidateAliases(const virDomainDef *def, static int virDomainDeviceValidateAliasImpl(const virDomainDef *def, - virDomainDeviceDefPtr dev) + virDomainDeviceDef *dev) { GHashTable *aliases = NULL; - virDomainDeviceInfoPtr info = virDomainDeviceGetInfo(dev); + virDomainDeviceInfo *info = virDomainDeviceGetInfo(dev); int ret = -1; if (!info || !info->alias) @@ -1089,12 +1089,12 @@ virDomainDeviceValidateAliasImpl(const virDomainDef *def, int -virDomainDeviceValidateAliasForHotplug(virDomainObjPtr vm, - virDomainDeviceDefPtr dev, +virDomainDeviceValidateAliasForHotplug(virDomainObj *vm, + virDomainDeviceDef *dev, unsigned int flags) { - virDomainDefPtr persDef = NULL; - virDomainDefPtr liveDef = NULL; + virDomainDef *persDef = NULL; + virDomainDef *liveDef = NULL; if (virDomainObjGetDefs(vm, flags, &liveDef, &persDef) < 0) return -1; @@ -1187,7 +1187,7 @@ virDomainDefMemtuneValidate(const virDomainDef *def) static int virDomainDefOSValidate(const virDomainDef *def, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { if (!def->os.loader) return 0; @@ -1294,7 +1294,7 @@ virDomainDefIOMMUValidate(const virDomainDef *def) static int virDomainDefValidateInternal(const virDomainDef *def, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { if (virDomainDefDuplicateDiskInfoValidate(def) < 0) return -1; @@ -1343,9 +1343,9 @@ virDomainDefValidateInternal(const virDomainDef *def, static int -virDomainDefValidateDeviceIterator(virDomainDefPtr def, - virDomainDeviceDefPtr dev, - virDomainDeviceInfoPtr info G_GNUC_UNUSED, +virDomainDefValidateDeviceIterator(virDomainDef *def, + virDomainDeviceDef *dev, + virDomainDeviceInfo *info G_GNUC_UNUSED, void *opaque) { struct virDomainDefPostParseDeviceIteratorData *data = opaque; @@ -1372,9 +1372,9 @@ virDomainDefValidateDeviceIterator(virDomainDefPtr def, * appropriate message. */ int -virDomainDefValidate(virDomainDefPtr def, +virDomainDefValidate(virDomainDef *def, unsigned int parseFlags, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque) { struct virDomainDefPostParseDeviceIteratorData data = { @@ -1939,7 +1939,7 @@ int virDomainDeviceDefValidate(const virDomainDeviceDef *dev, const virDomainDef *def, unsigned int parseFlags, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque) { /* validate configuration only in certain places */ diff --git a/src/conf/domain_validate.h b/src/conf/domain_validate.h index e88c101978..5f31616c85 100644 --- a/src/conf/domain_validate.h +++ b/src/conf/domain_validate.h @@ -25,16 +25,16 @@ #include "domain_conf.h" #include "virconftypes.h" -int virDomainDeviceValidateAliasForHotplug(virDomainObjPtr vm, - virDomainDeviceDefPtr dev, +int virDomainDeviceValidateAliasForHotplug(virDomainObj *vm, + virDomainDeviceDef *dev, unsigned int flags); -int virDomainDefValidate(virDomainDefPtr def, +int virDomainDefValidate(virDomainDef *def, unsigned int parseFlags, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque); int virDomainActualNetDefValidate(const virDomainNetDef *net); int virDomainDeviceDefValidate(const virDomainDeviceDef *dev, const virDomainDef *def, unsigned int parseFlags, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque); diff --git a/src/conf/interface_conf.c b/src/conf/interface_conf.c index 3cd8fcee94..d84ec66def 100644 --- a/src/conf/interface_conf.c +++ b/src/conf/interface_conf.c @@ -37,15 +37,15 @@ VIR_ENUM_IMPL(virInterface, "ethernet", "bridge", "bond", "vlan", ); -static virInterfaceDefPtr +static virInterfaceDef * virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType); static int -virInterfaceDefDevFormat(virBufferPtr buf, const virInterfaceDef *def, +virInterfaceDefDevFormat(virBuffer *buf, const virInterfaceDef *def, virInterfaceType parentIfType); static void -virInterfaceIPDefFree(virInterfaceIPDefPtr def) +virInterfaceIPDefFree(virInterfaceIPDef *def) { if (def == NULL) return; @@ -55,7 +55,7 @@ virInterfaceIPDefFree(virInterfaceIPDefPtr def) static void -virInterfaceProtocolDefFree(virInterfaceProtocolDefPtr def) +virInterfaceProtocolDefFree(virInterfaceProtocolDef *def) { size_t i; @@ -71,7 +71,7 @@ virInterfaceProtocolDefFree(virInterfaceProtocolDefPtr def) void -virInterfaceDefFree(virInterfaceDefPtr def) +virInterfaceDefFree(virInterfaceDef *def) { size_t i; int pp; @@ -116,7 +116,7 @@ virInterfaceDefFree(virInterfaceDefPtr def) static int -virInterfaceDefParseName(virInterfaceDefPtr def, +virInterfaceDefParseName(virInterfaceDef *def, xmlXPathContextPtr ctxt) { char *tmp; @@ -133,7 +133,7 @@ virInterfaceDefParseName(virInterfaceDefPtr def, static int -virInterfaceDefParseMtu(virInterfaceDefPtr def, +virInterfaceDefParseMtu(virInterfaceDef *def, xmlXPathContextPtr ctxt) { unsigned long mtu; @@ -152,7 +152,7 @@ virInterfaceDefParseMtu(virInterfaceDefPtr def, static int -virInterfaceDefParseStartMode(virInterfaceDefPtr def, +virInterfaceDefParseStartMode(virInterfaceDef *def, xmlXPathContextPtr ctxt) { char *tmp; @@ -259,7 +259,7 @@ virInterfaceDefParseBondArpValid(xmlXPathContextPtr ctxt) static int -virInterfaceDefParseDhcp(virInterfaceProtocolDefPtr def, +virInterfaceDefParseDhcp(virInterfaceProtocolDef *def, xmlNodePtr dhcp, xmlXPathContextPtr ctxt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -288,7 +288,7 @@ virInterfaceDefParseDhcp(virInterfaceProtocolDefPtr def, static int -virInterfaceDefParseIP(virInterfaceIPDefPtr def, +virInterfaceDefParseIP(virInterfaceIPDef *def, xmlXPathContextPtr ctxt) { int ret = 0; @@ -313,7 +313,7 @@ virInterfaceDefParseIP(virInterfaceIPDefPtr def, static int -virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def, +virInterfaceDefParseProtoIPv4(virInterfaceProtocolDef *def, xmlXPathContextPtr ctxt) { xmlNodePtr dhcp; @@ -337,12 +337,12 @@ virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def, if (ipNodes == NULL) return 0; - def->ips = g_new0(virInterfaceIPDefPtr, nipNodes); + def->ips = g_new0(virInterfaceIPDef *, nipNodes); def->nips = 0; for (i = 0; i < nipNodes; i++) { - virInterfaceIPDefPtr ip; + virInterfaceIPDef *ip; ip = g_new0(virInterfaceIPDef, 1); @@ -363,7 +363,7 @@ virInterfaceDefParseProtoIPv4(virInterfaceProtocolDefPtr def, static int -virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def, +virInterfaceDefParseProtoIPv6(virInterfaceProtocolDef *def, xmlXPathContextPtr ctxt) { xmlNodePtr dhcp, autoconf; @@ -391,12 +391,12 @@ virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def, if (ipNodes == NULL) return 0; - def->ips = g_new0(virInterfaceIPDefPtr, nipNodes); + def->ips = g_new0(virInterfaceIPDef *, nipNodes); def->nips = 0; for (i = 0; i < nipNodes; i++) { - virInterfaceIPDefPtr ip; + virInterfaceIPDef *ip; ip = g_new0(virInterfaceIPDef, 1); @@ -417,7 +417,7 @@ virInterfaceDefParseProtoIPv6(virInterfaceProtocolDefPtr def, static int -virInterfaceDefParseIfAdressing(virInterfaceDefPtr def, +virInterfaceDefParseIfAdressing(virInterfaceDef *def, xmlXPathContextPtr ctxt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -434,12 +434,12 @@ virInterfaceDefParseIfAdressing(virInterfaceDefPtr def, return 0; } - def->protos = g_new0(virInterfaceProtocolDefPtr, nProtoNodes); + def->protos = g_new0(virInterfaceProtocolDef *, nProtoNodes); def->nprotos = 0; for (pp = 0; pp < nProtoNodes; pp++) { - virInterfaceProtocolDefPtr proto; + virInterfaceProtocolDef *proto; proto = g_new0(virInterfaceProtocolDef, 1); @@ -483,12 +483,12 @@ virInterfaceDefParseIfAdressing(virInterfaceDefPtr def, static int -virInterfaceDefParseBridge(virInterfaceDefPtr def, +virInterfaceDefParseBridge(virInterfaceDef *def, xmlXPathContextPtr ctxt) { xmlNodePtr *interfaces = NULL; xmlNodePtr bridge; - virInterfaceDefPtr itf; + virInterfaceDef *itf; char *tmp = NULL; int nbItf; size_t i; @@ -540,12 +540,12 @@ virInterfaceDefParseBridge(virInterfaceDefPtr def, static int -virInterfaceDefParseBondItfs(virInterfaceDefPtr def, +virInterfaceDefParseBondItfs(virInterfaceDef *def, xmlXPathContextPtr ctxt) { xmlNodePtr *interfaces = NULL; VIR_XPATH_NODE_AUTORESTORE(ctxt) - virInterfaceDefPtr itf; + virInterfaceDef *itf; int nbItf; size_t i; int ret = -1; @@ -581,7 +581,7 @@ virInterfaceDefParseBondItfs(virInterfaceDefPtr def, static int -virInterfaceDefParseBond(virInterfaceDefPtr def, +virInterfaceDefParseBond(virInterfaceDef *def, xmlXPathContextPtr ctxt) { int res; @@ -654,7 +654,7 @@ virInterfaceDefParseBond(virInterfaceDefPtr def, static int -virInterfaceDefParseVlan(virInterfaceDefPtr def, +virInterfaceDefParseVlan(virInterfaceDef *def, xmlXPathContextPtr ctxt) { def->data.vlan.tag = virXPathString("string(./@tag)", ctxt); @@ -675,11 +675,11 @@ virInterfaceDefParseVlan(virInterfaceDefPtr def, } -static virInterfaceDefPtr +static virInterfaceDef * virInterfaceDefParseXML(xmlXPathContextPtr ctxt, int parentIfType) { - virInterfaceDefPtr def; + virInterfaceDef *def; int type; char *tmp; VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -795,7 +795,7 @@ virInterfaceDefParseXML(xmlXPathContextPtr ctxt, } -virInterfaceDefPtr +virInterfaceDef * virInterfaceDefParseNode(xmlDocPtr xml, xmlNodePtr root) { @@ -817,12 +817,12 @@ virInterfaceDefParseNode(xmlDocPtr xml, } -static virInterfaceDefPtr +static virInterfaceDef * virInterfaceDefParse(const char *xmlStr, const char *filename) { xmlDocPtr xml; - virInterfaceDefPtr def = NULL; + virInterfaceDef *def = NULL; if ((xml = virXMLParse(filename, xmlStr, _("(interface_definition)")))) { def = virInterfaceDefParseNode(xml, xmlDocGetRootElement(xml)); @@ -833,14 +833,14 @@ virInterfaceDefParse(const char *xmlStr, } -virInterfaceDefPtr +virInterfaceDef * virInterfaceDefParseString(const char *xmlStr) { return virInterfaceDefParse(xmlStr, NULL); } -virInterfaceDefPtr +virInterfaceDef * virInterfaceDefParseFile(const char *filename) { return virInterfaceDefParse(NULL, filename); @@ -848,7 +848,7 @@ virInterfaceDefParseFile(const char *filename) static int -virInterfaceBridgeDefFormat(virBufferPtr buf, +virInterfaceBridgeDefFormat(virBuffer *buf, const virInterfaceDef *def) { size_t i; @@ -877,7 +877,7 @@ virInterfaceBridgeDefFormat(virBufferPtr buf, static int -virInterfaceBondDefFormat(virBufferPtr buf, +virInterfaceBondDefFormat(virBuffer *buf, const virInterfaceDef *def) { size_t i; @@ -942,7 +942,7 @@ virInterfaceBondDefFormat(virBufferPtr buf, static int -virInterfaceVlanDefFormat(virBufferPtr buf, +virInterfaceVlanDefFormat(virBuffer *buf, const virInterfaceDef *def) { if (def->data.vlan.tag == NULL) { @@ -967,7 +967,7 @@ virInterfaceVlanDefFormat(virBufferPtr buf, static int -virInterfaceProtocolDefFormat(virBufferPtr buf, +virInterfaceProtocolDefFormat(virBuffer *buf, const virInterfaceDef *def) { size_t i, j; @@ -1014,7 +1014,7 @@ virInterfaceProtocolDefFormat(virBufferPtr buf, static int -virInterfaceStartmodeDefFormat(virBufferPtr buf, +virInterfaceStartmodeDefFormat(virBuffer *buf, virInterfaceStartMode startmode) { const char *mode; @@ -1041,7 +1041,7 @@ virInterfaceStartmodeDefFormat(virBufferPtr buf, static int -virInterfaceDefDevFormat(virBufferPtr buf, +virInterfaceDefDevFormat(virBuffer *buf, const virInterfaceDef *def, virInterfaceType parentIfType) { diff --git a/src/conf/interface_conf.h b/src/conf/interface_conf.h index 31063d206c..f5e802736b 100644 --- a/src/conf/interface_conf.h +++ b/src/conf/interface_conf.h @@ -84,7 +84,6 @@ typedef enum { struct _virInterfaceDef; /* forward declaration required for bridge/bond */ typedef struct _virInterfaceBridgeDef virInterfaceBridgeDef; -typedef virInterfaceBridgeDef *virInterfaceBridgeDefPtr; struct _virInterfaceBridgeDef { int stp; /* 0, 1 or -1 if undefined */ char *delay; @@ -93,7 +92,6 @@ struct _virInterfaceBridgeDef { }; typedef struct _virInterfaceBondDef virInterfaceBondDef; -typedef virInterfaceBondDef *virInterfaceBondDefPtr; struct _virInterfaceBondDef { int mode; /* virInterfaceBondMode */ int monit; /* virInterfaceBondMonit */ @@ -109,14 +107,12 @@ struct _virInterfaceBondDef { }; typedef struct _virInterfaceVlanDef virInterfaceVlanDef; -typedef virInterfaceVlanDef *virInterfaceVlanDefPtr; struct _virInterfaceVlanDef { char *tag; /* TAG for vlan */ char *dev_name; /* device name for vlan */ }; typedef struct _virInterfaceIPDef virInterfaceIPDef; -typedef virInterfaceIPDef *virInterfaceIPDefPtr; struct _virInterfaceIPDef { char *address; /* ip address */ int prefix; /* ip prefix */ @@ -124,20 +120,18 @@ struct _virInterfaceIPDef { typedef struct _virInterfaceProtocolDef virInterfaceProtocolDef; -typedef virInterfaceProtocolDef *virInterfaceProtocolDefPtr; struct _virInterfaceProtocolDef { char *family; /* ipv4 or ipv6 */ int dhcp; /* use dhcp */ int peerdns; /* dhcp peerdns ? */ int autoconf; /* only useful if family is ipv6 */ int nips; - virInterfaceIPDefPtr *ips; /* ptr to array of ips[nips] */ + virInterfaceIPDef **ips; /* ptr to array of ips[nips] */ char *gateway; /* route gateway */ }; typedef struct _virInterfaceDef virInterfaceDef; -typedef virInterfaceDef *virInterfaceDefPtr; struct _virInterfaceDef { int type; /* interface type */ char *name; /* interface name */ @@ -154,19 +148,19 @@ struct _virInterfaceDef { } data; int nprotos; - virInterfaceProtocolDefPtr *protos; /* ptr to array of protos[nprotos] */ + virInterfaceProtocolDef **protos; /* ptr to array of protos[nprotos] */ }; void -virInterfaceDefFree(virInterfaceDefPtr def); +virInterfaceDefFree(virInterfaceDef *def); -virInterfaceDefPtr +virInterfaceDef * virInterfaceDefParseString(const char *xmlStr); -virInterfaceDefPtr +virInterfaceDef * virInterfaceDefParseFile(const char *filename); -virInterfaceDefPtr +virInterfaceDef * virInterfaceDefParseNode(xmlDocPtr xml, xmlNodePtr root); diff --git a/src/conf/moment_conf.c b/src/conf/moment_conf.c index c643cbf6d6..0dff2cd000 100644 --- a/src/conf/moment_conf.c +++ b/src/conf/moment_conf.c @@ -34,7 +34,7 @@ VIR_LOG_INIT("conf.moment_conf"); -static virClassPtr virDomainMomentDefClass; +static virClass *virDomainMomentDefClass; static void virDomainMomentDefDispose(void *obj); static int @@ -48,7 +48,7 @@ virDomainMomentOnceInit(void) VIR_ONCE_GLOBAL_INIT(virDomainMoment); -virClassPtr +virClass * virClassForDomainMomentDef(void) { if (virDomainMomentInitialize() < 0) @@ -60,7 +60,7 @@ virClassForDomainMomentDef(void) static void virDomainMomentDefDispose(void *obj) { - virDomainMomentDefPtr def = obj; + virDomainMomentDef *def = obj; g_free(def->name); g_free(def->description); @@ -71,7 +71,7 @@ virDomainMomentDefDispose(void *obj) /* Provide defaults for creation time and moment name after parsing XML */ int -virDomainMomentDefPostParse(virDomainMomentDefPtr def) +virDomainMomentDefPostParse(virDomainMomentDef *def) { def->creationTime = g_get_real_time() / (1000*1000); diff --git a/src/conf/moment_conf.h b/src/conf/moment_conf.h index 70cc47bd70..e1bc7ba138 100644 --- a/src/conf/moment_conf.h +++ b/src/conf/moment_conf.h @@ -41,15 +41,15 @@ struct _virDomainMomentDef { * guest and the inactive domain definition in case of * offline guest */ - virDomainDefPtr dom; + virDomainDef *dom; /* * Store the inactive domain definition in case of online * guest and leave NULL in case of offline guest */ - virDomainDefPtr inactiveDom; + virDomainDef *inactiveDom; }; -virClassPtr virClassForDomainMomentDef(void); +virClass *virClassForDomainMomentDef(void); -int virDomainMomentDefPostParse(virDomainMomentDefPtr def); +int virDomainMomentDefPostParse(virDomainMomentDef *def); diff --git a/src/conf/netdev_bandwidth_conf.c b/src/conf/netdev_bandwidth_conf.c index 13abca94ec..7737451046 100644 --- a/src/conf/netdev_bandwidth_conf.c +++ b/src/conf/netdev_bandwidth_conf.c @@ -26,7 +26,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE static int -virNetDevBandwidthParseRate(xmlNodePtr node, virNetDevBandwidthRatePtr rate) +virNetDevBandwidthParseRate(xmlNodePtr node, virNetDevBandwidthRate *rate) { g_autofree char *average = NULL; g_autofree char *peak = NULL; @@ -101,7 +101,7 @@ virNetDevBandwidthParseRate(xmlNodePtr node, virNetDevBandwidthRatePtr rate) * Returns !NULL on success, NULL on error. */ int -virNetDevBandwidthParse(virNetDevBandwidthPtr *bandwidth, +virNetDevBandwidthParse(virNetDevBandwidth **bandwidth, unsigned int *class_id, xmlNodePtr node, bool allowFloor) @@ -199,8 +199,8 @@ virNetDevBandwidthParse(virNetDevBandwidthPtr *bandwidth, } static int -virNetDevBandwidthRateFormat(virNetDevBandwidthRatePtr def, - virBufferPtr buf, +virNetDevBandwidthRateFormat(virNetDevBandwidthRate *def, + virBuffer *buf, const char *elem_name) { if (!buf || !elem_name) @@ -242,7 +242,7 @@ virNetDevBandwidthRateFormat(virNetDevBandwidthRatePtr def, int virNetDevBandwidthFormat(const virNetDevBandwidth *def, unsigned int class_id, - virBufferPtr buf) + virBuffer *buf) { if (!buf) return -1; @@ -265,7 +265,7 @@ virNetDevBandwidthFormat(const virNetDevBandwidth *def, } void -virDomainClearNetBandwidth(virDomainDefPtr def) +virDomainClearNetBandwidth(virDomainDef *def) { size_t i; virDomainNetType type; diff --git a/src/conf/netdev_bandwidth_conf.h b/src/conf/netdev_bandwidth_conf.h index 34046eacd7..c698cc9dbc 100644 --- a/src/conf/netdev_bandwidth_conf.h +++ b/src/conf/netdev_bandwidth_conf.h @@ -25,16 +25,16 @@ #include "domain_conf.h" #include "network_conf.h" -int virNetDevBandwidthParse(virNetDevBandwidthPtr *bandwidth, +int virNetDevBandwidthParse(virNetDevBandwidth **bandwidth, unsigned int *class_id, xmlNodePtr node, bool allowFloor) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBandwidthFormat(const virNetDevBandwidth *def, unsigned int class_id, - virBufferPtr buf); + virBuffer *buf); -void virDomainClearNetBandwidth(virDomainDefPtr def) +void virDomainClearNetBandwidth(virDomainDef *def) ATTRIBUTE_NONNULL(1); bool virNetDevSupportsBandwidth(virDomainNetType type); diff --git a/src/conf/netdev_vlan_conf.c b/src/conf/netdev_vlan_conf.c index 6c93279ec5..9d7cc732ba 100644 --- a/src/conf/netdev_vlan_conf.c +++ b/src/conf/netdev_vlan_conf.c @@ -30,7 +30,7 @@ VIR_ENUM_IMPL(virNativeVlanMode, ); int -virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr def) +virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlan *def) { int ret = -1; VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -135,7 +135,7 @@ virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr de } int -virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf) +virNetDevVlanFormat(const virNetDevVlan *def, virBuffer *buf) { size_t i; diff --git a/src/conf/netdev_vlan_conf.h b/src/conf/netdev_vlan_conf.h index f798c2ae2d..a2752e57ad 100644 --- a/src/conf/netdev_vlan_conf.h +++ b/src/conf/netdev_vlan_conf.h @@ -23,5 +23,5 @@ #include "virbuffer.h" #include "virxml.h" -int virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr def); -int virNetDevVlanFormat(const virNetDevVlan *def, virBufferPtr buf); +int virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlan *def); +int virNetDevVlanFormat(const virNetDevVlan *def, virBuffer *buf); diff --git a/src/conf/netdev_vport_profile_conf.c b/src/conf/netdev_vport_profile_conf.c index fdc689b38a..d98ce098df 100644 --- a/src/conf/netdev_vport_profile_conf.c +++ b/src/conf/netdev_vport_profile_conf.c @@ -26,7 +26,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE -virNetDevVPortProfilePtr +virNetDevVPortProfile * virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags) { char *virtPortType; @@ -36,7 +36,7 @@ virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags) char *virtPortInstanceID = NULL; char *virtPortProfileID = NULL; char *virtPortInterfaceID = NULL; - virNetDevVPortProfilePtr virtPort = NULL; + virNetDevVPortProfile *virtPort = NULL; xmlNodePtr cur = node->children; virtPort = g_new0(virNetDevVPortProfile, 1); @@ -197,7 +197,7 @@ virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags) int virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort, - virBufferPtr buf) + virBuffer *buf) { enum virNetDevVPortProfile type; bool noParameters; diff --git a/src/conf/netdev_vport_profile_conf.h b/src/conf/netdev_vport_profile_conf.h index 6a99a42ee8..58b104610a 100644 --- a/src/conf/netdev_vport_profile_conf.h +++ b/src/conf/netdev_vport_profile_conf.h @@ -36,9 +36,9 @@ typedef enum { VIR_VPORT_XML_REQUIRE_TYPE = (1<<2), } virNetDevVPortXMLFlags; -virNetDevVPortProfilePtr +virNetDevVPortProfile * virNetDevVPortProfileParse(xmlNodePtr node, unsigned int flags); int virNetDevVPortProfileFormat(const virNetDevVPortProfile *virtPort, - virBufferPtr buf); + virBuffer *buf); diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c index 4cf4aa4840..f0f5ef6f42 100644 --- a/src/conf/network_conf.c +++ b/src/conf/network_conf.c @@ -77,7 +77,7 @@ VIR_ENUM_IMPL(virNetworkDHCPLeaseTimeUnit, "hours", ); -static virClassPtr virNetworkXMLOptionClass; +static virClass *virNetworkXMLOptionClass; static void virNetworkXMLOptionDispose(void *obj G_GNUC_UNUSED) @@ -96,10 +96,10 @@ virNetworkXMLOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNetworkXML); -virNetworkXMLOptionPtr -virNetworkXMLOptionNew(virXMLNamespacePtr xmlns) +virNetworkXMLOption * +virNetworkXMLOptionNew(virXMLNamespace *xmlns) { - virNetworkXMLOptionPtr xmlopt; + virNetworkXMLOption *xmlopt; if (virNetworkXMLInitialize() < 0) return NULL; @@ -114,7 +114,7 @@ virNetworkXMLOptionNew(virXMLNamespacePtr xmlns) } static void -virPortGroupDefClear(virPortGroupDefPtr def) +virPortGroupDefClear(virPortGroupDef *def) { VIR_FREE(def->name); VIR_FREE(def->virtPortProfile); @@ -125,7 +125,7 @@ virPortGroupDefClear(virPortGroupDefPtr def) static void -virNetworkForwardIfDefClear(virNetworkForwardIfDefPtr def) +virNetworkForwardIfDefClear(virNetworkForwardIfDef *def) { if (def->type == VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_NETDEV) VIR_FREE(def->device.dev); @@ -133,21 +133,21 @@ virNetworkForwardIfDefClear(virNetworkForwardIfDefPtr def) static void -virNetworkForwardPfDefClear(virNetworkForwardPfDefPtr def) +virNetworkForwardPfDefClear(virNetworkForwardPfDef *def) { VIR_FREE(def->dev); } static void -virNetworkDHCPLeaseTimeDefClear(virNetworkDHCPLeaseTimeDefPtr lease) +virNetworkDHCPLeaseTimeDefClear(virNetworkDHCPLeaseTimeDef *lease) { VIR_FREE(lease); } static void -virNetworkDHCPHostDefClear(virNetworkDHCPHostDefPtr def) +virNetworkDHCPHostDefClear(virNetworkDHCPHostDef *def) { VIR_FREE(def->mac); VIR_FREE(def->id); @@ -157,7 +157,7 @@ virNetworkDHCPHostDefClear(virNetworkDHCPHostDefPtr def) static void -virNetworkIPDefClear(virNetworkIPDefPtr def) +virNetworkIPDefClear(virNetworkIPDef *def) { VIR_FREE(def->family); @@ -175,7 +175,7 @@ virNetworkIPDefClear(virNetworkIPDefPtr def) static void -virNetworkDNSTxtDefClear(virNetworkDNSTxtDefPtr def) +virNetworkDNSTxtDefClear(virNetworkDNSTxtDef *def) { VIR_FREE(def->name); VIR_FREE(def->value); @@ -183,7 +183,7 @@ virNetworkDNSTxtDefClear(virNetworkDNSTxtDefPtr def) static void -virNetworkDNSHostDefClear(virNetworkDNSHostDefPtr def) +virNetworkDNSHostDefClear(virNetworkDNSHostDef *def) { while (def->nnames) VIR_FREE(def->names[--def->nnames]); @@ -192,7 +192,7 @@ virNetworkDNSHostDefClear(virNetworkDNSHostDefPtr def) static void -virNetworkDNSSrvDefClear(virNetworkDNSSrvDefPtr def) +virNetworkDNSSrvDefClear(virNetworkDNSSrvDef *def) { VIR_FREE(def->domain); VIR_FREE(def->service); @@ -202,14 +202,14 @@ virNetworkDNSSrvDefClear(virNetworkDNSSrvDefPtr def) static void -virNetworkDNSForwarderClear(virNetworkDNSForwarderPtr def) +virNetworkDNSForwarderClear(virNetworkDNSForwarder *def) { VIR_FREE(def->domain); } static void -virNetworkDNSDefClear(virNetworkDNSDefPtr def) +virNetworkDNSDefClear(virNetworkDNSDef *def) { if (def->forwarders) { while (def->nfwds) @@ -235,7 +235,7 @@ virNetworkDNSDefClear(virNetworkDNSDefPtr def) static void -virNetworkForwardDefClear(virNetworkForwardDefPtr def) +virNetworkForwardDefClear(virNetworkForwardDef *def) { size_t i; @@ -251,7 +251,7 @@ virNetworkForwardDefClear(virNetworkForwardDefPtr def) void -virNetworkDefFree(virNetworkDefPtr def) +virNetworkDefFree(virNetworkDef *def) { size_t i; @@ -301,9 +301,9 @@ virNetworkDefFree(virNetworkDefPtr def) * * Returns a new NetworkDef on success, or NULL on failure. */ -virNetworkDefPtr -virNetworkDefCopy(virNetworkDefPtr def, - virNetworkXMLOptionPtr xmlopt, +virNetworkDef * +virNetworkDefCopy(virNetworkDef *def, + virNetworkXMLOption *xmlopt, unsigned int flags) { g_autofree char *xml = NULL; @@ -323,7 +323,7 @@ virNetworkDefCopy(virNetworkDefPtr def, /* return ips[index], or NULL if there aren't enough ips */ -virNetworkIPDefPtr +virNetworkIPDef * virNetworkDefGetIPByIndex(const virNetworkDef *def, int family, size_t n) @@ -349,7 +349,7 @@ virNetworkDefGetIPByIndex(const virNetworkDef *def, /* return routes[index], or NULL if there aren't enough routes */ -virNetDevIPRoutePtr +virNetDevIPRoute * virNetworkDefGetRouteByIndex(const virNetworkDef *def, int family, size_t n) @@ -364,7 +364,7 @@ virNetworkDefGetRouteByIndex(const virNetworkDef *def, /* find the nth route of type "family" */ for (i = 0; i < def->nroutes; i++) { - virSocketAddrPtr addr = virNetDevIPRouteGetAddress(def->routes[i]); + virSocketAddr *addr = virNetDevIPRouteGetAddress(def->routes[i]); if (VIR_SOCKET_ADDR_IS_FAMILY(addr, family) && (n-- <= 0)) { return def->routes[i]; @@ -393,7 +393,7 @@ virNetworkIPDefPrefix(const virNetworkIPDef *def) * prefix. Return -1 on error (and set the netmask family to AF_UNSPEC) */ int virNetworkIPDefNetmask(const virNetworkIPDef *def, - virSocketAddrPtr netmask) + virSocketAddr *netmask) { if (VIR_SOCKET_ADDR_IS_FAMILY(&def->netmask, AF_INET)) { *netmask = def->netmask; @@ -406,10 +406,10 @@ int virNetworkIPDefNetmask(const virNetworkIPDef *def, static int -virNetworkDHCPLeaseTimeDefParseXML(virNetworkDHCPLeaseTimeDefPtr *lease, +virNetworkDHCPLeaseTimeDefParseXML(virNetworkDHCPLeaseTimeDef **lease, xmlNodePtr node) { - virNetworkDHCPLeaseTimeDefPtr new_lease = NULL; + virNetworkDHCPLeaseTimeDef *new_lease = NULL; g_autofree char *expirystr = NULL; g_autofree char *unitstr = NULL; unsigned long expiry; @@ -457,11 +457,11 @@ virNetworkDHCPLeaseTimeDefParseXML(virNetworkDHCPLeaseTimeDefPtr *lease, static int virNetworkDHCPRangeDefParseXML(const char *networkName, - virNetworkIPDefPtr ipdef, + virNetworkIPDef *ipdef, xmlNodePtr node, - virNetworkDHCPRangeDefPtr range) + virNetworkDHCPRangeDef *range) { - virSocketAddrRangePtr addr = &range->addr; + virSocketAddrRange *addr = &range->addr; xmlNodePtr cur = node->children; g_autofree char *start = NULL; g_autofree char *end = NULL; @@ -505,9 +505,9 @@ virNetworkDHCPRangeDefParseXML(const char *networkName, static int virNetworkDHCPHostDefParseXML(const char *networkName, - virNetworkIPDefPtr def, + virNetworkIPDef *def, xmlNodePtr node, - virNetworkDHCPHostDefPtr host, + virNetworkDHCPHostDef *host, bool partialOkay) { g_autofree char *mac = NULL; @@ -632,7 +632,7 @@ virNetworkDHCPHostDefParseXML(const char *networkName, static int virNetworkDHCPDefParseXML(const char *networkName, xmlNodePtr node, - virNetworkIPDefPtr def) + virNetworkIPDef *def) { int ret = -1; xmlNodePtr cur; @@ -696,7 +696,7 @@ virNetworkDHCPDefParseXML(const char *networkName, static int virNetworkDNSHostDefParseXML(const char *networkName, xmlNodePtr node, - virNetworkDNSHostDefPtr def, + virNetworkDNSHostDef *def, bool partialOkay) { xmlNodePtr cur; @@ -779,7 +779,7 @@ static int virNetworkDNSSrvDefParseXML(const char *networkName, xmlNodePtr node, xmlXPathContextPtr ctxt, - virNetworkDNSSrvDefPtr def, + virNetworkDNSSrvDef *def, bool partialOkay) { int ret; @@ -889,7 +889,7 @@ virNetworkDNSSrvDefParseXML(const char *networkName, static int virNetworkDNSTxtDefParseXML(const char *networkName, xmlNodePtr node, - virNetworkDNSTxtDefPtr def, + virNetworkDNSTxtDef *def, bool partialOkay) { const char *bad = " ,"; @@ -931,7 +931,7 @@ static int virNetworkDNSDefParseXML(const char *networkName, xmlNodePtr node, xmlXPathContextPtr ctxt, - virNetworkDNSDefPtr def) + virNetworkDNSDef *def) { g_autofree xmlNodePtr *hostNodes = NULL; g_autofree xmlNodePtr *srvNodes = NULL; @@ -1074,7 +1074,7 @@ static int virNetworkIPDefParseXML(const char *networkName, xmlNodePtr node, xmlXPathContextPtr ctxt, - virNetworkIPDefPtr def) + virNetworkIPDef *def) { /* * virNetworkIPDef object is already allocated as part of an array. @@ -1243,7 +1243,7 @@ virNetworkPortOptionsParseXML(xmlXPathContextPtr ctxt, static int -virNetworkPortGroupParseXML(virPortGroupDefPtr def, +virNetworkPortGroupParseXML(virPortGroupDef *def, xmlNodePtr node, xmlXPathContextPtr ctxt) { @@ -1314,7 +1314,7 @@ static int virNetworkForwardNatDefParseXML(const char *networkName, xmlNodePtr node, xmlXPathContextPtr ctxt, - virNetworkForwardDefPtr def) + virNetworkForwardDef *def) { int nNatAddrs, nNatPorts; g_autofree xmlNodePtr *natAddrNodes = NULL; @@ -1448,7 +1448,7 @@ static int virNetworkForwardDefParseXML(const char *networkName, xmlNodePtr node, xmlXPathContextPtr ctxt, - virNetworkForwardDefPtr def) + virNetworkForwardDef *def) { size_t i, j; int nForwardIfs, nForwardAddrs, nForwardPfs, nForwardNats; @@ -1621,7 +1621,7 @@ virNetworkForwardDefParseXML(const char *networkName, switch (def->ifs[i].type) { case VIR_NETWORK_FORWARD_HOSTDEV_DEVICE_PCI: { - virPCIDeviceAddressPtr addr = &def->ifs[i].device.pci; + virPCIDeviceAddress *addr = &def->ifs[i].device.pci; if (virPCIDeviceAddressParseXML(forwardAddrNodes[i], addr) < 0) return -1; @@ -1675,9 +1675,9 @@ virNetworkForwardDefParseXML(const char *networkName, } -virNetworkDefPtr +virNetworkDef * virNetworkDefParseXML(xmlXPathContextPtr ctxt, - virNetworkXMLOptionPtr xmlopt) + virNetworkXMLOption *xmlopt) { g_autoptr(virNetworkDef) def = NULL; g_autofree char *uuid = NULL; @@ -1895,10 +1895,10 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt, size_t i; /* allocate array to hold all the route definitions */ - def->routes = g_new0(virNetDevIPRoutePtr, nRoutes); + def->routes = g_new0(virNetDevIPRoute *, nRoutes); /* parse each definition */ for (i = 0; i < nRoutes; i++) { - virNetDevIPRoutePtr route = NULL; + virNetDevIPRoute *route = NULL; if (!(route = virNetDevIPRouteParseXML(def->name, routeNodes[i], @@ -1920,11 +1920,11 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt, size_t j; virSocketAddr testAddr, testGw; bool addrMatch; - virNetDevIPRoutePtr gwdef = def->routes[i]; - virSocketAddrPtr gateway = virNetDevIPRouteGetGateway(gwdef); + virNetDevIPRoute *gwdef = def->routes[i]; + virSocketAddr *gateway = virNetDevIPRouteGetGateway(gwdef); addrMatch = false; for (j = 0; j < nips; j++) { - virNetworkIPDefPtr def2 = &def->ips[j]; + virNetworkIPDef *def2 = &def->ips[j]; int prefix; if (VIR_SOCKET_ADDR_FAMILY(gateway) @@ -2101,13 +2101,13 @@ virNetworkDefParseXML(xmlXPathContextPtr ctxt, } -static virNetworkDefPtr +static virNetworkDef * virNetworkDefParse(const char *xmlStr, const char *filename, - virNetworkXMLOptionPtr xmlopt) + virNetworkXMLOption *xmlopt) { g_autoptr(xmlDoc) xml = NULL; - virNetworkDefPtr def = NULL; + virNetworkDef *def = NULL; int keepBlanksDefault = xmlKeepBlanksDefault(0); if ((xml = virXMLParse(filename, xmlStr, _("(network_definition)")))) @@ -2118,26 +2118,26 @@ virNetworkDefParse(const char *xmlStr, } -virNetworkDefPtr +virNetworkDef * virNetworkDefParseString(const char *xmlStr, - virNetworkXMLOptionPtr xmlopt) + virNetworkXMLOption *xmlopt) { return virNetworkDefParse(xmlStr, NULL, xmlopt); } -virNetworkDefPtr +virNetworkDef * virNetworkDefParseFile(const char *filename, - virNetworkXMLOptionPtr xmlopt) + virNetworkXMLOption *xmlopt) { return virNetworkDefParse(NULL, filename, xmlopt); } -virNetworkDefPtr +virNetworkDef * virNetworkDefParseNode(xmlDocPtr xml, xmlNodePtr root, - virNetworkXMLOptionPtr xmlopt) + virNetworkXMLOption *xmlopt) { g_autoptr(xmlXPathContext) ctxt = NULL; @@ -2158,7 +2158,7 @@ virNetworkDefParseNode(xmlDocPtr xml, static int -virNetworkDNSDefFormat(virBufferPtr buf, +virNetworkDNSDefFormat(virBuffer *buf, const virNetworkDNSDef *def) { size_t i, j; @@ -2263,7 +2263,7 @@ virNetworkDNSDefFormat(virBufferPtr buf, static int -virNetworkIPDefFormat(virBufferPtr buf, +virNetworkIPDefFormat(virBuffer *buf, const virNetworkIPDef *def) { virBufferAddLit(buf, "nranges; i++) { virSocketAddrRange addr = def->ranges[i].addr; - virNetworkDHCPLeaseTimeDefPtr lease = def->ranges[i].lease; + virNetworkDHCPLeaseTimeDef *lease = def->ranges[i].lease; g_autofree char *saddr = NULL; g_autofree char *eaddr = NULL; @@ -2333,7 +2333,7 @@ virNetworkIPDefFormat(virBufferPtr buf, } } for (i = 0; i < def->nhosts; i++) { - virNetworkDHCPLeaseTimeDefPtr lease = def->hosts[i].lease; + virNetworkDHCPLeaseTimeDef *lease = def->hosts[i].lease; virBufferAddLit(buf, "hosts[i].mac) virBufferAsprintf(buf, " mac='%s'", def->hosts[i].mac); @@ -2389,7 +2389,7 @@ virNetworkIPDefFormat(virBufferPtr buf, void virNetworkPortOptionsFormat(virTristateBool isolatedPort, - virBufferPtr buf) + virBuffer *buf) { if (isolatedPort != VIR_TRISTATE_BOOL_ABSENT) virBufferAsprintf(buf, "\n", @@ -2397,7 +2397,7 @@ virNetworkPortOptionsFormat(virTristateBool isolatedPort, } static int -virPortGroupDefFormat(virBufferPtr buf, +virPortGroupDefFormat(virBuffer *buf, const virPortGroupDef *def) { virBufferAsprintf(buf, "name); @@ -2420,7 +2420,7 @@ virPortGroupDefFormat(virBufferPtr buf, static int -virNetworkForwardNatDefFormat(virBufferPtr buf, +virNetworkForwardNatDefFormat(virBuffer *buf, const virNetworkForwardDef *fwd) { g_autofree char *addrStart = NULL; @@ -2473,9 +2473,9 @@ virNetworkForwardNatDefFormat(virBufferPtr buf, int -virNetworkDefFormatBuf(virBufferPtr buf, +virNetworkDefFormatBuf(virBuffer *buf, const virNetworkDef *def, - virNetworkXMLOptionPtr xmlopt G_GNUC_UNUSED, + virNetworkXMLOption *xmlopt G_GNUC_UNUSED, unsigned int flags) { const unsigned char *uuid; @@ -2708,7 +2708,7 @@ virNetworkDefFormatBuf(virBufferPtr buf, char * virNetworkDefFormat(const virNetworkDef *def, - virNetworkXMLOptionPtr xmlopt, + virNetworkXMLOption *xmlopt, unsigned int flags) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -2730,8 +2730,8 @@ virNetworkDefForwardIf(const virNetworkDef *def, } -virPortGroupDefPtr -virPortGroupFindByName(virNetworkDefPtr net, +virPortGroupDef * +virPortGroupFindByName(virNetworkDef *net, const char *portgroup) { size_t i; @@ -2750,7 +2750,7 @@ virPortGroupFindByName(virNetworkDefPtr net, int virNetworkSaveXML(const char *configDir, - virNetworkDefPtr def, + virNetworkDef *def, const char *xml) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -2775,8 +2775,8 @@ virNetworkSaveXML(const char *configDir, int virNetworkSaveConfig(const char *configDir, - virNetworkDefPtr def, - virNetworkXMLOptionPtr xmlopt) + virNetworkDef *def, + virNetworkXMLOption *xmlopt) { g_autofree char *xml = NULL; @@ -2799,7 +2799,7 @@ virNetworkConfigFile(const char *dir, void -virNetworkSetBridgeMacAddr(virNetworkDefPtr def) +virNetworkSetBridgeMacAddr(virNetworkDef *def) { if (!def->mac_specified) { /* if the bridge doesn't have a mac address explicitly defined, @@ -2815,7 +2815,7 @@ virNetworkSetBridgeMacAddr(virNetworkDefPtr def) /* NetworkObj backend of the virNetworkUpdate API */ static void -virNetworkDefUpdateNoSupport(virNetworkDefPtr def, const char *section) +virNetworkDefUpdateNoSupport(virNetworkDef *def, const char *section) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, _("can't update '%s' section of network '%s'"), @@ -2832,7 +2832,7 @@ virNetworkDefUpdateUnknownCommand(unsigned int command) static int -virNetworkDefUpdateCheckElementName(virNetworkDefPtr def, +virNetworkDefUpdateCheckElementName(virNetworkDef *def, xmlNodePtr node, const char *section) { @@ -2848,7 +2848,7 @@ virNetworkDefUpdateCheckElementName(virNetworkDefPtr def, static int -virNetworkDefUpdateBridge(virNetworkDefPtr def, +virNetworkDefUpdateBridge(virNetworkDef *def, unsigned int command G_GNUC_UNUSED, int parentIndex G_GNUC_UNUSED, xmlXPathContextPtr ctxt G_GNUC_UNUSED, @@ -2861,7 +2861,7 @@ virNetworkDefUpdateBridge(virNetworkDefPtr def, static int -virNetworkDefUpdateDomain(virNetworkDefPtr def, +virNetworkDefUpdateDomain(virNetworkDef *def, unsigned int command G_GNUC_UNUSED, int parentIndex G_GNUC_UNUSED, xmlXPathContextPtr ctxt G_GNUC_UNUSED, @@ -2874,7 +2874,7 @@ virNetworkDefUpdateDomain(virNetworkDefPtr def, static int -virNetworkDefUpdateIP(virNetworkDefPtr def, +virNetworkDefUpdateIP(virNetworkDef *def, unsigned int command G_GNUC_UNUSED, int parentIndex G_GNUC_UNUSED, xmlXPathContextPtr ctxt G_GNUC_UNUSED, @@ -2886,10 +2886,10 @@ virNetworkDefUpdateIP(virNetworkDefPtr def, } -static virNetworkIPDefPtr -virNetworkIPDefByIndex(virNetworkDefPtr def, int parentIndex) +static virNetworkIPDef * +virNetworkIPDefByIndex(virNetworkDef *def, int parentIndex) { - virNetworkIPDefPtr ipdef = NULL; + virNetworkIPDef *ipdef = NULL; size_t i; /* first find which ip element's dhcp host list to work on */ @@ -2928,12 +2928,12 @@ virNetworkIPDefByIndex(virNetworkDefPtr def, int parentIndex) static int -virNetworkDefUpdateCheckMultiDHCP(virNetworkDefPtr def, - virNetworkIPDefPtr ipdef) +virNetworkDefUpdateCheckMultiDHCP(virNetworkDef *def, + virNetworkIPDef *ipdef) { int family = VIR_SOCKET_ADDR_FAMILY(&ipdef->address); size_t i; - virNetworkIPDefPtr ip; + virNetworkIPDef *ip; for (i = 0; (ip = virNetworkDefGetIPByIndex(def, family, i)); i++) { if (ip != ipdef) { @@ -2951,7 +2951,7 @@ virNetworkDefUpdateCheckMultiDHCP(virNetworkDefPtr def, static int -virNetworkDefUpdateIPDHCPHost(virNetworkDefPtr def, +virNetworkDefUpdateIPDHCPHost(virNetworkDef *def, unsigned int command, int parentIndex, xmlXPathContextPtr ctxt, @@ -2960,7 +2960,7 @@ virNetworkDefUpdateIPDHCPHost(virNetworkDefPtr def, { size_t i; int ret = -1; - virNetworkIPDefPtr ipdef = virNetworkIPDefByIndex(def, parentIndex); + virNetworkIPDef *ipdef = virNetworkIPDefByIndex(def, parentIndex); virNetworkDHCPHostDef host; bool partialOkay = (command == VIR_NETWORK_UPDATE_COMMAND_DELETE); @@ -3089,7 +3089,7 @@ virNetworkDefUpdateIPDHCPHost(virNetworkDefPtr def, static int -virNetworkDefUpdateIPDHCPRange(virNetworkDefPtr def, +virNetworkDefUpdateIPDHCPRange(virNetworkDef *def, unsigned int command, int parentIndex, xmlXPathContextPtr ctxt, @@ -3097,7 +3097,7 @@ virNetworkDefUpdateIPDHCPRange(virNetworkDefPtr def, unsigned int fflags G_GNUC_UNUSED) { size_t i; - virNetworkIPDefPtr ipdef = virNetworkIPDefByIndex(def, parentIndex); + virNetworkIPDef *ipdef = virNetworkIPDefByIndex(def, parentIndex); virNetworkDHCPRangeDef range; memset(&range, 0, sizeof(range)); @@ -3187,7 +3187,7 @@ virNetworkDefUpdateIPDHCPRange(virNetworkDefPtr def, static int -virNetworkDefUpdateForward(virNetworkDefPtr def, +virNetworkDefUpdateForward(virNetworkDef *def, unsigned int command G_GNUC_UNUSED, int parentIndex G_GNUC_UNUSED, xmlXPathContextPtr ctxt G_GNUC_UNUSED, @@ -3200,7 +3200,7 @@ virNetworkDefUpdateForward(virNetworkDefPtr def, static int -virNetworkDefUpdateForwardInterface(virNetworkDefPtr def, +virNetworkDefUpdateForwardInterface(virNetworkDef *def, unsigned int command, int parentIndex G_GNUC_UNUSED, xmlXPathContextPtr ctxt, @@ -3295,7 +3295,7 @@ virNetworkDefUpdateForwardInterface(virNetworkDefPtr def, static int -virNetworkDefUpdateForwardPF(virNetworkDefPtr def, +virNetworkDefUpdateForwardPF(virNetworkDef *def, unsigned int command G_GNUC_UNUSED, int parentIndex G_GNUC_UNUSED, xmlXPathContextPtr ctxt G_GNUC_UNUSED, @@ -3308,7 +3308,7 @@ virNetworkDefUpdateForwardPF(virNetworkDefPtr def, static int -virNetworkDefUpdatePortGroup(virNetworkDefPtr def, +virNetworkDefUpdatePortGroup(virNetworkDef *def, unsigned int command, int parentIndex G_GNUC_UNUSED, xmlXPathContextPtr ctxt, @@ -3403,7 +3403,7 @@ virNetworkDefUpdatePortGroup(virNetworkDefPtr def, static int -virNetworkDefUpdateDNSHost(virNetworkDefPtr def, +virNetworkDefUpdateDNSHost(virNetworkDef *def, unsigned int command G_GNUC_UNUSED, int parentIndex G_GNUC_UNUSED, xmlXPathContextPtr ctxt G_GNUC_UNUSED, @@ -3412,7 +3412,7 @@ virNetworkDefUpdateDNSHost(virNetworkDefPtr def, { size_t i, j, k; int foundIdx = -1, ret = -1; - virNetworkDNSDefPtr dns = &def->dns; + virNetworkDNSDef *dns = &def->dns; virNetworkDNSHostDef host; bool isAdd = (command == VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST || command == VIR_NETWORK_UPDATE_COMMAND_ADD_LAST); @@ -3498,7 +3498,7 @@ virNetworkDefUpdateDNSHost(virNetworkDefPtr def, static int -virNetworkDefUpdateDNSSrv(virNetworkDefPtr def, +virNetworkDefUpdateDNSSrv(virNetworkDef *def, unsigned int command G_GNUC_UNUSED, int parentIndex G_GNUC_UNUSED, xmlXPathContextPtr ctxt G_GNUC_UNUSED, @@ -3507,7 +3507,7 @@ virNetworkDefUpdateDNSSrv(virNetworkDefPtr def, { size_t i; int foundIdx = -1, ret = -1; - virNetworkDNSDefPtr dns = &def->dns; + virNetworkDNSDef *dns = &def->dns; virNetworkDNSSrvDef srv; bool isAdd = (command == VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST || command == VIR_NETWORK_UPDATE_COMMAND_ADD_LAST); @@ -3585,7 +3585,7 @@ virNetworkDefUpdateDNSSrv(virNetworkDefPtr def, static int -virNetworkDefUpdateDNSTxt(virNetworkDefPtr def, +virNetworkDefUpdateDNSTxt(virNetworkDef *def, unsigned int command G_GNUC_UNUSED, int parentIndex G_GNUC_UNUSED, xmlXPathContextPtr ctxt G_GNUC_UNUSED, @@ -3593,7 +3593,7 @@ virNetworkDefUpdateDNSTxt(virNetworkDefPtr def, unsigned int fflags G_GNUC_UNUSED) { int foundIdx, ret = -1; - virNetworkDNSDefPtr dns = &def->dns; + virNetworkDNSDef *dns = &def->dns; virNetworkDNSTxtDef txt; bool isAdd = (command == VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST || command == VIR_NETWORK_UPDATE_COMMAND_ADD_LAST); @@ -3659,7 +3659,7 @@ virNetworkDefUpdateDNSTxt(virNetworkDefPtr def, int -virNetworkDefUpdateSection(virNetworkDefPtr def, +virNetworkDefUpdateSection(virNetworkDef *def, unsigned int command, /* virNetworkUpdateCommand */ unsigned int section, /* virNetworkUpdateSection */ int parentIndex, diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h index 34b9aa9505..a7e6b7a2a6 100644 --- a/src/conf/network_conf.h +++ b/src/conf/network_conf.h @@ -44,7 +44,6 @@ struct _virNetworkXMLOption { virXMLNamespace ns; }; typedef struct _virNetworkXMLOption virNetworkXMLOption; -typedef virNetworkXMLOption *virNetworkXMLOptionPtr; typedef enum { @@ -105,38 +104,33 @@ typedef enum { VIR_ENUM_DECL(virNetworkForwardDriverName); typedef struct _virNetworkDHCPLeaseTimeDef virNetworkDHCPLeaseTimeDef; -typedef virNetworkDHCPLeaseTimeDef *virNetworkDHCPLeaseTimeDefPtr; struct _virNetworkDHCPLeaseTimeDef { unsigned long expiry; virNetworkDHCPLeaseTimeUnitType unit; }; typedef struct _virNetworkDHCPRangeDef virNetworkDHCPRangeDef; -typedef virNetworkDHCPRangeDef *virNetworkDHCPRangeDefPtr; struct _virNetworkDHCPRangeDef { virSocketAddrRange addr; - virNetworkDHCPLeaseTimeDefPtr lease; + virNetworkDHCPLeaseTimeDef *lease; }; typedef struct _virNetworkDHCPHostDef virNetworkDHCPHostDef; -typedef virNetworkDHCPHostDef *virNetworkDHCPHostDefPtr; struct _virNetworkDHCPHostDef { char *mac; char *id; char *name; virSocketAddr ip; - virNetworkDHCPLeaseTimeDefPtr lease; + virNetworkDHCPLeaseTimeDef *lease; }; typedef struct _virNetworkDNSTxtDef virNetworkDNSTxtDef; -typedef virNetworkDNSTxtDef *virNetworkDNSTxtDefPtr; struct _virNetworkDNSTxtDef { char *name; char *value; }; typedef struct _virNetworkDNSSrvDef virNetworkDNSSrvDef; -typedef virNetworkDNSSrvDef *virNetworkDNSSrvDefPtr; struct _virNetworkDNSSrvDef { char *domain; char *service; @@ -148,7 +142,6 @@ struct _virNetworkDNSSrvDef { }; typedef struct _virNetworkDNSHostDef virNetworkDNSHostDef; -typedef virNetworkDNSHostDef *virNetworkDNSHostDefPtr; struct _virNetworkDNSHostDef { virSocketAddr ip; size_t nnames; @@ -157,29 +150,26 @@ struct _virNetworkDNSHostDef { typedef struct _virNetworkDNSForwarder virNetworkDNSForwarder; -typedef virNetworkDNSForwarder *virNetworkDNSForwarderPtr; struct _virNetworkDNSForwarder { virSocketAddr addr; char *domain; }; typedef struct _virNetworkDNSDef virNetworkDNSDef; -typedef virNetworkDNSDef *virNetworkDNSDefPtr; struct _virNetworkDNSDef { int enable; /* enum virTristateBool */ int forwardPlainNames; /* enum virTristateBool */ size_t ntxts; - virNetworkDNSTxtDefPtr txts; + virNetworkDNSTxtDef *txts; size_t nhosts; - virNetworkDNSHostDefPtr hosts; + virNetworkDNSHostDef *hosts; size_t nsrvs; - virNetworkDNSSrvDefPtr srvs; + virNetworkDNSSrvDef *srvs; size_t nfwds; - virNetworkDNSForwarderPtr forwarders; + virNetworkDNSForwarder *forwarders; }; typedef struct _virNetworkIPDef virNetworkIPDef; -typedef virNetworkIPDef *virNetworkIPDefPtr; struct _virNetworkIPDef { char *family; /* ipv4 or ipv6 - default is ipv4 */ virSocketAddr address; /* Bridge IP address */ @@ -196,10 +186,10 @@ struct _virNetworkIPDef { int localPTR; /* virTristateBool */ size_t nranges; /* Zero or more dhcp ranges */ - virNetworkDHCPRangeDefPtr ranges; + virNetworkDHCPRangeDef *ranges; size_t nhosts; /* Zero or more dhcp hosts */ - virNetworkDHCPHostDefPtr hosts; + virNetworkDHCPHostDef *hosts; char *tftproot; char *bootfile; @@ -207,7 +197,6 @@ struct _virNetworkIPDef { }; typedef struct _virNetworkForwardIfDef virNetworkForwardIfDef; -typedef virNetworkForwardIfDef *virNetworkForwardIfDefPtr; struct _virNetworkForwardIfDef { int type; union { @@ -219,14 +208,12 @@ struct _virNetworkForwardIfDef { }; typedef struct _virNetworkForwardPfDef virNetworkForwardPfDef; -typedef virNetworkForwardPfDef *virNetworkForwardPfDefPtr; struct _virNetworkForwardPfDef { char *dev; /* name of device */ int connections; /* how many guest interfaces are connected to this device? */ }; typedef struct _virNetworkForwardDef virNetworkForwardDef; -typedef virNetworkForwardDef *virNetworkForwardDefPtr; struct _virNetworkForwardDef { int type; /* One of virNetworkForwardType constants */ bool managed; /* managed attribute for hostdev mode */ @@ -236,10 +223,10 @@ struct _virNetworkForwardDef { * interfaces), they will be listed here. */ size_t npfs; - virNetworkForwardPfDefPtr pfs; + virNetworkForwardPfDef *pfs; size_t nifs; - virNetworkForwardIfDefPtr ifs; + virNetworkForwardIfDef *ifs; /* ranges for NAT */ virSocketAddrRange addr; @@ -249,18 +236,16 @@ struct _virNetworkForwardDef { }; typedef struct _virPortGroupDef virPortGroupDef; -typedef virPortGroupDef *virPortGroupDefPtr; struct _virPortGroupDef { char *name; bool isDefault; - virNetDevVPortProfilePtr virtPortProfile; - virNetDevBandwidthPtr bandwidth; + virNetDevVPortProfile *virtPortProfile; + virNetDevBandwidth *bandwidth; virNetDevVlan vlan; int trustGuestRxFilters; /* enum virTristateBool */ }; typedef struct _virNetworkDef virNetworkDef; -typedef virNetworkDef *virNetworkDefPtr; struct _virNetworkDef { unsigned char uuid[VIR_UUID_BUFLEN]; bool uuid_specified; @@ -286,17 +271,17 @@ struct _virNetworkDef { virNetworkForwardDef forward; size_t nips; - virNetworkIPDefPtr ips; /* ptr to array of IP addresses on this network */ + virNetworkIPDef *ips; /* ptr to array of IP addresses on this network */ size_t nroutes; - virNetDevIPRoutePtr *routes; /* ptr to array of static routes on this interface */ + virNetDevIPRoute **routes; /* ptr to array of static routes on this interface */ virNetworkDNSDef dns; /* dns related configuration */ - virNetDevVPortProfilePtr virtPortProfile; + virNetDevVPortProfile *virtPortProfile; size_t nPortGroups; - virPortGroupDefPtr portGroups; - virNetDevBandwidthPtr bandwidth; + virPortGroupDef *portGroups; + virNetDevBandwidth *bandwidth; virNetDevVlan vlan; int trustGuestRxFilters; /* enum virTristateBool */ virTristateBool isolatedPort; @@ -320,7 +305,7 @@ typedef enum { VIR_NETWORK_TAINT_LAST } virNetworkTaintFlags; -void virNetworkDefFree(virNetworkDefPtr def); +void virNetworkDefFree(virNetworkDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetworkDef, virNetworkDefFree); enum { @@ -328,56 +313,56 @@ enum { VIR_NETWORK_OBJ_LIST_ADD_CHECK_LIVE = (1 << 1), }; -virNetworkXMLOptionPtr -virNetworkXMLOptionNew(virXMLNamespacePtr xmlns); +virNetworkXMLOption * +virNetworkXMLOptionNew(virXMLNamespace *xmlns); -virNetworkDefPtr -virNetworkDefCopy(virNetworkDefPtr def, - virNetworkXMLOptionPtr xmlopt, +virNetworkDef * +virNetworkDefCopy(virNetworkDef *def, + virNetworkXMLOption *xmlopt, unsigned int flags); -virNetworkDefPtr +virNetworkDef * virNetworkDefParseXML(xmlXPathContextPtr ctxt, - virNetworkXMLOptionPtr xmlopt); + virNetworkXMLOption *xmlopt); -virNetworkDefPtr +virNetworkDef * virNetworkDefParseString(const char *xmlStr, - virNetworkXMLOptionPtr xmlopt); + virNetworkXMLOption *xmlopt); -virNetworkDefPtr +virNetworkDef * virNetworkDefParseFile(const char *filename, - virNetworkXMLOptionPtr xmlopt); + virNetworkXMLOption *xmlopt); -virNetworkDefPtr +virNetworkDef * virNetworkDefParseNode(xmlDocPtr xml, xmlNodePtr root, - virNetworkXMLOptionPtr xmlopt); + virNetworkXMLOption *xmlopt); char * virNetworkDefFormat(const virNetworkDef *def, - virNetworkXMLOptionPtr xmlopt, + virNetworkXMLOption *xmlopt, unsigned int flags); int -virNetworkDefFormatBuf(virBufferPtr buf, +virNetworkDefFormatBuf(virBuffer *buf, const virNetworkDef *def, - virNetworkXMLOptionPtr xmlopt, + virNetworkXMLOption *xmlopt, unsigned int flags); const char * virNetworkDefForwardIf(const virNetworkDef *def, size_t n); -virPortGroupDefPtr -virPortGroupFindByName(virNetworkDefPtr net, +virPortGroupDef * +virPortGroupFindByName(virNetworkDef *net, const char *portgroup); -virNetworkIPDefPtr +virNetworkIPDef * virNetworkDefGetIPByIndex(const virNetworkDef *def, int family, size_t n); -virNetDevIPRoutePtr +virNetDevIPRoute * virNetworkDefGetRouteByIndex(const virNetworkDef *def, int family, size_t n); @@ -387,24 +372,24 @@ virNetworkIPDefPrefix(const virNetworkIPDef *def); int virNetworkIPDefNetmask(const virNetworkIPDef *def, - virSocketAddrPtr netmask); + virSocketAddr *netmask); int virNetworkSaveXML(const char *configDir, - virNetworkDefPtr def, + virNetworkDef *def, const char *xml); int virNetworkSaveConfig(const char *configDir, - virNetworkDefPtr def, - virNetworkXMLOptionPtr xmlopt); + virNetworkDef *def, + virNetworkXMLOption *xmlopt); char * virNetworkConfigFile(const char *dir, const char *name); void -virNetworkSetBridgeMacAddr(virNetworkDefPtr def); +virNetworkSetBridgeMacAddr(virNetworkDef *def); int virNetworkPortOptionsParseXML(xmlXPathContextPtr ctxt, @@ -412,7 +397,7 @@ virNetworkPortOptionsParseXML(xmlXPathContextPtr ctxt, void virNetworkPortOptionsFormat(virTristateBool isolatedPort, - virBufferPtr buf); + virBuffer *buf); VIR_ENUM_DECL(virNetworkForward); @@ -435,7 +420,7 @@ VIR_ENUM_DECL(virNetworkForward); /* for testing */ int -virNetworkDefUpdateSection(virNetworkDefPtr def, +virNetworkDefUpdateSection(virNetworkDef *def, unsigned int command, /* virNetworkUpdateCommand */ unsigned int section, /* virNetworkUpdateSection */ int parentIndex, diff --git a/src/conf/network_event.c b/src/conf/network_event.c index 41cabe340a..a47bf4dd3e 100644 --- a/src/conf/network_event.c +++ b/src/conf/network_event.c @@ -36,7 +36,6 @@ struct _virNetworkEvent { bool dummy; }; typedef struct _virNetworkEvent virNetworkEvent; -typedef virNetworkEvent *virNetworkEventPtr; struct _virNetworkEventLifecycle { virNetworkEvent parent; @@ -45,10 +44,9 @@ struct _virNetworkEventLifecycle { int detail; }; typedef struct _virNetworkEventLifecycle virNetworkEventLifecycle; -typedef virNetworkEventLifecycle *virNetworkEventLifecyclePtr; -static virClassPtr virNetworkEventClass; -static virClassPtr virNetworkEventLifecycleClass; +static virClass *virNetworkEventClass; +static virClass *virNetworkEventLifecycleClass; static void virNetworkEventDispose(void *obj); static void virNetworkEventLifecycleDispose(void *obj); @@ -69,7 +67,7 @@ VIR_ONCE_GLOBAL_INIT(virNetworkEvents); static void virNetworkEventDispose(void *obj) { - virNetworkEventPtr event = obj; + virNetworkEvent *event = obj; VIR_DEBUG("obj=%p", event); } @@ -77,14 +75,14 @@ virNetworkEventDispose(void *obj) static void virNetworkEventLifecycleDispose(void *obj) { - virNetworkEventLifecyclePtr event = obj; + virNetworkEventLifecycle *event = obj; VIR_DEBUG("obj=%p", event); } static void virNetworkEventDispatchDefaultFunc(virConnectPtr conn, - virObjectEventPtr event, + virObjectEvent *event, virConnectObjectEventGenericCallback cb, void *cbopaque) { @@ -95,9 +93,9 @@ virNetworkEventDispatchDefaultFunc(virConnectPtr conn, switch ((virNetworkEventID)event->eventID) { case VIR_NETWORK_EVENT_ID_LIFECYCLE: { - virNetworkEventLifecyclePtr networkLifecycleEvent; + virNetworkEventLifecycle *networkLifecycleEvent; - networkLifecycleEvent = (virNetworkEventLifecyclePtr)event; + networkLifecycleEvent = (virNetworkEventLifecycle *)event; ((virConnectNetworkEventLifecycleCallback)cb)(conn, net, networkLifecycleEvent->type, networkLifecycleEvent->detail, @@ -134,7 +132,7 @@ virNetworkEventDispatchDefaultFunc(virConnectPtr conn, */ int virNetworkEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virNetworkPtr net, int eventID, virConnectNetworkEventGenericCallback cb, @@ -178,7 +176,7 @@ virNetworkEventStateRegisterID(virConnectPtr conn, */ int virNetworkEventStateRegisterClient(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virNetworkPtr net, int eventID, virConnectNetworkEventGenericCallback cb, @@ -211,13 +209,13 @@ virNetworkEventStateRegisterClient(virConnectPtr conn, * * Create a new network lifecycle event. */ -virObjectEventPtr +virObjectEvent * virNetworkEventLifecycleNew(const char *name, const unsigned char *uuid, int type, int detail) { - virNetworkEventLifecyclePtr event; + virNetworkEventLifecycle *event; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (virNetworkEventsInitialize() < 0) @@ -233,5 +231,5 @@ virNetworkEventLifecycleNew(const char *name, event->type = type; event->detail = detail; - return (virObjectEventPtr)event; + return (virObjectEvent *)event; } diff --git a/src/conf/network_event.h b/src/conf/network_event.h index 2267003970..b55739ed0f 100644 --- a/src/conf/network_event.h +++ b/src/conf/network_event.h @@ -27,7 +27,7 @@ int virNetworkEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virNetworkPtr net, int eventID, virConnectNetworkEventGenericCallback cb, @@ -39,7 +39,7 @@ virNetworkEventStateRegisterID(virConnectPtr conn, int virNetworkEventStateRegisterClient(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virNetworkPtr net, int eventID, virConnectNetworkEventGenericCallback cb, @@ -49,7 +49,7 @@ virNetworkEventStateRegisterClient(virConnectPtr conn, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(8); -virObjectEventPtr +virObjectEvent * virNetworkEventLifecycleNew(const char *name, const unsigned char *uuid, int type, diff --git a/src/conf/networkcommon_conf.c b/src/conf/networkcommon_conf.c index 425b94e511..2f543ced70 100644 --- a/src/conf/networkcommon_conf.c +++ b/src/conf/networkcommon_conf.c @@ -30,7 +30,7 @@ #define VIR_FROM_THIS VIR_FROM_NETWORK -virNetDevIPRoutePtr +virNetDevIPRoute * virNetDevIPRouteCreate(const char *errorDetail, const char *family, const char *address, @@ -212,7 +212,7 @@ virNetDevIPRouteCreate(const char *errorDetail, return g_steal_pointer(&def); } -virNetDevIPRoutePtr +virNetDevIPRoute * virNetDevIPRouteParseXML(const char *errorDetail, xmlNodePtr node, xmlXPathContextPtr ctxt) @@ -273,7 +273,7 @@ virNetDevIPRouteParseXML(const char *errorDetail, } int -virNetDevIPRouteFormat(virBufferPtr buf, +virNetDevIPRouteFormat(virBuffer *buf, const virNetDevIPRoute *def) { g_autofree char *address = NULL; diff --git a/src/conf/networkcommon_conf.h b/src/conf/networkcommon_conf.h index b257ffdd9c..cc75af1ebb 100644 --- a/src/conf/networkcommon_conf.h +++ b/src/conf/networkcommon_conf.h @@ -30,7 +30,7 @@ #include "virsocketaddr.h" #include "virnetdevip.h" -virNetDevIPRoutePtr +virNetDevIPRoute * virNetDevIPRouteCreate(const char *networkName, const char *family, const char *address, @@ -41,10 +41,10 @@ virNetDevIPRouteCreate(const char *networkName, unsigned int metric, bool hasMetric); -virNetDevIPRoutePtr +virNetDevIPRoute * virNetDevIPRouteParseXML(const char *networkName, xmlNodePtr node, xmlXPathContextPtr ctxt); int -virNetDevIPRouteFormat(virBufferPtr buf, +virNetDevIPRouteFormat(virBuffer *buf, const virNetDevIPRoute *def); diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c index d167da6171..faa36c1944 100644 --- a/src/conf/node_device_conf.c +++ b/src/conf/node_device_conf.c @@ -101,9 +101,9 @@ virNodeDevCapsDefParseString(const char *xpath, void -virNodeDeviceDefFree(virNodeDeviceDefPtr def) +virNodeDeviceDefFree(virNodeDeviceDef *def) { - virNodeDevCapsDefPtr caps; + virNodeDevCapsDef *caps; if (!def) return; @@ -121,7 +121,7 @@ virNodeDeviceDefFree(virNodeDeviceDefPtr def) caps = def->caps; while (caps) { - virNodeDevCapsDefPtr next = caps->next; + virNodeDevCapsDef *next = caps->next; virNodeDevCapsDefFree(caps); caps = next; } @@ -131,8 +131,8 @@ virNodeDeviceDefFree(virNodeDeviceDefPtr def) static void -virPCIELinkFormat(virBufferPtr buf, - virPCIELinkPtr lnk, +virPCIELinkFormat(virBuffer *buf, + virPCIELink *lnk, const char *attrib) { if (!lnk) @@ -150,8 +150,8 @@ virPCIELinkFormat(virBufferPtr buf, static void -virPCIEDeviceInfoFormat(virBufferPtr buf, - virPCIEDeviceInfoPtr info) +virPCIEDeviceInfoFormat(virBuffer *buf, + virPCIEDeviceInfo *info) { if (!info->link_cap && !info->link_sta) { virBufferAddLit(buf, "\n"); @@ -170,7 +170,7 @@ virPCIEDeviceInfoFormat(virBufferPtr buf, static void -virNodeDeviceCapSystemDefFormat(virBufferPtr buf, +virNodeDeviceCapSystemDefFormat(virBuffer *buf, const virNodeDevCapData *data) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -211,8 +211,8 @@ virNodeDeviceCapSystemDefFormat(virBufferPtr buf, static void -virNodeDeviceCapMdevTypesFormat(virBufferPtr buf, - virMediatedDeviceTypePtr *mdev_types, +virNodeDeviceCapMdevTypesFormat(virBuffer *buf, + virMediatedDeviceType **mdev_types, const size_t nmdev_types) { size_t i; @@ -221,7 +221,7 @@ virNodeDeviceCapMdevTypesFormat(virBufferPtr buf, virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); for (i = 0; i < nmdev_types; i++) { - virMediatedDeviceTypePtr type = mdev_types[i]; + virMediatedDeviceType *type = mdev_types[i]; virBufferEscapeString(buf, "\n", type->id); virBufferAdjustIndent(buf, 2); if (type->name) @@ -242,7 +242,7 @@ virNodeDeviceCapMdevTypesFormat(virBufferPtr buf, static void -virNodeDeviceCapPCIDefFormat(virBufferPtr buf, +virNodeDeviceCapPCIDefFormat(virBuffer *buf, const virNodeDevCapData *data) { size_t i; @@ -341,7 +341,7 @@ virNodeDeviceCapPCIDefFormat(virBufferPtr buf, static void -virNodeDeviceCapUSBDevDefFormat(virBufferPtr buf, +virNodeDeviceCapUSBDevDefFormat(virBuffer *buf, const virNodeDevCapData *data) { virBufferAsprintf(buf, "%d\n", data->usb_dev.bus); @@ -365,7 +365,7 @@ virNodeDeviceCapUSBDevDefFormat(virBufferPtr buf, static void -virNodeDeviceCapUSBInterfaceDefFormat(virBufferPtr buf, +virNodeDeviceCapUSBInterfaceDefFormat(virBuffer *buf, const virNodeDevCapData *data) { virBufferAsprintf(buf, "%d\n", @@ -384,7 +384,7 @@ virNodeDeviceCapUSBInterfaceDefFormat(virBufferPtr buf, static void -virNodeDeviceCapNetDefFormat(virBufferPtr buf, +virNodeDeviceCapNetDefFormat(virBuffer *buf, const virNodeDevCapData *data) { size_t i; @@ -413,7 +413,7 @@ virNodeDeviceCapNetDefFormat(virBufferPtr buf, static void -virNodeDeviceCapSCSIHostDefFormat(virBufferPtr buf, +virNodeDeviceCapSCSIHostDefFormat(virBuffer *buf, const virNodeDevCapData *data) { virBufferAsprintf(buf, "%d\n", @@ -447,7 +447,7 @@ virNodeDeviceCapSCSIHostDefFormat(virBufferPtr buf, static void -virNodeDeviceCapSCSIDefFormat(virBufferPtr buf, +virNodeDeviceCapSCSIDefFormat(virBuffer *buf, const virNodeDevCapData *data) { virBufferAsprintf(buf, "%d\n", data->scsi.host); @@ -462,7 +462,7 @@ virNodeDeviceCapSCSIDefFormat(virBufferPtr buf, static void -virNodeDeviceCapStorageDefFormat(virBufferPtr buf, +virNodeDeviceCapStorageDefFormat(virBuffer *buf, const virNodeDevCapData *data) { virBufferEscapeString(buf, "%s\n", @@ -521,7 +521,7 @@ virNodeDeviceCapStorageDefFormat(virBufferPtr buf, } static void -virNodeDeviceCapMdevDefFormat(virBufferPtr buf, +virNodeDeviceCapMdevDefFormat(virBuffer *buf, const virNodeDevCapData *data) { size_t i; @@ -532,14 +532,14 @@ virNodeDeviceCapMdevDefFormat(virBufferPtr buf, data->mdev.iommuGroupNumber); for (i = 0; i < data->mdev.nattributes; i++) { - virMediatedDeviceAttrPtr attr = data->mdev.attributes[i]; + virMediatedDeviceAttr *attr = data->mdev.attributes[i]; virBufferAsprintf(buf, "\n", attr->name, attr->value); } } static void -virNodeDeviceCapVDPADefFormat(virBufferPtr buf, +virNodeDeviceCapVDPADefFormat(virBuffer *buf, const virNodeDevCapData *data) { virBufferEscapeString(buf, "%s\n", data->vdpa.chardev); @@ -547,7 +547,7 @@ virNodeDeviceCapVDPADefFormat(virBufferPtr buf, static void -virNodeDeviceCapCCWDefFormat(virBufferPtr buf, +virNodeDeviceCapCCWDefFormat(virBuffer *buf, const virNodeDevCapData *data) { virBufferAsprintf(buf, "0x%x\n", @@ -567,7 +567,7 @@ char * virNodeDeviceDefFormat(const virNodeDeviceDef *def) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virNodeDevCapsDefPtr caps; + virNodeDevCapsDef *caps; size_t i = 0; virBufferAddLit(&buf, "\n"); @@ -593,7 +593,7 @@ virNodeDeviceDefFormat(const virNodeDeviceDef *def) } for (caps = def->caps; caps; caps = caps->next) { - virNodeDevCapDataPtr data = &caps->data; + virNodeDevCapData *data = &caps->data; virBufferAsprintf(&buf, "\n", virNodeDevCapTypeToString(caps->data.type)); @@ -704,7 +704,7 @@ static int virNodeDevCapsDefParseIntOptional(const char *xpath, xmlXPathContextPtr ctxt, int *value, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, const char *invalid_error_fmt) { int ret; @@ -728,7 +728,7 @@ static int virNodeDevCapsDefParseULong(const char *xpath, xmlXPathContextPtr ctxt, unsigned *value, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, const char *missing_error_fmt, const char *invalid_error_fmt) { @@ -752,7 +752,7 @@ static int virNodeDevCapsDefParseULongLong(const char *xpath, xmlXPathContextPtr ctxt, unsigned long long *value, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, const char *missing_error_fmt, const char *invalid_error_fmt) { @@ -774,9 +774,9 @@ virNodeDevCapsDefParseULongLong(const char *xpath, static int virNodeDevCapDRMParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapDRMPtr drm) + virNodeDevCapDRM *drm) { VIR_XPATH_NODE_AUTORESTORE(ctxt) int val; @@ -799,14 +799,14 @@ virNodeDevCapDRMParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapMdevTypesParseXML(xmlXPathContextPtr ctxt, - virMediatedDeviceTypePtr **mdev_types, + virMediatedDeviceType ***mdev_types, size_t *nmdev_types) { int ret = -1; xmlNodePtr orignode = NULL; g_autofree xmlNodePtr *nodes = NULL; int ntypes = -1; - virMediatedDeviceTypePtr type = NULL; + virMediatedDeviceType *type = NULL; size_t i; if ((ntypes = virXPathNodeSet("./type", ctxt, &nodes)) < 0) @@ -865,7 +865,7 @@ virNodeDevCapMdevTypesParseXML(xmlXPathContextPtr ctxt, static int virNodeDevAPMatrixCapabilityParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, - virNodeDevCapAPMatrixPtr apm_dev) + virNodeDevCapAPMatrix *apm_dev) { g_autofree char *type = virXMLPropString(node, "type"); VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -892,7 +892,7 @@ virNodeDevAPMatrixCapabilityParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCSSCapabilityParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, - virNodeDevCapCCWPtr ccw_dev) + virNodeDevCapCCW *ccw_dev) { g_autofree char *type = virXMLPropString(node, "type"); VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -918,9 +918,9 @@ virNodeDevCSSCapabilityParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapCCWParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapCCWPtr ccw_dev) + virNodeDevCapCCW *ccw_dev) { VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree xmlNodePtr *nodes = NULL; @@ -985,7 +985,7 @@ virNodeDevCapCCWParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapAPAdapterParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, unsigned int *ap_adapter) { g_autofree char *adapter = NULL; @@ -1009,9 +1009,9 @@ virNodeDevCapAPAdapterParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapAPCardParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapAPCardPtr ap_card) + virNodeDevCapAPCard *ap_card) { VIR_XPATH_NODE_AUTORESTORE(ctxt) ctxt->node = node; @@ -1022,9 +1022,9 @@ virNodeDevCapAPCardParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapAPQueueParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapAPQueuePtr ap_queue) + virNodeDevCapAPQueue *ap_queue) { int ret = -1; VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -1063,9 +1063,9 @@ virNodeDevCapAPQueueParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapAPMatrixParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def G_GNUC_UNUSED, + virNodeDeviceDef *def G_GNUC_UNUSED, xmlNodePtr node, - virNodeDevCapAPMatrixPtr ap_matrix) + virNodeDevCapAPMatrix *ap_matrix) { VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree xmlNodePtr *nodes = NULL; @@ -1088,9 +1088,9 @@ virNodeDevCapAPMatrixParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapStorageParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapStoragePtr storage) + virNodeDevCapStorage *storage) { VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree xmlNodePtr *nodes = NULL; @@ -1174,9 +1174,9 @@ virNodeDevCapStorageParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapSCSIParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapSCSIPtr scsi) + virNodeDevCapSCSI *scsi) { VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -1214,9 +1214,9 @@ virNodeDevCapSCSIParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapSCSITargetParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapSCSITargetPtr scsi_target) + virNodeDevCapSCSITarget *scsi_target) { VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree xmlNodePtr *nodes = NULL; @@ -1281,9 +1281,9 @@ virNodeDevCapSCSITargetParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapSCSIHostParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapSCSIHostPtr scsi_host, + virNodeDevCapSCSIHost *scsi_host, int create, const char *virt_type) { @@ -1376,9 +1376,9 @@ virNodeDevCapSCSIHostParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapNetParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapNetPtr net) + virNodeDevCapNet *net) { VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr lnk; @@ -1447,9 +1447,9 @@ virNodeDevCapNetParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapUSBInterfaceParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapUSBIfPtr usb_if) + virNodeDevCapUSBIf *usb_if) { VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -1489,7 +1489,7 @@ static int virNodeDevCapsDefParseHexId(const char *xpath, xmlXPathContextPtr ctxt, unsigned *value, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, const char *missing_error_fmt, const char *invalid_error_fmt) { @@ -1511,9 +1511,9 @@ virNodeDevCapsDefParseHexId(const char *xpath, static int virNodeDevCapUSBDevParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapUSBDevPtr usb_dev) + virNodeDevCapUSBDev *usb_dev) { VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -1553,7 +1553,7 @@ virNodeDevCapUSBDevParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapPCIDevIommuGroupParseXML(xmlXPathContextPtr ctxt, xmlNodePtr iommuGroupNode, - virNodeDevCapPCIDevPtr pci_dev) + virNodeDevCapPCIDev *pci_dev) { VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree xmlNodePtr *addrNodes = NULL; @@ -1598,7 +1598,7 @@ virNodeDevCapPCIDevIommuGroupParseXML(xmlXPathContextPtr ctxt, static int virPCIEDeviceInfoLinkParseXML(xmlXPathContextPtr ctxt, xmlNodePtr linkNode, - virPCIELinkPtr lnk) + virPCIELink *lnk) { VIR_XPATH_NODE_AUTORESTORE(ctxt) int speed; @@ -1641,7 +1641,7 @@ virPCIEDeviceInfoLinkParseXML(xmlXPathContextPtr ctxt, static int virPCIEDeviceInfoParseXML(xmlXPathContextPtr ctxt, xmlNodePtr pciExpressNode, - virPCIEDeviceInfoPtr pci_express) + virPCIEDeviceInfo *pci_express) { VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr lnk; @@ -1670,7 +1670,7 @@ virPCIEDeviceInfoParseXML(xmlXPathContextPtr ctxt, static int virNodeDevPCICapSRIOVPhysicalParseXML(xmlXPathContextPtr ctxt, - virNodeDevCapPCIDevPtr pci_dev) + virNodeDevCapPCIDev *pci_dev) { xmlNodePtr address = virXPathNode("./address[1]", ctxt); @@ -1694,7 +1694,7 @@ virNodeDevPCICapSRIOVPhysicalParseXML(xmlXPathContextPtr ctxt, static int virNodeDevPCICapSRIOVVirtualParseXML(xmlXPathContextPtr ctxt, - virNodeDevCapPCIDevPtr pci_dev) + virNodeDevCapPCIDev *pci_dev) { g_autofree xmlNodePtr *addresses = NULL; int naddresses = virXPathNodeSet("./address", ctxt, &addresses); @@ -1712,7 +1712,7 @@ virNodeDevPCICapSRIOVVirtualParseXML(xmlXPathContextPtr ctxt, return -1; } - pci_dev->virtual_functions = g_new0(virPCIDeviceAddressPtr, naddresses); + pci_dev->virtual_functions = g_new0(virPCIDeviceAddress *, naddresses); for (i = 0; i < naddresses; i++) { g_autoptr(virPCIDeviceAddress) addr = NULL; @@ -1736,7 +1736,7 @@ virNodeDevPCICapSRIOVVirtualParseXML(xmlXPathContextPtr ctxt, static int virNodeDevPCICapabilityParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, - virNodeDevCapPCIDevPtr pci_dev) + virNodeDevCapPCIDev *pci_dev) { g_autofree char *type = virXMLPropString(node, "type"); VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -1773,9 +1773,9 @@ virNodeDevPCICapabilityParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapPCIDevPtr pci_dev) + virNodeDevCapPCIDev *pci_dev) { VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr iommuGroupNode; @@ -1783,7 +1783,7 @@ virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt, g_autofree xmlNodePtr *nodes = NULL; int n = 0; int ret = -1; - virPCIEDeviceInfoPtr pci_express = NULL; + virPCIEDeviceInfo *pci_express = NULL; g_autofree char *tmp = NULL; size_t i = 0; @@ -1880,12 +1880,12 @@ virNodeDevCapPCIDevParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapSystemParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapSystemPtr syscap) + virNodeDevCapSystem *syscap) { - virNodeDevCapSystemHardwarePtr hardware = &syscap->hardware; - virNodeDevCapSystemFirmwarePtr firmware = &syscap->firmware; + virNodeDevCapSystemHardware *hardware = &syscap->hardware; + virNodeDevCapSystemFirmware *firmware = &syscap->firmware; VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree char *tmp = NULL; @@ -1920,7 +1920,7 @@ virNodeDevCapSystemParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapMdevAttributeParseXML(xmlXPathContextPtr ctxt, xmlNodePtr node, - virNodeDevCapMdevPtr mdev) + virNodeDevCapMdev *mdev) { VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autoptr(virMediatedDeviceAttr) attr = virMediatedDeviceAttrNew(); @@ -1941,9 +1941,9 @@ virNodeDevCapMdevAttributeParseXML(xmlXPathContextPtr ctxt, static int virNodeDevCapMdevParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, - virNodeDevCapMdevPtr mdev) + virNodeDevCapMdev *mdev) { VIR_XPATH_NODE_AUTORESTORE(ctxt) int nattrs = 0; @@ -1991,14 +1991,14 @@ virNodeDevCapMdevParseXML(xmlXPathContextPtr ctxt, } -static virNodeDevCapsDefPtr +static virNodeDevCapsDef * virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, xmlNodePtr node, int create, const char *virt_type) { - virNodeDevCapsDefPtr caps; + virNodeDevCapsDef *caps; g_autofree char *tmp = NULL; int val, ret = -1; @@ -2097,13 +2097,13 @@ virNodeDevCapsDefParseXML(xmlXPathContextPtr ctxt, } -static virNodeDeviceDefPtr +static virNodeDeviceDef * virNodeDeviceDefParseXML(xmlXPathContextPtr ctxt, int create, const char *virt_type) { - virNodeDeviceDefPtr def; - virNodeDevCapsDefPtr *next_cap; + virNodeDeviceDef *def; + virNodeDevCapsDef **next_cap; xmlNodePtr *nodes = NULL; int n, m; size_t i; @@ -2219,7 +2219,7 @@ virNodeDeviceDefParseXML(xmlXPathContextPtr ctxt, } -virNodeDeviceDefPtr +virNodeDeviceDef * virNodeDeviceDefParseNode(xmlDocPtr xml, xmlNodePtr root, int create, @@ -2243,14 +2243,14 @@ virNodeDeviceDefParseNode(xmlDocPtr xml, } -static virNodeDeviceDefPtr +static virNodeDeviceDef * virNodeDeviceDefParse(const char *str, const char *filename, int create, const char *virt_type) { xmlDocPtr xml; - virNodeDeviceDefPtr def = NULL; + virNodeDeviceDef *def = NULL; if ((xml = virXMLParse(filename, str, _("(node_device_definition)")))) { def = virNodeDeviceDefParseNode(xml, xmlDocGetRootElement(xml), @@ -2262,7 +2262,7 @@ virNodeDeviceDefParse(const char *str, } -virNodeDeviceDefPtr +virNodeDeviceDef * virNodeDeviceDefParseString(const char *str, int create, const char *virt_type) @@ -2271,7 +2271,7 @@ virNodeDeviceDefParseString(const char *str, } -virNodeDeviceDefPtr +virNodeDeviceDef * virNodeDeviceDefParseFile(const char *filename, int create, const char *virt_type) @@ -2284,11 +2284,11 @@ virNodeDeviceDefParseFile(const char *filename, * Return fc_host dev's WWNN and WWPN */ int -virNodeDeviceGetWWNs(virNodeDeviceDefPtr def, +virNodeDeviceGetWWNs(virNodeDeviceDef *def, char **wwnn, char **wwpn) { - virNodeDevCapsDefPtr cap = NULL; + virNodeDevCapsDef *cap = NULL; cap = def->caps; while (cap != NULL) { @@ -2313,10 +2313,10 @@ virNodeDeviceGetWWNs(virNodeDeviceDefPtr def, void -virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps) +virNodeDevCapsDefFree(virNodeDevCapsDef *caps) { size_t i = 0; - virNodeDevCapDataPtr data = &caps->data; + virNodeDevCapData *data = &caps->data; switch (caps->data.type) { case VIR_NODE_DEV_CAP_SYSTEM: @@ -2416,9 +2416,9 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps) int -virNodeDeviceUpdateCaps(virNodeDeviceDefPtr def) +virNodeDeviceUpdateCaps(virNodeDeviceDef *def) { - virNodeDevCapsDefPtr cap = def->caps; + virNodeDevCapsDef *cap = def->caps; while (cap) { switch (cap->data.type) { @@ -2495,10 +2495,10 @@ virNodeDeviceUpdateCaps(virNodeDeviceDefPtr def) * Returns the number of capabilities the device supports, -1 on error. */ int -virNodeDeviceCapsListExport(virNodeDeviceDefPtr def, +virNodeDeviceCapsListExport(virNodeDeviceDef *def, virNodeDevCapType **list) { - virNodeDevCapsDefPtr caps = NULL; + virNodeDevCapsDef *caps = NULL; g_autofree virNodeDevCapType *tmp = NULL; bool want_list = !!list; int ncaps = 0; @@ -2576,7 +2576,7 @@ virNodeDeviceCapsListExport(virNodeDeviceDefPtr def, #ifdef __linux__ int -virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host) +virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHost *scsi_host) { g_autofree char *tmp = NULL; int ret = -1; @@ -2657,7 +2657,7 @@ virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host) int virNodeDeviceGetSCSITargetCaps(const char *sysfsPath, - virNodeDevCapSCSITargetPtr scsi_target) + virNodeDevCapSCSITarget *scsi_target) { int ret = -1; g_autofree char *dir = NULL; @@ -2698,7 +2698,7 @@ virNodeDeviceGetSCSITargetCaps(const char *sysfsPath, static int virNodeDeviceGetPCISRIOVCaps(const char *sysfsPath, - virNodeDevCapPCIDevPtr pci_dev) + virNodeDevCapPCIDev *pci_dev) { size_t i; int ret; @@ -2736,7 +2736,7 @@ virNodeDeviceGetPCISRIOVCaps(const char *sysfsPath, static int -virNodeDeviceGetPCIIOMMUGroupCaps(virNodeDevCapPCIDevPtr pci_dev) +virNodeDeviceGetPCIIOMMUGroupCaps(virNodeDevCapPCIDev *pci_dev) { size_t i; int tmpGroup; @@ -2774,10 +2774,10 @@ virNodeDeviceGetPCIIOMMUGroupCaps(virNodeDevCapPCIDevPtr pci_dev) static int virNodeDeviceGetMdevTypesCaps(const char *sysfspath, - virMediatedDeviceTypePtr **mdev_types, + virMediatedDeviceType ***mdev_types, size_t *nmdev_types) { - virMediatedDeviceTypePtr *types = NULL; + virMediatedDeviceType **types = NULL; size_t ntypes = 0; size_t i; @@ -2805,7 +2805,7 @@ virNodeDeviceGetMdevTypesCaps(const char *sysfspath, */ int virNodeDeviceGetPCIDynamicCaps(const char *sysfsPath, - virNodeDevCapPCIDevPtr pci_dev) + virNodeDevCapPCIDev *pci_dev) { if (virNodeDeviceGetPCISRIOVCaps(sysfsPath, pci_dev) < 0 || virNodeDeviceGetPCIIOMMUGroupCaps(pci_dev) < 0) @@ -2831,7 +2831,7 @@ virNodeDeviceGetPCIDynamicCaps(const char *sysfsPath, */ int virNodeDeviceGetCSSDynamicCaps(const char *sysfsPath, - virNodeDevCapCCWPtr ccw_dev) + virNodeDevCapCCW *ccw_dev) { ccw_dev->flags &= ~VIR_NODE_DEV_CAP_FLAG_CSS_MDEV; if (virNodeDeviceGetMdevTypesCaps(sysfsPath, @@ -2852,7 +2852,7 @@ virNodeDeviceGetCSSDynamicCaps(const char *sysfsPath, */ int virNodeDeviceGetAPMatrixDynamicCaps(const char *sysfsPath, - virNodeDevCapAPMatrixPtr ap_matrix) + virNodeDevCapAPMatrix *ap_matrix) { ap_matrix->flags &= ~VIR_NODE_DEV_CAP_FLAG_AP_MATRIX_MDEV; if (virNodeDeviceGetMdevTypesCaps(sysfsPath, @@ -2868,35 +2868,35 @@ virNodeDeviceGetAPMatrixDynamicCaps(const char *sysfsPath, #else int -virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host G_GNUC_UNUSED) +virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHost *scsi_host G_GNUC_UNUSED) { return -1; } int virNodeDeviceGetPCIDynamicCaps(const char *sysfsPath G_GNUC_UNUSED, - virNodeDevCapPCIDevPtr pci_dev G_GNUC_UNUSED) + virNodeDevCapPCIDev *pci_dev G_GNUC_UNUSED) { return -1; } int virNodeDeviceGetSCSITargetCaps(const char *sysfsPath G_GNUC_UNUSED, - virNodeDevCapSCSITargetPtr scsi_target G_GNUC_UNUSED) + virNodeDevCapSCSITarget *scsi_target G_GNUC_UNUSED) { return -1; } int virNodeDeviceGetCSSDynamicCaps(const char *sysfsPath G_GNUC_UNUSED, - virNodeDevCapCCWPtr ccw_dev G_GNUC_UNUSED) + virNodeDevCapCCW *ccw_dev G_GNUC_UNUSED) { return -1; } int virNodeDeviceGetAPMatrixDynamicCaps(const char *sysfsPath G_GNUC_UNUSED, - virNodeDevCapAPMatrixPtr ap_matrix G_GNUC_UNUSED) + virNodeDevCapAPMatrix *ap_matrix G_GNUC_UNUSED) { return -1; } diff --git a/src/conf/node_device_conf.h b/src/conf/node_device_conf.h index 6b382ecbff..85790ad96c 100644 --- a/src/conf/node_device_conf.h +++ b/src/conf/node_device_conf.h @@ -125,7 +125,6 @@ typedef enum { VIR_ENUM_DECL(virNodeDevDRM); typedef struct _virNodeDevCapSystemHardware virNodeDevCapSystemHardware; -typedef virNodeDevCapSystemHardware *virNodeDevCapSystemHardwarePtr; struct _virNodeDevCapSystemHardware { char *vendor_name; char *version; @@ -134,7 +133,6 @@ struct _virNodeDevCapSystemHardware { }; typedef struct _virNodeDevCapSystemFirmware virNodeDevCapSystemFirmware; -typedef virNodeDevCapSystemFirmware *virNodeDevCapSystemFirmwarePtr; struct _virNodeDevCapSystemFirmware { char *vendor_name; char *version; @@ -142,7 +140,6 @@ struct _virNodeDevCapSystemFirmware { }; typedef struct _virNodeDevCapSystem virNodeDevCapSystem; -typedef virNodeDevCapSystem *virNodeDevCapSystemPtr; struct _virNodeDevCapSystem { char *product_name; virNodeDevCapSystemHardware hardware; @@ -150,17 +147,15 @@ struct _virNodeDevCapSystem { }; typedef struct _virNodeDevCapMdev virNodeDevCapMdev; -typedef virNodeDevCapMdev *virNodeDevCapMdevPtr; struct _virNodeDevCapMdev { char *type; unsigned int iommuGroupNumber; char *uuid; - virMediatedDeviceAttrPtr *attributes; + virMediatedDeviceAttr **attributes; size_t nattributes; }; typedef struct _virNodeDevCapPCIDev virNodeDevCapPCIDev; -typedef virNodeDevCapPCIDev *virNodeDevCapPCIDevPtr; struct _virNodeDevCapPCIDev { unsigned int domain; unsigned int bus; @@ -171,23 +166,22 @@ struct _virNodeDevCapPCIDev { int klass; char *product_name; char *vendor_name; - virPCIDeviceAddressPtr physical_function; - virPCIDeviceAddressPtr *virtual_functions; + virPCIDeviceAddress *physical_function; + virPCIDeviceAddress **virtual_functions; size_t num_virtual_functions; unsigned int max_virtual_functions; unsigned int flags; - virPCIDeviceAddressPtr *iommuGroupDevices; + virPCIDeviceAddress **iommuGroupDevices; size_t nIommuGroupDevices; unsigned int iommuGroupNumber; int numa_node; - virPCIEDeviceInfoPtr pci_express; + virPCIEDeviceInfo *pci_express; int hdrType; /* enum virPCIHeaderType or -1 */ - virMediatedDeviceTypePtr *mdev_types; + virMediatedDeviceType **mdev_types; size_t nmdev_types; }; typedef struct _virNodeDevCapUSBDev virNodeDevCapUSBDev; -typedef virNodeDevCapUSBDev *virNodeDevCapUSBDevPtr; struct _virNodeDevCapUSBDev { unsigned int bus; unsigned int device; @@ -198,7 +192,6 @@ struct _virNodeDevCapUSBDev { }; typedef struct _virNodeDevCapUSBIf virNodeDevCapUSBIf; -typedef virNodeDevCapUSBIf *virNodeDevCapUSBIfPtr; struct _virNodeDevCapUSBIf { unsigned int number; unsigned int klass; @@ -208,18 +201,16 @@ struct _virNodeDevCapUSBIf { }; typedef struct _virNodeDevCapNet virNodeDevCapNet; -typedef virNodeDevCapNet *virNodeDevCapNetPtr; struct _virNodeDevCapNet { char *address; unsigned int address_len; char *ifname; virNetDevIfLink lnk; virNodeDevNetCapType subtype; /* LAST -> no subtype */ - virBitmapPtr features; /* enum virNetDevFeature */ + virBitmap *features; /* enum virNetDevFeature */ }; typedef struct _virNodeDevCapSCSIHost virNodeDevCapSCSIHost; -typedef virNodeDevCapSCSIHost *virNodeDevCapSCSIHostPtr; struct _virNodeDevCapSCSIHost { unsigned int host; int unique_id; @@ -232,7 +223,6 @@ struct _virNodeDevCapSCSIHost { }; typedef struct _virNodeDevCapSCSITarget virNodeDevCapSCSITarget; -typedef virNodeDevCapSCSITarget *virNodeDevCapSCSITargetPtr; struct _virNodeDevCapSCSITarget { char *name; unsigned int flags; /* enum virNodeDevSCSITargetCapsFlags */ @@ -241,7 +231,6 @@ struct _virNodeDevCapSCSITarget { }; typedef struct _virNodeDevCapSCSI virNodeDevCapSCSI; -typedef virNodeDevCapSCSI *virNodeDevCapSCSIPtr; struct _virNodeDevCapSCSI { unsigned int host; unsigned int bus; @@ -251,7 +240,6 @@ struct _virNodeDevCapSCSI { }; typedef struct _virNodeDevCapStorage virNodeDevCapStorage; -typedef virNodeDevCapStorage *virNodeDevCapStoragePtr; struct _virNodeDevCapStorage { unsigned long long size; unsigned long long num_blocks; @@ -268,58 +256,50 @@ struct _virNodeDevCapStorage { }; typedef struct _virNodeDevCapSCSIGeneric virNodeDevCapSCSIGeneric; -typedef virNodeDevCapSCSIGeneric *virNodeDevCapSCSIGenericPtr; struct _virNodeDevCapSCSIGeneric { char *path; }; typedef struct _virNodeDevCapDRM virNodeDevCapDRM; -typedef virNodeDevCapDRM *virNodeDevCapDRMPtr; struct _virNodeDevCapDRM { virNodeDevDRMType type; }; typedef struct _virNodeDevCapCCW virNodeDevCapCCW; -typedef virNodeDevCapCCW *virNodeDevCapCCWPtr; struct _virNodeDevCapCCW { unsigned int cssid; unsigned int ssid; unsigned int devno; unsigned int flags; /* enum virNodeDevCCWCapFlags */ - virMediatedDeviceTypePtr *mdev_types; + virMediatedDeviceType **mdev_types; size_t nmdev_types; }; typedef struct _virNodeDevCapVDPA virNodeDevCapVDPA; -typedef virNodeDevCapVDPA *virNodeDevCapVDPAPtr; struct _virNodeDevCapVDPA { char *chardev; }; typedef struct _virNodeDevCapAPCard virNodeDevCapAPCard; -typedef virNodeDevCapAPCard *virNodeDevCapAPCardPtr; struct _virNodeDevCapAPCard { unsigned int ap_adapter; }; typedef struct _virNodeDevCapAPQueue virNodeDevCapAPQueue; -typedef virNodeDevCapAPQueue *virNodeDevCapAPQueuePtr; struct _virNodeDevCapAPQueue { unsigned int ap_adapter; unsigned int ap_domain; }; typedef struct _virNodeDevCapAPMatrix virNodeDevCapAPMatrix; -typedef virNodeDevCapAPMatrix *virNodeDevCapAPMatrixPtr; struct _virNodeDevCapAPMatrix { char *addr; unsigned int flags; /* enum virNodeDevAPMatrixCapFlags */ - virMediatedDeviceTypePtr *mdev_types; + virMediatedDeviceType **mdev_types; size_t nmdev_types; }; typedef struct _virNodeDevCapData virNodeDevCapData; -typedef virNodeDevCapData *virNodeDevCapDataPtr; struct _virNodeDevCapData { virNodeDevCapType type; union { @@ -344,15 +324,13 @@ struct _virNodeDevCapData { }; typedef struct _virNodeDevCapsDef virNodeDevCapsDef; -typedef virNodeDevCapsDef *virNodeDevCapsDefPtr; struct _virNodeDevCapsDef { virNodeDevCapData data; - virNodeDevCapsDefPtr next; /* next capability */ + virNodeDevCapsDef *next; /* next capability */ }; typedef struct _virNodeDeviceDef virNodeDeviceDef; -typedef virNodeDeviceDef *virNodeDeviceDefPtr; struct _virNodeDeviceDef { char *name; /* device name (unique on node) */ char *sysfs_path; /* udev name/sysfs path */ @@ -364,40 +342,40 @@ struct _virNodeDeviceDef { char *driver; /* optional driver name */ char *devnode; /* /dev path */ char **devlinks; /* /dev links */ - virNodeDevCapsDefPtr caps; /* optional device capabilities */ + virNodeDevCapsDef *caps; /* optional device capabilities */ }; char * virNodeDeviceDefFormat(const virNodeDeviceDef *def); -virNodeDeviceDefPtr +virNodeDeviceDef * virNodeDeviceDefParseString(const char *str, int create, const char *virt_type); -virNodeDeviceDefPtr +virNodeDeviceDef * virNodeDeviceDefParseFile(const char *filename, int create, const char *virt_type); -virNodeDeviceDefPtr +virNodeDeviceDef * virNodeDeviceDefParseNode(xmlDocPtr xml, xmlNodePtr root, int create, const char *virt_type); int -virNodeDeviceGetWWNs(virNodeDeviceDefPtr def, +virNodeDeviceGetWWNs(virNodeDeviceDef *def, char **wwnn, char **wwpn); void -virNodeDeviceDefFree(virNodeDeviceDefPtr def); +virNodeDeviceDefFree(virNodeDeviceDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNodeDeviceDef, virNodeDeviceDefFree); void -virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps); +virNodeDevCapsDefFree(virNodeDevCapsDef *caps); #define VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_CAP \ (VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM | \ @@ -431,27 +409,27 @@ virNodeDevCapsDefFree(virNodeDevCapsDefPtr caps); VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_ACTIVE int -virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHostPtr scsi_host); +virNodeDeviceGetSCSIHostCaps(virNodeDevCapSCSIHost *scsi_host); int virNodeDeviceGetSCSITargetCaps(const char *sysfsPath, - virNodeDevCapSCSITargetPtr scsi_target); + virNodeDevCapSCSITarget *scsi_target); int virNodeDeviceGetPCIDynamicCaps(const char *sysfsPath, - virNodeDevCapPCIDevPtr pci_dev); + virNodeDevCapPCIDev *pci_dev); int virNodeDeviceGetCSSDynamicCaps(const char *sysfsPath, - virNodeDevCapCCWPtr ccw_dev); + virNodeDevCapCCW *ccw_dev); int virNodeDeviceGetAPMatrixDynamicCaps(const char *sysfsPath, - virNodeDevCapAPMatrixPtr ap_matrix); + virNodeDevCapAPMatrix *ap_matrix); int -virNodeDeviceUpdateCaps(virNodeDeviceDefPtr def); +virNodeDeviceUpdateCaps(virNodeDeviceDef *def); int -virNodeDeviceCapsListExport(virNodeDeviceDefPtr def, +virNodeDeviceCapsListExport(virNodeDeviceDef *def, virNodeDevCapType **list); diff --git a/src/conf/node_device_event.c b/src/conf/node_device_event.c index c6915be593..d51cc20ce8 100644 --- a/src/conf/node_device_event.c +++ b/src/conf/node_device_event.c @@ -37,7 +37,6 @@ struct _virNodeDeviceEvent { bool dummy; }; typedef struct _virNodeDeviceEvent virNodeDeviceEvent; -typedef virNodeDeviceEvent *virNodeDeviceEventPtr; struct _virNodeDeviceEventLifecycle { virNodeDeviceEvent parent; @@ -46,7 +45,6 @@ struct _virNodeDeviceEventLifecycle { int detail; }; typedef struct _virNodeDeviceEventLifecycle virNodeDeviceEventLifecycle; -typedef virNodeDeviceEventLifecycle *virNodeDeviceEventLifecyclePtr; struct _virNodeDeviceEventUpdate { virNodeDeviceEvent parent; @@ -54,11 +52,10 @@ struct _virNodeDeviceEventUpdate { bool dummy; }; typedef struct _virNodeDeviceEventUpdate virNodeDeviceEventUpdate; -typedef virNodeDeviceEventUpdate *virNodeDeviceEventUpdatePtr; -static virClassPtr virNodeDeviceEventClass; -static virClassPtr virNodeDeviceEventLifecycleClass; -static virClassPtr virNodeDeviceEventUpdateClass; +static virClass *virNodeDeviceEventClass; +static virClass *virNodeDeviceEventLifecycleClass; +static virClass *virNodeDeviceEventUpdateClass; static void virNodeDeviceEventDispose(void *obj); static void virNodeDeviceEventLifecycleDispose(void *obj); static void virNodeDeviceEventUpdateDispose(void *obj); @@ -83,7 +80,7 @@ VIR_ONCE_GLOBAL_INIT(virNodeDeviceEvents); static void virNodeDeviceEventDispose(void *obj) { - virNodeDeviceEventPtr event = obj; + virNodeDeviceEvent *event = obj; VIR_DEBUG("obj=%p", event); } @@ -91,7 +88,7 @@ virNodeDeviceEventDispose(void *obj) static void virNodeDeviceEventLifecycleDispose(void *obj) { - virNodeDeviceEventLifecyclePtr event = obj; + virNodeDeviceEventLifecycle *event = obj; VIR_DEBUG("obj=%p", event); } @@ -99,14 +96,14 @@ virNodeDeviceEventLifecycleDispose(void *obj) static void virNodeDeviceEventUpdateDispose(void *obj) { - virNodeDeviceEventUpdatePtr event = obj; + virNodeDeviceEventUpdate *event = obj; VIR_DEBUG("obj=%p", event); } static void virNodeDeviceEventDispatchDefaultFunc(virConnectPtr conn, - virObjectEventPtr event, + virObjectEvent *event, virConnectObjectEventGenericCallback cb, void *cbopaque) { @@ -119,9 +116,9 @@ virNodeDeviceEventDispatchDefaultFunc(virConnectPtr conn, switch ((virNodeDeviceEventID)event->eventID) { case VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE: { - virNodeDeviceEventLifecyclePtr nodeDeviceLifecycleEvent; + virNodeDeviceEventLifecycle *nodeDeviceLifecycleEvent; - nodeDeviceLifecycleEvent = (virNodeDeviceEventLifecyclePtr)event; + nodeDeviceLifecycleEvent = (virNodeDeviceEventLifecycle *)event; ((virConnectNodeDeviceEventLifecycleCallback)cb)(conn, dev, nodeDeviceLifecycleEvent->type, nodeDeviceLifecycleEvent->detail, @@ -165,7 +162,7 @@ virNodeDeviceEventDispatchDefaultFunc(virConnectPtr conn, */ int virNodeDeviceEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virNodeDevicePtr dev, int eventID, virConnectNodeDeviceEventGenericCallback cb, @@ -205,7 +202,7 @@ virNodeDeviceEventStateRegisterID(virConnectPtr conn, */ int virNodeDeviceEventStateRegisterClient(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virNodeDevicePtr dev, int eventID, virConnectNodeDeviceEventGenericCallback cb, @@ -233,12 +230,12 @@ virNodeDeviceEventStateRegisterClient(virConnectPtr conn, * * Create a new node device lifecycle event. */ -virObjectEventPtr +virObjectEvent * virNodeDeviceEventLifecycleNew(const char *name, int type, int detail) { - virNodeDeviceEventLifecyclePtr event; + virNodeDeviceEventLifecycle *event; if (virNodeDeviceEventsInitialize() < 0) return NULL; @@ -252,7 +249,7 @@ virNodeDeviceEventLifecycleNew(const char *name, event->type = type; event->detail = detail; - return (virObjectEventPtr)event; + return (virObjectEvent *)event; } @@ -262,10 +259,10 @@ virNodeDeviceEventLifecycleNew(const char *name, * * Create a new node device update event. */ -virObjectEventPtr +virObjectEvent * virNodeDeviceEventUpdateNew(const char *name) { - virNodeDeviceEventUpdatePtr event; + virNodeDeviceEventUpdate *event; if (virNodeDeviceEventsInitialize() < 0) return NULL; @@ -276,5 +273,5 @@ virNodeDeviceEventUpdateNew(const char *name) 0, name, NULL, name))) return NULL; - return (virObjectEventPtr)event; + return (virObjectEvent *)event; } diff --git a/src/conf/node_device_event.h b/src/conf/node_device_event.h index 8fe55ba6d1..46828ce406 100644 --- a/src/conf/node_device_event.h +++ b/src/conf/node_device_event.h @@ -28,7 +28,7 @@ int virNodeDeviceEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virNodeDevicePtr dev, int eventID, virConnectNodeDeviceEventGenericCallback cb, @@ -40,7 +40,7 @@ virNodeDeviceEventStateRegisterID(virConnectPtr conn, int virNodeDeviceEventStateRegisterClient(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virNodeDevicePtr dev, int eventID, virConnectNodeDeviceEventGenericCallback cb, @@ -50,10 +50,10 @@ virNodeDeviceEventStateRegisterClient(virConnectPtr conn, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(8); -virObjectEventPtr +virObjectEvent * virNodeDeviceEventLifecycleNew(const char *name, int type, int detail); -virObjectEventPtr +virObjectEvent * virNodeDeviceEventUpdateNew(const char *name); diff --git a/src/conf/node_device_util.c b/src/conf/node_device_util.c index 5e80422d7f..1c1f5a0dd5 100644 --- a/src/conf/node_device_util.c +++ b/src/conf/node_device_util.c @@ -75,7 +75,7 @@ virNodeDeviceGetParentName(virConnectPtr conn, * Returns vHBA name on success, NULL on failure with an error message set */ char * -virNodeDeviceCreateVport(virStorageAdapterFCHostPtr fchost) +virNodeDeviceCreateVport(virStorageAdapterFCHost *fchost) { unsigned int parent_host; char *name = NULL; @@ -159,7 +159,7 @@ virNodeDeviceCreateVport(virStorageAdapterFCHostPtr fchost) */ int virNodeDeviceDeleteVport(virConnectPtr conn, - virStorageAdapterFCHostPtr fchost) + virStorageAdapterFCHost *fchost) { char *name = NULL; char *scsi_host_name = NULL; diff --git a/src/conf/node_device_util.h b/src/conf/node_device_util.h index 933b7f6e31..d113298f0c 100644 --- a/src/conf/node_device_util.h +++ b/src/conf/node_device_util.h @@ -25,8 +25,8 @@ virNodeDeviceGetParentName(virConnectPtr conn, const char *nodedev_name); char * -virNodeDeviceCreateVport(virStorageAdapterFCHostPtr fchost); +virNodeDeviceCreateVport(virStorageAdapterFCHost *fchost); int virNodeDeviceDeleteVport(virConnectPtr conn, - virStorageAdapterFCHostPtr fchost); + virStorageAdapterFCHost *fchost); diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c index 64b93fd7d1..e28c86284f 100644 --- a/src/conf/numa_conf.c +++ b/src/conf/numa_conf.c @@ -82,29 +82,25 @@ VIR_ENUM_IMPL(virDomainMemoryLatency, ); typedef struct _virDomainNumaDistance virDomainNumaDistance; -typedef virDomainNumaDistance *virDomainNumaDistancePtr; typedef struct _virDomainNumaCache virDomainNumaCache; -typedef virDomainNumaCache *virDomainNumaCachePtr; typedef struct _virDomainNumaInterconnect virDomainNumaInterconnect; -typedef virDomainNumaInterconnect *virDomainNumaInterconnectPtr; typedef struct _virDomainNumaNode virDomainNumaNode; -typedef virDomainNumaNode *virDomainNumaNodePtr; struct _virDomainNuma { struct { bool specified; - virBitmapPtr nodeset; + virBitmap *nodeset; virDomainNumatuneMemMode mode; virDomainNumatunePlacement placement; } memory; /* pinning for all the memory */ struct _virDomainNumaNode { unsigned long long mem; /* memory size in KiB */ - virBitmapPtr cpumask; /* bitmap of vCPUs corresponding to the node */ - virBitmapPtr nodeset; /* host memory nodes where this guest node resides */ + virBitmap *cpumask; /* bitmap of vCPUs corresponding to the node */ + virBitmap *nodeset; /* host memory nodes where this guest node resides */ virDomainNumatuneMemMode mode; /* memory mode selection */ virDomainMemoryAccess memAccess; /* shared memory access configuration */ virTristateBool discard; /* discard-data for memory-backend-file */ @@ -143,7 +139,7 @@ struct _virDomainNuma { bool -virDomainNumatuneNodeSpecified(virDomainNumaPtr numatune, +virDomainNumatuneNodeSpecified(virDomainNuma *numatune, int cellid) { if (numatune && @@ -155,7 +151,7 @@ virDomainNumatuneNodeSpecified(virDomainNumaPtr numatune, } static int -virDomainNumatuneNodeParseXML(virDomainNumaPtr numa, +virDomainNumatuneNodeParseXML(virDomainNuma *numa, xmlXPathContextPtr ctxt) { char *tmp = NULL; @@ -191,7 +187,7 @@ virDomainNumatuneNodeParseXML(virDomainNumaPtr numa, for (i = 0; i < n; i++) { int mode = 0; unsigned int cellid = 0; - virDomainNumaNodePtr mem_node = NULL; + virDomainNumaNode *mem_node = NULL; xmlNodePtr cur_node = nodes[i]; tmp = virXMLPropString(cur_node, "cellid"); @@ -264,7 +260,7 @@ virDomainNumatuneNodeParseXML(virDomainNumaPtr numa, } int -virDomainNumatuneParseXML(virDomainNumaPtr numa, +virDomainNumatuneParseXML(virDomainNuma *numa, bool placement_static, xmlXPathContextPtr ctxt) { @@ -273,7 +269,7 @@ virDomainNumatuneParseXML(virDomainNumaPtr numa, int n = 0; int placement = -1; int ret = -1; - virBitmapPtr nodeset = NULL; + virBitmap *nodeset = NULL; xmlNodePtr node = NULL; if (virXPathInt("count(./numatune)", ctxt, &n) < 0) { @@ -341,8 +337,8 @@ virDomainNumatuneParseXML(virDomainNumaPtr numa, } int -virDomainNumatuneFormatXML(virBufferPtr buf, - virDomainNumaPtr numatune) +virDomainNumatuneFormatXML(virBuffer *buf, + virDomainNuma *numatune) { const char *tmp = NULL; char *nodeset = NULL; @@ -381,7 +377,7 @@ virDomainNumatuneFormatXML(virBufferPtr buf, } for (i = 0; i < numatune->nmem_nodes; i++) { - virDomainNumaNodePtr mem_node = &numatune->mem_nodes[i]; + virDomainNumaNode *mem_node = &numatune->mem_nodes[i]; if (!mem_node->nodeset) continue; @@ -403,7 +399,7 @@ virDomainNumatuneFormatXML(virBufferPtr buf, } void -virDomainNumaFree(virDomainNumaPtr numa) +virDomainNumaFree(virDomainNuma *numa) { size_t i = 0; @@ -439,7 +435,7 @@ virDomainNumaFree(virDomainNumaPtr numa) * Returns: 0 on success (with @mode updated) * -1 if no mode was defined in XML */ -int virDomainNumatuneGetMode(virDomainNumaPtr numatune, +int virDomainNumatuneGetMode(virDomainNuma *numatune, int cellid, virDomainNumatuneMemMode *mode) { @@ -461,9 +457,9 @@ int virDomainNumatuneGetMode(virDomainNumaPtr numatune, return 0; } -virBitmapPtr -virDomainNumatuneGetNodeset(virDomainNumaPtr numatune, - virBitmapPtr auto_nodeset, +virBitmap * +virDomainNumatuneGetNodeset(virDomainNuma *numatune, + virBitmap *auto_nodeset, int cellid) { if (!numatune) @@ -483,8 +479,8 @@ virDomainNumatuneGetNodeset(virDomainNumaPtr numatune, } char * -virDomainNumatuneFormatNodeset(virDomainNumaPtr numatune, - virBitmapPtr auto_nodeset, +virDomainNumatuneFormatNodeset(virDomainNuma *numatune, + virBitmap *auto_nodeset, int cellid) { return virBitmapFormat(virDomainNumatuneGetNodeset(numatune, @@ -494,9 +490,9 @@ virDomainNumatuneFormatNodeset(virDomainNumaPtr numatune, int -virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune, - virBitmapPtr auto_nodeset, - virBitmapPtr *retNodeset, +virDomainNumatuneMaybeGetNodeset(virDomainNuma *numatune, + virBitmap *auto_nodeset, + virBitmap **retNodeset, int cellid) { *retNodeset = NULL; @@ -524,12 +520,12 @@ virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune, int -virDomainNumatuneMaybeFormatNodeset(virDomainNumaPtr numatune, - virBitmapPtr auto_nodeset, +virDomainNumatuneMaybeFormatNodeset(virDomainNuma *numatune, + virBitmap *auto_nodeset, char **mask, int cellid) { - virBitmapPtr nodeset; + virBitmap *nodeset; if (virDomainNumatuneMaybeGetNodeset(numatune, auto_nodeset, &nodeset, cellid) < 0) @@ -543,11 +539,11 @@ virDomainNumatuneMaybeFormatNodeset(virDomainNumaPtr numatune, } int -virDomainNumatuneSet(virDomainNumaPtr numa, +virDomainNumatuneSet(virDomainNuma *numa, bool placement_static, int placement, int mode, - virBitmapPtr nodeset) + virBitmap *nodeset) { /* No need to do anything in this case */ if (mode == -1 && placement == -1 && !nodeset) @@ -619,8 +615,8 @@ virDomainNumatuneSet(virDomainNumaPtr numa, } static bool -virDomainNumaNodesEqual(virDomainNumaPtr n1, - virDomainNumaPtr n2) +virDomainNumaNodesEqual(virDomainNuma *n1, + virDomainNuma *n2) { size_t i = 0; @@ -628,8 +624,8 @@ virDomainNumaNodesEqual(virDomainNumaPtr n1, return false; for (i = 0; i < n1->nmem_nodes; i++) { - virDomainNumaNodePtr nd1 = &n1->mem_nodes[i]; - virDomainNumaNodePtr nd2 = &n2->mem_nodes[i]; + virDomainNumaNode *nd1 = &n1->mem_nodes[i]; + virDomainNumaNode *nd2 = &n2->mem_nodes[i]; if (!nd1->nodeset && !nd2->nodeset) continue; @@ -645,8 +641,8 @@ virDomainNumaNodesEqual(virDomainNumaPtr n1, } bool -virDomainNumaEquals(virDomainNumaPtr n1, - virDomainNumaPtr n2) +virDomainNumaEquals(virDomainNuma *n1, + virDomainNuma *n2) { if (!n1 && !n2) return true; @@ -673,7 +669,7 @@ virDomainNumaEquals(virDomainNumaPtr n1, } bool -virDomainNumatuneHasPlacementAuto(virDomainNumaPtr numatune) +virDomainNumatuneHasPlacementAuto(virDomainNuma *numatune) { if (!numatune) return false; @@ -688,7 +684,7 @@ virDomainNumatuneHasPlacementAuto(virDomainNumaPtr numatune) } bool -virDomainNumatuneHasPerNodeBinding(virDomainNumaPtr numatune) +virDomainNumatuneHasPerNodeBinding(virDomainNuma *numatune) { size_t i = 0; @@ -704,10 +700,10 @@ virDomainNumatuneHasPerNodeBinding(virDomainNumaPtr numatune) } int -virDomainNumatuneSpecifiedMaxNode(virDomainNumaPtr numatune) +virDomainNumatuneSpecifiedMaxNode(virDomainNuma *numatune) { int ret = -1; - virBitmapPtr nodemask = NULL; + virBitmap *nodemask = NULL; size_t i; int bit; @@ -732,11 +728,11 @@ virDomainNumatuneSpecifiedMaxNode(virDomainNumaPtr numatune) } bool -virDomainNumatuneNodesetIsAvailable(virDomainNumaPtr numatune, - virBitmapPtr auto_nodeset) +virDomainNumatuneNodesetIsAvailable(virDomainNuma *numatune, + virBitmap *auto_nodeset) { size_t i = 0; - virBitmapPtr b = NULL; + virBitmap *b = NULL; if (!numatune) return true; @@ -756,7 +752,7 @@ virDomainNumatuneNodesetIsAvailable(virDomainNumaPtr numatune, static int -virDomainNumaDefNodeDistanceParseXML(virDomainNumaPtr def, +virDomainNumaDefNodeDistanceParseXML(virDomainNuma *def, xmlXPathContextPtr ctxt, unsigned int cur_cell) { @@ -780,8 +776,8 @@ virDomainNumaDefNodeDistanceParseXML(virDomainNumaPtr def, } for (i = 0; i < sibling; i++) { - virDomainNumaDistancePtr ldist; - virDomainNumaDistancePtr rdist; + virDomainNumaDistance *ldist; + virDomainNumaDistance *rdist; unsigned int sibling_id, sibling_value; /* siblings are in order of parsing or explicitly numbered */ @@ -893,7 +889,7 @@ virDomainNumaDefNodeDistanceParseXML(virDomainNumaPtr def, static int -virDomainNumaDefNodeCacheParseXML(virDomainNumaPtr def, +virDomainNumaDefNodeCacheParseXML(virDomainNuma *def, xmlXPathContextPtr ctxt, unsigned int cur_cell) { @@ -908,7 +904,7 @@ virDomainNumaDefNodeCacheParseXML(virDomainNumaPtr def, for (i = 0; i < n; i++) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virDomainNumaCachePtr cache = &def->mem_nodes[cur_cell].caches[i]; + virDomainNumaCache *cache = &def->mem_nodes[cur_cell].caches[i]; g_autofree char *tmp = NULL; unsigned int level; int associativity; @@ -983,7 +979,7 @@ virDomainNumaDefNodeCacheParseXML(virDomainNumaPtr def, int -virDomainNumaDefParseXML(virDomainNumaPtr def, +virDomainNumaDefParseXML(virDomainNuma *def, xmlXPathContextPtr ctxt) { xmlNodePtr *nodes = NULL; @@ -1208,8 +1204,8 @@ virDomainNumaDefParseXML(virDomainNumaPtr def, int -virDomainNumaDefFormatXML(virBufferPtr buf, - virDomainNumaPtr def) +virDomainNumaDefFormatXML(virBuffer *buf, + virDomainNuma *def) { virDomainMemoryAccess memAccess; virTristateBool discard; @@ -1222,7 +1218,7 @@ virDomainNumaDefFormatXML(virBufferPtr buf, virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); for (i = 0; i < ncells; i++) { - virBitmapPtr cpumask = virDomainNumaGetNodeCpumask(def, i); + virBitmap *cpumask = virDomainNumaGetNodeCpumask(def, i); int ndistances; size_t ncaches; @@ -1261,7 +1257,7 @@ virDomainNumaDefFormatXML(virBufferPtr buf, virBufferAdjustIndent(buf, 2); if (ndistances) { - virDomainNumaDistancePtr distances = def->mem_nodes[i].distances; + virDomainNumaDistance *distances = def->mem_nodes[i].distances; virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); @@ -1278,7 +1274,7 @@ virDomainNumaDefFormatXML(virBufferPtr buf, } for (j = 0; j < ncaches; j++) { - virDomainNumaCachePtr cache = &def->mem_nodes[i].caches[j]; + virDomainNumaCache *cache = &def->mem_nodes[i].caches[j]; virBufferAsprintf(buf, "level); if (cache->associativity) { @@ -1317,7 +1313,7 @@ virDomainNumaDefFormatXML(virBufferPtr buf, } for (i = 0; i < def->ninterconnects; i++) { - virDomainNumaInterconnectPtr l = &def->interconnects[i]; + virDomainNumaInterconnect *l = &def->interconnects[i]; switch (l->type) { case VIR_DOMAIN_NUMA_INTERCONNECT_TYPE_LATENCY: @@ -1459,13 +1455,13 @@ virDomainNumaDefValidate(const virDomainNuma *def) unsigned int -virDomainNumaGetCPUCountTotal(virDomainNumaPtr numa) +virDomainNumaGetCPUCountTotal(virDomainNuma *numa) { size_t i; unsigned int ret = 0; for (i = 0; i < numa->nmem_nodes; i++) { - virBitmapPtr cpumask = virDomainNumaGetNodeCpumask(numa, i); + virBitmap *cpumask = virDomainNumaGetNodeCpumask(numa, i); if (cpumask) ret += virBitmapCountBits(cpumask); @@ -1475,13 +1471,13 @@ virDomainNumaGetCPUCountTotal(virDomainNumaPtr numa) } unsigned int -virDomainNumaGetMaxCPUID(virDomainNumaPtr numa) +virDomainNumaGetMaxCPUID(virDomainNuma *numa) { size_t i; unsigned int ret = 0; for (i = 0; i < numa->nmem_nodes; i++) { - virBitmapPtr cpumask = virDomainNumaGetNodeCpumask(numa, i); + virBitmap *cpumask = virDomainNumaGetNodeCpumask(numa, i); int bit; if (cpumask) { @@ -1495,7 +1491,7 @@ virDomainNumaGetMaxCPUID(virDomainNumaPtr numa) } -virDomainNumaPtr +virDomainNuma * virDomainNumaNew(void) { return g_new0(virDomainNuma, 1); @@ -1503,8 +1499,8 @@ virDomainNumaNew(void) bool -virDomainNumaCheckABIStability(virDomainNumaPtr src, - virDomainNumaPtr tgt) +virDomainNumaCheckABIStability(virDomainNuma *src, + virDomainNuma *tgt) { size_t i; size_t j; @@ -1554,7 +1550,7 @@ virDomainNumaCheckABIStability(virDomainNumaPtr src, size_t -virDomainNumaGetNodeCount(virDomainNumaPtr numa) +virDomainNumaGetNodeCount(virDomainNuma *numa) { if (!numa) return 0; @@ -1564,7 +1560,7 @@ virDomainNumaGetNodeCount(virDomainNumaPtr numa) size_t -virDomainNumaSetNodeCount(virDomainNumaPtr numa, size_t nmem_nodes) +virDomainNumaSetNodeCount(virDomainNuma *numa, size_t nmem_nodes) { if (!nmem_nodes) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -1587,7 +1583,7 @@ virDomainNumaSetNodeCount(virDomainNumaPtr numa, size_t nmem_nodes) bool -virDomainNumaNodeDistanceIsUsingDefaults(virDomainNumaPtr numa, +virDomainNumaNodeDistanceIsUsingDefaults(virDomainNuma *numa, size_t node, size_t sibling) { @@ -1607,7 +1603,7 @@ virDomainNumaNodeDistanceIsUsingDefaults(virDomainNumaPtr numa, bool -virDomainNumaNodesDistancesAreBeingSet(virDomainNumaPtr numa) +virDomainNumaNodesDistancesAreBeingSet(virDomainNuma *numa) { size_t ncells = virDomainNumaGetNodeCount(numa); size_t i, j; @@ -1626,11 +1622,11 @@ virDomainNumaNodesDistancesAreBeingSet(virDomainNumaPtr numa) size_t -virDomainNumaGetNodeDistance(virDomainNumaPtr numa, +virDomainNumaGetNodeDistance(virDomainNuma *numa, size_t node, size_t cellid) { - virDomainNumaDistancePtr distances = NULL; + virDomainNumaDistance *distances = NULL; if (node < numa->nmem_nodes) distances = numa->mem_nodes[node].distances; @@ -1650,12 +1646,12 @@ virDomainNumaGetNodeDistance(virDomainNumaPtr numa, int -virDomainNumaSetNodeDistance(virDomainNumaPtr numa, +virDomainNumaSetNodeDistance(virDomainNuma *numa, size_t node, size_t cellid, unsigned int value) { - virDomainNumaDistancePtr distances; + virDomainNumaDistance *distances; if (node >= numa->nmem_nodes) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -1704,11 +1700,11 @@ virDomainNumaSetNodeDistance(virDomainNumaPtr numa, size_t -virDomainNumaSetNodeDistanceCount(virDomainNumaPtr numa, +virDomainNumaSetNodeDistanceCount(virDomainNuma *numa, size_t node, size_t ndistances) { - virDomainNumaDistancePtr distances; + virDomainNumaDistance *distances; distances = numa->mem_nodes[node].distances; if (distances) { @@ -1727,8 +1723,8 @@ virDomainNumaSetNodeDistanceCount(virDomainNumaPtr numa, } -virBitmapPtr -virDomainNumaGetNodeCpumask(virDomainNumaPtr numa, +virBitmap * +virDomainNumaGetNodeCpumask(virDomainNuma *numa, size_t node) { return numa->mem_nodes[node].cpumask; @@ -1736,16 +1732,16 @@ virDomainNumaGetNodeCpumask(virDomainNumaPtr numa, void -virDomainNumaSetNodeCpumask(virDomainNumaPtr numa, +virDomainNumaSetNodeCpumask(virDomainNuma *numa, size_t node, - virBitmapPtr cpumask) + virBitmap *cpumask) { numa->mem_nodes[node].cpumask = cpumask; } virDomainMemoryAccess -virDomainNumaGetNodeMemoryAccessMode(virDomainNumaPtr numa, +virDomainNumaGetNodeMemoryAccessMode(virDomainNuma *numa, size_t node) { return numa->mem_nodes[node].memAccess; @@ -1753,7 +1749,7 @@ virDomainNumaGetNodeMemoryAccessMode(virDomainNumaPtr numa, virTristateBool -virDomainNumaGetNodeDiscard(virDomainNumaPtr numa, +virDomainNumaGetNodeDiscard(virDomainNuma *numa, size_t node) { return numa->mem_nodes[node].discard; @@ -1761,7 +1757,7 @@ virDomainNumaGetNodeDiscard(virDomainNumaPtr numa, unsigned long long -virDomainNumaGetNodeMemorySize(virDomainNumaPtr numa, +virDomainNumaGetNodeMemorySize(virDomainNuma *numa, size_t node) { return numa->mem_nodes[node].mem; @@ -1769,7 +1765,7 @@ virDomainNumaGetNodeMemorySize(virDomainNumaPtr numa, void -virDomainNumaSetNodeMemorySize(virDomainNumaPtr numa, +virDomainNumaSetNodeMemorySize(virDomainNuma *numa, size_t node, unsigned long long size) { @@ -1778,7 +1774,7 @@ virDomainNumaSetNodeMemorySize(virDomainNumaPtr numa, unsigned long long -virDomainNumaGetMemorySize(virDomainNumaPtr numa) +virDomainNumaGetMemorySize(virDomainNuma *numa) { size_t i; unsigned long long ret = 0; @@ -1791,7 +1787,7 @@ virDomainNumaGetMemorySize(virDomainNumaPtr numa) int -virDomainNumaFillCPUsInNode(virDomainNumaPtr numa, +virDomainNumaFillCPUsInNode(virDomainNuma *numa, size_t node, unsigned int maxCpus) { @@ -1804,7 +1800,7 @@ virDomainNumaFillCPUsInNode(virDomainNumaPtr numa, virBitmapSetAll(maxCPUsBitmap); for (i = 0; i < numa->nmem_nodes; i++) { - virBitmapPtr nodeCpus = virDomainNumaGetNodeCpumask(numa, i); + virBitmap *nodeCpus = virDomainNumaGetNodeCpumask(numa, i); if (i == node || !nodeCpus) continue; diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h index db5d79e62a..8f6597b0b7 100644 --- a/src/conf/numa_conf.h +++ b/src/conf/numa_conf.h @@ -29,7 +29,6 @@ typedef struct _virDomainNuma virDomainNuma; -typedef virDomainNuma *virDomainNumaPtr; typedef enum { VIR_DOMAIN_NUMATUNE_PLACEMENT_DEFAULT = 0, @@ -85,142 +84,142 @@ typedef enum { VIR_ENUM_DECL(virDomainMemoryLatency); -virDomainNumaPtr virDomainNumaNew(void); -void virDomainNumaFree(virDomainNumaPtr numa); +virDomainNuma *virDomainNumaNew(void); +void virDomainNumaFree(virDomainNuma *numa); /* * XML Parse/Format functions */ -int virDomainNumatuneParseXML(virDomainNumaPtr numa, +int virDomainNumatuneParseXML(virDomainNuma *numa, bool placement_static, xmlXPathContextPtr ctxt) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); -int virDomainNumatuneFormatXML(virBufferPtr buf, virDomainNumaPtr numatune) +int virDomainNumatuneFormatXML(virBuffer *buf, virDomainNuma *numatune) ATTRIBUTE_NONNULL(1); /* * Getters */ -int virDomainNumatuneGetMode(virDomainNumaPtr numatune, +int virDomainNumatuneGetMode(virDomainNuma *numatune, int cellid, virDomainNumatuneMemMode *mode); -virBitmapPtr virDomainNumatuneGetNodeset(virDomainNumaPtr numatune, - virBitmapPtr auto_nodeset, +virBitmap *virDomainNumatuneGetNodeset(virDomainNuma *numatune, + virBitmap *auto_nodeset, int cellid); -int virDomainNumatuneMaybeGetNodeset(virDomainNumaPtr numatune, - virBitmapPtr auto_nodeset, - virBitmapPtr *retNodeset, +int virDomainNumatuneMaybeGetNodeset(virDomainNuma *numatune, + virBitmap *auto_nodeset, + virBitmap **retNodeset, int cellid); -size_t virDomainNumaGetNodeCount(virDomainNumaPtr numa); +size_t virDomainNumaGetNodeCount(virDomainNuma *numa); -bool virDomainNumaNodeDistanceIsUsingDefaults(virDomainNumaPtr numa, +bool virDomainNumaNodeDistanceIsUsingDefaults(virDomainNuma *numa, size_t node, size_t sibling) ATTRIBUTE_NONNULL(1); -bool virDomainNumaNodesDistancesAreBeingSet(virDomainNumaPtr numa) +bool virDomainNumaNodesDistancesAreBeingSet(virDomainNuma *numa) ATTRIBUTE_NONNULL(1); -size_t virDomainNumaGetNodeDistance(virDomainNumaPtr numa, +size_t virDomainNumaGetNodeDistance(virDomainNuma *numa, size_t node, size_t sibling) ATTRIBUTE_NONNULL(1); -virBitmapPtr virDomainNumaGetNodeCpumask(virDomainNumaPtr numa, +virBitmap *virDomainNumaGetNodeCpumask(virDomainNuma *numa, size_t node) ATTRIBUTE_NONNULL(1); -virDomainMemoryAccess virDomainNumaGetNodeMemoryAccessMode(virDomainNumaPtr numa, +virDomainMemoryAccess virDomainNumaGetNodeMemoryAccessMode(virDomainNuma *numa, size_t node) ATTRIBUTE_NONNULL(1); -virTristateBool virDomainNumaGetNodeDiscard(virDomainNumaPtr numa, +virTristateBool virDomainNumaGetNodeDiscard(virDomainNuma *numa, size_t node) ATTRIBUTE_NONNULL(1); -unsigned long long virDomainNumaGetNodeMemorySize(virDomainNumaPtr numa, +unsigned long long virDomainNumaGetNodeMemorySize(virDomainNuma *numa, size_t node) ATTRIBUTE_NONNULL(1); -unsigned long long virDomainNumaGetMemorySize(virDomainNumaPtr numa) +unsigned long long virDomainNumaGetMemorySize(virDomainNuma *numa) ATTRIBUTE_NONNULL(1); unsigned int -virDomainNumaGetMaxCPUID(virDomainNumaPtr numa); +virDomainNumaGetMaxCPUID(virDomainNuma *numa); /* * Formatters */ -char *virDomainNumatuneFormatNodeset(virDomainNumaPtr numatune, - virBitmapPtr auto_nodeset, +char *virDomainNumatuneFormatNodeset(virDomainNuma *numatune, + virBitmap *auto_nodeset, int cellid); -int virDomainNumatuneMaybeFormatNodeset(virDomainNumaPtr numatune, - virBitmapPtr auto_nodeset, +int virDomainNumatuneMaybeFormatNodeset(virDomainNuma *numatune, + virBitmap *auto_nodeset, char **mask, int cellid); /* * Setters */ -int virDomainNumatuneSet(virDomainNumaPtr numa, +int virDomainNumatuneSet(virDomainNuma *numa, bool placement_static, int placement, int mode, - virBitmapPtr nodeset) + virBitmap *nodeset) ATTRIBUTE_NONNULL(1); -size_t virDomainNumaSetNodeCount(virDomainNumaPtr numa, +size_t virDomainNumaSetNodeCount(virDomainNuma *numa, size_t nmem_nodes) ATTRIBUTE_NONNULL(1); -void virDomainNumaSetNodeMemorySize(virDomainNumaPtr numa, +void virDomainNumaSetNodeMemorySize(virDomainNuma *numa, size_t node, unsigned long long size) ATTRIBUTE_NONNULL(1); -int virDomainNumaSetNodeDistance(virDomainNumaPtr numa, +int virDomainNumaSetNodeDistance(virDomainNuma *numa, size_t node, size_t sibling, unsigned int value) ATTRIBUTE_NONNULL(1); -size_t virDomainNumaSetNodeDistanceCount(virDomainNumaPtr numa, +size_t virDomainNumaSetNodeDistanceCount(virDomainNuma *numa, size_t node, size_t ndistances) ATTRIBUTE_NONNULL(1); -void virDomainNumaSetNodeCpumask(virDomainNumaPtr numa, +void virDomainNumaSetNodeCpumask(virDomainNuma *numa, size_t node, - virBitmapPtr cpumask) + virBitmap *cpumask) ATTRIBUTE_NONNULL(1); /* * Other accessors */ -bool virDomainNumaEquals(virDomainNumaPtr n1, - virDomainNumaPtr n2); +bool virDomainNumaEquals(virDomainNuma *n1, + virDomainNuma *n2); -bool virDomainNumaCheckABIStability(virDomainNumaPtr src, - virDomainNumaPtr tgt); +bool virDomainNumaCheckABIStability(virDomainNuma *src, + virDomainNuma *tgt); -bool virDomainNumatuneHasPlacementAuto(virDomainNumaPtr numatune); +bool virDomainNumatuneHasPlacementAuto(virDomainNuma *numatune); -bool virDomainNumatuneHasPerNodeBinding(virDomainNumaPtr numatune); +bool virDomainNumatuneHasPerNodeBinding(virDomainNuma *numatune); -int virDomainNumatuneSpecifiedMaxNode(virDomainNumaPtr numatune); +int virDomainNumatuneSpecifiedMaxNode(virDomainNuma *numatune); -bool virDomainNumatuneNodesetIsAvailable(virDomainNumaPtr numatune, - virBitmapPtr auto_nodeset); +bool virDomainNumatuneNodesetIsAvailable(virDomainNuma *numatune, + virBitmap *auto_nodeset); -bool virDomainNumatuneNodeSpecified(virDomainNumaPtr numatune, +bool virDomainNumatuneNodeSpecified(virDomainNuma *numatune, int cellid); -int virDomainNumaDefParseXML(virDomainNumaPtr def, xmlXPathContextPtr ctxt); -int virDomainNumaDefFormatXML(virBufferPtr buf, virDomainNumaPtr def); +int virDomainNumaDefParseXML(virDomainNuma *def, xmlXPathContextPtr ctxt); +int virDomainNumaDefFormatXML(virBuffer *buf, virDomainNuma *def); int virDomainNumaDefValidate(const virDomainNuma *def); -unsigned int virDomainNumaGetCPUCountTotal(virDomainNumaPtr numa); +unsigned int virDomainNumaGetCPUCountTotal(virDomainNuma *numa); -int virDomainNumaFillCPUsInNode(virDomainNumaPtr numa, size_t node, +int virDomainNumaFillCPUsInNode(virDomainNuma *numa, size_t node, unsigned int maxCpus); bool virDomainNumaHasHMAT(const virDomainNuma *numa); diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index dc1b879eb3..6fced96865 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c @@ -299,7 +299,7 @@ intMapGetByString(const struct int_map *intmap, void -virNWFilterRuleDefFree(virNWFilterRuleDefPtr def) +virNWFilterRuleDefFree(virNWFilterRuleDef *def) { size_t i; if (!def) @@ -319,7 +319,7 @@ virNWFilterRuleDefFree(virNWFilterRuleDefPtr def) static void -virNWFilterIncludeDefFree(virNWFilterIncludeDefPtr inc) +virNWFilterIncludeDefFree(virNWFilterIncludeDef *inc) { if (!inc) return; @@ -330,7 +330,7 @@ virNWFilterIncludeDefFree(virNWFilterIncludeDefPtr inc) static void -virNWFilterEntryFree(virNWFilterEntryPtr entry) +virNWFilterEntryFree(virNWFilterEntry *entry) { if (!entry) return; @@ -342,7 +342,7 @@ virNWFilterEntryFree(virNWFilterEntryPtr entry) void -virNWFilterDefFree(virNWFilterDefPtr def) +virNWFilterDefFree(virNWFilterDef *def) { size_t i; if (!def) @@ -361,12 +361,12 @@ virNWFilterDefFree(virNWFilterDefPtr def) static int -virNWFilterRuleDefAddVar(virNWFilterRuleDefPtr nwf, +virNWFilterRuleDefAddVar(virNWFilterRuleDef *nwf, nwItemDesc *item, const char *var) { size_t i = 0; - virNWFilterVarAccessPtr varAccess; + virNWFilterVarAccess *varAccess; varAccess = virNWFilterVarAccessParse(var); if (varAccess == NULL) @@ -390,7 +390,7 @@ virNWFilterRuleDefAddVar(virNWFilterRuleDefPtr nwf, static char * -virNWFilterRuleDefAddString(virNWFilterRuleDefPtr nwf, +virNWFilterRuleDefAddString(virNWFilterRuleDef *nwf, const char *string, size_t maxstrlen) { @@ -412,10 +412,10 @@ union data { }; typedef bool (*valueValidator)(enum attrDatatype datatype, union data *valptr, - virNWFilterRuleDefPtr nwf, + virNWFilterRuleDef *nwf, nwItemDesc *item); -typedef bool (*valueFormatter)(virBufferPtr buf, - virNWFilterRuleDefPtr nwf, +typedef bool (*valueFormatter)(virBuffer *buf, + virNWFilterRuleDef *nwf, nwItemDesc *item); typedef struct _virXMLAttr2Struct virXMLAttr2Struct; @@ -443,7 +443,7 @@ static const struct int_map macProtoMap[] = { static bool checkMacProtocolID(enum attrDatatype datatype, union data *value, - virNWFilterRuleDefPtr nwf G_GNUC_UNUSED, + virNWFilterRuleDef *nwf G_GNUC_UNUSED, nwItemDesc *item G_GNUC_UNUSED) { int32_t res = -1; @@ -470,8 +470,8 @@ checkMacProtocolID(enum attrDatatype datatype, static bool -macProtocolIDFormatter(virBufferPtr buf, - virNWFilterRuleDefPtr nwf, +macProtocolIDFormatter(virBuffer *buf, + virNWFilterRuleDef *nwf, nwItemDesc *item G_GNUC_UNUSED) { const char *str = NULL; @@ -494,7 +494,7 @@ macProtocolIDFormatter(virBufferPtr buf, static bool checkVlanVlanID(enum attrDatatype datatype, union data *value, - virNWFilterRuleDefPtr nwf, + virNWFilterRuleDef *nwf, nwItemDesc *item G_GNUC_UNUSED) { int32_t res; @@ -516,7 +516,7 @@ checkVlanVlanID(enum attrDatatype datatype, static bool checkVlanProtocolID(enum attrDatatype datatype, union data *value, - virNWFilterRuleDefPtr nwf, + virNWFilterRuleDef *nwf, nwItemDesc *item G_GNUC_UNUSED) { int32_t res = -1; @@ -543,8 +543,8 @@ checkVlanProtocolID(enum attrDatatype datatype, static bool -vlanProtocolIDFormatter(virBufferPtr buf, - virNWFilterRuleDefPtr nwf, +vlanProtocolIDFormatter(virBuffer *buf, + virNWFilterRuleDef *nwf, nwItemDesc *item G_GNUC_UNUSED) { const char *str = NULL; @@ -597,7 +597,7 @@ checkValidMask(unsigned char *data, static bool checkMACMask(enum attrDatatype datatype G_GNUC_UNUSED, union data *macMask, - virNWFilterRuleDefPtr nwf G_GNUC_UNUSED, + virNWFilterRuleDef *nwf G_GNUC_UNUSED, nwItemDesc *item G_GNUC_UNUSED) { return checkValidMask(macMask->uc, 6); @@ -624,7 +624,7 @@ static const struct int_map arpOpcodeMap[] = { static bool arpOpcodeValidator(enum attrDatatype datatype, union data *value, - virNWFilterRuleDefPtr nwf, + virNWFilterRuleDef *nwf, nwItemDesc *item G_GNUC_UNUSED) { int32_t res = -1; @@ -648,8 +648,8 @@ arpOpcodeValidator(enum attrDatatype datatype, static bool -arpOpcodeFormatter(virBufferPtr buf, - virNWFilterRuleDefPtr nwf, +arpOpcodeFormatter(virBuffer *buf, + virNWFilterRuleDef *nwf, nwItemDesc *item G_GNUC_UNUSED) { const char *str = NULL; @@ -686,7 +686,7 @@ static const struct int_map ipProtoMap[] = { static bool checkIPProtocolID(enum attrDatatype datatype, union data *value, - virNWFilterRuleDefPtr nwf, + virNWFilterRuleDef *nwf, nwItemDesc *item G_GNUC_UNUSED) { int32_t res = -1; @@ -710,8 +710,8 @@ checkIPProtocolID(enum attrDatatype datatype, static bool -formatIPProtocolID(virBufferPtr buf, - virNWFilterRuleDefPtr nwf, +formatIPProtocolID(virBuffer *buf, + virNWFilterRuleDef *nwf, nwItemDesc *item G_GNUC_UNUSED) { const char *str = NULL; @@ -734,7 +734,7 @@ formatIPProtocolID(virBufferPtr buf, static bool dscpValidator(enum attrDatatype datatype, union data *val, - virNWFilterRuleDefPtr nwf, + virNWFilterRuleDef *nwf, nwItemDesc *item G_GNUC_UNUSED) { uint8_t dscp = val->ui; @@ -793,7 +793,7 @@ parseStringItems(const struct int_map *int_map, static int -printStringItems(virBufferPtr buf, +printStringItems(virBuffer *buf, const struct int_map *int_map, int32_t flags, const char *sep) @@ -837,7 +837,7 @@ parseStateMatch(const char *statematch, void -virNWFilterPrintStateMatchFlags(virBufferPtr buf, +virNWFilterPrintStateMatchFlags(virBuffer *buf, const char *prefix, int32_t flags, bool disp_none) @@ -854,7 +854,7 @@ virNWFilterPrintStateMatchFlags(virBufferPtr buf, static bool stateValidator(enum attrDatatype datatype G_GNUC_UNUSED, union data *val, - virNWFilterRuleDefPtr nwf, + virNWFilterRuleDef *nwf, nwItemDesc *item) { char *input = val->c; @@ -873,8 +873,8 @@ stateValidator(enum attrDatatype datatype G_GNUC_UNUSED, static bool -stateFormatter(virBufferPtr buf, - virNWFilterRuleDefPtr nwf G_GNUC_UNUSED, +stateFormatter(virBuffer *buf, + virNWFilterRuleDef *nwf G_GNUC_UNUSED, nwItemDesc *item) { virNWFilterPrintStateMatchFlags(buf, "", item->u.u16, true); @@ -899,7 +899,7 @@ static const struct int_map tcpFlags[] = { static bool tcpFlagsValidator(enum attrDatatype datatype G_GNUC_UNUSED, union data *val, - virNWFilterRuleDefPtr nwf G_GNUC_UNUSED, + virNWFilterRuleDef *nwf G_GNUC_UNUSED, nwItemDesc *item) { bool rc = false; @@ -929,7 +929,7 @@ tcpFlagsValidator(enum attrDatatype datatype G_GNUC_UNUSED, static void -printTCPFlags(virBufferPtr buf, +printTCPFlags(virBuffer *buf, uint8_t flags) { if (flags == 0) @@ -951,8 +951,8 @@ virNWFilterPrintTCPFlags(uint8_t flags) static bool -tcpFlagsFormatter(virBufferPtr buf, - virNWFilterRuleDefPtr nwf G_GNUC_UNUSED, +tcpFlagsFormatter(virBuffer *buf, + virNWFilterRuleDef *nwf G_GNUC_UNUSED, nwItemDesc *item) { printTCPFlags(buf, item->u.tcpFlags.mask); @@ -966,7 +966,7 @@ tcpFlagsFormatter(virBufferPtr buf, static bool ipsetValidator(enum attrDatatype datatype G_GNUC_UNUSED, union data *val, - virNWFilterRuleDefPtr nwf G_GNUC_UNUSED, + virNWFilterRuleDef *nwf G_GNUC_UNUSED, nwItemDesc *item) { const char *errmsg = NULL; @@ -992,8 +992,8 @@ ipsetValidator(enum attrDatatype datatype G_GNUC_UNUSED, static bool -ipsetFormatter(virBufferPtr buf, - virNWFilterRuleDefPtr nwf G_GNUC_UNUSED, +ipsetFormatter(virBuffer *buf, + virNWFilterRuleDef *nwf G_GNUC_UNUSED, nwItemDesc *item) { virBufferAdd(buf, item->u.ipset.setname, -1); @@ -1005,7 +1005,7 @@ ipsetFormatter(virBufferPtr buf, static bool ipsetFlagsValidator(enum attrDatatype datatype G_GNUC_UNUSED, union data *val, - virNWFilterRuleDefPtr nwf G_GNUC_UNUSED, + virNWFilterRuleDef *nwf G_GNUC_UNUSED, nwItemDesc *item) { const char *errmsg = NULL; @@ -1042,8 +1042,8 @@ ipsetFlagsValidator(enum attrDatatype datatype G_GNUC_UNUSED, static bool -ipsetFlagsFormatter(virBufferPtr buf, - virNWFilterRuleDefPtr nwf G_GNUC_UNUSED, +ipsetFlagsFormatter(virBuffer *buf, + virNWFilterRuleDef *nwf G_GNUC_UNUSED, nwItemDesc *item) { uint8_t ctr; @@ -1794,7 +1794,7 @@ static const virAttributes virAttr[] = { static int virNWFilterRuleDetailsParse(xmlNodePtr node, - virNWFilterRuleDefPtr nwf, + virNWFilterRuleDef *nwf, const virXMLAttr2Struct *att) { int rc = 0, g_rc = 0; @@ -2060,10 +2060,10 @@ virNWFilterRuleDetailsParse(xmlNodePtr node, } -static virNWFilterIncludeDefPtr +static virNWFilterIncludeDef * virNWFilterIncludeParse(xmlNodePtr cur) { - virNWFilterIncludeDefPtr ret; + virNWFilterIncludeDef *ret; ret = g_new0(virNWFilterIncludeDef, 1); @@ -2088,7 +2088,7 @@ virNWFilterIncludeParse(xmlNodePtr cur) static void -virNWFilterRuleDefFixupIPSet(ipHdrDataDefPtr ipHdr) +virNWFilterRuleDefFixupIPSet(ipHdrDataDef *ipHdr) { if (HAS_ENTRY_ITEM(&ipHdr->dataIPSet) && !HAS_ENTRY_ITEM(&ipHdr->dataIPSetFlags)) { @@ -2109,11 +2109,11 @@ virNWFilterRuleDefFixupIPSet(ipHdrDataDefPtr ipHdr) * defined that cannot be instantiated. */ static int -virNWFilterRuleValidate(virNWFilterRuleDefPtr rule) +virNWFilterRuleValidate(virNWFilterRuleDef *rule) { int ret = 0; - portDataDefPtr portData = NULL; - nwItemDescPtr dataProtocolID = NULL; + portDataDef *portData = NULL; + nwItemDesc *dataProtocolID = NULL; const char *protocol = NULL; switch (rule->prtclType) { @@ -2189,7 +2189,7 @@ virNWFilterRuleValidate(virNWFilterRuleDefPtr rule) static void -virNWFilterRuleDefFixup(virNWFilterRuleDefPtr rule) +virNWFilterRuleDefFixup(virNWFilterRuleDef *rule) { #define COPY_NEG_SIGN(A, B) \ (A).flags = ((A).flags & ~NWFILTER_ENTRY_ITEM_FLAG_IS_NEG) | \ @@ -2404,7 +2404,7 @@ virNWFilterRuleDefFixup(virNWFilterRuleDefPtr rule) } -static virNWFilterRuleDefPtr +static virNWFilterRuleDef * virNWFilterRuleParse(xmlNodePtr node) { char *action; @@ -2416,7 +2416,7 @@ virNWFilterRuleParse(xmlNodePtr node) int priority; xmlNodePtr cur; - virNWFilterRuleDefPtr ret; + virNWFilterRuleDef *ret; ret = g_new0(virNWFilterRuleDef, 1); @@ -2598,15 +2598,15 @@ virNWFilterIsAllowedChain(const char *chainname) } -static virNWFilterDefPtr +static virNWFilterDef * virNWFilterDefParseXML(xmlXPathContextPtr ctxt) { - virNWFilterDefPtr ret; + virNWFilterDef *ret; xmlNodePtr curr = ctxt->node; char *uuid = NULL; char *chain = NULL; char *chain_pri_s = NULL; - virNWFilterEntryPtr entry; + virNWFilterEntry *entry; int chain_priority; const char *name_prefix; @@ -2722,7 +2722,7 @@ virNWFilterDefParseXML(xmlXPathContextPtr ctxt) } -virNWFilterDefPtr +virNWFilterDef * virNWFilterDefParseNode(xmlDocPtr xml, xmlNodePtr root) { @@ -2743,11 +2743,11 @@ virNWFilterDefParseNode(xmlDocPtr xml, } -static virNWFilterDefPtr +static virNWFilterDef * virNWFilterDefParse(const char *xmlStr, const char *filename) { - virNWFilterDefPtr def = NULL; + virNWFilterDef *def = NULL; xmlDocPtr xml; if ((xml = virXMLParse(filename, xmlStr, _("(nwfilter_definition)")))) { @@ -2759,14 +2759,14 @@ virNWFilterDefParse(const char *xmlStr, } -virNWFilterDefPtr +virNWFilterDef * virNWFilterDefParseString(const char *xmlStr) { return virNWFilterDefParse(xmlStr, NULL); } -virNWFilterDefPtr +virNWFilterDef * virNWFilterDefParseFile(const char *filename) { return virNWFilterDefParse(NULL, filename); @@ -2775,7 +2775,7 @@ virNWFilterDefParseFile(const char *filename) int virNWFilterSaveConfig(const char *configDir, - virNWFilterDefPtr def) + virNWFilterDef *def) { int ret = -1; char *xml; @@ -2802,7 +2802,7 @@ virNWFilterSaveConfig(const char *configDir, int virNWFilterDeleteDef(const char *configDir, - virNWFilterDefPtr def) + virNWFilterDef *def) { int ret = -1; char *configFile = NULL; @@ -2825,8 +2825,8 @@ virNWFilterDeleteDef(const char *configDir, static void -virNWIPAddressFormat(virBufferPtr buf, - virSocketAddrPtr ipaddr) +virNWIPAddressFormat(virBuffer *buf, + virSocketAddr *ipaddr) { char *output = virSocketAddrFormat(ipaddr); @@ -2838,10 +2838,10 @@ virNWIPAddressFormat(virBufferPtr buf, static void -virNWFilterRuleDefDetailsFormat(virBufferPtr buf, +virNWFilterRuleDefDetailsFormat(virBuffer *buf, const char *type, const virXMLAttr2Struct *att, - virNWFilterRuleDefPtr def) + virNWFilterRuleDef *def) { size_t i = 0, j; bool typeShown = false; @@ -2985,8 +2985,8 @@ virNWFilterRuleDefDetailsFormat(virBufferPtr buf, static int -virNWFilterRuleDefFormat(virBufferPtr buf, - virNWFilterRuleDefPtr def) +virNWFilterRuleDefFormat(virBuffer *buf, + virNWFilterRuleDef *def) { size_t i; bool subelement = false; @@ -3025,8 +3025,8 @@ virNWFilterRuleDefFormat(virBufferPtr buf, static int -virNWFilterEntryFormat(virBufferPtr buf, - virNWFilterEntryPtr entry) +virNWFilterEntryFormat(virBuffer *buf, + virNWFilterEntry *entry) { if (entry->rule) return virNWFilterRuleDefFormat(buf, entry->rule); @@ -3111,7 +3111,7 @@ virNWFilterTriggerRebuild(void) bool -virNWFilterRuleIsProtocolIPv4(virNWFilterRuleDefPtr rule) +virNWFilterRuleIsProtocolIPv4(virNWFilterRuleDef *rule) { if (rule->prtclType >= VIR_NWFILTER_RULE_PROTOCOL_TCP && rule->prtclType <= VIR_NWFILTER_RULE_PROTOCOL_ALL) @@ -3121,7 +3121,7 @@ virNWFilterRuleIsProtocolIPv4(virNWFilterRuleDefPtr rule) bool -virNWFilterRuleIsProtocolIPv6(virNWFilterRuleDefPtr rule) +virNWFilterRuleIsProtocolIPv6(virNWFilterRuleDef *rule) { if (rule->prtclType >= VIR_NWFILTER_RULE_PROTOCOL_TCPoIPV6 && rule->prtclType <= VIR_NWFILTER_RULE_PROTOCOL_ALLoIPV6) @@ -3131,7 +3131,7 @@ virNWFilterRuleIsProtocolIPv6(virNWFilterRuleDefPtr rule) bool -virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDefPtr rule) +virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDef *rule) { if (rule->prtclType <= VIR_NWFILTER_RULE_PROTOCOL_IPV6) return true; diff --git a/src/conf/nwfilter_conf.h b/src/conf/nwfilter_conf.h index 13c5723779..8d5684eb4e 100644 --- a/src/conf/nwfilter_conf.h +++ b/src/conf/nwfilter_conf.h @@ -111,10 +111,9 @@ typedef enum attrDatatype { typedef struct _nwItemDesc nwItemDesc; -typedef nwItemDesc *nwItemDescPtr; struct _nwItemDesc { virNWFilterEntryItemFlags flags; - virNWFilterVarAccessPtr varAccess; + virNWFilterVarAccess *varAccess; enum attrDatatype datatype; union { virMacAddr macaddr; @@ -141,7 +140,6 @@ struct _nwItemDesc { "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_.:-+ " typedef struct _ethHdrDataDef ethHdrDataDef; -typedef ethHdrDataDef *ethHdrDataDefPtr; struct _ethHdrDataDef { nwItemDesc dataSrcMACAddr; nwItemDesc dataSrcMACMask; @@ -151,7 +149,6 @@ struct _ethHdrDataDef { typedef struct _ethHdrFilterDef ethHdrFilterDef; -typedef ethHdrFilterDef *ethHdrFilterDefPtr; struct _ethHdrFilterDef { ethHdrDataDef ethHdr; nwItemDesc dataProtocolID; @@ -160,7 +157,6 @@ struct _ethHdrFilterDef { typedef struct _vlanHdrFilterDef vlanHdrFilterDef; -typedef vlanHdrFilterDef *vlanHdrFilterDefPtr; struct _vlanHdrFilterDef { ethHdrDataDef ethHdr; nwItemDesc dataVlanID; @@ -170,7 +166,6 @@ struct _vlanHdrFilterDef { typedef struct _stpHdrFilterDef stpHdrFilterDef; -typedef stpHdrFilterDef *stpHdrFilterDefPtr; struct _stpHdrFilterDef { ethHdrDataDef ethHdr; nwItemDesc dataType; @@ -200,7 +195,6 @@ struct _stpHdrFilterDef { typedef struct _arpHdrFilterDef arpHdrFilterDef; -typedef arpHdrFilterDef *arpHdrFilterDefPtr; struct _arpHdrFilterDef { ethHdrDataDef ethHdr; nwItemDesc dataHWType; @@ -218,7 +212,6 @@ struct _arpHdrFilterDef { typedef struct _ipHdrDataDef ipHdrDataDef; -typedef ipHdrDataDef *ipHdrDataDefPtr; struct _ipHdrDataDef { nwItemDesc dataIPVersion; nwItemDesc dataSrcIPAddr; @@ -240,7 +233,6 @@ struct _ipHdrDataDef { typedef struct _portDataDef portDataDef; -typedef portDataDef *portDataDefPtr; struct _portDataDef { nwItemDesc dataSrcPortStart; nwItemDesc dataSrcPortEnd; @@ -250,7 +242,6 @@ struct _portDataDef { typedef struct _ipHdrFilterDef ipHdrFilterDef; -typedef ipHdrFilterDef *ipHdrFilterDefPtr; struct _ipHdrFilterDef { ethHdrDataDef ethHdr; ipHdrDataDef ipHdr; @@ -259,7 +250,6 @@ struct _ipHdrFilterDef { typedef struct _ipv6HdrFilterDef ipv6HdrFilterDef; -typedef ipv6HdrFilterDef *ipv6HdrFilterDefPtr; struct _ipv6HdrFilterDef { ethHdrDataDef ethHdr; ipHdrDataDef ipHdr; @@ -272,7 +262,6 @@ struct _ipv6HdrFilterDef { typedef struct _icmpHdrFilterDef icmpHdrFilterDef; -typedef icmpHdrFilterDef *icmpHdrFilterDefPtr; struct _icmpHdrFilterDef { nwItemDesc dataSrcMACAddr; ipHdrDataDef ipHdr; @@ -283,7 +272,6 @@ struct _icmpHdrFilterDef { typedef struct _allHdrFilterDef allHdrFilterDef; -typedef allHdrFilterDef *allHdrFilterDefPtr; struct _allHdrFilterDef { nwItemDesc dataSrcMACAddr; ipHdrDataDef ipHdr; @@ -291,7 +279,6 @@ struct _allHdrFilterDef { typedef struct _igmpHdrFilterDef igmpHdrFilterDef; -typedef igmpHdrFilterDef *igmpHdrFilterDefPtr; struct _igmpHdrFilterDef { nwItemDesc dataSrcMACAddr; ipHdrDataDef ipHdr; @@ -299,7 +286,6 @@ struct _igmpHdrFilterDef { typedef struct _tcpHdrFilterDef tcpHdrFilterDef; -typedef tcpHdrFilterDef *tcpHdrFilterDefPtr; struct _tcpHdrFilterDef { nwItemDesc dataSrcMACAddr; ipHdrDataDef ipHdr; @@ -310,7 +296,6 @@ struct _tcpHdrFilterDef { typedef struct _udpHdrFilterDef udpHdrFilterDef; -typedef udpHdrFilterDef *udpHdrFilterDefPtr; struct _udpHdrFilterDef { nwItemDesc dataSrcMACAddr; ipHdrDataDef ipHdr; @@ -319,7 +304,6 @@ struct _udpHdrFilterDef { typedef struct _sctpHdrFilterDef sctpHdrFilterDef; -typedef sctpHdrFilterDef *sctpHdrFilterDefPtr; struct _sctpHdrFilterDef { nwItemDesc dataSrcMACAddr; ipHdrDataDef ipHdr; @@ -328,7 +312,6 @@ struct _sctpHdrFilterDef { typedef struct _espHdrFilterDef espHdrFilterDef; -typedef espHdrFilterDef *espHdrFilterDefPtr; struct _espHdrFilterDef { nwItemDesc dataSrcMACAddr; ipHdrDataDef ipHdr; @@ -336,7 +319,6 @@ struct _espHdrFilterDef { typedef struct _ahHdrFilterDef ahHdrFilterDef; -typedef ahHdrFilterDef *ahHdrFilterDefPtr; struct _ahHdrFilterDef { nwItemDesc dataSrcMACAddr; ipHdrDataDef ipHdr; @@ -344,7 +326,6 @@ struct _ahHdrFilterDef { typedef struct _udpliteHdrFilterDef udpliteHdrFilterDef; -typedef udpliteHdrFilterDef *udpliteHdrFilterDefPtr; struct _udpliteHdrFilterDef { nwItemDesc dataSrcMACAddr; ipHdrDataDef ipHdr; @@ -457,13 +438,12 @@ typedef enum { RULE_FLAG_STATE_INVALID | \ RULE_FLAG_STATE_NONE) -void virNWFilterPrintStateMatchFlags(virBufferPtr buf, const char *prefix, +void virNWFilterPrintStateMatchFlags(virBuffer *buf, const char *prefix, int32_t flags, bool disp_none); typedef int32_t virNWFilterRulePriority; typedef struct _virNWFilterRuleDef virNWFilterRuleDef; -typedef virNWFilterRuleDef *virNWFilterRuleDefPtr; struct _virNWFilterRuleDef { virNWFilterRulePriority priority; virNWFilterRuleFlags flags; @@ -489,7 +469,7 @@ struct _virNWFilterRuleDef { } p; size_t nVarAccess; - virNWFilterVarAccessPtr *varAccess; + virNWFilterVarAccess **varAccess; size_t nstrings; char **strings; @@ -497,7 +477,6 @@ struct _virNWFilterRuleDef { typedef struct _virNWFilterIncludeDef virNWFilterIncludeDef; -typedef virNWFilterIncludeDef *virNWFilterIncludeDefPtr; struct _virNWFilterIncludeDef { char *filterref; GHashTable *params; @@ -505,7 +484,6 @@ struct _virNWFilterIncludeDef { typedef struct _virNWFilterEntry virNWFilterEntry; -typedef virNWFilterEntry *virNWFilterEntryPtr; struct _virNWFilterEntry { virNWFilterRuleDef *rule; virNWFilterIncludeDef *include; @@ -530,8 +508,6 @@ typedef enum { typedef int32_t virNWFilterChainPriority; typedef struct _virNWFilterDef virNWFilterDef; -typedef virNWFilterDef *virNWFilterDefPtr; - struct _virNWFilterDef { char *name; unsigned char uuid[VIR_UUID_BUFLEN]; @@ -541,24 +517,24 @@ struct _virNWFilterDef { virNWFilterChainPriority chainPriority; size_t nentries; - virNWFilterEntryPtr *filterEntries; + virNWFilterEntry **filterEntries; }; void -virNWFilterRuleDefFree(virNWFilterRuleDefPtr def); +virNWFilterRuleDefFree(virNWFilterRuleDef *def); void -virNWFilterDefFree(virNWFilterDefPtr def); +virNWFilterDefFree(virNWFilterDef *def); int virNWFilterTriggerRebuild(void); int virNWFilterDeleteDef(const char *configDir, - virNWFilterDefPtr def); + virNWFilterDef *def); -virNWFilterDefPtr +virNWFilterDef * virNWFilterDefParseNode(xmlDocPtr xml, xmlNodePtr root); @@ -567,12 +543,12 @@ virNWFilterDefFormat(const virNWFilterDef *def); int virNWFilterSaveConfig(const char *configDir, - virNWFilterDefPtr def); + virNWFilterDef *def); -virNWFilterDefPtr +virNWFilterDef * virNWFilterDefParseString(const char *xml); -virNWFilterDefPtr +virNWFilterDef * virNWFilterDefParseFile(const char *filename); void @@ -598,13 +574,13 @@ char * virNWFilterPrintTCPFlags(uint8_t flags); bool -virNWFilterRuleIsProtocolIPv4(virNWFilterRuleDefPtr rule); +virNWFilterRuleIsProtocolIPv4(virNWFilterRuleDef *rule); bool -virNWFilterRuleIsProtocolIPv6(virNWFilterRuleDefPtr rule); +virNWFilterRuleIsProtocolIPv6(virNWFilterRuleDef *rule); bool -virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDefPtr rule); +virNWFilterRuleIsProtocolEthernet(virNWFilterRuleDef *rule); VIR_ENUM_DECL(virNWFilterRuleAction); diff --git a/src/conf/nwfilter_ipaddrmap.c b/src/conf/nwfilter_ipaddrmap.c index 02f2cabefc..d6facd749e 100644 --- a/src/conf/nwfilter_ipaddrmap.c +++ b/src/conf/nwfilter_ipaddrmap.c @@ -51,7 +51,7 @@ virNWFilterIPAddrMapAddIPAddr(const char *ifname, char *addr) { int ret = -1; char *addrCopy; - virNWFilterVarValuePtr val; + virNWFilterVarValue *val; addrCopy = g_strdup(addr); @@ -100,7 +100,7 @@ int virNWFilterIPAddrMapDelIPAddr(const char *ifname, const char *ipaddr) { int ret = -1; - virNWFilterVarValuePtr val = NULL; + virNWFilterVarValue *val = NULL; virMutexLock(&ipAddressMapLock); @@ -129,13 +129,13 @@ virNWFilterIPAddrMapDelIPAddr(const char *ifname, const char *ipaddr) /* Get the list of IP addresses known to be in use by an interface * * This function returns NULL in case no IP address is known to be - * associated with the interface, a virNWFilterVarValuePtr otherwise + * associated with the interface, a virNWFilterVarValue *otherwise * that then can contain one or multiple entries. */ -virNWFilterVarValuePtr +virNWFilterVarValue * virNWFilterIPAddrMapGetIPAddr(const char *ifname) { - virNWFilterVarValuePtr res; + virNWFilterVarValue *res; virMutexLock(&ipAddressMapLock); diff --git a/src/conf/nwfilter_ipaddrmap.h b/src/conf/nwfilter_ipaddrmap.h index ebb999a29a..88e5b1995a 100644 --- a/src/conf/nwfilter_ipaddrmap.h +++ b/src/conf/nwfilter_ipaddrmap.h @@ -28,4 +28,4 @@ void virNWFilterIPAddrMapShutdown(void); int virNWFilterIPAddrMapAddIPAddr(const char *ifname, char *addr); int virNWFilterIPAddrMapDelIPAddr(const char *ifname, const char *ipaddr); -virNWFilterVarValuePtr virNWFilterIPAddrMapGetIPAddr(const char *ifname); +virNWFilterVarValue *virNWFilterIPAddrMapGetIPAddr(const char *ifname); diff --git a/src/conf/nwfilter_params.c b/src/conf/nwfilter_params.c index 825c151284..aeed0cff1f 100644 --- a/src/conf/nwfilter_params.c +++ b/src/conf/nwfilter_params.c @@ -36,12 +36,12 @@ VIR_LOG_INIT("conf.nwfilter_params"); static bool isValidVarValue(const char *value); -static void virNWFilterVarAccessSetIntIterId(virNWFilterVarAccessPtr, +static void virNWFilterVarAccessSetIntIterId(virNWFilterVarAccess *, unsigned int); static unsigned int virNWFilterVarAccessGetIntIterId(const virNWFilterVarAccess *); void -virNWFilterVarValueFree(virNWFilterVarValuePtr val) +virNWFilterVarValueFree(virNWFilterVarValue *val) { size_t i; @@ -63,10 +63,10 @@ virNWFilterVarValueFree(virNWFilterVarValuePtr val) g_free(val); } -virNWFilterVarValuePtr +virNWFilterVarValue * virNWFilterVarValueCopy(const virNWFilterVarValue *val) { - virNWFilterVarValuePtr res; + virNWFilterVarValue *res; size_t i; char *str; @@ -92,10 +92,10 @@ virNWFilterVarValueCopy(const virNWFilterVarValue *val) return res; } -virNWFilterVarValuePtr +virNWFilterVarValue * virNWFilterVarValueCreateSimple(char *value) { - virNWFilterVarValuePtr val; + virNWFilterVarValue *val; if (!isValidVarValue(value)) { virReportError(VIR_ERR_INVALID_ARG, "%s", @@ -111,11 +111,11 @@ virNWFilterVarValueCreateSimple(char *value) return val; } -virNWFilterVarValuePtr +virNWFilterVarValue * virNWFilterVarValueCreateSimpleCopyValue(const char *value) { char *val; - virNWFilterVarValuePtr ret; + virNWFilterVarValue *ret; val = g_strdup(value); ret = virNWFilterVarValueCreateSimple(val); @@ -203,7 +203,7 @@ virNWFilterVarValueEqual(const virNWFilterVarValue *a, } int -virNWFilterVarValueAddValue(virNWFilterVarValuePtr val, char *value) +virNWFilterVarValueAddValue(virNWFilterVarValue *val, char *value) { char *tmp; int rc = -1; @@ -235,7 +235,7 @@ virNWFilterVarValueAddValue(virNWFilterVarValuePtr val, char *value) int -virNWFilterVarValueAddValueCopy(virNWFilterVarValuePtr val, const char *value) +virNWFilterVarValueAddValueCopy(virNWFilterVarValue *val, const char *value) { char *valdup; valdup = g_strdup(value); @@ -248,7 +248,7 @@ virNWFilterVarValueAddValueCopy(virNWFilterVarValuePtr val, const char *value) static int -virNWFilterVarValueDelNthValue(virNWFilterVarValuePtr val, unsigned int pos) +virNWFilterVarValueDelNthValue(virNWFilterVarValue *val, unsigned int pos) { switch (val->valType) { case NWFILTER_VALUE_TYPE_SIMPLE: @@ -270,7 +270,7 @@ virNWFilterVarValueDelNthValue(virNWFilterVarValuePtr val, unsigned int pos) } int -virNWFilterVarValueDelValue(virNWFilterVarValuePtr val, const char *value) +virNWFilterVarValueDelValue(virNWFilterVarValue *val, const char *value) { size_t i; @@ -292,7 +292,7 @@ virNWFilterVarValueDelValue(virNWFilterVarValuePtr val, const char *value) } void -virNWFilterVarCombIterFree(virNWFilterVarCombIterPtr ci) +virNWFilterVarCombIterFree(virNWFilterVarCombIter *ci) { size_t i; @@ -308,7 +308,7 @@ virNWFilterVarCombIterFree(virNWFilterVarCombIterPtr ci) } static int -virNWFilterVarCombIterGetIndexByIterId(virNWFilterVarCombIterPtr ci, +virNWFilterVarCombIterGetIndexByIterId(virNWFilterVarCombIter *ci, unsigned int iterId) { size_t i; @@ -321,7 +321,7 @@ virNWFilterVarCombIterGetIndexByIterId(virNWFilterVarCombIterPtr ci, } static void -virNWFilterVarCombIterEntryInit(virNWFilterVarCombIterEntryPtr cie, +virNWFilterVarCombIterEntryInit(virNWFilterVarCombIterEntry *cie, unsigned int iterId) { memset(cie, 0, sizeof(*cie)); @@ -329,11 +329,11 @@ virNWFilterVarCombIterEntryInit(virNWFilterVarCombIterEntryPtr cie, } static int -virNWFilterVarCombIterAddVariable(virNWFilterVarCombIterEntryPtr cie, +virNWFilterVarCombIterAddVariable(virNWFilterVarCombIterEntry *cie, GHashTable *hash, const virNWFilterVarAccess *varAccess) { - virNWFilterVarValuePtr varValue; + virNWFilterVarValue *varValue; unsigned int maxValue = 0, minValue = 0; const char *varName = virNWFilterVarAccessGetVarName(varAccess); @@ -394,12 +394,12 @@ virNWFilterVarCombIterAddVariable(virNWFilterVarCombIterEntryPtr cie, * skip them since this pair has already been encountered in the 1st iteration */ static bool -virNWFilterVarCombIterEntryAreUniqueEntries(virNWFilterVarCombIterEntryPtr cie, +virNWFilterVarCombIterEntryAreUniqueEntries(virNWFilterVarCombIterEntry *cie, GHashTable *hash) { size_t i, j; - virNWFilterVarValuePtr varValue; - virNWFilterVarValuePtr tmp; + virNWFilterVarValue *varValue; + virNWFilterVarValue *tmp; const char *value; varValue = virHashLookup(hash, cie->varNames[0]); @@ -453,12 +453,12 @@ virNWFilterVarCombIterEntryAreUniqueEntries(virNWFilterVarCombIterEntryPtr cie, * which then would cause all combinations of the items of the two lists to * be created. */ -virNWFilterVarCombIterPtr +virNWFilterVarCombIter * virNWFilterVarCombIterCreate(GHashTable *hash, - virNWFilterVarAccessPtr *varAccess, + virNWFilterVarAccess **varAccess, size_t nVarAccess) { - virNWFilterVarCombIterPtr res; + virNWFilterVarCombIter *res; size_t i; unsigned int iterId; int iterIndex = -1; @@ -510,8 +510,8 @@ virNWFilterVarCombIterCreate(GHashTable *hash, return NULL; } -virNWFilterVarCombIterPtr -virNWFilterVarCombIterNext(virNWFilterVarCombIterPtr ci) +virNWFilterVarCombIter * +virNWFilterVarCombIterNext(virNWFilterVarCombIter *ci) { size_t i; @@ -535,14 +535,14 @@ virNWFilterVarCombIterNext(virNWFilterVarCombIterPtr ci) } const char * -virNWFilterVarCombIterGetVarValue(virNWFilterVarCombIterPtr ci, +virNWFilterVarCombIterGetVarValue(virNWFilterVarCombIter *ci, const virNWFilterVarAccess *vap) { size_t i; unsigned int iterId; bool found = false; const char *res = NULL; - virNWFilterVarValuePtr value; + virNWFilterVarValue *value; int iterIndex = -1; const char *varName = virNWFilterVarAccessGetVarName(vap); @@ -622,12 +622,12 @@ static int addToTable(void *payload, const char *name, void *data) { struct addToTableStruct *atts = (struct addToTableStruct *)data; - virNWFilterVarValuePtr val; + virNWFilterVarValue *val; if (atts->errOccurred) return 0; - val = virNWFilterVarValueCopy((virNWFilterVarValuePtr)payload); + val = virNWFilterVarValueCopy((virNWFilterVarValue *)payload); if (!val) { atts->errOccurred = 1; return 0; @@ -689,7 +689,7 @@ isValidVarValue(const char *value) return (value[strspn(value, VALID_VARVALUE)] == 0) && (strlen(value) != 0); } -static virNWFilterVarValuePtr +static virNWFilterVarValue * virNWFilterParseVarValue(const char *val) { return virNWFilterVarValueCreateSimpleCopyValue(val); @@ -699,7 +699,7 @@ GHashTable * virNWFilterParseParamAttributes(xmlNodePtr cur) { char *nam, *val; - virNWFilterVarValuePtr value; + virNWFilterVarValue *value; GHashTable *table = virHashNew(virNWFilterVarValueHashFree); if (!table) @@ -755,11 +755,11 @@ virNWFilterParseParamAttributes(xmlNodePtr cur) int -virNWFilterFormatParamAttributes(virBufferPtr buf, +virNWFilterFormatParamAttributes(virBuffer *buf, GHashTable *table, const char *filterref) { - virHashKeyValuePairPtr items; + virHashKeyValuePair *items; size_t i, j; int card, numKeys; @@ -803,7 +803,7 @@ virNWFilterFormatParamAttributes(virBufferPtr buf, } void -virNWFilterVarAccessFree(virNWFilterVarAccessPtr varAccess) +virNWFilterVarAccessFree(virNWFilterVarAccess *varAccess) { if (!varAccess) return; @@ -838,11 +838,11 @@ virNWFilterVarAccessEqual(const virNWFilterVarAccess *a, * Parse a variable access like * IP, IP[@2], IP[3] */ -virNWFilterVarAccessPtr +virNWFilterVarAccess * virNWFilterVarAccessParse(const char *varAccess) { size_t idx, varNameLen; - virNWFilterVarAccessPtr dest; + virNWFilterVarAccess *dest; const char *input = varAccess; dest = g_new0(virNWFilterVarAccess, 1); @@ -927,7 +927,7 @@ virNWFilterVarAccessParse(const char *varAccess) } void -virNWFilterVarAccessPrint(virNWFilterVarAccessPtr vap, virBufferPtr buf) +virNWFilterVarAccessPrint(virNWFilterVarAccess *vap, virBuffer *buf) { virBufferAdd(buf, vap->varName, -1); switch (vap->accessType) { @@ -968,7 +968,7 @@ virNWFilterVarAccessGetIndex(const virNWFilterVarAccess *vap) } static void -virNWFilterVarAccessSetIntIterId(virNWFilterVarAccessPtr vap, +virNWFilterVarAccessSetIntIterId(virNWFilterVarAccess *vap, unsigned int intIterId) { vap->u.index.intIterId = intIterId; @@ -987,7 +987,7 @@ virNWFilterVarAccessIsAvailable(const virNWFilterVarAccess *varAccess, const char *varName = virNWFilterVarAccessGetVarName(varAccess); const char *res; unsigned int idx; - virNWFilterVarValuePtr varValue; + virNWFilterVarValue *varValue; varValue = virHashLookup(hash, varName); if (!varValue) diff --git a/src/conf/nwfilter_params.h b/src/conf/nwfilter_params.h index 59068b8ae9..d11b533958 100644 --- a/src/conf/nwfilter_params.h +++ b/src/conf/nwfilter_params.h @@ -34,7 +34,6 @@ typedef enum { } virNWFilterVarValueType; typedef struct _virNWFilterVarValue virNWFilterVarValue; -typedef virNWFilterVarValue *virNWFilterVarValuePtr; struct _virNWFilterVarValue { virNWFilterVarValueType valType; union { @@ -48,10 +47,10 @@ struct _virNWFilterVarValue { } u; }; -virNWFilterVarValuePtr virNWFilterVarValueCreateSimple(char *); -virNWFilterVarValuePtr virNWFilterVarValueCreateSimpleCopyValue(const char *); -virNWFilterVarValuePtr virNWFilterVarValueCopy(const virNWFilterVarValue *); -void virNWFilterVarValueFree(virNWFilterVarValuePtr val); +virNWFilterVarValue *virNWFilterVarValueCreateSimple(char *); +virNWFilterVarValue *virNWFilterVarValueCreateSimpleCopyValue(const char *); +virNWFilterVarValue *virNWFilterVarValueCopy(const virNWFilterVarValue *); +void virNWFilterVarValueFree(virNWFilterVarValue *val); void virNWFilterVarValueHashFree(void *payload); const char *virNWFilterVarValueGetSimple(const virNWFilterVarValue *val); const char *virNWFilterVarValueGetNthValue(const virNWFilterVarValue *val, @@ -59,12 +58,12 @@ const char *virNWFilterVarValueGetNthValue(const virNWFilterVarValue *val, unsigned int virNWFilterVarValueGetCardinality(const virNWFilterVarValue *); bool virNWFilterVarValueEqual(const virNWFilterVarValue *a, const virNWFilterVarValue *b); -int virNWFilterVarValueAddValue(virNWFilterVarValuePtr val, char *value); -int virNWFilterVarValueAddValueCopy(virNWFilterVarValuePtr val, const char *value); -int virNWFilterVarValueDelValue(virNWFilterVarValuePtr val, const char *value); +int virNWFilterVarValueAddValue(virNWFilterVarValue *val, char *value); +int virNWFilterVarValueAddValueCopy(virNWFilterVarValue *val, const char *value); +int virNWFilterVarValueDelValue(virNWFilterVarValue *val, const char *value); GHashTable *virNWFilterParseParamAttributes(xmlNodePtr cur); -int virNWFilterFormatParamAttributes(virBufferPtr buf, +int virNWFilterFormatParamAttributes(virBuffer *buf, GHashTable *table, const char *filterref); @@ -92,7 +91,6 @@ typedef enum { } virNWFilterVarAccessType; typedef struct _virNWFilterVarAccess virNWFilterVarAccess; -typedef virNWFilterVarAccess *virNWFilterVarAccessPtr; struct _virNWFilterVarAccess { virNWFilterVarAccessType accessType; union { @@ -107,12 +105,12 @@ struct _virNWFilterVarAccess { #define VIR_NWFILTER_MAX_ITERID 1000 -void virNWFilterVarAccessFree(virNWFilterVarAccessPtr varAccess); +void virNWFilterVarAccessFree(virNWFilterVarAccess *varAccess); bool virNWFilterVarAccessEqual(const virNWFilterVarAccess *a, const virNWFilterVarAccess *b); -virNWFilterVarAccessPtr virNWFilterVarAccessParse(const char *varAccess); -void virNWFilterVarAccessPrint(virNWFilterVarAccessPtr vap, - virBufferPtr buf); +virNWFilterVarAccess *virNWFilterVarAccessParse(const char *varAccess); +void virNWFilterVarAccessPrint(virNWFilterVarAccess *vap, + virBuffer *buf); const char *virNWFilterVarAccessGetVarName(const virNWFilterVarAccess *vap); virNWFilterVarAccessType virNWFilterVarAccessGetType( const virNWFilterVarAccess *vap); @@ -122,7 +120,6 @@ bool virNWFilterVarAccessIsAvailable(const virNWFilterVarAccess *vap, GHashTable *hash); typedef struct _virNWFilterVarCombIterEntry virNWFilterVarCombIterEntry; -typedef virNWFilterVarCombIterEntry *virNWFilterVarCombIterEntryPtr; struct _virNWFilterVarCombIterEntry { unsigned int iterId; const char **varNames; @@ -133,19 +130,18 @@ struct _virNWFilterVarCombIterEntry { }; typedef struct _virNWFilterVarCombIter virNWFilterVarCombIter; -typedef virNWFilterVarCombIter *virNWFilterVarCombIterPtr; struct _virNWFilterVarCombIter { GHashTable *hashTable; size_t nIter; - virNWFilterVarCombIterEntryPtr iter; + virNWFilterVarCombIterEntry *iter; }; -virNWFilterVarCombIterPtr virNWFilterVarCombIterCreate( +virNWFilterVarCombIter *virNWFilterVarCombIterCreate( GHashTable *hash, - virNWFilterVarAccessPtr *vars, + virNWFilterVarAccess **vars, size_t nVars); -void virNWFilterVarCombIterFree(virNWFilterVarCombIterPtr ci); -virNWFilterVarCombIterPtr virNWFilterVarCombIterNext( - virNWFilterVarCombIterPtr ci); -const char *virNWFilterVarCombIterGetVarValue(virNWFilterVarCombIterPtr ci, +void virNWFilterVarCombIterFree(virNWFilterVarCombIter *ci); +virNWFilterVarCombIter *virNWFilterVarCombIterNext( + virNWFilterVarCombIter *ci); +const char *virNWFilterVarCombIterGetVarValue(virNWFilterVarCombIter *ci, const virNWFilterVarAccess *); diff --git a/src/conf/object_event.c b/src/conf/object_event.c index 4a9450dd9c..4b571facc8 100644 --- a/src/conf/object_event.c +++ b/src/conf/object_event.c @@ -39,7 +39,7 @@ VIR_LOG_INIT("conf.object_event"); struct _virObjectEventCallback { int callbackID; - virClassPtr klass; + virClass *klass; int eventID; virConnectPtr conn; int remoteID; @@ -54,35 +54,33 @@ struct _virObjectEventCallback { bool legacy; /* true if end user does not know callbackID */ }; typedef struct _virObjectEventCallback virObjectEventCallback; -typedef virObjectEventCallback *virObjectEventCallbackPtr; struct _virObjectEventCallbackList { unsigned int nextID; size_t count; - virObjectEventCallbackPtr *callbacks; + virObjectEventCallback **callbacks; }; struct _virObjectEventQueue { size_t count; - virObjectEventPtr *events; + virObjectEvent **events; }; typedef struct _virObjectEventQueue virObjectEventQueue; -typedef virObjectEventQueue *virObjectEventQueuePtr; struct _virObjectEventState { virObjectLockable parent; /* The list of domain event callbacks */ - virObjectEventCallbackListPtr callbacks; + virObjectEventCallbackList *callbacks; /* The queue of object events */ - virObjectEventQueuePtr queue; + virObjectEventQueue *queue; /* Timer for flushing events queue */ int timer; /* Flag if we're in process of dispatching */ bool isDispatching; }; -static virClassPtr virObjectEventClass; -static virClassPtr virObjectEventStateClass; +static virClass *virObjectEventClass; +static virClass *virObjectEventStateClass; static void virObjectEventDispose(void *obj); static void virObjectEventStateDispose(void *obj); @@ -107,7 +105,7 @@ VIR_ONCE_GLOBAL_INIT(virObjectEvent); * Return the class object to be used as a parent when creating an * event subclass. */ -virClassPtr +virClass * virClassForObjectEvent(void) { if (virObjectEventInitialize() < 0) @@ -119,7 +117,7 @@ virClassForObjectEvent(void) static void virObjectEventDispose(void *obj) { - virObjectEventPtr event = obj; + virObjectEvent *event = obj; VIR_DEBUG("obj=%p", event); @@ -134,7 +132,7 @@ virObjectEventDispose(void *obj) * Free the memory in the domain event callback */ static void -virObjectEventCallbackFree(virObjectEventCallbackPtr cb) +virObjectEventCallbackFree(virObjectEventCallback *cb) { if (!cb) return; @@ -151,7 +149,7 @@ virObjectEventCallbackFree(virObjectEventCallbackPtr cb) * Free the memory in the domain event callback list */ static void -virObjectEventCallbackListFree(virObjectEventCallbackListPtr list) +virObjectEventCallbackListFree(virObjectEventCallbackList *list) { size_t i; if (!list) @@ -192,8 +190,8 @@ virObjectEventCallbackListFree(virObjectEventCallbackListPtr list) */ static int virObjectEventCallbackListCount(virConnectPtr conn, - virObjectEventCallbackListPtr cbList, - virClassPtr klass, + virObjectEventCallbackList *cbList, + virClass *klass, int eventID, const char *key, bool serverFilter) @@ -202,7 +200,7 @@ virObjectEventCallbackListCount(virConnectPtr conn, int ret = 0; for (i = 0; i < cbList->count; i++) { - virObjectEventCallbackPtr cb = cbList->callbacks[i]; + virObjectEventCallback *cb = cbList->callbacks[i]; if (cb->filter) continue; @@ -226,18 +224,18 @@ virObjectEventCallbackListCount(virConnectPtr conn, * @callback: the callback to remove * @doFreeCb: Inhibit calling the freecb * - * Internal function to remove a callback from a virObjectEventCallbackListPtr + * Internal function to remove a callback from a virObjectEventCallbackList * */ static int virObjectEventCallbackListRemoveID(virConnectPtr conn, - virObjectEventCallbackListPtr cbList, + virObjectEventCallbackList *cbList, int callbackID, bool doFreeCb) { size_t i; for (i = 0; i < cbList->count; i++) { - virObjectEventCallbackPtr cb = cbList->callbacks[i]; + virObjectEventCallback *cb = cbList->callbacks[i]; if (cb->callbackID == callbackID && cb->conn == conn) { int ret; @@ -268,13 +266,13 @@ virObjectEventCallbackListRemoveID(virConnectPtr conn, static int virObjectEventCallbackListMarkDeleteID(virConnectPtr conn, - virObjectEventCallbackListPtr cbList, + virObjectEventCallbackList *cbList, int callbackID) { size_t i; for (i = 0; i < cbList->count; i++) { - virObjectEventCallbackPtr cb = cbList->callbacks[i]; + virObjectEventCallback *cb = cbList->callbacks[i]; if (cb->callbackID == callbackID && cb->conn == conn) { cb->deleted = true; @@ -294,7 +292,7 @@ virObjectEventCallbackListMarkDeleteID(virConnectPtr conn, static int -virObjectEventCallbackListPurgeMarked(virObjectEventCallbackListPtr cbList) +virObjectEventCallbackListPurgeMarked(virObjectEventCallbackList *cbList) { size_t n; for (n = 0; n < cbList->count; n++) { @@ -332,9 +330,9 @@ virObjectEventCallbackListPurgeMarked(virObjectEventCallbackListPtr cbList) */ static int ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) virObjectEventCallbackLookup(virConnectPtr conn, - virObjectEventCallbackListPtr cbList, + virObjectEventCallbackList *cbList, const char *key, - virClassPtr klass, + virClass *klass, int eventID, virConnectObjectEventGenericCallback callback, bool legacy, @@ -346,7 +344,7 @@ virObjectEventCallbackLookup(virConnectPtr conn, *remoteID = -1; for (i = 0; i < cbList->count; i++) { - virObjectEventCallbackPtr cb = cbList->callbacks[i]; + virObjectEventCallback *cb = cbList->callbacks[i]; if (cb->deleted) continue; @@ -382,15 +380,15 @@ virObjectEventCallbackLookup(virConnectPtr conn, * @callbackID: filled with callback ID * @serverFilter: true if server supports object filtering * - * Internal function to add a callback from a virObjectEventCallbackListPtr + * Internal function to add a callback from a virObjectEventCallbackList * */ static int virObjectEventCallbackListAddID(virConnectPtr conn, - virObjectEventCallbackListPtr cbList, + virObjectEventCallbackList *cbList, const char *key, virObjectEventCallbackFilter filter, void *filter_opaque, - virClassPtr klass, + virClass *klass, int eventID, virConnectObjectEventGenericCallback callback, void *opaque, @@ -399,7 +397,7 @@ virObjectEventCallbackListAddID(virConnectPtr conn, int *callbackID, bool serverFilter) { - virObjectEventCallbackPtr cb; + virObjectEventCallback *cb; int ret = -1; int remoteID = -1; @@ -469,7 +467,7 @@ virObjectEventCallbackListAddID(virConnectPtr conn, * Removes all elements from the queue */ static void -virObjectEventQueueClear(virObjectEventQueuePtr queue) +virObjectEventQueueClear(virObjectEventQueue *queue) { size_t i; if (!queue) @@ -488,7 +486,7 @@ virObjectEventQueueClear(virObjectEventQueuePtr queue) * Free the memory in the queue. We process this like a list here */ static void -virObjectEventQueueFree(virObjectEventQueuePtr queue) +virObjectEventQueueFree(virObjectEventQueue *queue) { if (!queue) return; @@ -497,7 +495,7 @@ virObjectEventQueueFree(virObjectEventQueuePtr queue) g_free(queue); } -static virObjectEventQueuePtr +static virObjectEventQueue * virObjectEventQueueNew(void) { return g_new0(virObjectEventQueue, 1); @@ -506,14 +504,14 @@ virObjectEventQueueNew(void) /** * virObjectEventStateDispose: - * @list: virObjectEventStatePtr to free + * @list: virObjectEventState * to free * - * Free a virObjectEventStatePtr and its members, and unregister the timer. + * Free a virObjectEventState * and its members, and unregister the timer. */ static void virObjectEventStateDispose(void *obj) { - virObjectEventStatePtr state = obj; + virObjectEventState *state = obj; VIR_DEBUG("obj=%p", state); @@ -525,7 +523,7 @@ virObjectEventStateDispose(void *obj) } -static void virObjectEventStateFlush(virObjectEventStatePtr state); +static void virObjectEventStateFlush(virObjectEventState *state); /** @@ -540,7 +538,7 @@ static void virObjectEventStateFlush(virObjectEventStatePtr state); static void virObjectEventTimer(int timer G_GNUC_UNUSED, void *opaque) { - virObjectEventStatePtr state = opaque; + virObjectEventState *state = opaque; virObjectEventStateFlush(state); } @@ -551,10 +549,10 @@ virObjectEventTimer(int timer G_GNUC_UNUSED, void *opaque) * * Allocate a new event state object. */ -virObjectEventStatePtr +virObjectEventState * virObjectEventStateNew(void) { - virObjectEventStatePtr state = NULL; + virObjectEventState *state = NULL; if (virObjectEventInitialize() < 0) return NULL; @@ -590,7 +588,7 @@ virObjectEventStateNew(void) * Create a new event, with the information common to all events. */ void * -virObjectEventNew(virClassPtr klass, +virObjectEventNew(virClass *klass, virObjectEventDispatchFunc dispatcher, int eventID, int id, @@ -598,7 +596,7 @@ virObjectEventNew(virClassPtr klass, const unsigned char *uuid, const char *key) { - virObjectEventPtr event; + virObjectEvent *event; if (virObjectEventInitialize() < 0) return NULL; @@ -638,8 +636,8 @@ virObjectEventNew(virClassPtr klass, * Returns: 0 on success, -1 on failure */ static int -virObjectEventQueuePush(virObjectEventQueuePtr evtQueue, - virObjectEventPtr event) +virObjectEventQueuePush(virObjectEventQueue *evtQueue, + virObjectEvent *event) { if (!evtQueue) return -1; @@ -651,8 +649,8 @@ virObjectEventQueuePush(virObjectEventQueuePtr evtQueue, static bool -virObjectEventDispatchMatchCallback(virObjectEventPtr event, - virObjectEventCallbackPtr cb) +virObjectEventDispatchMatchCallback(virObjectEvent *event, + virObjectEventCallback *cb) { if (!cb) return false; @@ -675,9 +673,9 @@ virObjectEventDispatchMatchCallback(virObjectEventPtr event, static void -virObjectEventStateDispatchCallbacks(virObjectEventStatePtr state, - virObjectEventPtr event, - virObjectEventCallbackListPtr callbacks) +virObjectEventStateDispatchCallbacks(virObjectEventState *state, + virObjectEvent *event, + virObjectEventCallbackList *callbacks) { size_t i; /* Cache this now, since we may be dropping the lock, @@ -686,7 +684,7 @@ virObjectEventStateDispatchCallbacks(virObjectEventStatePtr state, size_t cbCount = callbacks->count; for (i = 0; i < cbCount; i++) { - virObjectEventCallbackPtr cb = callbacks->callbacks[i]; + virObjectEventCallback *cb = callbacks->callbacks[i]; if (!virObjectEventDispatchMatchCallback(event, cb)) continue; @@ -700,9 +698,9 @@ virObjectEventStateDispatchCallbacks(virObjectEventStatePtr state, static void -virObjectEventStateQueueDispatch(virObjectEventStatePtr state, - virObjectEventQueuePtr queue, - virObjectEventCallbackListPtr callbacks) +virObjectEventStateQueueDispatch(virObjectEventState *state, + virObjectEventQueue *queue, + virObjectEventCallbackList *callbacks) { size_t i; @@ -729,8 +727,8 @@ virObjectEventStateQueueDispatch(virObjectEventStatePtr state, * id. */ void -virObjectEventStateQueueRemote(virObjectEventStatePtr state, - virObjectEventPtr event, +virObjectEventStateQueueRemote(virObjectEventState *state, + virObjectEvent *event, int remoteID) { if (!event) @@ -765,15 +763,15 @@ virObjectEventStateQueueRemote(virObjectEventStatePtr state, * call. */ void -virObjectEventStateQueue(virObjectEventStatePtr state, - virObjectEventPtr event) +virObjectEventStateQueue(virObjectEventState *state, + virObjectEvent *event) { virObjectEventStateQueueRemote(state, event, -1); } static void -virObjectEventStateCleanupTimer(virObjectEventStatePtr state, bool clear_queue) +virObjectEventStateCleanupTimer(virObjectEventState *state, bool clear_queue) { /* There are still some callbacks, keep the timer. */ if (state->callbacks->count) @@ -792,7 +790,7 @@ virObjectEventStateCleanupTimer(virObjectEventStatePtr state, bool clear_queue) static void -virObjectEventStateFlush(virObjectEventStatePtr state) +virObjectEventStateFlush(virObjectEventState *state) { virObjectEventQueue tempQueue; @@ -863,11 +861,11 @@ virObjectEventStateFlush(virObjectEventStatePtr state) */ int virObjectEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, const char *key, virObjectEventCallbackFilter filter, void *filter_opaque, - virClassPtr klass, + virClass *klass, int eventID, virConnectObjectEventGenericCallback cb, void *opaque, @@ -929,7 +927,7 @@ virObjectEventStateRegisterID(virConnectPtr conn, */ int virObjectEventStateDeregisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, int callbackID, bool doFreeCb) { @@ -966,8 +964,8 @@ virObjectEventStateDeregisterID(virConnectPtr conn, */ int virObjectEventStateCallbackID(virConnectPtr conn, - virObjectEventStatePtr state, - virClassPtr klass, + virObjectEventState *state, + virClass *klass, int eventID, virConnectObjectEventGenericCallback callback, int *remoteID) @@ -1004,17 +1002,17 @@ virObjectEventStateCallbackID(virConnectPtr conn, */ int virObjectEventStateEventID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, int callbackID, int *remoteID) { int ret = -1; size_t i; - virObjectEventCallbackListPtr cbList = state->callbacks; + virObjectEventCallbackList *cbList = state->callbacks; virObjectLock(state); for (i = 0; i < cbList->count; i++) { - virObjectEventCallbackPtr cb = cbList->callbacks[i]; + virObjectEventCallback *cb = cbList->callbacks[i]; if (cb->deleted) continue; @@ -1050,7 +1048,7 @@ virObjectEventStateEventID(virConnectPtr conn, */ void virObjectEventStateSetRemote(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, int callbackID, int remoteID) { @@ -1058,7 +1056,7 @@ virObjectEventStateSetRemote(virConnectPtr conn, virObjectLock(state); for (i = 0; i < state->callbacks->count; i++) { - virObjectEventCallbackPtr cb = state->callbacks->callbacks[i]; + virObjectEventCallback *cb = state->callbacks->callbacks[i]; if (cb->deleted) continue; diff --git a/src/conf/object_event.h b/src/conf/object_event.h index 63b0818613..7b5531344e 100644 --- a/src/conf/object_event.h +++ b/src/conf/object_event.h @@ -31,13 +31,11 @@ * in a call / response rpc */ typedef struct _virObjectEvent virObjectEvent; -typedef virObjectEvent *virObjectEventPtr; typedef struct _virObjectEventState virObjectEventState; -typedef virObjectEventState *virObjectEventStatePtr; -virObjectEventStatePtr +virObjectEventState * virObjectEventStateNew(void); /** @@ -57,33 +55,33 @@ typedef void (*virConnectObjectEventGenericCallback)(virConnectPtr conn, ((virConnectObjectEventGenericCallback)(cb)) void -virObjectEventStateQueue(virObjectEventStatePtr state, - virObjectEventPtr event) +virObjectEventStateQueue(virObjectEventState *state, + virObjectEvent *event) ATTRIBUTE_NONNULL(1); void -virObjectEventStateQueueRemote(virObjectEventStatePtr state, - virObjectEventPtr event, +virObjectEventStateQueueRemote(virObjectEventState *state, + virObjectEvent *event, int remoteID) ATTRIBUTE_NONNULL(1); int virObjectEventStateDeregisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, int callbackID, bool doFreeCb) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int virObjectEventStateEventID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, int callbackID, int *remoteID) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); void virObjectEventStateSetRemote(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, int callbackID, int remoteID) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); diff --git a/src/conf/object_event_private.h b/src/conf/object_event_private.h index 80af043b9b..ef9f0f3b32 100644 --- a/src/conf/object_event_private.h +++ b/src/conf/object_event_private.h @@ -31,14 +31,12 @@ struct _virObjectMeta { char *key; }; typedef struct _virObjectMeta virObjectMeta; -typedef virObjectMeta *virObjectMetaPtr; typedef struct _virObjectEventCallbackList virObjectEventCallbackList; -typedef virObjectEventCallbackList *virObjectEventCallbackListPtr; typedef void (*virObjectEventDispatchFunc)(virConnectPtr conn, - virObjectEventPtr event, + virObjectEvent *event, virConnectObjectEventGenericCallback cb, void *cbopaque); @@ -61,19 +59,19 @@ struct __attribute__((aligned(8))) _virObjectEvent { * be sent to @conn. */ typedef bool (*virObjectEventCallbackFilter)(virConnectPtr conn, - virObjectEventPtr event, + virObjectEvent *event, void *opaque); -virClassPtr +virClass * virClassForObjectEvent(void); int virObjectEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, const char *key, virObjectEventCallbackFilter filter, void *filter_opaque, - virClassPtr klass, + virClass *klass, int eventID, virConnectObjectEventGenericCallback cb, void *opaque, @@ -86,8 +84,8 @@ virObjectEventStateRegisterID(virConnectPtr conn, int virObjectEventStateCallbackID(virConnectPtr conn, - virObjectEventStatePtr state, - virClassPtr klass, + virObjectEventState *state, + virClass *klass, int eventID, virConnectObjectEventGenericCallback callback, int *remoteID) @@ -95,7 +93,7 @@ virObjectEventStateCallbackID(virConnectPtr conn, ATTRIBUTE_NONNULL(5); void * -virObjectEventNew(virClassPtr klass, +virObjectEventNew(virClass *klass, virObjectEventDispatchFunc dispatcher, int eventID, int id, diff --git a/src/conf/secret_conf.c b/src/conf/secret_conf.c index 3341f5d83c..7bfdc58b83 100644 --- a/src/conf/secret_conf.c +++ b/src/conf/secret_conf.c @@ -38,7 +38,7 @@ VIR_LOG_INIT("conf.secret_conf"); void -virSecretDefFree(virSecretDefPtr def) +virSecretDefFree(virSecretDef *def) { if (def == NULL) return; @@ -50,7 +50,7 @@ virSecretDefFree(virSecretDefPtr def) static int virSecretDefParseUsage(xmlXPathContextPtr ctxt, - virSecretDefPtr def) + virSecretDef *def) { g_autofree char *type_str = NULL; int type; @@ -126,7 +126,7 @@ virSecretDefParseUsage(xmlXPathContextPtr ctxt, return 0; } -static virSecretDefPtr +static virSecretDef * secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root) { g_autoptr(xmlXPathContext) ctxt = NULL; @@ -189,12 +189,12 @@ secretXMLParseNode(xmlDocPtr xml, xmlNodePtr root) return g_steal_pointer(&def); } -static virSecretDefPtr +static virSecretDef * virSecretDefParse(const char *xmlStr, const char *filename) { xmlDocPtr xml; - virSecretDefPtr ret = NULL; + virSecretDef *ret = NULL; if ((xml = virXMLParse(filename, xmlStr, _("(definition_of_secret)")))) { ret = secretXMLParseNode(xml, xmlDocGetRootElement(xml)); @@ -204,20 +204,20 @@ virSecretDefParse(const char *xmlStr, return ret; } -virSecretDefPtr +virSecretDef * virSecretDefParseString(const char *xmlStr) { return virSecretDefParse(xmlStr, NULL); } -virSecretDefPtr +virSecretDef * virSecretDefParseFile(const char *filename) { return virSecretDefParse(NULL, filename); } static int -virSecretDefFormatUsage(virBufferPtr buf, +virSecretDefFormatUsage(virBuffer *buf, const virSecretDef *def) { const char *type; diff --git a/src/conf/secret_conf.h b/src/conf/secret_conf.h index 77457ecd7a..373c96b729 100644 --- a/src/conf/secret_conf.h +++ b/src/conf/secret_conf.h @@ -23,7 +23,6 @@ #include "internal.h" typedef struct _virSecretDef virSecretDef; -typedef virSecretDef *virSecretDefPtr; struct _virSecretDef { bool isephemeral; bool isprivate; @@ -33,11 +32,11 @@ struct _virSecretDef { char *usage_id; /* May be NULL */ }; -void virSecretDefFree(virSecretDefPtr def); +void virSecretDefFree(virSecretDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSecretDef, virSecretDefFree); -virSecretDefPtr virSecretDefParseString(const char *xml); -virSecretDefPtr virSecretDefParseFile(const char *filename); +virSecretDef *virSecretDefParseString(const char *xml); +virSecretDef *virSecretDefParseFile(const char *filename); char *virSecretDefFormat(const virSecretDef *def); #define VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL \ diff --git a/src/conf/secret_event.c b/src/conf/secret_event.c index 1c34dcfbc9..473747a7f3 100644 --- a/src/conf/secret_event.c +++ b/src/conf/secret_event.c @@ -37,7 +37,6 @@ struct _virSecretEvent { bool dummy; }; typedef struct _virSecretEvent virSecretEvent; -typedef virSecretEvent *virSecretEventPtr; struct _virSecretEventLifecycle { virSecretEvent parent; @@ -46,18 +45,16 @@ struct _virSecretEventLifecycle { int detail; }; typedef struct _virSecretEventLifecycle virSecretEventLifecycle; -typedef virSecretEventLifecycle *virSecretEventLifecyclePtr; struct _virSecretEventValueChanged { virSecretEvent parent; bool dummy; }; typedef struct _virSecretEventValueChanged virSecretEventValueChanged; -typedef virSecretEventValueChanged *virSecretEventValueChangedPtr; -static virClassPtr virSecretEventClass; -static virClassPtr virSecretEventLifecycleClass; -static virClassPtr virSecretEventValueChangedClass; +static virClass *virSecretEventClass; +static virClass *virSecretEventLifecycleClass; +static virClass *virSecretEventValueChangedClass; static void virSecretEventDispose(void *obj); static void virSecretEventLifecycleDispose(void *obj); static void virSecretEventValueChangedDispose(void *obj); @@ -82,7 +79,7 @@ VIR_ONCE_GLOBAL_INIT(virSecretEvents); static void virSecretEventDispose(void *obj) { - virSecretEventPtr event = obj; + virSecretEvent *event = obj; VIR_DEBUG("obj=%p", event); } @@ -90,7 +87,7 @@ virSecretEventDispose(void *obj) static void virSecretEventLifecycleDispose(void *obj) { - virSecretEventLifecyclePtr event = obj; + virSecretEventLifecycle *event = obj; VIR_DEBUG("obj=%p", event); } @@ -98,14 +95,14 @@ virSecretEventLifecycleDispose(void *obj) static void virSecretEventValueChangedDispose(void *obj) { - virSecretEventValueChangedPtr event = obj; + virSecretEventValueChanged *event = obj; VIR_DEBUG("obj=%p", event); } static void virSecretEventDispatchDefaultFunc(virConnectPtr conn, - virObjectEventPtr event, + virObjectEvent *event, virConnectObjectEventGenericCallback cb, void *cbopaque) { @@ -120,9 +117,9 @@ virSecretEventDispatchDefaultFunc(virConnectPtr conn, switch ((virSecretEventID)event->eventID) { case VIR_SECRET_EVENT_ID_LIFECYCLE: { - virSecretEventLifecyclePtr secretLifecycleEvent; + virSecretEventLifecycle *secretLifecycleEvent; - secretLifecycleEvent = (virSecretEventLifecyclePtr)event; + secretLifecycleEvent = (virSecretEventLifecycle *)event; ((virConnectSecretEventLifecycleCallback)cb)(conn, secret, secretLifecycleEvent->type, secretLifecycleEvent->detail, @@ -166,7 +163,7 @@ virSecretEventDispatchDefaultFunc(virConnectPtr conn, */ int virSecretEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virSecretPtr secret, int eventID, virConnectSecretEventGenericCallback cb, @@ -210,7 +207,7 @@ virSecretEventStateRegisterID(virConnectPtr conn, */ int virSecretEventStateRegisterClient(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virSecretPtr secret, int eventID, virConnectSecretEventGenericCallback cb, @@ -245,14 +242,14 @@ virSecretEventStateRegisterClient(virConnectPtr conn, * * Create a new secret lifecycle event. */ -virObjectEventPtr +virObjectEvent * virSecretEventLifecycleNew(const unsigned char *uuid, int usage_type, const char *usage_id, int type, int detail) { - virSecretEventLifecyclePtr event; + virSecretEventLifecycle *event; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (virSecretEventsInitialize() < 0) @@ -269,7 +266,7 @@ virSecretEventLifecycleNew(const unsigned char *uuid, event->type = type; event->detail = detail; - return (virObjectEventPtr)event; + return (virObjectEvent *)event; } @@ -279,12 +276,12 @@ virSecretEventLifecycleNew(const unsigned char *uuid, * * Create a new secret lifecycle event. */ -virObjectEventPtr +virObjectEvent * virSecretEventValueChangedNew(const unsigned char *uuid, int usage_type, const char *usage_id) { - virSecretEventValueChangedPtr event; + virSecretEventValueChanged *event; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (virSecretEventsInitialize() < 0) @@ -298,5 +295,5 @@ virSecretEventValueChangedNew(const unsigned char *uuid, usage_type, usage_id, uuid, uuidstr))) return NULL; - return (virObjectEventPtr)event; + return (virObjectEvent *)event; } diff --git a/src/conf/secret_event.h b/src/conf/secret_event.h index 3fe80521b9..b0b0a213ce 100644 --- a/src/conf/secret_event.h +++ b/src/conf/secret_event.h @@ -28,7 +28,7 @@ int virSecretEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virSecretPtr secret, int eventID, virConnectSecretEventGenericCallback cb, @@ -40,7 +40,7 @@ virSecretEventStateRegisterID(virConnectPtr conn, int virSecretEventStateRegisterClient(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virSecretPtr secret, int eventID, virConnectSecretEventGenericCallback cb, @@ -50,13 +50,13 @@ virSecretEventStateRegisterClient(virConnectPtr conn, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(8); -virObjectEventPtr +virObjectEvent * virSecretEventLifecycleNew(const unsigned char *uuid, int usage_type, const char *usage_id, int type, int detail); -virObjectEventPtr +virObjectEvent * virSecretEventValueChangedNew(const unsigned char *uuid, int usage_type, const char *usage_id); diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c index 36ce1a08ca..07c9ea7af7 100644 --- a/src/conf/snapshot_conf.c +++ b/src/conf/snapshot_conf.c @@ -53,7 +53,7 @@ VIR_LOG_INIT("conf.snapshot_conf"); -static virClassPtr virDomainSnapshotDefClass; +static virClass *virDomainSnapshotDefClass; static void virDomainSnapshotDefDispose(void *obj); static int @@ -91,7 +91,7 @@ VIR_ENUM_IMPL(virDomainSnapshotState, /* Snapshot Def functions */ static void -virDomainSnapshotDiskDefClear(virDomainSnapshotDiskDefPtr disk) +virDomainSnapshotDiskDefClear(virDomainSnapshotDiskDef *disk) { VIR_FREE(disk->name); virObjectUnref(disk->src); @@ -99,7 +99,7 @@ virDomainSnapshotDiskDefClear(virDomainSnapshotDiskDefPtr disk) } void -virDomainSnapshotDiskDefFree(virDomainSnapshotDiskDefPtr disk) +virDomainSnapshotDiskDefFree(virDomainSnapshotDiskDef *disk) { if (!disk) return; @@ -110,7 +110,7 @@ virDomainSnapshotDiskDefFree(virDomainSnapshotDiskDefPtr disk) /* Allocate a new virDomainSnapshotDef; free with virObjectUnref() */ -virDomainSnapshotDefPtr +virDomainSnapshotDef * virDomainSnapshotDefNew(void) { if (virDomainSnapshotInitialize() < 0) @@ -122,7 +122,7 @@ virDomainSnapshotDefNew(void) static void virDomainSnapshotDefDispose(void *obj) { - virDomainSnapshotDefPtr def = obj; + virDomainSnapshotDef *def = obj; size_t i; g_free(def->file); @@ -135,9 +135,9 @@ virDomainSnapshotDefDispose(void *obj) int virDomainSnapshotDiskDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virDomainSnapshotDiskDefPtr def, + virDomainSnapshotDiskDef *def, unsigned int flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { int ret = -1; char *snapshot = NULL; @@ -222,15 +222,15 @@ virDomainSnapshotDiskDefParseXML(xmlNodePtr node, * If flags does not include * VIR_DOMAIN_SNAPSHOT_PARSE_INTERNAL, then current is ignored. */ -static virDomainSnapshotDefPtr +static virDomainSnapshotDef * virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque, bool *current, unsigned int flags) { - virDomainSnapshotDefPtr def = NULL; - virDomainSnapshotDefPtr ret = NULL; + virDomainSnapshotDef *def = NULL; + virDomainSnapshotDef *ret = NULL; xmlNodePtr *nodes = NULL; xmlNodePtr inactiveDomNode = NULL; size_t i; @@ -241,7 +241,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, char *memorySnapshot = NULL; char *memoryFile = NULL; bool offline = !!(flags & VIR_DOMAIN_SNAPSHOT_PARSE_OFFLINE); - virSaveCookieCallbacksPtr saveCookie = virDomainXMLOptionGetSaveCookie(xmlopt); + virSaveCookieCallbacks *saveCookie = virDomainXMLOptionGetSaveCookie(xmlopt); int domainflags = VIR_DOMAIN_DEF_PARSE_INACTIVE | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; @@ -417,10 +417,10 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt, return ret; } -virDomainSnapshotDefPtr +virDomainSnapshotDef * virDomainSnapshotDefParseNode(xmlDocPtr xml, xmlNodePtr root, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque, bool *current, unsigned int flags) @@ -451,14 +451,14 @@ virDomainSnapshotDefParseNode(xmlDocPtr xml, return virDomainSnapshotDefParse(ctxt, xmlopt, parseOpaque, current, flags); } -virDomainSnapshotDefPtr +virDomainSnapshotDef * virDomainSnapshotDefParseString(const char *xmlStr, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, void *parseOpaque, bool *current, unsigned int flags) { - virDomainSnapshotDefPtr ret = NULL; + virDomainSnapshotDef *ret = NULL; xmlDocPtr xml; int keepBlanksDefault = xmlKeepBlanksDefault(0); @@ -479,10 +479,10 @@ virDomainSnapshotDefParseString(const char *xmlStr, * @other is non-NULL, this may include swapping def->parent.dom from other * into def. */ int -virDomainSnapshotRedefineValidate(virDomainSnapshotDefPtr def, +virDomainSnapshotRedefineValidate(virDomainSnapshotDef *def, const unsigned char *domain_uuid, - virDomainMomentObjPtr other, - virDomainXMLOptionPtr xmlopt, + virDomainMomentObj *other, + virDomainXMLOption *xmlopt, unsigned int flags) { int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL; @@ -509,7 +509,7 @@ virDomainSnapshotRedefineValidate(virDomainSnapshotDefPtr def, } if (other) { - virDomainSnapshotDefPtr otherdef = virDomainSnapshotObjGetDef(other); + virDomainSnapshotDef *otherdef = virDomainSnapshotObjGetDef(other); if ((otherdef->state == VIR_DOMAIN_SNAPSHOT_RUNNING || otherdef->state == VIR_DOMAIN_SNAPSHOT_PAUSED) != @@ -566,7 +566,7 @@ virDomainSnapshotRedefineValidate(virDomainSnapshotDefPtr def, * success, -1 on error. */ static int -virDomainSnapshotDefAssignExternalNames(virDomainSnapshotDefPtr def) +virDomainSnapshotDefAssignExternalNames(virDomainSnapshotDef *def) { const char *origpath; char *tmppath; @@ -576,7 +576,7 @@ virDomainSnapshotDefAssignExternalNames(virDomainSnapshotDefPtr def) size_t j; for (i = 0; i < def->ndisks; i++) { - virDomainSnapshotDiskDefPtr disk = &def->disks[i]; + virDomainSnapshotDiskDef *disk = &def->disks[i]; if (disk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL || disk->src->path) @@ -641,13 +641,13 @@ virDomainSnapshotDefAssignExternalNames(virDomainSnapshotDefPtr def) * dom->disks. If require_match, also ensure that there is no * conflicting requests for both internal and external snapshots. */ int -virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr snapdef, +virDomainSnapshotAlignDisks(virDomainSnapshotDef *snapdef, int default_snapshot, bool require_match) { - virDomainDefPtr domdef = snapdef->parent.dom; + virDomainDef *domdef = snapdef->parent.dom; g_autoptr(GHashTable) map = virHashNew(NULL); - g_autofree virDomainSnapshotDiskDefPtr olddisks = NULL; + g_autofree virDomainSnapshotDiskDef *olddisks = NULL; size_t i; if (!domdef) { @@ -668,8 +668,8 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr snapdef, /* Double check requested disks. */ for (i = 0; i < snapdef->ndisks; i++) { - virDomainSnapshotDiskDefPtr snapdisk = &snapdef->disks[i]; - virDomainDiskDefPtr domdisk = virDomainDiskByName(domdef, snapdisk->name, false); + virDomainSnapshotDiskDef *snapdisk = &snapdef->disks[i]; + virDomainDiskDef *domdisk = virDomainDiskByName(domdef, snapdisk->name, false); if (!domdisk) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -725,9 +725,9 @@ virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr snapdef, snapdef->ndisks = domdef->ndisks; for (i = 0; i < domdef->ndisks; i++) { - virDomainDiskDefPtr domdisk = domdef->disks[i]; - virDomainSnapshotDiskDefPtr snapdisk = snapdef->disks + i; - virDomainSnapshotDiskDefPtr existing; + virDomainDiskDef *domdisk = domdef->disks[i]; + virDomainSnapshotDiskDef *snapdisk = snapdef->disks + i; + virDomainSnapshotDiskDef *existing; /* copy existing disks */ if ((existing = virHashLookup(map, domdisk->dst))) { @@ -774,9 +774,9 @@ virDomainSnapshotFormatConvertXMLFlags(unsigned int flags) static int -virDomainSnapshotDiskDefFormat(virBufferPtr buf, - virDomainSnapshotDiskDefPtr disk, - virDomainXMLOptionPtr xmlopt) +virDomainSnapshotDiskDefFormat(virBuffer *buf, + virDomainSnapshotDiskDef *disk, + virDomainXMLOption *xmlopt) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -824,10 +824,10 @@ virDomainSnapshotDiskDefFormat(virBufferPtr buf, /* Append XML describing def into buf. Return 0 on success, or -1 on * failure with buf cleared. */ static int -virDomainSnapshotDefFormatInternal(virBufferPtr buf, +virDomainSnapshotDefFormatInternal(virBuffer *buf, const char *uuidstr, - virDomainSnapshotDefPtr def, - virDomainXMLOptionPtr xmlopt, + virDomainSnapshotDef *def, + virDomainXMLOption *xmlopt, unsigned int flags) { size_t i; @@ -914,8 +914,8 @@ virDomainSnapshotDefFormatInternal(virBufferPtr buf, char * virDomainSnapshotDefFormat(const char *uuidstr, - virDomainSnapshotDefPtr def, - virDomainXMLOptionPtr xmlopt, + virDomainSnapshotDef *def, + virDomainXMLOption *xmlopt, unsigned int flags) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -932,7 +932,7 @@ virDomainSnapshotDefFormat(const char *uuidstr, bool -virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def) +virDomainSnapshotDefIsExternal(virDomainSnapshotDef *def) { size_t i; @@ -948,23 +948,23 @@ virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def) } bool -virDomainSnapshotIsExternal(virDomainMomentObjPtr snap) +virDomainSnapshotIsExternal(virDomainMomentObj *snap) { - virDomainSnapshotDefPtr def = virDomainSnapshotObjGetDef(snap); + virDomainSnapshotDef *def = virDomainSnapshotObjGetDef(snap); return virDomainSnapshotDefIsExternal(def); } int -virDomainSnapshotRedefinePrep(virDomainObjPtr vm, - virDomainSnapshotDefPtr *defptr, - virDomainMomentObjPtr *snap, - virDomainXMLOptionPtr xmlopt, +virDomainSnapshotRedefinePrep(virDomainObj *vm, + virDomainSnapshotDef **defptr, + virDomainMomentObj **snap, + virDomainXMLOption *xmlopt, unsigned int flags) { - virDomainSnapshotDefPtr def = *defptr; - virDomainMomentObjPtr other; - virDomainSnapshotDefPtr otherdef = NULL; + virDomainSnapshotDef *def = *defptr; + virDomainMomentObj *other; + virDomainSnapshotDef *otherdef = NULL; bool check_if_stolen; if (virDomainSnapshotCheckCycles(vm->snapshots, def, vm->def->name) < 0) diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h index 0f3987fc80..7d49a555cd 100644 --- a/src/conf/snapshot_conf.h +++ b/src/conf/snapshot_conf.h @@ -60,18 +60,17 @@ G_STATIC_ASSERT((int)VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT == VIR_DOMAIN_LAST); /* Stores disk-snapshot information */ typedef struct _virDomainSnapshotDiskDef virDomainSnapshotDiskDef; -typedef virDomainSnapshotDiskDef *virDomainSnapshotDiskDefPtr; struct _virDomainSnapshotDiskDef { char *name; /* name matching the ndisks */ virDomainSnapshotDiskDef *disks; - virObjectPtr cookie; + virObject *cookie; }; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virDomainSnapshotDef, virObjectUnref); @@ -110,39 +109,39 @@ typedef enum { unsigned int virDomainSnapshotFormatConvertXMLFlags(unsigned int flags); -virDomainSnapshotDefPtr virDomainSnapshotDefParseString(const char *xmlStr, - virDomainXMLOptionPtr xmlopt, - void *parseOpaque, - bool *current, - unsigned int flags); -virDomainSnapshotDefPtr virDomainSnapshotDefParseNode(xmlDocPtr xml, - xmlNodePtr root, - virDomainXMLOptionPtr xmlopt, +virDomainSnapshotDef *virDomainSnapshotDefParseString(const char *xmlStr, + virDomainXMLOption *xmlopt, void *parseOpaque, bool *current, unsigned int flags); -virDomainSnapshotDefPtr virDomainSnapshotDefNew(void); +virDomainSnapshotDef *virDomainSnapshotDefParseNode(xmlDocPtr xml, + xmlNodePtr root, + virDomainXMLOption *xmlopt, + void *parseOpaque, + bool *current, + unsigned int flags); +virDomainSnapshotDef *virDomainSnapshotDefNew(void); char *virDomainSnapshotDefFormat(const char *uuidstr, - virDomainSnapshotDefPtr def, - virDomainXMLOptionPtr xmlopt, + virDomainSnapshotDef *def, + virDomainXMLOption *xmlopt, unsigned int flags); -int virDomainSnapshotAlignDisks(virDomainSnapshotDefPtr snapshot, +int virDomainSnapshotAlignDisks(virDomainSnapshotDef *snapshot, int default_snapshot, bool require_match); -bool virDomainSnapshotDefIsExternal(virDomainSnapshotDefPtr def); -bool virDomainSnapshotIsExternal(virDomainMomentObjPtr snap); +bool virDomainSnapshotDefIsExternal(virDomainSnapshotDef *def); +bool virDomainSnapshotIsExternal(virDomainMomentObj *snap); -int virDomainSnapshotRedefinePrep(virDomainObjPtr vm, - virDomainSnapshotDefPtr *def, - virDomainMomentObjPtr *snap, - virDomainXMLOptionPtr xmlopt, +int virDomainSnapshotRedefinePrep(virDomainObj *vm, + virDomainSnapshotDef **def, + virDomainMomentObj **snap, + virDomainXMLOption *xmlopt, unsigned int flags); -int virDomainSnapshotRedefineValidate(virDomainSnapshotDefPtr def, +int virDomainSnapshotRedefineValidate(virDomainSnapshotDef *def, const unsigned char *domain_uuid, - virDomainMomentObjPtr other, - virDomainXMLOptionPtr xmlopt, + virDomainMomentObj *other, + virDomainXMLOption *xmlopt, unsigned int flags); VIR_ENUM_DECL(virDomainSnapshotLocation); diff --git a/src/conf/snapshot_conf_priv.h b/src/conf/snapshot_conf_priv.h index 369a023881..d5b334478f 100644 --- a/src/conf/snapshot_conf_priv.h +++ b/src/conf/snapshot_conf_priv.h @@ -27,6 +27,6 @@ int virDomainSnapshotDiskDefParseXML(xmlNodePtr node, xmlXPathContextPtr ctxt, - virDomainSnapshotDiskDefPtr def, + virDomainSnapshotDiskDef *def, unsigned int flags, - virDomainXMLOptionPtr xmlopt); + virDomainXMLOption *xmlopt); diff --git a/src/conf/storage_adapter_conf.c b/src/conf/storage_adapter_conf.c index 77ecb8d5f2..5b71c79d24 100644 --- a/src/conf/storage_adapter_conf.c +++ b/src/conf/storage_adapter_conf.c @@ -38,7 +38,7 @@ VIR_ENUM_IMPL(virStorageAdapter, ); static void -virStorageAdapterClearFCHost(virStorageAdapterFCHostPtr fchost) +virStorageAdapterClearFCHost(virStorageAdapterFCHost *fchost) { VIR_FREE(fchost->wwnn); VIR_FREE(fchost->wwpn); @@ -50,7 +50,7 @@ virStorageAdapterClearFCHost(virStorageAdapterFCHostPtr fchost) void -virStorageAdapterClear(virStorageAdapterPtr adapter) +virStorageAdapterClear(virStorageAdapter *adapter) { if (adapter->type == VIR_STORAGE_ADAPTER_TYPE_FC_HOST) virStorageAdapterClearFCHost(&adapter->data.fchost); @@ -62,7 +62,7 @@ virStorageAdapterClear(virStorageAdapterPtr adapter) static int virStorageAdapterParseXMLFCHost(xmlNodePtr node, - virStorageAdapterFCHostPtr fchost) + virStorageAdapterFCHost *fchost) { char *managed = NULL; @@ -91,7 +91,7 @@ virStorageAdapterParseXMLFCHost(xmlNodePtr node, static int virStorageAdapterParseXMLSCSIHost(xmlNodePtr node, xmlXPathContextPtr ctxt, - virStorageAdapterSCSIHostPtr scsi_host) + virStorageAdapterSCSIHost *scsi_host) { scsi_host->name = virXMLPropString(node, "name"); if (virXPathNode("./parentaddr", ctxt)) { @@ -135,7 +135,7 @@ virStorageAdapterParseXMLSCSIHost(xmlNodePtr node, static int virStorageAdapterParseXMLLegacy(xmlNodePtr node, xmlXPathContextPtr ctxt, - virStorageAdapterPtr adapter) + virStorageAdapter *adapter) { char *wwnn = virXMLPropString(node, "wwnn"); char *wwpn = virXMLPropString(node, "wwpn"); @@ -173,7 +173,7 @@ virStorageAdapterParseXMLLegacy(xmlNodePtr node, int -virStorageAdapterParseXML(virStorageAdapterPtr adapter, +virStorageAdapterParseXML(virStorageAdapter *adapter, xmlNodePtr node, xmlXPathContextPtr ctxt) { @@ -214,7 +214,7 @@ virStorageAdapterParseXML(virStorageAdapterPtr adapter, static int -virStorageAdapterValidateFCHost(virStorageAdapterFCHostPtr fchost) +virStorageAdapterValidateFCHost(virStorageAdapterFCHost *fchost) { if (!fchost->wwnn || !fchost->wwpn) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -256,7 +256,7 @@ virStorageAdapterValidateFCHost(virStorageAdapterFCHostPtr fchost) static int -virStorageAdapterValidateSCSIHost(virStorageAdapterSCSIHostPtr scsi_host) +virStorageAdapterValidateSCSIHost(virStorageAdapterSCSIHost *scsi_host) { if (!scsi_host->name && !scsi_host->has_parent) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -277,7 +277,7 @@ virStorageAdapterValidateSCSIHost(virStorageAdapterSCSIHostPtr scsi_host) int -virStorageAdapterValidate(virStorageAdapterPtr adapter) +virStorageAdapterValidate(virStorageAdapter *adapter) { if (!adapter->type) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -296,8 +296,8 @@ virStorageAdapterValidate(virStorageAdapterPtr adapter) static void -virStorageAdapterFormatFCHost(virBufferPtr buf, - virStorageAdapterFCHostPtr fchost) +virStorageAdapterFormatFCHost(virBuffer *buf, + virStorageAdapterFCHost *fchost) { virBufferEscapeString(buf, " parent='%s'", fchost->parent); virBufferEscapeString(buf, " parent_wwnn='%s'", fchost->parent_wwnn); @@ -314,8 +314,8 @@ virStorageAdapterFormatFCHost(virBufferPtr buf, static void -virStorageAdapterFormatSCSIHost(virBufferPtr buf, - virStorageAdapterSCSIHostPtr scsi_host) +virStorageAdapterFormatSCSIHost(virBuffer *buf, + virStorageAdapterSCSIHost *scsi_host) { if (scsi_host->name) { virBufferAsprintf(buf, " name='%s'/>\n", scsi_host->name); @@ -336,8 +336,8 @@ virStorageAdapterFormatSCSIHost(virBufferPtr buf, void -virStorageAdapterFormat(virBufferPtr buf, - virStorageAdapterPtr adapter) +virStorageAdapterFormat(virBuffer *buf, + virStorageAdapter *adapter) { virBufferAsprintf(buf, "type)); diff --git a/src/conf/storage_adapter_conf.h b/src/conf/storage_adapter_conf.h index 4c7da7c8d9..ec7e9cc98f 100644 --- a/src/conf/storage_adapter_conf.h +++ b/src/conf/storage_adapter_conf.h @@ -34,7 +34,6 @@ typedef enum { VIR_ENUM_DECL(virStorageAdapter); typedef struct _virStorageAdapterSCSIHost virStorageAdapterSCSIHost; -typedef virStorageAdapterSCSIHost *virStorageAdapterSCSIHostPtr; struct _virStorageAdapterSCSIHost { char *name; virPCIDeviceAddress parentaddr; /* host address */ @@ -43,7 +42,6 @@ struct _virStorageAdapterSCSIHost { }; typedef struct _virStorageAdapterFCHost virStorageAdapterFCHost; -typedef virStorageAdapterFCHost *virStorageAdapterFCHostPtr; struct _virStorageAdapterFCHost { char *parent; char *parent_wwnn; @@ -55,7 +53,6 @@ struct _virStorageAdapterFCHost { }; typedef struct _virStorageAdapter virStorageAdapter; -typedef virStorageAdapter *virStorageAdapterPtr; struct _virStorageAdapter { int type; /* virStorageAdapterType */ @@ -67,16 +64,16 @@ struct _virStorageAdapter { void -virStorageAdapterClear(virStorageAdapterPtr adapter); +virStorageAdapterClear(virStorageAdapter *adapter); int -virStorageAdapterParseXML(virStorageAdapterPtr adapter, +virStorageAdapterParseXML(virStorageAdapter *adapter, xmlNodePtr node, xmlXPathContextPtr ctxt); int -virStorageAdapterValidate(virStorageAdapterPtr adapter); +virStorageAdapterValidate(virStorageAdapter *adapter); void -virStorageAdapterFormat(virBufferPtr buf, - virStorageAdapterPtr adapter); +virStorageAdapterFormat(virBuffer *buf, + virStorageAdapter *adapter); diff --git a/src/conf/storage_capabilities.c b/src/conf/storage_capabilities.c index cac238c4f2..22e05bbe30 100644 --- a/src/conf/storage_capabilities.c +++ b/src/conf/storage_capabilities.c @@ -31,13 +31,13 @@ VIR_LOG_INIT("conf.storage_capabilities"); -static virClassPtr virStoragePoolCapsClass; +static virClass *virStoragePoolCapsClass; static void virStoragePoolCapsDispose(void *obj) { - virStoragePoolCapsPtr caps = obj; + virStoragePoolCaps *caps = obj; VIR_DEBUG("obj=%p", caps); virObjectUnref(caps->driverCaps); @@ -55,10 +55,10 @@ virStoragePoolCapsOnceInit(void) VIR_ONCE_GLOBAL_INIT(virStoragePoolCaps); -virStoragePoolCapsPtr -virStoragePoolCapsNew(virCapsPtr driverCaps) +virStoragePoolCaps * +virStoragePoolCapsNew(virCaps *driverCaps) { - virStoragePoolCapsPtr caps = NULL; + virStoragePoolCaps *caps = NULL; if (virStoragePoolCapsInitialize() < 0) return NULL; @@ -73,7 +73,7 @@ virStoragePoolCapsNew(virCapsPtr driverCaps) static bool -virStoragePoolCapsIsLoaded(virCapsPtr driverCaps, +virStoragePoolCapsIsLoaded(virCaps *driverCaps, int poolType) { size_t i; @@ -91,7 +91,7 @@ virStoragePoolCapsIsLoaded(virCapsPtr driverCaps, static int -virStoragePoolCapsFormatPool(virBufferPtr buf, +virStoragePoolCapsFormatPool(virBuffer *buf, int poolType, const virStoragePoolCaps *caps) { diff --git a/src/conf/storage_capabilities.h b/src/conf/storage_capabilities.h index 377c313aa0..2b484bbc30 100644 --- a/src/conf/storage_capabilities.h +++ b/src/conf/storage_capabilities.h @@ -23,18 +23,17 @@ #include "internal.h" typedef struct _virStoragePoolCaps virStoragePoolCaps; -typedef virStoragePoolCaps *virStoragePoolCapsPtr; struct _virStoragePoolCaps { virObjectLockable parent; - virCapsPtr driverCaps; + virCaps *driverCaps; }; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStoragePoolCaps, virObjectUnref); -virStoragePoolCapsPtr -virStoragePoolCapsNew(virCapsPtr driverCaps); +virStoragePoolCaps * +virStoragePoolCapsNew(virCaps *driverCaps); char * virStoragePoolCapsFormat(const virStoragePoolCaps *caps); diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 310a062ee7..eee5b36f83 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -116,7 +116,6 @@ typedef const char *(*virStoragePoolFormatToString)(int format); typedef int (*virStoragePoolFormatFromString)(const char *format); typedef struct _virStorageVolOptions virStorageVolOptions; -typedef virStorageVolOptions *virStorageVolOptionsPtr; struct _virStorageVolOptions { int defaultFormat; int lastFormat; @@ -136,7 +135,6 @@ enum { }; typedef struct _virStoragePoolOptions virStoragePoolOptions; -typedef virStoragePoolOptions *virStoragePoolOptionsPtr; struct _virStoragePoolOptions { unsigned int flags; int defaultFormat; @@ -149,7 +147,6 @@ struct _virStoragePoolOptions { }; typedef struct _virStoragePoolTypeInfo virStoragePoolTypeInfo; -typedef virStoragePoolTypeInfo *virStoragePoolTypeInfoPtr; struct _virStoragePoolTypeInfo { int poolType; virStoragePoolOptions poolOptions; @@ -307,7 +304,7 @@ static virStoragePoolTypeInfo poolTypeInfo[] = { }; -static virStoragePoolTypeInfoPtr +static virStoragePoolTypeInfo * virStoragePoolTypeInfoLookup(int type) { size_t i; @@ -321,10 +318,10 @@ virStoragePoolTypeInfoLookup(int type) } -static virStoragePoolOptionsPtr +static virStoragePoolOptions * virStoragePoolOptionsForPoolType(int type) { - virStoragePoolTypeInfoPtr backend = virStoragePoolTypeInfoLookup(type); + virStoragePoolTypeInfo *backend = virStoragePoolTypeInfoLookup(type); if (backend == NULL) return NULL; return &backend->poolOptions; @@ -343,9 +340,9 @@ virStoragePoolOptionsForPoolType(int type) */ int virStoragePoolOptionsPoolTypeSetXMLNamespace(int type, - virXMLNamespacePtr ns) + virXMLNamespace *ns) { - virStoragePoolTypeInfoPtr backend = virStoragePoolTypeInfoLookup(type); + virStoragePoolTypeInfo *backend = virStoragePoolTypeInfoLookup(type); if (!backend) return -1; @@ -356,10 +353,10 @@ virStoragePoolOptionsPoolTypeSetXMLNamespace(int type, } -static virStorageVolOptionsPtr +static virStorageVolOptions * virStorageVolOptionsForPoolType(int type) { - virStoragePoolTypeInfoPtr backend = virStoragePoolTypeInfoLookup(type); + virStoragePoolTypeInfo *backend = virStoragePoolTypeInfoLookup(type); if (backend == NULL) return NULL; return &backend->volOptions; @@ -367,10 +364,10 @@ virStorageVolOptionsForPoolType(int type) int -virStoragePoolOptionsFormatPool(virBufferPtr buf, +virStoragePoolOptionsFormatPool(virBuffer *buf, int type) { - virStoragePoolOptionsPtr poolOptions; + virStoragePoolOptions *poolOptions; if (!(poolOptions = virStoragePoolOptionsForPoolType(type))) return -1; @@ -405,11 +402,11 @@ virStoragePoolOptionsFormatPool(virBufferPtr buf, int -virStoragePoolOptionsFormatVolume(virBufferPtr buf, +virStoragePoolOptionsFormatVolume(virBuffer *buf, int type) { size_t i; - virStorageVolOptionsPtr volOptions; + virStorageVolOptions *volOptions; if (!(volOptions = virStorageVolOptionsForPoolType(type))) return -1; @@ -441,7 +438,7 @@ virStoragePoolOptionsFormatVolume(virBufferPtr buf, void -virStorageVolDefFree(virStorageVolDefPtr def) +virStorageVolDefFree(virStorageVolDef *def) { size_t i; @@ -461,7 +458,7 @@ virStorageVolDefFree(virStorageVolDefPtr def) void -virStoragePoolSourceDeviceClear(virStoragePoolSourceDevicePtr dev) +virStoragePoolSourceDeviceClear(virStoragePoolSourceDevice *dev) { VIR_FREE(dev->freeExtents); VIR_FREE(dev->path); @@ -469,7 +466,7 @@ virStoragePoolSourceDeviceClear(virStoragePoolSourceDevicePtr dev) void -virStoragePoolSourceClear(virStoragePoolSourcePtr source) +virStoragePoolSourceClear(virStoragePoolSource *source) { size_t i; @@ -494,7 +491,7 @@ virStoragePoolSourceClear(virStoragePoolSourcePtr source) void -virStoragePoolSourceFree(virStoragePoolSourcePtr source) +virStoragePoolSourceFree(virStoragePoolSource *source) { virStoragePoolSourceClear(source); g_free(source); @@ -502,7 +499,7 @@ virStoragePoolSourceFree(virStoragePoolSourcePtr source) void -virStoragePoolDefFree(virStoragePoolDefPtr def) +virStoragePoolDefFree(virStoragePoolDef *def) { if (!def) return; @@ -522,7 +519,7 @@ virStoragePoolDefFree(virStoragePoolDefPtr def) static int virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, - virStoragePoolSourcePtr source, + virStoragePoolSource *source, int pool_type, xmlNodePtr node) { @@ -531,7 +528,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, xmlNodePtr adapternode; int nsource; size_t i; - virStoragePoolOptionsPtr options; + virStoragePoolOptions *options; int n; g_autoptr(virStorageAuthDef) authdef = NULL; g_autofree char *port = NULL; @@ -688,7 +685,7 @@ virStoragePoolDefParseSource(xmlXPathContextPtr ctxt, } -virStoragePoolSourcePtr +virStoragePoolSource * virStoragePoolDefParseSourceString(const char *srcSpec, int pool_type) { @@ -720,7 +717,7 @@ virStoragePoolDefParseSourceString(const char *srcSpec, static int virStorageDefParsePerms(xmlXPathContextPtr ctxt, - virStoragePermsPtr perms, + virStoragePerms *perms, const char *permxpath) { long long val; @@ -794,9 +791,9 @@ virStorageDefParsePerms(xmlXPathContextPtr ctxt, static int virStoragePoolDefRefreshParse(xmlXPathContextPtr ctxt, - virStoragePoolDefPtr def) + virStoragePoolDef *def) { - g_autofree virStoragePoolDefRefreshPtr refresh = NULL; + g_autofree virStoragePoolDefRefresh *refresh = NULL; g_autofree char *allocation = NULL; int tmp; @@ -821,8 +818,8 @@ virStoragePoolDefRefreshParse(xmlXPathContextPtr ctxt, static void -virStoragePoolDefRefreshFormat(virBufferPtr buf, - virStoragePoolDefRefreshPtr refresh) +virStoragePoolDefRefreshFormat(virBuffer *buf, + virStoragePoolDefRefresh *refresh) { if (!refresh) return; @@ -837,7 +834,7 @@ virStoragePoolDefRefreshFormat(virBufferPtr buf, static int -virStoragePoolDefParseFeatures(virStoragePoolDefPtr def, +virStoragePoolDefParseFeatures(virStoragePoolDef *def, xmlXPathContextPtr ctxt) { g_autofree char *cow = virXPathString("string(./features/cow/@state)", ctxt); @@ -863,10 +860,10 @@ virStoragePoolDefParseFeatures(virStoragePoolDefPtr def, } -virStoragePoolDefPtr +virStoragePoolDef * virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) { - virStoragePoolOptionsPtr options; + virStoragePoolOptions *options; xmlNodePtr source_node; g_autoptr(virStoragePoolDef) def = NULL; g_autofree char *type = NULL; @@ -1019,7 +1016,7 @@ virStoragePoolDefParseXML(xmlXPathContextPtr ctxt) } -virStoragePoolDefPtr +virStoragePoolDef * virStoragePoolDefParseNode(xmlDocPtr xml, xmlNodePtr root) { @@ -1041,11 +1038,11 @@ virStoragePoolDefParseNode(xmlDocPtr xml, } -static virStoragePoolDefPtr +static virStoragePoolDef * virStoragePoolDefParse(const char *xmlStr, const char *filename) { - virStoragePoolDefPtr ret = NULL; + virStoragePoolDef *ret = NULL; xmlDocPtr xml; if ((xml = virXMLParse(filename, xmlStr, _("(storage_pool_definition)")))) { @@ -1057,14 +1054,14 @@ virStoragePoolDefParse(const char *xmlStr, } -virStoragePoolDefPtr +virStoragePoolDef * virStoragePoolDefParseString(const char *xmlStr) { return virStoragePoolDefParse(xmlStr, NULL); } -virStoragePoolDefPtr +virStoragePoolDef * virStoragePoolDefParseFile(const char *filename) { return virStoragePoolDefParse(NULL, filename); @@ -1072,9 +1069,9 @@ virStoragePoolDefParseFile(const char *filename) static int -virStoragePoolSourceFormat(virBufferPtr buf, - virStoragePoolOptionsPtr options, - virStoragePoolSourcePtr src) +virStoragePoolSourceFormat(virBuffer *buf, + virStoragePoolOptions *options, + virStoragePoolSource *src) { size_t i, j; @@ -1158,8 +1155,8 @@ virStoragePoolSourceFormat(virBufferPtr buf, static void -virStoragePoolDefFormatFeatures(virBufferPtr buf, - virStoragePoolDefPtr def) +virStoragePoolDefFormatFeatures(virBuffer *buf, + virStoragePoolDef *def) { if (def->features.cow == VIR_TRISTATE_BOOL_ABSENT) return; @@ -1175,10 +1172,10 @@ virStoragePoolDefFormatFeatures(virBufferPtr buf, static int -virStoragePoolDefFormatBuf(virBufferPtr buf, - virStoragePoolDefPtr def) +virStoragePoolDefFormatBuf(virBuffer *buf, + virStoragePoolDef *def) { - virStoragePoolOptionsPtr options; + virStoragePoolOptions *options; char uuid[VIR_UUID_STRING_BUFLEN]; const char *type; @@ -1266,7 +1263,7 @@ virStoragePoolDefFormatBuf(virBufferPtr buf, char * -virStoragePoolDefFormat(virStoragePoolDefPtr def) +virStoragePoolDefFormat(virStoragePoolDef *def) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -1317,12 +1314,12 @@ virStorageCheckCompat(const char *compat) } -static virStorageVolDefPtr -virStorageVolDefParseXML(virStoragePoolDefPtr pool, +static virStorageVolDef * +virStorageVolDefParseXML(virStoragePoolDef *pool, xmlXPathContextPtr ctxt, unsigned int flags) { - virStorageVolOptionsPtr options; + virStorageVolOptions *options; xmlNodePtr node; size_t i; int n; @@ -1477,8 +1474,8 @@ virStorageVolDefParseXML(virStoragePoolDefPtr pool, } -virStorageVolDefPtr -virStorageVolDefParseNode(virStoragePoolDefPtr pool, +virStorageVolDef * +virStorageVolDefParseNode(virStoragePoolDef *pool, xmlDocPtr xml, xmlNodePtr root, unsigned int flags) @@ -1501,13 +1498,13 @@ virStorageVolDefParseNode(virStoragePoolDefPtr pool, } -static virStorageVolDefPtr -virStorageVolDefParse(virStoragePoolDefPtr pool, +static virStorageVolDef * +virStorageVolDefParse(virStoragePoolDef *pool, const char *xmlStr, const char *filename, unsigned int flags) { - virStorageVolDefPtr ret = NULL; + virStorageVolDef *ret = NULL; xmlDocPtr xml; if ((xml = virXMLParse(filename, xmlStr, _("(storage_volume_definition)")))) { @@ -1519,8 +1516,8 @@ virStorageVolDefParse(virStoragePoolDefPtr pool, } -virStorageVolDefPtr -virStorageVolDefParseString(virStoragePoolDefPtr pool, +virStorageVolDef * +virStorageVolDefParseString(virStoragePoolDef *pool, const char *xmlStr, unsigned int flags) { @@ -1528,8 +1525,8 @@ virStorageVolDefParseString(virStoragePoolDefPtr pool, } -virStorageVolDefPtr -virStorageVolDefParseFile(virStoragePoolDefPtr pool, +virStorageVolDef * +virStorageVolDefParseFile(virStoragePoolDef *pool, const char *filename, unsigned int flags) { @@ -1538,7 +1535,7 @@ virStorageVolDefParseFile(virStoragePoolDefPtr pool, static void -virStorageVolTimestampFormat(virBufferPtr buf, const char *name, +virStorageVolTimestampFormat(virBuffer *buf, const char *name, struct timespec *ts) { if (ts->tv_nsec < 0) @@ -1552,9 +1549,9 @@ virStorageVolTimestampFormat(virBufferPtr buf, const char *name, static int -virStorageVolTargetDefFormat(virStorageVolOptionsPtr options, - virBufferPtr buf, - virStorageSourcePtr def, +virStorageVolTargetDefFormat(virStorageVolOptions *options, + virBuffer *buf, + virStorageSource *def, const char *type) { virBufferAsprintf(buf, "<%s>\n", type); @@ -1644,8 +1641,8 @@ virStorageVolTargetDefFormat(virStorageVolOptionsPtr options, static void -virStorageVolDefFormatSourceExtents(virBufferPtr buf, - virStorageVolDefPtr def) +virStorageVolDefFormatSourceExtents(virBuffer *buf, + virStorageVolDef *def) { size_t i; const char *thispath = NULL; @@ -1673,10 +1670,10 @@ virStorageVolDefFormatSourceExtents(virBufferPtr buf, char * -virStorageVolDefFormat(virStoragePoolDefPtr pool, - virStorageVolDefPtr def) +virStorageVolDefFormat(virStoragePoolDef *pool, + virStorageVolDef *def) { - virStorageVolOptionsPtr options; + virStorageVolOptions *options; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) sourceChildBuf = VIR_BUFFER_INITIALIZER; @@ -1728,7 +1725,7 @@ virStorageVolDefFormat(virStoragePoolDefPtr pool, static int virStoragePoolSaveXML(const char *path, - virStoragePoolDefPtr def, + virStoragePoolDef *def, const char *xml) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -1742,7 +1739,7 @@ virStoragePoolSaveXML(const char *path, int virStoragePoolSaveState(const char *stateFile, - virStoragePoolDefPtr def) + virStoragePoolDef *def) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_autofree char *xml = NULL; @@ -1768,7 +1765,7 @@ virStoragePoolSaveState(const char *stateFile, int virStoragePoolSaveConfig(const char *configFile, - virStoragePoolDefPtr def) + virStoragePoolDef *def) { g_autofree char *xml = NULL; @@ -1782,10 +1779,10 @@ virStoragePoolSaveConfig(const char *configFile, } -virStoragePoolSourcePtr -virStoragePoolSourceListNewSource(virStoragePoolSourceListPtr list) +virStoragePoolSource * +virStoragePoolSourceListNewSource(virStoragePoolSourceList *list) { - virStoragePoolSourcePtr source; + virStoragePoolSource *source; VIR_REALLOC_N(list->sources, list->nsources + 1); @@ -1797,9 +1794,9 @@ virStoragePoolSourceListNewSource(virStoragePoolSourceListPtr list) char * -virStoragePoolSourceListFormat(virStoragePoolSourceListPtr def) +virStoragePoolSourceListFormat(virStoragePoolSourceList *def) { - virStoragePoolOptionsPtr options; + virStoragePoolOptions *options; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char *type; size_t i; diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index 647eb847bf..f083b41693 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -36,14 +36,14 @@ int virStoragePoolOptionsPoolTypeSetXMLNamespace(int type, - virXMLNamespacePtr ns); + virXMLNamespace *ns); int -virStoragePoolOptionsFormatPool(virBufferPtr buf, +virStoragePoolOptionsFormatPool(virBuffer *buf, int type); int -virStoragePoolOptionsFormatVolume(virBufferPtr buf, +virStoragePoolOptionsFormatVolume(virBuffer *buf, int type); /* * How the volume's data is stored on underlying @@ -51,7 +51,6 @@ virStoragePoolOptionsFormatVolume(virBufferPtr buf, * devices in LVM case. */ typedef struct _virStorageVolSourceExtent virStorageVolSourceExtent; -typedef virStorageVolSourceExtent *virStorageVolSourceExtentPtr; struct _virStorageVolSourceExtent { char *path; unsigned long long start; @@ -59,10 +58,9 @@ struct _virStorageVolSourceExtent { }; typedef struct _virStorageVolSource virStorageVolSource; -typedef virStorageVolSource *virStorageVolSourcePtr; struct _virStorageVolSource { size_t nextent; - virStorageVolSourceExtentPtr extents; + virStorageVolSourceExtent *extents; int partType; /* virStorageVolTypeDisk, only used by disk * backend for partition type creation */ @@ -77,7 +75,6 @@ typedef enum { VIR_ENUM_DECL(virStorageVolDefRefreshAllocation); typedef struct _virStorageVolDef virStorageVolDef; -typedef virStorageVolDef *virStorageVolDefPtr; struct _virStorageVolDef { char *name; char *key; @@ -91,7 +88,6 @@ struct _virStorageVolDef { }; typedef struct _virStorageVolDefList virStorageVolDefList; -typedef virStorageVolDefList *virStorageVolDefListPtr; VIR_ENUM_DECL(virStorageVol); @@ -128,7 +124,6 @@ typedef enum { * For remote pools, info on how to reach the host */ typedef struct _virStoragePoolSourceHost virStoragePoolSourceHost; -typedef virStoragePoolSourceHost *virStoragePoolSourceHostPtr; struct _virStoragePoolSourceHost { char *name; int port; @@ -150,7 +145,6 @@ typedef enum { * Available extents on the underlying storage */ typedef struct _virStoragePoolSourceDeviceExtent virStoragePoolSourceDeviceExtent; -typedef virStoragePoolSourceDeviceExtent *virStoragePoolSourceDeviceExtentPtr; struct _virStoragePoolSourceDeviceExtent { unsigned long long start; unsigned long long end; @@ -162,10 +156,9 @@ struct _virStoragePoolSourceDeviceExtent { * allow us to track free space on underlying devices. */ typedef struct _virStoragePoolSourceDevice virStoragePoolSourceDevice; -typedef virStoragePoolSourceDevice *virStoragePoolSourceDevicePtr; struct _virStoragePoolSourceDevice { int nfreeExtent; - virStoragePoolSourceDeviceExtentPtr freeExtents; + virStoragePoolSourceDeviceExtent *freeExtents; char *path; int format; /* Pool specific source format */ int part_separator; /* enum virTristateSwitch */ @@ -181,22 +174,20 @@ struct _virStoragePoolSourceDevice { }; typedef struct _virStoragePoolFeatures virStoragePoolFeatures; -typedef virStoragePoolFeatures *virStoragePoolFeaturesPtr; struct _virStoragePoolFeatures { virTristateBool cow; }; typedef struct _virStoragePoolSource virStoragePoolSource; -typedef virStoragePoolSource *virStoragePoolSourcePtr; struct _virStoragePoolSource { /* An optional (maybe multiple) host(s) */ size_t nhost; - virStoragePoolSourceHostPtr hosts; + virStoragePoolSourceHost *hosts; /* And either one or more devices ... */ size_t ndevice; - virStoragePoolSourceDevicePtr devices; + virStoragePoolSourceDevice *devices; /* Or a directory */ char *dir; @@ -211,7 +202,7 @@ struct _virStoragePoolSource { virStorageSourceInitiatorDef initiator; /* Authentication information */ - virStorageAuthDefPtr auth; + virStorageAuthDef *auth; /* Vendor of the source */ char *vendor; @@ -229,7 +220,6 @@ struct _virStoragePoolSource { }; typedef struct _virStoragePoolTarget virStoragePoolTarget; -typedef virStoragePoolTarget *virStoragePoolTargetPtr; struct _virStoragePoolTarget { char *path; /* Optional local filesystem mapping */ virStoragePerms perms; /* Default permissions for volumes */ @@ -237,27 +227,24 @@ struct _virStoragePoolTarget { typedef struct _virStorageVolDefRefresh virStorageVolDefRefresh; -typedef virStorageVolDefRefresh *virStorageVolDefRefreshPtr; struct _virStorageVolDefRefresh { int allocation; /* virStorageVolDefRefreshAllocation */ }; typedef struct _virStoragePoolDefRefresh virStoragePoolDefRefresh; -typedef virStoragePoolDefRefresh *virStoragePoolDefRefreshPtr; struct _virStoragePoolDefRefresh { virStorageVolDefRefresh volume; }; typedef struct _virStoragePoolDef virStoragePoolDef; -typedef virStoragePoolDef *virStoragePoolDefPtr; struct _virStoragePoolDef { char *name; unsigned char uuid[VIR_UUID_BUFLEN]; int type; /* virStoragePoolType */ - virStoragePoolDefRefreshPtr refresh; + virStoragePoolDefRefresh *refresh; unsigned long long allocation; /* bytes */ unsigned long long capacity; /* bytes */ @@ -273,28 +260,27 @@ struct _virStoragePoolDef { }; typedef struct _virStoragePoolSourceList virStoragePoolSourceList; -typedef virStoragePoolSourceList *virStoragePoolSourceListPtr; struct _virStoragePoolSourceList { int type; unsigned int nsources; - virStoragePoolSourcePtr sources; + virStoragePoolSource *sources; }; -virStoragePoolDefPtr +virStoragePoolDef * virStoragePoolDefParseXML(xmlXPathContextPtr ctxt); -virStoragePoolDefPtr +virStoragePoolDef * virStoragePoolDefParseString(const char *xml); -virStoragePoolDefPtr +virStoragePoolDef * virStoragePoolDefParseFile(const char *filename); -virStoragePoolDefPtr +virStoragePoolDef * virStoragePoolDefParseNode(xmlDocPtr xml, xmlNodePtr root); char * -virStoragePoolDefFormat(virStoragePoolDefPtr def); +virStoragePoolDefFormat(virStoragePoolDef *def); typedef enum { /* do not require volume capacity at all */ @@ -303,58 +289,58 @@ typedef enum { VIR_VOL_XML_PARSE_OPT_CAPACITY = 1 << 1, } virStorageVolDefParseFlags; -virStorageVolDefPtr -virStorageVolDefParseString(virStoragePoolDefPtr pool, +virStorageVolDef * +virStorageVolDefParseString(virStoragePoolDef *pool, const char *xml, unsigned int flags); -virStorageVolDefPtr -virStorageVolDefParseFile(virStoragePoolDefPtr pool, +virStorageVolDef * +virStorageVolDefParseFile(virStoragePoolDef *pool, const char *filename, unsigned int flags); -virStorageVolDefPtr -virStorageVolDefParseNode(virStoragePoolDefPtr pool, +virStorageVolDef * +virStorageVolDefParseNode(virStoragePoolDef *pool, xmlDocPtr xml, xmlNodePtr root, unsigned int flags); char * -virStorageVolDefFormat(virStoragePoolDefPtr pool, - virStorageVolDefPtr def); +virStorageVolDefFormat(virStoragePoolDef *pool, + virStorageVolDef *def); int virStoragePoolSaveState(const char *stateFile, - virStoragePoolDefPtr def); + virStoragePoolDef *def); int virStoragePoolSaveConfig(const char *configFile, - virStoragePoolDefPtr def); + virStoragePoolDef *def); void -virStorageVolDefFree(virStorageVolDefPtr def); +virStorageVolDefFree(virStorageVolDef *def); void -virStoragePoolSourceClear(virStoragePoolSourcePtr source); +virStoragePoolSourceClear(virStoragePoolSource *source); void -virStoragePoolSourceDeviceClear(virStoragePoolSourceDevicePtr dev); +virStoragePoolSourceDeviceClear(virStoragePoolSourceDevice *dev); void -virStoragePoolSourceFree(virStoragePoolSourcePtr source); +virStoragePoolSourceFree(virStoragePoolSource *source); void -virStoragePoolDefFree(virStoragePoolDefPtr def); +virStoragePoolDefFree(virStoragePoolDef *def); -virStoragePoolSourcePtr +virStoragePoolSource * virStoragePoolDefParseSourceString(const char *srcSpec, int pool_type); -virStoragePoolSourcePtr -virStoragePoolSourceListNewSource(virStoragePoolSourceListPtr list); +virStoragePoolSource * +virStoragePoolSourceListNewSource(virStoragePoolSourceList *list); char * -virStoragePoolSourceListFormat(virStoragePoolSourceListPtr def); +virStoragePoolSourceListFormat(virStoragePoolSourceList *def); typedef enum { VIR_STORAGE_POOL_FS_AUTO = 0, diff --git a/src/conf/storage_encryption_conf.c b/src/conf/storage_encryption_conf.c index e2ae7f7b51..c2c7c1dd43 100644 --- a/src/conf/storage_encryption_conf.c +++ b/src/conf/storage_encryption_conf.c @@ -48,7 +48,7 @@ VIR_ENUM_IMPL(virStorageEncryptionFormat, ); static void -virStorageEncryptionInfoDefClear(virStorageEncryptionInfoDefPtr def) +virStorageEncryptionInfoDefClear(virStorageEncryptionInfoDef *def) { VIR_FREE(def->cipher_name); VIR_FREE(def->cipher_mode); @@ -59,7 +59,7 @@ virStorageEncryptionInfoDefClear(virStorageEncryptionInfoDefPtr def) static void -virStorageEncryptionSecretFree(virStorageEncryptionSecretPtr secret) +virStorageEncryptionSecretFree(virStorageEncryptionSecret *secret) { if (!secret) return; @@ -68,7 +68,7 @@ virStorageEncryptionSecretFree(virStorageEncryptionSecretPtr secret) } void -virStorageEncryptionFree(virStorageEncryptionPtr enc) +virStorageEncryptionFree(virStorageEncryption *enc) { size_t i; @@ -82,10 +82,10 @@ virStorageEncryptionFree(virStorageEncryptionPtr enc) g_free(enc); } -static virStorageEncryptionSecretPtr +static virStorageEncryptionSecret * virStorageEncryptionSecretCopy(const virStorageEncryptionSecret *src) { - virStorageEncryptionSecretPtr ret = g_new0(virStorageEncryptionSecret, 1); + virStorageEncryptionSecret *ret = g_new0(virStorageEncryptionSecret, 1); ret->type = src->type; virSecretLookupDefCopy(&ret->seclookupdef, &src->seclookupdef); @@ -96,7 +96,7 @@ virStorageEncryptionSecretCopy(const virStorageEncryptionSecret *src) static int virStorageEncryptionInfoDefCopy(const virStorageEncryptionInfoDef *src, - virStorageEncryptionInfoDefPtr dst) + virStorageEncryptionInfoDef *dst) { dst->cipher_size = src->cipher_size; dst->cipher_name = g_strdup(src->cipher_name); @@ -109,15 +109,15 @@ virStorageEncryptionInfoDefCopy(const virStorageEncryptionInfoDef *src, } -virStorageEncryptionPtr +virStorageEncryption * virStorageEncryptionCopy(const virStorageEncryption *src) { - virStorageEncryptionPtr ret; + virStorageEncryption *ret; size_t i; ret = g_new0(virStorageEncryption, 1); - ret->secrets = g_new0(virStorageEncryptionSecretPtr, src->nsecrets); + ret->secrets = g_new0(virStorageEncryptionSecret *, src->nsecrets); ret->nsecrets = src->nsecrets; ret->format = src->format; @@ -136,12 +136,12 @@ virStorageEncryptionCopy(const virStorageEncryption *src) return NULL; } -static virStorageEncryptionSecretPtr +static virStorageEncryptionSecret * virStorageEncryptionSecretParse(xmlXPathContextPtr ctxt, xmlNodePtr node) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virStorageEncryptionSecretPtr ret; + virStorageEncryptionSecret *ret; g_autofree char *type_str = NULL; ret = g_new0(virStorageEncryptionSecret, 1); @@ -174,7 +174,7 @@ virStorageEncryptionSecretParse(xmlXPathContextPtr ctxt, static int virStorageEncryptionInfoParseCipher(xmlNodePtr info_node, - virStorageEncryptionInfoDefPtr info) + virStorageEncryptionInfoDef *info) { g_autofree char *size_str = NULL; @@ -207,7 +207,7 @@ virStorageEncryptionInfoParseCipher(xmlNodePtr info_node, static int virStorageEncryptionInfoParseIvgen(xmlNodePtr info_node, - virStorageEncryptionInfoDefPtr info) + virStorageEncryptionInfoDef *info) { if (!(info->ivgen_name = virXMLPropString(info_node, "name"))) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -221,14 +221,14 @@ virStorageEncryptionInfoParseIvgen(xmlNodePtr info_node, } -virStorageEncryptionPtr +virStorageEncryption * virStorageEncryptionParseNode(xmlNodePtr node, xmlXPathContextPtr ctxt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) xmlNodePtr *nodes = NULL; - virStorageEncryptionPtr encdef = NULL; - virStorageEncryptionPtr ret = NULL; + virStorageEncryption *encdef = NULL; + virStorageEncryption *ret = NULL; g_autofree char *format_str = NULL; int n; size_t i; @@ -255,7 +255,7 @@ virStorageEncryptionParseNode(xmlNodePtr node, goto cleanup; if (n > 0) { - encdef->secrets = g_new0(virStorageEncryptionSecretPtr, n); + encdef->secrets = g_new0(virStorageEncryptionSecret *, n); encdef->nsecrets = n; for (i = 0; i < n; i++) { @@ -297,8 +297,8 @@ virStorageEncryptionParseNode(xmlNodePtr node, static int -virStorageEncryptionSecretFormat(virBufferPtr buf, - virStorageEncryptionSecretPtr secret) +virStorageEncryptionSecretFormat(virBuffer *buf, + virStorageEncryptionSecret *secret) { const char *type; @@ -315,7 +315,7 @@ virStorageEncryptionSecretFormat(virBufferPtr buf, static void -virStorageEncryptionInfoDefFormat(virBufferPtr buf, +virStorageEncryptionInfoDefFormat(virBuffer *buf, const virStorageEncryptionInfoDef *enc) { virBufferEscapeString(buf, "cipher_name); @@ -336,8 +336,8 @@ virStorageEncryptionInfoDefFormat(virBufferPtr buf, int -virStorageEncryptionFormat(virBufferPtr buf, - virStorageEncryptionPtr enc) +virStorageEncryptionFormat(virBuffer *buf, + virStorageEncryption *enc) { const char *format; size_t i; diff --git a/src/conf/storage_encryption_conf.h b/src/conf/storage_encryption_conf.h index 0799421763..34adbd5f7b 100644 --- a/src/conf/storage_encryption_conf.h +++ b/src/conf/storage_encryption_conf.h @@ -35,7 +35,6 @@ typedef enum { VIR_ENUM_DECL(virStorageEncryptionSecret); typedef struct _virStorageEncryptionSecret virStorageEncryptionSecret; -typedef virStorageEncryptionSecret *virStorageEncryptionSecretPtr; struct _virStorageEncryptionSecret { int type; /* virStorageEncryptionSecretType */ virSecretLookupTypeDef seclookupdef; @@ -43,7 +42,6 @@ struct _virStorageEncryptionSecret { /* It's possible to dictate the cipher and if necessary iv */ typedef struct _virStorageEncryptionInfoDef virStorageEncryptionInfoDef; -typedef virStorageEncryptionInfoDef *virStorageEncryptionInfoDefPtr; struct _virStorageEncryptionInfoDef { unsigned int cipher_size; char *cipher_name; @@ -64,27 +62,26 @@ typedef enum { VIR_ENUM_DECL(virStorageEncryptionFormat); typedef struct _virStorageEncryption virStorageEncryption; -typedef virStorageEncryption *virStorageEncryptionPtr; struct _virStorageEncryption { int format; /* virStorageEncryptionFormatType */ int payload_offset; size_t nsecrets; - virStorageEncryptionSecretPtr *secrets; + virStorageEncryptionSecret **secrets; virStorageEncryptionInfoDef encinfo; }; -virStorageEncryptionPtr virStorageEncryptionCopy(const virStorageEncryption *src) +virStorageEncryption *virStorageEncryptionCopy(const virStorageEncryption *src) ATTRIBUTE_NONNULL(1); -void virStorageEncryptionFree(virStorageEncryptionPtr enc); +void virStorageEncryptionFree(virStorageEncryption *enc); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageEncryption, virStorageEncryptionFree); -virStorageEncryptionPtr virStorageEncryptionParseNode(xmlNodePtr node, +virStorageEncryption *virStorageEncryptionParseNode(xmlNodePtr node, xmlXPathContextPtr ctxt); -int virStorageEncryptionFormat(virBufferPtr buf, - virStorageEncryptionPtr enc); +int virStorageEncryptionFormat(virBuffer *buf, + virStorageEncryption *enc); /* A helper for VIR_STORAGE_ENCRYPTION_FORMAT_QCOW */ enum { diff --git a/src/conf/storage_event.c b/src/conf/storage_event.c index de36ec3af9..1ffe6e53f5 100644 --- a/src/conf/storage_event.c +++ b/src/conf/storage_event.c @@ -37,7 +37,6 @@ struct _virStoragePoolEvent { bool dummy; }; typedef struct _virStoragePoolEvent virStoragePoolEvent; -typedef virStoragePoolEvent *virStoragePoolEventPtr; struct _virStoragePoolEventLifecycle { virStoragePoolEvent parent; @@ -46,7 +45,6 @@ struct _virStoragePoolEventLifecycle { int detail; }; typedef struct _virStoragePoolEventLifecycle virStoragePoolEventLifecycle; -typedef virStoragePoolEventLifecycle *virStoragePoolEventLifecyclePtr; struct _virStoragePoolEventRefresh { virStoragePoolEvent parent; @@ -54,11 +52,10 @@ struct _virStoragePoolEventRefresh { bool dummy; }; typedef struct _virStoragePoolEventRefresh virStoragePoolEventRefresh; -typedef virStoragePoolEventRefresh *virStoragePoolEventRefreshPtr; -static virClassPtr virStoragePoolEventClass; -static virClassPtr virStoragePoolEventLifecycleClass; -static virClassPtr virStoragePoolEventRefreshClass; +static virClass *virStoragePoolEventClass; +static virClass *virStoragePoolEventLifecycleClass; +static virClass *virStoragePoolEventRefreshClass; static void virStoragePoolEventDispose(void *obj); static void virStoragePoolEventLifecycleDispose(void *obj); static void virStoragePoolEventRefreshDispose(void *obj); @@ -83,7 +80,7 @@ VIR_ONCE_GLOBAL_INIT(virStoragePoolEvents); static void virStoragePoolEventDispose(void *obj) { - virStoragePoolEventPtr event = obj; + virStoragePoolEvent *event = obj; VIR_DEBUG("obj=%p", event); } @@ -91,7 +88,7 @@ virStoragePoolEventDispose(void *obj) static void virStoragePoolEventLifecycleDispose(void *obj) { - virStoragePoolEventLifecyclePtr event = obj; + virStoragePoolEventLifecycle *event = obj; VIR_DEBUG("obj=%p", event); } @@ -99,14 +96,14 @@ virStoragePoolEventLifecycleDispose(void *obj) static void virStoragePoolEventRefreshDispose(void *obj) { - virStoragePoolEventRefreshPtr event = obj; + virStoragePoolEventRefresh *event = obj; VIR_DEBUG("obj=%p", event); } static void virStoragePoolEventDispatchDefaultFunc(virConnectPtr conn, - virObjectEventPtr event, + virObjectEvent *event, virConnectObjectEventGenericCallback cb, void *cbopaque) { @@ -120,9 +117,9 @@ virStoragePoolEventDispatchDefaultFunc(virConnectPtr conn, switch ((virStoragePoolEventID)event->eventID) { case VIR_STORAGE_POOL_EVENT_ID_LIFECYCLE: { - virStoragePoolEventLifecyclePtr storagePoolLifecycleEvent; + virStoragePoolEventLifecycle *storagePoolLifecycleEvent; - storagePoolLifecycleEvent = (virStoragePoolEventLifecyclePtr)event; + storagePoolLifecycleEvent = (virStoragePoolEventLifecycle *)event; ((virConnectStoragePoolEventLifecycleCallback)cb)(conn, pool, storagePoolLifecycleEvent->type, storagePoolLifecycleEvent->detail, @@ -166,7 +163,7 @@ virStoragePoolEventDispatchDefaultFunc(virConnectPtr conn, */ int virStoragePoolEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virStoragePoolPtr pool, int eventID, virConnectStoragePoolEventGenericCallback cb, @@ -210,7 +207,7 @@ virStoragePoolEventStateRegisterID(virConnectPtr conn, */ int virStoragePoolEventStateRegisterClient(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virStoragePoolPtr pool, int eventID, virConnectStoragePoolEventGenericCallback cb, @@ -243,13 +240,13 @@ virStoragePoolEventStateRegisterClient(virConnectPtr conn, * * Create a new storage pool lifecycle event. */ -virObjectEventPtr +virObjectEvent * virStoragePoolEventLifecycleNew(const char *name, const unsigned char *uuid, int type, int detail) { - virStoragePoolEventLifecyclePtr event; + virStoragePoolEventLifecycle *event; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (virStoragePoolEventsInitialize() < 0) @@ -265,7 +262,7 @@ virStoragePoolEventLifecycleNew(const char *name, event->type = type; event->detail = detail; - return (virObjectEventPtr)event; + return (virObjectEvent *)event; } @@ -276,11 +273,11 @@ virStoragePoolEventLifecycleNew(const char *name, * * Create a new storage pool refresh event. */ -virObjectEventPtr +virObjectEvent * virStoragePoolEventRefreshNew(const char *name, const unsigned char *uuid) { - virStoragePoolEventRefreshPtr event; + virStoragePoolEventRefresh *event; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (virStoragePoolEventsInitialize() < 0) @@ -293,5 +290,5 @@ virStoragePoolEventRefreshNew(const char *name, 0, name, uuid, uuidstr))) return NULL; - return (virObjectEventPtr)event; + return (virObjectEvent *)event; } diff --git a/src/conf/storage_event.h b/src/conf/storage_event.h index 3e67ad5ccf..8a62785798 100644 --- a/src/conf/storage_event.h +++ b/src/conf/storage_event.h @@ -28,7 +28,7 @@ int virStoragePoolEventStateRegisterID(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virStoragePoolPtr pool, int eventID, virConnectStoragePoolEventGenericCallback cb, @@ -40,7 +40,7 @@ virStoragePoolEventStateRegisterID(virConnectPtr conn, int virStoragePoolEventStateRegisterClient(virConnectPtr conn, - virObjectEventStatePtr state, + virObjectEventState *state, virStoragePoolPtr pool, int eventID, virConnectStoragePoolEventGenericCallback cb, @@ -50,12 +50,12 @@ virStoragePoolEventStateRegisterClient(virConnectPtr conn, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(8); -virObjectEventPtr +virObjectEvent * virStoragePoolEventLifecycleNew(const char *name, const unsigned char *uuid, int type, int detail); -virObjectEventPtr +virObjectEvent * virStoragePoolEventRefreshNew(const char *name, const unsigned char *uuid); diff --git a/src/conf/storage_source_conf.c b/src/conf/storage_source_conf.c index 67c3aedefb..05939181d6 100644 --- a/src/conf/storage_source_conf.c +++ b/src/conf/storage_source_conf.c @@ -34,7 +34,7 @@ VIR_LOG_INIT("conf.storage_source_conf"); -static virClassPtr virStorageSourceClass; +static virClass *virStorageSourceClass; VIR_ENUM_IMPL(virStorage, @@ -138,7 +138,7 @@ virStorageSourceHasBacking(const virStorageSource *src) void -virStorageNetHostDefClear(virStorageNetHostDefPtr def) +virStorageNetHostDefClear(virStorageNetHostDef *def) { if (!def) return; @@ -150,7 +150,7 @@ virStorageNetHostDefClear(virStorageNetHostDefPtr def) void virStorageNetHostDefFree(size_t nhosts, - virStorageNetHostDefPtr hosts) + virStorageNetHostDef *hosts) { size_t i; @@ -165,7 +165,7 @@ virStorageNetHostDefFree(size_t nhosts, static void -virStoragePermsFree(virStoragePermsPtr def) +virStoragePermsFree(virStoragePerms *def) { if (!def) return; @@ -175,18 +175,18 @@ virStoragePermsFree(virStoragePermsPtr def) } -virStorageNetHostDefPtr +virStorageNetHostDef * virStorageNetHostDefCopy(size_t nhosts, - virStorageNetHostDefPtr hosts) + virStorageNetHostDef *hosts) { - virStorageNetHostDefPtr ret = NULL; + virStorageNetHostDef *ret = NULL; size_t i; ret = g_new0(virStorageNetHostDef, nhosts); for (i = 0; i < nhosts; i++) { - virStorageNetHostDefPtr src = &hosts[i]; - virStorageNetHostDefPtr dst = &ret[i]; + virStorageNetHostDef *src = &hosts[i]; + virStorageNetHostDef *dst = &ret[i]; dst->transport = src->transport; dst->port = src->port; @@ -200,7 +200,7 @@ virStorageNetHostDefCopy(size_t nhosts, void -virStorageAuthDefFree(virStorageAuthDefPtr authdef) +virStorageAuthDefFree(virStorageAuthDef *authdef) { if (!authdef) return; @@ -212,7 +212,7 @@ virStorageAuthDefFree(virStorageAuthDefPtr authdef) } -virStorageAuthDefPtr +virStorageAuthDef * virStorageAuthDefCopy(const virStorageAuthDef *src) { g_autoptr(virStorageAuthDef) authdef = NULL; @@ -230,12 +230,12 @@ virStorageAuthDefCopy(const virStorageAuthDef *src) } -virStorageAuthDefPtr +virStorageAuthDef * virStorageAuthDefParse(xmlNodePtr node, xmlXPathContextPtr ctxt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virStorageAuthDefPtr ret = NULL; + virStorageAuthDef *ret = NULL; xmlNodePtr secretnode = NULL; g_autoptr(virStorageAuthDef) authdef = NULL; g_autofree char *authtype = NULL; @@ -290,8 +290,8 @@ virStorageAuthDefParse(xmlNodePtr node, void -virStorageAuthDefFormat(virBufferPtr buf, - virStorageAuthDefPtr authdef) +virStorageAuthDefFormat(virBuffer *buf, + virStorageAuthDef *authdef) { if (authdef->authType == VIR_STORAGE_AUTH_TYPE_NONE) { virBufferEscapeString(buf, "\n", authdef->username); @@ -310,7 +310,7 @@ virStorageAuthDefFormat(virBufferPtr buf, void -virStoragePRDefFree(virStoragePRDefPtr prd) +virStoragePRDefFree(virStoragePRDef *prd) { if (!prd) return; @@ -321,11 +321,11 @@ virStoragePRDefFree(virStoragePRDefPtr prd) } -virStoragePRDefPtr +virStoragePRDef * virStoragePRDefParseXML(xmlXPathContextPtr ctxt) { - virStoragePRDefPtr prd; - virStoragePRDefPtr ret = NULL; + virStoragePRDef *prd; + virStoragePRDef *ret = NULL; g_autofree char *managed = NULL; g_autofree char *type = NULL; g_autofree char *path = NULL; @@ -393,8 +393,8 @@ virStoragePRDefParseXML(xmlXPathContextPtr ctxt) void -virStoragePRDefFormat(virBufferPtr buf, - virStoragePRDefPtr prd, +virStoragePRDefFormat(virBuffer *buf, + virStoragePRDef *prd, bool migratable) { virBufferAsprintf(buf, "managed == VIR_TRISTATE_BOOL_YES; } bool -virStorageSourceChainHasManagedPR(virStorageSourcePtr src) +virStorageSourceChainHasManagedPR(virStorageSource *src) { - virStorageSourcePtr n; + virStorageSource *n; for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) { if (virStoragePRDefIsManaged(n->pr)) @@ -453,11 +453,11 @@ virStorageSourceChainHasManagedPR(virStorageSourcePtr src) } -static virStoragePRDefPtr -virStoragePRDefCopy(virStoragePRDefPtr src) +static virStoragePRDef * +virStoragePRDefCopy(virStoragePRDef *src) { - virStoragePRDefPtr copy = NULL; - virStoragePRDefPtr ret = NULL; + virStoragePRDef *copy = NULL; + virStoragePRDef *ret = NULL; copy = g_new0(virStoragePRDef, 1); @@ -473,10 +473,10 @@ virStoragePRDefCopy(virStoragePRDefPtr src) } -static virStorageSourceNVMeDefPtr +static virStorageSourceNVMeDef * virStorageSourceNVMeDefCopy(const virStorageSourceNVMeDef *src) { - virStorageSourceNVMeDefPtr ret = NULL; + virStorageSourceNVMeDef *ret = NULL; ret = g_new0(virStorageSourceNVMeDef, 1); @@ -507,7 +507,7 @@ virStorageSourceNVMeDefIsEqual(const virStorageSourceNVMeDef *a, void -virStorageSourceNVMeDefFree(virStorageSourceNVMeDefPtr def) +virStorageSourceNVMeDefFree(virStorageSourceNVMeDef *def) { if (!def) return; @@ -530,8 +530,8 @@ virStorageSourceChainHasNVMe(const virStorageSource *src) } -virSecurityDeviceLabelDefPtr -virStorageSourceGetSecurityLabelDef(virStorageSourcePtr src, +virSecurityDeviceLabelDef * +virStorageSourceGetSecurityLabelDef(virStorageSource *src, const char *model) { size_t i; @@ -546,7 +546,7 @@ virStorageSourceGetSecurityLabelDef(virStorageSourcePtr src, static void -virStorageSourceSeclabelsClear(virStorageSourcePtr def) +virStorageSourceSeclabelsClear(virStorageSource *def) { size_t i; @@ -559,7 +559,7 @@ virStorageSourceSeclabelsClear(virStorageSourcePtr def) static int -virStorageSourceSeclabelsCopy(virStorageSourcePtr to, +virStorageSourceSeclabelsCopy(virStorageSource *to, const virStorageSource *from) { size_t i; @@ -567,7 +567,7 @@ virStorageSourceSeclabelsCopy(virStorageSourcePtr to, if (from->nseclabels == 0) return 0; - to->seclabels = g_new0(virSecurityDeviceLabelDefPtr, from->nseclabels); + to->seclabels = g_new0(virSecurityDeviceLabelDef *, from->nseclabels); to->nseclabels = from->nseclabels; for (i = 0; i < to->nseclabels; i++) { @@ -584,7 +584,7 @@ virStorageSourceSeclabelsCopy(virStorageSourcePtr to, void -virStorageNetCookieDefFree(virStorageNetCookieDefPtr def) +virStorageNetCookieDefFree(virStorageNetCookieDef *def) { if (!def) return; @@ -597,7 +597,7 @@ virStorageNetCookieDefFree(virStorageNetCookieDefPtr def) static void -virStorageSourceNetCookiesClear(virStorageSourcePtr src) +virStorageSourceNetCookiesClear(virStorageSource *src) { size_t i; @@ -613,7 +613,7 @@ virStorageSourceNetCookiesClear(virStorageSourcePtr src) static void -virStorageSourceNetCookiesCopy(virStorageSourcePtr to, +virStorageSourceNetCookiesCopy(virStorageSource *to, const virStorageSource *from) { size_t i; @@ -621,7 +621,7 @@ virStorageSourceNetCookiesCopy(virStorageSourcePtr to, if (from->ncookies == 0) return; - to->cookies = g_new0(virStorageNetCookieDefPtr, from->ncookies); + to->cookies = g_new0(virStorageNetCookieDef *, from->ncookies); to->ncookies = from->ncookies; for (i = 0; i < from->ncookies; i++) { @@ -642,7 +642,7 @@ static const char virStorageSourceCookieNameInvalidChars[] = "()<>@:/[]?={}"; static int -virStorageSourceNetCookieValidate(virStorageNetCookieDefPtr def) +virStorageSourceNetCookieValidate(virStorageNetCookieDef *def) { g_autofree char *val = g_strdup(def->value); const char *checkval = val; @@ -690,7 +690,7 @@ virStorageSourceNetCookieValidate(virStorageNetCookieDefPtr def) int -virStorageSourceNetCookiesValidate(virStorageSourcePtr src) +virStorageSourceNetCookiesValidate(virStorageSource *src) { size_t i; size_t j; @@ -712,10 +712,10 @@ virStorageSourceNetCookiesValidate(virStorageSourcePtr src) } -static virStorageTimestampsPtr +static virStorageTimestamps * virStorageTimestampsCopy(const virStorageTimestamps *src) { - virStorageTimestampsPtr ret; + virStorageTimestamps *ret; ret = g_new0(virStorageTimestamps, 1); @@ -725,10 +725,10 @@ virStorageTimestampsCopy(const virStorageTimestamps *src) } -static virStoragePermsPtr +static virStoragePerms * virStoragePermsCopy(const virStoragePerms *src) { - virStoragePermsPtr ret; + virStoragePerms *ret; ret = g_new0(virStoragePerms, 1); @@ -742,10 +742,10 @@ virStoragePermsCopy(const virStoragePerms *src) } -static virStorageSourcePoolDefPtr +static virStorageSourcePoolDef * virStorageSourcePoolDefCopy(const virStorageSourcePoolDef *src) { - virStorageSourcePoolDefPtr ret; + virStorageSourcePoolDef *ret; ret = g_new0(virStorageSourcePoolDef, 1); @@ -761,10 +761,10 @@ virStorageSourcePoolDefCopy(const virStorageSourcePoolDef *src) } -static virStorageSourceSlicePtr +static virStorageSourceSlice * virStorageSourceSliceCopy(const virStorageSourceSlice *src) { - virStorageSourceSlicePtr ret = g_new0(virStorageSourceSlice, 1); + virStorageSourceSlice *ret = g_new0(virStorageSourceSlice, 1); ret->offset = src->offset; ret->size = src->size; @@ -775,7 +775,7 @@ virStorageSourceSliceCopy(const virStorageSourceSlice *src) static void -virStorageSourceSliceFree(virStorageSourceSlicePtr slice) +virStorageSourceSliceFree(virStorageSourceSlice *slice) { if (!slice) return; @@ -786,7 +786,7 @@ virStorageSourceSliceFree(virStorageSourceSlicePtr slice) /** - * virStorageSourcePtr: + * virStorageSource *: * * Deep-copies a virStorageSource structure. If @backing chain is true * then also copies the backing chain recursively, otherwise just @@ -794,7 +794,7 @@ virStorageSourceSliceFree(virStorageSourceSlicePtr slice) * storage driver access structure and thus the struct needs to be initialized * separately. */ -virStorageSourcePtr +virStorageSource * virStorageSourceCopy(const virStorageSource *src, bool backingChain) { @@ -915,8 +915,8 @@ virStorageSourceCopy(const virStorageSource *src, * This does not compare any other configuration option */ bool -virStorageSourceIsSameLocation(virStorageSourcePtr a, - virStorageSourcePtr b) +virStorageSourceIsSameLocation(virStorageSource *a, + virStorageSource *b) { size_t i; @@ -971,8 +971,8 @@ virStorageSourceIsSameLocation(virStorageSourcePtr a, * Returns 0 on success, -1 on error. */ int -virStorageSourceInitChainElement(virStorageSourcePtr newelem, - virStorageSourcePtr old, +virStorageSourceInitChainElement(virStorageSource *newelem, + virStorageSource *old, bool transferLabels) { if (transferLabels && @@ -988,7 +988,7 @@ virStorageSourceInitChainElement(virStorageSourcePtr newelem, void -virStorageSourcePoolDefFree(virStorageSourcePoolDefPtr def) +virStorageSourcePoolDefFree(virStorageSourcePoolDef *def) { if (!def) return; @@ -1055,7 +1055,7 @@ virStorageSourceIsLocalStorage(const virStorageSource *src) * (such as an empty cdrom drive). */ bool -virStorageSourceIsEmpty(virStorageSourcePtr src) +virStorageSourceIsEmpty(virStorageSource *src) { if (virStorageSourceIsLocalStorage(src) && !src->path) return true; @@ -1093,7 +1093,7 @@ virStorageSourceIsBlockLocal(const virStorageSource *src) * Clears information about backing store of the current storage file. */ void -virStorageSourceBackingStoreClear(virStorageSourcePtr def) +virStorageSourceBackingStoreClear(virStorageSource *def) { if (!def) return; @@ -1108,7 +1108,7 @@ virStorageSourceBackingStoreClear(virStorageSourcePtr def) void -virStorageSourceClear(virStorageSourcePtr def) +virStorageSourceClear(virStorageSource *def) { if (!def) return; @@ -1161,7 +1161,7 @@ virStorageSourceClear(virStorageSourcePtr def) static void virStorageSourceDispose(void *obj) { - virStorageSourcePtr src = obj; + virStorageSource *src = obj; virStorageSourceClear(src); } @@ -1180,10 +1180,10 @@ virStorageSourceOnceInit(void) VIR_ONCE_GLOBAL_INIT(virStorageSource); -virStorageSourcePtr +virStorageSource * virStorageSourceNew(void) { - virStorageSourcePtr ret; + virStorageSource *ret; if (virStorageSourceInitialize() < 0) abort(); @@ -1202,7 +1202,7 @@ virStorageSourceNew(void) * Returns true if given storage source definition is a relative path. */ bool -virStorageSourceIsRelative(virStorageSourcePtr src) +virStorageSourceIsRelative(virStorageSource *src) { virStorageType actual_type = virStorageSourceGetActualType(src); @@ -1283,7 +1283,7 @@ virStorageSourceNetworkDefaultPort(virStorageNetProtocol protocol) void -virStorageSourceNetworkAssignDefaultPorts(virStorageSourcePtr src) +virStorageSourceNetworkAssignDefaultPorts(virStorageSource *src) { size_t i; @@ -1297,7 +1297,7 @@ virStorageSourceNetworkAssignDefaultPorts(virStorageSourcePtr src) int virStorageSourcePrivateDataParseRelPath(xmlXPathContextPtr ctxt, - virStorageSourcePtr src) + virStorageSource *src) { src->relPath = virXPathString("string(./relPath)", ctxt); return 0; @@ -1305,8 +1305,8 @@ virStorageSourcePrivateDataParseRelPath(xmlXPathContextPtr ctxt, int -virStorageSourcePrivateDataFormatRelPath(virStorageSourcePtr src, - virBufferPtr buf) +virStorageSourcePrivateDataFormatRelPath(virStorageSource *src, + virBuffer *buf) { if (src->relPath) virBufferEscapeString(buf, "%s\n", src->relPath); @@ -1317,15 +1317,15 @@ virStorageSourcePrivateDataFormatRelPath(virStorageSourcePtr src, void virStorageSourceInitiatorParseXML(xmlXPathContextPtr ctxt, - virStorageSourceInitiatorDefPtr initiator) + virStorageSourceInitiatorDef *initiator) { initiator->iqn = virXPathString("string(./initiator/iqn/@name)", ctxt); } void -virStorageSourceInitiatorFormatXML(virStorageSourceInitiatorDefPtr initiator, - virBufferPtr buf) +virStorageSourceInitiatorFormatXML(virStorageSourceInitiatorDef *initiator, + virBuffer *buf) { if (!initiator->iqn) return; @@ -1339,7 +1339,7 @@ virStorageSourceInitiatorFormatXML(virStorageSourceInitiatorDefPtr initiator, int -virStorageSourceInitiatorCopy(virStorageSourceInitiatorDefPtr dest, +virStorageSourceInitiatorCopy(virStorageSourceInitiatorDef *dest, const virStorageSourceInitiatorDef *src) { dest->iqn = g_strdup(src->iqn); @@ -1348,7 +1348,7 @@ virStorageSourceInitiatorCopy(virStorageSourceInitiatorDefPtr dest, void -virStorageSourceInitiatorClear(virStorageSourceInitiatorDefPtr initiator) +virStorageSourceInitiatorClear(virStorageSourceInitiatorDef *initiator) { VIR_FREE(initiator->iqn); } diff --git a/src/conf/storage_source_conf.h b/src/conf/storage_source_conf.h index f42bb1c67d..b388cb5497 100644 --- a/src/conf/storage_source_conf.h +++ b/src/conf/storage_source_conf.h @@ -94,7 +94,6 @@ VIR_ENUM_DECL(virStorageFileFeature); typedef struct _virStoragePerms virStoragePerms; -typedef virStoragePerms *virStoragePermsPtr; struct _virStoragePerms { mode_t mode; uid_t uid; @@ -104,7 +103,6 @@ struct _virStoragePerms { typedef struct _virStorageTimestamps virStorageTimestamps; -typedef virStorageTimestamps *virStorageTimestampsPtr; struct _virStorageTimestamps { struct timespec atime; struct timespec btime; /* birth time unknown if btime.tv_nsec == -1 */ @@ -148,7 +146,6 @@ VIR_ENUM_DECL(virStorageNetHostTransport); typedef struct _virStorageNetHostDef virStorageNetHostDef; -typedef virStorageNetHostDef *virStorageNetHostDefPtr; struct _virStorageNetHostDef { char *name; unsigned int port; @@ -158,7 +155,6 @@ struct _virStorageNetHostDef { typedef struct _virStorageNetCookieDef virStorageNetCookieDef; -typedef virStorageNetCookieDef *virStorageNetCookieDefPtr; struct _virStorageNetCookieDef { char *name; char *value; @@ -166,7 +162,7 @@ struct _virStorageNetCookieDef { void -virStorageNetCookieDefFree(virStorageNetCookieDefPtr def); +virStorageNetCookieDefFree(virStorageNetCookieDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageNetCookieDef, virStorageNetCookieDefFree); @@ -197,7 +193,6 @@ VIR_ENUM_DECL(virStorageSourcePoolMode); typedef struct _virStorageSourcePoolDef virStorageSourcePoolDef; -typedef virStorageSourcePoolDef *virStorageSourcePoolDefPtr; struct _virStorageSourcePoolDef { char *pool; /* pool name */ char *volume; /* volume name */ @@ -220,7 +215,6 @@ VIR_ENUM_DECL(virStorageAuth); typedef struct _virStorageAuthDef virStorageAuthDef; -typedef virStorageAuthDef *virStorageAuthDefPtr; struct _virStorageAuthDef { char *username; char *secrettype; /* path); g_free(priv); @@ -237,7 +236,7 @@ static void virChrdevFDStreamCloseCbFree(void *opaque) static void virChrdevFDStreamCloseCb(virStreamPtr st G_GNUC_UNUSED, void *opaque) { - virChrdevStreamInfoPtr priv = opaque; + virChrdevStreamInfo *priv = opaque; virMutexLock(&priv->devs->lock); /* remove entry from hash */ @@ -252,9 +251,9 @@ static void virChrdevFDStreamCloseCb(virStreamPtr st G_GNUC_UNUSED, * * Returns pointer to the allocated structure or NULL on error */ -virChrdevsPtr virChrdevAlloc(void) +virChrdevs *virChrdevAlloc(void) { - virChrdevsPtr devs; + virChrdevs *devs; devs = g_new0(virChrdevs, 1); if (virMutexInit(&devs->lock) < 0) { @@ -293,7 +292,7 @@ static int virChrdevFreeClearCallbacks(void *payload, * * @devs Pointer to the private structure. */ -void virChrdevFree(virChrdevsPtr devs) +void virChrdevFree(virChrdevs *devs) { if (!devs) return; @@ -323,12 +322,12 @@ void virChrdevFree(virChrdevsPtr devs) * corresponding lock file is created (if configured). Returns -1 on * error and 1 if the device stream is open and busy. */ -int virChrdevOpen(virChrdevsPtr devs, - virDomainChrSourceDefPtr source, +int virChrdevOpen(virChrdevs *devs, + virDomainChrSourceDef *source, virStreamPtr st, bool force) { - virChrdevStreamInfoPtr cbdata = NULL; + virChrdevStreamInfo *cbdata = NULL; virChrdevHashEntry *ent; char *path; int ret; diff --git a/src/conf/virchrdev.h b/src/conf/virchrdev.h index e218ea7203..54fd110ab0 100644 --- a/src/conf/virchrdev.h +++ b/src/conf/virchrdev.h @@ -25,10 +25,9 @@ #include "domain_conf.h" typedef struct _virChrdevs virChrdevs; -typedef virChrdevs *virChrdevsPtr; -virChrdevsPtr virChrdevAlloc(void); -void virChrdevFree(virChrdevsPtr devs); +virChrdevs *virChrdevAlloc(void); +void virChrdevFree(virChrdevs *devs); -int virChrdevOpen(virChrdevsPtr devs, virDomainChrSourceDefPtr source, +int virChrdevOpen(virChrdevs *devs, virDomainChrSourceDef *source, virStreamPtr st, bool force); diff --git a/src/conf/virconftypes.h b/src/conf/virconftypes.h index 4658d0de9c..ff5d8145c3 100644 --- a/src/conf/virconftypes.h +++ b/src/conf/virconftypes.h @@ -25,343 +25,229 @@ /* forward declarations of various types required in src/conf */ typedef struct _virBlkioDevice virBlkioDevice; -typedef virBlkioDevice *virBlkioDevicePtr; typedef struct _virCaps virCaps; -typedef virCaps *virCapsPtr; typedef struct _virCapsDomainData virCapsDomainData; -typedef virCapsDomainData *virCapsDomainDataPtr; typedef struct _virCapsGuest virCapsGuest; -typedef virCapsGuest *virCapsGuestPtr; typedef struct _virCapsGuestArch virCapsGuestArch; -typedef virCapsGuestArch *virCapsGuestArchPtr; typedef struct _virCapsGuestDomain virCapsGuestDomain; -typedef virCapsGuestDomain *virCapsGuestDomainPtr; typedef struct _virCapsGuestDomainInfo virCapsGuestDomainInfo; -typedef virCapsGuestDomainInfo *virCapsGuestDomainInfoPtr; typedef struct _virCapsGuestFeature virCapsGuestFeature; -typedef virCapsGuestFeature *virCapsGuestFeaturePtr; typedef struct _virCapsGuestMachine virCapsGuestMachine; -typedef virCapsGuestMachine *virCapsGuestMachinePtr; typedef struct _virCapsHost virCapsHost; -typedef virCapsHost *virCapsHostPtr; typedef struct _virCapsHostCache virCapsHostCache; -typedef virCapsHostCache *virCapsHostCachePtr; typedef struct _virCapsHostCacheBank virCapsHostCacheBank; -typedef virCapsHostCacheBank *virCapsHostCacheBankPtr; typedef struct _virCapsHostMemBW virCapsHostMemBW; -typedef virCapsHostMemBW *virCapsHostMemBWPtr; typedef struct _virCapsHostMemBWNode virCapsHostMemBWNode; -typedef virCapsHostMemBWNode *virCapsHostMemBWNodePtr; typedef struct _virCapsHostNUMA virCapsHostNUMA; -typedef virCapsHostNUMA *virCapsHostNUMAPtr; typedef struct _virCapsHostNUMACell virCapsHostNUMACell; -typedef virCapsHostNUMACell *virCapsHostNUMACellPtr; typedef struct _virCapsHostNUMACellCPU virCapsHostNUMACellCPU; -typedef virCapsHostNUMACellCPU *virCapsHostNUMACellCPUPtr; typedef struct _virCapsHostNUMACellPageInfo virCapsHostNUMACellPageInfo; -typedef virCapsHostNUMACellPageInfo *virCapsHostNUMACellPageInfoPtr; typedef struct _virCapsHostNUMACellSiblingInfo virCapsHostNUMACellSiblingInfo; -typedef virCapsHostNUMACellSiblingInfo *virCapsHostNUMACellSiblingInfoPtr; typedef struct _virCapsHostSecModel virCapsHostSecModel; -typedef virCapsHostSecModel *virCapsHostSecModelPtr; typedef struct _virCapsHostSecModelLabel virCapsHostSecModelLabel; -typedef virCapsHostSecModelLabel *virCapsHostSecModelLabelPtr; typedef struct _virCapsStoragePool virCapsStoragePool; -typedef virCapsStoragePool *virCapsStoragePoolPtr; typedef struct _virDomainABIStability virDomainABIStability; -typedef virDomainABIStability *virDomainABIStabilityPtr; typedef struct _virDomainActualNetDef virDomainActualNetDef; -typedef virDomainActualNetDef *virDomainActualNetDefPtr; typedef struct _virDomainBackupDef virDomainBackupDef; -typedef virDomainBackupDef *virDomainBackupDefPtr; typedef struct _virDomainBIOSDef virDomainBIOSDef; -typedef virDomainBIOSDef *virDomainBIOSDefPtr; typedef struct _virDomainBlkiotune virDomainBlkiotune; -typedef virDomainBlkiotune *virDomainBlkiotunePtr; typedef struct _virDomainBlockIoTuneInfo virDomainBlockIoTuneInfo; -typedef virDomainBlockIoTuneInfo *virDomainBlockIoTuneInfoPtr; typedef struct _virDomainCheckpointDef virDomainCheckpointDef; -typedef virDomainCheckpointDef *virDomainCheckpointDefPtr; typedef struct _virDomainCheckpointObj virDomainCheckpointObj; -typedef virDomainCheckpointObj *virDomainCheckpointObjPtr; typedef struct _virDomainCheckpointObjList virDomainCheckpointObjList; -typedef virDomainCheckpointObjList *virDomainCheckpointObjListPtr; typedef struct _virDomainChrDef virDomainChrDef; -typedef virDomainChrDef *virDomainChrDefPtr; typedef struct _virDomainChrSourceDef virDomainChrSourceDef; -typedef virDomainChrSourceDef *virDomainChrSourceDefPtr; typedef struct _virDomainChrSourceReconnectDef virDomainChrSourceReconnectDef; -typedef virDomainChrSourceReconnectDef *virDomainChrSourceReconnectDefPtr; typedef struct _virDomainClockDef virDomainClockDef; -typedef virDomainClockDef *virDomainClockDefPtr; typedef struct _virDomainControllerDef virDomainControllerDef; -typedef virDomainControllerDef *virDomainControllerDefPtr; typedef struct _virDomainCputune virDomainCputune; -typedef virDomainCputune *virDomainCputunePtr; typedef struct _virDomainDef virDomainDef; -typedef virDomainDef *virDomainDefPtr; typedef struct _virDomainDefParserConfig virDomainDefParserConfig; -typedef virDomainDefParserConfig *virDomainDefParserConfigPtr; typedef struct _virDomainDeviceDef virDomainDeviceDef; -typedef virDomainDeviceDef *virDomainDeviceDefPtr; typedef struct _virDomainDiskDef virDomainDiskDef; -typedef virDomainDiskDef *virDomainDiskDefPtr; typedef struct _virDomainFSDef virDomainFSDef; -typedef virDomainFSDef *virDomainFSDefPtr; typedef struct _virDomainGraphicsAuthDef virDomainGraphicsAuthDef; -typedef virDomainGraphicsAuthDef *virDomainGraphicsAuthDefPtr; typedef struct _virDomainGraphicsDef virDomainGraphicsDef; -typedef virDomainGraphicsDef *virDomainGraphicsDefPtr; typedef struct _virDomainGraphicsListenDef virDomainGraphicsListenDef; -typedef virDomainGraphicsListenDef *virDomainGraphicsListenDefPtr; typedef struct _virDomainHostdevCaps virDomainHostdevCaps; -typedef virDomainHostdevCaps *virDomainHostdevCapsPtr; typedef struct _virDomainHostdevDef virDomainHostdevDef; -typedef virDomainHostdevDef *virDomainHostdevDefPtr; typedef struct _virDomainHostdevOrigStates virDomainHostdevOrigStates; -typedef virDomainHostdevOrigStates *virDomainHostdevOrigStatesPtr; typedef struct _virDomainHostdevSubsys virDomainHostdevSubsys; -typedef virDomainHostdevSubsys *virDomainHostdevSubsysPtr; typedef struct _virDomainHostdevSubsysMediatedDev virDomainHostdevSubsysMediatedDev; -typedef virDomainHostdevSubsysMediatedDev *virDomainHostdevSubsysMediatedDevPtr; typedef struct _virDomainHostdevSubsysPCI virDomainHostdevSubsysPCI; -typedef virDomainHostdevSubsysPCI *virDomainHostdevSubsysPCIPtr; typedef struct _virDomainHostdevSubsysSCSI virDomainHostdevSubsysSCSI; -typedef virDomainHostdevSubsysSCSI *virDomainHostdevSubsysSCSIPtr; typedef struct _virDomainHostdevSubsysSCSIHost virDomainHostdevSubsysSCSIHost; -typedef virDomainHostdevSubsysSCSIHost *virDomainHostdevSubsysSCSIHostPtr; typedef struct _virDomainHostdevSubsysSCSIVHost virDomainHostdevSubsysSCSIVHost; -typedef virDomainHostdevSubsysSCSIVHost *virDomainHostdevSubsysSCSIVHostPtr; typedef struct _virDomainHostdevSubsysSCSIiSCSI virDomainHostdevSubsysSCSIiSCSI; -typedef virDomainHostdevSubsysSCSIiSCSI *virDomainHostdevSubsysSCSIiSCSIPtr; typedef struct _virDomainHostdevSubsysUSB virDomainHostdevSubsysUSB; -typedef virDomainHostdevSubsysUSB *virDomainHostdevSubsysUSBPtr; typedef struct _virDomainHubDef virDomainHubDef; -typedef virDomainHubDef *virDomainHubDefPtr; typedef struct _virDomainHugePage virDomainHugePage; -typedef virDomainHugePage *virDomainHugePagePtr; typedef struct _virDomainIOMMUDef virDomainIOMMUDef; -typedef virDomainIOMMUDef *virDomainIOMMUDefPtr; typedef struct _virDomainIOThreadIDDef virDomainIOThreadIDDef; -typedef virDomainIOThreadIDDef *virDomainIOThreadIDDefPtr; typedef struct _virDomainIdMapDef virDomainIdMapDef; -typedef virDomainIdMapDef *virDomainIdMapDefPtr; typedef struct _virDomainIdMapEntry virDomainIdMapEntry; -typedef virDomainIdMapEntry *virDomainIdMapEntryPtr; typedef struct _virDomainInputDef virDomainInputDef; -typedef virDomainInputDef *virDomainInputDefPtr; typedef struct _virDomainKeyWrapDef virDomainKeyWrapDef; -typedef virDomainKeyWrapDef *virDomainKeyWrapDefPtr; typedef struct _virDomainLeaseDef virDomainLeaseDef; -typedef virDomainLeaseDef *virDomainLeaseDefPtr; typedef struct _virDomainLoaderDef virDomainLoaderDef; -typedef virDomainLoaderDef *virDomainLoaderDefPtr; typedef struct _virDomainMemballoonDef virDomainMemballoonDef; -typedef virDomainMemballoonDef *virDomainMemballoonDefPtr; typedef struct _virDomainMemoryDef virDomainMemoryDef; -typedef virDomainMemoryDef *virDomainMemoryDefPtr; typedef struct _virDomainMemtune virDomainMemtune; -typedef virDomainMemtune *virDomainMemtunePtr; typedef struct _virDomainMomentDef virDomainMomentDef; -typedef virDomainMomentDef *virDomainMomentDefPtr; typedef struct _virDomainMomentObj virDomainMomentObj; -typedef virDomainMomentObj *virDomainMomentObjPtr; typedef struct _virDomainMomentObjList virDomainMomentObjList; -typedef virDomainMomentObjList *virDomainMomentObjListPtr; typedef struct _virDomainNVRAMDef virDomainNVRAMDef; -typedef virDomainNVRAMDef *virDomainNVRAMDefPtr; typedef struct _virDomainNetDef virDomainNetDef; -typedef virDomainNetDef *virDomainNetDefPtr; typedef struct _virDomainNetTeamingInfo virDomainNetTeamingInfo; -typedef virDomainNetTeamingInfo *virDomainNetTeamingInfoPtr; typedef struct _virDomainOSDef virDomainOSDef; -typedef virDomainOSDef *virDomainOSDefPtr; typedef struct _virDomainOSEnv virDomainOSEnv; -typedef virDomainOSEnv *virDomainOSEnvPtr; typedef struct _virDomainObj virDomainObj; -typedef virDomainObj *virDomainObjPtr; typedef struct _virDomainPCIControllerOpts virDomainPCIControllerOpts; -typedef virDomainPCIControllerOpts *virDomainPCIControllerOptsPtr; typedef struct _virDomainPanicDef virDomainPanicDef; -typedef virDomainPanicDef *virDomainPanicDefPtr; typedef struct _virDomainPerfDef virDomainPerfDef; -typedef virDomainPerfDef *virDomainPerfDefPtr; typedef struct _virDomainPowerManagement virDomainPowerManagement; -typedef virDomainPowerManagement *virDomainPowerManagementPtr; typedef struct _virDomainRNGDef virDomainRNGDef; -typedef virDomainRNGDef *virDomainRNGDefPtr; typedef struct _virDomainRedirFilterDef virDomainRedirFilterDef; -typedef virDomainRedirFilterDef *virDomainRedirFilterDefPtr; typedef struct _virDomainRedirFilterUSBDevDef virDomainRedirFilterUSBDevDef; -typedef virDomainRedirFilterUSBDevDef *virDomainRedirFilterUSBDevDefPtr; typedef struct _virDomainRedirdevDef virDomainRedirdevDef; -typedef virDomainRedirdevDef *virDomainRedirdevDefPtr; typedef struct _virDomainResctrlDef virDomainResctrlDef; -typedef virDomainResctrlDef *virDomainResctrlDefPtr; typedef struct _virDomainResctrlMonDef virDomainResctrlMonDef; -typedef virDomainResctrlMonDef *virDomainResctrlMonDefPtr; typedef struct _virDomainResourceDef virDomainResourceDef; -typedef virDomainResourceDef *virDomainResourceDefPtr; typedef struct _virDomainSEVDef virDomainSEVDef; -typedef virDomainSEVDef *virDomainSEVDefPtr; typedef struct _virDomainShmemDef virDomainShmemDef; -typedef virDomainShmemDef *virDomainShmemDefPtr; typedef struct _virDomainSmartcardDef virDomainSmartcardDef; -typedef virDomainSmartcardDef *virDomainSmartcardDefPtr; typedef struct _virDomainSnapshotDef virDomainSnapshotDef; -typedef virDomainSnapshotDef *virDomainSnapshotDefPtr; typedef struct _virDomainSnapshotObjList virDomainSnapshotObjList; -typedef virDomainSnapshotObjList *virDomainSnapshotObjListPtr; typedef struct _virDomainSoundCodecDef virDomainSoundCodecDef; -typedef virDomainSoundCodecDef *virDomainSoundCodecDefPtr; typedef struct _virDomainSoundDef virDomainSoundDef; -typedef virDomainSoundDef *virDomainSoundDefPtr; typedef struct _virDomainAudioDef virDomainAudioDef; -typedef virDomainAudioDef *virDomainAudioDefPtr; typedef struct _virDomainTPMDef virDomainTPMDef; -typedef virDomainTPMDef *virDomainTPMDefPtr; typedef struct _virDomainThreadSchedParam virDomainThreadSchedParam; -typedef virDomainThreadSchedParam *virDomainThreadSchedParamPtr; typedef struct _virDomainTimerCatchupDef virDomainTimerCatchupDef; -typedef virDomainTimerCatchupDef *virDomainTimerCatchupDefPtr; typedef struct _virDomainTimerDef virDomainTimerDef; -typedef virDomainTimerDef *virDomainTimerDefPtr; typedef struct _virDomainUSBControllerOpts virDomainUSBControllerOpts; -typedef virDomainUSBControllerOpts *virDomainUSBControllerOptsPtr; typedef struct _virDomainVcpuDef virDomainVcpuDef; -typedef virDomainVcpuDef *virDomainVcpuDefPtr; typedef struct _virDomainVideoAccelDef virDomainVideoAccelDef; -typedef virDomainVideoAccelDef *virDomainVideoAccelDefPtr; typedef struct _virDomainVideoResolutionDef virDomainVideoResolutionDef; -typedef virDomainVideoResolutionDef *virDomainVideoResolutionDefPtr; typedef struct _virDomainVideoDef virDomainVideoDef; -typedef virDomainVideoDef *virDomainVideoDefPtr; typedef struct _virDomainVideoDriverDef virDomainVideoDriverDef; -typedef virDomainVideoDriverDef *virDomainVideoDriverDefPtr; typedef struct _virDomainVirtioOptions virDomainVirtioOptions; -typedef virDomainVirtioOptions *virDomainVirtioOptionsPtr; typedef struct _virDomainVirtioSerialOpts virDomainVirtioSerialOpts; -typedef virDomainVirtioSerialOpts *virDomainVirtioSerialOptsPtr; typedef struct _virDomainVsockDef virDomainVsockDef; -typedef virDomainVsockDef *virDomainVsockDefPtr; typedef struct _virDomainWatchdogDef virDomainWatchdogDef; -typedef virDomainWatchdogDef *virDomainWatchdogDefPtr; typedef struct _virDomainXMLOption virDomainXMLOption; -typedef virDomainXMLOption *virDomainXMLOptionPtr; typedef struct _virDomainXMLPrivateDataCallbacks virDomainXMLPrivateDataCallbacks; -typedef virDomainXMLPrivateDataCallbacks *virDomainXMLPrivateDataCallbacksPtr; typedef struct _virDomainXenbusControllerOpts virDomainXenbusControllerOpts; -typedef virDomainXenbusControllerOpts *virDomainXenbusControllerOptsPtr; diff --git a/src/conf/virdomaincheckpointobjlist.c b/src/conf/virdomaincheckpointobjlist.c index a8025055c2..797feea520 100644 --- a/src/conf/virdomaincheckpointobjlist.c +++ b/src/conf/virdomaincheckpointobjlist.c @@ -36,19 +36,19 @@ VIR_LOG_INIT("conf.virdomaincheckpointobjlist"); struct _virDomainCheckpointObjList { - virDomainMomentObjListPtr base; + virDomainMomentObjList *base; }; -virDomainMomentObjPtr -virDomainCheckpointAssignDef(virDomainCheckpointObjListPtr checkpoints, - virDomainCheckpointDefPtr def) +virDomainMomentObj * +virDomainCheckpointAssignDef(virDomainCheckpointObjList *checkpoints, + virDomainCheckpointDef *def) { return virDomainMomentAssignDef(checkpoints->base, &def->parent); } static bool -virDomainCheckpointFilter(virDomainMomentObjPtr obj G_GNUC_UNUSED, +virDomainCheckpointFilter(virDomainMomentObj *obj G_GNUC_UNUSED, unsigned int flags) { /* For now, we have no further filters than what the common code handles. */ @@ -57,10 +57,10 @@ virDomainCheckpointFilter(virDomainMomentObjPtr obj G_GNUC_UNUSED, } -virDomainCheckpointObjListPtr +virDomainCheckpointObjList * virDomainCheckpointObjListNew(void) { - virDomainCheckpointObjListPtr checkpoints; + virDomainCheckpointObjList *checkpoints; checkpoints = g_new0(virDomainCheckpointObjList, 1); checkpoints->base = virDomainMomentObjListNew(); @@ -73,7 +73,7 @@ virDomainCheckpointObjListNew(void) void -virDomainCheckpointObjListFree(virDomainCheckpointObjListPtr checkpoints) +virDomainCheckpointObjListFree(virDomainCheckpointObjList *checkpoints) { if (!checkpoints) return; @@ -83,8 +83,8 @@ virDomainCheckpointObjListFree(virDomainCheckpointObjListPtr checkpoints) static int -virDomainCheckpointObjListGetNames(virDomainCheckpointObjListPtr checkpoints, - virDomainMomentObjPtr from, +virDomainCheckpointObjListGetNames(virDomainCheckpointObjList *checkpoints, + virDomainMomentObj *from, char **const names, int maxnames, unsigned int flags) @@ -105,8 +105,8 @@ virDomainCheckpointObjListGetNames(virDomainCheckpointObjListPtr checkpoints, } -virDomainMomentObjPtr -virDomainCheckpointFindByName(virDomainCheckpointObjListPtr checkpoints, +virDomainMomentObj * +virDomainCheckpointFindByName(virDomainCheckpointObjList *checkpoints, const char *name) { return virDomainMomentFindByName(checkpoints->base, name); @@ -114,8 +114,8 @@ virDomainCheckpointFindByName(virDomainCheckpointObjListPtr checkpoints, /* Return the current checkpoint, or NULL */ -virDomainMomentObjPtr -virDomainCheckpointGetCurrent(virDomainCheckpointObjListPtr checkpoints) +virDomainMomentObj * +virDomainCheckpointGetCurrent(virDomainCheckpointObjList *checkpoints) { return virDomainMomentGetCurrent(checkpoints->base); } @@ -123,7 +123,7 @@ virDomainCheckpointGetCurrent(virDomainCheckpointObjListPtr checkpoints) /* Return the current checkpoint's name, or NULL */ const char * -virDomainCheckpointGetCurrentName(virDomainCheckpointObjListPtr checkpoints) +virDomainCheckpointGetCurrentName(virDomainCheckpointObjList *checkpoints) { return virDomainMomentGetCurrentName(checkpoints->base); } @@ -131,8 +131,8 @@ virDomainCheckpointGetCurrentName(virDomainCheckpointObjListPtr checkpoints) /* Update the current checkpoint, using NULL if no current remains */ void -virDomainCheckpointSetCurrent(virDomainCheckpointObjListPtr checkpoints, - virDomainMomentObjPtr checkpoint) +virDomainCheckpointSetCurrent(virDomainCheckpointObjList *checkpoints, + virDomainMomentObj *checkpoint) { virDomainMomentSetCurrent(checkpoints->base, checkpoint); } @@ -140,8 +140,8 @@ virDomainCheckpointSetCurrent(virDomainCheckpointObjListPtr checkpoints, /* Remove checkpoint from the list; return true if it was current */ bool -virDomainCheckpointObjListRemove(virDomainCheckpointObjListPtr checkpoints, - virDomainMomentObjPtr checkpoint) +virDomainCheckpointObjListRemove(virDomainCheckpointObjList *checkpoints, + virDomainMomentObj *checkpoint) { return virDomainMomentObjListRemove(checkpoints->base, checkpoint); } @@ -149,14 +149,14 @@ virDomainCheckpointObjListRemove(virDomainCheckpointObjListPtr checkpoints, /* Remove all checkpoints tracked in the list */ void -virDomainCheckpointObjListRemoveAll(virDomainCheckpointObjListPtr checkpoints) +virDomainCheckpointObjListRemoveAll(virDomainCheckpointObjList *checkpoints) { return virDomainMomentObjListRemoveAll(checkpoints->base); } int -virDomainCheckpointForEach(virDomainCheckpointObjListPtr checkpoints, +virDomainCheckpointForEach(virDomainCheckpointObjList *checkpoints, virHashIterator iter, void *data) { @@ -166,8 +166,8 @@ virDomainCheckpointForEach(virDomainCheckpointObjListPtr checkpoints, /* Populate parent link of a given checkpoint. */ void -virDomainCheckpointLinkParent(virDomainCheckpointObjListPtr checkpoints, - virDomainMomentObjPtr chk) +virDomainCheckpointLinkParent(virDomainCheckpointObjList *checkpoints, + virDomainMomentObj *chk) { return virDomainMomentLinkParent(checkpoints->base, chk); } @@ -179,8 +179,8 @@ virDomainCheckpointLinkParent(virDomainCheckpointObjListPtr checkpoints, * was requested. Set leaf to the end of the chain, if there is * exactly one such leaf. */ int -virDomainCheckpointUpdateRelations(virDomainCheckpointObjListPtr checkpoints, - virDomainMomentObjPtr *leaf) +virDomainCheckpointUpdateRelations(virDomainCheckpointObjList *checkpoints, + virDomainMomentObj **leaf) { int ret = virDomainMomentUpdateRelations(checkpoints->base); @@ -191,8 +191,8 @@ virDomainCheckpointUpdateRelations(virDomainCheckpointObjListPtr checkpoints, int -virDomainCheckpointCheckCycles(virDomainCheckpointObjListPtr checkpoints, - virDomainCheckpointDefPtr def, +virDomainCheckpointCheckCycles(virDomainCheckpointObjList *checkpoints, + virDomainCheckpointDef *def, const char *domname) { return virDomainMomentCheckCycles(checkpoints->base, &def->parent, domname); @@ -200,8 +200,8 @@ virDomainCheckpointCheckCycles(virDomainCheckpointObjListPtr checkpoints, int -virDomainListCheckpoints(virDomainCheckpointObjListPtr checkpoints, - virDomainMomentObjPtr from, +virDomainListCheckpoints(virDomainCheckpointObjList *checkpoints, + virDomainMomentObj *from, virDomainPtr dom, virDomainCheckpointPtr **chks, unsigned int flags) diff --git a/src/conf/virdomaincheckpointobjlist.h b/src/conf/virdomaincheckpointobjlist.h index 2005177434..8b6f51cd89 100644 --- a/src/conf/virdomaincheckpointobjlist.h +++ b/src/conf/virdomaincheckpointobjlist.h @@ -26,53 +26,53 @@ #include "virdomainmomentobjlist.h" #include "virbuffer.h" -virDomainCheckpointObjListPtr +virDomainCheckpointObjList * virDomainCheckpointObjListNew(void); void -virDomainCheckpointObjListFree(virDomainCheckpointObjListPtr checkpoints); +virDomainCheckpointObjListFree(virDomainCheckpointObjList *checkpoints); -virDomainMomentObjPtr -virDomainCheckpointAssignDef(virDomainCheckpointObjListPtr checkpoints, - virDomainCheckpointDefPtr def); +virDomainMomentObj * +virDomainCheckpointAssignDef(virDomainCheckpointObjList *checkpoints, + virDomainCheckpointDef *def); -virDomainMomentObjPtr -virDomainCheckpointFindByName(virDomainCheckpointObjListPtr checkpoints, +virDomainMomentObj * +virDomainCheckpointFindByName(virDomainCheckpointObjList *checkpoints, const char *name); -virDomainMomentObjPtr -virDomainCheckpointGetCurrent(virDomainCheckpointObjListPtr checkpoints); +virDomainMomentObj * +virDomainCheckpointGetCurrent(virDomainCheckpointObjList *checkpoints); const char * -virDomainCheckpointGetCurrentName(virDomainCheckpointObjListPtr checkpoints); +virDomainCheckpointGetCurrentName(virDomainCheckpointObjList *checkpoints); void -virDomainCheckpointSetCurrent(virDomainCheckpointObjListPtr checkpoints, - virDomainMomentObjPtr checkpoint); +virDomainCheckpointSetCurrent(virDomainCheckpointObjList *checkpoints, + virDomainMomentObj *checkpoint); bool -virDomainCheckpointObjListRemove(virDomainCheckpointObjListPtr checkpoints, - virDomainMomentObjPtr checkpoint); +virDomainCheckpointObjListRemove(virDomainCheckpointObjList *checkpoints, + virDomainMomentObj *checkpoint); void -virDomainCheckpointObjListRemoveAll(virDomainCheckpointObjListPtr checkpoints); +virDomainCheckpointObjListRemoveAll(virDomainCheckpointObjList *checkpoints); int -virDomainCheckpointForEach(virDomainCheckpointObjListPtr checkpoints, +virDomainCheckpointForEach(virDomainCheckpointObjList *checkpoints, virHashIterator iter, void *data); void -virDomainCheckpointLinkParent(virDomainCheckpointObjListPtr checkpoints, - virDomainMomentObjPtr chk); +virDomainCheckpointLinkParent(virDomainCheckpointObjList *checkpoints, + virDomainMomentObj *chk); int -virDomainCheckpointUpdateRelations(virDomainCheckpointObjListPtr checkpoints, - virDomainMomentObjPtr *leaf); +virDomainCheckpointUpdateRelations(virDomainCheckpointObjList *checkpoints, + virDomainMomentObj **leaf); int -virDomainCheckpointCheckCycles(virDomainCheckpointObjListPtr checkpoints, - virDomainCheckpointDefPtr def, +virDomainCheckpointCheckCycles(virDomainCheckpointObjList *checkpoints, + virDomainCheckpointDef *def, const char *domname); #define VIR_DOMAIN_CHECKPOINT_FILTERS_LEAVES \ @@ -83,14 +83,14 @@ virDomainCheckpointCheckCycles(virDomainCheckpointObjListPtr checkpoints, (VIR_DOMAIN_CHECKPOINT_FILTERS_LEAVES) int -virDomainListCheckpoints(virDomainCheckpointObjListPtr checkpoints, - virDomainMomentObjPtr from, +virDomainListCheckpoints(virDomainCheckpointObjList *checkpoints, + virDomainMomentObj *from, virDomainPtr dom, virDomainCheckpointPtr **objs, unsigned int flags); -static inline virDomainCheckpointDefPtr -virDomainCheckpointObjGetDef(virDomainMomentObjPtr obj) +static inline virDomainCheckpointDef * +virDomainCheckpointObjGetDef(virDomainMomentObj *obj) { - return (virDomainCheckpointDefPtr) obj->def; + return (virDomainCheckpointDef *) obj->def; } diff --git a/src/conf/virdomainmomentobjlist.c b/src/conf/virdomainmomentobjlist.c index 879bc56472..c0896685a9 100644 --- a/src/conf/virdomainmomentobjlist.c +++ b/src/conf/virdomainmomentobjlist.c @@ -45,7 +45,7 @@ struct _virDomainMomentObjList { GHashTable *objs; virDomainMomentObj metaroot; /* Special parent of all root moments */ - virDomainMomentObjPtr current; /* The current moment, if any */ + virDomainMomentObj *current; /* The current moment, if any */ }; @@ -53,14 +53,14 @@ struct _virDomainMomentObjList { * other entries in moments. Return the number of children * visited. No particular ordering is guaranteed. */ int -virDomainMomentForEachChild(virDomainMomentObjPtr moment, +virDomainMomentForEachChild(virDomainMomentObj *moment, virHashIterator iter, void *data) { - virDomainMomentObjPtr child = moment->first_child; + virDomainMomentObj *child = moment->first_child; while (child) { - virDomainMomentObjPtr next = child->sibling; + virDomainMomentObj *next = child->sibling; (iter)(child, child->def->name, data); child = next; } @@ -79,7 +79,7 @@ virDomainMomentActOnDescendant(void *payload, const char *name, void *data) { - virDomainMomentObjPtr obj = payload; + virDomainMomentObj *obj = payload; struct moment_act_on_descendant *curr = data; virDomainMomentObj tmp = *obj; @@ -96,7 +96,7 @@ virDomainMomentActOnDescendant(void *payload, * visited. The visit is guaranteed to be topological, but no * particular order between siblings is guaranteed. */ int -virDomainMomentForEachDescendant(virDomainMomentObjPtr moment, +virDomainMomentForEachDescendant(virDomainMomentObj *moment, virHashIterator iter, void *data) { @@ -117,10 +117,10 @@ virDomainMomentForEachDescendant(virDomainMomentObjPtr moment, * of a parent, it is faster to just 0 the count rather than calling * this function on each child. */ void -virDomainMomentDropParent(virDomainMomentObjPtr moment) +virDomainMomentDropParent(virDomainMomentObj *moment) { - virDomainMomentObjPtr prev = NULL; - virDomainMomentObjPtr curr = NULL; + virDomainMomentObj *prev = NULL; + virDomainMomentObj *curr = NULL; moment->parent->nchildren--; curr = moment->parent->first_child; @@ -142,7 +142,7 @@ virDomainMomentDropParent(virDomainMomentObjPtr moment) /* Update @moment to no longer have children. */ void -virDomainMomentDropChildren(virDomainMomentObjPtr moment) +virDomainMomentDropChildren(virDomainMomentObj *moment) { moment->nchildren = 0; moment->first_child = NULL; @@ -151,8 +151,8 @@ virDomainMomentDropChildren(virDomainMomentObjPtr moment) /* Add @moment to @parent's list of children. */ static void -virDomainMomentSetParent(virDomainMomentObjPtr moment, - virDomainMomentObjPtr parent) +virDomainMomentSetParent(virDomainMomentObj *moment, + virDomainMomentObj *parent) { moment->parent = parent; parent->nchildren++; @@ -166,10 +166,10 @@ virDomainMomentSetParent(virDomainMomentObjPtr moment, * (for a new root) or set to an existing moment already in the * list. */ void -virDomainMomentLinkParent(virDomainMomentObjListPtr moments, - virDomainMomentObjPtr moment) +virDomainMomentLinkParent(virDomainMomentObjList *moments, + virDomainMomentObj *moment) { - virDomainMomentObjPtr parent; + virDomainMomentObj *parent; parent = virDomainMomentFindByName(moments, moment->def->parent_name); if (!parent) { @@ -184,10 +184,10 @@ virDomainMomentLinkParent(virDomainMomentObjListPtr moments, /* Take all children of @from and convert them into children of @to. */ void -virDomainMomentMoveChildren(virDomainMomentObjPtr from, - virDomainMomentObjPtr to) +virDomainMomentMoveChildren(virDomainMomentObj *from, + virDomainMomentObj *to) { - virDomainMomentObjPtr child = from->first_child; + virDomainMomentObj *child = from->first_child; if (!from->nchildren) return; @@ -205,10 +205,10 @@ virDomainMomentMoveChildren(virDomainMomentObjPtr from, } -static virDomainMomentObjPtr +static virDomainMomentObj * virDomainMomentObjNew(void) { - virDomainMomentObjPtr moment; + virDomainMomentObj *moment; moment = g_new0(virDomainMomentObj, 1); @@ -219,7 +219,7 @@ virDomainMomentObjNew(void) static void -virDomainMomentObjFree(virDomainMomentObjPtr moment) +virDomainMomentObjFree(virDomainMomentObj *moment) { if (!moment) return; @@ -232,11 +232,11 @@ virDomainMomentObjFree(virDomainMomentObjPtr moment) /* Add def to the list and return a matching object, or NULL on error */ -virDomainMomentObjPtr -virDomainMomentAssignDef(virDomainMomentObjListPtr moments, - virDomainMomentDefPtr def) +virDomainMomentObj * +virDomainMomentAssignDef(virDomainMomentObjList *moments, + virDomainMomentDef *def) { - virDomainMomentObjPtr moment; + virDomainMomentObj *moment; if (virHashLookup(moments->objs, def->name) != NULL) { virReportError(VIR_ERR_OPERATION_FAILED, @@ -261,16 +261,16 @@ virDomainMomentAssignDef(virDomainMomentObjListPtr moments, static void virDomainMomentObjListDataFree(void *payload) { - virDomainMomentObjPtr obj = payload; + virDomainMomentObj *obj = payload; virDomainMomentObjFree(obj); } -virDomainMomentObjListPtr +virDomainMomentObjList * virDomainMomentObjListNew(void) { - virDomainMomentObjListPtr moments; + virDomainMomentObjList *moments; moments = g_new0(virDomainMomentObjList, 1); moments->objs = virHashNew(virDomainMomentObjListDataFree); @@ -282,7 +282,7 @@ virDomainMomentObjListNew(void) } void -virDomainMomentObjListFree(virDomainMomentObjListPtr moments) +virDomainMomentObjListFree(virDomainMomentObjList *moments) { if (!moments) return; @@ -308,7 +308,7 @@ static int virDomainMomentObjListCopyNames(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virDomainMomentObjPtr obj = payload; + virDomainMomentObj *obj = payload; struct virDomainMomentNameData *data = opaque; if (data->error) @@ -331,8 +331,8 @@ static int virDomainMomentObjListCopyNames(void *payload, int -virDomainMomentObjListGetNames(virDomainMomentObjListPtr moments, - virDomainMomentObjPtr from, +virDomainMomentObjListGetNames(virDomainMomentObjList *moments, + virDomainMomentObj *from, char **const names, int maxnames, unsigned int flags, @@ -399,8 +399,8 @@ virDomainMomentObjListGetNames(virDomainMomentObjListPtr moments, } -virDomainMomentObjPtr -virDomainMomentFindByName(virDomainMomentObjListPtr moments, +virDomainMomentObj * +virDomainMomentFindByName(virDomainMomentObjList *moments, const char *name) { if (name) @@ -410,8 +410,8 @@ virDomainMomentFindByName(virDomainMomentObjListPtr moments, /* Return the current moment, or NULL */ -virDomainMomentObjPtr -virDomainMomentGetCurrent(virDomainMomentObjListPtr moments) +virDomainMomentObj * +virDomainMomentGetCurrent(virDomainMomentObjList *moments) { return moments->current; } @@ -419,7 +419,7 @@ virDomainMomentGetCurrent(virDomainMomentObjListPtr moments) /* Return the current moment's name, or NULL */ const char * -virDomainMomentGetCurrentName(virDomainMomentObjListPtr moments) +virDomainMomentGetCurrentName(virDomainMomentObjList *moments) { if (moments->current) return moments->current->def->name; @@ -429,8 +429,8 @@ virDomainMomentGetCurrentName(virDomainMomentObjListPtr moments) /* Update the current moment, using NULL if no current remains */ void -virDomainMomentSetCurrent(virDomainMomentObjListPtr moments, - virDomainMomentObjPtr moment) +virDomainMomentSetCurrent(virDomainMomentObjList *moments, + virDomainMomentObj *moment) { moments->current = moment; } @@ -438,7 +438,7 @@ virDomainMomentSetCurrent(virDomainMomentObjListPtr moments, /* Return the number of moments in the list */ int -virDomainMomentObjListSize(virDomainMomentObjListPtr moments) +virDomainMomentObjListSize(virDomainMomentObjList *moments) { return virHashSize(moments->objs); } @@ -446,8 +446,8 @@ virDomainMomentObjListSize(virDomainMomentObjListPtr moments) /* Remove moment from the list; return true if it was current */ bool -virDomainMomentObjListRemove(virDomainMomentObjListPtr moments, - virDomainMomentObjPtr moment) +virDomainMomentObjListRemove(virDomainMomentObjList *moments, + virDomainMomentObj *moment) { bool ret = moments->current == moment; @@ -460,7 +460,7 @@ virDomainMomentObjListRemove(virDomainMomentObjListPtr moments, /* Remove all moments tracked in the list */ void -virDomainMomentObjListRemoveAll(virDomainMomentObjListPtr moments) +virDomainMomentObjListRemoveAll(virDomainMomentObjList *moments) { virHashRemoveAll(moments->objs); virDomainMomentDropChildren(&moments->metaroot); @@ -469,7 +469,7 @@ virDomainMomentObjListRemoveAll(virDomainMomentObjListPtr moments) /* Call iter on each member of the list, in unspecified order */ int -virDomainMomentForEach(virDomainMomentObjListPtr moments, +virDomainMomentForEach(virDomainMomentObjList *moments, virHashIterator iter, void *data) { @@ -484,7 +484,7 @@ virDomainMomentForEach(virDomainMomentObjListPtr moments, * indicator gets set if a parent is missing or a requested parent would * cause a circular parent chain. */ struct moment_set_relation { - virDomainMomentObjListPtr moments; + virDomainMomentObjList *moments; int err; }; static int @@ -492,10 +492,10 @@ virDomainMomentSetRelations(void *payload, const char *name G_GNUC_UNUSED, void *data) { - virDomainMomentObjPtr obj = payload; + virDomainMomentObj *obj = payload; struct moment_set_relation *curr = data; - virDomainMomentObjPtr tmp; - virDomainMomentObjPtr parent; + virDomainMomentObj *tmp; + virDomainMomentObj *parent; parent = virDomainMomentFindByName(curr->moments, obj->def->parent_name); if (!parent) { @@ -527,7 +527,7 @@ virDomainMomentSetRelations(void *payload, * success, -1 if a parent is missing or if a circular relationship * was requested. */ int -virDomainMomentUpdateRelations(virDomainMomentObjListPtr moments) +virDomainMomentUpdateRelations(virDomainMomentObjList *moments) { struct moment_set_relation act = { moments, 0 }; @@ -544,11 +544,11 @@ virDomainMomentUpdateRelations(virDomainMomentObjListPtr moments) * on success, or report an error on behalf of domname before * returning -1. */ int -virDomainMomentCheckCycles(virDomainMomentObjListPtr list, - virDomainMomentDefPtr def, +virDomainMomentCheckCycles(virDomainMomentObjList *list, + virDomainMomentDef *def, const char *domname) { - virDomainMomentObjPtr other; + virDomainMomentObj *other; if (def->parent_name) { if (STREQ(def->name, def->parent_name)) { @@ -583,10 +583,10 @@ virDomainMomentCheckCycles(virDomainMomentObjListPtr list, } /* If there is exactly one leaf node, return that node. */ -virDomainMomentObjPtr -virDomainMomentFindLeaf(virDomainMomentObjListPtr list) +virDomainMomentObj * +virDomainMomentFindLeaf(virDomainMomentObjList *list) { - virDomainMomentObjPtr moment = &list->metaroot; + virDomainMomentObj *moment = &list->metaroot; if (moment->nchildren != 1) return NULL; diff --git a/src/conf/virdomainmomentobjlist.h b/src/conf/virdomainmomentobjlist.h index 75198909ba..dd8f798301 100644 --- a/src/conf/virdomainmomentobjlist.h +++ b/src/conf/virdomainmomentobjlist.h @@ -27,7 +27,7 @@ #include "virhash.h" /* Filter that returns true if a given moment matches the filter flags */ -typedef bool (*virDomainMomentObjListFilter)(virDomainMomentObjPtr obj, +typedef bool (*virDomainMomentObjListFilter)(virDomainMomentObj *obj, unsigned int flags); /* Struct that allows tracing hierarchical relationships between @@ -39,35 +39,35 @@ typedef bool (*virDomainMomentObjListFilter)(virDomainMomentObjPtr obj, * a linked list. */ struct _virDomainMomentObj { /* Public field */ - virDomainMomentDefPtr def; /* non-NULL except for metaroot */ + virDomainMomentDef *def; /* non-NULL except for metaroot */ /* Private fields, use accessors instead */ - virDomainMomentObjPtr parent; /* non-NULL except for metaroot, before + virDomainMomentObj *parent; /* non-NULL except for metaroot, before virDomainMomentUpdateRelations, or after virDomainMomentDropParent */ - virDomainMomentObjPtr sibling; /* NULL if last child of parent */ + virDomainMomentObj *sibling; /* NULL if last child of parent */ size_t nchildren; - virDomainMomentObjPtr first_child; /* NULL if no children */ + virDomainMomentObj *first_child; /* NULL if no children */ }; -int virDomainMomentForEachChild(virDomainMomentObjPtr moment, +int virDomainMomentForEachChild(virDomainMomentObj *moment, virHashIterator iter, void *data); -int virDomainMomentForEachDescendant(virDomainMomentObjPtr moment, +int virDomainMomentForEachDescendant(virDomainMomentObj *moment, virHashIterator iter, void *data); -void virDomainMomentDropParent(virDomainMomentObjPtr moment); -void virDomainMomentDropChildren(virDomainMomentObjPtr moment); -void virDomainMomentMoveChildren(virDomainMomentObjPtr from, - virDomainMomentObjPtr to); -void virDomainMomentLinkParent(virDomainMomentObjListPtr moments, - virDomainMomentObjPtr moment); +void virDomainMomentDropParent(virDomainMomentObj *moment); +void virDomainMomentDropChildren(virDomainMomentObj *moment); +void virDomainMomentMoveChildren(virDomainMomentObj *from, + virDomainMomentObj *to); +void virDomainMomentLinkParent(virDomainMomentObjList *moments, + virDomainMomentObj *moment); -virDomainMomentObjListPtr virDomainMomentObjListNew(void); -void virDomainMomentObjListFree(virDomainMomentObjListPtr moments); +virDomainMomentObjList *virDomainMomentObjListNew(void); +void virDomainMomentObjListFree(virDomainMomentObjList *moments); -virDomainMomentObjPtr virDomainMomentAssignDef(virDomainMomentObjListPtr moments, - virDomainMomentDefPtr def); +virDomainMomentObj *virDomainMomentAssignDef(virDomainMomentObjList *moments, + virDomainMomentDef *def); /* Various enum bits that map to public API filters. Note that the * values of the internal bits are not the same as the public ones for @@ -97,28 +97,28 @@ typedef enum { VIR_DOMAIN_MOMENT_FILTERS_METADATA | \ VIR_DOMAIN_MOMENT_FILTERS_LEAVES) -int virDomainMomentObjListGetNames(virDomainMomentObjListPtr moments, - virDomainMomentObjPtr from, +int virDomainMomentObjListGetNames(virDomainMomentObjList *moments, + virDomainMomentObj *from, char **const names, int maxnames, unsigned int moment_flags, virDomainMomentObjListFilter filter, unsigned int filter_flags); -virDomainMomentObjPtr virDomainMomentFindByName(virDomainMomentObjListPtr moments, +virDomainMomentObj *virDomainMomentFindByName(virDomainMomentObjList *moments, const char *name); -int virDomainMomentObjListSize(virDomainMomentObjListPtr moments); -virDomainMomentObjPtr virDomainMomentGetCurrent(virDomainMomentObjListPtr moments); -const char *virDomainMomentGetCurrentName(virDomainMomentObjListPtr moments); -void virDomainMomentSetCurrent(virDomainMomentObjListPtr moments, - virDomainMomentObjPtr moment); -bool virDomainMomentObjListRemove(virDomainMomentObjListPtr moments, - virDomainMomentObjPtr moment); -void virDomainMomentObjListRemoveAll(virDomainMomentObjListPtr moments); -int virDomainMomentForEach(virDomainMomentObjListPtr moments, +int virDomainMomentObjListSize(virDomainMomentObjList *moments); +virDomainMomentObj *virDomainMomentGetCurrent(virDomainMomentObjList *moments); +const char *virDomainMomentGetCurrentName(virDomainMomentObjList *moments); +void virDomainMomentSetCurrent(virDomainMomentObjList *moments, + virDomainMomentObj *moment); +bool virDomainMomentObjListRemove(virDomainMomentObjList *moments, + virDomainMomentObj *moment); +void virDomainMomentObjListRemoveAll(virDomainMomentObjList *moments); +int virDomainMomentForEach(virDomainMomentObjList *moments, virHashIterator iter, void *data); -int virDomainMomentUpdateRelations(virDomainMomentObjListPtr moments); -int virDomainMomentCheckCycles(virDomainMomentObjListPtr list, - virDomainMomentDefPtr def, +int virDomainMomentUpdateRelations(virDomainMomentObjList *moments); +int virDomainMomentCheckCycles(virDomainMomentObjList *list, + virDomainMomentDef *def, const char *domname); -virDomainMomentObjPtr virDomainMomentFindLeaf(virDomainMomentObjListPtr list); +virDomainMomentObj *virDomainMomentFindLeaf(virDomainMomentObjList *list); diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c index d37bbc94a6..e1d455eefe 100644 --- a/src/conf/virdomainobjlist.c +++ b/src/conf/virdomainobjlist.c @@ -38,7 +38,7 @@ VIR_LOG_INIT("conf.virdomainobjlist"); -static virClassPtr virDomainObjListClass; +static virClass *virDomainObjListClass; static void virDomainObjListDispose(void *obj); @@ -65,9 +65,9 @@ static int virDomainObjListOnceInit(void) VIR_ONCE_GLOBAL_INIT(virDomainObjList); -virDomainObjListPtr virDomainObjListNew(void) +virDomainObjList *virDomainObjListNew(void) { - virDomainObjListPtr doms; + virDomainObjList *doms; if (virDomainObjListInitialize() < 0) return NULL; @@ -87,7 +87,7 @@ virDomainObjListPtr virDomainObjListNew(void) static void virDomainObjListDispose(void *obj) { - virDomainObjListPtr doms = obj; + virDomainObjList *doms = obj; virHashFree(doms->objs); virHashFree(doms->objsName); @@ -98,7 +98,7 @@ static int virDomainObjListSearchID(const void *payload, const char *name G_GNUC_UNUSED, const void *data) { - virDomainObjPtr obj = (virDomainObjPtr)payload; + virDomainObj *obj = (virDomainObj *)payload; const int *id = data; int want = 0; @@ -111,11 +111,11 @@ static int virDomainObjListSearchID(const void *payload, } -virDomainObjPtr -virDomainObjListFindByID(virDomainObjListPtr doms, +virDomainObj * +virDomainObjListFindByID(virDomainObjList *doms, int id) { - virDomainObjPtr obj; + virDomainObj *obj; virObjectRWLockRead(doms); obj = virHashSearch(doms->objs, virDomainObjListSearchID, &id, NULL); @@ -134,12 +134,12 @@ virDomainObjListFindByID(virDomainObjListPtr doms, } -static virDomainObjPtr -virDomainObjListFindByUUIDLocked(virDomainObjListPtr doms, +static virDomainObj * +virDomainObjListFindByUUIDLocked(virDomainObjList *doms, const unsigned char *uuid) { char uuidstr[VIR_UUID_STRING_BUFLEN]; - virDomainObjPtr obj; + virDomainObj *obj; virUUIDFormat(uuid, uuidstr); obj = virHashLookup(doms->objs, uuidstr); @@ -159,11 +159,11 @@ virDomainObjListFindByUUIDLocked(virDomainObjListPtr doms, * locked and ref counted domain object if found. Caller is * expected to use the virDomainObjEndAPI when done with the object. */ -virDomainObjPtr -virDomainObjListFindByUUID(virDomainObjListPtr doms, +virDomainObj * +virDomainObjListFindByUUID(virDomainObjList *doms, const unsigned char *uuid) { - virDomainObjPtr obj; + virDomainObj *obj; virObjectRWLockRead(doms); obj = virDomainObjListFindByUUIDLocked(doms, uuid); @@ -179,11 +179,11 @@ virDomainObjListFindByUUID(virDomainObjListPtr doms, } -static virDomainObjPtr -virDomainObjListFindByNameLocked(virDomainObjListPtr doms, +static virDomainObj * +virDomainObjListFindByNameLocked(virDomainObjList *doms, const char *name) { - virDomainObjPtr obj; + virDomainObj *obj; obj = virHashLookup(doms->objsName, name); if (obj) { @@ -202,11 +202,11 @@ virDomainObjListFindByNameLocked(virDomainObjListPtr doms, * locked and ref counted domain object if found. Caller is expected * to use the virDomainObjEndAPI when done with the object. */ -virDomainObjPtr -virDomainObjListFindByName(virDomainObjListPtr doms, +virDomainObj * +virDomainObjListFindByName(virDomainObjList *doms, const char *name) { - virDomainObjPtr obj; + virDomainObj *obj; virObjectRWLockRead(doms); obj = virDomainObjListFindByNameLocked(doms, name); @@ -239,8 +239,8 @@ virDomainObjListFindByName(virDomainObjListPtr doms, * -1 on failure with 1 reference and locked */ static int -virDomainObjListAddObjLocked(virDomainObjListPtr doms, - virDomainObjPtr vm) +virDomainObjListAddObjLocked(virDomainObjList *doms, + virDomainObj *vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -274,14 +274,14 @@ virDomainObjListAddObjLocked(virDomainObjListPtr doms, * counted. The caller is expected to use virDomainObjEndAPI * when it completes usage. */ -static virDomainObjPtr -virDomainObjListAddLocked(virDomainObjListPtr doms, - virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, +static virDomainObj * +virDomainObjListAddLocked(virDomainObjList *doms, + virDomainDef *def, + virDomainXMLOption *xmlopt, unsigned int flags, - virDomainDefPtr *oldDef) + virDomainDef **oldDef) { - virDomainObjPtr vm; + virDomainObj *vm; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (oldDef) @@ -351,13 +351,14 @@ virDomainObjListAddLocked(virDomainObjListPtr doms, } -virDomainObjPtr virDomainObjListAdd(virDomainObjListPtr doms, - virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, - unsigned int flags, - virDomainDefPtr *oldDef) +virDomainObj * +virDomainObjListAdd(virDomainObjList *doms, + virDomainDef *def, + virDomainXMLOption *xmlopt, + unsigned int flags, + virDomainDef **oldDef) { - virDomainObjPtr ret; + virDomainObj *ret; virObjectRWLockWrite(doms); ret = virDomainObjListAddLocked(doms, def, xmlopt, flags, oldDef); @@ -373,8 +374,8 @@ virDomainObjPtr virDomainObjListAdd(virDomainObjListPtr doms, * virDomainObjListForEach */ void -virDomainObjListRemoveLocked(virDomainObjListPtr doms, - virDomainObjPtr dom) +virDomainObjListRemoveLocked(virDomainObjList *doms, + virDomainObj *dom) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -399,8 +400,8 @@ virDomainObjListRemoveLocked(virDomainObjListPtr doms, * tables and returned with lock and refcnt that was present upon entry. */ void -virDomainObjListRemove(virDomainObjListPtr doms, - virDomainObjPtr dom) +virDomainObjListRemove(virDomainObjList *doms, + virDomainObj *dom) { dom->removing = true; virObjectRef(dom); @@ -423,8 +424,8 @@ virDomainObjListRemove(virDomainObjListPtr doms, * consistency must not rely on this lock solely. */ int -virDomainObjListRename(virDomainObjListPtr doms, - virDomainObjPtr dom, +virDomainObjListRename(virDomainObjList *doms, + virDomainObj *dom, const char *new_name, unsigned int flags, virDomainObjListRenameCallback callback, @@ -481,9 +482,9 @@ virDomainObjListRename(virDomainObjListPtr doms, } -static virDomainObjPtr -virDomainObjListLoadConfig(virDomainObjListPtr doms, - virDomainXMLOptionPtr xmlopt, +static virDomainObj * +virDomainObjListLoadConfig(virDomainObjList *doms, + virDomainXMLOption *xmlopt, const char *configDir, const char *autostartDir, const char *name, @@ -491,10 +492,10 @@ virDomainObjListLoadConfig(virDomainObjListPtr doms, void *opaque) { char *configFile = NULL, *autostartLink = NULL; - virDomainDefPtr def = NULL; - virDomainObjPtr dom; + virDomainDef *def = NULL; + virDomainObj *dom; int autostart; - virDomainDefPtr oldDef = NULL; + virDomainDef *oldDef = NULL; if ((configFile = virDomainConfigFile(configDir, name)) == NULL) goto error; @@ -531,16 +532,16 @@ virDomainObjListLoadConfig(virDomainObjListPtr doms, } -static virDomainObjPtr -virDomainObjListLoadStatus(virDomainObjListPtr doms, +static virDomainObj * +virDomainObjListLoadStatus(virDomainObjList *doms, const char *statusDir, const char *name, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, virDomainLoadConfigNotify notify, void *opaque) { char *statusFile = NULL; - virDomainObjPtr obj = NULL; + virDomainObj *obj = NULL; char uuidstr[VIR_UUID_STRING_BUFLEN]; if ((statusFile = virDomainConfigFile(statusDir, name)) == NULL) @@ -580,11 +581,11 @@ virDomainObjListLoadStatus(virDomainObjListPtr doms, int -virDomainObjListLoadAllConfigs(virDomainObjListPtr doms, +virDomainObjListLoadAllConfigs(virDomainObjList *doms, const char *configDir, const char *autostartDir, bool liveStatus, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, virDomainLoadConfigNotify notify, void *opaque) { @@ -601,7 +602,7 @@ virDomainObjListLoadAllConfigs(virDomainObjListPtr doms, virObjectRWLockWrite(doms); while ((ret = virDirRead(dir, &entry, configDir)) > 0) { - virDomainObjPtr dom; + virDomainObj *dom; if (!virStringStripSuffix(entry->d_name, ".xml")) continue; @@ -651,7 +652,7 @@ virDomainObjListCount(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virDomainObjPtr obj = payload; + virDomainObj *obj = payload; struct virDomainObjListData *data = opaque; virObjectLock(obj); if (data->filter && @@ -671,7 +672,7 @@ virDomainObjListCount(void *payload, int -virDomainObjListNumOfDomains(virDomainObjListPtr doms, +virDomainObjListNumOfDomains(virDomainObjList *doms, bool active, virDomainObjListACLFilter filter, virConnectPtr conn) @@ -698,7 +699,7 @@ virDomainObjListCopyActiveIDs(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virDomainObjPtr obj = payload; + virDomainObj *obj = payload; struct virDomainIDData *data = opaque; virObjectLock(obj); if (data->filter && @@ -713,7 +714,7 @@ virDomainObjListCopyActiveIDs(void *payload, int -virDomainObjListGetActiveIDs(virDomainObjListPtr doms, +virDomainObjListGetActiveIDs(virDomainObjList *doms, int *ids, int maxids, virDomainObjListACLFilter filter, @@ -743,7 +744,7 @@ virDomainObjListCopyInactiveNames(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virDomainObjPtr obj = payload; + virDomainObj *obj = payload; struct virDomainNameData *data = opaque; if (data->oom) @@ -765,7 +766,7 @@ virDomainObjListCopyInactiveNames(void *payload, int -virDomainObjListGetInactiveNames(virDomainObjListPtr doms, +virDomainObjListGetInactiveNames(virDomainObjList *doms, char **const names, int maxnames, virDomainObjListACLFilter filter, @@ -824,7 +825,7 @@ virDomainObjListHelper(void *payload, * -1 otherwise. */ int -virDomainObjListForEach(virDomainObjListPtr doms, +virDomainObjListForEach(virDomainObjList *doms, bool modify, virDomainObjListIterator callback, void *opaque) @@ -845,7 +846,7 @@ virDomainObjListForEach(virDomainObjListPtr doms, #define MATCH(FLAG) (filter & (FLAG)) static bool -virDomainObjMatchFilter(virDomainObjPtr vm, +virDomainObjMatchFilter(virDomainObj *vm, unsigned int filter) { /* filter by active state */ @@ -917,7 +918,7 @@ virDomainObjMatchFilter(virDomainObjPtr vm, struct virDomainListData { - virDomainObjPtr *vms; + virDomainObj **vms; size_t nvms; }; @@ -935,7 +936,7 @@ virDomainObjListCollectIterator(void *payload, static void -virDomainObjListFilter(virDomainObjPtr **list, +virDomainObjListFilter(virDomainObj ***list, size_t *nvms, virConnectPtr conn, virDomainObjListACLFilter filter, @@ -944,7 +945,7 @@ virDomainObjListFilter(virDomainObjPtr **list, size_t i = 0; while (i < *nvms) { - virDomainObjPtr vm = (*list)[i]; + virDomainObj *vm = (*list)[i]; virObjectLock(vm); @@ -969,9 +970,9 @@ virDomainObjListFilter(virDomainObjPtr **list, int -virDomainObjListCollect(virDomainObjListPtr domlist, +virDomainObjListCollect(virDomainObjList *domlist, virConnectPtr conn, - virDomainObjPtr **vms, + virDomainObj ***vms, size_t *nvms, virDomainObjListACLFilter filter, unsigned int flags) @@ -980,7 +981,7 @@ virDomainObjListCollect(virDomainObjListPtr domlist, virObjectRWLockRead(domlist); sa_assert(domlist->objs); - data.vms = g_new0(virDomainObjPtr, virHashSize(domlist->objs)); + data.vms = g_new0(virDomainObj *, virHashSize(domlist->objs)); virHashForEach(domlist->objs, virDomainObjListCollectIterator, &data); virObjectRWUnlock(domlist); @@ -995,18 +996,18 @@ virDomainObjListCollect(virDomainObjListPtr domlist, int -virDomainObjListConvert(virDomainObjListPtr domlist, +virDomainObjListConvert(virDomainObjList *domlist, virConnectPtr conn, virDomainPtr *doms, size_t ndoms, - virDomainObjPtr **vms, + virDomainObj ***vms, size_t *nvms, virDomainObjListACLFilter filter, unsigned int flags, bool skip_missing) { char uuidstr[VIR_UUID_STRING_BUFLEN]; - virDomainObjPtr vm; + virDomainObj *vm; size_t i; *nvms = 0; @@ -1054,13 +1055,13 @@ virDomainObjListConvert(virDomainObjListPtr domlist, int -virDomainObjListExport(virDomainObjListPtr domlist, +virDomainObjListExport(virDomainObjList *domlist, virConnectPtr conn, virDomainPtr **domains, virDomainObjListACLFilter filter, unsigned int flags) { - virDomainObjPtr *vms = NULL; + virDomainObj **vms = NULL; virDomainPtr *doms = NULL; size_t nvms = 0; size_t i; @@ -1073,7 +1074,7 @@ virDomainObjListExport(virDomainObjListPtr domlist, doms = g_new0(virDomainPtr, nvms + 1); for (i = 0; i < nvms; i++) { - virDomainObjPtr vm = vms[i]; + virDomainObj *vm = vms[i]; virObjectLock(vm); doms[i] = virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id); diff --git a/src/conf/virdomainobjlist.h b/src/conf/virdomainobjlist.h index 6150e13aa4..7b4e34b951 100644 --- a/src/conf/virdomainobjlist.h +++ b/src/conf/virdomainobjlist.h @@ -25,71 +25,70 @@ #include "domain_conf.h" typedef struct _virDomainObjList virDomainObjList; -typedef virDomainObjList *virDomainObjListPtr; -virDomainObjListPtr virDomainObjListNew(void); +virDomainObjList *virDomainObjListNew(void); -virDomainObjPtr virDomainObjListFindByID(virDomainObjListPtr doms, +virDomainObj *virDomainObjListFindByID(virDomainObjList *doms, int id); -virDomainObjPtr virDomainObjListFindByUUID(virDomainObjListPtr doms, +virDomainObj *virDomainObjListFindByUUID(virDomainObjList *doms, const unsigned char *uuid); -virDomainObjPtr virDomainObjListFindByName(virDomainObjListPtr doms, +virDomainObj *virDomainObjListFindByName(virDomainObjList *doms, const char *name); enum { VIR_DOMAIN_OBJ_LIST_ADD_LIVE = (1 << 0), VIR_DOMAIN_OBJ_LIST_ADD_CHECK_LIVE = (1 << 1), }; -virDomainObjPtr virDomainObjListAdd(virDomainObjListPtr doms, - virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt, - unsigned int flags, - virDomainDefPtr *oldDef); +virDomainObj *virDomainObjListAdd(virDomainObjList *doms, + virDomainDef *def, + virDomainXMLOption *xmlopt, + unsigned int flags, + virDomainDef **oldDef); -typedef int (*virDomainObjListRenameCallback)(virDomainObjPtr dom, +typedef int (*virDomainObjListRenameCallback)(virDomainObj *dom, const char *new_name, unsigned int flags, void *opaque); -int virDomainObjListRename(virDomainObjListPtr doms, - virDomainObjPtr dom, +int virDomainObjListRename(virDomainObjList *doms, + virDomainObj *dom, const char *new_name, unsigned int flags, virDomainObjListRenameCallback callback, void *opaque); -void virDomainObjListRemove(virDomainObjListPtr doms, - virDomainObjPtr dom); -void virDomainObjListRemoveLocked(virDomainObjListPtr doms, - virDomainObjPtr dom); +void virDomainObjListRemove(virDomainObjList *doms, + virDomainObj *dom); +void virDomainObjListRemoveLocked(virDomainObjList *doms, + virDomainObj *dom); -int virDomainObjListLoadAllConfigs(virDomainObjListPtr doms, +int virDomainObjListLoadAllConfigs(virDomainObjList *doms, const char *configDir, const char *autostartDir, bool liveStatus, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, virDomainLoadConfigNotify notify, void *opaque); -int virDomainObjListNumOfDomains(virDomainObjListPtr doms, +int virDomainObjListNumOfDomains(virDomainObjList *doms, bool active, virDomainObjListACLFilter filter, virConnectPtr conn); -int virDomainObjListGetActiveIDs(virDomainObjListPtr doms, +int virDomainObjListGetActiveIDs(virDomainObjList *doms, int *ids, int maxids, virDomainObjListACLFilter filter, virConnectPtr conn); -int virDomainObjListGetInactiveNames(virDomainObjListPtr doms, +int virDomainObjListGetInactiveNames(virDomainObjList *doms, char **const names, int maxnames, virDomainObjListACLFilter filter, virConnectPtr conn); -typedef int (*virDomainObjListIterator)(virDomainObjPtr dom, +typedef int (*virDomainObjListIterator)(virDomainObj *dom, void *opaque); -int virDomainObjListForEach(virDomainObjListPtr doms, +int virDomainObjListForEach(virDomainObjList *doms, bool modify, virDomainObjListIterator callback, void *opaque); @@ -133,22 +132,22 @@ int virDomainObjListForEach(virDomainObjListPtr doms, VIR_CONNECT_LIST_DOMAINS_FILTERS_SNAPSHOT | \ VIR_CONNECT_LIST_DOMAINS_FILTERS_CHECKPOINT) -int virDomainObjListCollect(virDomainObjListPtr doms, +int virDomainObjListCollect(virDomainObjList *doms, virConnectPtr conn, - virDomainObjPtr **vms, + virDomainObj ***vms, size_t *nvms, virDomainObjListACLFilter filter, unsigned int flags); -int virDomainObjListExport(virDomainObjListPtr doms, +int virDomainObjListExport(virDomainObjList *doms, virConnectPtr conn, virDomainPtr **domains, virDomainObjListACLFilter filter, unsigned int flags); -int virDomainObjListConvert(virDomainObjListPtr domlist, +int virDomainObjListConvert(virDomainObjList *domlist, virConnectPtr conn, virDomainPtr *doms, size_t ndoms, - virDomainObjPtr **vms, + virDomainObj ***vms, size_t *nvms, virDomainObjListACLFilter filter, unsigned int flags, diff --git a/src/conf/virdomainsnapshotobjlist.c b/src/conf/virdomainsnapshotobjlist.c index 4c7176b95e..0ccdf31ae0 100644 --- a/src/conf/virdomainsnapshotobjlist.c +++ b/src/conf/virdomainsnapshotobjlist.c @@ -36,23 +36,23 @@ VIR_LOG_INIT("conf.virdomainsnapshotobjlist"); struct _virDomainSnapshotObjList { - virDomainMomentObjListPtr base; + virDomainMomentObjList *base; }; -virDomainMomentObjPtr -virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr snapshots, - virDomainSnapshotDefPtr def) +virDomainMomentObj * +virDomainSnapshotAssignDef(virDomainSnapshotObjList *snapshots, + virDomainSnapshotDef *def) { return virDomainMomentAssignDef(snapshots->base, &def->parent); } static bool -virDomainSnapshotFilter(virDomainMomentObjPtr obj, +virDomainSnapshotFilter(virDomainMomentObj *obj, unsigned int flags) { - virDomainSnapshotDefPtr def = virDomainSnapshotObjGetDef(obj); + virDomainSnapshotDef *def = virDomainSnapshotObjGetDef(obj); /* Caller has already sanitized flags and performed filtering on * DESCENDANTS and LEAVES. */ @@ -80,10 +80,10 @@ virDomainSnapshotFilter(virDomainMomentObjPtr obj, } -virDomainSnapshotObjListPtr +virDomainSnapshotObjList * virDomainSnapshotObjListNew(void) { - virDomainSnapshotObjListPtr snapshots; + virDomainSnapshotObjList *snapshots; snapshots = g_new0(virDomainSnapshotObjList, 1); snapshots->base = virDomainMomentObjListNew(); @@ -96,7 +96,7 @@ virDomainSnapshotObjListNew(void) void -virDomainSnapshotObjListFree(virDomainSnapshotObjListPtr snapshots) +virDomainSnapshotObjListFree(virDomainSnapshotObjList *snapshots) { if (!snapshots) return; @@ -106,8 +106,8 @@ virDomainSnapshotObjListFree(virDomainSnapshotObjListPtr snapshots) int -virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots, - virDomainMomentObjPtr from, +virDomainSnapshotObjListGetNames(virDomainSnapshotObjList *snapshots, + virDomainMomentObj *from, char **const names, int maxnames, unsigned int flags) @@ -155,16 +155,16 @@ virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots, int -virDomainSnapshotObjListNum(virDomainSnapshotObjListPtr snapshots, - virDomainMomentObjPtr from, +virDomainSnapshotObjListNum(virDomainSnapshotObjList *snapshots, + virDomainMomentObj *from, unsigned int flags) { return virDomainSnapshotObjListGetNames(snapshots, from, NULL, 0, flags); } -virDomainMomentObjPtr -virDomainSnapshotFindByName(virDomainSnapshotObjListPtr snapshots, +virDomainMomentObj * +virDomainSnapshotFindByName(virDomainSnapshotObjList *snapshots, const char *name) { return virDomainMomentFindByName(snapshots->base, name); @@ -172,8 +172,8 @@ virDomainSnapshotFindByName(virDomainSnapshotObjListPtr snapshots, /* Return the current snapshot, or NULL */ -virDomainMomentObjPtr -virDomainSnapshotGetCurrent(virDomainSnapshotObjListPtr snapshots) +virDomainMomentObj * +virDomainSnapshotGetCurrent(virDomainSnapshotObjList *snapshots) { return virDomainMomentGetCurrent(snapshots->base); } @@ -181,7 +181,7 @@ virDomainSnapshotGetCurrent(virDomainSnapshotObjListPtr snapshots) /* Return the current snapshot's name, or NULL */ const char * -virDomainSnapshotGetCurrentName(virDomainSnapshotObjListPtr snapshots) +virDomainSnapshotGetCurrentName(virDomainSnapshotObjList *snapshots) { return virDomainMomentGetCurrentName(snapshots->base); } @@ -189,8 +189,8 @@ virDomainSnapshotGetCurrentName(virDomainSnapshotObjListPtr snapshots) /* Update the current snapshot, using NULL if no current remains */ void -virDomainSnapshotSetCurrent(virDomainSnapshotObjListPtr snapshots, - virDomainMomentObjPtr snapshot) +virDomainSnapshotSetCurrent(virDomainSnapshotObjList *snapshots, + virDomainMomentObj *snapshot) { virDomainMomentSetCurrent(snapshots->base, snapshot); } @@ -198,8 +198,8 @@ virDomainSnapshotSetCurrent(virDomainSnapshotObjListPtr snapshots, /* Remove snapshot from the list; return true if it was current */ bool -virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots, - virDomainMomentObjPtr snapshot) +virDomainSnapshotObjListRemove(virDomainSnapshotObjList *snapshots, + virDomainMomentObj *snapshot) { return virDomainMomentObjListRemove(snapshots->base, snapshot); } @@ -207,14 +207,14 @@ virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots, /* Remove all snapshots tracked in the list */ void -virDomainSnapshotObjListRemoveAll(virDomainSnapshotObjListPtr snapshots) +virDomainSnapshotObjListRemoveAll(virDomainSnapshotObjList *snapshots) { return virDomainMomentObjListRemoveAll(snapshots->base); } int -virDomainSnapshotForEach(virDomainSnapshotObjListPtr snapshots, +virDomainSnapshotForEach(virDomainSnapshotObjList *snapshots, virHashIterator iter, void *data) { @@ -224,8 +224,8 @@ virDomainSnapshotForEach(virDomainSnapshotObjListPtr snapshots, /* Populate parent link of a given snapshot. */ void -virDomainSnapshotLinkParent(virDomainSnapshotObjListPtr snapshots, - virDomainMomentObjPtr snap) +virDomainSnapshotLinkParent(virDomainSnapshotObjList *snapshots, + virDomainMomentObj *snap) { return virDomainMomentLinkParent(snapshots->base, snap); } @@ -236,15 +236,15 @@ virDomainSnapshotLinkParent(virDomainSnapshotObjListPtr snapshots, * success, -1 if a parent is missing or if a circular relationship * was requested. */ int -virDomainSnapshotUpdateRelations(virDomainSnapshotObjListPtr snapshots) +virDomainSnapshotUpdateRelations(virDomainSnapshotObjList *snapshots) { return virDomainMomentUpdateRelations(snapshots->base); } int -virDomainSnapshotCheckCycles(virDomainSnapshotObjListPtr snapshots, - virDomainSnapshotDefPtr def, +virDomainSnapshotCheckCycles(virDomainSnapshotObjList *snapshots, + virDomainSnapshotDef *def, const char *domname) { return virDomainMomentCheckCycles(snapshots->base, &def->parent, domname); @@ -252,8 +252,8 @@ virDomainSnapshotCheckCycles(virDomainSnapshotObjListPtr snapshots, int -virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots, - virDomainMomentObjPtr from, +virDomainListSnapshots(virDomainSnapshotObjList *snapshots, + virDomainMomentObj *from, virDomainPtr dom, virDomainSnapshotPtr **snaps, unsigned int flags) diff --git a/src/conf/virdomainsnapshotobjlist.h b/src/conf/virdomainsnapshotobjlist.h index b8c80b39ed..eebeb9f5a3 100644 --- a/src/conf/virdomainsnapshotobjlist.h +++ b/src/conf/virdomainsnapshotobjlist.h @@ -26,36 +26,36 @@ #include "virdomainmomentobjlist.h" #include "virbuffer.h" -virDomainSnapshotObjListPtr virDomainSnapshotObjListNew(void); -void virDomainSnapshotObjListFree(virDomainSnapshotObjListPtr snapshots); +virDomainSnapshotObjList *virDomainSnapshotObjListNew(void); +void virDomainSnapshotObjListFree(virDomainSnapshotObjList *snapshots); -virDomainMomentObjPtr virDomainSnapshotAssignDef(virDomainSnapshotObjListPtr snapshots, - virDomainSnapshotDefPtr def); +virDomainMomentObj *virDomainSnapshotAssignDef(virDomainSnapshotObjList *snapshots, + virDomainSnapshotDef *def); -int virDomainSnapshotObjListGetNames(virDomainSnapshotObjListPtr snapshots, - virDomainMomentObjPtr from, +int virDomainSnapshotObjListGetNames(virDomainSnapshotObjList *snapshots, + virDomainMomentObj *from, char **const names, int maxnames, unsigned int flags); -int virDomainSnapshotObjListNum(virDomainSnapshotObjListPtr snapshots, - virDomainMomentObjPtr from, +int virDomainSnapshotObjListNum(virDomainSnapshotObjList *snapshots, + virDomainMomentObj *from, unsigned int flags); -virDomainMomentObjPtr virDomainSnapshotFindByName(virDomainSnapshotObjListPtr snapshots, +virDomainMomentObj *virDomainSnapshotFindByName(virDomainSnapshotObjList *snapshots, const char *name); -virDomainMomentObjPtr virDomainSnapshotGetCurrent(virDomainSnapshotObjListPtr snapshots); -const char *virDomainSnapshotGetCurrentName(virDomainSnapshotObjListPtr snapshots); -void virDomainSnapshotSetCurrent(virDomainSnapshotObjListPtr snapshots, - virDomainMomentObjPtr snapshot); -bool virDomainSnapshotObjListRemove(virDomainSnapshotObjListPtr snapshots, - virDomainMomentObjPtr snapshot); -void virDomainSnapshotObjListRemoveAll(virDomainSnapshotObjListPtr snapshots); -int virDomainSnapshotForEach(virDomainSnapshotObjListPtr snapshots, +virDomainMomentObj *virDomainSnapshotGetCurrent(virDomainSnapshotObjList *snapshots); +const char *virDomainSnapshotGetCurrentName(virDomainSnapshotObjList *snapshots); +void virDomainSnapshotSetCurrent(virDomainSnapshotObjList *snapshots, + virDomainMomentObj *snapshot); +bool virDomainSnapshotObjListRemove(virDomainSnapshotObjList *snapshots, + virDomainMomentObj *snapshot); +void virDomainSnapshotObjListRemoveAll(virDomainSnapshotObjList *snapshots); +int virDomainSnapshotForEach(virDomainSnapshotObjList *snapshots, virHashIterator iter, void *data); -void virDomainSnapshotLinkParent(virDomainSnapshotObjListPtr snapshots, - virDomainMomentObjPtr moment); -int virDomainSnapshotUpdateRelations(virDomainSnapshotObjListPtr snapshots); -int virDomainSnapshotCheckCycles(virDomainSnapshotObjListPtr snapshots, - virDomainSnapshotDefPtr def, +void virDomainSnapshotLinkParent(virDomainSnapshotObjList *snapshots, + virDomainMomentObj *moment); +int virDomainSnapshotUpdateRelations(virDomainSnapshotObjList *snapshots); +int virDomainSnapshotCheckCycles(virDomainSnapshotObjList *snapshots, + virDomainSnapshotDef *def, const char *domname); #define VIR_DOMAIN_SNAPSHOT_FILTERS_METADATA \ @@ -81,15 +81,15 @@ int virDomainSnapshotCheckCycles(virDomainSnapshotObjListPtr snapshots, VIR_DOMAIN_SNAPSHOT_FILTERS_STATUS | \ VIR_DOMAIN_SNAPSHOT_FILTERS_LOCATION) -int virDomainListSnapshots(virDomainSnapshotObjListPtr snapshots, - virDomainMomentObjPtr from, +int virDomainListSnapshots(virDomainSnapshotObjList *snapshots, + virDomainMomentObj *from, virDomainPtr dom, virDomainSnapshotPtr **snaps, unsigned int flags); /* Access the snapshot-specific definition from a given list member. */ -static inline virDomainSnapshotDefPtr -virDomainSnapshotObjGetDef(virDomainMomentObjPtr obj) +static inline virDomainSnapshotDef * +virDomainSnapshotObjGetDef(virDomainMomentObj *obj) { - return (virDomainSnapshotDefPtr) obj->def; + return (virDomainSnapshotDef *) obj->def; } diff --git a/src/conf/virinterfaceobj.c b/src/conf/virinterfaceobj.c index 909075c029..c8fda4990f 100644 --- a/src/conf/virinterfaceobj.c +++ b/src/conf/virinterfaceobj.c @@ -37,7 +37,7 @@ struct _virInterfaceObj { virObjectLockable parent; bool active; /* true if interface is active (up) */ - virInterfaceDefPtr def; /* The interface definition */ + virInterfaceDef *def; /* The interface definition */ }; struct _virInterfaceObjList { @@ -50,8 +50,8 @@ struct _virInterfaceObjList { /* virInterfaceObj manipulation */ -static virClassPtr virInterfaceObjClass; -static virClassPtr virInterfaceObjListClass; +static virClass *virInterfaceObjClass; +static virClass *virInterfaceObjListClass; static void virInterfaceObjDispose(void *obj); static void virInterfaceObjListDispose(void *obj); @@ -73,16 +73,16 @@ VIR_ONCE_GLOBAL_INIT(virInterfaceObj); static void virInterfaceObjDispose(void *opaque) { - virInterfaceObjPtr obj = opaque; + virInterfaceObj *obj = opaque; virInterfaceDefFree(obj->def); } -static virInterfaceObjPtr +static virInterfaceObj * virInterfaceObjNew(void) { - virInterfaceObjPtr obj; + virInterfaceObj *obj; if (virInterfaceObjInitialize() < 0) return NULL; @@ -97,7 +97,7 @@ virInterfaceObjNew(void) void -virInterfaceObjEndAPI(virInterfaceObjPtr *obj) +virInterfaceObjEndAPI(virInterfaceObj **obj) { if (!*obj) return; @@ -108,22 +108,22 @@ virInterfaceObjEndAPI(virInterfaceObjPtr *obj) } -virInterfaceDefPtr -virInterfaceObjGetDef(virInterfaceObjPtr obj) +virInterfaceDef * +virInterfaceObjGetDef(virInterfaceObj *obj) { return obj->def; } bool -virInterfaceObjIsActive(virInterfaceObjPtr obj) +virInterfaceObjIsActive(virInterfaceObj *obj) { return obj->active; } void -virInterfaceObjSetActive(virInterfaceObjPtr obj, +virInterfaceObjSetActive(virInterfaceObj *obj, bool active) { obj->active = active; @@ -131,10 +131,10 @@ virInterfaceObjSetActive(virInterfaceObjPtr obj, /* virInterfaceObjList manipulation */ -virInterfaceObjListPtr +virInterfaceObjList * virInterfaceObjListNew(void) { - virInterfaceObjListPtr interfaces; + virInterfaceObjList *interfaces; if (virInterfaceObjInitialize() < 0) return NULL; @@ -164,7 +164,7 @@ virInterfaceObjListFindByMACStringCb(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virInterfaceObjPtr obj = payload; + virInterfaceObj *obj = payload; struct _virInterfaceObjFindMACData *data = opaque; if (data->error) @@ -186,7 +186,7 @@ virInterfaceObjListFindByMACStringCb(void *payload, int -virInterfaceObjListFindByMACString(virInterfaceObjListPtr interfaces, +virInterfaceObjListFindByMACString(virInterfaceObjList *interfaces, const char *mac, char **const matches, int maxmatches) @@ -215,19 +215,19 @@ virInterfaceObjListFindByMACString(virInterfaceObjListPtr interfaces, } -static virInterfaceObjPtr -virInterfaceObjListFindByNameLocked(virInterfaceObjListPtr interfaces, +static virInterfaceObj * +virInterfaceObjListFindByNameLocked(virInterfaceObjList *interfaces, const char *name) { return virObjectRef(virHashLookup(interfaces->objsName, name)); } -virInterfaceObjPtr -virInterfaceObjListFindByName(virInterfaceObjListPtr interfaces, +virInterfaceObj * +virInterfaceObjListFindByName(virInterfaceObjList *interfaces, const char *name) { - virInterfaceObjPtr obj; + virInterfaceObj *obj; virObjectRWLockRead(interfaces); obj = virInterfaceObjListFindByNameLocked(interfaces, name); virObjectRWUnlock(interfaces); @@ -240,7 +240,7 @@ virInterfaceObjListFindByName(virInterfaceObjListPtr interfaces, #define MATCH(FLAG) (flags & (FLAG)) static bool -virInterfaceObjMatch(virInterfaceObjPtr obj, +virInterfaceObjMatch(virInterfaceObj *obj, unsigned int flags) { /* filter by active state */ @@ -257,7 +257,6 @@ virInterfaceObjMatch(virInterfaceObjPtr obj, typedef struct _virInterfaceObjListExportData virInterfaceObjListExportData; -typedef virInterfaceObjListExportData *virInterfaceObjListExportDataPtr; struct _virInterfaceObjListExportData { virConnectPtr conn; virInterfacePtr *ifaces; @@ -272,8 +271,8 @@ virInterfaceObjListExportCallback(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virInterfaceObjListExportDataPtr data = opaque; - virInterfaceObjPtr obj = payload; + virInterfaceObjListExportData *data = opaque; + virInterfaceObj *obj = payload; virInterfacePtr iface = NULL; if (data->error) @@ -308,7 +307,7 @@ virInterfaceObjListExportCallback(void *payload, int virInterfaceObjListExport(virConnectPtr conn, - virInterfaceObjListPtr ifaceobjs, + virInterfaceObjList *ifaceobjs, virInterfacePtr **ifaces, virInterfaceObjListFilter filter, unsigned int flags) @@ -347,7 +346,7 @@ virInterfaceObjListExport(virConnectPtr conn, void virInterfaceObjListDispose(void *obj) { - virInterfaceObjListPtr interfaces = obj; + virInterfaceObjList *interfaces = obj; virHashFree(interfaces->objsName); } @@ -355,7 +354,7 @@ virInterfaceObjListDispose(void *obj) struct _virInterfaceObjListCloneData { bool error; - virInterfaceObjListPtr dest; + virInterfaceObjList *dest; }; static int @@ -363,11 +362,11 @@ virInterfaceObjListCloneCb(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virInterfaceObjPtr srcObj = payload; + virInterfaceObj *srcObj = payload; struct _virInterfaceObjListCloneData *data = opaque; char *xml = NULL; - virInterfaceDefPtr backup = NULL; - virInterfaceObjPtr obj; + virInterfaceDef *backup = NULL; + virInterfaceObj *obj; if (data->error) return 0; @@ -397,8 +396,8 @@ virInterfaceObjListCloneCb(void *payload, } -virInterfaceObjListPtr -virInterfaceObjListClone(virInterfaceObjListPtr interfaces) +virInterfaceObjList * +virInterfaceObjListClone(virInterfaceObjList *interfaces) { struct _virInterfaceObjListCloneData data = { .error = false, .dest = NULL }; @@ -424,11 +423,11 @@ virInterfaceObjListClone(virInterfaceObjListPtr interfaces) } -virInterfaceObjPtr -virInterfaceObjListAssignDef(virInterfaceObjListPtr interfaces, - virInterfaceDefPtr def) +virInterfaceObj * +virInterfaceObjListAssignDef(virInterfaceObjList *interfaces, + virInterfaceDef *def) { - virInterfaceObjPtr obj; + virInterfaceObj *obj; virObjectRWLockWrite(interfaces); if ((obj = virInterfaceObjListFindByNameLocked(interfaces, def->name))) { @@ -455,8 +454,8 @@ virInterfaceObjListAssignDef(virInterfaceObjListPtr interfaces, void -virInterfaceObjListRemove(virInterfaceObjListPtr interfaces, - virInterfaceObjPtr obj) +virInterfaceObjListRemove(virInterfaceObjList *interfaces, + virInterfaceObj *obj) { if (!obj) return; @@ -482,7 +481,7 @@ virInterfaceObjListNumOfInterfacesCb(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virInterfaceObjPtr obj = payload; + virInterfaceObj *obj = payload; struct _virInterfaceObjNumOfInterfacesData *data = opaque; virObjectLock(obj); @@ -496,7 +495,7 @@ virInterfaceObjListNumOfInterfacesCb(void *payload, int -virInterfaceObjListNumOfInterfaces(virInterfaceObjListPtr interfaces, +virInterfaceObjListNumOfInterfaces(virInterfaceObjList *interfaces, bool wantActive) { struct _virInterfaceObjNumOfInterfacesData data = { @@ -524,7 +523,7 @@ virInterfaceObjListGetNamesCb(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virInterfaceObjPtr obj = payload; + virInterfaceObj *obj = payload; struct _virInterfaceObjGetNamesData *data = opaque; if (data->error) @@ -549,7 +548,7 @@ virInterfaceObjListGetNamesCb(void *payload, int -virInterfaceObjListGetNames(virInterfaceObjListPtr interfaces, +virInterfaceObjListGetNames(virInterfaceObjList *interfaces, bool wantActive, char **const names, int maxnames) diff --git a/src/conf/virinterfaceobj.h b/src/conf/virinterfaceobj.h index 6142fb9f53..d60faa95f2 100644 --- a/src/conf/virinterfaceobj.h +++ b/src/conf/virinterfaceobj.h @@ -22,68 +22,66 @@ #include "internal.h" typedef struct _virInterfaceObj virInterfaceObj; -typedef virInterfaceObj *virInterfaceObjPtr; typedef struct _virInterfaceObjList virInterfaceObjList; -typedef virInterfaceObjList *virInterfaceObjListPtr; void -virInterfaceObjEndAPI(virInterfaceObjPtr *obj); +virInterfaceObjEndAPI(virInterfaceObj **obj); -virInterfaceDefPtr -virInterfaceObjGetDef(virInterfaceObjPtr obj); +virInterfaceDef * +virInterfaceObjGetDef(virInterfaceObj *obj); bool -virInterfaceObjIsActive(virInterfaceObjPtr obj); +virInterfaceObjIsActive(virInterfaceObj *obj); void -virInterfaceObjSetActive(virInterfaceObjPtr obj, +virInterfaceObjSetActive(virInterfaceObj *obj, bool active); -virInterfaceObjListPtr +virInterfaceObjList * virInterfaceObjListNew(void); int -virInterfaceObjListFindByMACString(virInterfaceObjListPtr interfaces, +virInterfaceObjListFindByMACString(virInterfaceObjList *interfaces, const char *mac, char **const matches, int maxmatches); -virInterfaceObjPtr -virInterfaceObjListFindByName(virInterfaceObjListPtr interfaces, +virInterfaceObj * +virInterfaceObjListFindByName(virInterfaceObjList *interfaces, const char *name); void -virInterfaceObjFree(virInterfaceObjPtr obj); +virInterfaceObjFree(virInterfaceObj *obj); -virInterfaceObjListPtr -virInterfaceObjListClone(virInterfaceObjListPtr interfaces); +virInterfaceObjList * +virInterfaceObjListClone(virInterfaceObjList *interfaces); -virInterfaceObjPtr -virInterfaceObjListAssignDef(virInterfaceObjListPtr interfaces, - virInterfaceDefPtr def); +virInterfaceObj * +virInterfaceObjListAssignDef(virInterfaceObjList *interfaces, + virInterfaceDef *def); void -virInterfaceObjListRemove(virInterfaceObjListPtr interfaces, - virInterfaceObjPtr obj); +virInterfaceObjListRemove(virInterfaceObjList *interfaces, + virInterfaceObj *obj); typedef bool (*virInterfaceObjListFilter)(virConnectPtr conn, - virInterfaceDefPtr def); + virInterfaceDef *def); int -virInterfaceObjListNumOfInterfaces(virInterfaceObjListPtr interfaces, +virInterfaceObjListNumOfInterfaces(virInterfaceObjList *interfaces, bool wantActive); int -virInterfaceObjListGetNames(virInterfaceObjListPtr interfaces, +virInterfaceObjListGetNames(virInterfaceObjList *interfaces, bool wantActive, char **const names, int maxnames); int virInterfaceObjListExport(virConnectPtr conn, - virInterfaceObjListPtr ifaceobjs, + virInterfaceObjList *ifaceobjs, virInterfacePtr **ifaces, virInterfaceObjListFilter filter, unsigned int flags); diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c index e2a6328d3d..341d6b4292 100644 --- a/src/conf/virnetworkobj.c +++ b/src/conf/virnetworkobj.c @@ -48,18 +48,18 @@ struct _virNetworkObj { bool autostart; bool persistent; - virNetworkDefPtr def; /* The current definition */ - virNetworkDefPtr newDef; /* New definition to activate at shutdown */ + virNetworkDef *def; /* The current definition */ + virNetworkDef *newDef; /* New definition to activate at shutdown */ - virBitmapPtr classIdMap; /* bitmap of class IDs for QoS */ + virBitmap *classIdMap; /* bitmap of class IDs for QoS */ unsigned long long floor_sum; /* sum of all 'floor'-s of attached NICs */ unsigned int taint; /* Immutable pointer, self locking APIs */ - virMacMapPtr macmap; + virMacMap *macmap; - GHashTable *ports; /* uuid -> virNetworkPortDefPtr */ + GHashTable *ports; /* uuid -> virNetworkPortDef **/ }; struct _virNetworkObjList { @@ -68,8 +68,8 @@ struct _virNetworkObjList { GHashTable *objs; }; -static virClassPtr virNetworkObjClass; -static virClassPtr virNetworkObjListClass; +static virClass *virNetworkObjClass; +static virClass *virNetworkObjListClass; static void virNetworkObjDispose(void *obj); static void virNetworkObjListDispose(void *obj); @@ -89,7 +89,7 @@ virNetworkObjOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNetworkObj); static int -virNetworkObjLoadAllPorts(virNetworkObjPtr net, +virNetworkObjLoadAllPorts(virNetworkObj *net, const char *stateDir); @@ -99,10 +99,10 @@ virNetworkObjPortFree(void *val) virNetworkPortDefFree(val); } -virNetworkObjPtr +virNetworkObj * virNetworkObjNew(void) { - virNetworkObjPtr obj; + virNetworkObj *obj; if (virNetworkObjInitialize() < 0) return NULL; @@ -132,7 +132,7 @@ virNetworkObjNew(void) void -virNetworkObjEndAPI(virNetworkObjPtr *obj) +virNetworkObjEndAPI(virNetworkObj **obj) { if (!*obj) return; @@ -143,37 +143,37 @@ virNetworkObjEndAPI(virNetworkObjPtr *obj) } -virNetworkDefPtr -virNetworkObjGetDef(virNetworkObjPtr obj) +virNetworkDef * +virNetworkObjGetDef(virNetworkObj *obj) { return obj->def; } void -virNetworkObjSetDef(virNetworkObjPtr obj, - virNetworkDefPtr def) +virNetworkObjSetDef(virNetworkObj *obj, + virNetworkDef *def) { obj->def = def; } -virNetworkDefPtr -virNetworkObjGetNewDef(virNetworkObjPtr obj) +virNetworkDef * +virNetworkObjGetNewDef(virNetworkObj *obj) { return obj->newDef; } bool -virNetworkObjIsActive(virNetworkObjPtr obj) +virNetworkObjIsActive(virNetworkObj *obj) { return obj->active; } void -virNetworkObjSetActive(virNetworkObjPtr obj, +virNetworkObjSetActive(virNetworkObj *obj, bool active) { obj->active = active; @@ -181,21 +181,21 @@ virNetworkObjSetActive(virNetworkObjPtr obj, bool -virNetworkObjIsPersistent(virNetworkObjPtr obj) +virNetworkObjIsPersistent(virNetworkObj *obj) { return obj->persistent; } bool -virNetworkObjIsAutostart(virNetworkObjPtr obj) +virNetworkObjIsAutostart(virNetworkObj *obj) { return obj->autostart; } void -virNetworkObjSetAutostart(virNetworkObjPtr obj, +virNetworkObjSetAutostart(virNetworkObj *obj, bool autostart) { obj->autostart = autostart; @@ -203,14 +203,14 @@ virNetworkObjSetAutostart(virNetworkObjPtr obj, pid_t -virNetworkObjGetDnsmasqPid(virNetworkObjPtr obj) +virNetworkObjGetDnsmasqPid(virNetworkObj *obj) { return obj->dnsmasqPid; } void -virNetworkObjSetDnsmasqPid(virNetworkObjPtr obj, +virNetworkObjSetDnsmasqPid(virNetworkObj *obj, pid_t dnsmasqPid) { obj->dnsmasqPid = dnsmasqPid; @@ -218,43 +218,43 @@ virNetworkObjSetDnsmasqPid(virNetworkObjPtr obj, pid_t -virNetworkObjGetRadvdPid(virNetworkObjPtr obj) +virNetworkObjGetRadvdPid(virNetworkObj *obj) { return obj->radvdPid; } void -virNetworkObjSetRadvdPid(virNetworkObjPtr obj, +virNetworkObjSetRadvdPid(virNetworkObj *obj, pid_t radvdPid) { obj->radvdPid = radvdPid; } -virBitmapPtr -virNetworkObjGetClassIdMap(virNetworkObjPtr obj) +virBitmap * +virNetworkObjGetClassIdMap(virNetworkObj *obj) { return obj->classIdMap; } -virMacMapPtr -virNetworkObjGetMacMap(virNetworkObjPtr obj) +virMacMap * +virNetworkObjGetMacMap(virNetworkObj *obj) { return obj->macmap; } unsigned long long -virNetworkObjGetFloorSum(virNetworkObjPtr obj) +virNetworkObjGetFloorSum(virNetworkObj *obj) { return obj->floor_sum; } void -virNetworkObjSetFloorSum(virNetworkObjPtr obj, +virNetworkObjSetFloorSum(virNetworkObj *obj, unsigned long long floor_sum) { obj->floor_sum = floor_sum; @@ -262,15 +262,15 @@ virNetworkObjSetFloorSum(virNetworkObjPtr obj, void -virNetworkObjSetMacMap(virNetworkObjPtr obj, - virMacMapPtr macmap) +virNetworkObjSetMacMap(virNetworkObj *obj, + virMacMap *macmap) { obj->macmap = macmap; } void -virNetworkObjUnrefMacMap(virNetworkObjPtr obj) +virNetworkObjUnrefMacMap(virNetworkObj *obj) { virObjectUnref(obj->macmap); obj->macmap = NULL; @@ -278,7 +278,7 @@ virNetworkObjUnrefMacMap(virNetworkObjPtr obj) int -virNetworkObjMacMgrAdd(virNetworkObjPtr obj, +virNetworkObjMacMgrAdd(virNetworkObj *obj, const char *dnsmasqStateDir, const char *domain, const virMacAddr *mac) @@ -309,7 +309,7 @@ virNetworkObjMacMgrAdd(virNetworkObjPtr obj, int -virNetworkObjMacMgrDel(virNetworkObjPtr obj, +virNetworkObjMacMgrDel(virNetworkObj *obj, const char *dnsmasqStateDir, const char *domain, const virMacAddr *mac) @@ -339,10 +339,10 @@ virNetworkObjMacMgrDel(virNetworkObjPtr obj, } -virNetworkObjListPtr +virNetworkObjList * virNetworkObjListNew(void) { - virNetworkObjListPtr nets; + virNetworkObjList *nets; if (virNetworkObjInitialize() < 0) return NULL; @@ -359,11 +359,11 @@ virNetworkObjListNew(void) } -static virNetworkObjPtr -virNetworkObjFindByUUIDLocked(virNetworkObjListPtr nets, +static virNetworkObj * +virNetworkObjFindByUUIDLocked(virNetworkObjList *nets, const unsigned char *uuid) { - virNetworkObjPtr obj = NULL; + virNetworkObj *obj = NULL; char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(uuid, uuidstr); @@ -385,11 +385,11 @@ virNetworkObjFindByUUIDLocked(virNetworkObjListPtr nets, * * Returns: locked and ref'd network object. */ -virNetworkObjPtr -virNetworkObjFindByUUID(virNetworkObjListPtr nets, +virNetworkObj * +virNetworkObjFindByUUID(virNetworkObjList *nets, const unsigned char *uuid) { - virNetworkObjPtr obj; + virNetworkObj *obj; virObjectRWLockRead(nets); obj = virNetworkObjFindByUUIDLocked(nets, uuid); @@ -405,7 +405,7 @@ virNetworkObjSearchName(const void *payload, const char *name G_GNUC_UNUSED, const void *data) { - virNetworkObjPtr obj = (virNetworkObjPtr) payload; + virNetworkObj *obj = (virNetworkObj *) payload; int want = 0; virObjectLock(obj); @@ -416,11 +416,11 @@ virNetworkObjSearchName(const void *payload, } -static virNetworkObjPtr -virNetworkObjFindByNameLocked(virNetworkObjListPtr nets, +static virNetworkObj * +virNetworkObjFindByNameLocked(virNetworkObjList *nets, const char *name) { - virNetworkObjPtr obj = NULL; + virNetworkObj *obj = NULL; obj = virHashSearch(nets->objs, virNetworkObjSearchName, name, NULL); if (obj) @@ -439,11 +439,11 @@ virNetworkObjFindByNameLocked(virNetworkObjListPtr nets, * * Returns: locked and ref'd network object. */ -virNetworkObjPtr -virNetworkObjFindByName(virNetworkObjListPtr nets, +virNetworkObj * +virNetworkObjFindByName(virNetworkObjList *nets, const char *name) { - virNetworkObjPtr obj; + virNetworkObj *obj; virObjectRWLockRead(nets); obj = virNetworkObjFindByNameLocked(nets, name); @@ -455,7 +455,7 @@ virNetworkObjFindByName(virNetworkObjListPtr nets, bool -virNetworkObjTaint(virNetworkObjPtr obj, +virNetworkObjTaint(virNetworkObj *obj, virNetworkTaintFlags taint) { unsigned int flag = (1 << taint); @@ -471,7 +471,7 @@ virNetworkObjTaint(virNetworkObjPtr obj, static void virNetworkObjDispose(void *opaque) { - virNetworkObjPtr obj = opaque; + virNetworkObj *obj = opaque; virHashFree(obj->ports); virNetworkDefFree(obj->def); @@ -484,7 +484,7 @@ virNetworkObjDispose(void *opaque) static void virNetworkObjListDispose(void *opaque) { - virNetworkObjListPtr nets = opaque; + virNetworkObjList *nets = opaque; virHashFree(nets->objs); } @@ -507,8 +507,8 @@ virNetworkObjListDispose(void *opaque) * */ void -virNetworkObjUpdateAssignDef(virNetworkObjPtr obj, - virNetworkDefPtr def, +virNetworkObjUpdateAssignDef(virNetworkObj *obj, + virNetworkDef *def, bool live) { if (live) { @@ -562,13 +562,13 @@ virNetworkObjUpdateAssignDef(virNetworkObjPtr obj, * * If flags is zero, network is considered as inactive and persistent. */ -static virNetworkObjPtr -virNetworkObjAssignDefLocked(virNetworkObjListPtr nets, - virNetworkDefPtr def, +static virNetworkObj * +virNetworkObjAssignDefLocked(virNetworkObjList *nets, + virNetworkDef *def, unsigned int flags) { - virNetworkObjPtr obj; - virNetworkObjPtr ret = NULL; + virNetworkObj *obj; + virNetworkObj *ret = NULL; char uuidstr[VIR_UUID_STRING_BUFLEN]; /* See if a network with matching UUID already exists */ @@ -639,14 +639,14 @@ virNetworkObjAssignDefLocked(virNetworkObjListPtr nets, * * Look at virNetworkObjAssignDefLocked() for @flags description. * - * Returns NULL on error, virNetworkObjPtr on success. + * Returns NULL on error, virNetworkObj *on success. */ -virNetworkObjPtr -virNetworkObjAssignDef(virNetworkObjListPtr nets, - virNetworkDefPtr def, +virNetworkObj * +virNetworkObjAssignDef(virNetworkObjList *nets, + virNetworkDef *def, unsigned int flags) { - virNetworkObjPtr obj; + virNetworkObj *obj; virObjectRWLockWrite(nets); obj = virNetworkObjAssignDefLocked(nets, def, flags); @@ -670,9 +670,9 @@ virNetworkObjAssignDef(virNetworkObjListPtr nets, * Returns 0 on success, -1 on failure */ int -virNetworkObjSetDefTransient(virNetworkObjPtr obj, +virNetworkObjSetDefTransient(virNetworkObj *obj, bool live, - virNetworkXMLOptionPtr xmlopt) + virNetworkXMLOption *xmlopt) { if (!virNetworkObjIsActive(obj) && !live) return 0; @@ -692,7 +692,7 @@ virNetworkObjSetDefTransient(virNetworkObjPtr obj, * This *undoes* what virNetworkObjSetDefTransient did. */ void -virNetworkObjUnsetDefTransient(virNetworkObjPtr obj) +virNetworkObjUnsetDefTransient(virNetworkObj *obj) { if (obj->newDef) { virNetworkDefFree(obj->def); @@ -708,10 +708,10 @@ virNetworkObjUnsetDefTransient(virNetworkObjPtr obj) * Return the persistent network configuration. If network is transient, * return the running config. * - * Returns NULL on error, virNetworkDefPtr on success. + * Returns NULL on error, virNetworkDef *on success. */ -virNetworkDefPtr -virNetworkObjGetPersistentDef(virNetworkObjPtr obj) +virNetworkDef * +virNetworkObjGetPersistentDef(virNetworkObj *obj) { if (obj->newDef) return obj->newDef; @@ -732,8 +732,8 @@ virNetworkObjGetPersistentDef(virNetworkObjPtr obj) * Returns -1 on error, 0 on success */ int -virNetworkObjReplacePersistentDef(virNetworkObjPtr obj, - virNetworkDefPtr def) +virNetworkObjReplacePersistentDef(virNetworkObj *obj, + virNetworkDef *def) { if (virNetworkObjIsActive(obj)) { virNetworkDefFree(obj->newDef); @@ -758,8 +758,8 @@ virNetworkObjReplacePersistentDef(virNetworkObjPtr obj, * Returns 0 on success, -1 on error. */ static int -virNetworkObjConfigChangeSetup(virNetworkObjPtr obj, - virNetworkXMLOptionPtr xmlopt, +virNetworkObjConfigChangeSetup(virNetworkObj *obj, + virNetworkXMLOption *xmlopt, unsigned int flags) { bool isActive; @@ -791,8 +791,8 @@ virNetworkObjConfigChangeSetup(virNetworkObjPtr obj, void -virNetworkObjRemoveInactive(virNetworkObjListPtr nets, - virNetworkObjPtr obj) +virNetworkObjRemoveInactive(virNetworkObjList *nets, + virNetworkObj *obj) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -808,8 +808,8 @@ virNetworkObjRemoveInactive(virNetworkObjListPtr nets, static char * -virNetworkObjFormat(virNetworkObjPtr obj, - virNetworkXMLOptionPtr xmlopt, +virNetworkObjFormat(virNetworkObj *obj, + virNetworkXMLOption *xmlopt, unsigned int flags) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -843,8 +843,8 @@ virNetworkObjFormat(virNetworkObjPtr obj, int virNetworkObjSaveStatus(const char *statusDir, - virNetworkObjPtr obj, - virNetworkXMLOptionPtr xmlopt) + virNetworkObj *obj, + virNetworkXMLOption *xmlopt) { int ret = -1; int flags = 0; @@ -863,19 +863,19 @@ virNetworkObjSaveStatus(const char *statusDir, } -static virNetworkObjPtr -virNetworkLoadState(virNetworkObjListPtr nets, +static virNetworkObj * +virNetworkLoadState(virNetworkObjList *nets, const char *stateDir, const char *name, - virNetworkXMLOptionPtr xmlopt) + virNetworkXMLOption *xmlopt) { char *configFile = NULL; - virNetworkDefPtr def = NULL; - virNetworkObjPtr obj = NULL; + virNetworkDef *def = NULL; + virNetworkObj *obj = NULL; xmlDocPtr xml = NULL; xmlNodePtr node = NULL, *nodes = NULL; xmlXPathContextPtr ctxt = NULL; - virBitmapPtr classIdMap = NULL; + virBitmap *classIdMap = NULL; unsigned long long floor_sum_val = 0; unsigned int taint = 0; int n; @@ -990,16 +990,16 @@ virNetworkLoadState(virNetworkObjListPtr nets, } -static virNetworkObjPtr -virNetworkLoadConfig(virNetworkObjListPtr nets, +static virNetworkObj * +virNetworkLoadConfig(virNetworkObjList *nets, const char *configDir, const char *autostartDir, const char *name, - virNetworkXMLOptionPtr xmlopt) + virNetworkXMLOption *xmlopt) { char *configFile = NULL, *autostartLink = NULL; - virNetworkDefPtr def = NULL; - virNetworkObjPtr obj; + virNetworkDef *def = NULL; + virNetworkObj *obj; bool saveConfig = false; int autostart; @@ -1082,9 +1082,9 @@ virNetworkLoadConfig(virNetworkObjListPtr nets, int -virNetworkObjLoadAllState(virNetworkObjListPtr nets, +virNetworkObjLoadAllState(virNetworkObjList *nets, const char *stateDir, - virNetworkXMLOptionPtr xmlopt) + virNetworkXMLOption *xmlopt) { g_autoptr(DIR) dir = NULL; struct dirent *entry; @@ -1095,7 +1095,7 @@ virNetworkObjLoadAllState(virNetworkObjListPtr nets, return rc; while ((ret = virDirRead(dir, &entry, stateDir)) > 0) { - virNetworkObjPtr obj; + virNetworkObj *obj; if (!virStringStripSuffix(entry->d_name, ".xml")) continue; @@ -1115,10 +1115,10 @@ virNetworkObjLoadAllState(virNetworkObjListPtr nets, int -virNetworkObjLoadAllConfigs(virNetworkObjListPtr nets, +virNetworkObjLoadAllConfigs(virNetworkObjList *nets, const char *configDir, const char *autostartDir, - virNetworkXMLOptionPtr xmlopt) + virNetworkXMLOption *xmlopt) { g_autoptr(DIR) dir = NULL; struct dirent *entry; @@ -1129,7 +1129,7 @@ virNetworkObjLoadAllConfigs(virNetworkObjListPtr nets, return rc; while ((ret = virDirRead(dir, &entry, configDir)) > 0) { - virNetworkObjPtr obj; + virNetworkObj *obj; if (!virStringStripSuffix(entry->d_name, ".xml")) continue; @@ -1151,7 +1151,7 @@ virNetworkObjLoadAllConfigs(virNetworkObjListPtr nets, int virNetworkObjDeleteConfig(const char *configDir, const char *autostartDir, - virNetworkObjPtr obj) + virNetworkObj *obj) { char *configFile = NULL; char *autostartLink = NULL; @@ -1193,7 +1193,7 @@ virNetworkObjBridgeInUseHelper(const void *payload, const void *opaque) { int ret; - virNetworkObjPtr obj = (virNetworkObjPtr) payload; + virNetworkObj *obj = (virNetworkObj *) payload; const struct virNetworkObjBridgeInUseHelperData *data = opaque; virObjectLock(obj); @@ -1214,11 +1214,11 @@ virNetworkObjBridgeInUseHelper(const void *payload, bool -virNetworkObjBridgeInUse(virNetworkObjListPtr nets, +virNetworkObjBridgeInUse(virNetworkObjList *nets, const char *bridge, const char *skipname) { - virNetworkObjPtr obj; + virNetworkObj *obj; struct virNetworkObjBridgeInUseHelperData data = {bridge, skipname}; virObjectRWLockRead(nets); @@ -1244,24 +1244,24 @@ virNetworkObjBridgeInUse(virNetworkObjListPtr nets, * Returns: -1 on error, 0 on success. */ int -virNetworkObjUpdate(virNetworkObjPtr obj, +virNetworkObjUpdate(virNetworkObj *obj, unsigned int command, /* virNetworkUpdateCommand */ unsigned int section, /* virNetworkUpdateSection */ int parentIndex, const char *xml, - virNetworkXMLOptionPtr xmlopt, + virNetworkXMLOption *xmlopt, unsigned int flags) /* virNetworkUpdateFlags */ { int ret = -1; - virNetworkDefPtr livedef = NULL; - virNetworkDefPtr configdef = NULL; + virNetworkDef *livedef = NULL; + virNetworkDef *configdef = NULL; /* normalize config data, and check for common invalid requests. */ if (virNetworkObjConfigChangeSetup(obj, xmlopt, flags) < 0) goto cleanup; if (flags & VIR_NETWORK_UPDATE_AFFECT_LIVE) { - virNetworkDefPtr checkdef; + virNetworkDef *checkdef; /* work on a copy of the def */ if (!(livedef = virNetworkDefCopy(obj->def, xmlopt, 0))) @@ -1279,7 +1279,7 @@ virNetworkObjUpdate(virNetworkObjPtr obj, } if (flags & VIR_NETWORK_UPDATE_AFFECT_CONFIG) { - virNetworkDefPtr checkdef; + virNetworkDef *checkdef; /* work on a copy of the def */ if (!(configdef = virNetworkDefCopy(virNetworkObjGetPersistentDef(obj), @@ -1321,7 +1321,7 @@ virNetworkObjUpdate(virNetworkObjPtr obj, #define MATCH(FLAG) (flags & (FLAG)) static bool -virNetworkObjMatch(virNetworkObjPtr obj, +virNetworkObjMatch(virNetworkObj *obj, unsigned int flags) { /* filter by active state */ @@ -1354,7 +1354,6 @@ virNetworkObjMatch(virNetworkObjPtr obj, typedef struct _virNetworkObjListExportData virNetworkObjListExportData; -typedef virNetworkObjListExportData *virNetworkObjListExportDataPtr; struct _virNetworkObjListExportData { virConnectPtr conn; virNetworkPtr *nets; @@ -1369,8 +1368,8 @@ virNetworkObjListExportCallback(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virNetworkObjListExportDataPtr data = opaque; - virNetworkObjPtr obj = payload; + virNetworkObjListExportData *data = opaque; + virNetworkObj *obj = payload; virNetworkPtr net = NULL; if (data->error) @@ -1405,7 +1404,7 @@ virNetworkObjListExportCallback(void *payload, int virNetworkObjListExport(virConnectPtr conn, - virNetworkObjListPtr netobjs, + virNetworkObjList *netobjs, virNetworkPtr **nets, virNetworkObjListFilter filter, unsigned int flags) @@ -1474,7 +1473,7 @@ virNetworkObjListForEachHelper(void *payload, * Returns: 0 on success, -1 otherwise. */ int -virNetworkObjListForEach(virNetworkObjListPtr nets, +virNetworkObjListForEach(virNetworkObjList *nets, virNetworkObjListIterator callback, void *opaque) { @@ -1503,7 +1502,7 @@ virNetworkObjListGetHelper(void *payload, void *opaque) { struct virNetworkObjListGetHelperData *data = opaque; - virNetworkObjPtr obj = payload; + virNetworkObj *obj = payload; if (data->error) return 0; @@ -1532,7 +1531,7 @@ virNetworkObjListGetHelper(void *payload, int -virNetworkObjListGetNames(virNetworkObjListPtr nets, +virNetworkObjListGetNames(virNetworkObjList *nets, bool active, char **names, int maxnames, @@ -1563,7 +1562,7 @@ virNetworkObjListGetNames(virNetworkObjListPtr nets, int -virNetworkObjListNumOfNetworks(virNetworkObjListPtr nets, +virNetworkObjListNumOfNetworks(virNetworkObjList *nets, bool active, virNetworkObjListFilter filter, virConnectPtr conn) @@ -1590,7 +1589,7 @@ virNetworkObjListPruneHelper(const void *payload, const void *opaque) { const struct virNetworkObjListPruneHelperData *data = opaque; - virNetworkObjPtr obj = (virNetworkObjPtr) payload; + virNetworkObj *obj = (virNetworkObj *) payload; int want = 0; virObjectLock(obj); @@ -1609,7 +1608,7 @@ virNetworkObjListPruneHelper(const void *payload, * ones from it. */ void -virNetworkObjListPrune(virNetworkObjListPtr nets, +virNetworkObjListPrune(virNetworkObjList *nets, unsigned int flags) { struct virNetworkObjListPruneHelperData data = {flags}; @@ -1621,7 +1620,7 @@ virNetworkObjListPrune(virNetworkObjListPtr nets, char * -virNetworkObjGetPortStatusDir(virNetworkObjPtr net, +virNetworkObjGetPortStatusDir(virNetworkObj *net, const char *stateDir) { char *ret; @@ -1630,8 +1629,8 @@ virNetworkObjGetPortStatusDir(virNetworkObjPtr net, } int -virNetworkObjAddPort(virNetworkObjPtr net, - virNetworkPortDefPtr portdef, +virNetworkObjAddPort(virNetworkObj *net, + virNetworkPortDef *portdef, const char *stateDir) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -1661,11 +1660,11 @@ virNetworkObjAddPort(virNetworkObjPtr net, } -virNetworkPortDefPtr -virNetworkObjLookupPort(virNetworkObjPtr net, +virNetworkPortDef * +virNetworkObjLookupPort(virNetworkObj *net, const unsigned char *uuid) { - virNetworkPortDefPtr ret = NULL; + virNetworkPortDef *ret = NULL; char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(uuid, uuidstr); @@ -1682,13 +1681,13 @@ virNetworkObjLookupPort(virNetworkObjPtr net, int -virNetworkObjDeletePort(virNetworkObjPtr net, +virNetworkObjDeletePort(virNetworkObj *net, const unsigned char *uuid, const char *stateDir) { char uuidstr[VIR_UUID_STRING_BUFLEN]; g_autofree char *dir = NULL; - virNetworkPortDefPtr portdef; + virNetworkPortDef *portdef; virUUIDFormat(uuid, uuidstr); @@ -1713,7 +1712,7 @@ virNetworkObjDeletePort(virNetworkObjPtr net, int -virNetworkObjDeleteAllPorts(virNetworkObjPtr net, +virNetworkObjDeleteAllPorts(virNetworkObj *net, const char *stateDir) { g_autofree char *dir = NULL; @@ -1747,10 +1746,9 @@ virNetworkObjDeleteAllPorts(virNetworkObjPtr net, typedef struct _virNetworkObjPortListExportData virNetworkObjPortListExportData; -typedef virNetworkObjPortListExportData *virNetworkObjPortListExportDataPtr; struct _virNetworkObjPortListExportData { virNetworkPtr net; - virNetworkDefPtr def; + virNetworkDef *def; virNetworkPortPtr *ports; virNetworkPortListFilter filter; int nports; @@ -1762,8 +1760,8 @@ virNetworkObjPortListExportCallback(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virNetworkObjPortListExportDataPtr data = opaque; - virNetworkPortDefPtr def = payload; + virNetworkObjPortListExportData *data = opaque; + virNetworkPortDef *def = payload; virNetworkPortPtr port; if (data->error) @@ -1791,7 +1789,7 @@ virNetworkObjPortListExportCallback(void *payload, int virNetworkObjPortListExport(virNetworkPtr net, - virNetworkObjPtr obj, + virNetworkObj *obj, virNetworkPortPtr **ports, virNetworkPortListFilter filter) { @@ -1848,7 +1846,7 @@ virNetworkObjPortForEachCallback(void *payload, } int -virNetworkObjPortForEach(virNetworkObjPtr obj, +virNetworkObjPortForEach(virNetworkObj *obj, virNetworkPortListIter iter, void *opaque) { @@ -1861,7 +1859,7 @@ virNetworkObjPortForEach(virNetworkObjPtr obj, static int -virNetworkObjLoadAllPorts(virNetworkObjPtr net, +virNetworkObjLoadAllPorts(virNetworkObj *net, const char *stateDir) { g_autofree char *dir = NULL; diff --git a/src/conf/virnetworkobj.h b/src/conf/virnetworkobj.h index fe3ec5bbf8..d980e9f38d 100644 --- a/src/conf/virnetworkobj.h +++ b/src/conf/virnetworkobj.h @@ -25,233 +25,231 @@ #include "virnetworkportdef.h" typedef struct _virNetworkObj virNetworkObj; -typedef virNetworkObj *virNetworkObjPtr; -virNetworkObjPtr +virNetworkObj * virNetworkObjNew(void); -virNetworkDefPtr -virNetworkObjGetDef(virNetworkObjPtr obj); +virNetworkDef * +virNetworkObjGetDef(virNetworkObj *obj); void -virNetworkObjSetDef(virNetworkObjPtr obj, - virNetworkDefPtr def); +virNetworkObjSetDef(virNetworkObj *obj, + virNetworkDef *def); -virNetworkDefPtr -virNetworkObjGetNewDef(virNetworkObjPtr obj); +virNetworkDef * +virNetworkObjGetNewDef(virNetworkObj *obj); bool -virNetworkObjIsActive(virNetworkObjPtr obj); +virNetworkObjIsActive(virNetworkObj *obj); void -virNetworkObjSetActive(virNetworkObjPtr obj, +virNetworkObjSetActive(virNetworkObj *obj, bool active); bool -virNetworkObjIsPersistent(virNetworkObjPtr obj); +virNetworkObjIsPersistent(virNetworkObj *obj); bool -virNetworkObjIsAutostart(virNetworkObjPtr obj); +virNetworkObjIsAutostart(virNetworkObj *obj); void -virNetworkObjSetAutostart(virNetworkObjPtr obj, +virNetworkObjSetAutostart(virNetworkObj *obj, bool autostart); -virMacMapPtr -virNetworkObjGetMacMap(virNetworkObjPtr obj); +virMacMap * +virNetworkObjGetMacMap(virNetworkObj *obj); pid_t -virNetworkObjGetDnsmasqPid(virNetworkObjPtr obj); +virNetworkObjGetDnsmasqPid(virNetworkObj *obj); void -virNetworkObjSetDnsmasqPid(virNetworkObjPtr obj, +virNetworkObjSetDnsmasqPid(virNetworkObj *obj, pid_t dnsmasqPid); pid_t -virNetworkObjGetRadvdPid(virNetworkObjPtr obj); +virNetworkObjGetRadvdPid(virNetworkObj *obj); void -virNetworkObjSetRadvdPid(virNetworkObjPtr obj, +virNetworkObjSetRadvdPid(virNetworkObj *obj, pid_t radvdPid); -virBitmapPtr -virNetworkObjGetClassIdMap(virNetworkObjPtr obj); +virBitmap * +virNetworkObjGetClassIdMap(virNetworkObj *obj); unsigned long long -virNetworkObjGetFloorSum(virNetworkObjPtr obj); +virNetworkObjGetFloorSum(virNetworkObj *obj); void -virNetworkObjSetFloorSum(virNetworkObjPtr obj, +virNetworkObjSetFloorSum(virNetworkObj *obj, unsigned long long floor_sum); void -virNetworkObjSetMacMap(virNetworkObjPtr obj, - virMacMapPtr macmap); +virNetworkObjSetMacMap(virNetworkObj *obj, + virMacMap *macmap); void -virNetworkObjUnrefMacMap(virNetworkObjPtr obj); +virNetworkObjUnrefMacMap(virNetworkObj *obj); int -virNetworkObjMacMgrAdd(virNetworkObjPtr obj, +virNetworkObjMacMgrAdd(virNetworkObj *obj, const char *dnsmasqStateDir, const char *domain, const virMacAddr *mac); int -virNetworkObjMacMgrDel(virNetworkObjPtr obj, +virNetworkObjMacMgrDel(virNetworkObj *obj, const char *dnsmasqStateDir, const char *domain, const virMacAddr *mac); void -virNetworkObjEndAPI(virNetworkObjPtr *net); +virNetworkObjEndAPI(virNetworkObj **net); typedef struct _virNetworkObjList virNetworkObjList; -typedef virNetworkObjList *virNetworkObjListPtr; -virNetworkObjListPtr +virNetworkObjList * virNetworkObjListNew(void); -virNetworkObjPtr -virNetworkObjFindByUUID(virNetworkObjListPtr nets, +virNetworkObj * +virNetworkObjFindByUUID(virNetworkObjList *nets, const unsigned char *uuid); -virNetworkObjPtr -virNetworkObjFindByName(virNetworkObjListPtr nets, +virNetworkObj * +virNetworkObjFindByName(virNetworkObjList *nets, const char *name); bool -virNetworkObjTaint(virNetworkObjPtr obj, +virNetworkObjTaint(virNetworkObj *obj, virNetworkTaintFlags taint); typedef bool (*virNetworkObjListFilter)(virConnectPtr conn, - virNetworkDefPtr def); + virNetworkDef *def); -virNetworkObjPtr -virNetworkObjAssignDef(virNetworkObjListPtr nets, - virNetworkDefPtr def, +virNetworkObj * +virNetworkObjAssignDef(virNetworkObjList *nets, + virNetworkDef *def, unsigned int flags); void -virNetworkObjUpdateAssignDef(virNetworkObjPtr network, - virNetworkDefPtr def, +virNetworkObjUpdateAssignDef(virNetworkObj *network, + virNetworkDef *def, bool live); int -virNetworkObjSetDefTransient(virNetworkObjPtr network, +virNetworkObjSetDefTransient(virNetworkObj *network, bool live, - virNetworkXMLOptionPtr xmlopt); + virNetworkXMLOption *xmlopt); void -virNetworkObjUnsetDefTransient(virNetworkObjPtr network); +virNetworkObjUnsetDefTransient(virNetworkObj *network); -virNetworkDefPtr -virNetworkObjGetPersistentDef(virNetworkObjPtr network); +virNetworkDef * +virNetworkObjGetPersistentDef(virNetworkObj *network); int -virNetworkObjReplacePersistentDef(virNetworkObjPtr network, - virNetworkDefPtr def); +virNetworkObjReplacePersistentDef(virNetworkObj *network, + virNetworkDef *def); void -virNetworkObjRemoveInactive(virNetworkObjListPtr nets, - virNetworkObjPtr net); +virNetworkObjRemoveInactive(virNetworkObjList *nets, + virNetworkObj *net); int -virNetworkObjAddPort(virNetworkObjPtr net, - virNetworkPortDefPtr portdef, +virNetworkObjAddPort(virNetworkObj *net, + virNetworkPortDef *portdef, const char *stateDir); char * -virNetworkObjGetPortStatusDir(virNetworkObjPtr net, +virNetworkObjGetPortStatusDir(virNetworkObj *net, const char *stateDir); -virNetworkPortDefPtr -virNetworkObjLookupPort(virNetworkObjPtr net, +virNetworkPortDef * +virNetworkObjLookupPort(virNetworkObj *net, const unsigned char *uuid); int -virNetworkObjDeletePort(virNetworkObjPtr net, +virNetworkObjDeletePort(virNetworkObj *net, const unsigned char *uuid, const char *stateDir); int -virNetworkObjDeleteAllPorts(virNetworkObjPtr net, +virNetworkObjDeleteAllPorts(virNetworkObj *net, const char *stateDir); typedef bool (*virNetworkPortListFilter)(virConnectPtr conn, - virNetworkDefPtr def, - virNetworkPortDefPtr portdef); + virNetworkDef *def, + virNetworkPortDef *portdef); int virNetworkObjPortListExport(virNetworkPtr net, - virNetworkObjPtr obj, + virNetworkObj *obj, virNetworkPortPtr **ports, virNetworkPortListFilter filter); typedef bool -(*virNetworkPortListIter)(virNetworkPortDefPtr portdef, +(*virNetworkPortListIter)(virNetworkPortDef *portdef, void *opaque); int -virNetworkObjPortForEach(virNetworkObjPtr obj, +virNetworkObjPortForEach(virNetworkObj *obj, virNetworkPortListIter iter, void *opaque); int virNetworkObjSaveStatus(const char *statusDir, - virNetworkObjPtr net, - virNetworkXMLOptionPtr xmlopt) G_GNUC_WARN_UNUSED_RESULT; + virNetworkObj *net, + virNetworkXMLOption *xmlopt) G_GNUC_WARN_UNUSED_RESULT; int -virNetworkObjLoadAllConfigs(virNetworkObjListPtr nets, +virNetworkObjLoadAllConfigs(virNetworkObjList *nets, const char *configDir, const char *autostartDir, - virNetworkXMLOptionPtr xmlopt); + virNetworkXMLOption *xmlopt); int -virNetworkObjLoadAllState(virNetworkObjListPtr nets, +virNetworkObjLoadAllState(virNetworkObjList *nets, const char *stateDir, - virNetworkXMLOptionPtr xmlopt); + virNetworkXMLOption *xmlopt); int virNetworkObjDeleteConfig(const char *configDir, const char *autostartDir, - virNetworkObjPtr net); + virNetworkObj *net); bool -virNetworkObjBridgeInUse(virNetworkObjListPtr nets, +virNetworkObjBridgeInUse(virNetworkObjList *nets, const char *bridge, const char *skipname); int -virNetworkObjUpdate(virNetworkObjPtr obj, +virNetworkObjUpdate(virNetworkObj *obj, unsigned int command, /* virNetworkUpdateCommand */ unsigned int section, /* virNetworkUpdateSection */ int parentIndex, const char *xml, - virNetworkXMLOptionPtr xmlopt, + virNetworkXMLOption *xmlopt, unsigned int flags); /* virNetworkUpdateFlags */ int virNetworkObjListExport(virConnectPtr conn, - virNetworkObjListPtr netobjs, + virNetworkObjList *netobjs, virNetworkPtr **nets, virNetworkObjListFilter filter, unsigned int flags); typedef int -(*virNetworkObjListIterator)(virNetworkObjPtr net, +(*virNetworkObjListIterator)(virNetworkObj *net, void *opaque); int -virNetworkObjListForEach(virNetworkObjListPtr nets, +virNetworkObjListForEach(virNetworkObjList *nets, virNetworkObjListIterator callback, void *opaque); int -virNetworkObjListGetNames(virNetworkObjListPtr nets, +virNetworkObjListGetNames(virNetworkObjList *nets, bool active, char **names, int maxnames, @@ -259,11 +257,11 @@ virNetworkObjListGetNames(virNetworkObjListPtr nets, virConnectPtr conn); int -virNetworkObjListNumOfNetworks(virNetworkObjListPtr nets, +virNetworkObjListNumOfNetworks(virNetworkObjList *nets, bool active, virNetworkObjListFilter filter, virConnectPtr conn); void -virNetworkObjListPrune(virNetworkObjListPtr nets, +virNetworkObjListPrune(virNetworkObjList *nets, unsigned int flags); diff --git a/src/conf/virnetworkportdef.c b/src/conf/virnetworkportdef.c index 3923d2aa37..adda66590a 100644 --- a/src/conf/virnetworkportdef.c +++ b/src/conf/virnetworkportdef.c @@ -40,7 +40,7 @@ VIR_ENUM_IMPL(virNetworkPortPlug, "none", "network", "bridge", "direct", "hostdev-pci"); void -virNetworkPortDefFree(virNetworkPortDefPtr def) +virNetworkPortDefFree(virNetworkPortDef *def) { if (!def) return; @@ -78,7 +78,7 @@ virNetworkPortDefFree(virNetworkPortDefPtr def) -static virNetworkPortDefPtr +static virNetworkPortDef * virNetworkPortDefParseXML(xmlXPathContextPtr ctxt) { g_autoptr(virNetworkPortDef) def = NULL; @@ -264,12 +264,12 @@ virNetworkPortDefParseXML(xmlXPathContextPtr ctxt) } -virNetworkPortDefPtr +virNetworkPortDef * virNetworkPortDefParseNode(xmlDocPtr xml, xmlNodePtr root) { xmlXPathContextPtr ctxt = NULL; - virNetworkPortDefPtr def = NULL; + virNetworkPortDef *def = NULL; if (STRNEQ((const char *)root->name, "networkport")) { virReportError(VIR_ERR_XML_ERROR, @@ -290,11 +290,11 @@ virNetworkPortDefParseNode(xmlDocPtr xml, } -static virNetworkPortDefPtr +static virNetworkPortDef * virNetworkPortDefParse(const char *xmlStr, const char *filename) { - virNetworkPortDefPtr def = NULL; + virNetworkPortDef *def = NULL; xmlDocPtr xml; if ((xml = virXMLParse(filename, xmlStr, _("(networkport_definition)")))) { @@ -306,14 +306,14 @@ virNetworkPortDefParse(const char *xmlStr, } -virNetworkPortDefPtr +virNetworkPortDef * virNetworkPortDefParseString(const char *xmlStr) { return virNetworkPortDefParse(xmlStr, NULL); } -virNetworkPortDefPtr +virNetworkPortDef * virNetworkPortDefParseFile(const char *filename) { return virNetworkPortDefParse(NULL, filename); @@ -333,7 +333,7 @@ virNetworkPortDefFormat(const virNetworkPortDef *def) int -virNetworkPortDefFormatBuf(virBufferPtr buf, +virNetworkPortDefFormatBuf(virBuffer *buf, const virNetworkPortDef *def) { char uuid[VIR_UUID_STRING_BUFLEN]; diff --git a/src/conf/virnetworkportdef.h b/src/conf/virnetworkportdef.h index 72da8b6915..0ac232d16a 100644 --- a/src/conf/virnetworkportdef.h +++ b/src/conf/virnetworkportdef.h @@ -30,7 +30,6 @@ #include "virxml.h" typedef struct _virNetworkPortDef virNetworkPortDef; -typedef virNetworkPortDef *virNetworkPortDefPtr; typedef enum { VIR_NETWORK_PORT_PLUG_TYPE_NONE, @@ -52,8 +51,8 @@ struct _virNetworkPortDef { char *group; virMacAddr mac; - virNetDevVPortProfilePtr virtPortProfile; - virNetDevBandwidthPtr bandwidth; + virNetDevVPortProfile *virtPortProfile; + virNetDevBandwidth *bandwidth; unsigned int class_id; /* class ID for bandwidth 'floor' */ virNetDevVlan vlan; int trustGuestRxFilters; /* enum virTristateBool */ @@ -79,24 +78,24 @@ struct _virNetworkPortDef { void -virNetworkPortDefFree(virNetworkPortDefPtr port); +virNetworkPortDefFree(virNetworkPortDef *port); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetworkPortDef, virNetworkPortDefFree); -virNetworkPortDefPtr +virNetworkPortDef * virNetworkPortDefParseNode(xmlDocPtr xml, xmlNodePtr root); -virNetworkPortDefPtr +virNetworkPortDef * virNetworkPortDefParseString(const char *xml); -virNetworkPortDefPtr +virNetworkPortDef * virNetworkPortDefParseFile(const char *filename); char * virNetworkPortDefFormat(const virNetworkPortDef *def); int -virNetworkPortDefFormatBuf(virBufferPtr buf, +virNetworkPortDefFormatBuf(virBuffer *buf, const virNetworkPortDef *def); int diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c index 23fbaac889..b213592b56 100644 --- a/src/conf/virnodedeviceobj.c +++ b/src/conf/virnodedeviceobj.c @@ -36,7 +36,7 @@ VIR_LOG_INIT("conf.virnodedeviceobj"); struct _virNodeDeviceObj { virObjectLockable parent; - virNodeDeviceDefPtr def; /* device definition */ + virNodeDeviceDef *def; /* device definition */ bool skipUpdateCaps; /* whether to skip checking host caps, used by testdriver */ bool active; @@ -53,8 +53,8 @@ struct _virNodeDeviceObjList { }; -static virClassPtr virNodeDeviceObjClass; -static virClassPtr virNodeDeviceObjListClass; +static virClass *virNodeDeviceObjClass; +static virClass *virNodeDeviceObjListClass; static void virNodeDeviceObjDispose(void *opaque); static void virNodeDeviceObjListDispose(void *opaque); static bool virNodeDeviceObjHasCap(const virNodeDeviceObj *obj, int type); @@ -77,16 +77,16 @@ VIR_ONCE_GLOBAL_INIT(virNodeDeviceObj); static void virNodeDeviceObjDispose(void *opaque) { - virNodeDeviceObjPtr obj = opaque; + virNodeDeviceObj *obj = opaque; virNodeDeviceDefFree(obj->def); } -static virNodeDeviceObjPtr +static virNodeDeviceObj * virNodeDeviceObjNew(void) { - virNodeDeviceObjPtr obj; + virNodeDeviceObj *obj; if (virNodeDeviceObjInitialize() < 0) return NULL; @@ -101,7 +101,7 @@ virNodeDeviceObjNew(void) void -virNodeDeviceObjEndAPI(virNodeDeviceObjPtr *obj) +virNodeDeviceObjEndAPI(virNodeDeviceObj **obj) { if (!*obj) return; @@ -112,8 +112,8 @@ virNodeDeviceObjEndAPI(virNodeDeviceObjPtr *obj) } -virNodeDeviceDefPtr -virNodeDeviceObjGetDef(virNodeDeviceObjPtr obj) +virNodeDeviceDef * +virNodeDeviceObjGetDef(virNodeDeviceObj *obj) { return obj->def; } @@ -140,10 +140,10 @@ virNodeDeviceObjHasCapStr(const virNodeDeviceObj *obj, * Returns: * Pointer to the caps or NULL if not found */ -static virNodeDevCapsDefPtr +static virNodeDevCapsDef * virNodeDeviceFindFCCapDef(const virNodeDeviceObj *obj) { - virNodeDevCapsDefPtr caps = obj->def->caps; + virNodeDevCapsDef *caps = obj->def->caps; while (caps) { if (caps->data.type == VIR_NODE_DEV_CAP_SCSI_HOST && @@ -164,10 +164,10 @@ virNodeDeviceFindFCCapDef(const virNodeDeviceObj *obj) * Returns: * Pointer to the caps or NULL if not found */ -static virNodeDevCapsDefPtr +static virNodeDevCapsDef * virNodeDeviceFindVPORTCapDef(const virNodeDeviceObj *obj) { - virNodeDevCapsDefPtr caps = obj->def->caps; + virNodeDevCapsDef *caps = obj->def->caps; while (caps) { if (caps->data.type == VIR_NODE_DEV_CAP_SCSI_HOST && @@ -180,12 +180,12 @@ virNodeDeviceFindVPORTCapDef(const virNodeDeviceObj *obj) } -static virNodeDeviceObjPtr -virNodeDeviceObjListSearch(virNodeDeviceObjListPtr devs, +static virNodeDeviceObj * +virNodeDeviceObjListSearch(virNodeDeviceObjList *devs, virHashSearcher callback, const void *data) { - virNodeDeviceObjPtr obj; + virNodeDeviceObj *obj; virObjectRWLockRead(devs); obj = virHashSearch(devs->objs, callback, data, NULL); @@ -204,7 +204,7 @@ virNodeDeviceObjListFindBySysfsPathCallback(const void *payload, const char *name G_GNUC_UNUSED, const void *opaque) { - virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload; + virNodeDeviceObj *obj = (virNodeDeviceObj *) payload; const char *sysfs_path = opaque; int want = 0; @@ -217,8 +217,8 @@ virNodeDeviceObjListFindBySysfsPathCallback(const void *payload, } -virNodeDeviceObjPtr -virNodeDeviceObjListFindBySysfsPath(virNodeDeviceObjListPtr devs, +virNodeDeviceObj * +virNodeDeviceObjListFindBySysfsPath(virNodeDeviceObjList *devs, const char *sysfs_path) { return virNodeDeviceObjListSearch(devs, @@ -227,19 +227,19 @@ virNodeDeviceObjListFindBySysfsPath(virNodeDeviceObjListPtr devs, } -static virNodeDeviceObjPtr -virNodeDeviceObjListFindByNameLocked(virNodeDeviceObjListPtr devs, +static virNodeDeviceObj * +virNodeDeviceObjListFindByNameLocked(virNodeDeviceObjList *devs, const char *name) { return virObjectRef(virHashLookup(devs->objs, name)); } -virNodeDeviceObjPtr -virNodeDeviceObjListFindByName(virNodeDeviceObjListPtr devs, +virNodeDeviceObj * +virNodeDeviceObjListFindByName(virNodeDeviceObjList *devs, const char *name) { - virNodeDeviceObjPtr obj; + virNodeDeviceObj *obj; virObjectRWLockRead(devs); obj = virNodeDeviceObjListFindByNameLocked(devs, name); @@ -261,10 +261,10 @@ virNodeDeviceObjListFindByWWNsCallback(const void *payload, const char *name G_GNUC_UNUSED, const void *opaque) { - virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload; + virNodeDeviceObj *obj = (virNodeDeviceObj *) payload; struct virNodeDeviceObjListFindByWWNsData *data = (struct virNodeDeviceObjListFindByWWNsData *) opaque; - virNodeDevCapsDefPtr cap; + virNodeDevCapsDef *cap; int want = 0; virObjectLock(obj); @@ -278,8 +278,8 @@ virNodeDeviceObjListFindByWWNsCallback(const void *payload, } -static virNodeDeviceObjPtr -virNodeDeviceObjListFindByWWNs(virNodeDeviceObjListPtr devs, +static virNodeDeviceObj * +virNodeDeviceObjListFindByWWNs(virNodeDeviceObjList *devs, const char *parent_wwnn, const char *parent_wwpn) { @@ -297,9 +297,9 @@ virNodeDeviceObjListFindByFabricWWNCallback(const void *payload, const char *name G_GNUC_UNUSED, const void *opaque) { - virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload; + virNodeDeviceObj *obj = (virNodeDeviceObj *) payload; const char *matchstr = opaque; - virNodeDevCapsDefPtr cap; + virNodeDevCapsDef *cap; int want = 0; virObjectLock(obj); @@ -312,8 +312,8 @@ virNodeDeviceObjListFindByFabricWWNCallback(const void *payload, } -static virNodeDeviceObjPtr -virNodeDeviceObjListFindByFabricWWN(virNodeDeviceObjListPtr devs, +static virNodeDeviceObj * +virNodeDeviceObjListFindByFabricWWN(virNodeDeviceObjList *devs, const char *parent_fabric_wwn) { return virNodeDeviceObjListSearch(devs, @@ -327,7 +327,7 @@ virNodeDeviceObjListFindByCapCallback(const void *payload, const char *name G_GNUC_UNUSED, const void *opaque) { - virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload; + virNodeDeviceObj *obj = (virNodeDeviceObj *) payload; const char *matchstr = opaque; int want = 0; @@ -339,8 +339,8 @@ virNodeDeviceObjListFindByCapCallback(const void *payload, } -static virNodeDeviceObjPtr -virNodeDeviceObjListFindByCap(virNodeDeviceObjListPtr devs, +static virNodeDeviceObj * +virNodeDeviceObjListFindByCap(virNodeDeviceObjList *devs, const char *cap) { return virNodeDeviceObjListSearch(devs, @@ -359,10 +359,10 @@ virNodeDeviceObjListFindSCSIHostByWWNsCallback(const void *payload, const char *name G_GNUC_UNUSED, const void *opaque) { - virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload; + virNodeDeviceObj *obj = (virNodeDeviceObj *) payload; struct virNodeDeviceObjListFindSCSIHostByWWNsData *data = (struct virNodeDeviceObjListFindSCSIHostByWWNsData *) opaque; - virNodeDevCapsDefPtr cap; + virNodeDevCapsDef *cap; int want = 0; virObjectLock(obj); @@ -388,8 +388,8 @@ virNodeDeviceObjListFindSCSIHostByWWNsCallback(const void *payload, } -virNodeDeviceObjPtr -virNodeDeviceObjListFindSCSIHostByWWNs(virNodeDeviceObjListPtr devs, +virNodeDeviceObj * +virNodeDeviceObjListFindSCSIHostByWWNs(virNodeDeviceObjList *devs, const char *wwnn, const char *wwpn) { @@ -406,9 +406,9 @@ virNodeDeviceObjListFindMediatedDeviceByUUIDCallback(const void *payload, const char *name G_GNUC_UNUSED, const void *opaque) { - virNodeDeviceObjPtr obj = (virNodeDeviceObjPtr) payload; + virNodeDeviceObj *obj = (virNodeDeviceObj *) payload; const char *uuid = (const char *) opaque; - virNodeDevCapsDefPtr cap; + virNodeDevCapsDef *cap; int want = 0; virObjectLock(obj); @@ -427,8 +427,8 @@ virNodeDeviceObjListFindMediatedDeviceByUUIDCallback(const void *payload, } -virNodeDeviceObjPtr -virNodeDeviceObjListFindMediatedDeviceByUUID(virNodeDeviceObjListPtr devs, +virNodeDeviceObj * +virNodeDeviceObjListFindMediatedDeviceByUUID(virNodeDeviceObjList *devs, const char *uuid) { return virNodeDeviceObjListSearch(devs, @@ -439,16 +439,16 @@ virNodeDeviceObjListFindMediatedDeviceByUUID(virNodeDeviceObjListPtr devs, static void virNodeDeviceObjListDispose(void *obj) { - virNodeDeviceObjListPtr devs = obj; + virNodeDeviceObjList *devs = obj; virHashFree(devs->objs); } -virNodeDeviceObjListPtr +virNodeDeviceObjList * virNodeDeviceObjListNew(void) { - virNodeDeviceObjListPtr devs; + virNodeDeviceObjList *devs; if (virNodeDeviceObjInitialize() < 0) return NULL; @@ -466,17 +466,17 @@ virNodeDeviceObjListNew(void) void -virNodeDeviceObjListFree(virNodeDeviceObjListPtr devs) +virNodeDeviceObjListFree(virNodeDeviceObjList *devs) { virObjectUnref(devs); } -virNodeDeviceObjPtr -virNodeDeviceObjListAssignDef(virNodeDeviceObjListPtr devs, - virNodeDeviceDefPtr def) +virNodeDeviceObj * +virNodeDeviceObjListAssignDef(virNodeDeviceObjList *devs, + virNodeDeviceDef *def) { - virNodeDeviceObjPtr obj; + virNodeDeviceObj *obj; virObjectRWLockWrite(devs); @@ -504,8 +504,8 @@ virNodeDeviceObjListAssignDef(virNodeDeviceObjListPtr devs, void -virNodeDeviceObjListRemove(virNodeDeviceObjListPtr devs, - virNodeDeviceObjPtr obj) +virNodeDeviceObjListRemove(virNodeDeviceObjList *devs, + virNodeDeviceObj *obj) { if (!obj) return; @@ -543,9 +543,9 @@ virNodeDeviceObjListRemoveLocked(virNodeDeviceObjList *devs, * parent_host value on success (>= 0), -1 otherwise. */ static int -virNodeDeviceFindFCParentHost(virNodeDeviceObjPtr obj) +virNodeDeviceFindFCParentHost(virNodeDeviceObj *obj) { - virNodeDevCapsDefPtr cap = virNodeDeviceFindVPORTCapDef(obj); + virNodeDevCapsDef *cap = virNodeDeviceFindVPORTCapDef(obj); if (!cap) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -560,11 +560,11 @@ virNodeDeviceFindFCParentHost(virNodeDeviceObjPtr obj) static int -virNodeDeviceObjListGetParentHostByParent(virNodeDeviceObjListPtr devs, +virNodeDeviceObjListGetParentHostByParent(virNodeDeviceObjList *devs, const char *dev_name, const char *parent_name) { - virNodeDeviceObjPtr obj = NULL; + virNodeDeviceObj *obj = NULL; int ret; if (!(obj = virNodeDeviceObjListFindByName(devs, parent_name))) { @@ -583,12 +583,12 @@ virNodeDeviceObjListGetParentHostByParent(virNodeDeviceObjListPtr devs, static int -virNodeDeviceObjListGetParentHostByWWNs(virNodeDeviceObjListPtr devs, +virNodeDeviceObjListGetParentHostByWWNs(virNodeDeviceObjList *devs, const char *dev_name, const char *parent_wwnn, const char *parent_wwpn) { - virNodeDeviceObjPtr obj = NULL; + virNodeDeviceObj *obj = NULL; int ret; if (!(obj = virNodeDeviceObjListFindByWWNs(devs, parent_wwnn, @@ -608,11 +608,11 @@ virNodeDeviceObjListGetParentHostByWWNs(virNodeDeviceObjListPtr devs, static int -virNodeDeviceObjListGetParentHostByFabricWWN(virNodeDeviceObjListPtr devs, +virNodeDeviceObjListGetParentHostByFabricWWN(virNodeDeviceObjList *devs, const char *dev_name, const char *parent_fabric_wwn) { - virNodeDeviceObjPtr obj = NULL; + virNodeDeviceObj *obj = NULL; int ret; if (!(obj = virNodeDeviceObjListFindByFabricWWN(devs, parent_fabric_wwn))) { @@ -631,9 +631,9 @@ virNodeDeviceObjListGetParentHostByFabricWWN(virNodeDeviceObjListPtr devs, static int -virNodeDeviceObjListFindVportParentHost(virNodeDeviceObjListPtr devs) +virNodeDeviceObjListFindVportParentHost(virNodeDeviceObjList *devs) { - virNodeDeviceObjPtr obj = NULL; + virNodeDeviceObj *obj = NULL; const char *cap = virNodeDevCapTypeToString(VIR_NODE_DEV_CAP_VPORTS); int ret; @@ -652,8 +652,8 @@ virNodeDeviceObjListFindVportParentHost(virNodeDeviceObjListPtr devs) int -virNodeDeviceObjListGetParentHost(virNodeDeviceObjListPtr devs, - virNodeDeviceDefPtr def) +virNodeDeviceObjListGetParentHost(virNodeDeviceObjList *devs, + virNodeDeviceDef *def) { int parent_host = -1; @@ -681,7 +681,7 @@ static bool virNodeDeviceObjHasCap(const virNodeDeviceObj *obj, int type) { - virNodeDevCapsDefPtr cap = NULL; + virNodeDevCapsDef *cap = NULL; for (cap = obj->def->caps; cap; cap = cap->next) { if (type == cap->data.type) @@ -754,8 +754,8 @@ virNodeDeviceObjListNumOfDevicesCallback(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virNodeDeviceObjPtr obj = payload; - virNodeDeviceDefPtr def; + virNodeDeviceObj *obj = payload; + virNodeDeviceDef *def; struct virNodeDeviceCountData *data = opaque; virNodeDeviceObjListFilter filter = data->filter; @@ -771,7 +771,7 @@ virNodeDeviceObjListNumOfDevicesCallback(void *payload, int -virNodeDeviceObjListNumOfDevices(virNodeDeviceObjListPtr devs, +virNodeDeviceObjListNumOfDevices(virNodeDeviceObjList *devs, virConnectPtr conn, const char *cap, virNodeDeviceObjListFilter filter) @@ -802,8 +802,8 @@ virNodeDeviceObjListGetNamesCallback(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virNodeDeviceObjPtr obj = payload; - virNodeDeviceDefPtr def; + virNodeDeviceObj *obj = payload; + virNodeDeviceDef *def; struct virNodeDeviceGetNamesData *data = opaque; virNodeDeviceObjListFilter filter = data->filter; @@ -828,7 +828,7 @@ virNodeDeviceObjListGetNamesCallback(void *payload, int -virNodeDeviceObjListGetNames(virNodeDeviceObjListPtr devs, +virNodeDeviceObjListGetNames(virNodeDeviceObjList *devs, virConnectPtr conn, virNodeDeviceObjListFilter filter, const char *cap, @@ -860,7 +860,7 @@ virNodeDeviceObjListGetNames(virNodeDeviceObjListPtr devs, #define MATCH(FLAG) (flags & (FLAG)) static bool -virNodeDeviceObjMatch(virNodeDeviceObjPtr obj, +virNodeDeviceObjMatch(virNodeDeviceObj *obj, unsigned int flags) { /* Refresh the capabilities first, e.g. due to a driver change */ @@ -909,7 +909,6 @@ virNodeDeviceObjMatch(virNodeDeviceObjPtr obj, typedef struct _virNodeDeviceObjListExportData virNodeDeviceObjListExportData; -typedef virNodeDeviceObjListExportData *virNodeDeviceObjListExportDataPtr; struct _virNodeDeviceObjListExportData { virConnectPtr conn; virNodeDeviceObjListFilter filter; @@ -924,9 +923,9 @@ virNodeDeviceObjListExportCallback(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virNodeDeviceObjPtr obj = payload; - virNodeDeviceDefPtr def; - virNodeDeviceObjListExportDataPtr data = opaque; + virNodeDeviceObj *obj = payload; + virNodeDeviceDef *def; + virNodeDeviceObjListExportData *data = opaque; virNodeDevicePtr device = NULL; if (data->error) @@ -957,7 +956,7 @@ virNodeDeviceObjListExportCallback(void *payload, int virNodeDeviceObjListExport(virConnectPtr conn, - virNodeDeviceObjListPtr devs, + virNodeDeviceObjList *devs, virNodeDevicePtr **devices, virNodeDeviceObjListFilter filter, unsigned int flags) @@ -990,7 +989,7 @@ virNodeDeviceObjListExport(virConnectPtr conn, void -virNodeDeviceObjSetSkipUpdateCaps(virNodeDeviceObjPtr obj, +virNodeDeviceObjSetSkipUpdateCaps(virNodeDeviceObj *obj, bool skipUpdateCaps) { obj->skipUpdateCaps = skipUpdateCaps; diff --git a/src/conf/virnodedeviceobj.h b/src/conf/virnodedeviceobj.h index a41742c257..7353e4619b 100644 --- a/src/conf/virnodedeviceobj.h +++ b/src/conf/virnodedeviceobj.h @@ -27,13 +27,10 @@ typedef struct _virNodeDeviceObj virNodeDeviceObj; -typedef virNodeDeviceObj *virNodeDeviceObjPtr; typedef struct _virNodeDeviceObjList virNodeDeviceObjList; -typedef virNodeDeviceObjList *virNodeDeviceObjListPtr; typedef struct _virNodeDeviceDriverState virNodeDeviceDriverState; -typedef virNodeDeviceDriverState *virNodeDeviceDriverStatePtr; struct _virNodeDeviceDriverState { virMutex lock; virCond initCond; @@ -44,68 +41,68 @@ struct _virNodeDeviceDriverState { char *stateDir; - virNodeDeviceObjListPtr devs; /* currently-known devices */ + virNodeDeviceObjList *devs; /* currently-known devices */ void *privateData; /* driver-specific private data */ bool privileged; /* whether we run in privileged mode */ /* Immutable pointer, self-locking APIs */ - virObjectEventStatePtr nodeDeviceEventState; + virObjectEventState *nodeDeviceEventState; }; void -virNodeDeviceObjEndAPI(virNodeDeviceObjPtr *obj); +virNodeDeviceObjEndAPI(virNodeDeviceObj **obj); -virNodeDeviceDefPtr -virNodeDeviceObjGetDef(virNodeDeviceObjPtr obj); +virNodeDeviceDef * +virNodeDeviceObjGetDef(virNodeDeviceObj *obj); -virNodeDeviceObjPtr -virNodeDeviceObjListFindByName(virNodeDeviceObjListPtr devs, +virNodeDeviceObj * +virNodeDeviceObjListFindByName(virNodeDeviceObjList *devs, const char *name); -virNodeDeviceObjPtr -virNodeDeviceObjListFindBySysfsPath(virNodeDeviceObjListPtr devs, +virNodeDeviceObj * +virNodeDeviceObjListFindBySysfsPath(virNodeDeviceObjList *devs, const char *sysfs_path) ATTRIBUTE_NONNULL(2); -virNodeDeviceObjPtr -virNodeDeviceObjListFindSCSIHostByWWNs(virNodeDeviceObjListPtr devs, +virNodeDeviceObj * +virNodeDeviceObjListFindSCSIHostByWWNs(virNodeDeviceObjList *devs, const char *wwnn, const char *wwpn); -virNodeDeviceObjPtr -virNodeDeviceObjListAssignDef(virNodeDeviceObjListPtr devs, - virNodeDeviceDefPtr def); +virNodeDeviceObj * +virNodeDeviceObjListAssignDef(virNodeDeviceObjList *devs, + virNodeDeviceDef *def); void -virNodeDeviceObjListRemove(virNodeDeviceObjListPtr devs, - virNodeDeviceObjPtr dev); +virNodeDeviceObjListRemove(virNodeDeviceObjList *devs, + virNodeDeviceObj *dev); void virNodeDeviceObjListRemoveLocked(virNodeDeviceObjList *devs, virNodeDeviceObj *dev); int -virNodeDeviceObjListGetParentHost(virNodeDeviceObjListPtr devs, - virNodeDeviceDefPtr def); +virNodeDeviceObjListGetParentHost(virNodeDeviceObjList *devs, + virNodeDeviceDef *def); -virNodeDeviceObjListPtr +virNodeDeviceObjList * virNodeDeviceObjListNew(void); void -virNodeDeviceObjListFree(virNodeDeviceObjListPtr devs); +virNodeDeviceObjListFree(virNodeDeviceObjList *devs); typedef bool (*virNodeDeviceObjListFilter)(virConnectPtr conn, - virNodeDeviceDefPtr def); + virNodeDeviceDef *def); int -virNodeDeviceObjListNumOfDevices(virNodeDeviceObjListPtr devs, +virNodeDeviceObjListNumOfDevices(virNodeDeviceObjList *devs, virConnectPtr conn, const char *cap, virNodeDeviceObjListFilter filter); int -virNodeDeviceObjListGetNames(virNodeDeviceObjListPtr devs, +virNodeDeviceObjListGetNames(virNodeDeviceObjList *devs, virConnectPtr conn, virNodeDeviceObjListFilter filter, const char *cap, @@ -114,16 +111,16 @@ virNodeDeviceObjListGetNames(virNodeDeviceObjListPtr devs, int virNodeDeviceObjListExport(virConnectPtr conn, - virNodeDeviceObjListPtr devobjs, + virNodeDeviceObjList *devobjs, virNodeDevicePtr **devices, virNodeDeviceObjListFilter filter, unsigned int flags); void -virNodeDeviceObjSetSkipUpdateCaps(virNodeDeviceObjPtr obj, +virNodeDeviceObjSetSkipUpdateCaps(virNodeDeviceObj *obj, bool skipUpdateCaps); -virNodeDeviceObjPtr -virNodeDeviceObjListFindMediatedDeviceByUUID(virNodeDeviceObjListPtr devs, +virNodeDeviceObj * +virNodeDeviceObjListFindMediatedDeviceByUUID(virNodeDeviceObjList *devs, const char *uuid); bool diff --git a/src/conf/virnwfilterbindingdef.c b/src/conf/virnwfilterbindingdef.c index a3f90b86bb..98df1f750a 100644 --- a/src/conf/virnwfilterbindingdef.c +++ b/src/conf/virnwfilterbindingdef.c @@ -31,7 +31,7 @@ #define VIR_FROM_THIS VIR_FROM_NWFILTER void -virNWFilterBindingDefFree(virNWFilterBindingDefPtr def) +virNWFilterBindingDefFree(virNWFilterBindingDef *def) { if (!def) return; @@ -46,10 +46,10 @@ virNWFilterBindingDefFree(virNWFilterBindingDefPtr def) } -virNWFilterBindingDefPtr -virNWFilterBindingDefCopy(virNWFilterBindingDefPtr src) +virNWFilterBindingDef * +virNWFilterBindingDefCopy(virNWFilterBindingDef *src) { - virNWFilterBindingDefPtr ret; + virNWFilterBindingDef *ret; ret = g_new0(virNWFilterBindingDef, 1); @@ -79,10 +79,10 @@ virNWFilterBindingDefCopy(virNWFilterBindingDefPtr src) } -static virNWFilterBindingDefPtr +static virNWFilterBindingDef * virNWFilterBindingDefParseXML(xmlXPathContextPtr ctxt) { - virNWFilterBindingDefPtr ret; + virNWFilterBindingDef *ret; char *uuid = NULL; char *mac = NULL; xmlNodePtr node; @@ -162,12 +162,12 @@ virNWFilterBindingDefParseXML(xmlXPathContextPtr ctxt) } -virNWFilterBindingDefPtr +virNWFilterBindingDef * virNWFilterBindingDefParseNode(xmlDocPtr xml, xmlNodePtr root) { xmlXPathContextPtr ctxt = NULL; - virNWFilterBindingDefPtr def = NULL; + virNWFilterBindingDef *def = NULL; if (STRNEQ((const char *)root->name, "filterbinding")) { virReportError(VIR_ERR_XML_ERROR, @@ -188,11 +188,11 @@ virNWFilterBindingDefParseNode(xmlDocPtr xml, } -static virNWFilterBindingDefPtr +static virNWFilterBindingDef * virNWFilterBindingDefParse(const char *xmlStr, const char *filename) { - virNWFilterBindingDefPtr def = NULL; + virNWFilterBindingDef *def = NULL; xmlDocPtr xml; if ((xml = virXMLParse(filename, xmlStr, _("(nwfilterbinding_definition)")))) { @@ -204,14 +204,14 @@ virNWFilterBindingDefParse(const char *xmlStr, } -virNWFilterBindingDefPtr +virNWFilterBindingDef * virNWFilterBindingDefParseString(const char *xmlStr) { return virNWFilterBindingDefParse(xmlStr, NULL); } -virNWFilterBindingDefPtr +virNWFilterBindingDef * virNWFilterBindingDefParseFile(const char *filename) { return virNWFilterBindingDefParse(NULL, filename); @@ -231,7 +231,7 @@ virNWFilterBindingDefFormat(const virNWFilterBindingDef *def) int -virNWFilterBindingDefFormatBuf(virBufferPtr buf, +virNWFilterBindingDefFormatBuf(virBuffer *buf, const virNWFilterBindingDef *def) { char uuid[VIR_UUID_STRING_BUFLEN]; diff --git a/src/conf/virnwfilterbindingdef.h b/src/conf/virnwfilterbindingdef.h index ef4f9d7e7e..0e52789332 100644 --- a/src/conf/virnwfilterbindingdef.h +++ b/src/conf/virnwfilterbindingdef.h @@ -28,8 +28,6 @@ #include "virxml.h" typedef struct _virNWFilterBindingDef virNWFilterBindingDef; -typedef virNWFilterBindingDef *virNWFilterBindingDefPtr; - struct _virNWFilterBindingDef { char *ownername; unsigned char owneruuid[VIR_UUID_BUFLEN]; @@ -42,23 +40,23 @@ struct _virNWFilterBindingDef { void -virNWFilterBindingDefFree(virNWFilterBindingDefPtr binding); -virNWFilterBindingDefPtr -virNWFilterBindingDefCopy(virNWFilterBindingDefPtr src); +virNWFilterBindingDefFree(virNWFilterBindingDef *binding); +virNWFilterBindingDef * +virNWFilterBindingDefCopy(virNWFilterBindingDef *src); -virNWFilterBindingDefPtr +virNWFilterBindingDef * virNWFilterBindingDefParseNode(xmlDocPtr xml, xmlNodePtr root); -virNWFilterBindingDefPtr +virNWFilterBindingDef * virNWFilterBindingDefParseString(const char *xml); -virNWFilterBindingDefPtr +virNWFilterBindingDef * virNWFilterBindingDefParseFile(const char *filename); char * virNWFilterBindingDefFormat(const virNWFilterBindingDef *def); int -virNWFilterBindingDefFormatBuf(virBufferPtr buf, +virNWFilterBindingDefFormatBuf(virBuffer *buf, const virNWFilterBindingDef *def); diff --git a/src/conf/virnwfilterbindingobj.c b/src/conf/virnwfilterbindingobj.c index 2f29670f9f..d48c95af88 100644 --- a/src/conf/virnwfilterbindingobj.c +++ b/src/conf/virnwfilterbindingobj.c @@ -36,11 +36,11 @@ struct _virNWFilterBindingObj { virObjectLockable parent; bool removing; - virNWFilterBindingDefPtr def; + virNWFilterBindingDef *def; }; -static virClassPtr virNWFilterBindingObjClass; +static virClass *virNWFilterBindingObjClass; static void virNWFilterBindingObjDispose(void *obj); static int @@ -54,7 +54,7 @@ virNWFilterBindingObjOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNWFilterBindingObj); -virNWFilterBindingObjPtr +virNWFilterBindingObj * virNWFilterBindingObjNew(void) { if (virNWFilterBindingObjInitialize() < 0) @@ -67,44 +67,44 @@ virNWFilterBindingObjNew(void) static void virNWFilterBindingObjDispose(void *obj) { - virNWFilterBindingObjPtr bobj = obj; + virNWFilterBindingObj *bobj = obj; virNWFilterBindingDefFree(bobj->def); } -virNWFilterBindingDefPtr -virNWFilterBindingObjGetDef(virNWFilterBindingObjPtr obj) +virNWFilterBindingDef * +virNWFilterBindingObjGetDef(virNWFilterBindingObj *obj) { return obj->def; } void -virNWFilterBindingObjSetDef(virNWFilterBindingObjPtr obj, - virNWFilterBindingDefPtr def) +virNWFilterBindingObjSetDef(virNWFilterBindingObj *obj, + virNWFilterBindingDef *def) { virNWFilterBindingDefFree(obj->def); obj->def = def; } -virNWFilterBindingDefPtr -virNWFilterBindingObjStealDef(virNWFilterBindingObjPtr obj) +virNWFilterBindingDef * +virNWFilterBindingObjStealDef(virNWFilterBindingObj *obj) { return g_steal_pointer(&obj->def); } bool -virNWFilterBindingObjGetRemoving(virNWFilterBindingObjPtr obj) +virNWFilterBindingObjGetRemoving(virNWFilterBindingObj *obj) { return obj->removing; } void -virNWFilterBindingObjSetRemoving(virNWFilterBindingObjPtr obj, +virNWFilterBindingObjSetRemoving(virNWFilterBindingObj *obj, bool removing) { obj->removing = removing; @@ -123,7 +123,7 @@ virNWFilterBindingObjSetRemoving(virNWFilterBindingObjPtr obj, * the object, the pointer is cleared. */ void -virNWFilterBindingObjEndAPI(virNWFilterBindingObjPtr *obj) +virNWFilterBindingObjEndAPI(virNWFilterBindingObj **obj) { if (!*obj) return; @@ -205,11 +205,11 @@ virNWFilterBindingObjDelete(const virNWFilterBindingObj *obj, } -static virNWFilterBindingObjPtr +static virNWFilterBindingObj * virNWFilterBindingObjParseXML(xmlDocPtr doc, xmlXPathContextPtr ctxt) { - virNWFilterBindingObjPtr ret; + virNWFilterBindingObj *ret; xmlNodePtr node; if (!(ret = virNWFilterBindingObjNew())) @@ -232,12 +232,12 @@ virNWFilterBindingObjParseXML(xmlDocPtr doc, } -static virNWFilterBindingObjPtr +static virNWFilterBindingObj * virNWFilterBindingObjParseNode(xmlDocPtr doc, xmlNodePtr root) { xmlXPathContextPtr ctxt = NULL; - virNWFilterBindingObjPtr obj = NULL; + virNWFilterBindingObj *obj = NULL; if (STRNEQ((const char *)root->name, "filterbindingstatus")) { virReportError(VIR_ERR_XML_ERROR, @@ -258,11 +258,11 @@ virNWFilterBindingObjParseNode(xmlDocPtr doc, } -static virNWFilterBindingObjPtr +static virNWFilterBindingObj * virNWFilterBindingObjParse(const char *xmlStr, const char *filename) { - virNWFilterBindingObjPtr obj = NULL; + virNWFilterBindingObj *obj = NULL; xmlDocPtr xml; if ((xml = virXMLParse(filename, xmlStr, _("(nwfilterbinding_status)")))) { @@ -274,7 +274,7 @@ virNWFilterBindingObjParse(const char *xmlStr, } -virNWFilterBindingObjPtr +virNWFilterBindingObj * virNWFilterBindingObjParseFile(const char *filename) { return virNWFilterBindingObjParse(NULL, filename); diff --git a/src/conf/virnwfilterbindingobj.h b/src/conf/virnwfilterbindingobj.h index 2318f042bc..93f693936e 100644 --- a/src/conf/virnwfilterbindingobj.h +++ b/src/conf/virnwfilterbindingobj.h @@ -26,30 +26,29 @@ #include "virobject.h" typedef struct _virNWFilterBindingObj virNWFilterBindingObj; -typedef virNWFilterBindingObj *virNWFilterBindingObjPtr; -virNWFilterBindingObjPtr +virNWFilterBindingObj * virNWFilterBindingObjNew(void); -virNWFilterBindingDefPtr -virNWFilterBindingObjGetDef(virNWFilterBindingObjPtr obj); +virNWFilterBindingDef * +virNWFilterBindingObjGetDef(virNWFilterBindingObj *obj); void -virNWFilterBindingObjSetDef(virNWFilterBindingObjPtr obj, - virNWFilterBindingDefPtr def); +virNWFilterBindingObjSetDef(virNWFilterBindingObj *obj, + virNWFilterBindingDef *def); -virNWFilterBindingDefPtr -virNWFilterBindingObjStealDef(virNWFilterBindingObjPtr obj); +virNWFilterBindingDef * +virNWFilterBindingObjStealDef(virNWFilterBindingObj *obj); bool -virNWFilterBindingObjGetRemoving(virNWFilterBindingObjPtr obj); +virNWFilterBindingObjGetRemoving(virNWFilterBindingObj *obj); void -virNWFilterBindingObjSetRemoving(virNWFilterBindingObjPtr obj, +virNWFilterBindingObjSetRemoving(virNWFilterBindingObj *obj, bool removing); void -virNWFilterBindingObjEndAPI(virNWFilterBindingObjPtr *obj); +virNWFilterBindingObjEndAPI(virNWFilterBindingObj **obj); char * virNWFilterBindingObjConfigFile(const char *dir, @@ -63,7 +62,7 @@ int virNWFilterBindingObjDelete(const virNWFilterBindingObj *obj, const char *statusDir); -virNWFilterBindingObjPtr +virNWFilterBindingObj * virNWFilterBindingObjParseFile(const char *filename); char * diff --git a/src/conf/virnwfilterbindingobjlist.c b/src/conf/virnwfilterbindingobjlist.c index 7472c95bd4..fe97f2b3df 100644 --- a/src/conf/virnwfilterbindingobjlist.c +++ b/src/conf/virnwfilterbindingobjlist.c @@ -32,7 +32,7 @@ VIR_LOG_INIT("conf.virnwfilterbindingobjlist"); -static virClassPtr virNWFilterBindingObjListClass; +static virClass *virNWFilterBindingObjListClass; static void virNWFilterBindingObjListDispose(void *obj); struct _virNWFilterBindingObjList { @@ -55,10 +55,10 @@ static int virNWFilterBindingObjListOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNWFilterBindingObjList); -virNWFilterBindingObjListPtr +virNWFilterBindingObjList * virNWFilterBindingObjListNew(void) { - virNWFilterBindingObjListPtr bindings; + virNWFilterBindingObjList *bindings; if (virNWFilterBindingObjListInitialize() < 0) return NULL; @@ -78,17 +78,17 @@ virNWFilterBindingObjListNew(void) static void virNWFilterBindingObjListDispose(void *obj) { - virNWFilterBindingObjListPtr bindings = obj; + virNWFilterBindingObjList *bindings = obj; virHashFree(bindings->objs); } -static virNWFilterBindingObjPtr -virNWFilterBindingObjListFindByPortDevLocked(virNWFilterBindingObjListPtr bindings, +static virNWFilterBindingObj * +virNWFilterBindingObjListFindByPortDevLocked(virNWFilterBindingObjList *bindings, const char *name) { - virNWFilterBindingObjPtr obj; + virNWFilterBindingObj *obj; obj = virHashLookup(bindings->objs, name); if (obj) { @@ -107,11 +107,11 @@ virNWFilterBindingObjListFindByPortDevLocked(virNWFilterBindingObjListPtr bindin * locked and ref counted binding object if found. Caller is expected * to use the virNWFilterBindingObjEndAPI when done with the object. */ -virNWFilterBindingObjPtr -virNWFilterBindingObjListFindByPortDev(virNWFilterBindingObjListPtr bindings, +virNWFilterBindingObj * +virNWFilterBindingObjListFindByPortDev(virNWFilterBindingObjList *bindings, const char *name) { - virNWFilterBindingObjPtr obj; + virNWFilterBindingObj *obj; virObjectRWLockRead(bindings); obj = virNWFilterBindingObjListFindByPortDevLocked(bindings, name); @@ -144,10 +144,10 @@ virNWFilterBindingObjListFindByPortDev(virNWFilterBindingObjListPtr bindings, * -1 on failure with 1 reference and locked */ static int -virNWFilterBindingObjListAddObjLocked(virNWFilterBindingObjListPtr bindings, - virNWFilterBindingObjPtr binding) +virNWFilterBindingObjListAddObjLocked(virNWFilterBindingObjList *bindings, + virNWFilterBindingObj *binding) { - virNWFilterBindingDefPtr def = virNWFilterBindingObjGetDef(binding); + virNWFilterBindingDef *def = virNWFilterBindingObjGetDef(binding); if (virHashAddEntry(bindings->objs, def->portdevname, binding) < 0) return -1; virObjectRef(binding); @@ -163,11 +163,11 @@ virNWFilterBindingObjListAddObjLocked(virNWFilterBindingObjListPtr bindings, * counted. The caller is expected to use virNWFilterBindingObjEndAPI * when it completes usage. */ -static virNWFilterBindingObjPtr -virNWFilterBindingObjListAddLocked(virNWFilterBindingObjListPtr bindings, - virNWFilterBindingDefPtr def) +static virNWFilterBindingObj * +virNWFilterBindingObjListAddLocked(virNWFilterBindingObjList *bindings, + virNWFilterBindingDef *def) { - virNWFilterBindingObjPtr binding; + virNWFilterBindingObj *binding; bool stealDef = false; /* See if a binding with matching portdev already exists */ @@ -204,11 +204,11 @@ virNWFilterBindingObjListAddLocked(virNWFilterBindingObjListPtr bindings, } -virNWFilterBindingObjPtr -virNWFilterBindingObjListAdd(virNWFilterBindingObjListPtr bindings, - virNWFilterBindingDefPtr def) +virNWFilterBindingObj * +virNWFilterBindingObjListAdd(virNWFilterBindingObjList *bindings, + virNWFilterBindingDef *def) { - virNWFilterBindingObjPtr ret; + virNWFilterBindingObj *ret; virObjectRWLockWrite(bindings); ret = virNWFilterBindingObjListAddLocked(bindings, def); @@ -224,10 +224,10 @@ virNWFilterBindingObjListAdd(virNWFilterBindingObjListPtr bindings, * virNWFilterBindingObjListForEach */ static void -virNWFilterBindingObjListRemoveLocked(virNWFilterBindingObjListPtr bindings, - virNWFilterBindingObjPtr binding) +virNWFilterBindingObjListRemoveLocked(virNWFilterBindingObjList *bindings, + virNWFilterBindingObj *binding) { - virNWFilterBindingDefPtr def = virNWFilterBindingObjGetDef(binding); + virNWFilterBindingDef *def = virNWFilterBindingObjGetDef(binding); virHashRemoveEntry(bindings->objs, def->portdevname); } @@ -246,8 +246,8 @@ virNWFilterBindingObjListRemoveLocked(virNWFilterBindingObjListPtr bindings, * tables and returned with lock and refcnt that was present upon entry. */ void -virNWFilterBindingObjListRemove(virNWFilterBindingObjListPtr bindings, - virNWFilterBindingObjPtr binding) +virNWFilterBindingObjListRemove(virNWFilterBindingObjList *bindings, + virNWFilterBindingObj *binding) { virNWFilterBindingObjSetRemoving(binding, true); virObjectRef(binding); @@ -260,14 +260,14 @@ virNWFilterBindingObjListRemove(virNWFilterBindingObjListPtr bindings, } -static virNWFilterBindingObjPtr -virNWFilterBindingObjListLoadStatus(virNWFilterBindingObjListPtr bindings, +static virNWFilterBindingObj * +virNWFilterBindingObjListLoadStatus(virNWFilterBindingObjList *bindings, const char *statusDir, const char *name) { char *statusFile = NULL; - virNWFilterBindingObjPtr obj = NULL; - virNWFilterBindingDefPtr def; + virNWFilterBindingObj *obj = NULL; + virNWFilterBindingDef *def; if ((statusFile = virNWFilterBindingObjConfigFile(statusDir, name)) == NULL) goto error; @@ -297,7 +297,7 @@ virNWFilterBindingObjListLoadStatus(virNWFilterBindingObjListPtr bindings, int -virNWFilterBindingObjListLoadAllConfigs(virNWFilterBindingObjListPtr bindings, +virNWFilterBindingObjListLoadAllConfigs(virNWFilterBindingObjList *bindings, const char *configDir) { g_autoptr(DIR) dir = NULL; @@ -313,7 +313,7 @@ virNWFilterBindingObjListLoadAllConfigs(virNWFilterBindingObjListPtr bindings, virObjectRWLockWrite(bindings); while ((ret = virDirRead(dir, &entry, configDir)) > 0) { - virNWFilterBindingObjPtr binding; + virNWFilterBindingObj *binding; if (!virStringStripSuffix(entry->d_name, ".xml")) continue; @@ -356,7 +356,7 @@ virNWFilterBindingObjListHelper(void *payload, int -virNWFilterBindingObjListForEach(virNWFilterBindingObjListPtr bindings, +virNWFilterBindingObjListForEach(virNWFilterBindingObjList *bindings, virNWFilterBindingObjListIterator callback, void *opaque) { @@ -371,7 +371,7 @@ virNWFilterBindingObjListForEach(virNWFilterBindingObjListPtr bindings, struct virNWFilterBindingListData { - virNWFilterBindingObjPtr *bindings; + virNWFilterBindingObj **bindings; size_t nbindings; }; @@ -389,7 +389,7 @@ virNWFilterBindingObjListCollectIterator(void *payload, static void -virNWFilterBindingObjListFilter(virNWFilterBindingObjPtr **list, +virNWFilterBindingObjListFilter(virNWFilterBindingObj ***list, size_t *nbindings, virConnectPtr conn, virNWFilterBindingObjListACLFilter filter) @@ -397,8 +397,8 @@ virNWFilterBindingObjListFilter(virNWFilterBindingObjPtr **list, size_t i = 0; while (i < *nbindings) { - virNWFilterBindingObjPtr binding = (*list)[i]; - virNWFilterBindingDefPtr def; + virNWFilterBindingObj *binding = (*list)[i]; + virNWFilterBindingDef *def; virObjectLock(binding); @@ -423,9 +423,9 @@ virNWFilterBindingObjListFilter(virNWFilterBindingObjPtr **list, static int -virNWFilterBindingObjListCollect(virNWFilterBindingObjListPtr domlist, +virNWFilterBindingObjListCollect(virNWFilterBindingObjList *domlist, virConnectPtr conn, - virNWFilterBindingObjPtr **bindings, + virNWFilterBindingObj ***bindings, size_t *nbindings, virNWFilterBindingObjListACLFilter filter) { @@ -433,7 +433,7 @@ virNWFilterBindingObjListCollect(virNWFilterBindingObjListPtr domlist, virObjectRWLockRead(domlist); sa_assert(domlist->objs); - data.bindings = g_new0(virNWFilterBindingObjPtr, virHashSize(domlist->objs)); + data.bindings = g_new0(virNWFilterBindingObj *, virHashSize(domlist->objs)); virHashForEach(domlist->objs, virNWFilterBindingObjListCollectIterator, &data); virObjectRWUnlock(domlist); @@ -448,12 +448,12 @@ virNWFilterBindingObjListCollect(virNWFilterBindingObjListPtr domlist, int -virNWFilterBindingObjListExport(virNWFilterBindingObjListPtr bindings, +virNWFilterBindingObjListExport(virNWFilterBindingObjList *bindings, virConnectPtr conn, virNWFilterBindingPtr **bindinglist, virNWFilterBindingObjListACLFilter filter) { - virNWFilterBindingObjPtr *bindingobjs = NULL; + virNWFilterBindingObj **bindingobjs = NULL; size_t nbindings = 0; size_t i; int ret = -1; @@ -466,8 +466,8 @@ virNWFilterBindingObjListExport(virNWFilterBindingObjListPtr bindings, *bindinglist = g_new0(virNWFilterBindingPtr, nbindings + 1); for (i = 0; i < nbindings; i++) { - virNWFilterBindingObjPtr binding = bindingobjs[i]; - virNWFilterBindingDefPtr def = virNWFilterBindingObjGetDef(binding); + virNWFilterBindingObj *binding = bindingobjs[i]; + virNWFilterBindingDef *def = virNWFilterBindingObjGetDef(binding); virObjectLock(binding); (*bindinglist)[i] = virGetNWFilterBinding(conn, def->portdevname, diff --git a/src/conf/virnwfilterbindingobjlist.h b/src/conf/virnwfilterbindingobjlist.h index a819b4cc8a..801803bda0 100644 --- a/src/conf/virnwfilterbindingobjlist.h +++ b/src/conf/virnwfilterbindingobjlist.h @@ -23,41 +23,40 @@ #include "virnwfilterbindingobj.h" typedef struct _virNWFilterBindingObjList virNWFilterBindingObjList; -typedef virNWFilterBindingObjList *virNWFilterBindingObjListPtr; -virNWFilterBindingObjListPtr +virNWFilterBindingObjList * virNWFilterBindingObjListNew(void); -virNWFilterBindingObjPtr -virNWFilterBindingObjListFindByPortDev(virNWFilterBindingObjListPtr bindings, +virNWFilterBindingObj * +virNWFilterBindingObjListFindByPortDev(virNWFilterBindingObjList *bindings, const char *name); -virNWFilterBindingObjPtr -virNWFilterBindingObjListAdd(virNWFilterBindingObjListPtr bindings, - virNWFilterBindingDefPtr def); +virNWFilterBindingObj * +virNWFilterBindingObjListAdd(virNWFilterBindingObjList *bindings, + virNWFilterBindingDef *def); void -virNWFilterBindingObjListRemove(virNWFilterBindingObjListPtr bindings, - virNWFilterBindingObjPtr binding); +virNWFilterBindingObjListRemove(virNWFilterBindingObjList *bindings, + virNWFilterBindingObj *binding); int -virNWFilterBindingObjListLoadAllConfigs(virNWFilterBindingObjListPtr bindings, +virNWFilterBindingObjListLoadAllConfigs(virNWFilterBindingObjList *bindings, const char *configDir); -typedef int (*virNWFilterBindingObjListIterator)(virNWFilterBindingObjPtr binding, +typedef int (*virNWFilterBindingObjListIterator)(virNWFilterBindingObj *binding, void *opaque); int -virNWFilterBindingObjListForEach(virNWFilterBindingObjListPtr bindings, +virNWFilterBindingObjListForEach(virNWFilterBindingObjList *bindings, virNWFilterBindingObjListIterator callback, void *opaque); typedef bool (*virNWFilterBindingObjListACLFilter)(virConnectPtr conn, - virNWFilterBindingDefPtr def); + virNWFilterBindingDef *def); int -virNWFilterBindingObjListExport(virNWFilterBindingObjListPtr bindings, +virNWFilterBindingObjListExport(virNWFilterBindingObjList *bindings, virConnectPtr conn, virNWFilterBindingPtr **bindinglist, virNWFilterBindingObjListACLFilter filter); diff --git a/src/conf/virnwfilterobj.c b/src/conf/virnwfilterobj.c index f4bf1b083d..b64fdb9670 100644 --- a/src/conf/virnwfilterobj.c +++ b/src/conf/virnwfilterobj.c @@ -38,20 +38,20 @@ struct _virNWFilterObj { bool wantRemoved; - virNWFilterDefPtr def; - virNWFilterDefPtr newDef; + virNWFilterDef *def; + virNWFilterDef *newDef; }; struct _virNWFilterObjList { size_t count; - virNWFilterObjPtr *objs; + virNWFilterObj **objs; }; -static virNWFilterObjPtr +static virNWFilterObj * virNWFilterObjNew(void) { - virNWFilterObjPtr obj; + virNWFilterObj *obj; obj = g_new0(virNWFilterObj, 1); @@ -67,29 +67,29 @@ virNWFilterObjNew(void) } -virNWFilterDefPtr -virNWFilterObjGetDef(virNWFilterObjPtr obj) +virNWFilterDef * +virNWFilterObjGetDef(virNWFilterObj *obj) { return obj->def; } -virNWFilterDefPtr -virNWFilterObjGetNewDef(virNWFilterObjPtr obj) +virNWFilterDef * +virNWFilterObjGetNewDef(virNWFilterObj *obj) { return obj->newDef; } bool -virNWFilterObjWantRemoved(virNWFilterObjPtr obj) +virNWFilterObjWantRemoved(virNWFilterObj *obj) { return obj->wantRemoved; } static void -virNWFilterObjFree(virNWFilterObjPtr obj) +virNWFilterObjFree(virNWFilterObj *obj) { if (!obj) return; @@ -104,7 +104,7 @@ virNWFilterObjFree(virNWFilterObjPtr obj) void -virNWFilterObjListFree(virNWFilterObjListPtr nwfilters) +virNWFilterObjListFree(virNWFilterObjList *nwfilters) { size_t i; for (i = 0; i < nwfilters->count; i++) @@ -114,10 +114,10 @@ virNWFilterObjListFree(virNWFilterObjListPtr nwfilters) } -virNWFilterObjListPtr +virNWFilterObjList * virNWFilterObjListNew(void) { - virNWFilterObjListPtr nwfilters; + virNWFilterObjList *nwfilters; nwfilters = g_new0(virNWFilterObjList, 1); return nwfilters; @@ -125,8 +125,8 @@ virNWFilterObjListNew(void) void -virNWFilterObjListRemove(virNWFilterObjListPtr nwfilters, - virNWFilterObjPtr obj) +virNWFilterObjListRemove(virNWFilterObjList *nwfilters, + virNWFilterObj *obj) { size_t i; @@ -146,13 +146,13 @@ virNWFilterObjListRemove(virNWFilterObjListPtr nwfilters, } -virNWFilterObjPtr -virNWFilterObjListFindByUUID(virNWFilterObjListPtr nwfilters, +virNWFilterObj * +virNWFilterObjListFindByUUID(virNWFilterObjList *nwfilters, const unsigned char *uuid) { size_t i; - virNWFilterObjPtr obj; - virNWFilterDefPtr def; + virNWFilterObj *obj; + virNWFilterDef *def; for (i = 0; i < nwfilters->count; i++) { obj = nwfilters->objs[i]; @@ -167,13 +167,13 @@ virNWFilterObjListFindByUUID(virNWFilterObjListPtr nwfilters, } -virNWFilterObjPtr -virNWFilterObjListFindByName(virNWFilterObjListPtr nwfilters, +virNWFilterObj * +virNWFilterObjListFindByName(virNWFilterObjList *nwfilters, const char *name) { size_t i; - virNWFilterObjPtr obj; - virNWFilterDefPtr def; + virNWFilterObj *obj; + virNWFilterDef *def; for (i = 0; i < nwfilters->count; i++) { obj = nwfilters->objs[i]; @@ -188,11 +188,11 @@ virNWFilterObjListFindByName(virNWFilterObjListPtr nwfilters, } -virNWFilterObjPtr -virNWFilterObjListFindInstantiateFilter(virNWFilterObjListPtr nwfilters, +virNWFilterObj * +virNWFilterObjListFindInstantiateFilter(virNWFilterObjList *nwfilters, const char *filtername) { - virNWFilterObjPtr obj; + virNWFilterObj *obj; if (!(obj = virNWFilterObjListFindByName(nwfilters, filtername))) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -212,14 +212,14 @@ virNWFilterObjListFindInstantiateFilter(virNWFilterObjListPtr nwfilters, static int -_virNWFilterObjListDefLoopDetect(virNWFilterObjListPtr nwfilters, - virNWFilterDefPtr def, +_virNWFilterObjListDefLoopDetect(virNWFilterObjList *nwfilters, + virNWFilterDef *def, const char *filtername) { int rc = 0; size_t i; - virNWFilterEntryPtr entry; - virNWFilterObjPtr obj; + virNWFilterEntry *entry; + virNWFilterObj *obj; if (!def) return 0; @@ -260,15 +260,15 @@ _virNWFilterObjListDefLoopDetect(virNWFilterObjListPtr nwfilters, * Returns 0 in case no loop was detected, -1 otherwise. */ static int -virNWFilterObjListDefLoopDetect(virNWFilterObjListPtr nwfilters, - virNWFilterDefPtr def) +virNWFilterObjListDefLoopDetect(virNWFilterObjList *nwfilters, + virNWFilterDef *def) { return _virNWFilterObjListDefLoopDetect(nwfilters, def, def->name); } int -virNWFilterObjTestUnassignDef(virNWFilterObjPtr obj) +virNWFilterObjTestUnassignDef(virNWFilterObj *obj) { int rc = 0; @@ -285,7 +285,7 @@ virNWFilterObjTestUnassignDef(virNWFilterObjPtr obj) static bool virNWFilterDefEqual(const virNWFilterDef *def1, - virNWFilterDefPtr def2) + virNWFilterDef *def2) { bool ret = false; char *xml1 = NULL; @@ -305,12 +305,12 @@ virNWFilterDefEqual(const virNWFilterDef *def1, } -virNWFilterObjPtr -virNWFilterObjListAssignDef(virNWFilterObjListPtr nwfilters, - virNWFilterDefPtr def) +virNWFilterObj * +virNWFilterObjListAssignDef(virNWFilterObjList *nwfilters, + virNWFilterDef *def) { - virNWFilterObjPtr obj; - virNWFilterDefPtr objdef; + virNWFilterObj *obj; + virNWFilterDef *objdef; if ((obj = virNWFilterObjListFindByUUID(nwfilters, def->uuid))) { objdef = obj->def; @@ -384,7 +384,7 @@ virNWFilterObjListAssignDef(virNWFilterObjListPtr nwfilters, int -virNWFilterObjListNumOfNWFilters(virNWFilterObjListPtr nwfilters, +virNWFilterObjListNumOfNWFilters(virNWFilterObjList *nwfilters, virConnectPtr conn, virNWFilterObjListFilter filter) { @@ -392,7 +392,7 @@ virNWFilterObjListNumOfNWFilters(virNWFilterObjListPtr nwfilters, int nfilters = 0; for (i = 0; i < nwfilters->count; i++) { - virNWFilterObjPtr obj = nwfilters->objs[i]; + virNWFilterObj *obj = nwfilters->objs[i]; virNWFilterObjLock(obj); if (!filter || filter(conn, obj->def)) nfilters++; @@ -404,7 +404,7 @@ virNWFilterObjListNumOfNWFilters(virNWFilterObjListPtr nwfilters, int -virNWFilterObjListGetNames(virNWFilterObjListPtr nwfilters, +virNWFilterObjListGetNames(virNWFilterObjList *nwfilters, virConnectPtr conn, virNWFilterObjListFilter filter, char **const names, @@ -412,10 +412,10 @@ virNWFilterObjListGetNames(virNWFilterObjListPtr nwfilters, { int nnames = 0; size_t i; - virNWFilterDefPtr def; + virNWFilterDef *def; for (i = 0; i < nwfilters->count && nnames < maxnames; i++) { - virNWFilterObjPtr obj = nwfilters->objs[i]; + virNWFilterObj *obj = nwfilters->objs[i]; virNWFilterObjLock(obj); def = obj->def; if (!filter || filter(conn, def)) { @@ -431,15 +431,15 @@ virNWFilterObjListGetNames(virNWFilterObjListPtr nwfilters, int virNWFilterObjListExport(virConnectPtr conn, - virNWFilterObjListPtr nwfilters, + virNWFilterObjList *nwfilters, virNWFilterPtr **filters, virNWFilterObjListFilter filter) { virNWFilterPtr *tmp_filters = NULL; int nfilters = 0; virNWFilterPtr nwfilter = NULL; - virNWFilterObjPtr obj = NULL; - virNWFilterDefPtr def; + virNWFilterObj *obj = NULL; + virNWFilterDef *def; size_t i; int ret = -1; @@ -478,13 +478,13 @@ virNWFilterObjListExport(virConnectPtr conn, } -static virNWFilterObjPtr -virNWFilterObjListLoadConfig(virNWFilterObjListPtr nwfilters, +static virNWFilterObj * +virNWFilterObjListLoadConfig(virNWFilterObjList *nwfilters, const char *configDir, const char *name) { - virNWFilterDefPtr def = NULL; - virNWFilterObjPtr obj; + virNWFilterDef *def = NULL; + virNWFilterObj *obj; char *configFile = NULL; if (!(configFile = virFileBuildPath(configDir, name, ".xml"))) @@ -520,7 +520,7 @@ virNWFilterObjListLoadConfig(virNWFilterObjListPtr nwfilters, int -virNWFilterObjListLoadAllConfigs(virNWFilterObjListPtr nwfilters, +virNWFilterObjListLoadAllConfigs(virNWFilterObjList *nwfilters, const char *configDir) { g_autoptr(DIR) dir = NULL; @@ -532,7 +532,7 @@ virNWFilterObjListLoadAllConfigs(virNWFilterObjListPtr nwfilters, return rc; while ((ret = virDirRead(dir, &entry, configDir)) > 0) { - virNWFilterObjPtr obj; + virNWFilterObj *obj; if (!virStringStripSuffix(entry->d_name, ".xml")) continue; @@ -547,14 +547,14 @@ virNWFilterObjListLoadAllConfigs(virNWFilterObjListPtr nwfilters, void -virNWFilterObjLock(virNWFilterObjPtr obj) +virNWFilterObjLock(virNWFilterObj *obj) { virMutexLock(&obj->lock); } void -virNWFilterObjUnlock(virNWFilterObjPtr obj) +virNWFilterObjUnlock(virNWFilterObj *obj) { virMutexUnlock(&obj->lock); } diff --git a/src/conf/virnwfilterobj.h b/src/conf/virnwfilterobj.h index a6bdfb3864..44ba31f732 100644 --- a/src/conf/virnwfilterobj.h +++ b/src/conf/virnwfilterobj.h @@ -25,13 +25,10 @@ #include "virnwfilterbindingobjlist.h" typedef struct _virNWFilterObj virNWFilterObj; -typedef virNWFilterObj *virNWFilterObjPtr; typedef struct _virNWFilterObjList virNWFilterObjList; -typedef virNWFilterObjList *virNWFilterObjListPtr; typedef struct _virNWFilterDriverState virNWFilterDriverState; -typedef virNWFilterDriverState *virNWFilterDriverStatePtr; struct _virNWFilterDriverState { virMutex lock; bool privileged; @@ -39,64 +36,64 @@ struct _virNWFilterDriverState { /* pid file FD, ensures two copies of the driver can't use the same root */ int lockFD; - virNWFilterObjListPtr nwfilters; + virNWFilterObjList *nwfilters; - virNWFilterBindingObjListPtr bindings; + virNWFilterBindingObjList *bindings; char *stateDir; char *configDir; char *bindingDir; }; -virNWFilterDefPtr -virNWFilterObjGetDef(virNWFilterObjPtr obj); +virNWFilterDef * +virNWFilterObjGetDef(virNWFilterObj *obj); -virNWFilterDefPtr -virNWFilterObjGetNewDef(virNWFilterObjPtr obj); +virNWFilterDef * +virNWFilterObjGetNewDef(virNWFilterObj *obj); bool -virNWFilterObjWantRemoved(virNWFilterObjPtr obj); +virNWFilterObjWantRemoved(virNWFilterObj *obj); -virNWFilterObjListPtr +virNWFilterObjList * virNWFilterObjListNew(void); void -virNWFilterObjListFree(virNWFilterObjListPtr nwfilters); +virNWFilterObjListFree(virNWFilterObjList *nwfilters); void -virNWFilterObjListRemove(virNWFilterObjListPtr nwfilters, - virNWFilterObjPtr obj); +virNWFilterObjListRemove(virNWFilterObjList *nwfilters, + virNWFilterObj *obj); -virNWFilterObjPtr -virNWFilterObjListFindByUUID(virNWFilterObjListPtr nwfilters, +virNWFilterObj * +virNWFilterObjListFindByUUID(virNWFilterObjList *nwfilters, const unsigned char *uuid); -virNWFilterObjPtr -virNWFilterObjListFindByName(virNWFilterObjListPtr nwfilters, +virNWFilterObj * +virNWFilterObjListFindByName(virNWFilterObjList *nwfilters, const char *name); -virNWFilterObjPtr -virNWFilterObjListFindInstantiateFilter(virNWFilterObjListPtr nwfilters, +virNWFilterObj * +virNWFilterObjListFindInstantiateFilter(virNWFilterObjList *nwfilters, const char *filtername); -virNWFilterObjPtr -virNWFilterObjListAssignDef(virNWFilterObjListPtr nwfilters, - virNWFilterDefPtr def); +virNWFilterObj * +virNWFilterObjListAssignDef(virNWFilterObjList *nwfilters, + virNWFilterDef *def); int -virNWFilterObjTestUnassignDef(virNWFilterObjPtr obj); +virNWFilterObjTestUnassignDef(virNWFilterObj *obj); typedef bool (*virNWFilterObjListFilter)(virConnectPtr conn, - virNWFilterDefPtr def); + virNWFilterDef *def); int -virNWFilterObjListNumOfNWFilters(virNWFilterObjListPtr nwfilters, +virNWFilterObjListNumOfNWFilters(virNWFilterObjList *nwfilters, virConnectPtr conn, virNWFilterObjListFilter filter); int -virNWFilterObjListGetNames(virNWFilterObjListPtr nwfilters, +virNWFilterObjListGetNames(virNWFilterObjList *nwfilters, virConnectPtr conn, virNWFilterObjListFilter filter, char **const names, @@ -104,16 +101,16 @@ virNWFilterObjListGetNames(virNWFilterObjListPtr nwfilters, int virNWFilterObjListExport(virConnectPtr conn, - virNWFilterObjListPtr nwfilters, + virNWFilterObjList *nwfilters, virNWFilterPtr **filters, virNWFilterObjListFilter filter); int -virNWFilterObjListLoadAllConfigs(virNWFilterObjListPtr nwfilters, +virNWFilterObjListLoadAllConfigs(virNWFilterObjList *nwfilters, const char *configDir); void -virNWFilterObjLock(virNWFilterObjPtr obj); +virNWFilterObjLock(virNWFilterObj *obj); void -virNWFilterObjUnlock(virNWFilterObjPtr obj); +virNWFilterObjUnlock(virNWFilterObj *obj); diff --git a/src/conf/virsavecookie.c b/src/conf/virsavecookie.c index eeca61f351..0e67bf1477 100644 --- a/src/conf/virsavecookie.c +++ b/src/conf/virsavecookie.c @@ -34,8 +34,8 @@ VIR_LOG_INIT("conf.savecookie"); static int virSaveCookieParseNode(xmlXPathContextPtr ctxt, - virObjectPtr *obj, - virSaveCookieCallbacksPtr saveCookie) + virObject **obj, + virSaveCookieCallbacks *saveCookie) { *obj = NULL; @@ -54,8 +54,8 @@ virSaveCookieParseNode(xmlXPathContextPtr ctxt, int virSaveCookieParse(xmlXPathContextPtr ctxt, - virObjectPtr *obj, - virSaveCookieCallbacksPtr saveCookie) + virObject **obj, + virSaveCookieCallbacks *saveCookie) { VIR_XPATH_NODE_AUTORESTORE(ctxt) int ret = -1; @@ -76,8 +76,8 @@ virSaveCookieParse(xmlXPathContextPtr ctxt, int virSaveCookieParseString(const char *xml, - virObjectPtr *obj, - virSaveCookieCallbacksPtr saveCookie) + virObject **obj, + virSaveCookieCallbacks *saveCookie) { xmlDocPtr doc = NULL; xmlXPathContextPtr ctxt = NULL; @@ -103,9 +103,9 @@ virSaveCookieParseString(const char *xml, int -virSaveCookieFormatBuf(virBufferPtr buf, - virObjectPtr obj, - virSaveCookieCallbacksPtr saveCookie) +virSaveCookieFormatBuf(virBuffer *buf, + virObject *obj, + virSaveCookieCallbacks *saveCookie) { if (!obj || !saveCookie || !saveCookie->format) return 0; @@ -124,8 +124,8 @@ virSaveCookieFormatBuf(virBufferPtr buf, char * -virSaveCookieFormat(virObjectPtr obj, - virSaveCookieCallbacksPtr saveCookie) +virSaveCookieFormat(virObject *obj, + virSaveCookieCallbacks *saveCookie) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; diff --git a/src/conf/virsavecookie.h b/src/conf/virsavecookie.h index eafffbed66..9d275edd03 100644 --- a/src/conf/virsavecookie.h +++ b/src/conf/virsavecookie.h @@ -28,12 +28,11 @@ typedef int (*virSaveCookieParseFunc)(xmlXPathContextPtr ctxt, - virObjectPtr *obj); -typedef int (*virSaveCookieFormatFunc)(virBufferPtr buf, - virObjectPtr obj); + virObject **obj); +typedef int (*virSaveCookieFormatFunc)(virBuffer *buf, + virObject *obj); typedef struct _virSaveCookieCallbacks virSaveCookieCallbacks; -typedef virSaveCookieCallbacks *virSaveCookieCallbacksPtr; struct _virSaveCookieCallbacks { virSaveCookieParseFunc parse; virSaveCookieFormatFunc format; @@ -42,19 +41,19 @@ struct _virSaveCookieCallbacks { int virSaveCookieParse(xmlXPathContextPtr ctxt, - virObjectPtr *obj, - virSaveCookieCallbacksPtr saveCookie); + virObject **obj, + virSaveCookieCallbacks *saveCookie); int virSaveCookieParseString(const char *xml, - virObjectPtr *obj, - virSaveCookieCallbacksPtr saveCookie); + virObject **obj, + virSaveCookieCallbacks *saveCookie); int -virSaveCookieFormatBuf(virBufferPtr buf, - virObjectPtr obj, - virSaveCookieCallbacksPtr saveCookie); +virSaveCookieFormatBuf(virBuffer *buf, + virObject *obj, + virSaveCookieCallbacks *saveCookie); char * -virSaveCookieFormat(virObjectPtr obj, - virSaveCookieCallbacksPtr saveCookie); +virSaveCookieFormat(virObject *obj, + virSaveCookieCallbacks *saveCookie); diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c index a15a288371..bdd5e4a6f7 100644 --- a/src/conf/virsecretobj.c +++ b/src/conf/virsecretobj.c @@ -40,13 +40,13 @@ struct _virSecretObj { virObjectLockable parent; char *configFile; char *base64File; - virSecretDefPtr def; + virSecretDef *def; unsigned char *value; /* May be NULL */ size_t value_size; }; -static virClassPtr virSecretObjClass; -static virClassPtr virSecretObjListClass; +static virClass *virSecretObjClass; +static virClass *virSecretObjListClass; static void virSecretObjDispose(void *obj); static void virSecretObjListDispose(void *obj); @@ -79,10 +79,10 @@ virSecretObjOnceInit(void) VIR_ONCE_GLOBAL_INIT(virSecretObj); -static virSecretObjPtr +static virSecretObj * virSecretObjNew(void) { - virSecretObjPtr obj; + virSecretObj *obj; if (virSecretObjInitialize() < 0) return NULL; @@ -97,7 +97,7 @@ virSecretObjNew(void) void -virSecretObjEndAPI(virSecretObjPtr *obj) +virSecretObjEndAPI(virSecretObj **obj) { if (!*obj) return; @@ -108,10 +108,10 @@ virSecretObjEndAPI(virSecretObjPtr *obj) } -virSecretObjListPtr +virSecretObjList * virSecretObjListNew(void) { - virSecretObjListPtr secrets; + virSecretObjList *secrets; if (virSecretObjInitialize() < 0) return NULL; @@ -131,7 +131,7 @@ virSecretObjListNew(void) static void virSecretObjDispose(void *opaque) { - virSecretObjPtr obj = opaque; + virSecretObj *obj = opaque; virSecretDefFree(obj->def); if (obj->value) { @@ -147,7 +147,7 @@ virSecretObjDispose(void *opaque) static void virSecretObjListDispose(void *obj) { - virSecretObjListPtr secrets = obj; + virSecretObjList *secrets = obj; virHashFree(secrets->objs); } @@ -162,8 +162,8 @@ virSecretObjListDispose(void *obj) * * Returns: not locked, but ref'd secret object. */ -static virSecretObjPtr -virSecretObjListFindByUUIDLocked(virSecretObjListPtr secrets, +static virSecretObj * +virSecretObjListFindByUUIDLocked(virSecretObjList *secrets, const char *uuidstr) { return virObjectRef(virHashLookup(secrets->objs, uuidstr)); @@ -180,11 +180,11 @@ virSecretObjListFindByUUIDLocked(virSecretObjListPtr secrets, * * Returns: locked and ref'd secret object. */ -virSecretObjPtr -virSecretObjListFindByUUID(virSecretObjListPtr secrets, +virSecretObj * +virSecretObjListFindByUUID(virSecretObjList *secrets, const char *uuidstr) { - virSecretObjPtr obj; + virSecretObj *obj; virObjectRWLockRead(secrets); obj = virSecretObjListFindByUUIDLocked(secrets, uuidstr); @@ -200,8 +200,8 @@ virSecretObjSearchName(const void *payload, const char *name G_GNUC_UNUSED, const void *opaque) { - virSecretObjPtr obj = (virSecretObjPtr) payload; - virSecretDefPtr def; + virSecretObj *obj = (virSecretObj *) payload; + virSecretDef *def; struct virSecretSearchData *data = (struct virSecretSearchData *) opaque; int found = 0; @@ -231,12 +231,12 @@ virSecretObjSearchName(const void *payload, * * Returns: not locked, but ref'd secret object. */ -static virSecretObjPtr -virSecretObjListFindByUsageLocked(virSecretObjListPtr secrets, +static virSecretObj * +virSecretObjListFindByUsageLocked(virSecretObjList *secrets, int usageType, const char *usageID) { - virSecretObjPtr obj = NULL; + virSecretObj *obj = NULL; struct virSecretSearchData data = { .usageType = usageType, .usageID = usageID }; @@ -258,12 +258,12 @@ virSecretObjListFindByUsageLocked(virSecretObjListPtr secrets, * * Returns: locked and ref'd secret object. */ -virSecretObjPtr -virSecretObjListFindByUsage(virSecretObjListPtr secrets, +virSecretObj * +virSecretObjListFindByUsage(virSecretObjList *secrets, int usageType, const char *usageID) { - virSecretObjPtr obj; + virSecretObj *obj; virObjectRWLockRead(secrets); obj = virSecretObjListFindByUsageLocked(secrets, usageType, usageID); @@ -284,11 +284,11 @@ virSecretObjListFindByUsage(virSecretObjListPtr secrets, * ensure no one else is either waiting for @secret or still using it. */ void -virSecretObjListRemove(virSecretObjListPtr secrets, - virSecretObjPtr obj) +virSecretObjListRemove(virSecretObjList *secrets, + virSecretObj *obj) { char uuidstr[VIR_UUID_STRING_BUFLEN]; - virSecretDefPtr def; + virSecretDef *def; if (!obj) return; @@ -318,15 +318,15 @@ virSecretObjListRemove(virSecretObjListPtr secrets, * * Returns: locked and ref'd secret or NULL if failure to add */ -virSecretObjPtr -virSecretObjListAdd(virSecretObjListPtr secrets, - virSecretDefPtr newdef, +virSecretObj * +virSecretObjListAdd(virSecretObjList *secrets, + virSecretDef *newdef, const char *configDir, - virSecretDefPtr *oldDef) + virSecretDef **oldDef) { - virSecretObjPtr obj; - virSecretDefPtr objdef; - virSecretObjPtr ret = NULL; + virSecretObj *obj; + virSecretDef *objdef; + virSecretObj *ret = NULL; char uuidstr[VIR_UUID_STRING_BUFLEN]; virObjectRWLockWrite(secrets); @@ -414,8 +414,8 @@ virSecretObjListNumOfSecretsCallback(void *payload, void *opaque) { struct virSecretCountData *data = opaque; - virSecretObjPtr obj = payload; - virSecretDefPtr def; + virSecretObj *obj = payload; + virSecretDef *def; virObjectLock(obj); def = obj->def; @@ -447,8 +447,8 @@ virSecretObjListGetUUIDsCallback(void *payload, void *opaque) { struct virSecretListData *data = opaque; - virSecretObjPtr obj = payload; - virSecretDefPtr def; + virSecretObj *obj = payload; + virSecretDef *def; if (data->error) return 0; @@ -478,7 +478,7 @@ virSecretObjListGetUUIDsCallback(void *payload, int -virSecretObjListNumOfSecrets(virSecretObjListPtr secrets, +virSecretObjListNumOfSecrets(virSecretObjList *secrets, virSecretObjListACLFilter filter, virConnectPtr conn) { @@ -495,10 +495,10 @@ virSecretObjListNumOfSecrets(virSecretObjListPtr secrets, #define MATCH(FLAG) (flags & (FLAG)) static bool -virSecretObjMatch(virSecretObjPtr obj, +virSecretObjMatch(virSecretObj *obj, unsigned int flags) { - virSecretDefPtr def = obj->def; + virSecretDef *def = obj->def; /* filter by whether it's ephemeral */ if (MATCH(VIR_CONNECT_LIST_SECRETS_FILTERS_EPHEMERAL) && @@ -522,7 +522,6 @@ virSecretObjMatch(virSecretObjPtr obj, typedef struct _virSecretObjListExportData virSecretObjListExportData; -typedef virSecretObjListExportData *virSecretObjListExportDataPtr; struct _virSecretObjListExportData { virConnectPtr conn; virSecretPtr *secrets; @@ -537,9 +536,9 @@ virSecretObjListExportCallback(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virSecretObjListExportDataPtr data = opaque; - virSecretObjPtr obj = payload; - virSecretDefPtr def; + virSecretObjListExportData *data = opaque; + virSecretObj *obj = payload; + virSecretDef *def; virSecretPtr secret = NULL; if (data->error) @@ -576,7 +575,7 @@ virSecretObjListExportCallback(void *payload, int virSecretObjListExport(virConnectPtr conn, - virSecretObjListPtr secretobjs, + virSecretObjList *secretobjs, virSecretPtr **secrets, virSecretObjListACLFilter filter, unsigned int flags) @@ -611,7 +610,7 @@ virSecretObjListExport(virConnectPtr conn, int -virSecretObjListGetUUIDs(virSecretObjListPtr secrets, +virSecretObjListGetUUIDs(virSecretObjList *secrets, char **uuids, int maxuuids, virSecretObjListACLFilter filter, @@ -638,9 +637,9 @@ virSecretObjListGetUUIDs(virSecretObjListPtr secrets, int -virSecretObjDeleteConfig(virSecretObjPtr obj) +virSecretObjDeleteConfig(virSecretObj *obj) { - virSecretDefPtr def = obj->def; + virSecretDef *def = obj->def; if (!def->isephemeral && unlink(obj->configFile) < 0 && errno != ENOENT) { @@ -654,7 +653,7 @@ virSecretObjDeleteConfig(virSecretObjPtr obj) void -virSecretObjDeleteData(virSecretObjPtr obj) +virSecretObjDeleteData(virSecretObj *obj) { /* The configFile will already be removed, so secret won't be * loaded again if this fails */ @@ -664,12 +663,12 @@ virSecretObjDeleteData(virSecretObjPtr obj) /* Permanent secret storage */ -/* Secrets are stored in virSecretDriverStatePtr->configDir. Each secret +/* Secrets are stored in virSecretDriverState *->configDir. Each secret has virSecretDef stored as XML in "$basename.xml". If a value of the secret is defined, it is stored as base64 (with no formatting) in "$basename.base64". "$basename" is in both cases the base64-encoded UUID. */ int -virSecretObjSaveConfig(virSecretObjPtr obj) +virSecretObjSaveConfig(virSecretObj *obj) { g_autofree char *xml = NULL; @@ -684,7 +683,7 @@ virSecretObjSaveConfig(virSecretObjPtr obj) int -virSecretObjSaveData(virSecretObjPtr obj) +virSecretObjSaveData(virSecretObj *obj) { g_autofree char *base64 = NULL; @@ -700,25 +699,25 @@ virSecretObjSaveData(virSecretObjPtr obj) } -virSecretDefPtr -virSecretObjGetDef(virSecretObjPtr obj) +virSecretDef * +virSecretObjGetDef(virSecretObj *obj) { return obj->def; } void -virSecretObjSetDef(virSecretObjPtr obj, - virSecretDefPtr def) +virSecretObjSetDef(virSecretObj *obj, + virSecretDef *def) { obj->def = def; } unsigned char * -virSecretObjGetValue(virSecretObjPtr obj) +virSecretObjGetValue(virSecretObj *obj) { - virSecretDefPtr def = obj->def; + virSecretDef *def = obj->def; unsigned char *ret = NULL; if (!obj->value) { @@ -737,11 +736,11 @@ virSecretObjGetValue(virSecretObjPtr obj) int -virSecretObjSetValue(virSecretObjPtr obj, +virSecretObjSetValue(virSecretObj *obj, const unsigned char *value, size_t value_size) { - virSecretDefPtr def = obj->def; + virSecretDef *def = obj->def; g_autofree unsigned char *old_value = NULL; g_autofree unsigned char *new_value = NULL; size_t old_value_size; @@ -775,14 +774,14 @@ virSecretObjSetValue(virSecretObjPtr obj, size_t -virSecretObjGetValueSize(virSecretObjPtr obj) +virSecretObjGetValueSize(virSecretObj *obj) { return obj->value_size; } void -virSecretObjSetValueSize(virSecretObjPtr obj, +virSecretObjSetValueSize(virSecretObj *obj, size_t value_size) { obj->value_size = value_size; @@ -790,7 +789,7 @@ virSecretObjSetValueSize(virSecretObjPtr obj, static int -virSecretLoadValidateUUID(virSecretDefPtr def, +virSecretLoadValidateUUID(virSecretDef *def, const char *file) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -809,7 +808,7 @@ virSecretLoadValidateUUID(virSecretDefPtr def, static int -virSecretLoadValue(virSecretObjPtr obj) +virSecretLoadValue(virSecretObj *obj) { int ret = -1, fd = -1; struct stat st; @@ -861,14 +860,14 @@ virSecretLoadValue(virSecretObjPtr obj) } -static virSecretObjPtr -virSecretLoad(virSecretObjListPtr secrets, +static virSecretObj * +virSecretLoad(virSecretObjList *secrets, const char *file, const char *path, const char *configDir) { - virSecretDefPtr def = NULL; - virSecretObjPtr obj = NULL; + virSecretDef *def = NULL; + virSecretObj *obj = NULL; if (!(def = virSecretDefParseFile(path))) goto cleanup; @@ -893,7 +892,7 @@ virSecretLoad(virSecretObjListPtr secrets, int -virSecretLoadAllConfigs(virSecretObjListPtr secrets, +virSecretLoadAllConfigs(virSecretObjList *secrets, const char *configDir) { g_autoptr(DIR) dir = NULL; @@ -907,7 +906,7 @@ virSecretLoadAllConfigs(virSecretObjListPtr secrets, * loop (if any). It's better to keep the secrets we managed to find. */ while (virDirRead(dir, &de, NULL) > 0) { char *path; - virSecretObjPtr obj; + virSecretObj *obj; if (!virStringHasSuffix(de->d_name, ".xml")) continue; diff --git a/src/conf/virsecretobj.h b/src/conf/virsecretobj.h index 09ee19f603..e91b9518eb 100644 --- a/src/conf/virsecretobj.h +++ b/src/conf/virsecretobj.h @@ -26,93 +26,91 @@ #include "virobject.h" typedef struct _virSecretObj virSecretObj; -typedef virSecretObj *virSecretObjPtr; void -virSecretObjEndAPI(virSecretObjPtr *obj); +virSecretObjEndAPI(virSecretObj **obj); typedef struct _virSecretObjList virSecretObjList; -typedef virSecretObjList *virSecretObjListPtr; -virSecretObjListPtr +virSecretObjList * virSecretObjListNew(void); -virSecretObjPtr -virSecretObjListFindByUUID(virSecretObjListPtr secrets, +virSecretObj * +virSecretObjListFindByUUID(virSecretObjList *secrets, const char *uuidstr); -virSecretObjPtr -virSecretObjListFindByUsage(virSecretObjListPtr secrets, +virSecretObj * +virSecretObjListFindByUsage(virSecretObjList *secrets, int usageType, const char *usageID); void -virSecretObjListRemove(virSecretObjListPtr secrets, - virSecretObjPtr obj); +virSecretObjListRemove(virSecretObjList *secrets, + virSecretObj *obj); -virSecretObjPtr -virSecretObjListAdd(virSecretObjListPtr secrets, - virSecretDefPtr newdef, +virSecretObj * +virSecretObjListAdd(virSecretObjList *secrets, + virSecretDef *newdef, const char *configDir, - virSecretDefPtr *oldDef); + virSecretDef **oldDef); typedef bool (*virSecretObjListACLFilter)(virConnectPtr conn, - virSecretDefPtr def); + virSecretDef *def); int -virSecretObjListNumOfSecrets(virSecretObjListPtr secrets, +virSecretObjListNumOfSecrets(virSecretObjList *secrets, virSecretObjListACLFilter filter, virConnectPtr conn); int virSecretObjListExport(virConnectPtr conn, - virSecretObjListPtr secretobjs, + virSecretObjList *secretobjs, virSecretPtr **secrets, virSecretObjListACLFilter filter, unsigned int flags); int -virSecretObjListGetUUIDs(virSecretObjListPtr secrets, +virSecretObjListGetUUIDs(virSecretObjList *secrets, char **uuids, int maxuuids, virSecretObjListACLFilter filter, virConnectPtr conn); int -virSecretObjDeleteConfig(virSecretObjPtr obj); +virSecretObjDeleteConfig(virSecretObj *obj); void -virSecretObjDeleteData(virSecretObjPtr obj); +virSecretObjDeleteData(virSecretObj *obj); int -virSecretObjSaveConfig(virSecretObjPtr obj); +virSecretObjSaveConfig(virSecretObj *obj); int -virSecretObjSaveData(virSecretObjPtr obj); +virSecretObjSaveData(virSecretObj *obj); -virSecretDefPtr -virSecretObjGetDef(virSecretObjPtr obj); +virSecretDef * +virSecretObjGetDef(virSecretObj *obj); void -virSecretObjSetDef(virSecretObjPtr obj, - virSecretDefPtr def); +virSecretObjSetDef(virSecretObj *obj, + virSecretDef *def); unsigned char * -virSecretObjGetValue(virSecretObjPtr obj); +virSecretObjGetValue(virSecretObj *obj); int -virSecretObjSetValue(virSecretObjPtr obj, +virSecretObjSetValue(virSecretObj *obj, const unsigned char *value, size_t value_size); size_t -virSecretObjGetValueSize(virSecretObjPtr obj); +virSecretObjGetValueSize(virSecretObj *obj); void -virSecretObjSetValueSize(virSecretObjPtr obj, +virSecretObjSetValueSize(virSecretObj *obj, size_t value_size); int -virSecretLoadAllConfigs(virSecretObjListPtr secrets, +virSecretLoadAllConfigs(virSecretObjList *secrets, const char *configDir); diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c index ef1dad597c..24957d6012 100644 --- a/src/conf/virstorageobj.c +++ b/src/conf/virstorageobj.c @@ -38,10 +38,10 @@ VIR_LOG_INIT("conf.virstorageobj"); -static virClassPtr virStoragePoolObjClass; -static virClassPtr virStoragePoolObjListClass; -static virClassPtr virStorageVolObjClass; -static virClassPtr virStorageVolObjListClass; +static virClass *virStoragePoolObjClass; +static virClass *virStoragePoolObjListClass; +static virClass *virStorageVolObjClass; +static virClass *virStorageVolObjListClass; static void virStoragePoolObjDispose(void *opaque); @@ -55,15 +55,13 @@ virStorageVolObjListDispose(void *opaque); typedef struct _virStorageVolObj virStorageVolObj; -typedef virStorageVolObj *virStorageVolObjPtr; struct _virStorageVolObj { virObjectLockable parent; - virStorageVolDefPtr voldef; + virStorageVolDef *voldef; }; typedef struct _virStorageVolObjList virStorageVolObjList; -typedef virStorageVolObjList *virStorageVolObjListPtr; struct _virStorageVolObjList { virObjectRWLockable parent; @@ -90,10 +88,10 @@ struct _virStoragePoolObj { bool autostart; unsigned int asyncjobs; - virStoragePoolDefPtr def; - virStoragePoolDefPtr newDef; + virStoragePoolDef *def; + virStoragePoolDef *newDef; - virStorageVolObjListPtr volumes; + virStorageVolObjList *volumes; }; struct _virStoragePoolObjList { @@ -124,10 +122,10 @@ virStorageVolObjOnceInit(void) VIR_ONCE_GLOBAL_INIT(virStorageVolObj); -static virStorageVolObjPtr +static virStorageVolObj * virStorageVolObjNew(void) { - virStorageVolObjPtr obj; + virStorageVolObj *obj; if (virStorageVolObjInitialize() < 0) return NULL; @@ -141,7 +139,7 @@ virStorageVolObjNew(void) static void -virStorageVolObjEndAPI(virStorageVolObjPtr *obj) +virStorageVolObjEndAPI(virStorageVolObj **obj) { if (!*obj) return; @@ -155,16 +153,16 @@ virStorageVolObjEndAPI(virStorageVolObjPtr *obj) static void virStorageVolObjDispose(void *opaque) { - virStorageVolObjPtr obj = opaque; + virStorageVolObj *obj = opaque; virStorageVolDefFree(obj->voldef); } -static virStorageVolObjListPtr +static virStorageVolObjList * virStorageVolObjListNew(void) { - virStorageVolObjListPtr vols; + virStorageVolObjList *vols; if (virStorageVolObjInitialize() < 0) return NULL; @@ -186,7 +184,7 @@ virStorageVolObjListNew(void) static void virStorageVolObjListDispose(void *opaque) { - virStorageVolObjListPtr vols = opaque; + virStorageVolObjList *vols = opaque; virHashFree(vols->objsKey); virHashFree(vols->objsName); @@ -209,10 +207,10 @@ virStoragePoolObjOnceInit(void) VIR_ONCE_GLOBAL_INIT(virStoragePoolObj); -virStoragePoolObjPtr +virStoragePoolObj * virStoragePoolObjNew(void) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; if (virStoragePoolObjInitialize() < 0) return NULL; @@ -232,7 +230,7 @@ virStoragePoolObjNew(void) void -virStoragePoolObjEndAPI(virStoragePoolObjPtr *obj) +virStoragePoolObjEndAPI(virStoragePoolObj **obj) { if (!*obj) return; @@ -243,31 +241,31 @@ virStoragePoolObjEndAPI(virStoragePoolObjPtr *obj) } -virStoragePoolDefPtr -virStoragePoolObjGetDef(virStoragePoolObjPtr obj) +virStoragePoolDef * +virStoragePoolObjGetDef(virStoragePoolObj *obj) { return obj->def; } void -virStoragePoolObjSetDef(virStoragePoolObjPtr obj, - virStoragePoolDefPtr def) +virStoragePoolObjSetDef(virStoragePoolObj *obj, + virStoragePoolDef *def) { virStoragePoolDefFree(obj->def); obj->def = def; } -virStoragePoolDefPtr -virStoragePoolObjGetNewDef(virStoragePoolObjPtr obj) +virStoragePoolDef * +virStoragePoolObjGetNewDef(virStoragePoolObj *obj) { return obj->newDef; } void -virStoragePoolObjDefUseNewDef(virStoragePoolObjPtr obj) +virStoragePoolObjDefUseNewDef(virStoragePoolObj *obj) { virStoragePoolDefFree(obj->def); obj->def = g_steal_pointer(&obj->newDef); @@ -275,14 +273,14 @@ virStoragePoolObjDefUseNewDef(virStoragePoolObjPtr obj) const char * -virStoragePoolObjGetConfigFile(virStoragePoolObjPtr obj) +virStoragePoolObjGetConfigFile(virStoragePoolObj *obj) { return obj->configFile; } void -virStoragePoolObjSetConfigFile(virStoragePoolObjPtr obj, +virStoragePoolObjSetConfigFile(virStoragePoolObj *obj, char *configFile) { VIR_FREE(obj->configFile); @@ -291,21 +289,21 @@ virStoragePoolObjSetConfigFile(virStoragePoolObjPtr obj, const char * -virStoragePoolObjGetAutostartLink(virStoragePoolObjPtr obj) +virStoragePoolObjGetAutostartLink(virStoragePoolObj *obj) { return obj->autostartLink; } bool -virStoragePoolObjIsActive(virStoragePoolObjPtr obj) +virStoragePoolObjIsActive(virStoragePoolObj *obj) { return obj->active; } void -virStoragePoolObjSetActive(virStoragePoolObjPtr obj, +virStoragePoolObjSetActive(virStoragePoolObj *obj, bool active) { obj->active = active; @@ -313,7 +311,7 @@ virStoragePoolObjSetActive(virStoragePoolObjPtr obj, void -virStoragePoolObjSetStarting(virStoragePoolObjPtr obj, +virStoragePoolObjSetStarting(virStoragePoolObj *obj, bool starting) { obj->starting = starting; @@ -321,14 +319,14 @@ virStoragePoolObjSetStarting(virStoragePoolObjPtr obj, bool -virStoragePoolObjIsStarting(virStoragePoolObjPtr obj) +virStoragePoolObjIsStarting(virStoragePoolObj *obj) { return obj->starting; } bool -virStoragePoolObjIsAutostart(virStoragePoolObjPtr obj) +virStoragePoolObjIsAutostart(virStoragePoolObj *obj) { if (!obj->configFile) return false; @@ -338,7 +336,7 @@ virStoragePoolObjIsAutostart(virStoragePoolObjPtr obj) void -virStoragePoolObjSetAutostart(virStoragePoolObjPtr obj, +virStoragePoolObjSetAutostart(virStoragePoolObj *obj, bool autostart) { obj->autostart = autostart; @@ -346,21 +344,21 @@ virStoragePoolObjSetAutostart(virStoragePoolObjPtr obj, unsigned int -virStoragePoolObjGetAsyncjobs(virStoragePoolObjPtr obj) +virStoragePoolObjGetAsyncjobs(virStoragePoolObj *obj) { return obj->asyncjobs; } void -virStoragePoolObjIncrAsyncjobs(virStoragePoolObjPtr obj) +virStoragePoolObjIncrAsyncjobs(virStoragePoolObj *obj) { obj->asyncjobs++; } void -virStoragePoolObjDecrAsyncjobs(virStoragePoolObjPtr obj) +virStoragePoolObjDecrAsyncjobs(virStoragePoolObj *obj) { obj->asyncjobs--; } @@ -369,7 +367,7 @@ virStoragePoolObjDecrAsyncjobs(virStoragePoolObjPtr obj) void virStoragePoolObjDispose(void *opaque) { - virStoragePoolObjPtr obj = opaque; + virStoragePoolObj *obj = opaque; virStoragePoolObjClearVols(obj); virObjectUnref(obj->volumes); @@ -385,17 +383,17 @@ virStoragePoolObjDispose(void *opaque) void virStoragePoolObjListDispose(void *opaque) { - virStoragePoolObjListPtr pools = opaque; + virStoragePoolObjList *pools = opaque; virHashFree(pools->objs); virHashFree(pools->objsName); } -virStoragePoolObjListPtr +virStoragePoolObjList * virStoragePoolObjListNew(void) { - virStoragePoolObjListPtr pools; + virStoragePoolObjList *pools; if (virStoragePoolObjInitialize() < 0) return NULL; @@ -423,7 +421,7 @@ virStoragePoolObjListForEachCb(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virStoragePoolObjPtr obj = payload; + virStoragePoolObj *obj = payload; struct _virStoragePoolObjListForEachData *data = opaque; /* Grab a reference so that we don't rely only on references grabbed by @@ -457,7 +455,7 @@ virStoragePoolObjListForEachCb(void *payload, * AutoStart, or Reload) this is OK. */ void -virStoragePoolObjListForEach(virStoragePoolObjListPtr pools, +virStoragePoolObjListForEach(virStoragePoolObjList *pools, virStoragePoolObjListIterator iter, const void *opaque) { @@ -479,7 +477,7 @@ virStoragePoolObjListSearchCb(const void *payload, const char *name G_GNUC_UNUSED, const void *opaque) { - virStoragePoolObjPtr obj = (virStoragePoolObjPtr) payload; + virStoragePoolObj *obj = (virStoragePoolObj *) payload; struct _virStoragePoolObjListSearchData *data = (struct _virStoragePoolObjListSearchData *)opaque; @@ -503,12 +501,12 @@ virStoragePoolObjListSearchCb(const void *payload, * * Returns a locked and reffed object when found and NULL when not found */ -virStoragePoolObjPtr -virStoragePoolObjListSearch(virStoragePoolObjListPtr pools, +virStoragePoolObj * +virStoragePoolObjListSearch(virStoragePoolObjList *pools, virStoragePoolObjListSearcher searcher, const void *opaque) { - virStoragePoolObjPtr obj = NULL; + virStoragePoolObj *obj = NULL; struct _virStoragePoolObjListSearchData data = { .searcher = searcher, .opaque = opaque }; @@ -521,8 +519,8 @@ virStoragePoolObjListSearch(virStoragePoolObjListPtr pools, void -virStoragePoolObjRemove(virStoragePoolObjListPtr pools, - virStoragePoolObjPtr obj) +virStoragePoolObjRemove(virStoragePoolObjList *pools, + virStoragePoolObj *obj) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -538,8 +536,8 @@ virStoragePoolObjRemove(virStoragePoolObjListPtr pools, } -static virStoragePoolObjPtr -virStoragePoolObjFindByUUIDLocked(virStoragePoolObjListPtr pools, +static virStoragePoolObj * +virStoragePoolObjFindByUUIDLocked(virStoragePoolObjList *pools, const unsigned char *uuid) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -559,11 +557,11 @@ virStoragePoolObjFindByUUIDLocked(virStoragePoolObjListPtr pools, * * Returns: Locked and reffed storage pool object or NULL if not found */ -virStoragePoolObjPtr -virStoragePoolObjFindByUUID(virStoragePoolObjListPtr pools, +virStoragePoolObj * +virStoragePoolObjFindByUUID(virStoragePoolObjList *pools, const unsigned char *uuid) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; virObjectRWLockRead(pools); obj = virStoragePoolObjFindByUUIDLocked(pools, uuid); @@ -575,8 +573,8 @@ virStoragePoolObjFindByUUID(virStoragePoolObjListPtr pools, } -static virStoragePoolObjPtr -virStoragePoolObjFindByNameLocked(virStoragePoolObjListPtr pools, +static virStoragePoolObj * +virStoragePoolObjFindByNameLocked(virStoragePoolObjList *pools, const char *name) { return virObjectRef(virHashLookup(pools->objsName, name)); @@ -592,11 +590,11 @@ virStoragePoolObjFindByNameLocked(virStoragePoolObjListPtr pools, * * Returns: Locked and reffed storage pool object or NULL if not found */ -virStoragePoolObjPtr -virStoragePoolObjFindByName(virStoragePoolObjListPtr pools, +virStoragePoolObj * +virStoragePoolObjFindByName(virStoragePoolObjList *pools, const char *name) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; virObjectRWLockRead(pools); obj = virStoragePoolObjFindByNameLocked(pools, name); @@ -608,9 +606,9 @@ virStoragePoolObjFindByName(virStoragePoolObjListPtr pools, } -static virStoragePoolObjPtr -virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr obj, - virStoragePoolDefPtr def) +static virStoragePoolObj * +virStoragePoolSourceFindDuplicateDevices(virStoragePoolObj *obj, + virStoragePoolDef *def) { size_t i, j; @@ -626,7 +624,7 @@ virStoragePoolSourceFindDuplicateDevices(virStoragePoolObjPtr obj, void -virStoragePoolObjClearVols(virStoragePoolObjPtr obj) +virStoragePoolObjClearVols(virStoragePoolObj *obj) { if (!obj->volumes) return; @@ -638,11 +636,11 @@ virStoragePoolObjClearVols(virStoragePoolObjPtr obj) int -virStoragePoolObjAddVol(virStoragePoolObjPtr obj, - virStorageVolDefPtr voldef) +virStoragePoolObjAddVol(virStoragePoolObj *obj, + virStorageVolDef *voldef) { - virStorageVolObjPtr volobj = NULL; - virStorageVolObjListPtr volumes = obj->volumes; + virStorageVolObj *volobj = NULL; + virStorageVolObjList *volumes = obj->volumes; virObjectRWLockWrite(volumes); @@ -679,11 +677,11 @@ virStoragePoolObjAddVol(virStoragePoolObjPtr obj, void -virStoragePoolObjRemoveVol(virStoragePoolObjPtr obj, - virStorageVolDefPtr voldef) +virStoragePoolObjRemoveVol(virStoragePoolObj *obj, + virStorageVolDef *voldef) { - virStorageVolObjListPtr volumes = obj->volumes; - virStorageVolObjPtr volobj; + virStorageVolObjList *volumes = obj->volumes; + virStorageVolObj *volobj; virObjectRWLockWrite(volumes); volobj = virHashLookup(volumes->objsName, voldef->name); @@ -708,7 +706,7 @@ virStoragePoolObjRemoveVol(virStoragePoolObjPtr obj, size_t -virStoragePoolObjGetVolumesCount(virStoragePoolObjPtr obj) +virStoragePoolObjGetVolumesCount(virStoragePoolObj *obj) { size_t nbElems; @@ -731,7 +729,7 @@ virStoragePoolObjForEachVolumeCb(void *payload, void *opaque) { int ret = 0; - virStorageVolObjPtr volobj = payload; + virStorageVolObj *volobj = payload; struct _virStoragePoolObjForEachVolData *data = opaque; virObjectLock(volobj); @@ -744,7 +742,7 @@ virStoragePoolObjForEachVolumeCb(void *payload, int -virStoragePoolObjForEachVolume(virStoragePoolObjPtr obj, +virStoragePoolObjForEachVolume(virStoragePoolObj *obj, virStorageVolObjListIterator iter, const void *opaque) { @@ -769,7 +767,7 @@ virStoragePoolObjSearchVolumeCb(const void *payload, const char *name G_GNUC_UNUSED, const void *opaque) { - virStorageVolObjPtr volobj = (virStorageVolObjPtr) payload; + virStorageVolObj *volobj = (virStorageVolObj *) payload; struct _virStoragePoolObjSearchVolData *data = (struct _virStoragePoolObjSearchVolData *) opaque; int found = 0; @@ -783,12 +781,12 @@ virStoragePoolObjSearchVolumeCb(const void *payload, } -virStorageVolDefPtr -virStoragePoolObjSearchVolume(virStoragePoolObjPtr obj, +virStorageVolDef * +virStoragePoolObjSearchVolume(virStoragePoolObj *obj, virStorageVolObjListSearcher iter, const void *opaque) { - virStorageVolObjPtr volobj; + virStorageVolObj *volobj; struct _virStoragePoolObjSearchVolData data = { .iter = iter, .opaque = opaque }; @@ -805,11 +803,11 @@ virStoragePoolObjSearchVolume(virStoragePoolObjPtr obj, } -virStorageVolDefPtr -virStorageVolDefFindByKey(virStoragePoolObjPtr obj, +virStorageVolDef * +virStorageVolDefFindByKey(virStoragePoolObj *obj, const char *key) { - virStorageVolObjPtr volobj; + virStorageVolObj *volobj; virObjectRWLockRead(obj->volumes); volobj = virHashLookup(obj->volumes->objsKey, key); @@ -821,11 +819,11 @@ virStorageVolDefFindByKey(virStoragePoolObjPtr obj, } -virStorageVolDefPtr -virStorageVolDefFindByPath(virStoragePoolObjPtr obj, +virStorageVolDef * +virStorageVolDefFindByPath(virStoragePoolObj *obj, const char *path) { - virStorageVolObjPtr volobj; + virStorageVolObj *volobj; virObjectRWLockRead(obj->volumes); volobj = virHashLookup(obj->volumes->objsPath, path); @@ -837,11 +835,11 @@ virStorageVolDefFindByPath(virStoragePoolObjPtr obj, } -virStorageVolDefPtr -virStorageVolDefFindByName(virStoragePoolObjPtr obj, +virStorageVolDef * +virStorageVolDefFindByName(virStoragePoolObj *obj, const char *name) { - virStorageVolObjPtr volobj; + virStorageVolObj *volobj; virObjectRWLockRead(obj->volumes); volobj = virHashLookup(obj->volumes->objsName, name); @@ -856,7 +854,7 @@ virStorageVolDefFindByName(virStoragePoolObjPtr obj, struct _virStorageVolObjCountData { virConnectPtr conn; virStoragePoolVolumeACLFilter filter; - virStoragePoolDefPtr pooldef; + virStoragePoolDef *pooldef; int count; }; @@ -866,7 +864,7 @@ virStoragePoolObjNumOfVolumesCb(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virStorageVolObjPtr volobj = payload; + virStorageVolObj *volobj = payload; struct _virStorageVolObjCountData *data = opaque; virObjectLock(volobj); @@ -884,11 +882,11 @@ virStoragePoolObjNumOfVolumesCb(void *payload, int -virStoragePoolObjNumOfVolumes(virStoragePoolObjPtr obj, +virStoragePoolObjNumOfVolumes(virStoragePoolObj *obj, virConnectPtr conn, virStoragePoolVolumeACLFilter filter) { - virStorageVolObjListPtr volumes = obj->volumes; + virStorageVolObjList *volumes = obj->volumes; struct _virStorageVolObjCountData data = { .conn = conn, .filter = filter, .pooldef = obj->def, .count = 0 }; @@ -903,7 +901,7 @@ virStoragePoolObjNumOfVolumes(virStoragePoolObjPtr obj, struct _virStorageVolObjNameData { virConnectPtr conn; virStoragePoolVolumeACLFilter filter; - virStoragePoolDefPtr pooldef; + virStoragePoolDef *pooldef; bool error; int nnames; int maxnames; @@ -915,7 +913,7 @@ virStoragePoolObjVolumeGetNamesCb(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virStorageVolObjPtr volobj = payload; + virStorageVolObj *volobj = payload; struct _virStorageVolObjNameData *data = opaque; if (data->error) @@ -942,13 +940,13 @@ virStoragePoolObjVolumeGetNamesCb(void *payload, int -virStoragePoolObjVolumeGetNames(virStoragePoolObjPtr obj, +virStoragePoolObjVolumeGetNames(virStoragePoolObj *obj, virConnectPtr conn, virStoragePoolVolumeACLFilter filter, char **const names, int maxnames) { - virStorageVolObjListPtr volumes = obj->volumes; + virStorageVolObjList *volumes = obj->volumes; struct _virStorageVolObjNameData data = { .conn = conn, .filter = filter, .pooldef = obj->def, .error = false, .nnames = 0, .maxnames = maxnames, .names = names }; @@ -970,11 +968,10 @@ virStoragePoolObjVolumeGetNames(virStoragePoolObjPtr obj, typedef struct _virStoragePoolObjVolumeListExportData virStoragePoolObjVolumeListExportData; -typedef virStoragePoolObjVolumeListExportData *virStoragePoolObjVolumeListExportDataPtr; struct _virStoragePoolObjVolumeListExportData { virConnectPtr conn; virStoragePoolVolumeACLFilter filter; - virStoragePoolDefPtr pooldef; + virStoragePoolDef *pooldef; bool error; int nvols; virStorageVolPtr *vols; @@ -985,8 +982,8 @@ virStoragePoolObjVolumeListExportCallback(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virStorageVolObjPtr volobj = payload; - virStoragePoolObjVolumeListExportDataPtr data = opaque; + virStorageVolObj *volobj = payload; + virStoragePoolObjVolumeListExportData *data = opaque; virStorageVolPtr vol = NULL; if (data->error) @@ -1018,11 +1015,11 @@ virStoragePoolObjVolumeListExportCallback(void *payload, int virStoragePoolObjVolumeListExport(virConnectPtr conn, - virStoragePoolObjPtr obj, + virStoragePoolObj *obj, virStorageVolPtr **vols, virStoragePoolVolumeACLFilter filter) { - virStorageVolObjListPtr volumes = obj->volumes; + virStorageVolObjList *volumes = obj->volumes; virStoragePoolObjVolumeListExportData data = { .conn = conn, .filter = filter, .pooldef = obj->def, .error = false, .nvols = 0, .vols = NULL }; @@ -1055,8 +1052,8 @@ virStoragePoolObjVolumeListExport(virConnectPtr conn, /* * virStoragePoolObjIsDuplicate: - * @doms : virStoragePoolObjListPtr to search - * @def : virStoragePoolDefPtr definition of pool to lookup + * @doms : virStoragePoolObjList * to search + * @def : virStoragePoolDef * definition of pool to lookup * @check_active: If true, ensure that pool is not active * @objRet: returned pool object * @@ -1067,13 +1064,13 @@ virStoragePoolObjVolumeListExport(virConnectPtr conn, * 1 if pool is a duplicate (name and UUID match) */ static int -virStoragePoolObjIsDuplicate(virStoragePoolObjListPtr pools, - virStoragePoolDefPtr def, +virStoragePoolObjIsDuplicate(virStoragePoolObjList *pools, + virStoragePoolDef *def, bool check_active, - virStoragePoolObjPtr *objRet) + virStoragePoolObj **objRet) { int ret = -1; - virStoragePoolObjPtr obj = NULL; + virStoragePoolObj *obj = NULL; /* See if a Pool with matching UUID already exists */ obj = virStoragePoolObjFindByUUIDLocked(pools, def->uuid); @@ -1133,7 +1130,7 @@ virStoragePoolObjIsDuplicate(virStoragePoolObjListPtr pools, static int -getSCSIHostNumber(virStorageAdapterSCSIHostPtr scsi_host, +getSCSIHostNumber(virStorageAdapterSCSIHost *scsi_host, unsigned int *hostnum) { int ret = -1; @@ -1141,7 +1138,7 @@ getSCSIHostNumber(virStorageAdapterSCSIHostPtr scsi_host, char *name = NULL; if (scsi_host->has_parent) { - virPCIDeviceAddressPtr addr = &scsi_host->parentaddr; + virPCIDeviceAddress *addr = &scsi_host->parentaddr; unsigned int unique_id = scsi_host->unique_id; if (!(name = virSCSIHostGetNameByParentaddr(addr->domain, @@ -1190,7 +1187,7 @@ virStorageIsSameHostnum(const char *name, * fc_adapter host# and the scsi_host host# */ static bool -matchFCHostToSCSIHost(virStorageAdapterFCHostPtr fchost, +matchFCHostToSCSIHost(virStorageAdapterFCHost *fchost, unsigned int scsi_hostnum) { virConnectPtr conn = NULL; @@ -1259,11 +1256,11 @@ matchFCHostToSCSIHost(virStorageAdapterFCHostPtr fchost, static bool -matchSCSIAdapterParent(virStorageAdapterSCSIHostPtr pool_scsi_host, - virStorageAdapterSCSIHostPtr def_scsi_host) +matchSCSIAdapterParent(virStorageAdapterSCSIHost *pool_scsi_host, + virStorageAdapterSCSIHost *def_scsi_host) { - virPCIDeviceAddressPtr pooladdr = &pool_scsi_host->parentaddr; - virPCIDeviceAddressPtr defaddr = &def_scsi_host->parentaddr; + virPCIDeviceAddress *pooladdr = &pool_scsi_host->parentaddr; + virPCIDeviceAddress *defaddr = &def_scsi_host->parentaddr; if (pooladdr->domain == defaddr->domain && pooladdr->bus == defaddr->bus && @@ -1277,8 +1274,8 @@ matchSCSIAdapterParent(virStorageAdapterSCSIHostPtr pool_scsi_host, static bool -virStoragePoolSourceMatchSingleHost(virStoragePoolSourcePtr poolsrc, - virStoragePoolSourcePtr defsrc) +virStoragePoolSourceMatchSingleHost(virStoragePoolSource *poolsrc, + virStoragePoolSource *defsrc) { if (poolsrc->nhost != 1 && defsrc->nhost != 1) return false; @@ -1292,11 +1289,11 @@ virStoragePoolSourceMatchSingleHost(virStoragePoolSourcePtr poolsrc, static bool -virStoragePoolSourceISCSIMatch(virStoragePoolObjPtr obj, - virStoragePoolDefPtr def) +virStoragePoolSourceISCSIMatch(virStoragePoolObj *obj, + virStoragePoolDef *def) { - virStoragePoolSourcePtr poolsrc = &obj->def->source; - virStoragePoolSourcePtr defsrc = &def->source; + virStoragePoolSource *poolsrc = &obj->def->source; + virStoragePoolSource *defsrc = &def->source; /* NB: Do not check the source host name */ if (STRNEQ_NULLABLE(poolsrc->initiator.iqn, defsrc->initiator.iqn)) @@ -1306,9 +1303,9 @@ virStoragePoolSourceISCSIMatch(virStoragePoolObjPtr obj, } -static virStoragePoolObjPtr -virStoragePoolObjSourceMatchTypeDIR(virStoragePoolObjPtr obj, - virStoragePoolDefPtr def) +static virStoragePoolObj * +virStoragePoolObjSourceMatchTypeDIR(virStoragePoolObj *obj, + virStoragePoolDef *def) { if (obj->def->type == VIR_STORAGE_POOL_DIR) { if (STREQ(obj->def->target.path, def->target.path)) @@ -1330,16 +1327,16 @@ virStoragePoolObjSourceMatchTypeDIR(virStoragePoolObjPtr obj, } -static virStoragePoolObjPtr -virStoragePoolObjSourceMatchTypeISCSI(virStoragePoolObjPtr obj, - virStoragePoolDefPtr def) +static virStoragePoolObj * +virStoragePoolObjSourceMatchTypeISCSI(virStoragePoolObj *obj, + virStoragePoolDef *def) { - virStorageAdapterPtr pool_adapter = &obj->def->source.adapter; - virStorageAdapterPtr def_adapter = &def->source.adapter; - virStorageAdapterSCSIHostPtr pool_scsi_host; - virStorageAdapterSCSIHostPtr def_scsi_host; - virStorageAdapterFCHostPtr pool_fchost; - virStorageAdapterFCHostPtr def_fchost; + virStorageAdapter *pool_adapter = &obj->def->source.adapter; + virStorageAdapter *def_adapter = &def->source.adapter; + virStorageAdapterSCSIHost *pool_scsi_host; + virStorageAdapterSCSIHost *def_scsi_host; + virStorageAdapterFCHost *pool_fchost; + virStorageAdapterFCHost *def_fchost; unsigned int pool_hostnum; unsigned int def_hostnum; unsigned int scsi_hostnum; @@ -1395,11 +1392,11 @@ virStoragePoolObjSourceMatchTypeISCSI(virStoragePoolObjPtr obj, } -static virStoragePoolObjPtr -virStoragePoolObjSourceMatchTypeDEVICE(virStoragePoolObjPtr obj, - virStoragePoolDefPtr def) +static virStoragePoolObj * +virStoragePoolObjSourceMatchTypeDEVICE(virStoragePoolObj *obj, + virStoragePoolDef *def) { - virStoragePoolObjPtr matchobj = NULL; + virStoragePoolObj *matchobj = NULL; if (obj->def->type == VIR_STORAGE_POOL_ISCSI) { if (def->type != VIR_STORAGE_POOL_ISCSI) @@ -1424,7 +1421,7 @@ virStoragePoolObjSourceMatchTypeDEVICE(virStoragePoolObjPtr obj, struct _virStoragePoolObjFindDuplicateData { - virStoragePoolDefPtr def; + virStoragePoolDef *def; }; static int @@ -1432,7 +1429,7 @@ virStoragePoolObjSourceFindDuplicateCb(const void *payload, const char *name G_GNUC_UNUSED, const void *opaque) { - virStoragePoolObjPtr obj = (virStoragePoolObjPtr) payload; + virStoragePoolObj *obj = (virStoragePoolObj *) payload; struct _virStoragePoolObjFindDuplicateData *data = (struct _virStoragePoolObjFindDuplicateData *) opaque; @@ -1500,11 +1497,11 @@ virStoragePoolObjSourceFindDuplicateCb(const void *payload, static int -virStoragePoolObjSourceFindDuplicate(virStoragePoolObjListPtr pools, - virStoragePoolDefPtr def) +virStoragePoolObjSourceFindDuplicate(virStoragePoolObjList *pools, + virStoragePoolDef *def) { struct _virStoragePoolObjFindDuplicateData data = {.def = def}; - virStoragePoolObjPtr obj = NULL; + virStoragePoolObj *obj = NULL; obj = virHashSearch(pools->objs, virStoragePoolObjSourceFindDuplicateCb, &data, NULL); @@ -1521,8 +1518,8 @@ virStoragePoolObjSourceFindDuplicate(virStoragePoolObjListPtr pools, static void -virStoragePoolObjAssignDef(virStoragePoolObjPtr obj, - virStoragePoolDefPtr def, +virStoragePoolObjAssignDef(virStoragePoolObj *obj, + virStoragePoolDef *def, unsigned int flags) { if (virStoragePoolObjIsActive(obj) || @@ -1559,12 +1556,12 @@ virStoragePoolObjAssignDef(virStoragePoolObjPtr obj, * * Returns locked and reffed object pointer or NULL on error */ -virStoragePoolObjPtr -virStoragePoolObjListAdd(virStoragePoolObjListPtr pools, - virStoragePoolDefPtr def, +virStoragePoolObj * +virStoragePoolObjListAdd(virStoragePoolObjList *pools, + virStoragePoolDef *def, unsigned int flags) { - virStoragePoolObjPtr obj = NULL; + virStoragePoolObj *obj = NULL; char uuidstr[VIR_UUID_STRING_BUFLEN]; int rc; @@ -1609,13 +1606,13 @@ virStoragePoolObjListAdd(virStoragePoolObjListPtr pools, } -static virStoragePoolObjPtr -virStoragePoolObjLoad(virStoragePoolObjListPtr pools, +static virStoragePoolObj * +virStoragePoolObjLoad(virStoragePoolObjList *pools, const char *file, const char *path, const char *autostartLink) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; g_autoptr(virStoragePoolDef) def = NULL; if (!(def = virStoragePoolDefParseFile(path))) @@ -1645,13 +1642,13 @@ virStoragePoolObjLoad(virStoragePoolObjListPtr pools, } -static virStoragePoolObjPtr -virStoragePoolObjLoadState(virStoragePoolObjListPtr pools, +static virStoragePoolObj * +virStoragePoolObjLoadState(virStoragePoolObjList *pools, const char *stateDir, const char *name) { char *stateFile = NULL; - virStoragePoolObjPtr obj = NULL; + virStoragePoolObj *obj = NULL; xmlDocPtr xml = NULL; xmlXPathContextPtr ctxt = NULL; xmlNodePtr node = NULL; @@ -1703,7 +1700,7 @@ virStoragePoolObjLoadState(virStoragePoolObjListPtr pools, int -virStoragePoolObjLoadAllState(virStoragePoolObjListPtr pools, +virStoragePoolObjLoadAllState(virStoragePoolObjList *pools, const char *stateDir) { g_autoptr(DIR) dir = NULL; @@ -1715,7 +1712,7 @@ virStoragePoolObjLoadAllState(virStoragePoolObjListPtr pools, return rc; while ((ret = virDirRead(dir, &entry, stateDir)) > 0) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; if (!virStringStripSuffix(entry->d_name, ".xml")) continue; @@ -1730,7 +1727,7 @@ virStoragePoolObjLoadAllState(virStoragePoolObjListPtr pools, int -virStoragePoolObjLoadAllConfigs(virStoragePoolObjListPtr pools, +virStoragePoolObjLoadAllConfigs(virStoragePoolObjList *pools, const char *configDir, const char *autostartDir) { @@ -1745,7 +1742,7 @@ virStoragePoolObjLoadAllConfigs(virStoragePoolObjListPtr pools, while ((ret = virDirRead(dir, &entry, configDir)) > 0) { char *path; char *autostartLink; - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; if (!virStringHasSuffix(entry->d_name, ".xml")) continue; @@ -1771,9 +1768,9 @@ virStoragePoolObjLoadAllConfigs(virStoragePoolObjListPtr pools, int -virStoragePoolObjSaveDef(virStorageDriverStatePtr driver, - virStoragePoolObjPtr obj, - virStoragePoolDefPtr def) +virStoragePoolObjSaveDef(virStorageDriverState *driver, + virStoragePoolObj *obj, + virStoragePoolDef *def) { if (!obj->configFile) { if (g_mkdir_with_parents(driver->configDir, 0777) < 0) { @@ -1800,7 +1797,7 @@ virStoragePoolObjSaveDef(virStorageDriverStatePtr driver, int -virStoragePoolObjDeleteDef(virStoragePoolObjPtr obj) +virStoragePoolObjDeleteDef(virStoragePoolObj *obj) { if (!obj->configFile) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -1832,7 +1829,7 @@ virStoragePoolObjNumOfStoragePoolsCb(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virStoragePoolObjPtr obj = payload; + virStoragePoolObj *obj = payload; struct _virStoragePoolCountData *data = opaque; virObjectLock(obj); @@ -1852,7 +1849,7 @@ virStoragePoolObjNumOfStoragePoolsCb(void *payload, int -virStoragePoolObjNumOfStoragePools(virStoragePoolObjListPtr pools, +virStoragePoolObjNumOfStoragePools(virStoragePoolObjList *pools, virConnectPtr conn, bool wantActive, virStoragePoolObjListACLFilter filter) @@ -1884,7 +1881,7 @@ virStoragePoolObjGetNamesCb(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virStoragePoolObjPtr obj = payload; + virStoragePoolObj *obj = payload; struct _virStoragePoolNameData *data = opaque; if (data->error) @@ -1913,7 +1910,7 @@ virStoragePoolObjGetNamesCb(void *payload, int -virStoragePoolObjGetNames(virStoragePoolObjListPtr pools, +virStoragePoolObjGetNames(virStoragePoolObjList *pools, virConnectPtr conn, bool wantActive, virStoragePoolObjListACLFilter filter, @@ -1942,7 +1939,7 @@ virStoragePoolObjGetNames(virStoragePoolObjListPtr pools, #define MATCH(FLAG) (flags & (FLAG)) static bool -virStoragePoolObjMatch(virStoragePoolObjPtr obj, +virStoragePoolObjMatch(virStoragePoolObj *obj, unsigned int flags) { /* filter by active state */ @@ -2008,7 +2005,6 @@ virStoragePoolObjMatch(virStoragePoolObjPtr obj, typedef struct _virStoragePoolObjListExportData virStoragePoolObjListExportData; -typedef virStoragePoolObjListExportData *virStoragePoolObjListExportDataPtr; struct _virStoragePoolObjListExportData { virConnectPtr conn; virStoragePoolObjListACLFilter filter; @@ -2027,8 +2023,8 @@ virStoragePoolObjListExportCallback(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virStoragePoolObjPtr obj = payload; - virStoragePoolObjListExportDataPtr data = opaque; + virStoragePoolObj *obj = payload; + virStoragePoolObjListExportData *data = opaque; virStoragePoolPtr pool = NULL; if (data->error) @@ -2061,7 +2057,7 @@ virStoragePoolObjListExportCallback(void *payload, int virStoragePoolObjListExport(virConnectPtr conn, - virStoragePoolObjListPtr poolobjs, + virStoragePoolObjList *poolobjs, virStoragePoolPtr **pools, virStoragePoolObjListFilter filter, unsigned int flags) diff --git a/src/conf/virstorageobj.h b/src/conf/virstorageobj.h index 54100ac22a..65f2ae8175 100644 --- a/src/conf/virstorageobj.h +++ b/src/conf/virstorageobj.h @@ -26,21 +26,17 @@ #include "capabilities.h" typedef struct _virStoragePoolObj virStoragePoolObj; -typedef virStoragePoolObj *virStoragePoolObjPtr; typedef struct _virStoragePoolObjList virStoragePoolObjList; -typedef virStoragePoolObjList *virStoragePoolObjListPtr; typedef struct _virStorageDriverState virStorageDriverState; -typedef virStorageDriverState *virStorageDriverStatePtr; - struct _virStorageDriverState { virMutex lock; /* pid file FD, ensures two copies of the driver can't use the same root */ int lockFD; - virStoragePoolObjListPtr pools; + virStoragePoolObjList *pools; char *configDir; char *autostartDir; @@ -48,147 +44,147 @@ struct _virStorageDriverState { bool privileged; /* Immutable pointer, self-locking APIs */ - virObjectEventStatePtr storageEventState; + virObjectEventState *storageEventState; /* Immutable pointer, read only after initialized */ - virCapsPtr caps; + virCaps *caps; }; typedef bool (*virStoragePoolObjListFilter)(virConnectPtr conn, - virStoragePoolDefPtr def); + virStoragePoolDef *def); -virStoragePoolObjPtr +virStoragePoolObj * virStoragePoolObjNew(void); void -virStoragePoolObjEndAPI(virStoragePoolObjPtr *obj); +virStoragePoolObjEndAPI(virStoragePoolObj **obj); -virStoragePoolDefPtr -virStoragePoolObjGetDef(virStoragePoolObjPtr obj); +virStoragePoolDef * +virStoragePoolObjGetDef(virStoragePoolObj *obj); void -virStoragePoolObjSetDef(virStoragePoolObjPtr obj, - virStoragePoolDefPtr def); +virStoragePoolObjSetDef(virStoragePoolObj *obj, + virStoragePoolDef *def); -virStoragePoolDefPtr -virStoragePoolObjGetNewDef(virStoragePoolObjPtr obj); +virStoragePoolDef * +virStoragePoolObjGetNewDef(virStoragePoolObj *obj); void -virStoragePoolObjDefUseNewDef(virStoragePoolObjPtr obj); +virStoragePoolObjDefUseNewDef(virStoragePoolObj *obj); const char * -virStoragePoolObjGetConfigFile(virStoragePoolObjPtr obj); +virStoragePoolObjGetConfigFile(virStoragePoolObj *obj); void -virStoragePoolObjSetConfigFile(virStoragePoolObjPtr obj, +virStoragePoolObjSetConfigFile(virStoragePoolObj *obj, char *configFile); const char * -virStoragePoolObjGetAutostartLink(virStoragePoolObjPtr obj); +virStoragePoolObjGetAutostartLink(virStoragePoolObj *obj); bool -virStoragePoolObjIsActive(virStoragePoolObjPtr obj); +virStoragePoolObjIsActive(virStoragePoolObj *obj); void -virStoragePoolObjSetActive(virStoragePoolObjPtr obj, +virStoragePoolObjSetActive(virStoragePoolObj *obj, bool active); void -virStoragePoolObjSetStarting(virStoragePoolObjPtr obj, +virStoragePoolObjSetStarting(virStoragePoolObj *obj, bool starting); bool -virStoragePoolObjIsStarting(virStoragePoolObjPtr obj); +virStoragePoolObjIsStarting(virStoragePoolObj *obj); bool -virStoragePoolObjIsAutostart(virStoragePoolObjPtr obj); +virStoragePoolObjIsAutostart(virStoragePoolObj *obj); void -virStoragePoolObjSetAutostart(virStoragePoolObjPtr obj, +virStoragePoolObjSetAutostart(virStoragePoolObj *obj, bool autostart); unsigned int -virStoragePoolObjGetAsyncjobs(virStoragePoolObjPtr obj); +virStoragePoolObjGetAsyncjobs(virStoragePoolObj *obj); void -virStoragePoolObjIncrAsyncjobs(virStoragePoolObjPtr obj); +virStoragePoolObjIncrAsyncjobs(virStoragePoolObj *obj); void -virStoragePoolObjDecrAsyncjobs(virStoragePoolObjPtr obj); +virStoragePoolObjDecrAsyncjobs(virStoragePoolObj *obj); int -virStoragePoolObjLoadAllConfigs(virStoragePoolObjListPtr pools, +virStoragePoolObjLoadAllConfigs(virStoragePoolObjList *pools, const char *configDir, const char *autostartDir); int -virStoragePoolObjLoadAllState(virStoragePoolObjListPtr pools, +virStoragePoolObjLoadAllState(virStoragePoolObjList *pools, const char *stateDir); -virStoragePoolObjPtr -virStoragePoolObjFindByUUID(virStoragePoolObjListPtr pools, +virStoragePoolObj * +virStoragePoolObjFindByUUID(virStoragePoolObjList *pools, const unsigned char *uuid); -virStoragePoolObjPtr -virStoragePoolObjFindByName(virStoragePoolObjListPtr pools, +virStoragePoolObj * +virStoragePoolObjFindByName(virStoragePoolObjList *pools, const char *name); int -virStoragePoolObjAddVol(virStoragePoolObjPtr obj, - virStorageVolDefPtr voldef); +virStoragePoolObjAddVol(virStoragePoolObj *obj, + virStorageVolDef *voldef); void -virStoragePoolObjRemoveVol(virStoragePoolObjPtr obj, - virStorageVolDefPtr voldef); +virStoragePoolObjRemoveVol(virStoragePoolObj *obj, + virStorageVolDef *voldef); size_t -virStoragePoolObjGetVolumesCount(virStoragePoolObjPtr obj); +virStoragePoolObjGetVolumesCount(virStoragePoolObj *obj); typedef int -(*virStorageVolObjListIterator)(virStorageVolDefPtr voldef, +(*virStorageVolObjListIterator)(virStorageVolDef *voldef, const void *opaque); int -virStoragePoolObjForEachVolume(virStoragePoolObjPtr obj, +virStoragePoolObjForEachVolume(virStoragePoolObj *obj, virStorageVolObjListIterator iter, const void *opaque); typedef bool -(*virStorageVolObjListSearcher)(virStorageVolDefPtr voldef, +(*virStorageVolObjListSearcher)(virStorageVolDef *voldef, const void *opaque); -virStorageVolDefPtr -virStoragePoolObjSearchVolume(virStoragePoolObjPtr obj, +virStorageVolDef * +virStoragePoolObjSearchVolume(virStoragePoolObj *obj, virStorageVolObjListSearcher iter, const void *opaque); -virStorageVolDefPtr -virStorageVolDefFindByKey(virStoragePoolObjPtr obj, +virStorageVolDef * +virStorageVolDefFindByKey(virStoragePoolObj *obj, const char *key); -virStorageVolDefPtr -virStorageVolDefFindByPath(virStoragePoolObjPtr obj, +virStorageVolDef * +virStorageVolDefFindByPath(virStoragePoolObj *obj, const char *path); -virStorageVolDefPtr -virStorageVolDefFindByName(virStoragePoolObjPtr obj, +virStorageVolDef * +virStorageVolDefFindByName(virStoragePoolObj *obj, const char *name); void -virStoragePoolObjClearVols(virStoragePoolObjPtr obj); +virStoragePoolObjClearVols(virStoragePoolObj *obj); typedef bool (*virStoragePoolVolumeACLFilter)(virConnectPtr conn, - virStoragePoolDefPtr pool, - virStorageVolDefPtr def); + virStoragePoolDef *pool, + virStorageVolDef *def); int -virStoragePoolObjNumOfVolumes(virStoragePoolObjPtr obj, +virStoragePoolObjNumOfVolumes(virStoragePoolObj *obj, virConnectPtr conn, virStoragePoolVolumeACLFilter filter); int -virStoragePoolObjVolumeGetNames(virStoragePoolObjPtr obj, +virStoragePoolObjVolumeGetNames(virStoragePoolObj *obj, virConnectPtr conn, virStoragePoolVolumeACLFilter filter, char **const names, @@ -196,7 +192,7 @@ virStoragePoolObjVolumeGetNames(virStoragePoolObjPtr obj, int virStoragePoolObjVolumeListExport(virConnectPtr conn, - virStoragePoolObjPtr obj, + virStoragePoolObj *obj, virStorageVolPtr **vols, virStoragePoolVolumeACLFilter filter); @@ -205,30 +201,30 @@ typedef enum { VIR_STORAGE_POOL_OBJ_LIST_ADD_CHECK_LIVE = (1 << 1), } virStoragePoolObjListFlags; -virStoragePoolObjPtr -virStoragePoolObjListAdd(virStoragePoolObjListPtr pools, - virStoragePoolDefPtr def, +virStoragePoolObj * +virStoragePoolObjListAdd(virStoragePoolObjList *pools, + virStoragePoolDef *def, unsigned int flags); int -virStoragePoolObjSaveDef(virStorageDriverStatePtr driver, - virStoragePoolObjPtr obj, - virStoragePoolDefPtr def); +virStoragePoolObjSaveDef(virStorageDriverState *driver, + virStoragePoolObj *obj, + virStoragePoolDef *def); int -virStoragePoolObjDeleteDef(virStoragePoolObjPtr obj); +virStoragePoolObjDeleteDef(virStoragePoolObj *obj); typedef bool (*virStoragePoolObjListACLFilter)(virConnectPtr conn, - virStoragePoolDefPtr def); + virStoragePoolDef *def); int -virStoragePoolObjNumOfStoragePools(virStoragePoolObjListPtr pools, +virStoragePoolObjNumOfStoragePools(virStoragePoolObjList *pools, virConnectPtr conn, bool wantActive, virStoragePoolObjListACLFilter filter); int -virStoragePoolObjGetNames(virStoragePoolObjListPtr pools, +virStoragePoolObjGetNames(virStoragePoolObjList *pools, virConnectPtr conn, bool wantActive, virStoragePoolObjListACLFilter filter, @@ -236,36 +232,36 @@ virStoragePoolObjGetNames(virStoragePoolObjListPtr pools, int maxnames); void -virStoragePoolObjFree(virStoragePoolObjPtr obj); +virStoragePoolObjFree(virStoragePoolObj *obj); typedef void -(*virStoragePoolObjListIterator)(virStoragePoolObjPtr obj, +(*virStoragePoolObjListIterator)(virStoragePoolObj *obj, const void *opaque); void -virStoragePoolObjListForEach(virStoragePoolObjListPtr pools, +virStoragePoolObjListForEach(virStoragePoolObjList *pools, virStoragePoolObjListIterator iter, const void *opaque); typedef bool -(*virStoragePoolObjListSearcher)(virStoragePoolObjPtr obj, +(*virStoragePoolObjListSearcher)(virStoragePoolObj *obj, const void *opaque); -virStoragePoolObjPtr -virStoragePoolObjListSearch(virStoragePoolObjListPtr pools, +virStoragePoolObj * +virStoragePoolObjListSearch(virStoragePoolObjList *pools, virStoragePoolObjListSearcher searcher, const void *opaque); -virStoragePoolObjListPtr +virStoragePoolObjList * virStoragePoolObjListNew(void); void -virStoragePoolObjRemove(virStoragePoolObjListPtr pools, - virStoragePoolObjPtr obj); +virStoragePoolObjRemove(virStoragePoolObjList *pools, + virStoragePoolObj *obj); int virStoragePoolObjListExport(virConnectPtr conn, - virStoragePoolObjListPtr poolobjs, + virStoragePoolObjList *poolobjs, virStoragePoolPtr **pools, virStoragePoolObjListFilter filter, unsigned int flags); diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c index 3fd7035f7a..b4965f3ee0 100644 --- a/src/cpu/cpu.c +++ b/src/cpu/cpu.c @@ -107,7 +107,7 @@ cpuGetSubDriverByName(const char *name) */ virCPUCompareResult virCPUCompareXML(virArch arch, - virCPUDefPtr host, + virCPUDef *host, const char *xml, bool failIncompatible, bool validateXML) @@ -143,8 +143,8 @@ virCPUCompareXML(virArch arch, */ virCPUCompareResult virCPUCompare(virArch arch, - virCPUDefPtr host, - virCPUDefPtr cpu, + virCPUDef *host, + virCPUDef *cpu, bool failIncompatible) { struct cpuArchDriver *driver; @@ -186,9 +186,9 @@ virCPUCompare(virArch arch, * Returns 0 on success, -1 on error. */ int -cpuDecode(virCPUDefPtr cpu, +cpuDecode(virCPUDef *cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models) + virDomainCapsCPUModels *models) { struct cpuArchDriver *driver; @@ -242,12 +242,12 @@ cpuDecode(virCPUDefPtr cpu, int cpuEncode(virArch arch, const virCPUDef *cpu, - virCPUDataPtr *forced, - virCPUDataPtr *required, - virCPUDataPtr *optional, - virCPUDataPtr *disabled, - virCPUDataPtr *forbidden, - virCPUDataPtr *vendor) + virCPUData **forced, + virCPUData **required, + virCPUData **optional, + virCPUData **disabled, + virCPUData **forbidden, + virCPUData **vendor) { struct cpuArchDriver *driver; @@ -282,10 +282,10 @@ cpuEncode(virArch arch, * * Returns an allocated memory for virCPUData or NULL on error. */ -virCPUDataPtr +virCPUData * virCPUDataNew(virArch arch) { - virCPUDataPtr data; + virCPUData *data; data = g_new0(virCPUData, 1); data->arch = arch; @@ -304,7 +304,7 @@ virCPUDataNew(virArch arch) * Returns nothing. */ void -virCPUDataFree(virCPUDataPtr data) +virCPUDataFree(virCPUData *data) { struct cpuArchDriver *driver; @@ -370,11 +370,11 @@ virCPUGetHostIsSupported(virArch arch) * * Returns host CPU definition or NULL on error. */ -virCPUDefPtr +virCPUDef * virCPUGetHost(virArch arch, virCPUType type, virNodeInfoPtr nodeInfo, - virDomainCapsCPUModelsPtr models) + virDomainCapsCPUModels *models) { struct cpuArchDriver *driver; g_autoptr(virCPUDef) cpu = NULL; @@ -439,7 +439,7 @@ virCPUGetHost(virArch arch, } -virCPUDefPtr +virCPUDef * virCPUProbeHost(virArch arch) { virNodeInfo nodeinfo; @@ -468,11 +468,11 @@ virCPUProbeHost(virArch arch) * * Returns baseline CPU definition or NULL on error. */ -virCPUDefPtr +virCPUDef * virCPUBaseline(virArch arch, - virCPUDefPtr *cpus, + virCPUDef **cpus, unsigned int ncpus, - virDomainCapsCPUModelsPtr models, + virDomainCapsCPUModels *models, const char **features, bool migratable) { @@ -548,7 +548,7 @@ virCPUBaseline(virArch arch, */ int virCPUUpdate(virArch arch, - virCPUDefPtr guest, + virCPUDef *guest, const virCPUDef *host) { struct cpuArchDriver *driver; @@ -627,9 +627,9 @@ virCPUUpdate(virArch arch, */ int virCPUUpdateLive(virArch arch, - virCPUDefPtr cpu, - virCPUDataPtr dataEnabled, - virCPUDataPtr dataDisabled) + virCPUDef *cpu, + virCPUData *dataEnabled, + virCPUData *dataDisabled) { struct cpuArchDriver *driver; @@ -701,11 +701,11 @@ virCPUCheckFeature(virArch arch, * Returns 0 on success or -1 on error. */ int -virCPUCheckForbiddenFeatures(virCPUDefPtr guest, const virCPUDef *host) +virCPUCheckForbiddenFeatures(virCPUDef *guest, const virCPUDef *host) { size_t i; for (i = 0; i < guest->nfeatures; ++i) { - virCPUFeatureDefPtr feature; + virCPUFeatureDef *feature; if (guest->features[i].policy != VIR_CPU_FEATURE_FORBID) continue; @@ -800,13 +800,13 @@ virCPUDataFormat(const virCPUData *data) * * Returns internal CPU data structure parsed from the XML or NULL on error. */ -virCPUDataPtr +virCPUData * virCPUDataParse(const char *xmlStr) { struct cpuArchDriver *driver; g_autoptr(xmlDoc) xml = NULL; g_autoptr(xmlXPathContext) ctxt = NULL; - virCPUDataPtr data = NULL; + virCPUData *data = NULL; g_autofree char *arch = NULL; VIR_DEBUG("xmlStr=%s", xmlStr); @@ -849,7 +849,7 @@ virCPUDataParse(const char *xmlStr) */ bool virCPUModelIsAllowed(const char *model, - virDomainCapsCPUModelsPtr models) + virDomainCapsCPUModels *models) { if (!models) return true; @@ -909,8 +909,8 @@ virCPUGetModels(virArch arch, char ***models) */ int virCPUTranslate(virArch arch, - virCPUDefPtr cpu, - virDomainCapsCPUModelsPtr models) + virCPUDef *cpu, + virDomainCapsCPUModels *models) { struct cpuArchDriver *driver; @@ -964,7 +964,7 @@ virCPUTranslate(virArch arch, */ int virCPUConvertLegacy(virArch arch, - virCPUDefPtr cpu) + virCPUDef *cpu) { struct cpuArchDriver *driver; @@ -1013,7 +1013,7 @@ virCPUFeatureCompare(const void *p1, */ int virCPUExpandFeatures(virArch arch, - virCPUDefPtr cpu) + virCPUDef *cpu) { struct cpuArchDriver *driver; @@ -1047,9 +1047,9 @@ virCPUExpandFeatures(virArch arch, * * Returns the copy of the CPU or NULL on error. */ -virCPUDefPtr +virCPUDef * virCPUCopyMigratable(virArch arch, - virCPUDefPtr cpu) + virCPUDef *cpu) { struct cpuArchDriver *driver; @@ -1078,7 +1078,7 @@ virCPUCopyMigratable(virArch arch, */ int virCPUValidateFeatures(virArch arch, - virCPUDefPtr cpu) + virCPUDef *cpu) { struct cpuArchDriver *driver; @@ -1106,7 +1106,7 @@ virCPUValidateFeatures(virArch arch, * Returns 0 on success, -1 on error. */ int -virCPUDataAddFeature(virCPUDataPtr cpuData, +virCPUDataAddFeature(virCPUData *cpuData, const char *name) { struct cpuArchDriver *driver; diff --git a/src/cpu/cpu.h b/src/cpu/cpu.h index 0b00f0b98d..d11d2641fc 100644 --- a/src/cpu/cpu.h +++ b/src/cpu/cpu.h @@ -31,7 +31,6 @@ typedef struct _virCPUData virCPUData; -typedef virCPUData *virCPUDataPtr; struct _virCPUData { virArch arch; union { @@ -44,48 +43,48 @@ struct _virCPUData { typedef virCPUCompareResult -(*virCPUArchCompare)(virCPUDefPtr host, - virCPUDefPtr cpu, +(*virCPUArchCompare)(virCPUDef *host, + virCPUDef *cpu, bool failIncompatible); typedef int -(*cpuArchDecode) (virCPUDefPtr cpu, +(*cpuArchDecode) (virCPUDef *cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models); + virDomainCapsCPUModels *models); typedef int (*cpuArchEncode) (virArch arch, const virCPUDef *cpu, - virCPUDataPtr *forced, - virCPUDataPtr *required, - virCPUDataPtr *optional, - virCPUDataPtr *disabled, - virCPUDataPtr *forbidden, - virCPUDataPtr *vendor); + virCPUData **forced, + virCPUData **required, + virCPUData **optional, + virCPUData **disabled, + virCPUData **forbidden, + virCPUData **vendor); typedef void -(*cpuArchDataFree) (virCPUDataPtr data); +(*cpuArchDataFree) (virCPUData *data); typedef int -(*virCPUArchGetHost)(virCPUDefPtr cpu, - virDomainCapsCPUModelsPtr models); +(*virCPUArchGetHost)(virCPUDef *cpu, + virDomainCapsCPUModels *models); -typedef virCPUDefPtr -(*virCPUArchBaseline)(virCPUDefPtr *cpus, +typedef virCPUDef * +(*virCPUArchBaseline)(virCPUDef **cpus, unsigned int ncpus, - virDomainCapsCPUModelsPtr models, + virDomainCapsCPUModels *models, const char **features, bool migratable); typedef int -(*virCPUArchUpdate)(virCPUDefPtr guest, +(*virCPUArchUpdate)(virCPUDef *guest, const virCPUDef *host, bool relative); typedef int -(*virCPUArchUpdateLive)(virCPUDefPtr cpu, - virCPUDataPtr dataEnabled, - virCPUDataPtr dataDisabled); +(*virCPUArchUpdateLive)(virCPUDef *cpu, + virCPUData *dataEnabled, + virCPUData *dataDisabled); typedef int (*virCPUArchCheckFeature)(const virCPUDef *cpu, @@ -98,30 +97,30 @@ typedef int typedef char * (*virCPUArchDataFormat)(const virCPUData *data); -typedef virCPUDataPtr +typedef virCPUData * (*virCPUArchDataParse)(xmlXPathContextPtr ctxt); typedef int (*virCPUArchGetModels)(char ***models); typedef int -(*virCPUArchTranslate)(virCPUDefPtr cpu, - virDomainCapsCPUModelsPtr models); +(*virCPUArchTranslate)(virCPUDef *cpu, + virDomainCapsCPUModels *models); typedef int -(*virCPUArchConvertLegacy)(virCPUDefPtr cpu); +(*virCPUArchConvertLegacy)(virCPUDef *cpu); typedef int -(*virCPUArchExpandFeatures)(virCPUDefPtr cpu); +(*virCPUArchExpandFeatures)(virCPUDef *cpu); -typedef virCPUDefPtr -(*virCPUArchCopyMigratable)(virCPUDefPtr cpu); +typedef virCPUDef * +(*virCPUArchCopyMigratable)(virCPUDef *cpu); typedef int -(*virCPUArchValidateFeatures)(virCPUDefPtr cpu); +(*virCPUArchValidateFeatures)(virCPUDef *cpu); typedef int -(*virCPUArchDataAddFeature)(virCPUDataPtr cpuData, +(*virCPUArchDataAddFeature)(virCPUData *cpuData, const char *name); struct cpuArchDriver { @@ -152,73 +151,73 @@ struct cpuArchDriver { virCPUCompareResult virCPUCompareXML(virArch arch, - virCPUDefPtr host, + virCPUDef *host, const char *xml, bool failIncompatible, bool validateXML); virCPUCompareResult virCPUCompare(virArch arch, - virCPUDefPtr host, - virCPUDefPtr cpu, + virCPUDef *host, + virCPUDef *cpu, bool failIncompatible) ATTRIBUTE_NONNULL(3); int -cpuDecode (virCPUDefPtr cpu, +cpuDecode (virCPUDef *cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models) + virDomainCapsCPUModels *models) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int cpuEncode (virArch arch, const virCPUDef *cpu, - virCPUDataPtr *forced, - virCPUDataPtr *required, - virCPUDataPtr *optional, - virCPUDataPtr *disabled, - virCPUDataPtr *forbidden, - virCPUDataPtr *vendor) + virCPUData **forced, + virCPUData **required, + virCPUData **optional, + virCPUData **disabled, + virCPUData **forbidden, + virCPUData **vendor) ATTRIBUTE_NONNULL(2); -virCPUDataPtr +virCPUData * virCPUDataNew(virArch arch); void -virCPUDataFree(virCPUDataPtr data); +virCPUDataFree(virCPUData *data); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUData, virCPUDataFree); bool virCPUGetHostIsSupported(virArch arch); -virCPUDefPtr +virCPUDef * virCPUGetHost(virArch arch, virCPUType type, virNodeInfoPtr nodeInfo, - virDomainCapsCPUModelsPtr models); + virDomainCapsCPUModels *models); -virCPUDefPtr +virCPUDef * virCPUProbeHost(virArch arch) G_GNUC_NO_INLINE; -virCPUDefPtr +virCPUDef * virCPUBaseline(virArch arch, - virCPUDefPtr *cpus, + virCPUDef **cpus, unsigned int ncpus, - virDomainCapsCPUModelsPtr models, + virDomainCapsCPUModels *models, const char **features, bool migratable); int virCPUUpdate(virArch arch, - virCPUDefPtr guest, + virCPUDef *guest, const virCPUDef *host) ATTRIBUTE_NONNULL(2); int virCPUUpdateLive(virArch arch, - virCPUDefPtr cpu, - virCPUDataPtr dataEnabled, - virCPUDataPtr dataDisabled) + virCPUDef *cpu, + virCPUData *dataEnabled, + virCPUData *dataDisabled) ATTRIBUTE_NONNULL(2); int @@ -229,7 +228,7 @@ virCPUCheckFeature(virArch arch, int -virCPUCheckForbiddenFeatures(virCPUDefPtr guest, +virCPUCheckForbiddenFeatures(virCPUDef *guest, const virCPUDef *host) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); @@ -242,7 +241,7 @@ virCPUDataCheckFeature(const virCPUData *data, bool virCPUModelIsAllowed(const char *model, - virDomainCapsCPUModelsPtr models) + virDomainCapsCPUModels *models) ATTRIBUTE_NONNULL(1); int @@ -250,30 +249,30 @@ virCPUGetModels(virArch arch, char ***models); int virCPUTranslate(virArch arch, - virCPUDefPtr cpu, - virDomainCapsCPUModelsPtr models) + virCPUDef *cpu, + virDomainCapsCPUModels *models) ATTRIBUTE_NONNULL(2); int virCPUConvertLegacy(virArch arch, - virCPUDefPtr cpu) + virCPUDef *cpu) ATTRIBUTE_NONNULL(2); int virCPUExpandFeatures(virArch arch, - virCPUDefPtr cpu); + virCPUDef *cpu); -virCPUDefPtr +virCPUDef * virCPUCopyMigratable(virArch arch, - virCPUDefPtr cpu); + virCPUDef *cpu); int virCPUValidateFeatures(virArch arch, - virCPUDefPtr cpu) + virCPUDef *cpu) ATTRIBUTE_NONNULL(2); int -virCPUDataAddFeature(virCPUDataPtr cpuData, +virCPUDataAddFeature(virCPUData *cpuData, const char *name); bool @@ -284,5 +283,5 @@ virCPUArchIsSupported(virArch arch); */ char *virCPUDataFormat(const virCPUData *data) ATTRIBUTE_NONNULL(1); -virCPUDataPtr virCPUDataParse(const char *xmlStr) +virCPUData *virCPUDataParse(const char *xmlStr) ATTRIBUTE_NONNULL(1); diff --git a/src/cpu/cpu_arm.c b/src/cpu/cpu_arm.c index 52bde40a15..1e5ac558b2 100644 --- a/src/cpu/cpu_arm.c +++ b/src/cpu/cpu_arm.c @@ -57,34 +57,31 @@ static const virArch archs[] = { }; typedef struct _virCPUarmVendor virCPUarmVendor; -typedef virCPUarmVendor *virCPUarmVendorPtr; struct _virCPUarmVendor { char *name; unsigned long value; }; typedef struct _virCPUarmModel virCPUarmModel; -typedef virCPUarmModel *virCPUarmModelPtr; struct _virCPUarmModel { char *name; - virCPUarmVendorPtr vendor; + virCPUarmVendor *vendor; virCPUarmData data; }; typedef struct _virCPUarmFeature virCPUarmFeature; -typedef virCPUarmFeature *virCPUarmFeaturePtr; struct _virCPUarmFeature { char *name; }; -static virCPUarmFeaturePtr +static virCPUarmFeature * virCPUarmFeatureNew(void) { return g_new0(virCPUarmFeature, 1); } static void -virCPUarmFeatureFree(virCPUarmFeaturePtr feature) +virCPUarmFeatureFree(virCPUarmFeature *feature) { if (!feature) return; @@ -97,19 +94,18 @@ virCPUarmFeatureFree(virCPUarmFeaturePtr feature) G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUarmFeature, virCPUarmFeatureFree); typedef struct _virCPUarmMap virCPUarmMap; -typedef virCPUarmMap *virCPUarmMapPtr; struct _virCPUarmMap { size_t nvendors; - virCPUarmVendorPtr *vendors; + virCPUarmVendor **vendors; size_t nmodels; - virCPUarmModelPtr *models; + virCPUarmModel **models; GPtrArray *features; }; -static virCPUarmMapPtr +static virCPUarmMap * virCPUarmMapNew(void) { - virCPUarmMapPtr map; + virCPUarmMap *map; map = g_new0(virCPUarmMap, 1); @@ -130,7 +126,7 @@ virCPUarmDataClear(virCPUarmData *data) } static void -virCPUarmDataFree(virCPUDataPtr cpuData) +virCPUarmDataFree(virCPUData *cpuData) { if (!cpuData) return; @@ -140,7 +136,7 @@ virCPUarmDataFree(virCPUDataPtr cpuData) } static void -virCPUarmModelFree(virCPUarmModelPtr model) +virCPUarmModelFree(virCPUarmModel *model) { if (!model) return; @@ -153,7 +149,7 @@ virCPUarmModelFree(virCPUarmModelPtr model) G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUarmModel, virCPUarmModelFree); static void -virCPUarmVendorFree(virCPUarmVendorPtr vendor) +virCPUarmVendorFree(virCPUarmVendor *vendor) { if (!vendor) return; @@ -165,7 +161,7 @@ virCPUarmVendorFree(virCPUarmVendorPtr vendor) G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUarmVendor, virCPUarmVendorFree); static void -virCPUarmMapFree(virCPUarmMapPtr map) +virCPUarmMapFree(virCPUarmMap *map) { size_t i; @@ -187,14 +183,14 @@ virCPUarmMapFree(virCPUarmMapPtr map) G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUarmMap, virCPUarmMapFree); -static virCPUarmFeaturePtr -virCPUarmMapFeatureFind(virCPUarmMapPtr map, +static virCPUarmFeature * +virCPUarmMapFeatureFind(virCPUarmMap *map, const char *name) { size_t i; for (i = 0; i < map->features->len; i++) { - virCPUarmFeaturePtr feature = g_ptr_array_index(map->features, i); + virCPUarmFeature *feature = g_ptr_array_index(map->features, i); if (STREQ(feature->name, name)) return feature; @@ -209,7 +205,7 @@ virCPUarmMapFeatureParse(xmlXPathContextPtr ctxt G_GNUC_UNUSED, void *data) { g_autoptr(virCPUarmFeature) feature = NULL; - virCPUarmMapPtr map = data; + virCPUarmMap *map = data; if (virCPUarmMapFeatureFind(map, name)) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -225,8 +221,8 @@ virCPUarmMapFeatureParse(xmlXPathContextPtr ctxt G_GNUC_UNUSED, return 0; } -static virCPUarmVendorPtr -virCPUarmVendorFindByID(virCPUarmMapPtr map, +static virCPUarmVendor * +virCPUarmVendorFindByID(virCPUarmMap *map, unsigned long vendor_id) { size_t i; @@ -240,8 +236,8 @@ virCPUarmVendorFindByID(virCPUarmMapPtr map, } -static virCPUarmVendorPtr -virCPUarmVendorFindByName(virCPUarmMapPtr map, +static virCPUarmVendor * +virCPUarmVendorFindByName(virCPUarmMap *map, const char *name) { size_t i; @@ -260,7 +256,7 @@ virCPUarmVendorParse(xmlXPathContextPtr ctxt, const char *name, void *data) { - virCPUarmMapPtr map = data; + virCPUarmMap *map = data; g_autoptr(virCPUarmVendor) vendor = NULL; vendor = g_new0(virCPUarmVendor, 1); @@ -292,8 +288,8 @@ virCPUarmVendorParse(xmlXPathContextPtr ctxt, return 0; } -static virCPUarmModelPtr -virCPUarmModelFind(virCPUarmMapPtr map, +static virCPUarmModel * +virCPUarmModelFind(virCPUarmMap *map, const char *name) { size_t i; @@ -307,8 +303,8 @@ virCPUarmModelFind(virCPUarmMapPtr map, } #if defined(__aarch64__) -static virCPUarmModelPtr -virCPUarmModelFindByPVR(virCPUarmMapPtr map, +static virCPUarmModel * +virCPUarmModelFindByPVR(virCPUarmMap *map, unsigned long pvr) { size_t i; @@ -327,7 +323,7 @@ virCPUarmModelParse(xmlXPathContextPtr ctxt, const char *name, void *data) { - virCPUarmMapPtr map = data; + virCPUarmMap *map = data; g_autoptr(virCPUarmModel) model = NULL; g_autofree char *vendor = NULL; @@ -378,7 +374,7 @@ virCPUarmModelParse(xmlXPathContextPtr ctxt, return 0; } -static virCPUarmMapPtr +static virCPUarmMap * virCPUarmLoadMap(void) { g_autoptr(virCPUarmMap) map = NULL; @@ -392,7 +388,7 @@ virCPUarmLoadMap(void) return g_steal_pointer(&map); } -static virCPUarmMapPtr cpuMap; +static virCPUarmMap *cpuMap; int virCPUarmDriverOnceInit(void); VIR_ONCE_GLOBAL_INIT(virCPUarmDriver); @@ -406,7 +402,7 @@ virCPUarmDriverOnceInit(void) return 0; } -static virCPUarmMapPtr +static virCPUarmMap * virCPUarmGetMap(void) { if (virCPUarmDriverInitialize() < 0) @@ -416,7 +412,7 @@ virCPUarmGetMap(void) } static int -virCPUarmUpdate(virCPUDefPtr guest, +virCPUarmUpdate(virCPUDef *guest, const virCPUDef *host, bool relative) { @@ -446,14 +442,14 @@ virCPUarmUpdate(virCPUDefPtr guest, } -static virCPUDefPtr -virCPUarmBaseline(virCPUDefPtr *cpus, +static virCPUDef * +virCPUarmBaseline(virCPUDef **cpus, unsigned int ncpus G_GNUC_UNUSED, - virDomainCapsCPUModelsPtr models G_GNUC_UNUSED, + virDomainCapsCPUModels *models G_GNUC_UNUSED, const char **features G_GNUC_UNUSED, bool migratable G_GNUC_UNUSED) { - virCPUDefPtr cpu = NULL; + virCPUDef *cpu = NULL; cpu = virCPUDefNew(); @@ -466,8 +462,8 @@ virCPUarmBaseline(virCPUDefPtr *cpus, } static virCPUCompareResult -virCPUarmCompare(virCPUDefPtr host, - virCPUDefPtr cpu, +virCPUarmCompare(virCPUDef *host, + virCPUDef *cpu, bool failIncompatible) { /* Only support host to host CPU compare for ARM */ @@ -507,16 +503,16 @@ virCPUarmCompare(virCPUDefPtr host, } static int -virCPUarmValidateFeatures(virCPUDefPtr cpu) +virCPUarmValidateFeatures(virCPUDef *cpu) { - virCPUarmMapPtr map; + virCPUarmMap *map; size_t i; if (!(map = virCPUarmGetMap())) return -1; for (i = 0; i < cpu->nfeatures; i++) { - virCPUFeatureDefPtr feature = &cpu->features[i]; + virCPUFeatureDef *feature = &cpu->features[i]; if (!virCPUarmMapFeatureFind(map, feature->name)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -595,14 +591,14 @@ virCPUarmCpuDataFromRegs(virCPUarmData *data) } static int -virCPUarmDecode(virCPUDefPtr cpu, +virCPUarmDecode(virCPUDef *cpu, const virCPUarmData *cpuData, - virDomainCapsCPUModelsPtr models) + virDomainCapsCPUModels *models) { size_t i; - virCPUarmMapPtr map; - virCPUarmModelPtr model; - virCPUarmVendorPtr vendor = NULL; + virCPUarmMap *map; + virCPUarmModel *model; + virCPUarmVendor *vendor = NULL; if (!cpuData || !(map = virCPUarmGetMap())) return -1; @@ -648,8 +644,8 @@ virCPUarmDecode(virCPUDefPtr cpu, } static int -virCPUarmGetHost(virCPUDefPtr cpu, - virDomainCapsCPUModelsPtr models) +virCPUarmGetHost(virCPUDef *cpu, + virDomainCapsCPUModels *models) { g_autoptr(virCPUData) cpuData = NULL; diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c index 3e34b14f79..c68a0f3656 100644 --- a/src/cpu/cpu_ppc64.c +++ b/src/cpu/cpu_ppc64.c @@ -35,13 +35,11 @@ VIR_LOG_INIT("cpu.cpu_ppc64"); static const virArch archs[] = { VIR_ARCH_PPC64, VIR_ARCH_PPC64LE }; typedef struct _ppc64_vendor virCPUppc64Vendor; -typedef struct _ppc64_vendor *virCPUppc64VendorPtr; struct _ppc64_vendor { char *name; }; typedef struct _ppc64_model virCPUppc64Model; -typedef struct _ppc64_model *virCPUppc64ModelPtr; struct _ppc64_model { char *name; const virCPUppc64Vendor *vendor; @@ -49,12 +47,11 @@ struct _ppc64_model { }; typedef struct _ppc64_map virCPUppc64Map; -typedef struct _ppc64_map *virCPUppc64MapPtr; struct _ppc64_map { size_t nvendors; - virCPUppc64VendorPtr *vendors; + struct _ppc64_vendor **vendors; size_t nmodels; - virCPUppc64ModelPtr *models; + struct _ppc64_model **models; }; /* Convert a legacy CPU definition by transforming @@ -64,7 +61,7 @@ struct _ppc64_map { * POWER7+_v2.1 => POWER7 * POWER8_v1.0 => POWER8 */ static int -virCPUppc64ConvertLegacy(virCPUDefPtr cpu) +virCPUppc64ConvertLegacy(virCPUDef *cpu) { if (cpu->model && (STREQ(cpu->model, "POWER7_v2.1") || @@ -146,7 +143,7 @@ ppc64DataCopy(virCPUppc64Data *dst, const virCPUppc64Data *src) } static void -ppc64VendorFree(virCPUppc64VendorPtr vendor) +ppc64VendorFree(struct _ppc64_vendor *vendor) { if (!vendor) return; @@ -156,7 +153,7 @@ ppc64VendorFree(virCPUppc64VendorPtr vendor) } G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUppc64Vendor, ppc64VendorFree); -static virCPUppc64VendorPtr +static struct _ppc64_vendor * ppc64VendorFind(const virCPUppc64Map *map, const char *name) { @@ -171,7 +168,7 @@ ppc64VendorFind(const virCPUppc64Map *map, } static void -ppc64ModelFree(virCPUppc64ModelPtr model) +ppc64ModelFree(struct _ppc64_model *model) { if (!model) return; @@ -182,7 +179,7 @@ ppc64ModelFree(virCPUppc64ModelPtr model) } G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUppc64Model, ppc64ModelFree); -static virCPUppc64ModelPtr +static struct _ppc64_model * ppc64ModelCopy(const virCPUppc64Model *model) { g_autoptr(virCPUppc64Model) copy = NULL; @@ -198,7 +195,7 @@ ppc64ModelCopy(const virCPUppc64Model *model) return g_steal_pointer(©); } -static virCPUppc64ModelPtr +static struct _ppc64_model * ppc64ModelFind(const virCPUppc64Map *map, const char *name) { @@ -212,7 +209,7 @@ ppc64ModelFind(const virCPUppc64Map *map, return NULL; } -static virCPUppc64ModelPtr +static struct _ppc64_model * ppc64ModelFindPVR(const virCPUppc64Map *map, uint32_t pvr) { @@ -220,7 +217,7 @@ ppc64ModelFindPVR(const virCPUppc64Map *map, size_t j; for (i = 0; i < map->nmodels; i++) { - virCPUppc64ModelPtr model = map->models[i]; + struct _ppc64_model *model = map->models[i]; for (j = 0; j < model->data.len; j++) { if ((pvr & model->data.pvr[j].mask) == model->data.pvr[j].value) return model; @@ -230,11 +227,11 @@ ppc64ModelFindPVR(const virCPUppc64Map *map, return NULL; } -static virCPUppc64ModelPtr +static struct _ppc64_model * ppc64ModelFromCPU(const virCPUDef *cpu, const virCPUppc64Map *map) { - virCPUppc64ModelPtr model; + struct _ppc64_model *model; if (!cpu->model) { virReportError(VIR_ERR_INVALID_ARG, "%s", @@ -252,7 +249,7 @@ ppc64ModelFromCPU(const virCPUDef *cpu, } static void -ppc64MapFree(virCPUppc64MapPtr map) +ppc64MapFree(struct _ppc64_map *map) { size_t i; @@ -276,7 +273,7 @@ ppc64VendorParse(xmlXPathContextPtr ctxt G_GNUC_UNUSED, const char *name, void *data) { - virCPUppc64MapPtr map = data; + struct _ppc64_map *map = data; g_autoptr(virCPUppc64Vendor) vendor = NULL; vendor = g_new0(virCPUppc64Vendor, 1); @@ -300,7 +297,7 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, const char *name, void *data) { - virCPUppc64MapPtr map = data; + struct _ppc64_map *map = data; g_autoptr(virCPUppc64Model) model = NULL; g_autofree xmlNodePtr *nodes = NULL; g_autofree char *vendor = NULL; @@ -371,7 +368,7 @@ ppc64ModelParse(xmlXPathContextPtr ctxt, } -static virCPUppc64MapPtr +static struct _ppc64_map * ppc64LoadMap(void) { g_autoptr(virCPUppc64Map) map = NULL; @@ -384,7 +381,7 @@ ppc64LoadMap(void) return g_steal_pointer(&map); } -static virCPUDataPtr +static virCPUData * ppc64MakeCPUData(virArch arch, virCPUppc64Data *data) { @@ -400,9 +397,9 @@ ppc64MakeCPUData(virArch arch, } static virCPUCompareResult -ppc64Compute(virCPUDefPtr host, +ppc64Compute(virCPUDef *host, const virCPUDef *other, - virCPUDataPtr *guestData, + virCPUData **guestData, char **message) { g_autoptr(virCPUppc64Map) map = NULL; @@ -519,8 +516,8 @@ ppc64Compute(virCPUDefPtr host, } static virCPUCompareResult -virCPUppc64Compare(virCPUDefPtr host, - virCPUDefPtr cpu, +virCPUppc64Compare(virCPUDef *host, + virCPUDef *cpu, bool failIncompatible) { virCPUCompareResult ret; @@ -552,9 +549,9 @@ virCPUppc64Compare(virCPUDefPtr host, } static int -ppc64DriverDecode(virCPUDefPtr cpu, +ppc64DriverDecode(virCPUDef *cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models) + virDomainCapsCPUModels *models) { g_autoptr(virCPUppc64Map) map = NULL; const virCPUppc64Model *model; @@ -584,7 +581,7 @@ ppc64DriverDecode(virCPUDefPtr cpu, } static void -virCPUppc64DataFree(virCPUDataPtr data) +virCPUppc64DataFree(virCPUData *data) { if (!data) return; @@ -595,8 +592,8 @@ virCPUppc64DataFree(virCPUDataPtr data) static int -virCPUppc64GetHost(virCPUDefPtr cpu, - virDomainCapsCPUModelsPtr models) +virCPUppc64GetHost(virCPUDef *cpu, + virDomainCapsCPUModels *models) { g_autoptr(virCPUData) cpuData = NULL; virCPUppc64Data *data; @@ -619,7 +616,7 @@ virCPUppc64GetHost(virCPUDefPtr cpu, static int -virCPUppc64Update(virCPUDefPtr guest, +virCPUppc64Update(virCPUDef *guest, const virCPUDef *host G_GNUC_UNUSED, bool relative G_GNUC_UNUSED) { @@ -637,10 +634,10 @@ virCPUppc64Update(virCPUDefPtr guest, return 0; } -static virCPUDefPtr -virCPUppc64Baseline(virCPUDefPtr *cpus, +static virCPUDef * +virCPUppc64Baseline(virCPUDef **cpus, unsigned int ncpus, - virDomainCapsCPUModelsPtr models G_GNUC_UNUSED, + virDomainCapsCPUModels *models G_GNUC_UNUSED, const char **features G_GNUC_UNUSED, bool migratable G_GNUC_UNUSED) { diff --git a/src/cpu/cpu_s390.c b/src/cpu/cpu_s390.c index 17321dc04a..8fda4a49a6 100644 --- a/src/cpu/cpu_s390.c +++ b/src/cpu/cpu_s390.c @@ -31,8 +31,8 @@ static const virArch archs[] = { VIR_ARCH_S390, VIR_ARCH_S390X }; static virCPUCompareResult -virCPUs390Compare(virCPUDefPtr host G_GNUC_UNUSED, - virCPUDefPtr cpu G_GNUC_UNUSED, +virCPUs390Compare(virCPUDef *host G_GNUC_UNUSED, + virCPUDef *cpu G_GNUC_UNUSED, bool failMessages G_GNUC_UNUSED) { /* s390 relies on QEMU to perform all runability checking. Return @@ -42,7 +42,7 @@ virCPUs390Compare(virCPUDefPtr host G_GNUC_UNUSED, } static int -virCPUs390Update(virCPUDefPtr guest, +virCPUs390Update(virCPUDef *guest, const virCPUDef *host, bool relative) { @@ -93,7 +93,7 @@ virCPUs390Update(virCPUDefPtr guest, static int -virCPUs390ValidateFeatures(virCPUDefPtr cpu) +virCPUs390ValidateFeatures(virCPUDef *cpu) { size_t i; diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c index 79c5868ae6..d01be6f7ba 100644 --- a/src/cpu/cpu_x86.c +++ b/src/cpu/cpu_x86.c @@ -40,14 +40,12 @@ VIR_LOG_INIT("cpu.cpu_x86"); static const virArch archs[] = { VIR_ARCH_I686, VIR_ARCH_X86_64 }; typedef struct _virCPUx86Vendor virCPUx86Vendor; -typedef virCPUx86Vendor *virCPUx86VendorPtr; struct _virCPUx86Vendor { char *name; virCPUx86DataItem data; }; typedef struct _virCPUx86Feature virCPUx86Feature; -typedef virCPUx86Feature *virCPUx86FeaturePtr; struct _virCPUx86Feature { char *name; virCPUx86Data data; @@ -125,42 +123,39 @@ typedef struct _virCPUx86Signature virCPUx86Signature; struct _virCPUx86Signature { unsigned int family; unsigned int model; - virBitmapPtr stepping; + virBitmap *stepping; }; typedef struct _virCPUx86Signatures virCPUx86Signatures; -typedef virCPUx86Signatures *virCPUx86SignaturesPtr; struct _virCPUx86Signatures { size_t count; virCPUx86Signature *items; }; typedef struct _virCPUx86Model virCPUx86Model; -typedef virCPUx86Model *virCPUx86ModelPtr; struct _virCPUx86Model { char *name; bool decodeHost; bool decodeGuest; - virCPUx86VendorPtr vendor; - virCPUx86SignaturesPtr signatures; + virCPUx86Vendor *vendor; + virCPUx86Signatures *signatures; virCPUx86Data data; GStrv removedFeatures; }; typedef struct _virCPUx86Map virCPUx86Map; -typedef virCPUx86Map *virCPUx86MapPtr; struct _virCPUx86Map { size_t nvendors; - virCPUx86VendorPtr *vendors; + virCPUx86Vendor **vendors; size_t nfeatures; - virCPUx86FeaturePtr *features; + virCPUx86Feature **features; size_t nmodels; - virCPUx86ModelPtr *models; + virCPUx86Model **models; size_t nblockers; - virCPUx86FeaturePtr *migrate_blockers; + virCPUx86Feature **migrate_blockers; }; -static virCPUx86MapPtr cpuMap; +static virCPUx86Map *cpuMap; int virCPUx86DriverOnceInit(void); VIR_ONCE_GLOBAL_INIT(virCPUx86Driver); @@ -175,7 +170,6 @@ typedef enum { typedef struct _virCPUx86DataIterator virCPUx86DataIterator; -typedef virCPUx86DataIterator *virCPUx86DataIteratorPtr; struct _virCPUx86DataIterator { const virCPUx86Data *data; int pos; @@ -183,7 +177,7 @@ struct _virCPUx86DataIterator { static void -virCPUx86DataIteratorInit(virCPUx86DataIteratorPtr iterator, +virCPUx86DataIteratorInit(virCPUx86DataIterator *iterator, const virCPUx86Data *data) { virCPUx86DataIterator iter = { data, -1 }; @@ -254,12 +248,12 @@ virCPUx86DataItemMatchMasked(const virCPUx86DataItem *item, static void -virCPUx86DataItemSetBits(virCPUx86DataItemPtr item, +virCPUx86DataItemSetBits(virCPUx86DataItem *item, const virCPUx86DataItem *mask) { - virCPUx86CPUIDPtr cpuid; + virCPUx86CPUID *cpuid; const virCPUx86CPUID *cpuidMask; - virCPUx86MSRPtr msr; + virCPUx86MSR *msr; const virCPUx86MSR *msrMask; if (!mask) @@ -290,12 +284,12 @@ virCPUx86DataItemSetBits(virCPUx86DataItemPtr item, static void -virCPUx86DataItemClearBits(virCPUx86DataItemPtr item, +virCPUx86DataItemClearBits(virCPUx86DataItem *item, const virCPUx86DataItem *mask) { - virCPUx86CPUIDPtr cpuid; + virCPUx86CPUID *cpuid; const virCPUx86CPUID *cpuidMask; - virCPUx86MSRPtr msr; + virCPUx86MSR *msr; const virCPUx86MSR *msrMask; if (!mask) @@ -326,12 +320,12 @@ virCPUx86DataItemClearBits(virCPUx86DataItemPtr item, static void -virCPUx86DataItemAndBits(virCPUx86DataItemPtr item, +virCPUx86DataItemAndBits(virCPUx86DataItem *item, const virCPUx86DataItem *mask) { - virCPUx86CPUIDPtr cpuid; + virCPUx86CPUID *cpuid; const virCPUx86CPUID *cpuidMask; - virCPUx86MSRPtr msr; + virCPUx86MSR *msr; const virCPUx86MSR *msrMask; if (!mask) @@ -361,8 +355,8 @@ virCPUx86DataItemAndBits(virCPUx86DataItemPtr item, } -static virCPUx86FeaturePtr -x86FeatureFind(virCPUx86MapPtr map, +static virCPUx86Feature * +x86FeatureFind(virCPUx86Map *map, const char *name) { size_t i; @@ -376,7 +370,7 @@ x86FeatureFind(virCPUx86MapPtr map, } -static virCPUx86FeaturePtr +static virCPUx86Feature * x86FeatureFindInternal(const char *name) { size_t i; @@ -394,8 +388,8 @@ x86FeatureFindInternal(const char *name) static int virCPUx86DataSorter(const void *a, const void *b) { - virCPUx86DataItemPtr da = (virCPUx86DataItemPtr) a; - virCPUx86DataItemPtr db = (virCPUx86DataItemPtr) b; + virCPUx86DataItem *da = (virCPUx86DataItem *) a; + virCPUx86DataItem *db = (virCPUx86DataItem *) b; if (da->type > db->type) return 1; @@ -441,8 +435,8 @@ virCPUx86DataItemCmp(const virCPUx86DataItem *item1, /* skips all zero CPUID leaves */ -static virCPUx86DataItemPtr -virCPUx86DataNext(virCPUx86DataIteratorPtr iterator) +static virCPUx86DataItem * +virCPUx86DataNext(virCPUx86DataIterator *iterator) { const virCPUx86Data *data = iterator->data; virCPUx86DataItem zero = { 0 }; @@ -451,7 +445,7 @@ virCPUx86DataNext(virCPUx86DataIteratorPtr iterator) return NULL; while (++iterator->pos < data->len) { - virCPUx86DataItemPtr item = data->items + iterator->pos; + virCPUx86DataItem *item = data->items + iterator->pos; if (!virCPUx86DataItemMatch(item, &zero)) return item; @@ -461,14 +455,14 @@ virCPUx86DataNext(virCPUx86DataIteratorPtr iterator) } -static virCPUx86DataItemPtr +static virCPUx86DataItem * virCPUx86DataGet(const virCPUx86Data *data, const virCPUx86DataItem *item) { size_t i; for (i = 0; i < data->len; i++) { - virCPUx86DataItemPtr di = data->items + i; + virCPUx86DataItem *di = data->items + i; if (virCPUx86DataItemCmp(di, item) == 0) return di; } @@ -488,7 +482,7 @@ G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virCPUx86Data, virCPUx86DataClear); static void -virCPUx86DataFree(virCPUDataPtr data) +virCPUx86DataFree(virCPUData *data) { if (!data) return; @@ -515,13 +509,13 @@ static int virCPUx86DataAddItem(virCPUx86Data *data, const virCPUx86DataItem *item) { - virCPUx86DataItemPtr existing; + virCPUx86DataItem *existing; if ((existing = virCPUx86DataGet(data, item))) { virCPUx86DataItemSetBits(existing, item); } else { if (VIR_APPEND_ELEMENT_COPY(data->items, data->len, - *((virCPUx86DataItemPtr)item)) < 0) + *((virCPUx86DataItem *)item)) < 0) return -1; qsort(data->items, data->len, @@ -537,7 +531,7 @@ x86DataAdd(virCPUx86Data *data1, const virCPUx86Data *data2) { virCPUx86DataIterator iter; - virCPUx86DataItemPtr item; + virCPUx86DataItem *item; virCPUx86DataIteratorInit(&iter, data2); while ((item = virCPUx86DataNext(&iter))) { @@ -554,8 +548,8 @@ x86DataSubtract(virCPUx86Data *data1, const virCPUx86Data *data2) { virCPUx86DataIterator iter; - virCPUx86DataItemPtr item1; - virCPUx86DataItemPtr item2; + virCPUx86DataItem *item1; + virCPUx86DataItem *item2; virCPUx86DataIteratorInit(&iter, data1); while ((item1 = virCPUx86DataNext(&iter))) { @@ -570,8 +564,8 @@ x86DataIntersect(virCPUx86Data *data1, const virCPUx86Data *data2) { virCPUx86DataIterator iter; - virCPUx86DataItemPtr item1; - virCPUx86DataItemPtr item2; + virCPUx86DataItem *item1; + virCPUx86DataItem *item2; virCPUx86DataIteratorInit(&iter, data1); while ((item1 = virCPUx86DataNext(&iter))) { @@ -615,15 +609,15 @@ x86DataIsSubset(const virCPUx86Data *data, /* also removes all detected features from data */ static int -x86DataToCPUFeatures(virCPUDefPtr cpu, +x86DataToCPUFeatures(virCPUDef *cpu, int policy, virCPUx86Data *data, - virCPUx86MapPtr map) + virCPUx86Map *map) { size_t i; for (i = 0; i < map->nfeatures; i++) { - virCPUx86FeaturePtr feature = map->features[i]; + virCPUx86Feature *feature = map->features[i]; if (x86DataIsSubset(data, &feature->data)) { x86DataSubtract(data, &feature->data); if (virCPUDefAddFeature(cpu, feature->name, policy) < 0) @@ -636,15 +630,15 @@ x86DataToCPUFeatures(virCPUDefPtr cpu, /* also removes bits corresponding to vendor string from data */ -static virCPUx86VendorPtr +static virCPUx86Vendor * x86DataToVendor(const virCPUx86Data *data, - virCPUx86MapPtr map) + virCPUx86Map *map) { - virCPUx86DataItemPtr item; + virCPUx86DataItem *item; size_t i; for (i = 0; i < map->nvendors; i++) { - virCPUx86VendorPtr vendor = map->vendors[i]; + virCPUx86Vendor *vendor = map->vendors[i]; if ((item = virCPUx86DataGet(data, &vendor->data)) && virCPUx86DataItemMatchMasked(item, &vendor->data)) { virCPUx86DataItemClearBits(item, &vendor->data); @@ -658,9 +652,9 @@ x86DataToVendor(const virCPUx86Data *data, static int virCPUx86VendorToData(const char *vendor, - virCPUx86DataItemPtr item) + virCPUx86DataItem *item) { - virCPUx86CPUIDPtr cpuid; + virCPUx86CPUID *cpuid; if (strlen(vendor) != VENDOR_STRING_LENGTH) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -766,7 +760,7 @@ x86DataToSignatureFull(const virCPUx86Data *data, unsigned int *stepping) { virCPUx86DataItem leaf1 = CPUID(.eax_in = 0x1); - virCPUx86DataItemPtr item; + virCPUx86DataItem *item; *family = *model = *stepping = 0; @@ -785,7 +779,7 @@ static uint32_t x86DataToSignature(const virCPUx86Data *data) { virCPUx86DataItem leaf1 = CPUID(.eax_in = 0x1); - virCPUx86DataItemPtr item; + virCPUx86DataItem *item; if (!(item = virCPUx86DataGet(data, &leaf1))) return 0; @@ -810,8 +804,8 @@ x86DataAddSignature(virCPUx86Data *data, * listed in the CPU definition. */ static int -virCPUx86DisableRemovedFeatures(virCPUDefPtr cpu, - virCPUx86ModelPtr model) +virCPUx86DisableRemovedFeatures(virCPUDef *cpu, + virCPUx86Model *model) { char **feat = model->removedFeatures; @@ -829,17 +823,17 @@ virCPUx86DisableRemovedFeatures(virCPUDefPtr cpu, } -static virCPUDefPtr +static virCPUDef * x86DataToCPU(const virCPUx86Data *data, - virCPUx86ModelPtr model, - virCPUx86MapPtr map, - virDomainCapsCPUModelPtr hvModel, + virCPUx86Model *model, + virCPUx86Map *map, + virDomainCapsCPUModel *hvModel, virCPUType cpuType) { g_autoptr(virCPUDef) cpu = NULL; g_auto(virCPUx86Data) copy = VIR_CPU_X86_DATA_INIT; g_auto(virCPUx86Data) modelData = VIR_CPU_X86_DATA_INIT; - virCPUx86VendorPtr vendor; + virCPUx86Vendor *vendor; cpu = virCPUDefNew(); @@ -860,7 +854,7 @@ x86DataToCPU(const virCPUx86Data *data, */ if (hvModel && hvModel->blockers) { char **blocker; - virCPUx86FeaturePtr feature; + virCPUx86Feature *feature; for (blocker = hvModel->blockers; *blocker; blocker++) { if ((feature = x86FeatureFind(map, *blocker)) && @@ -889,7 +883,7 @@ x86DataToCPU(const virCPUx86Data *data, static void -x86VendorFree(virCPUx86VendorPtr vendor) +x86VendorFree(virCPUx86Vendor *vendor) { if (!vendor) return; @@ -900,8 +894,8 @@ x86VendorFree(virCPUx86VendorPtr vendor) G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Vendor, x86VendorFree); -static virCPUx86VendorPtr -x86VendorFind(virCPUx86MapPtr map, +static virCPUx86Vendor * +x86VendorFind(virCPUx86Map *map, const char *name) { size_t i; @@ -920,7 +914,7 @@ x86VendorParse(xmlXPathContextPtr ctxt, const char *name, void *data) { - virCPUx86MapPtr map = data; + virCPUx86Map *map = data; g_autoptr(virCPUx86Vendor) vendor = NULL; g_autofree char *string = NULL; @@ -952,7 +946,7 @@ x86VendorParse(xmlXPathContextPtr ctxt, static void -x86FeatureFree(virCPUx86FeaturePtr feature) +x86FeatureFree(virCPUx86Feature *feature) { if (!feature) return; @@ -967,9 +961,9 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Feature, x86FeatureFree); static int x86FeatureInData(const char *name, const virCPUx86Data *data, - virCPUx86MapPtr map) + virCPUx86Map *map) { - virCPUx86FeaturePtr feature; + virCPUx86Feature *feature; if (!(feature = x86FeatureFind(map, name)) && !(feature = x86FeatureFindInternal(name))) { @@ -989,7 +983,7 @@ static bool x86FeatureIsMigratable(const char *name, void *cpu_map) { - virCPUx86MapPtr map = cpu_map; + virCPUx86Map *map = cpu_map; size_t i; for (i = 0; i < map->nblockers; i++) { @@ -1002,7 +996,7 @@ x86FeatureIsMigratable(const char *name, static char * -x86FeatureNames(virCPUx86MapPtr map, +x86FeatureNames(virCPUx86Map *map, const char *separator, virCPUx86Data *data) { @@ -1013,7 +1007,7 @@ x86FeatureNames(virCPUx86MapPtr map, virBufferAdd(&ret, "", 0); for (i = 0; i < map->nfeatures; i++) { - virCPUx86FeaturePtr feature = map->features[i]; + virCPUx86Feature *feature = map->features[i]; if (x86DataIsSubset(data, &feature->data)) { if (!first) virBufferAdd(&ret, separator, -1); @@ -1030,9 +1024,9 @@ x86FeatureNames(virCPUx86MapPtr map, static int x86ParseCPUID(xmlXPathContextPtr ctxt, - virCPUx86DataItemPtr item) + virCPUx86DataItem *item) { - virCPUx86CPUIDPtr cpuid; + virCPUx86CPUID *cpuid; unsigned long eax_in, ecx_in; unsigned long eax, ebx, ecx, edx; int ret_eax_in, ret_ecx_in, ret_eax, ret_ebx, ret_ecx, ret_edx; @@ -1066,9 +1060,9 @@ x86ParseCPUID(xmlXPathContextPtr ctxt, static int x86ParseMSR(xmlXPathContextPtr ctxt, - virCPUx86DataItemPtr item) + virCPUx86DataItem *item) { - virCPUx86MSRPtr msr; + virCPUx86MSR *msr; unsigned long index; unsigned long eax; unsigned long edx; @@ -1094,7 +1088,7 @@ x86FeatureParse(xmlXPathContextPtr ctxt, const char *name, void *data) { - virCPUx86MapPtr map = data; + virCPUx86Map *map = data; g_autofree xmlNodePtr *nodes = NULL; g_autoptr(virCPUx86Feature) feature = NULL; virCPUx86DataItem item; @@ -1162,10 +1156,10 @@ x86FeatureParse(xmlXPathContextPtr ctxt, } -static virCPUx86SignaturesPtr +static virCPUx86Signatures * virCPUx86SignaturesNew(size_t count) { - virCPUx86SignaturesPtr sigs; + virCPUx86Signatures *sigs; sigs = g_new0(virCPUx86Signatures, 1); sigs->items = g_new0(virCPUx86Signature, count); @@ -1176,7 +1170,7 @@ virCPUx86SignaturesNew(size_t count) static void -virCPUx86SignaturesFree(virCPUx86SignaturesPtr sigs) +virCPUx86SignaturesFree(virCPUx86Signatures *sigs) { size_t i; @@ -1191,10 +1185,10 @@ virCPUx86SignaturesFree(virCPUx86SignaturesPtr sigs) } -static virCPUx86SignaturesPtr -virCPUx86SignaturesCopy(virCPUx86SignaturesPtr src) +static virCPUx86Signatures * +virCPUx86SignaturesCopy(virCPUx86Signatures *src) { - virCPUx86SignaturesPtr dst; + virCPUx86Signatures *dst; size_t i; if (!src || src->count == 0) @@ -1214,7 +1208,7 @@ virCPUx86SignaturesCopy(virCPUx86SignaturesPtr src) static bool -virCPUx86SignaturesMatch(virCPUx86SignaturesPtr sigs, +virCPUx86SignaturesMatch(virCPUx86Signatures *sigs, uint32_t signature) { size_t i; @@ -1240,7 +1234,7 @@ virCPUx86SignaturesMatch(virCPUx86SignaturesPtr sigs, static char * -virCPUx86SignaturesFormat(virCPUx86SignaturesPtr sigs) +virCPUx86SignaturesFormat(virCPUx86Signatures *sigs) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t i; @@ -1267,7 +1261,7 @@ virCPUx86SignaturesFormat(virCPUx86SignaturesPtr sigs) static void -x86ModelFree(virCPUx86ModelPtr model) +x86ModelFree(virCPUx86Model *model) { if (!model) return; @@ -1281,10 +1275,10 @@ x86ModelFree(virCPUx86ModelPtr model) G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Model, x86ModelFree); -static virCPUx86ModelPtr -x86ModelCopy(virCPUx86ModelPtr model) +static virCPUx86Model * +x86ModelCopy(virCPUx86Model *model) { - virCPUx86ModelPtr copy; + virCPUx86Model *copy; copy = g_new0(virCPUx86Model, 1); copy->name = g_strdup(model->name); @@ -1297,8 +1291,8 @@ x86ModelCopy(virCPUx86ModelPtr model) } -static virCPUx86ModelPtr -x86ModelFind(virCPUx86MapPtr map, +static virCPUx86Model * +x86ModelFind(virCPUx86Map *map, const char *name) { size_t i; @@ -1321,9 +1315,9 @@ x86ModelFind(virCPUx86MapPtr map, * + required and forced features * - disabled and forbidden features */ -static virCPUx86ModelPtr +static virCPUx86Model * x86ModelFromCPU(const virCPUDef *cpu, - virCPUx86MapPtr map, + virCPUx86Map *map, int policy) { g_autoptr(virCPUx86Model) model = NULL; @@ -1351,7 +1345,7 @@ x86ModelFromCPU(const virCPUDef *cpu, } for (i = 0; i < cpu->nfeatures; i++) { - virCPUx86FeaturePtr feature; + virCPUx86Feature *feature; virCPUFeaturePolicy fpol; if (cpu->features[i].policy == -1) @@ -1397,14 +1391,14 @@ x86ModelFromCPU(const virCPUDef *cpu, static virCPUx86CompareResult -x86ModelCompare(virCPUx86ModelPtr model1, - virCPUx86ModelPtr model2) +x86ModelCompare(virCPUx86Model *model1, + virCPUx86Model *model2) { virCPUx86CompareResult result = EQUAL; virCPUx86DataIterator iter1; virCPUx86DataIterator iter2; - virCPUx86DataItemPtr item1; - virCPUx86DataItemPtr item2; + virCPUx86DataItem *item1; + virCPUx86DataItem *item2; virCPUx86DataIteratorInit(&iter1, &model1->data); virCPUx86DataIteratorInit(&iter2, &model2->data); @@ -1445,7 +1439,7 @@ x86ModelCompare(virCPUx86ModelPtr model1, static int -x86ModelParseDecode(virCPUx86ModelPtr model, +x86ModelParseDecode(virCPUx86Model *model, xmlXPathContextPtr ctxt) { g_autofree char *host = NULL; @@ -1483,12 +1477,12 @@ x86ModelParseDecode(virCPUx86ModelPtr model, static int -x86ModelParseAncestor(virCPUx86ModelPtr model, +x86ModelParseAncestor(virCPUx86Model *model, xmlXPathContextPtr ctxt, - virCPUx86MapPtr map) + virCPUx86Map *map) { g_autofree char *name = NULL; - virCPUx86ModelPtr ancestor; + virCPUx86Model *ancestor; int rc; if ((rc = virXPathBoolean("boolean(./model)", ctxt)) <= 0) @@ -1518,7 +1512,7 @@ x86ModelParseAncestor(virCPUx86ModelPtr model, static int -x86ModelParseSignatures(virCPUx86ModelPtr model, +x86ModelParseSignatures(virCPUx86Model *model, xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodes = NULL; @@ -1568,9 +1562,9 @@ x86ModelParseSignatures(virCPUx86ModelPtr model, static int -x86ModelParseVendor(virCPUx86ModelPtr model, +x86ModelParseVendor(virCPUx86Model *model, xmlXPathContextPtr ctxt, - virCPUx86MapPtr map) + virCPUx86Map *map) { g_autofree char *vendor = NULL; int rc; @@ -1598,9 +1592,9 @@ x86ModelParseVendor(virCPUx86ModelPtr model, static int -x86ModelParseFeatures(virCPUx86ModelPtr model, +x86ModelParseFeatures(virCPUx86Model *model, xmlXPathContextPtr ctxt, - virCPUx86MapPtr map) + virCPUx86Map *map) { g_autofree xmlNodePtr *nodes = NULL; size_t i; @@ -1615,7 +1609,7 @@ x86ModelParseFeatures(virCPUx86ModelPtr model, for (i = 0; i < n; i++) { g_autofree char *ftname = NULL; g_autofree char *removed = NULL; - virCPUx86FeaturePtr feature; + virCPUx86Feature *feature; if (!(ftname = virXMLPropString(nodes[i], "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -1663,7 +1657,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, const char *name, void *data) { - virCPUx86MapPtr map = data; + virCPUx86Map *map = data; g_autoptr(virCPUx86Model) model = NULL; if (x86ModelFind(map, name)) { @@ -1698,7 +1692,7 @@ x86ModelParse(xmlXPathContextPtr ctxt, static void -x86MapFree(virCPUx86MapPtr map) +x86MapFree(virCPUx86Map *map) { size_t i; @@ -1727,7 +1721,7 @@ x86MapFree(virCPUx86MapPtr map) G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCPUx86Map, x86MapFree); -static virCPUx86MapPtr +static virCPUx86Map * virCPUx86LoadMap(void) { g_autoptr(virCPUx86Map) map = NULL; @@ -1751,7 +1745,7 @@ virCPUx86DriverOnceInit(void) } -static virCPUx86MapPtr +static virCPUx86Map * virCPUx86GetMap(void) { if (virCPUx86DriverInitialize() < 0) @@ -1765,15 +1759,15 @@ static char * virCPUx86DataFormat(const virCPUData *data) { virCPUx86DataIterator iter; - virCPUx86DataItemPtr item; + virCPUx86DataItem *item; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; virCPUx86DataIteratorInit(&iter, &data->data.x86); virBufferAddLit(&buf, "\n"); while ((item = virCPUx86DataNext(&iter))) { - virCPUx86CPUIDPtr cpuid; - virCPUx86MSRPtr msr; + virCPUx86CPUID *cpuid; + virCPUx86MSR *msr; switch (item->type) { case VIR_CPU_X86_DATA_CPUID: @@ -1804,7 +1798,7 @@ virCPUx86DataFormat(const virCPUData *data) } -static virCPUDataPtr +static virCPUData * virCPUx86DataParse(xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodes = NULL; @@ -1864,12 +1858,12 @@ virCPUx86DataParse(xmlXPathContextPtr ctxt) static virCPUCompareResult -x86Compute(virCPUDefPtr host, - virCPUDefPtr cpu, - virCPUDataPtr *guest, +x86Compute(virCPUDef *host, + virCPUDef *cpu, + virCPUData **guest, char **message) { - virCPUx86MapPtr map = NULL; + virCPUx86Map *map = NULL; g_autoptr(virCPUx86Model) host_model = NULL; g_autoptr(virCPUx86Model) cpu_force = NULL; g_autoptr(virCPUx86Model) cpu_require = NULL; @@ -2009,8 +2003,8 @@ x86Compute(virCPUDefPtr host, static virCPUCompareResult -virCPUx86Compare(virCPUDefPtr host, - virCPUDefPtr cpu, +virCPUx86Compare(virCPUDef *host, + virCPUDef *cpu, bool failIncompatible) { virCPUCompareResult ret; @@ -2050,10 +2044,10 @@ virCPUx86Compare(virCPUDefPtr host, * 2 if candidate is the best one (search should stop now). */ static int -x86DecodeUseCandidate(virCPUx86ModelPtr current, - virCPUDefPtr cpuCurrent, - virCPUx86ModelPtr candidate, - virCPUDefPtr cpuCandidate, +x86DecodeUseCandidate(virCPUx86Model *current, + virCPUDef *cpuCurrent, + virCPUx86Model *candidate, + virCPUDef *cpuCandidate, uint32_t signature, const char *preferred) { @@ -2129,8 +2123,8 @@ x86DecodeUseCandidate(virCPUx86ModelPtr current, */ static void x86DataFilterTSX(virCPUx86Data *data, - virCPUx86VendorPtr vendor, - virCPUx86MapPtr map) + virCPUx86Vendor *vendor, + virCPUx86Map *map) { unsigned int family; unsigned int model; @@ -2146,7 +2140,7 @@ x86DataFilterTSX(virCPUx86Data *data, model == 60 || model == 69 || model == 70)) { - virCPUx86FeaturePtr feature; + virCPUx86Feature *feature; VIR_DEBUG("Dropping broken TSX"); @@ -2160,20 +2154,20 @@ x86DataFilterTSX(virCPUx86Data *data, static int -x86Decode(virCPUDefPtr cpu, +x86Decode(virCPUDef *cpu, const virCPUx86Data *cpuData, - virDomainCapsCPUModelsPtr models, + virDomainCapsCPUModels *models, const char *preferred, bool migratable) { - virCPUx86MapPtr map; - virCPUx86ModelPtr candidate; - virCPUDefPtr cpuCandidate; - virCPUx86ModelPtr model = NULL; + virCPUx86Map *map; + virCPUx86Model *candidate; + virCPUDef *cpuCandidate; + virCPUx86Model *model = NULL; g_autoptr(virCPUDef) cpuModel = NULL; g_auto(virCPUx86Data) data = VIR_CPU_X86_DATA_INIT; - virCPUx86VendorPtr vendor; - virDomainCapsCPUModelPtr hvModel = NULL; + virCPUx86Vendor *vendor; + virDomainCapsCPUModel *hvModel = NULL; g_autofree char *sigs = NULL; uint32_t signature; unsigned int sigFamily; @@ -2290,9 +2284,9 @@ x86Decode(virCPUDefPtr cpu, } static int -x86DecodeCPUData(virCPUDefPtr cpu, +x86DecodeCPUData(virCPUDef *cpu, const virCPUData *data, - virDomainCapsCPUModelsPtr models) + virDomainCapsCPUModels *models) { return x86Decode(cpu, &data->data.x86, models, NULL, false); } @@ -2301,7 +2295,7 @@ x86DecodeCPUData(virCPUDefPtr cpu, static int x86EncodePolicy(virCPUx86Data *data, const virCPUDef *cpu, - virCPUx86MapPtr map, + virCPUx86Map *map, virCPUFeaturePolicy policy) { g_autoptr(virCPUx86Model) model = NULL; @@ -2320,14 +2314,14 @@ x86EncodePolicy(virCPUx86Data *data, static int x86Encode(virArch arch, const virCPUDef *cpu, - virCPUDataPtr *forced, - virCPUDataPtr *required, - virCPUDataPtr *optional, - virCPUDataPtr *disabled, - virCPUDataPtr *forbidden, - virCPUDataPtr *vendor) + virCPUData **forced, + virCPUData **required, + virCPUData **optional, + virCPUData **disabled, + virCPUData **forbidden, + virCPUData **vendor) { - virCPUx86MapPtr map = NULL; + virCPUx86Map *map = NULL; g_autoptr(virCPUData) data_forced = NULL; g_autoptr(virCPUData) data_required = NULL; g_autoptr(virCPUData) data_optional = NULL; @@ -2382,7 +2376,7 @@ x86Encode(virArch arch, return -1; if (vendor) { - virCPUx86VendorPtr v = NULL; + virCPUx86Vendor *v = NULL; if (cpu->vendor && !(v = x86VendorFind(map, cpu->vendor))) { virReportError(VIR_ERR_OPERATION_FAILED, @@ -2418,7 +2412,7 @@ static int virCPUx86CheckFeature(const virCPUDef *cpu, const char *name) { - virCPUx86MapPtr map; + virCPUx86Map *map; g_autoptr(virCPUx86Model) model = NULL; if (!(map = virCPUx86GetMap())) @@ -2435,7 +2429,7 @@ static int virCPUx86DataCheckFeature(const virCPUData *data, const char *name) { - virCPUx86MapPtr map; + virCPUx86Map *map; if (!(map = virCPUx86GetMap())) return -1; @@ -2484,11 +2478,11 @@ cpuidCall(virCPUx86CPUID *cpuid) * Sub leaf n+1 is invalid if eax[4:0] in sub leaf n equals 0. */ static int -cpuidSetLeaf4(virCPUDataPtr data, - virCPUx86DataItemPtr subLeaf0) +cpuidSetLeaf4(virCPUData *data, + virCPUx86DataItem *subLeaf0) { virCPUx86DataItem item = *subLeaf0; - virCPUx86CPUIDPtr cpuid = &item.data.cpuid; + virCPUx86CPUID *cpuid = &item.data.cpuid; if (virCPUx86DataAdd(data, subLeaf0) < 0) return -1; @@ -2508,11 +2502,11 @@ cpuidSetLeaf4(virCPUDataPtr data, * Sub leaf n is invalid if n > eax in sub leaf 0. */ static int -cpuidSetLeaf7(virCPUDataPtr data, - virCPUx86DataItemPtr subLeaf0) +cpuidSetLeaf7(virCPUData *data, + virCPUx86DataItem *subLeaf0) { virCPUx86DataItem item = CPUID(.eax_in = 0x7); - virCPUx86CPUIDPtr cpuid = &item.data.cpuid; + virCPUx86CPUID *cpuid = &item.data.cpuid; uint32_t sub; if (virCPUx86DataAdd(data, subLeaf0) < 0) @@ -2536,11 +2530,11 @@ cpuidSetLeaf7(virCPUDataPtr data, * meaningful data even if it was (theoretically) considered invalid. */ static int -cpuidSetLeafB(virCPUDataPtr data, - virCPUx86DataItemPtr subLeaf0) +cpuidSetLeafB(virCPUData *data, + virCPUx86DataItem *subLeaf0) { virCPUx86DataItem item = *subLeaf0; - virCPUx86CPUIDPtr cpuid = &item.data.cpuid; + virCPUx86CPUID *cpuid = &item.data.cpuid; while (cpuid->ecx & 0xff00) { if (virCPUx86DataAdd(data, &item) < 0) @@ -2561,11 +2555,11 @@ cpuidSetLeafB(virCPUDataPtr data, * and edx[n-32] from sub leaf 1 is not set. */ static int -cpuidSetLeafD(virCPUDataPtr data, - virCPUx86DataItemPtr subLeaf0) +cpuidSetLeafD(virCPUData *data, + virCPUx86DataItem *subLeaf0) { virCPUx86DataItem item = CPUID(.eax_in = 0xd); - virCPUx86CPUIDPtr cpuid = &item.data.cpuid; + virCPUx86CPUID *cpuid = &item.data.cpuid; virCPUx86CPUID sub0; virCPUx86CPUID sub1; uint32_t sub; @@ -2609,12 +2603,12 @@ cpuidSetLeafD(virCPUDataPtr data, * 0x10: Sub leaf n is valid if ebx[n] (= res[ResID]) from sub leaf 0 is set. */ static int -cpuidSetLeafResID(virCPUDataPtr data, - virCPUx86DataItemPtr subLeaf0, +cpuidSetLeafResID(virCPUData *data, + virCPUx86DataItem *subLeaf0, uint32_t res) { virCPUx86DataItem item = CPUID(.eax_in = subLeaf0->data.cpuid.eax_in); - virCPUx86CPUIDPtr cpuid = &item.data.cpuid; + virCPUx86CPUID *cpuid = &item.data.cpuid; uint32_t sub; if (virCPUx86DataAdd(data, subLeaf0) < 0) @@ -2638,12 +2632,12 @@ cpuidSetLeafResID(virCPUDataPtr data, * Sub leaves n >= 2 are valid as long as eax[3:0] != 0. */ static int -cpuidSetLeaf12(virCPUDataPtr data, - virCPUx86DataItemPtr subLeaf0) +cpuidSetLeaf12(virCPUData *data, + virCPUx86DataItem *subLeaf0) { virCPUx86DataItem item = CPUID(.eax_in = 0x7); - virCPUx86CPUIDPtr cpuid = &item.data.cpuid; - virCPUx86DataItemPtr leaf7; + virCPUx86CPUID *cpuid = &item.data.cpuid; + virCPUx86DataItem *leaf7; if (!(leaf7 = virCPUx86DataGet(&data->data.x86, &item)) || !(leaf7->data.cpuid.ebx & (1 << 2))) @@ -2675,11 +2669,11 @@ cpuidSetLeaf12(virCPUDataPtr data, * Sub leaf 0 reports the maximum supported sub leaf in eax. */ static int -cpuidSetLeaf14(virCPUDataPtr data, - virCPUx86DataItemPtr subLeaf0) +cpuidSetLeaf14(virCPUData *data, + virCPUx86DataItem *subLeaf0) { virCPUx86DataItem item = CPUID(.eax_in = 0x14); - virCPUx86CPUIDPtr cpuid = &item.data.cpuid; + virCPUx86CPUID *cpuid = &item.data.cpuid; uint32_t sub; if (virCPUx86DataAdd(data, subLeaf0) < 0) @@ -2701,11 +2695,11 @@ cpuidSetLeaf14(virCPUDataPtr data, * Sub leaf 0 reports the maximum supported sub leaf in eax. */ static int -cpuidSetLeaf17(virCPUDataPtr data, - virCPUx86DataItemPtr subLeaf0) +cpuidSetLeaf17(virCPUData *data, + virCPUx86DataItem *subLeaf0) { virCPUx86DataItem item = CPUID(.eax_in = 0x17); - virCPUx86CPUIDPtr cpuid = &item.data.cpuid; + virCPUx86CPUID *cpuid = &item.data.cpuid; uint32_t sub; if (subLeaf0->data.cpuid.eax < 3) @@ -2725,13 +2719,13 @@ cpuidSetLeaf17(virCPUDataPtr data, static int -cpuidSet(uint32_t base, virCPUDataPtr data) +cpuidSet(uint32_t base, virCPUData *data) { int rc; uint32_t max; uint32_t leaf; virCPUx86DataItem item = CPUID(.eax_in = base); - virCPUx86CPUIDPtr cpuid = &item.data.cpuid; + virCPUx86CPUID *cpuid = &item.data.cpuid; cpuidCall(cpuid); max = cpuid->eax; @@ -2774,8 +2768,8 @@ cpuidSet(uint32_t base, virCPUDataPtr data) static int -virCPUx86GetHost(virCPUDefPtr cpu, - virDomainCapsCPUModelsPtr models) +virCPUx86GetHost(virCPUDef *cpu, + virDomainCapsCPUModels *models) { g_autoptr(virCPUData) cpuData = NULL; int ret; @@ -2829,18 +2823,18 @@ virCPUx86GetHost(virCPUDefPtr cpu, #endif -static virCPUDefPtr -virCPUx86Baseline(virCPUDefPtr *cpus, +static virCPUDef * +virCPUx86Baseline(virCPUDef **cpus, unsigned int ncpus, - virDomainCapsCPUModelsPtr models, + virDomainCapsCPUModels *models, const char **features, bool migratable) { - virCPUx86MapPtr map = NULL; + virCPUx86Map *map = NULL; g_autoptr(virCPUx86Model) base_model = NULL; g_autoptr(virCPUDef) cpu = NULL; size_t i; - virCPUx86VendorPtr vendor = NULL; + virCPUx86Vendor *vendor = NULL; bool outputVendor = true; const char *modelName; bool matchingNames = true; @@ -2916,7 +2910,7 @@ virCPUx86Baseline(virCPUDefPtr *cpus, } if (features) { - virCPUx86FeaturePtr feat; + virCPUx86Feature *feat; if (!(featData = virCPUDataNew(archs[0]))) return NULL; @@ -2954,7 +2948,7 @@ virCPUx86Baseline(virCPUDefPtr *cpus, static int -x86UpdateHostModel(virCPUDefPtr guest, +x86UpdateHostModel(virCPUDef *guest, const virCPUDef *host) { g_autoptr(virCPUDef) updated = NULL; @@ -2990,13 +2984,13 @@ x86UpdateHostModel(virCPUDefPtr guest, static int -virCPUx86Update(virCPUDefPtr guest, +virCPUx86Update(virCPUDef *guest, const virCPUDef *host, bool relative) { g_autoptr(virCPUx86Model) model = NULL; - virCPUx86ModelPtr guestModel; - virCPUx86MapPtr map; + virCPUx86Model *guestModel; + virCPUx86Map *map; size_t i; if (!(map = virCPUx86GetMap())) @@ -3046,13 +3040,13 @@ virCPUx86Update(virCPUDefPtr guest, static int -virCPUx86UpdateLive(virCPUDefPtr cpu, - virCPUDataPtr dataEnabled, - virCPUDataPtr dataDisabled) +virCPUx86UpdateLive(virCPUDef *cpu, + virCPUData *dataEnabled, + virCPUData *dataDisabled) { bool hostPassthrough = (cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH || cpu->mode == VIR_CPU_MODE_MAXIMUM); - virCPUx86MapPtr map; + virCPUx86Map *map; g_autoptr(virCPUx86Model) model = NULL; g_autoptr(virCPUx86Model) modelDisabled = NULL; g_auto(virCPUx86Data) enabled = VIR_CPU_X86_DATA_INIT; @@ -3080,7 +3074,7 @@ virCPUx86UpdateLive(virCPUDefPtr cpu, x86DataCopy(&disabled, &dataDisabled->data.x86); for (i = 0; i < map->nfeatures; i++) { - virCPUx86FeaturePtr feature = map->features[i]; + virCPUx86Feature *feature = map->features[i]; virCPUFeaturePolicy expected = VIR_CPU_FEATURE_LAST; if (x86DataIsSubset(&model->data, &feature->data)) @@ -3153,7 +3147,7 @@ virCPUx86UpdateLive(virCPUDefPtr cpu, static int virCPUx86GetModels(char ***models) { - virCPUx86MapPtr map; + virCPUx86Map *map; size_t i; if (!(map = virCPUx86GetMap())) @@ -3171,11 +3165,11 @@ virCPUx86GetModels(char ***models) static int -virCPUx86Translate(virCPUDefPtr cpu, - virDomainCapsCPUModelsPtr models) +virCPUx86Translate(virCPUDef *cpu, + virDomainCapsCPUModels *models) { g_autoptr(virCPUDef) translated = NULL; - virCPUx86MapPtr map; + virCPUx86Map *map; g_autoptr(virCPUx86Model) model = NULL; size_t i; @@ -3203,7 +3197,7 @@ virCPUx86Translate(virCPUDefPtr cpu, return -1; for (i = 0; i < cpu->nfeatures; i++) { - virCPUFeatureDefPtr f = cpu->features + i; + virCPUFeatureDef *f = cpu->features + i; if (virCPUDefUpdateFeature(translated, f->name, f->policy) < 0) return -1; } @@ -3214,9 +3208,9 @@ virCPUx86Translate(virCPUDefPtr cpu, static int -virCPUx86ExpandFeatures(virCPUDefPtr cpu) +virCPUx86ExpandFeatures(virCPUDef *cpu) { - virCPUx86MapPtr map; + virCPUx86Map *map; g_autoptr(virCPUDef) expanded = NULL; g_autoptr(virCPUx86Model) model = NULL; bool host = cpu->type == VIR_CPU_TYPE_HOST; @@ -3243,7 +3237,7 @@ virCPUx86ExpandFeatures(virCPUDefPtr cpu) return -1; for (i = 0; i < cpu->nfeatures; i++) { - virCPUFeatureDefPtr f = cpu->features + i; + virCPUFeatureDef *f = cpu->features + i; if (!host && f->policy != VIR_CPU_FEATURE_REQUIRE && @@ -3274,11 +3268,11 @@ x86FeatureFilterMigratable(const char *name, } -static virCPUDefPtr -virCPUx86CopyMigratable(virCPUDefPtr cpu) +static virCPUDef * +virCPUx86CopyMigratable(virCPUDef *cpu) { g_autoptr(virCPUDef) copy = NULL; - virCPUx86MapPtr map; + virCPUx86Map *map; if (!(map = virCPUx86GetMap())) return NULL; @@ -3295,9 +3289,9 @@ virCPUx86CopyMigratable(virCPUDefPtr cpu) static int -virCPUx86ValidateFeatures(virCPUDefPtr cpu) +virCPUx86ValidateFeatures(virCPUDef *cpu) { - virCPUx86MapPtr map; + virCPUx86Map *map; size_t i; if (!(map = virCPUx86GetMap())) @@ -3317,7 +3311,7 @@ virCPUx86ValidateFeatures(virCPUDefPtr cpu) int -virCPUx86DataAdd(virCPUDataPtr cpuData, +virCPUx86DataAdd(virCPUData *cpuData, const virCPUx86DataItem *item) { return virCPUx86DataAddItem(&cpuData->data.x86, item); @@ -3325,7 +3319,7 @@ virCPUx86DataAdd(virCPUDataPtr cpuData, int -virCPUx86DataSetSignature(virCPUDataPtr cpuData, +virCPUx86DataSetSignature(virCPUData *cpuData, unsigned int family, unsigned int model, unsigned int stepping) @@ -3337,7 +3331,7 @@ virCPUx86DataSetSignature(virCPUDataPtr cpuData, uint32_t -virCPUx86DataGetSignature(virCPUDataPtr cpuData, +virCPUx86DataGetSignature(virCPUData *cpuData, unsigned int *family, unsigned int *model, unsigned int *stepping) @@ -3349,7 +3343,7 @@ virCPUx86DataGetSignature(virCPUDataPtr cpuData, int -virCPUx86DataSetVendor(virCPUDataPtr cpuData, +virCPUx86DataSetVendor(virCPUData *cpuData, const char *vendor) { virCPUx86DataItem item = CPUID(0); @@ -3362,11 +3356,11 @@ virCPUx86DataSetVendor(virCPUDataPtr cpuData, static int -virCPUx86DataAddFeature(virCPUDataPtr cpuData, +virCPUx86DataAddFeature(virCPUData *cpuData, const char *name) { - virCPUx86FeaturePtr feature; - virCPUx86MapPtr map; + virCPUx86Feature *feature; + virCPUx86Map *map; if (!(map = virCPUx86GetMap())) return -1; @@ -3386,10 +3380,10 @@ virCPUx86DataAddFeature(virCPUDataPtr cpuData, static bool virCPUx86FeatureIsMSR(const char *name) { - virCPUx86FeaturePtr feature; + virCPUx86Feature *feature; virCPUx86DataIterator iter; - virCPUx86DataItemPtr item; - virCPUx86MapPtr map; + virCPUx86DataItem *item; + virCPUx86Map *map; if (!(map = virCPUx86GetMap())) return false; diff --git a/src/cpu/cpu_x86.h b/src/cpu/cpu_x86.h index 3b1aabe98d..416d052776 100644 --- a/src/cpu/cpu_x86.h +++ b/src/cpu/cpu_x86.h @@ -25,20 +25,20 @@ extern struct cpuArchDriver cpuDriverX86; -int virCPUx86DataAdd(virCPUDataPtr cpuData, +int virCPUx86DataAdd(virCPUData *cpuData, const virCPUx86DataItem *cpuid); -int virCPUx86DataSetSignature(virCPUDataPtr cpuData, +int virCPUx86DataSetSignature(virCPUData *cpuData, unsigned int family, unsigned int model, unsigned int stepping); -uint32_t virCPUx86DataGetSignature(virCPUDataPtr cpuData, +uint32_t virCPUx86DataGetSignature(virCPUData *cpuData, unsigned int *family, unsigned int *model, unsigned int *stepping); -int virCPUx86DataSetVendor(virCPUDataPtr cpuData, +int virCPUx86DataSetVendor(virCPUData *cpuData, const char *vendor); bool virCPUx86FeatureFilterSelectMSR(const char *name, diff --git a/src/cpu/cpu_x86_data.h b/src/cpu/cpu_x86_data.h index cebf3b6669..9a4333bf2b 100644 --- a/src/cpu/cpu_x86_data.h +++ b/src/cpu/cpu_x86_data.h @@ -21,7 +21,6 @@ #pragma once typedef struct _virCPUx86CPUID virCPUx86CPUID; -typedef virCPUx86CPUID *virCPUx86CPUIDPtr; struct _virCPUx86CPUID { uint32_t eax_in; uint32_t ecx_in; @@ -32,7 +31,6 @@ struct _virCPUx86CPUID { }; typedef struct _virCPUx86MSR virCPUx86MSR; -typedef virCPUx86MSR *virCPUx86MSRPtr; struct _virCPUx86MSR { uint32_t index; uint32_t eax; @@ -76,7 +74,6 @@ typedef enum { } virCPUx86DataType; typedef struct _virCPUx86DataItem virCPUx86DataItem; -typedef virCPUx86DataItem *virCPUx86DataItemPtr; struct _virCPUx86DataItem { virCPUx86DataType type; union { diff --git a/src/datatypes.c b/src/datatypes.c index e36f3a2d24..ad82703559 100644 --- a/src/datatypes.c +++ b/src/datatypes.c @@ -33,21 +33,21 @@ VIR_LOG_INIT("datatypes"); -virClassPtr virConnectClass; -virClassPtr virConnectCloseCallbackDataClass; -virClassPtr virDomainClass; -virClassPtr virDomainCheckpointClass; -virClassPtr virDomainSnapshotClass; -virClassPtr virInterfaceClass; -virClassPtr virNetworkClass; -virClassPtr virNetworkPortClass; -virClassPtr virNodeDeviceClass; -virClassPtr virNWFilterClass; -virClassPtr virNWFilterBindingClass; -virClassPtr virSecretClass; -virClassPtr virStreamClass; -virClassPtr virStorageVolClass; -virClassPtr virStoragePoolClass; +virClass *virConnectClass; +virClass *virConnectCloseCallbackDataClass; +virClass *virDomainClass; +virClass *virDomainCheckpointClass; +virClass *virDomainSnapshotClass; +virClass *virInterfaceClass; +virClass *virNetworkClass; +virClass *virNetworkPortClass; +virClass *virNodeDeviceClass; +virClass *virNWFilterClass; +virClass *virNWFilterBindingClass; +virClass *virSecretClass; +virClass *virStreamClass; +virClass *virStorageVolClass; +virClass *virStoragePoolClass; static void virConnectDispose(void *obj); static void virConnectCloseCallbackDataDispose(void *obj); @@ -65,14 +65,14 @@ static void virStreamDispose(void *obj); static void virStorageVolDispose(void *obj); static void virStoragePoolDispose(void *obj); -virClassPtr virAdmConnectClass; -virClassPtr virAdmConnectCloseCallbackDataClass; +virClass *virAdmConnectClass; +virClass *virAdmConnectCloseCallbackDataClass; static void virAdmConnectDispose(void *obj); static void virAdmConnectCloseCallbackDataDispose(void *obj); -virClassPtr virAdmServerClass; -virClassPtr virAdmClientClass; +virClass *virAdmServerClass; +virClass *virAdmClientClass; static void virAdmServerDispose(void *obj); static void virAdmClientDispose(void *obj); @@ -180,7 +180,7 @@ virConnectDispose(void *obj) static void -virConnectCloseCallbackDataReset(virConnectCloseCallbackDataPtr closeData) +virConnectCloseCallbackDataReset(virConnectCloseCallbackData *closeData) { if (closeData->freeCallback) closeData->freeCallback(closeData->opaque); @@ -203,7 +203,7 @@ virConnectCloseCallbackDataDispose(void *obj) virConnectCloseCallbackDataReset(obj); } -virConnectCloseCallbackDataPtr +virConnectCloseCallbackData * virNewConnectCloseCallbackData(void) { if (virDataTypesInitialize() < 0) @@ -212,7 +212,7 @@ virNewConnectCloseCallbackData(void) return virObjectLockableNew(virConnectCloseCallbackDataClass); } -void virConnectCloseCallbackDataRegister(virConnectCloseCallbackDataPtr closeData, +void virConnectCloseCallbackDataRegister(virConnectCloseCallbackData *closeData, virConnectPtr conn, virConnectCloseFunc cb, void *opaque, @@ -236,7 +236,7 @@ void virConnectCloseCallbackDataRegister(virConnectCloseCallbackDataPtr closeDat virObjectUnlock(closeData); } -void virConnectCloseCallbackDataUnregister(virConnectCloseCallbackDataPtr closeData, +void virConnectCloseCallbackDataUnregister(virConnectCloseCallbackData *closeData, virConnectCloseFunc cb) { virObjectLock(closeData); @@ -255,7 +255,7 @@ void virConnectCloseCallbackDataUnregister(virConnectCloseCallbackDataPtr closeD virObjectUnlock(closeData); } -void virConnectCloseCallbackDataCall(virConnectCloseCallbackDataPtr closeData, +void virConnectCloseCallbackDataCall(virConnectCloseCallbackData *closeData, int reason) { virObjectLock(closeData); @@ -274,7 +274,7 @@ void virConnectCloseCallbackDataCall(virConnectCloseCallbackDataPtr closeData, } virConnectCloseFunc -virConnectCloseCallbackDataGetCallback(virConnectCloseCallbackDataPtr closeData) +virConnectCloseCallbackDataGetCallback(virConnectCloseCallbackData *closeData) { virConnectCloseFunc cb; @@ -1128,7 +1128,7 @@ virAdmConnectDispose(void *obj) static void virAdmConnectCloseCallbackDataDispose(void *obj) { - virAdmConnectCloseCallbackDataPtr cb_data = obj; + virAdmConnectCloseCallbackData *cb_data = obj; virObjectLock(cb_data); virAdmConnectCloseCallbackDataReset(cb_data); @@ -1136,7 +1136,7 @@ virAdmConnectCloseCallbackDataDispose(void *obj) } void -virAdmConnectCloseCallbackDataReset(virAdmConnectCloseCallbackDataPtr cbdata) +virAdmConnectCloseCallbackDataReset(virAdmConnectCloseCallbackData *cbdata) { if (cbdata->freeCallback) cbdata->freeCallback(cbdata->opaque); @@ -1149,7 +1149,7 @@ virAdmConnectCloseCallbackDataReset(virAdmConnectCloseCallbackDataPtr cbdata) } int -virAdmConnectCloseCallbackDataUnregister(virAdmConnectCloseCallbackDataPtr cbdata, +virAdmConnectCloseCallbackDataUnregister(virAdmConnectCloseCallbackData *cbdata, virAdmConnectCloseFunc cb) { int ret = -1; @@ -1169,7 +1169,7 @@ virAdmConnectCloseCallbackDataUnregister(virAdmConnectCloseCallbackDataPtr cbdat } int -virAdmConnectCloseCallbackDataRegister(virAdmConnectCloseCallbackDataPtr cbdata, +virAdmConnectCloseCallbackDataRegister(virAdmConnectCloseCallbackData *cbdata, virAdmConnectPtr conn, virAdmConnectCloseFunc cb, void *opaque, diff --git a/src/datatypes.h b/src/datatypes.h index 7a88aba0df..49cd9cd42c 100644 --- a/src/datatypes.h +++ b/src/datatypes.h @@ -28,24 +28,24 @@ #include "virobject.h" #include "viruuid.h" -extern virClassPtr virConnectClass; -extern virClassPtr virDomainClass; -extern virClassPtr virDomainCheckpointClass; -extern virClassPtr virDomainSnapshotClass; -extern virClassPtr virInterfaceClass; -extern virClassPtr virNetworkClass; -extern virClassPtr virNetworkPortClass; -extern virClassPtr virNodeDeviceClass; -extern virClassPtr virNWFilterClass; -extern virClassPtr virNWFilterBindingClass; -extern virClassPtr virSecretClass; -extern virClassPtr virStreamClass; -extern virClassPtr virStorageVolClass; -extern virClassPtr virStoragePoolClass; +extern virClass *virConnectClass; +extern virClass *virDomainClass; +extern virClass *virDomainCheckpointClass; +extern virClass *virDomainSnapshotClass; +extern virClass *virInterfaceClass; +extern virClass *virNetworkClass; +extern virClass *virNetworkPortClass; +extern virClass *virNodeDeviceClass; +extern virClass *virNWFilterClass; +extern virClass *virNWFilterBindingClass; +extern virClass *virSecretClass; +extern virClass *virStreamClass; +extern virClass *virStorageVolClass; +extern virClass *virStoragePoolClass; -extern virClassPtr virAdmConnectClass; -extern virClassPtr virAdmServerClass; -extern virClassPtr virAdmClientClass; +extern virClass *virAdmConnectClass; +extern virClass *virAdmServerClass; +extern virClass *virAdmClientClass; #define virCheckConnectReturn(obj, retval) \ do { \ @@ -480,9 +480,7 @@ extern virClassPtr virAdmClientClass; typedef struct _virConnectCloseCallbackData virConnectCloseCallbackData; -typedef virConnectCloseCallbackData *virConnectCloseCallbackDataPtr; typedef struct _virAdmConnectCloseCallbackData virAdmConnectCloseCallbackData; -typedef virAdmConnectCloseCallbackData *virAdmConnectCloseCallbackDataPtr; /** * Internal structures holding data related to connection close callbacks. @@ -519,16 +517,16 @@ struct _virConnect { * them. */ unsigned int flags; /* a set of connection flags */ - virURIPtr uri; /* connection URI */ + virURI *uri; /* connection URI */ /* The underlying hypervisor driver and network driver. */ - virHypervisorDriverPtr driver; - virNetworkDriverPtr networkDriver; - virInterfaceDriverPtr interfaceDriver; - virStorageDriverPtr storageDriver; - virNodeDeviceDriverPtr nodeDeviceDriver; - virSecretDriverPtr secretDriver; - virNWFilterDriverPtr nwfilterDriver; + virHypervisorDriver *driver; + virNetworkDriver *networkDriver; + virInterfaceDriver *interfaceDriver; + virStorageDriver *storageDriver; + virNodeDeviceDriver *nodeDeviceDriver; + virSecretDriver *secretDriver; + virNWFilterDriver *nwfilterDriver; /* Private data pointer which can be used by domain driver as * it pleases. @@ -558,13 +556,13 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virConnect, virObjectUnref); */ struct _virAdmConnect { virObjectLockable parent; - virURIPtr uri; + virURI *uri; void *privateData; virFreeCallback privateDataFreeFunc; /* Per-connection close callback */ - virAdmConnectCloseCallbackDataPtr closeCallback; + virAdmConnectCloseCallbackData *closeCallback; }; /** @@ -736,7 +734,7 @@ struct _virStream { virConnectPtr conn; unsigned int flags; - virStreamDriverPtr driver; + virStreamDriver *driver; void *privateData; virFreeCallback ff; }; @@ -853,23 +851,23 @@ bool virConnectWasDisposed(void); void virAdmConnectWatchDispose(void); bool virAdmConnectWasDisposed(void); -virConnectCloseCallbackDataPtr virNewConnectCloseCallbackData(void); -void virConnectCloseCallbackDataRegister(virConnectCloseCallbackDataPtr close, +virConnectCloseCallbackData *virNewConnectCloseCallbackData(void); +void virConnectCloseCallbackDataRegister(virConnectCloseCallbackData *close, virConnectPtr conn, virConnectCloseFunc cb, void *opaque, virFreeCallback freecb); -void virConnectCloseCallbackDataUnregister(virConnectCloseCallbackDataPtr close, +void virConnectCloseCallbackDataUnregister(virConnectCloseCallbackData *close, virConnectCloseFunc cb); -void virConnectCloseCallbackDataCall(virConnectCloseCallbackDataPtr close, +void virConnectCloseCallbackDataCall(virConnectCloseCallbackData *close, int reason); virConnectCloseFunc -virConnectCloseCallbackDataGetCallback(virConnectCloseCallbackDataPtr close); -void virAdmConnectCloseCallbackDataReset(virAdmConnectCloseCallbackDataPtr cbdata); -int virAdmConnectCloseCallbackDataRegister(virAdmConnectCloseCallbackDataPtr cbdata, +virConnectCloseCallbackDataGetCallback(virConnectCloseCallbackData *close); +void virAdmConnectCloseCallbackDataReset(virAdmConnectCloseCallbackData *cbdata); +int virAdmConnectCloseCallbackDataRegister(virAdmConnectCloseCallbackData *cbdata, virAdmConnectPtr conn, virAdmConnectCloseFunc cb, void *opaque, virFreeCallback freecb); -int virAdmConnectCloseCallbackDataUnregister(virAdmConnectCloseCallbackDataPtr cbdata, +int virAdmConnectCloseCallbackDataUnregister(virAdmConnectCloseCallbackData *cbdata, virAdmConnectCloseFunc cb); diff --git a/src/driver-hypervisor.h b/src/driver-hypervisor.h index 2ec7b8b24a..d642af8a37 100644 --- a/src/driver-hypervisor.h +++ b/src/driver-hypervisor.h @@ -30,7 +30,7 @@ typedef int typedef virDrvOpenStatus (*virDrvConnectOpen)(virConnectPtr conn, virConnectAuthPtr auth, - virConfPtr conf, + virConf *conf, unsigned int flags); typedef int @@ -1411,7 +1411,6 @@ typedef int unsigned int flags); typedef struct _virHypervisorDriver virHypervisorDriver; -typedef virHypervisorDriver *virHypervisorDriverPtr; /** * _virHypervisorDriver: diff --git a/src/driver-interface.h b/src/driver-interface.h index 117c93b66f..cc450f58a3 100644 --- a/src/driver-interface.h +++ b/src/driver-interface.h @@ -89,7 +89,6 @@ typedef int unsigned int flags); typedef struct _virInterfaceDriver virInterfaceDriver; -typedef virInterfaceDriver *virInterfaceDriverPtr; /** * _virInterfaceDriver: diff --git a/src/driver-network.h b/src/driver-network.h index 44cec35e91..040ef383b3 100644 --- a/src/driver-network.h +++ b/src/driver-network.h @@ -152,7 +152,6 @@ typedef int unsigned int flags); typedef struct _virNetworkDriver virNetworkDriver; -typedef virNetworkDriver *virNetworkDriverPtr; /** * _virNetworkDriver: diff --git a/src/driver-nodedev.h b/src/driver-nodedev.h index 75464943a5..dd56421a54 100644 --- a/src/driver-nodedev.h +++ b/src/driver-nodedev.h @@ -102,7 +102,6 @@ typedef int typedef struct _virNodeDeviceDriver virNodeDeviceDriver; -typedef virNodeDeviceDriver *virNodeDeviceDriverPtr; /** * _virNodeDeviceDriver: diff --git a/src/driver-nwfilter.h b/src/driver-nwfilter.h index 7e95622423..fd76e3af84 100644 --- a/src/driver-nwfilter.h +++ b/src/driver-nwfilter.h @@ -83,7 +83,6 @@ typedef int typedef struct _virNWFilterDriver virNWFilterDriver; -typedef virNWFilterDriver *virNWFilterDriverPtr; /** * _virNWFilterDriver: diff --git a/src/driver-secret.h b/src/driver-secret.h index 125238fe7b..eb6e82478c 100644 --- a/src/driver-secret.h +++ b/src/driver-secret.h @@ -89,7 +89,6 @@ typedef int int callbackID); typedef struct _virSecretDriver virSecretDriver; -typedef virSecretDriver *virSecretDriverPtr; /** * _virSecretDriver: diff --git a/src/driver-state.h b/src/driver-state.h index 767d8e898d..f3a0638e90 100644 --- a/src/driver-state.h +++ b/src/driver-state.h @@ -52,8 +52,6 @@ typedef int (*virDrvStateShutdownWait)(void); typedef struct _virStateDriver virStateDriver; -typedef virStateDriver *virStateDriverPtr; - struct _virStateDriver { const char *name; bool initialized; diff --git a/src/driver-storage.h b/src/driver-storage.h index e11d1b7895..b2cd7e6144 100644 --- a/src/driver-storage.h +++ b/src/driver-storage.h @@ -222,7 +222,6 @@ typedef int typedef struct _virStorageDriver virStorageDriver; -typedef virStorageDriver *virStorageDriverPtr; /** * _virStorageDriver: diff --git a/src/driver-stream.h b/src/driver-stream.h index a5b16c8c4e..ced05253fa 100644 --- a/src/driver-stream.h +++ b/src/driver-stream.h @@ -76,8 +76,6 @@ typedef int (*virDrvStreamAbort)(virStreamPtr st); typedef struct _virStreamDriver virStreamDriver; -typedef virStreamDriver *virStreamDriverPtr; - struct _virStreamDriver { virDrvStreamSend streamSend; virDrvStreamRecv streamRecv; diff --git a/src/driver.c b/src/driver.c index f0970d9bbc..f8022d2522 100644 --- a/src/driver.c +++ b/src/driver.c @@ -133,7 +133,7 @@ virConnectCacheOnceInit(void) VIR_ONCE_GLOBAL_INIT(virConnectCache); static virConnectPtr -virGetConnectGeneric(virThreadLocalPtr threadPtr, const char *name) +virGetConnectGeneric(virThreadLocal *threadPtr, const char *name) { virConnectPtr conn; diff --git a/src/driver.h b/src/driver.h index 2531ac3382..7f45231f24 100644 --- a/src/driver.h +++ b/src/driver.h @@ -72,8 +72,6 @@ typedef enum { #undef __VIR_DRIVER_H_INCLUDES___ typedef struct _virConnectDriver virConnectDriver; -typedef virConnectDriver *virConnectDriverPtr; - struct _virConnectDriver { /* Whether driver permits a server in the URI */ bool localOnly; @@ -87,25 +85,25 @@ struct _virConnectDriver { * - NULL list indicates wildcard supporting all schemes */ const char **uriSchemes; - virHypervisorDriverPtr hypervisorDriver; - virInterfaceDriverPtr interfaceDriver; - virNetworkDriverPtr networkDriver; - virNodeDeviceDriverPtr nodeDeviceDriver; - virNWFilterDriverPtr nwfilterDriver; - virSecretDriverPtr secretDriver; - virStorageDriverPtr storageDriver; + virHypervisorDriver *hypervisorDriver; + virInterfaceDriver *interfaceDriver; + virNetworkDriver *networkDriver; + virNodeDeviceDriver *nodeDeviceDriver; + virNWFilterDriver *nwfilterDriver; + virSecretDriver *secretDriver; + virStorageDriver *storageDriver; }; -int virRegisterConnectDriver(virConnectDriverPtr driver, +int virRegisterConnectDriver(virConnectDriver *driver, bool setSharedDrivers) G_GNUC_WARN_UNUSED_RESULT; -int virRegisterStateDriver(virStateDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; +int virRegisterStateDriver(virStateDriver *driver) G_GNUC_WARN_UNUSED_RESULT; -int virSetSharedInterfaceDriver(virInterfaceDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; -int virSetSharedNetworkDriver(virNetworkDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; -int virSetSharedNodeDeviceDriver(virNodeDeviceDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; -int virSetSharedNWFilterDriver(virNWFilterDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; -int virSetSharedSecretDriver(virSecretDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; -int virSetSharedStorageDriver(virStorageDriverPtr driver) G_GNUC_WARN_UNUSED_RESULT; +int virSetSharedInterfaceDriver(virInterfaceDriver *driver) G_GNUC_WARN_UNUSED_RESULT; +int virSetSharedNetworkDriver(virNetworkDriver *driver) G_GNUC_WARN_UNUSED_RESULT; +int virSetSharedNodeDeviceDriver(virNodeDeviceDriver *driver) G_GNUC_WARN_UNUSED_RESULT; +int virSetSharedNWFilterDriver(virNWFilterDriver *driver) G_GNUC_WARN_UNUSED_RESULT; +int virSetSharedSecretDriver(virSecretDriver *driver) G_GNUC_WARN_UNUSED_RESULT; +int virSetSharedStorageDriver(virStorageDriver *driver) G_GNUC_WARN_UNUSED_RESULT; bool virHasDriverForURIScheme(const char *scheme); diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index c82e9921d7..75eee49775 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -352,7 +352,7 @@ esxFormatVMXFileName(const char *fileName, void *opaque) static int -esxAutodetectSCSIControllerModel(virDomainDiskDefPtr def, int *model, +esxAutodetectSCSIControllerModel(virDomainDiskDef *def, int *model, void *opaque) { int result = -1; @@ -536,12 +536,12 @@ esxLookupHostSystemBiosUuid(esxPrivate *priv, unsigned char *uuid) } -static virCapsPtr +static virCaps * esxCapsInit(esxPrivate *priv) { esxVI_Boolean supportsLongMode = esxSupportsLongMode(priv); - virCapsPtr caps = NULL; - virCapsGuestPtr guest = NULL; + virCaps *caps = NULL; + virCapsGuest *guest = NULL; if (supportsLongMode == esxVI_Boolean_Undefined) return NULL; @@ -796,7 +796,7 @@ esxConnectToVCenter(esxPrivate *priv, */ static virDrvOpenStatus esxConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virDrvOpenStatus result = VIR_DRV_OPEN_ERROR; @@ -2544,7 +2544,7 @@ esxDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) g_autofree char *vmx = NULL; virVMXContext ctx; esxVMX_Data data; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; char *xml = NULL; virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS, NULL); @@ -2631,7 +2631,7 @@ esxConnectDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat, esxPrivate *priv = conn->privateData; virVMXContext ctx; esxVMX_Data data; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; char *xml = NULL; virCheckFlags(0, NULL); @@ -2676,7 +2676,7 @@ esxConnectDomainXMLToNative(virConnectPtr conn, const char *nativeFormat, int virtualHW_version; virVMXContext ctx; esxVMX_Data data; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; char *vmx = NULL; virCheckFlags(0, NULL); @@ -2875,10 +2875,10 @@ static virDomainPtr esxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags) { esxPrivate *priv = conn->privateData; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; g_autofree char *vmx = NULL; size_t i; - virDomainDiskDefPtr disk = NULL; + virDomainDiskDef *disk = NULL; esxVI_ObjectContent *virtualMachine = NULL; int virtualHW_version; virVMXContext ctx; @@ -3667,7 +3667,7 @@ esxDomainMigratePerform(virDomainPtr domain, { int result = -1; esxPrivate *priv = domain->conn->privateData; - virURIPtr parsedUri = NULL; + virURI *parsedUri = NULL; char *saveptr; char *path_resourcePool; char *path_hostSystem; diff --git a/src/esx/esx_interface_driver.c b/src/esx/esx_interface_driver.c index 7873dd223f..0c4f2022f5 100644 --- a/src/esx/esx_interface_driver.c +++ b/src/esx/esx_interface_driver.c @@ -165,10 +165,10 @@ esxInterfaceGetXMLDesc(virInterfacePtr iface, unsigned int flags) esxVI_PhysicalNic *physicalNic = NULL; virInterfaceDef def; bool hasAddress = false; - virInterfaceProtocolDefPtr protocols; + virInterfaceProtocolDef *protocols; virInterfaceProtocolDef protocol; virSocketAddr socketAddress; - virInterfaceIPDefPtr ips; + virInterfaceIPDef *ips; virInterfaceIPDef ip; virCheckFlags(VIR_INTERFACE_XML_INACTIVE, NULL); diff --git a/src/esx/esx_network_driver.c b/src/esx/esx_network_driver.c index 4d0fba8c9f..0a0a3dda89 100644 --- a/src/esx/esx_network_driver.c +++ b/src/esx/esx_network_driver.c @@ -212,7 +212,7 @@ esxNetworkLookupByName(virConnectPtr conn, const char *name) static int -esxBandwidthToShapingPolicy(virNetDevBandwidthPtr bandwidth, +esxBandwidthToShapingPolicy(virNetDevBandwidth *bandwidth, esxVI_HostNetworkTrafficShapingPolicy **shapingPolicy) { int result = -1; @@ -278,7 +278,7 @@ esxNetworkDefineXML(virConnectPtr conn, const char *xml) { virNetworkPtr network = NULL; esxPrivate *priv = conn->privateData; - virNetworkDefPtr def = NULL; + virNetworkDef *def = NULL; esxVI_HostVirtualSwitch *hostVirtualSwitch = NULL; esxVI_HostPortGroup *hostPortGroupList = NULL; esxVI_HostPortGroup *hostPortGroup = NULL; @@ -597,7 +597,7 @@ esxNetworkUndefine(virNetworkPtr network) static int esxShapingPolicyToBandwidth(esxVI_HostNetworkTrafficShapingPolicy *shapingPolicy, - virNetDevBandwidthPtr *bandwidth) + virNetDevBandwidth **bandwidth) { ESX_VI_CHECK_ARG_LIST(bandwidth); @@ -649,7 +649,7 @@ esxNetworkGetXMLDesc(virNetworkPtr network_, unsigned int flags) esxVI_String *networkNameList = NULL; esxVI_String *hostPortGroupKey = NULL; esxVI_String *networkName = NULL; - virNetworkDefPtr def; + virNetworkDef *def; if (esxVI_EnsureSession(priv->primary) < 0) return NULL; diff --git a/src/esx/esx_private.h b/src/esx/esx_private.h index 15edab4aa1..278a3f0142 100644 --- a/src/esx/esx_private.h +++ b/src/esx/esx_private.h @@ -32,8 +32,8 @@ typedef struct _esxPrivate { esxVI_Context *host; esxVI_Context *vCenter; esxUtil_ParsedUri *parsedUri; - virCapsPtr caps; - virDomainXMLOptionPtr xmlopt; + virCaps *caps; + virDomainXMLOption *xmlopt; int32_t maxVcpus; esxVI_Boolean supportsVMotion; esxVI_Boolean supportsLongMode; /* aka x86_64 */ diff --git a/src/esx/esx_storage_driver.c b/src/esx/esx_storage_driver.c index 8a34732b45..056b340a08 100644 --- a/src/esx/esx_storage_driver.c +++ b/src/esx/esx_storage_driver.c @@ -46,7 +46,7 @@ enum { LAST_BACKEND }; -static virStorageDriverPtr backends[] = { +static virStorageDriver *backends[] = { &esxStorageBackendVMFS, &esxStorageBackendISCSI }; @@ -204,7 +204,7 @@ static int esxStoragePoolRefresh(virStoragePoolPtr pool, unsigned int flags) { esxPrivate *priv = pool->conn->privateData; - virStorageDriverPtr backend = pool->privateData; + virStorageDriver *backend = pool->privateData; virCheckNonNullArgReturn(pool->privateData, -1); @@ -220,7 +220,7 @@ static int esxStoragePoolGetInfo(virStoragePoolPtr pool, virStoragePoolInfoPtr info) { esxPrivate *priv = pool->conn->privateData; - virStorageDriverPtr backend = pool->privateData; + virStorageDriver *backend = pool->privateData; virCheckNonNullArgReturn(pool->privateData, -1); @@ -238,7 +238,7 @@ static char * esxStoragePoolGetXMLDesc(virStoragePoolPtr pool, unsigned int flags) { esxPrivate *priv = pool->conn->privateData; - virStorageDriverPtr backend = pool->privateData; + virStorageDriver *backend = pool->privateData; virCheckNonNullArgReturn(pool->privateData, NULL); @@ -284,7 +284,7 @@ static int esxStoragePoolNumOfVolumes(virStoragePoolPtr pool) { esxPrivate *priv = pool->conn->privateData; - virStorageDriverPtr backend = pool->privateData; + virStorageDriver *backend = pool->privateData; virCheckNonNullArgReturn(pool->privateData, -1); @@ -301,7 +301,7 @@ esxStoragePoolListVolumes(virStoragePoolPtr pool, char **const names, int maxnames) { esxPrivate *priv = pool->conn->privateData; - virStorageDriverPtr backend = pool->privateData; + virStorageDriver *backend = pool->privateData; virCheckNonNullArgReturn(pool->privateData, -1); @@ -317,7 +317,7 @@ static virStorageVolPtr esxStorageVolLookupByName(virStoragePoolPtr pool, const char *name) { esxPrivate *priv = pool->conn->privateData; - virStorageDriverPtr backend = pool->privateData; + virStorageDriver *backend = pool->privateData; virCheckNonNullArgReturn(pool->privateData, NULL); @@ -390,7 +390,7 @@ esxStorageVolCreateXML(virStoragePoolPtr pool, const char *xmldesc, unsigned int flags) { esxPrivate *priv = pool->conn->privateData; - virStorageDriverPtr backend = pool->privateData; + virStorageDriver *backend = pool->privateData; virCheckNonNullArgReturn(pool->privateData, NULL); @@ -407,7 +407,7 @@ esxStorageVolCreateXMLFrom(virStoragePoolPtr pool, const char *xmldesc, virStorageVolPtr sourceVolume, unsigned int flags) { esxPrivate *priv = pool->conn->privateData; - virStorageDriverPtr backend = pool->privateData; + virStorageDriver *backend = pool->privateData; virCheckNonNullArgReturn(pool->privateData, NULL); @@ -423,7 +423,7 @@ static int esxStorageVolDelete(virStorageVolPtr volume, unsigned int flags) { esxPrivate *priv = volume->conn->privateData; - virStorageDriverPtr backend = volume->privateData; + virStorageDriver *backend = volume->privateData; virCheckNonNullArgReturn(volume->privateData, -1); @@ -439,7 +439,7 @@ static int esxStorageVolWipe(virStorageVolPtr volume, unsigned int flags) { esxPrivate *priv = volume->conn->privateData; - virStorageDriverPtr backend = volume->privateData; + virStorageDriver *backend = volume->privateData; virCheckNonNullArgReturn(volume->privateData, -1); @@ -455,7 +455,7 @@ static int esxStorageVolGetInfo(virStorageVolPtr volume, virStorageVolInfoPtr info) { esxPrivate *priv = volume->conn->privateData; - virStorageDriverPtr backend = volume->privateData; + virStorageDriver *backend = volume->privateData; virCheckNonNullArgReturn(volume->privateData, -1); @@ -471,7 +471,7 @@ static char * esxStorageVolGetXMLDesc(virStorageVolPtr volume, unsigned int flags) { esxPrivate *priv = volume->conn->privateData; - virStorageDriverPtr backend = volume->privateData; + virStorageDriver *backend = volume->privateData; virCheckNonNullArgReturn(volume->privateData, NULL); @@ -487,7 +487,7 @@ static char * esxStorageVolGetPath(virStorageVolPtr volume) { esxPrivate *priv = volume->conn->privateData; - virStorageDriverPtr backend = volume->privateData; + virStorageDriver *backend = volume->privateData; virCheckNonNullArgReturn(volume->privateData, NULL); diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c index 24e1c73ec4..c73a6728f7 100644 --- a/src/esx/esx_util.c +++ b/src/esx/esx_util.c @@ -39,7 +39,7 @@ VIR_LOG_INIT("esx.esx_util"); int -esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri) +esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURI *uri) { int result = -1; size_t i; @@ -52,7 +52,7 @@ esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri) *parsedUri = g_new0(esxUtil_ParsedUri, 1); for (i = 0; i < uri->paramsCount; i++) { - virURIParamPtr queryParam = &uri->params[i]; + virURIParam *queryParam = &uri->params[i]; if (STRCASEEQ(queryParam->name, "transport")) { g_free((*parsedUri)->transport); diff --git a/src/esx/esx_util.h b/src/esx/esx_util.h index 9bfbff1d42..088c943e64 100644 --- a/src/esx/esx_util.h +++ b/src/esx/esx_util.h @@ -46,7 +46,7 @@ struct _esxUtil_ParsedUri { char *path; }; -int esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURIPtr uri); +int esxUtil_ParseUri(esxUtil_ParsedUri **parsedUri, virURI *uri); void esxUtil_FreeParsedUri(esxUtil_ParsedUri **parsedUri); diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c index 54f9a81d92..ebc6d9eb69 100644 --- a/src/esx/esx_vi.c +++ b/src/esx/esx_vi.c @@ -142,7 +142,7 @@ esxVI_CURL_ReadString(char *data, size_t size, size_t nmemb, void *userdata) static size_t esxVI_CURL_WriteBuffer(char *data, size_t size, size_t nmemb, void *userdata) { - virBufferPtr buffer = userdata; + virBuffer *buffer = userdata; if (buffer) { /* @@ -1450,7 +1450,7 @@ esxVI_Enumeration_CastFromAnyType(const esxVI_Enumeration *enumeration, int esxVI_Enumeration_Serialize(const esxVI_Enumeration *enumeration, - int value, const char *element, virBufferPtr output) + int value, const char *element, virBuffer *output) { size_t i; const char *name = NULL; @@ -1638,7 +1638,7 @@ esxVI_List_CastFromAnyType(esxVI_AnyType *anyType, esxVI_List **list, int esxVI_List_Serialize(esxVI_List *list, const char *element, - virBufferPtr output, + virBuffer *output, esxVI_List_SerializeFunc serializeFunc) { esxVI_List *item = NULL; diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h index b960c0900a..4c0e712919 100644 --- a/src/esx/esx_vi.h +++ b/src/esx/esx_vi.h @@ -184,7 +184,7 @@ struct _esxVI_Context { esxVI_ProductLine productLine; unsigned long productVersion; /* = 1000000 * major + 1000 * minor + micro */ esxVI_UserSession *session; /* ... except the session ... */ - virMutexPtr sessionLock; /* ... that is protected by this mutex */ + virMutex *sessionLock; /* ... that is protected by this mutex */ esxVI_Datacenter *datacenter; char *datacenterPath; /* including folders */ esxVI_ComputeResource *computeResource; @@ -251,7 +251,7 @@ int esxVI_Enumeration_CastFromAnyType(const esxVI_Enumeration *enumeration, esxVI_AnyType *anyType, int *value); int esxVI_Enumeration_Serialize(const esxVI_Enumeration *enumeration, int value, const char *element, - virBufferPtr output); + virBuffer *output); int esxVI_Enumeration_Deserialize(const esxVI_Enumeration *enumeration, xmlNodePtr node, int *value); @@ -270,7 +270,7 @@ typedef int (*esxVI_List_DeepCopyFunc) (esxVI_List **dest, esxVI_List *src); typedef int (*esxVI_List_CastFromAnyTypeFunc) (esxVI_AnyType *anyType, esxVI_List **item); typedef int (*esxVI_List_SerializeFunc) (esxVI_List *item, const char *element, - virBufferPtr output); + virBuffer *output); typedef int (*esxVI_List_DeserializeFunc) (xmlNodePtr node, esxVI_List **item); int esxVI_List_Append(esxVI_List **list, esxVI_List *item); @@ -281,7 +281,7 @@ int esxVI_List_CastFromAnyType(esxVI_AnyType *anyType, esxVI_List **list, esxVI_List_CastFromAnyTypeFunc castFromAnyTypeFunc, esxVI_List_FreeFunc freeFunc); int esxVI_List_Serialize(esxVI_List *list, const char *element, - virBufferPtr output, + virBuffer *output, esxVI_List_SerializeFunc serializeFunc); int esxVI_List_Deserialize(xmlNodePtr node, esxVI_List **list, esxVI_List_DeserializeFunc deserializeFunc, diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c index 59735194ae..132c5ac2fd 100644 --- a/src/esx/esx_vi_types.c +++ b/src/esx/esx_vi_types.c @@ -157,7 +157,7 @@ VIR_LOG_INIT("esx.esx_vi_types"); #define ESX_VI__TEMPLATE__LIST__SERIALIZE(_type) \ int \ esxVI_##_type##_SerializeList(esxVI_##_type *list, const char *element, \ - virBufferPtr output) \ + virBuffer *output) \ { \ return esxVI_List_Serialize((esxVI_List *)list, element, output, \ (esxVI_List_SerializeFunc) \ @@ -235,7 +235,7 @@ VIR_LOG_INIT("esx.esx_vi_types"); #define ESX_VI__TEMPLATE__SERIALIZE_EXTRA(_type, _extra, _serialize) \ int \ esxVI_##_type##_Serialize(esxVI_##_type *item, \ - const char *element, virBufferPtr output) \ + const char *element, virBuffer *output) \ { \ if (!element || !output) { \ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", \ @@ -509,7 +509,7 @@ VIR_LOG_INIT("esx.esx_vi_types"); #define ESX_VI__TEMPLATE__ENUMERATION__SERIALIZE(_type) \ int \ esxVI_##_type##_Serialize(esxVI_##_type value, const char *element, \ - virBufferPtr output) \ + virBuffer *output) \ { \ return esxVI_Enumeration_Serialize(&_esxVI_##_type##_Enumeration, \ value, element, output); \ @@ -1206,7 +1206,7 @@ ESX_VI__TEMPLATE__CAST_VALUE_FROM_ANY_TYPE(String, char) int esxVI_String_Serialize(esxVI_String *string, const char *element, - virBufferPtr output) + virBuffer *output) { return esxVI_String_SerializeValue(string ? string->value : NULL, element, output); @@ -1217,7 +1217,7 @@ ESX_VI__TEMPLATE__LIST__SERIALIZE(String) int esxVI_String_SerializeValue(const char *value, const char *element, - virBufferPtr output) + virBuffer *output) { if (!element || !output) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); @@ -1653,7 +1653,7 @@ ESX_VI__TEMPLATE__LIST__CAST_FROM_ANY_TYPE(ManagedObjectReference) int esxVI_ManagedObjectReference_Serialize (esxVI_ManagedObjectReference *managedObjectReference, - const char *element, virBufferPtr output) + const char *element, virBuffer *output) { if (!element || !output) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); diff --git a/src/esx/esx_vi_types.h b/src/esx/esx_vi_types.h index 956c43df9a..6f3f6f7979 100644 --- a/src/esx/esx_vi_types.h +++ b/src/esx/esx_vi_types.h @@ -126,7 +126,7 @@ enum _esxVI_Boolean { }; int esxVI_Boolean_Serialize(esxVI_Boolean boolean_, const char *element, - virBufferPtr output); + virBuffer *output); int esxVI_Boolean_Deserialize(xmlNodePtr node, esxVI_Boolean *boolean_); @@ -188,11 +188,11 @@ int esxVI_String_DeepCopyValue(char **dest, const char *src); int esxVI_String_CastFromAnyType(esxVI_AnyType *anyType, esxVI_String **string); int esxVI_String_CastValueFromAnyType(esxVI_AnyType *anyType, char **string); int esxVI_String_Serialize(esxVI_String *string, const char *element, - virBufferPtr output); + virBuffer *output); int esxVI_String_SerializeList(esxVI_String *stringList, const char *element, - virBufferPtr output); + virBuffer *output); int esxVI_String_SerializeValue(const char *value, const char *element, - virBufferPtr output); + virBuffer *output); int esxVI_String_Deserialize(xmlNodePtr node, esxVI_String **string); int esxVI_String_DeserializeList(xmlNodePtr node, esxVI_String **stringList); int esxVI_String_DeserializeValue(xmlNodePtr node, char **value); @@ -217,9 +217,9 @@ int esxVI_Byte_AppendToList(esxVI_Byte **numberList, esxVI_Byte *number); int esxVI_Byte_DeepCopy(esxVI_Byte **dest, esxVI_Byte *src); int esxVI_Byte_DeepCopyList(esxVI_Byte **destList, esxVI_Byte *srcList); int esxVI_Byte_Serialize(esxVI_Byte *number, const char *element, - virBufferPtr output); + virBuffer *output); int esxVI_Byte_SerializeList(esxVI_Byte *numberList, const char *element, - virBufferPtr output); + virBuffer *output); int esxVI_Byte_Deserialize(xmlNodePtr node, esxVI_Byte **number); @@ -242,9 +242,9 @@ int esxVI_Int_AppendToList(esxVI_Int **numberList, esxVI_Int *number); int esxVI_Int_DeepCopy(esxVI_Int **dest, esxVI_Int *src); int esxVI_Int_CastFromAnyType(esxVI_AnyType *anyType, esxVI_Int **number); int esxVI_Int_Serialize(esxVI_Int *number, const char *element, - virBufferPtr output); + virBuffer *output); int esxVI_Int_SerializeList(esxVI_Int *numberList, const char *element, - virBufferPtr output); + virBuffer *output); int esxVI_Int_Deserialize(xmlNodePtr node, esxVI_Int **number); @@ -267,9 +267,9 @@ int esxVI_Long_AppendToList(esxVI_Long **numberList, esxVI_Long *number); int esxVI_Long_DeepCopy(esxVI_Long **dest, esxVI_Long *src); int esxVI_Long_CastFromAnyType(esxVI_AnyType *anyType, esxVI_Long **number); int esxVI_Long_Serialize(esxVI_Long *number, const char *element, - virBufferPtr output); + virBuffer *output); int esxVI_Long_SerializeList(esxVI_Long *numberList, const char *element, - virBufferPtr output); + virBuffer *output); int esxVI_Long_Deserialize(xmlNodePtr node, esxVI_Long **number); @@ -290,7 +290,7 @@ void esxVI_DateTime_Free(esxVI_DateTime **dateTime); int esxVI_DateTime_Validate(esxVI_DateTime *dateTime); int esxVI_DateTime_DeepCopy(esxVI_DateTime **dest, esxVI_DateTime *src); int esxVI_DateTime_Serialize(esxVI_DateTime *dateTime, const char *element, - virBufferPtr output); + virBuffer *output); int esxVI_DateTime_Deserialize(xmlNodePtr node, esxVI_DateTime **dateTime); int esxVI_DateTime_ConvertToCalendarTime(esxVI_DateTime *dateTime, long long *secondsSinceEpoch); @@ -368,10 +368,10 @@ int esxVI_ManagedObjectReference_CastListFromAnyType esxVI_ManagedObjectReference **managedObjectReferenceList); int esxVI_ManagedObjectReference_Serialize (esxVI_ManagedObjectReference *managedObjectReference, - const char *element, virBufferPtr output); + const char *element, virBuffer *output); int esxVI_ManagedObjectReference_SerializeList (esxVI_ManagedObjectReference *managedObjectReference, - const char *element, virBufferPtr output); + const char *element, virBuffer *output); int esxVI_ManagedObjectReference_Deserialize (xmlNodePtr node, esxVI_ManagedObjectReference **managedObjectReference); diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c index 17f5be1f0d..0ac4f93d13 100644 --- a/src/hyperv/hyperv_driver.c +++ b/src/hyperv/hyperv_driver.c @@ -259,11 +259,11 @@ hypervLookupHostSystemBiosUuid(hypervPrivate *priv, unsigned char *uuid) } -static virCapsPtr +static virCaps * hypervCapsInit(hypervPrivate *priv) { - virCapsPtr caps = NULL; - virCapsGuestPtr guest = NULL; + virCaps *caps = NULL; + virCapsGuest *guest = NULL; caps = virCapabilitiesNew(VIR_ARCH_X86_64, 1, 1); @@ -424,7 +424,7 @@ hypervGetInstanceIDFromXMLResponse(WsXmlDocH response) static int -hypervDomainCreateSCSIController(virDomainPtr domain, virDomainControllerDefPtr def) +hypervDomainCreateSCSIController(virDomainPtr domain, virDomainControllerDef *def) { g_autoptr(GHashTable) scsiResource = NULL; g_autofree char *resourceType = NULL; @@ -469,7 +469,7 @@ hypervDomainCreateSCSIController(virDomainPtr domain, virDomainControllerDefPtr static int hypervDomainAddVirtualDiskParent(virDomainPtr domain, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, Msvm_ResourceAllocationSettingData *controller, const char *hostname, WsXmlDocH *response) @@ -517,7 +517,7 @@ hypervDomainAddVirtualDiskParent(virDomainPtr domain, static int hypervDomainAddVirtualHardDisk(virDomainPtr domain, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, const char *hostname, char *parentInstanceID) { @@ -564,7 +564,7 @@ hypervDomainAddVirtualHardDisk(virDomainPtr domain, static int hypervDomainAttachVirtualDisk(virDomainPtr domain, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, Msvm_ResourceAllocationSettingData *controller, const char *hostname) { @@ -595,7 +595,7 @@ hypervDomainAttachVirtualDisk(virDomainPtr domain, static int hypervDomainAttachPhysicalDisk(virDomainPtr domain, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, Msvm_ResourceAllocationSettingData *controller, const char *hostname) { @@ -698,7 +698,7 @@ hypervDomainAttachPhysicalDisk(virDomainPtr domain, static int hypervDomainAddOpticalDrive(virDomainPtr domain, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, Msvm_ResourceAllocationSettingData *controller, const char *hostname, WsXmlDocH *response) @@ -745,7 +745,7 @@ hypervDomainAddOpticalDrive(virDomainPtr domain, static int hypervDomainAddOpticalDisk(virDomainPtr domain, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, const char *hostname, char *driveInstanceID) { @@ -790,7 +790,7 @@ hypervDomainAddOpticalDisk(virDomainPtr domain, static int hypervDomainAttachCDROM(virDomainPtr domain, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, Msvm_ResourceAllocationSettingData *controller, const char *hostname) { @@ -817,7 +817,7 @@ hypervDomainAttachCDROM(virDomainPtr domain, static int hypervDomainAttachFloppy(virDomainPtr domain, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, Msvm_ResourceAllocationSettingData *driveSettings, const char *hostname) { @@ -864,7 +864,7 @@ hypervDomainAttachFloppy(virDomainPtr domain, static int hypervDomainAttachStorageVolume(virDomainPtr domain, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, Msvm_ResourceAllocationSettingData *controller, const char *hostname) { @@ -896,7 +896,7 @@ hypervDomainAttachStorageVolume(virDomainPtr domain, static int -hypervDomainAttachStorage(virDomainPtr domain, virDomainDefPtr def, const char *hostname) +hypervDomainAttachStorage(virDomainPtr domain, virDomainDef *def, const char *hostname) { hypervPrivate *priv = domain->conn->privateData; size_t i = 0; @@ -972,7 +972,7 @@ hypervDomainAttachStorage(virDomainPtr domain, virDomainDefPtr def, const char * static int -hypervDomainAttachSerial(virDomainPtr domain, virDomainChrDefPtr serial) +hypervDomainAttachSerial(virDomainPtr domain, virDomainChrDef *serial) { char uuid_string[VIR_UUID_STRING_BUFLEN]; hypervPrivate *priv = domain->conn->privateData; @@ -980,7 +980,7 @@ hypervDomainAttachSerial(virDomainPtr domain, virDomainChrDefPtr serial) g_autoptr(Msvm_VirtualSystemSettingData) vssd = NULL; g_autoptr(Msvm_ResourceAllocationSettingData) rasd = NULL; g_autoptr(Msvm_SerialPortSettingData) spsd = NULL; - hypervWmiClassInfoPtr classInfo = NULL; + hypervWmiClassInfo *classInfo = NULL; Msvm_ResourceAllocationSettingData *current = NULL; Msvm_ResourceAllocationSettingData *entry = NULL; g_autoptr(GHashTable) serialResource = NULL; @@ -1052,7 +1052,7 @@ hypervDomainAttachSerial(virDomainPtr domain, virDomainChrDefPtr serial) static int hypervDomainAttachSyntheticEthernetAdapter(virDomainPtr domain, - virDomainNetDefPtr net, + virDomainNetDef *net, char *hostname) { hypervPrivate *priv = domain->conn->privateData; @@ -1182,11 +1182,11 @@ hypervDomainAttachSyntheticEthernetAdapter(virDomainPtr domain, * Functions for deserializing device entries */ static int -hypervDomainDefAppendController(virDomainDefPtr def, +hypervDomainDefAppendController(virDomainDef *def, int idx, virDomainControllerType controllerType) { - virDomainControllerDefPtr controller = NULL; + virDomainControllerDef *controller = NULL; if (!(controller = virDomainControllerDefNew(controllerType))) return -1; @@ -1201,22 +1201,22 @@ hypervDomainDefAppendController(virDomainDefPtr def, static int -hypervDomainDefAppendIDEController(virDomainDefPtr def) +hypervDomainDefAppendIDEController(virDomainDef *def) { return hypervDomainDefAppendController(def, 0, VIR_DOMAIN_CONTROLLER_TYPE_IDE); } static int -hypervDomainDefAppendSCSIController(virDomainDefPtr def, int idx) +hypervDomainDefAppendSCSIController(virDomainDef *def, int idx) { return hypervDomainDefAppendController(def, idx, VIR_DOMAIN_CONTROLLER_TYPE_SCSI); } static int -hypervDomainDefAppendDisk(virDomainDefPtr def, - virDomainDiskDefPtr disk, +hypervDomainDefAppendDisk(virDomainDef *def, + virDomainDiskDef *disk, virDomainDiskBus busType, int diskNameOffset, const char *diskNamePrefix, @@ -1268,7 +1268,7 @@ hypervDomainDefAppendDisk(virDomainDefPtr def, static int -hypervDomainDefParseFloppyStorageExtent(virDomainDefPtr def, virDomainDiskDefPtr disk) +hypervDomainDefParseFloppyStorageExtent(virDomainDef *def, virDomainDiskDef *disk) { disk->bus = VIR_DOMAIN_DISK_BUS_FDC; disk->dst = g_strdup("fda"); @@ -1282,7 +1282,7 @@ hypervDomainDefParseFloppyStorageExtent(virDomainDefPtr def, virDomainDiskDefPtr static int hypervDomainDefParseVirtualExtent(hypervPrivate *priv, - virDomainDefPtr def, + virDomainDef *def, Msvm_StorageAllocationSettingData *disk_entry, Msvm_ResourceAllocationSettingData *rasd, Msvm_ResourceAllocationSettingData **ideChannels, @@ -1290,7 +1290,7 @@ hypervDomainDefParseVirtualExtent(hypervPrivate *priv, { Msvm_ResourceAllocationSettingData *diskParent = NULL; Msvm_ResourceAllocationSettingData *controller = NULL; - virDomainDiskDefPtr disk = NULL; + virDomainDiskDef *disk = NULL; int result = -1; if (disk_entry->data->HostResource.count < 1) @@ -1359,7 +1359,7 @@ hypervDomainDefParseVirtualExtent(hypervPrivate *priv, static int hypervDomainDefParsePhysicalDisk(hypervPrivate *priv, - virDomainDefPtr def, + virDomainDef *def, Msvm_ResourceAllocationSettingData *entry, Msvm_ResourceAllocationSettingData *rasd, Msvm_ResourceAllocationSettingData **ideChannels, @@ -1368,7 +1368,7 @@ hypervDomainDefParsePhysicalDisk(hypervPrivate *priv, int result = -1; Msvm_ResourceAllocationSettingData *controller = NULL; g_autoptr(Msvm_DiskDrive) diskdrive = NULL; - virDomainDiskDefPtr disk = NULL; + virDomainDiskDef *disk = NULL; char **hostResource = entry->data->HostResource.data; g_autofree char *hostEscaped = NULL; g_autofree char *driveNumberStr = NULL; @@ -1461,7 +1461,7 @@ hypervDomainDefParsePhysicalDisk(hypervPrivate *priv, static int hypervDomainDefParseStorage(hypervPrivate *priv, - virDomainDefPtr def, + virDomainDef *def, Msvm_ResourceAllocationSettingData *rasd, Msvm_StorageAllocationSettingData *sasd) { @@ -1533,13 +1533,13 @@ hypervDomainDefParseStorage(hypervPrivate *priv, static int -hypervDomainDefParseSerial(virDomainDefPtr def, Msvm_ResourceAllocationSettingData *rasd) +hypervDomainDefParseSerial(virDomainDef *def, Msvm_ResourceAllocationSettingData *rasd) { for (; rasd; rasd = rasd->next) { int port_num = 0; char **conn = NULL; const char *srcPath = NULL; - virDomainChrDefPtr serial = NULL; + virDomainChrDef *serial = NULL; if (rasd->data->ResourceType != MSVM_RASD_RESOURCETYPE_SERIAL_PORT) continue; @@ -1580,7 +1580,7 @@ hypervDomainDefParseSerial(virDomainDefPtr def, Msvm_ResourceAllocationSettingDa static int -hypervDomainDefParseEthernetAdapter(virDomainDefPtr def, +hypervDomainDefParseEthernetAdapter(virDomainDef *def, Msvm_EthernetPortAllocationSettingData *net, hypervPrivate *priv) { @@ -1661,7 +1661,7 @@ hypervDomainDefParseEthernetAdapter(virDomainDefPtr def, static int hypervDomainDefParseEthernet(virDomainPtr domain, - virDomainDefPtr def, + virDomainDef *def, Msvm_EthernetPortAllocationSettingData *nets) { Msvm_EthernetPortAllocationSettingData *entry = nets; @@ -1736,7 +1736,7 @@ virDomainDefParserConfig hypervDomainDefParserConfig; static virDrvOpenStatus hypervConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virDrvOpenStatus result = VIR_DRV_OPEN_ERROR; @@ -2772,17 +2772,17 @@ hypervDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) /* Allocate space for all potential devices */ /* 256 scsi drives + 4 ide drives */ - def->disks = g_new0(virDomainDiskDefPtr, + def->disks = g_new0(virDomainDiskDef *, HYPERV_MAX_SCSI_CONTROLLERS * HYPERV_MAX_DRIVES_PER_SCSI_CONTROLLER + HYPERV_MAX_IDE_CHANNELS * HYPERV_MAX_DRIVES_PER_IDE_CHANNEL); def->ndisks = 0; /* 1 ide & 4 scsi controllers */ - def->controllers = g_new0(virDomainControllerDefPtr, 5); + def->controllers = g_new0(virDomainControllerDef *, 5); def->ncontrollers = 0; /* 8 synthetic + 4 legacy NICs */ - def->nets = g_new0(virDomainNetDefPtr, 12); + def->nets = g_new0(virDomainNetDef *, 12); def->nnets = 0; if (hypervDomainDefParseStorage(priv, def, rasd, sasd) < 0) diff --git a/src/hyperv/hyperv_private.h b/src/hyperv/hyperv_private.h index a8855e8118..da37a8fd20 100644 --- a/src/hyperv/hyperv_private.h +++ b/src/hyperv/hyperv_private.h @@ -33,7 +33,7 @@ typedef struct _hypervPrivate hypervPrivate; struct _hypervPrivate { hypervParsedUri *parsedUri; WsManClient *client; - virCapsPtr caps; - virDomainXMLOptionPtr xmlopt; + virCaps *caps; + virDomainXMLOption *xmlopt; char *version; }; diff --git a/src/hyperv/hyperv_util.c b/src/hyperv/hyperv_util.c index d8a6e6cf5c..ede786be25 100644 --- a/src/hyperv/hyperv_util.c +++ b/src/hyperv/hyperv_util.c @@ -35,7 +35,7 @@ VIR_LOG_INIT("hyperv.hyperv_util"); int -hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri) +hypervParseUri(hypervParsedUri **parsedUri, virURI *uri) { int result = -1; size_t i; @@ -48,7 +48,7 @@ hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri) *parsedUri = g_new0(hypervParsedUri, 1); for (i = 0; i < uri->paramsCount; i++) { - virURIParamPtr queryParam = &uri->params[i]; + virURIParam *queryParam = &uri->params[i]; if (STRCASEEQ(queryParam->name, "transport")) { VIR_FREE((*parsedUri)->transport); diff --git a/src/hyperv/hyperv_util.h b/src/hyperv/hyperv_util.h index 67d698450d..3c3cf56c13 100644 --- a/src/hyperv/hyperv_util.h +++ b/src/hyperv/hyperv_util.h @@ -30,6 +30,6 @@ struct _hypervParsedUri { char *transport; }; -int hypervParseUri(hypervParsedUri **parsedUri, virURIPtr uri); +int hypervParseUri(hypervParsedUri **parsedUri, virURI *uri); void hypervFreeParsedUri(hypervParsedUri **parsedUri); diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c index 6271e85cc6..4aac38c732 100644 --- a/src/hyperv/hyperv_wmi.c +++ b/src/hyperv/hyperv_wmi.c @@ -48,8 +48,8 @@ VIR_LOG_INIT("hyperv.hyperv_wmi"); int -hypervGetWmiClassList(hypervPrivate *priv, hypervWmiClassInfoPtr wmiInfo, - virBufferPtr query, hypervObject **wmiClass) +hypervGetWmiClassList(hypervPrivate *priv, hypervWmiClassInfo *wmiInfo, + virBuffer *query, hypervObject **wmiClass) { hypervWqlQuery wqlQuery = HYPERV_WQL_QUERY_INITIALIZER; @@ -126,12 +126,12 @@ hypervVerifyResponse(WsManClient *client, WsXmlDocH response, * Returns a pointer to the newly instantiated object on success, which should * be freed by hypervInvokeMethod. Otherwise returns NULL. */ -hypervInvokeParamsListPtr +hypervInvokeParamsList * hypervCreateInvokeParamsList(const char *method, const char *selector, - hypervWmiClassInfoPtr info) + hypervWmiClassInfo *info) { - hypervInvokeParamsListPtr params = NULL; + hypervInvokeParamsList *params = NULL; params = g_new0(hypervInvokeParamsList, 1); @@ -154,9 +154,9 @@ hypervCreateInvokeParamsList(const char *method, * */ void -hypervFreeInvokeParams(hypervInvokeParamsListPtr params) +hypervFreeInvokeParams(hypervInvokeParamsList *params) { - hypervParamPtr p = NULL; + hypervParam *p = NULL; size_t i = 0; if (params == NULL) @@ -186,7 +186,7 @@ hypervFreeInvokeParams(hypervInvokeParamsListPtr params) static inline int -hypervCheckParams(hypervInvokeParamsListPtr params) +hypervCheckParams(hypervInvokeParamsList *params) { if (params->nbParams + 1 > params->nbAvailParams) { VIR_EXPAND_N(params->params, params->nbAvailParams, 5); @@ -208,10 +208,10 @@ hypervCheckParams(hypervInvokeParamsListPtr params) * Returns -1 on failure, 0 on success. */ int -hypervAddSimpleParam(hypervInvokeParamsListPtr params, const char *name, +hypervAddSimpleParam(hypervInvokeParamsList *params, const char *name, const char *value) { - hypervParamPtr p = NULL; + hypervParam *p = NULL; if (hypervCheckParams(params) < 0) return -1; @@ -239,12 +239,12 @@ hypervAddSimpleParam(hypervInvokeParamsListPtr params, const char *name, * Adds an EPR param to the params list. Returns -1 on failure, 0 on success. */ int -hypervAddEprParam(hypervInvokeParamsListPtr params, +hypervAddEprParam(hypervInvokeParamsList *params, const char *name, - virBufferPtr query, - hypervWmiClassInfoPtr classInfo) + virBuffer *query, + hypervWmiClassInfo *classInfo) { - hypervParamPtr p = NULL; + hypervParam *p = NULL; if (hypervCheckParams(params) < 0) return -1; @@ -271,7 +271,7 @@ hypervAddEprParam(hypervInvokeParamsListPtr params, * Returns a pointer to the GHashTable on success, otherwise NULL. */ GHashTable * -hypervCreateEmbeddedParam(hypervWmiClassInfoPtr classInfo) +hypervCreateEmbeddedParam(hypervWmiClassInfo *classInfo) { size_t i; size_t count; @@ -336,12 +336,12 @@ hypervSetEmbeddedProperty(GHashTable *table, * Returns -1 on failure, 0 on success. */ int -hypervAddEmbeddedParam(hypervInvokeParamsListPtr params, +hypervAddEmbeddedParam(hypervInvokeParamsList *params, const char *name, GHashTable **table, - hypervWmiClassInfoPtr classInfo) + hypervWmiClassInfo *classInfo) { - hypervParamPtr p = NULL; + hypervParam *p = NULL; if (hypervCheckParams(params) < 0) return -1; @@ -374,8 +374,8 @@ hypervFreeEmbeddedParam(GHashTable *p) * Serializing parameters to XML and invoking methods */ static int -hypervGetCimTypeInfo(hypervCimTypePtr typemap, const char *name, - hypervCimTypePtr *property) +hypervGetCimTypeInfo(hypervCimType *typemap, const char *name, + hypervCimType **property) { size_t i = 0; while (typemap[i].name[0] != '\0') { @@ -391,7 +391,7 @@ hypervGetCimTypeInfo(hypervCimTypePtr typemap, const char *name, static int -hypervCreateInvokeXmlDoc(hypervInvokeParamsListPtr params, WsXmlDocH *docRoot) +hypervCreateInvokeXmlDoc(hypervInvokeParamsList *params, WsXmlDocH *docRoot) { g_autofree char *method = g_strdup_printf("%s_INPUT", params->method); g_auto(WsXmlDocH) invokeXmlDocRoot = ws_xml_create_doc(NULL, method); @@ -418,7 +418,7 @@ hypervCreateInvokeXmlDoc(hypervInvokeParamsListPtr params, WsXmlDocH *docRoot) static int -hypervSerializeSimpleParam(hypervParamPtr p, const char *resourceUri, +hypervSerializeSimpleParam(hypervParam *p, const char *resourceUri, WsXmlNodeH *methodNode) { WsXmlNodeH xmlNodeParam = NULL; @@ -436,7 +436,7 @@ hypervSerializeSimpleParam(hypervParamPtr p, const char *resourceUri, static int -hypervSerializeEprParam(hypervParamPtr p, hypervPrivate *priv, +hypervSerializeEprParam(hypervParam *p, hypervPrivate *priv, const char *resourceUri, WsXmlNodeH *methodNode) { WsXmlNodeH xmlNodeParam = NULL, @@ -546,7 +546,7 @@ hypervSerializeEprParam(hypervParamPtr p, hypervPrivate *priv, static int -hypervSerializeEmbeddedParam(hypervParamPtr p, const char *resourceUri, +hypervSerializeEmbeddedParam(hypervParam *p, const char *resourceUri, WsXmlNodeH *methodNode) { WsXmlNodeH xmlNodeInstance = NULL, @@ -557,9 +557,9 @@ hypervSerializeEmbeddedParam(hypervParamPtr p, const char *resourceUri, g_auto(WsXmlDocH) xmlDocCdata = NULL; g_autofree char *cdataContent = NULL; xmlNodePtr xmlNodeCdata = NULL; - hypervWmiClassInfoPtr classInfo = p->embedded.info; - g_autofree virHashKeyValuePairPtr items = NULL; - hypervCimTypePtr property = NULL; + hypervWmiClassInfo *classInfo = p->embedded.info; + g_autofree virHashKeyValuePair *items = NULL; + hypervCimType *property = NULL; ssize_t numKeys = -1; int len = 0, i = 0; @@ -702,7 +702,7 @@ hypervSerializeEmbeddedParam(hypervParamPtr p, const char *resourceUri, */ int hypervInvokeMethod(hypervPrivate *priv, - hypervInvokeParamsListPtr *paramsPtr, + hypervInvokeParamsList **paramsPtr, WsXmlDocH *res) { g_autoptr(hypervInvokeParamsList) params = *paramsPtr; @@ -720,7 +720,7 @@ hypervInvokeMethod(hypervPrivate *priv, g_auto(virBuffer) query = VIR_BUFFER_INITIALIZER; g_autoptr(Msvm_ConcreteJob) job = NULL; int jobState = -1; - hypervParamPtr p = NULL; + hypervParam *p = NULL; int timeout = HYPERV_JOB_TIMEOUT_MS; *paramsPtr = NULL; @@ -885,13 +885,13 @@ hypervInvokeMethod(hypervPrivate *priv, /* This function guarantees that wqlQuery->query is reset, even on failure */ int -hypervEnumAndPull(hypervPrivate *priv, hypervWqlQueryPtr wqlQuery, +hypervEnumAndPull(hypervPrivate *priv, hypervWqlQuery *wqlQuery, hypervObject **list) { WsSerializerContextH serializerContext; g_autoptr(client_opt_t) options = NULL; g_autofree char *query_string = NULL; - hypervWmiClassInfoPtr wmiInfo = wqlQuery->info; + hypervWmiClassInfo *wmiInfo = wqlQuery->info; g_autoptr(filter_t) filter = NULL; g_auto(WsXmlDocH) response = NULL; g_autofree char *enumContext = NULL; @@ -1529,7 +1529,7 @@ hypervGetEthernetPortAllocationSD(hypervPrivate *priv, int hypervMsvmVSMSAddResourceSettings(virDomainPtr domain, GHashTable **resourceSettingsPtr, - hypervWmiClassInfoPtr wmiInfo, + hypervWmiClassInfo *wmiInfo, WsXmlDocH *response) { hypervPrivate *priv = domain->conn->privateData; @@ -1576,7 +1576,7 @@ hypervMsvmVSMSAddResourceSettings(virDomainPtr domain, int hypervMsvmVSMSModifyResourceSettings(hypervPrivate *priv, GHashTable **resourceSettingsPtr, - hypervWmiClassInfoPtr wmiInfo) + hypervWmiClassInfo *wmiInfo) { g_autoptr(GHashTable) resourceSettings = *resourceSettingsPtr; g_autoptr(hypervInvokeParamsList) params = NULL; diff --git a/src/hyperv/hyperv_wmi.h b/src/hyperv/hyperv_wmi.h index 6021a46f3e..9093aec455 100644 --- a/src/hyperv/hyperv_wmi.h +++ b/src/hyperv/hyperv_wmi.h @@ -48,19 +48,18 @@ int hypervVerifyResponse(WsManClient *client, WsXmlDocH response, typedef struct _hypervObject hypervObject; struct _hypervObject { XML_TYPE_PTR data; /* Unserialized data from wsman response */ - hypervWmiClassInfoPtr info; /* The info used to make wsman request */ + hypervWmiClassInfo *info; /* The info used to make wsman request */ hypervObject *next; hypervPrivate *priv; }; typedef struct _hypervWqlQuery hypervWqlQuery; -typedef hypervWqlQuery *hypervWqlQueryPtr; struct _hypervWqlQuery { - virBufferPtr query; - hypervWmiClassInfoPtr info; + virBuffer *query; + hypervWmiClassInfo *info; }; -int hypervEnumAndPull(hypervPrivate *priv, hypervWqlQueryPtr wqlQuery, +int hypervEnumAndPull(hypervPrivate *priv, hypervWqlQuery *wqlQuery, hypervObject **list); void hypervFreeObject(void *object); @@ -85,15 +84,15 @@ typedef struct _hypervSimpleParam hypervSimpleParam; struct _hypervEprParam { const char *name; - virBufferPtr query; - hypervWmiClassInfoPtr info; /* info of the object this param represents */ + virBuffer *query; + hypervWmiClassInfo *info; /* info of the object this param represents */ }; typedef struct _hypervEprParam hypervEprParam; struct _hypervEmbeddedParam { const char *name; GHashTable *table; - hypervWmiClassInfoPtr info; /* info of the object this param represents */ + hypervWmiClassInfo *info; /* info of the object this param represents */ }; typedef struct _hypervEmbeddedParam hypervEmbeddedParam; @@ -106,51 +105,49 @@ struct _hypervParam { }; }; typedef struct _hypervParam hypervParam; -typedef hypervParam *hypervParamPtr; struct _hypervInvokeParamsList { const char *method; const char *ns; const char *resourceUri; const char *selector; - hypervParamPtr params; + hypervParam *params; size_t nbParams; size_t nbAvailParams; }; typedef struct _hypervInvokeParamsList hypervInvokeParamsList; -typedef hypervInvokeParamsList *hypervInvokeParamsListPtr; -hypervInvokeParamsListPtr hypervCreateInvokeParamsList(const char *method, +hypervInvokeParamsList *hypervCreateInvokeParamsList(const char *method, const char *selector, - hypervWmiClassInfoPtr obj); + hypervWmiClassInfo *obj); -void hypervFreeInvokeParams(hypervInvokeParamsListPtr params); +void hypervFreeInvokeParams(hypervInvokeParamsList *params); G_DEFINE_AUTOPTR_CLEANUP_FUNC(hypervInvokeParamsList, hypervFreeInvokeParams); -int hypervAddSimpleParam(hypervInvokeParamsListPtr params, const char *name, +int hypervAddSimpleParam(hypervInvokeParamsList *params, const char *name, const char *value); -int hypervAddEprParam(hypervInvokeParamsListPtr params, +int hypervAddEprParam(hypervInvokeParamsList *params, const char *name, - virBufferPtr query, - hypervWmiClassInfoPtr eprInfo); + virBuffer *query, + hypervWmiClassInfo *eprInfo); -GHashTable *hypervCreateEmbeddedParam(hypervWmiClassInfoPtr info); +GHashTable *hypervCreateEmbeddedParam(hypervWmiClassInfo *info); int hypervSetEmbeddedProperty(GHashTable *table, const char *name, const char *value); -int hypervAddEmbeddedParam(hypervInvokeParamsListPtr params, +int hypervAddEmbeddedParam(hypervInvokeParamsList *params, const char *name, GHashTable **table, - hypervWmiClassInfoPtr info); + hypervWmiClassInfo *info); void hypervFreeEmbeddedParam(GHashTable *p); int hypervInvokeMethod(hypervPrivate *priv, - hypervInvokeParamsListPtr *paramsPtr, + hypervInvokeParamsList **paramsPtr, WsXmlDocH *res); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -190,8 +187,8 @@ const char *hypervReturnCodeToString(int returnCode); int hypervGetWmiClassList(hypervPrivate *priv, - hypervWmiClassInfoPtr wmiInfo, - virBufferPtr query, + hypervWmiClassInfo *wmiInfo, + virBuffer *query, hypervObject **wmiClass); /** @@ -272,9 +269,9 @@ int hypervGetEthernetPortAllocationSD(hypervPrivate *priv, int hypervMsvmVSMSAddResourceSettings(virDomainPtr domain, GHashTable **resourceSettingsPtr, - hypervWmiClassInfoPtr wmiInfo, + hypervWmiClassInfo *wmiInfo, WsXmlDocH *response); int hypervMsvmVSMSModifyResourceSettings(hypervPrivate *priv, GHashTable **resourceSettingsPtr, - hypervWmiClassInfoPtr wmiInfo); + hypervWmiClassInfo *wmiInfo); diff --git a/src/hyperv/hyperv_wmi_classes.h b/src/hyperv/hyperv_wmi_classes.h index faf98077eb..e9380e9aa5 100644 --- a/src/hyperv/hyperv_wmi_classes.h +++ b/src/hyperv/hyperv_wmi_classes.h @@ -159,7 +159,6 @@ enum _CIM_EnabledLogicalElement_EnabledState { */ typedef struct _hypervCimType hypervCimType; -typedef hypervCimType *hypervCimTypePtr; struct _hypervCimType { /* Parameter name */ const char *name; @@ -170,7 +169,6 @@ struct _hypervCimType { }; typedef struct _hypervWmiClassInfo hypervWmiClassInfo; -typedef hypervWmiClassInfo *hypervWmiClassInfoPtr; struct _hypervWmiClassInfo { /* The WMI class name */ const char *name; @@ -181,7 +179,7 @@ struct _hypervWmiClassInfo { /* The wsman serializer info - one of the *_TypeInfo structs */ XmlSerializerInfo *serializerInfo; /* Property type information */ - hypervCimTypePtr propertyInfo; + hypervCimType *propertyInfo; }; #include "hyperv_wmi_classes.generated.h" diff --git a/src/hypervisor/domain_cgroup.c b/src/hypervisor/domain_cgroup.c index 05e3aa7e6a..61b54f071c 100644 --- a/src/hypervisor/domain_cgroup.c +++ b/src/hypervisor/domain_cgroup.c @@ -29,7 +29,7 @@ int -virDomainCgroupSetupBlkio(virCgroupPtr cgroup, virDomainBlkiotune blkio) +virDomainCgroupSetupBlkio(virCgroup *cgroup, virDomainBlkiotune blkio) { size_t i; @@ -39,7 +39,7 @@ virDomainCgroupSetupBlkio(virCgroupPtr cgroup, virDomainBlkiotune blkio) if (blkio.ndevices) { for (i = 0; i < blkio.ndevices; i++) { - virBlkioDevicePtr dev = &blkio.devices[i]; + virBlkioDevice *dev = &blkio.devices[i]; if (dev->weight && virCgroupSetupBlkioDeviceWeight(cgroup, dev->path, @@ -73,7 +73,7 @@ virDomainCgroupSetupBlkio(virCgroupPtr cgroup, virDomainBlkiotune blkio) int -virDomainCgroupSetupMemtune(virCgroupPtr cgroup, virDomainMemtune mem) +virDomainCgroupSetupMemtune(virCgroup *cgroup, virDomainMemtune mem) { if (virMemoryLimitIsSet(mem.hard_limit)) if (virCgroupSetMemoryHardLimit(cgroup, mem.hard_limit) < 0) @@ -92,8 +92,8 @@ virDomainCgroupSetupMemtune(virCgroupPtr cgroup, virDomainMemtune mem) int -virDomainCgroupSetupDomainBlkioParameters(virCgroupPtr cgroup, - virDomainDefPtr def, +virDomainCgroupSetupDomainBlkioParameters(virCgroup *cgroup, + virDomainDef *def, virTypedParameterPtr params, int nparams) { @@ -113,7 +113,7 @@ virDomainCgroupSetupDomainBlkioParameters(virCgroupPtr cgroup, STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_READ_BPS) || STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS)) { size_t ndevices; - virBlkioDevicePtr devices = NULL; + virBlkioDevice *devices = NULL; size_t j; if (virDomainDriverParseBlkioDeviceStr(params[i].value.s, @@ -191,10 +191,10 @@ virDomainCgroupSetupDomainBlkioParameters(virCgroupPtr cgroup, int -virDomainCgroupSetMemoryLimitParameters(virCgroupPtr cgroup, - virDomainObjPtr vm, - virDomainDefPtr liveDef, - virDomainDefPtr persistentDef, +virDomainCgroupSetMemoryLimitParameters(virCgroup *cgroup, + virDomainObj *vm, + virDomainDef *liveDef, + virDomainDef *persistentDef, virTypedParameterPtr params, int nparams) { diff --git a/src/hypervisor/domain_cgroup.h b/src/hypervisor/domain_cgroup.h index 5a6498b1ce..f93e5f74fe 100644 --- a/src/hypervisor/domain_cgroup.h +++ b/src/hypervisor/domain_cgroup.h @@ -24,15 +24,15 @@ #include "domain_conf.h" -int virDomainCgroupSetupBlkio(virCgroupPtr cgroup, virDomainBlkiotune blkio); -int virDomainCgroupSetupMemtune(virCgroupPtr cgroup, virDomainMemtune mem); -int virDomainCgroupSetupDomainBlkioParameters(virCgroupPtr cgroup, - virDomainDefPtr def, +int virDomainCgroupSetupBlkio(virCgroup *cgroup, virDomainBlkiotune blkio); +int virDomainCgroupSetupMemtune(virCgroup *cgroup, virDomainMemtune mem); +int virDomainCgroupSetupDomainBlkioParameters(virCgroup *cgroup, + virDomainDef *def, virTypedParameterPtr params, int nparams); -int virDomainCgroupSetMemoryLimitParameters(virCgroupPtr cgroup, - virDomainObjPtr vm, - virDomainDefPtr liveDef, - virDomainDefPtr persistentDef, +int virDomainCgroupSetMemoryLimitParameters(virCgroup *cgroup, + virDomainObj *vm, + virDomainDef *liveDef, + virDomainDef *persistentDef, virTypedParameterPtr params, int nparams); diff --git a/src/hypervisor/domain_driver.c b/src/hypervisor/domain_driver.c index 945d375444..f7d49bc38a 100644 --- a/src/hypervisor/domain_driver.c +++ b/src/hypervisor/domain_driver.c @@ -53,7 +53,7 @@ virDomainDriverGenerateRootHash(const char *drivername, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-" static void -virDomainMachineNameAppendValid(virBufferPtr buf, +virDomainMachineNameAppendValid(virBuffer *buf, const char *name) { bool skip = true; @@ -121,15 +121,15 @@ virDomainDriverGenerateMachineName(const char *drivername, /* Modify dest_array to reflect all blkio device changes described in * src_array. */ int -virDomainDriverMergeBlkioDevice(virBlkioDevicePtr *dest_array, +virDomainDriverMergeBlkioDevice(virBlkioDevice **dest_array, size_t *dest_size, - virBlkioDevicePtr src_array, + virBlkioDevice *src_array, size_t src_size, const char *type) { size_t i, j; - virBlkioDevicePtr dest; - virBlkioDevicePtr src; + virBlkioDevice *dest; + virBlkioDevice *src; for (i = 0; i < src_size; i++) { bool found = false; @@ -192,13 +192,13 @@ virDomainDriverMergeBlkioDevice(virBlkioDevicePtr *dest_array, */ int virDomainDriverParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - virBlkioDevicePtr *dev, size_t *size) + virBlkioDevice **dev, size_t *size) { char *temp; int ndevices = 0; int nsep = 0; size_t i; - virBlkioDevicePtr result = NULL; + virBlkioDevice *result = NULL; *dev = NULL; *size = 0; @@ -298,7 +298,7 @@ virDomainDriverParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, int -virDomainDriverSetupPersistentDefBlkioParams(virDomainDefPtr persistentDef, +virDomainDriverSetupPersistentDefBlkioParams(virDomainDef *persistentDef, virTypedParameterPtr params, int nparams) { @@ -315,7 +315,7 @@ virDomainDriverSetupPersistentDefBlkioParams(virDomainDefPtr persistentDef, STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WRITE_IOPS) || STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_READ_BPS) || STREQ(param->field, VIR_DOMAIN_BLKIO_DEVICE_WRITE_BPS)) { - virBlkioDevicePtr devices = NULL; + virBlkioDevice *devices = NULL; size_t ndevices; if (virDomainDriverParseBlkioDeviceStr(param->value.s, @@ -342,10 +342,10 @@ virDomainDriverSetupPersistentDefBlkioParams(virDomainDefPtr persistentDef, int -virDomainDriverNodeDeviceGetPCIInfo(virNodeDeviceDefPtr def, - virPCIDeviceAddressPtr devAddr) +virDomainDriverNodeDeviceGetPCIInfo(virNodeDeviceDef *def, + virPCIDeviceAddress *devAddr) { - virNodeDevCapsDefPtr cap; + virNodeDevCapsDef *cap; cap = def->caps; while (cap) { @@ -372,7 +372,7 @@ virDomainDriverNodeDeviceGetPCIInfo(virNodeDeviceDefPtr def, int virDomainDriverNodeDeviceReset(virNodeDevicePtr dev, - virHostdevManagerPtr hostdevMgr) + virHostdevManager *hostdevMgr) { g_autoptr(virPCIDevice) pci = NULL; virPCIDeviceAddress devAddr; @@ -417,7 +417,7 @@ virDomainDriverNodeDeviceReset(virNodeDevicePtr dev, int virDomainDriverNodeDeviceReAttach(virNodeDevicePtr dev, - virHostdevManagerPtr hostdevMgr) + virHostdevManager *hostdevMgr) { g_autoptr(virPCIDevice) pci = NULL; virPCIDeviceAddress devAddr; @@ -461,7 +461,7 @@ virDomainDriverNodeDeviceReAttach(virNodeDevicePtr dev, int virDomainDriverNodeDeviceDetachFlags(virNodeDevicePtr dev, - virHostdevManagerPtr hostdevMgr, + virHostdevManager *hostdevMgr, const char *driverName) { g_autoptr(virPCIDevice) pci = NULL; diff --git a/src/hypervisor/domain_driver.h b/src/hypervisor/domain_driver.h index a22a3ee76c..5970eef082 100644 --- a/src/hypervisor/domain_driver.h +++ b/src/hypervisor/domain_driver.h @@ -35,28 +35,28 @@ virDomainDriverGenerateMachineName(const char *drivername, const char *name, bool privileged); -int virDomainDriverMergeBlkioDevice(virBlkioDevicePtr *dest_array, +int virDomainDriverMergeBlkioDevice(virBlkioDevice **dest_array, size_t *dest_size, - virBlkioDevicePtr src_array, + virBlkioDevice *src_array, size_t src_size, const char *type); int virDomainDriverParseBlkioDeviceStr(char *blkioDeviceStr, const char *type, - virBlkioDevicePtr *dev, size_t *size); + virBlkioDevice **dev, size_t *size); -int virDomainDriverSetupPersistentDefBlkioParams(virDomainDefPtr persistentDef, +int virDomainDriverSetupPersistentDefBlkioParams(virDomainDef *persistentDef, virTypedParameterPtr params, int nparams); -int virDomainDriverNodeDeviceGetPCIInfo(virNodeDeviceDefPtr def, - virPCIDeviceAddressPtr devAddr); +int virDomainDriverNodeDeviceGetPCIInfo(virNodeDeviceDef *def, + virPCIDeviceAddress *devAddr); int virDomainDriverNodeDeviceReset(virNodeDevicePtr dev, - virHostdevManagerPtr hostdevMgr); + virHostdevManager *hostdevMgr); int virDomainDriverNodeDeviceReAttach(virNodeDevicePtr dev, - virHostdevManagerPtr hostdevMgr); + virHostdevManager *hostdevMgr); int virDomainDriverNodeDeviceDetachFlags(virNodeDevicePtr dev, - virHostdevManagerPtr hostdevMgr, + virHostdevManager *hostdevMgr, const char *driverName); diff --git a/src/hypervisor/virclosecallbacks.c b/src/hypervisor/virclosecallbacks.c index 542dd61d01..b9d4940b60 100644 --- a/src/hypervisor/virclosecallbacks.c +++ b/src/hypervisor/virclosecallbacks.c @@ -30,7 +30,6 @@ VIR_LOG_INIT("util.closecallbacks"); typedef struct _virDriverCloseDef virDriverCloseDef; -typedef virDriverCloseDef *virDriverCloseDefPtr; struct _virDriverCloseDef { virConnectPtr conn; virCloseCallback cb; @@ -44,7 +43,7 @@ struct _virCloseCallbacks { }; -static virClassPtr virCloseCallbacksClass; +static virClass *virCloseCallbacksClass; static void virCloseCallbacksDispose(void *obj); static int virCloseCallbacksOnceInit(void) @@ -58,10 +57,10 @@ static int virCloseCallbacksOnceInit(void) VIR_ONCE_GLOBAL_INIT(virCloseCallbacks); -virCloseCallbacksPtr +virCloseCallbacks * virCloseCallbacksNew(void) { - virCloseCallbacksPtr closeCallbacks; + virCloseCallbacks *closeCallbacks; if (virCloseCallbacksInitialize() < 0) return NULL; @@ -81,19 +80,19 @@ virCloseCallbacksNew(void) static void virCloseCallbacksDispose(void *obj) { - virCloseCallbacksPtr closeCallbacks = obj; + virCloseCallbacks *closeCallbacks = obj; virHashFree(closeCallbacks->list); } int -virCloseCallbacksSet(virCloseCallbacksPtr closeCallbacks, - virDomainObjPtr vm, +virCloseCallbacksSet(virCloseCallbacks *closeCallbacks, + virDomainObj *vm, virConnectPtr conn, virCloseCallback cb) { char uuidstr[VIR_UUID_STRING_BUFLEN]; - virDriverCloseDefPtr closeDef; + virDriverCloseDef *closeDef; int ret = -1; virUUIDFormat(vm->def->uuid, uuidstr); @@ -138,12 +137,12 @@ virCloseCallbacksSet(virCloseCallbacksPtr closeCallbacks, } int -virCloseCallbacksUnset(virCloseCallbacksPtr closeCallbacks, - virDomainObjPtr vm, +virCloseCallbacksUnset(virCloseCallbacks *closeCallbacks, + virDomainObj *vm, virCloseCallback cb) { char uuidstr[VIR_UUID_STRING_BUFLEN]; - virDriverCloseDefPtr closeDef; + virDriverCloseDef *closeDef; int ret = -1; virUUIDFormat(vm->def->uuid, uuidstr); @@ -176,12 +175,12 @@ virCloseCallbacksUnset(virCloseCallbacksPtr closeCallbacks, } virCloseCallback -virCloseCallbacksGet(virCloseCallbacksPtr closeCallbacks, - virDomainObjPtr vm, +virCloseCallbacksGet(virCloseCallbacks *closeCallbacks, + virDomainObj *vm, virConnectPtr conn) { char uuidstr[VIR_UUID_STRING_BUFLEN]; - virDriverCloseDefPtr closeDef; + virDriverCloseDef *closeDef; virCloseCallback cb = NULL; virUUIDFormat(vm->def->uuid, uuidstr); @@ -201,11 +200,11 @@ virCloseCallbacksGet(virCloseCallbacksPtr closeCallbacks, } virConnectPtr -virCloseCallbacksGetConn(virCloseCallbacksPtr closeCallbacks, - virDomainObjPtr vm) +virCloseCallbacksGetConn(virCloseCallbacks *closeCallbacks, + virDomainObj *vm) { char uuidstr[VIR_UUID_STRING_BUFLEN]; - virDriverCloseDefPtr closeDef; + virDriverCloseDef *closeDef; virConnectPtr conn = NULL; virUUIDFormat(vm->def->uuid, uuidstr); @@ -225,22 +224,20 @@ virCloseCallbacksGetConn(virCloseCallbacksPtr closeCallbacks, typedef struct _virCloseCallbacksListEntry virCloseCallbacksListEntry; -typedef virCloseCallbacksListEntry *virCloseCallbacksListEntryPtr; struct _virCloseCallbacksListEntry { unsigned char uuid[VIR_UUID_BUFLEN]; virCloseCallback callback; }; typedef struct _virCloseCallbacksList virCloseCallbacksList; -typedef virCloseCallbacksList *virCloseCallbacksListPtr; struct _virCloseCallbacksList { size_t nentries; - virCloseCallbacksListEntryPtr entries; + virCloseCallbacksListEntry *entries; }; struct virCloseCallbacksData { virConnectPtr conn; - virCloseCallbacksListPtr list; + virCloseCallbacksList *list; }; static int @@ -249,7 +246,7 @@ virCloseCallbacksGetOne(void *payload, void *opaque) { struct virCloseCallbacksData *data = opaque; - virDriverCloseDefPtr closeDef = payload; + virDriverCloseDef *closeDef = payload; const char *uuidstr = key; unsigned char uuid[VIR_UUID_BUFLEN]; @@ -270,11 +267,11 @@ virCloseCallbacksGetOne(void *payload, return 0; } -static virCloseCallbacksListPtr -virCloseCallbacksGetForConn(virCloseCallbacksPtr closeCallbacks, +static virCloseCallbacksList * +virCloseCallbacksGetForConn(virCloseCallbacks *closeCallbacks, virConnectPtr conn) { - virCloseCallbacksListPtr list = NULL; + virCloseCallbacksList *list = NULL; struct virCloseCallbacksData data; list = g_new0(virCloseCallbacksList, 1); @@ -289,12 +286,12 @@ virCloseCallbacksGetForConn(virCloseCallbacksPtr closeCallbacks, void -virCloseCallbacksRun(virCloseCallbacksPtr closeCallbacks, +virCloseCallbacksRun(virCloseCallbacks *closeCallbacks, virConnectPtr conn, - virDomainObjListPtr domains, + virDomainObjList *domains, void *opaque) { - virCloseCallbacksListPtr list; + virCloseCallbacksList *list; size_t i; VIR_DEBUG("conn=%p", conn); @@ -319,7 +316,7 @@ virCloseCallbacksRun(virCloseCallbacksPtr closeCallbacks, virObjectUnlock(closeCallbacks); for (i = 0; i < list->nentries; i++) { - virDomainObjPtr vm; + virDomainObj *vm; /* Grab a ref and lock to the vm */ if (!(vm = virDomainObjListFindByUUID(domains, diff --git a/src/hypervisor/virclosecallbacks.h b/src/hypervisor/virclosecallbacks.h index 98fc2c4a94..97be25b781 100644 --- a/src/hypervisor/virclosecallbacks.h +++ b/src/hypervisor/virclosecallbacks.h @@ -23,28 +23,27 @@ #include "conf/virdomainobjlist.h" typedef struct _virCloseCallbacks virCloseCallbacks; -typedef virCloseCallbacks *virCloseCallbacksPtr; -typedef void (*virCloseCallback)(virDomainObjPtr vm, +typedef void (*virCloseCallback)(virDomainObj *vm, virConnectPtr conn, void *opaque); -virCloseCallbacksPtr virCloseCallbacksNew(void); -int virCloseCallbacksSet(virCloseCallbacksPtr closeCallbacks, - virDomainObjPtr vm, +virCloseCallbacks *virCloseCallbacksNew(void); +int virCloseCallbacksSet(virCloseCallbacks *closeCallbacks, + virDomainObj *vm, virConnectPtr conn, virCloseCallback cb); -int virCloseCallbacksUnset(virCloseCallbacksPtr closeCallbacks, - virDomainObjPtr vm, +int virCloseCallbacksUnset(virCloseCallbacks *closeCallbacks, + virDomainObj *vm, virCloseCallback cb); virCloseCallback -virCloseCallbacksGet(virCloseCallbacksPtr closeCallbacks, - virDomainObjPtr vm, +virCloseCallbacksGet(virCloseCallbacks *closeCallbacks, + virDomainObj *vm, virConnectPtr conn); virConnectPtr -virCloseCallbacksGetConn(virCloseCallbacksPtr closeCallbacks, - virDomainObjPtr vm); +virCloseCallbacksGetConn(virCloseCallbacks *closeCallbacks, + virDomainObj *vm); void -virCloseCallbacksRun(virCloseCallbacksPtr closeCallbacks, +virCloseCallbacksRun(virCloseCallbacks *closeCallbacks, virConnectPtr conn, - virDomainObjListPtr domains, + virDomainObjList *domains, void *opaque); diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c index a3ec63138e..14ea560309 100644 --- a/src/hypervisor/virhostdev.c +++ b/src/hypervisor/virhostdev.c @@ -42,14 +42,14 @@ VIR_LOG_INIT("util.hostdev"); #define HOSTDEV_STATE_DIR RUNSTATEDIR "/libvirt/hostdevmgr" -static virHostdevManagerPtr manager; /* global hostdev manager, never freed */ +static virHostdevManager *manager; /* global hostdev manager, never freed */ -static virClassPtr virHostdevManagerClass; +static virClass *virHostdevManagerClass; static void virHostdevManagerDispose(void *obj); -static virHostdevManagerPtr virHostdevManagerNew(void); +static virHostdevManager *virHostdevManagerNew(void); struct virHostdevIsPCINodeDeviceUsedData { - virHostdevManagerPtr mgr; + virHostdevManager *mgr; const char *driverName; const char *domainName; bool usesVFIO; @@ -76,9 +76,9 @@ struct virHostdevIsPCINodeDeviceUsedData { * module usually expect an 'actual'. Even with these conventions in place, * adding comments to highlight ownership-related issues is recommended */ -static int virHostdevIsPCINodeDeviceUsed(virPCIDeviceAddressPtr devAddr, void *opaque) +static int virHostdevIsPCINodeDeviceUsed(virPCIDeviceAddress *devAddr, void *opaque) { - virPCIDevicePtr actual; + virPCIDevice *actual; struct virHostdevIsPCINodeDeviceUsedData *helperData = opaque; actual = virPCIDeviceListFindByIDs(helperData->mgr->activePCIHostdevs, @@ -126,7 +126,7 @@ VIR_ONCE_GLOBAL_INIT(virHostdevManager); static void virHostdevManagerDispose(void *obj) { - virHostdevManagerPtr hostdevMgr = obj; + virHostdevManager *hostdevMgr = obj; virObjectUnref(hostdevMgr->activePCIHostdevs); virObjectUnref(hostdevMgr->inactivePCIHostdevs); @@ -138,7 +138,7 @@ virHostdevManagerDispose(void *obj) g_free(hostdevMgr->stateDir); } -static virHostdevManagerPtr +static virHostdevManager * virHostdevManagerNew(void) { g_autoptr(virHostdevManager) hostdevMgr = NULL; @@ -200,7 +200,7 @@ virHostdevManagerNew(void) return g_steal_pointer(&hostdevMgr); } -virHostdevManagerPtr +virHostdevManager * virHostdevManagerGetDefault(void) { if (virHostdevManagerInitialize() < 0) @@ -225,7 +225,7 @@ virHostdevManagerGetDefault(void) */ static int virHostdevGetPCIHostDevice(const virDomainHostdevDef *hostdev, - virPCIDevicePtr *pci) + virPCIDevice **pci) { g_autoptr(virPCIDevice) actual = NULL; const virDomainHostdevSubsysPCI *pcisrc = &hostdev->source.subsys.u.pci; @@ -261,8 +261,8 @@ virHostdevGetPCIHostDevice(const virDomainHostdevDef *hostdev, return 0; } -static virPCIDeviceListPtr -virHostdevGetPCIHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs) +static virPCIDeviceList * +virHostdevGetPCIHostDeviceList(virDomainHostdevDef **hostdevs, int nhostdevs) { g_autoptr(virPCIDeviceList) pcidevs = NULL; size_t i; @@ -271,7 +271,7 @@ virHostdevGetPCIHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs) return NULL; for (i = 0; i < nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = hostdevs[i]; + virDomainHostdevDef *hostdev = hostdevs[i]; g_autoptr(virPCIDevice) pci = NULL; if (virHostdevGetPCIHostDevice(hostdev, &pci) == -1) @@ -290,7 +290,7 @@ virHostdevGetPCIHostDeviceList(virDomainHostdevDefPtr *hostdevs, int nhostdevs) static int -virHostdevPCISysfsPath(virDomainHostdevDefPtr hostdev, +virHostdevPCISysfsPath(virDomainHostdevDef *hostdev, char **sysfs_path) { return virPCIDeviceAddressGetSysfsFile(&hostdev->source.subsys.u.pci.addr, sysfs_path); @@ -298,7 +298,7 @@ virHostdevPCISysfsPath(virDomainHostdevDefPtr hostdev, static int -virHostdevIsVirtualFunction(virDomainHostdevDefPtr hostdev) +virHostdevIsVirtualFunction(virDomainHostdevDef *hostdev) { g_autofree char *sysfs_path = NULL; @@ -310,7 +310,7 @@ virHostdevIsVirtualFunction(virDomainHostdevDefPtr hostdev) static int -virHostdevNetDevice(virDomainHostdevDefPtr hostdev, +virHostdevNetDevice(virDomainHostdevDef *hostdev, int pfNetDevIdx, char **linkdev, int *vf) @@ -416,7 +416,7 @@ virHostdevNetConfigVirtPortProfile(const char *linkdev, int vf, * Returns 0 on success, -1 on failure. */ static int -virHostdevSaveNetConfig(virDomainHostdevDefPtr hostdev, +virHostdevSaveNetConfig(virDomainHostdevDef *hostdev, const char *stateDir) { g_autofree char *linkdev = NULL; @@ -455,7 +455,7 @@ virHostdevSaveNetConfig(virDomainHostdevDefPtr hostdev, * Returns 0 on success, -1 on failure. */ static int -virHostdevSetNetConfig(virDomainHostdevDefPtr hostdev, +virHostdevSetNetConfig(virDomainHostdevDef *hostdev, const unsigned char *uuid) { g_autofree char *linkdev = NULL; @@ -495,12 +495,12 @@ virHostdevSetNetConfig(virDomainHostdevDefPtr hostdev, static int -virHostdevRestoreNetConfig(virDomainHostdevDefPtr hostdev, +virHostdevRestoreNetConfig(virDomainHostdevDef *hostdev, const char *stateDir) { g_autofree char *linkdev = NULL; - g_autofree virMacAddrPtr MAC = NULL; - g_autofree virMacAddrPtr adminMAC = NULL; + g_autofree virMacAddr *MAC = NULL; + g_autofree virMacAddr *adminMAC = NULL; g_autoptr(virNetDevVlan) vlan = NULL; const virNetDevVPortProfile *virtPort; int vf = -1; @@ -597,14 +597,14 @@ virHostdevRestoreNetConfig(virDomainHostdevDefPtr hostdev, } static int -virHostdevResetAllPCIDevices(virHostdevManagerPtr mgr, - virPCIDeviceListPtr pcidevs) +virHostdevResetAllPCIDevices(virHostdevManager *mgr, + virPCIDeviceList *pcidevs) { int ret = 0; size_t i; for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) { - virPCIDevicePtr pci = virPCIDeviceListGet(pcidevs, i); + virPCIDevice *pci = virPCIDeviceListGet(pcidevs, i); /* We can avoid looking up the actual device here, because performing * a PCI reset on a device doesn't require any information other than @@ -622,14 +622,14 @@ virHostdevResetAllPCIDevices(virHostdevManagerPtr mgr, } static void -virHostdevReattachAllPCIDevices(virHostdevManagerPtr mgr, - virPCIDeviceListPtr pcidevs) +virHostdevReattachAllPCIDevices(virHostdevManager *mgr, + virPCIDeviceList *pcidevs) { size_t i; for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) { - virPCIDevicePtr pci = virPCIDeviceListGet(pcidevs, i); - virPCIDevicePtr actual; + virPCIDevice *pci = virPCIDeviceListGet(pcidevs, i); + virPCIDevice *actual; /* We need to look up the actual device because that's what * virPCIDeviceReattach() expects as its argument */ @@ -655,19 +655,19 @@ virHostdevReattachAllPCIDevices(virHostdevManagerPtr mgr, static int -virHostdevPreparePCIDevicesImpl(virHostdevManagerPtr mgr, +virHostdevPreparePCIDevicesImpl(virHostdevManager *mgr, const char *drv_name, const char *dom_name, const unsigned char *uuid, - virPCIDeviceListPtr pcidevs, - virDomainHostdevDefPtr *hostdevs, + virPCIDeviceList *pcidevs, + virDomainHostdevDef **hostdevs, int nhostdevs, unsigned int flags) { int last_processed_hostdev_vf = -1; size_t i; int ret = -1; - virPCIDeviceAddressPtr devAddr = NULL; + virPCIDeviceAddress *devAddr = NULL; virObjectLock(mgr->activePCIHostdevs); virObjectLock(mgr->inactivePCIHostdevs); @@ -682,7 +682,7 @@ virHostdevPreparePCIDevicesImpl(virHostdevManagerPtr mgr, /* Step 1: Perform some initial checks on the devices */ for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) { - virPCIDevicePtr pci = virPCIDeviceListGet(pcidevs, i); + virPCIDevice *pci = virPCIDeviceListGet(pcidevs, i); bool strict_acs_check = !!(flags & VIR_HOSTDEV_STRICT_ACS_CHECK); bool usesVFIO = (virPCIDeviceGetStubDriver(pci) == VIR_PCI_STUB_DRIVER_VFIO); struct virHostdevIsPCINodeDeviceUsedData data = {mgr, drv_name, dom_name, false}; @@ -733,7 +733,7 @@ virHostdevPreparePCIDevicesImpl(virHostdevManagerPtr mgr, /* Step 2: detach managed devices and make sure unmanaged devices * have already been taken care of */ for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) { - virPCIDevicePtr pci = virPCIDeviceListGet(pcidevs, i); + virPCIDevice *pci = virPCIDeviceListGet(pcidevs, i); if (virPCIDeviceGetManaged(pci)) { @@ -817,8 +817,8 @@ virHostdevPreparePCIDevicesImpl(virHostdevManagerPtr mgr, /* Step 5: Move devices from the inactive list to the active list */ for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) { - virPCIDevicePtr pci = virPCIDeviceListGet(pcidevs, i); - virPCIDevicePtr actual; + virPCIDevice *pci = virPCIDeviceListGet(pcidevs, i); + virPCIDevice *actual; VIR_DEBUG("Removing PCI device %s from inactive list", virPCIDeviceGetName(pci)); @@ -832,8 +832,8 @@ virHostdevPreparePCIDevicesImpl(virHostdevManagerPtr mgr, /* Step 6: Set driver and domain information */ for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) { - virPCIDevicePtr pci; - virPCIDevicePtr actual; + virPCIDevice *pci; + virPCIDevice *actual; /* We need to look up the actual device and set the information * there because 'pci' only contain address information and will @@ -850,9 +850,9 @@ virHostdevPreparePCIDevicesImpl(virHostdevManagerPtr mgr, /* Step 7: Now set the original states for hostdev def */ for (i = 0; i < nhostdevs; i++) { - virPCIDevicePtr actual; - virDomainHostdevDefPtr hostdev = hostdevs[i]; - virDomainHostdevSubsysPCIPtr pcisrc = &hostdev->source.subsys.u.pci; + virPCIDevice *actual; + virDomainHostdevDef *hostdev = hostdevs[i]; + virDomainHostdevSubsysPCI *pcisrc = &hostdev->source.subsys.u.pci; if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) continue; @@ -890,8 +890,8 @@ virHostdevPreparePCIDevicesImpl(virHostdevManagerPtr mgr, /* Move devices back to the inactive list so that they can be * processed properly below (reattachdevs label) */ for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) { - virPCIDevicePtr pci = virPCIDeviceListGet(pcidevs, i); - virPCIDevicePtr actual; + virPCIDevice *pci = virPCIDeviceListGet(pcidevs, i); + virPCIDevice *actual; VIR_DEBUG("Removing PCI device %s from active list", virPCIDeviceGetName(pci)); @@ -924,11 +924,11 @@ virHostdevPreparePCIDevicesImpl(virHostdevManagerPtr mgr, int -virHostdevPreparePCIDevices(virHostdevManagerPtr mgr, +virHostdevPreparePCIDevices(virHostdevManager *mgr, const char *drv_name, const char *dom_name, const unsigned char *uuid, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs, unsigned int flags) { @@ -946,11 +946,11 @@ virHostdevPreparePCIDevices(virHostdevManagerPtr mgr, static void -virHostdevReAttachPCIDevicesImpl(virHostdevManagerPtr mgr, +virHostdevReAttachPCIDevicesImpl(virHostdevManager *mgr, const char *drv_name, const char *dom_name, - virPCIDeviceListPtr pcidevs, - virDomainHostdevDefPtr *hostdevs, + virPCIDeviceList *pcidevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { size_t i; @@ -965,8 +965,8 @@ virHostdevReAttachPCIDevicesImpl(virHostdevManagerPtr mgr, * used by the current domain and driver */ i = 0; while (i < virPCIDeviceListCount(pcidevs)) { - virPCIDevicePtr pci = virPCIDeviceListGet(pcidevs, i); - virPCIDevicePtr actual = NULL; + virPCIDevice *pci = virPCIDeviceListGet(pcidevs, i); + virPCIDevice *actual = NULL; /* We need to look up the actual device, which is the one containing * information such as by which domain and driver it is used. As a @@ -994,8 +994,8 @@ virHostdevReAttachPCIDevicesImpl(virHostdevManagerPtr mgr, /* Step 2: Move devices from the active list to the inactive list */ for (i = 0; i < virPCIDeviceListCount(pcidevs); i++) { - virPCIDevicePtr pci = virPCIDeviceListGet(pcidevs, i); - virPCIDevicePtr actual; + virPCIDevice *pci = virPCIDeviceListGet(pcidevs, i); + virPCIDevice *actual; VIR_DEBUG("Removing PCI device %s from active list", virPCIDeviceGetName(pci)); @@ -1020,11 +1020,11 @@ virHostdevReAttachPCIDevicesImpl(virHostdevManagerPtr mgr, * */ for (i = 0; i < nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = hostdevs[i]; + virDomainHostdevDef *hostdev = hostdevs[i]; if (virHostdevIsPCINetDevice(hostdev)) { - virDomainHostdevSubsysPCIPtr pcisrc = &hostdev->source.subsys.u.pci; - virPCIDevicePtr actual; + virDomainHostdevSubsysPCI *pcisrc = &hostdev->source.subsys.u.pci; + virPCIDevice *actual; actual = virPCIDeviceListFindByIDs(mgr->inactivePCIHostdevs, pcisrc->addr.domain, @@ -1053,8 +1053,8 @@ virHostdevReAttachPCIDevicesImpl(virHostdevManagerPtr mgr, static void -virHostdevDeleteMissingPCIDevices(virHostdevManagerPtr mgr, - virDomainHostdevDefPtr *hostdevs, +virHostdevDeleteMissingPCIDevices(virHostdevManager *mgr, + virDomainHostdevDef **hostdevs, int nhostdevs) { size_t i; @@ -1087,10 +1087,10 @@ virHostdevDeleteMissingPCIDevices(virHostdevManagerPtr mgr, void -virHostdevReAttachPCIDevices(virHostdevManagerPtr mgr, +virHostdevReAttachPCIDevices(virHostdevManager *mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { g_autoptr(virPCIDeviceList) pcidevs = NULL; @@ -1115,8 +1115,8 @@ virHostdevReAttachPCIDevices(virHostdevManagerPtr mgr, int -virHostdevUpdateActivePCIDevices(virHostdevManagerPtr mgr, - virDomainHostdevDefPtr *hostdevs, +virHostdevUpdateActivePCIDevices(virHostdevManager *mgr, + virDomainHostdevDef **hostdevs, int nhostdevs, const char *drv_name, const char *dom_name) @@ -1161,13 +1161,13 @@ virHostdevUpdateActivePCIDevices(virHostdevManagerPtr mgr, } int -virHostdevUpdateActiveUSBDevices(virHostdevManagerPtr mgr, - virDomainHostdevDefPtr *hostdevs, +virHostdevUpdateActiveUSBDevices(virHostdevManager *mgr, + virDomainHostdevDef **hostdevs, int nhostdevs, const char *drv_name, const char *dom_name) { - virDomainHostdevDefPtr hostdev = NULL; + virDomainHostdevDef *hostdev = NULL; size_t i; int ret = -1; @@ -1176,7 +1176,7 @@ virHostdevUpdateActiveUSBDevices(virHostdevManagerPtr mgr, virObjectLock(mgr->activeUSBHostdevs); for (i = 0; i < nhostdevs; i++) { - virDomainHostdevSubsysUSBPtr usbsrc; + virDomainHostdevSubsysUSB *usbsrc; g_autoptr(virUSBDevice) usb = NULL; hostdev = hostdevs[i]; usbsrc = &hostdev->source.subsys.u.usb; @@ -1205,15 +1205,15 @@ virHostdevUpdateActiveUSBDevices(virHostdevManagerPtr mgr, } static int -virHostdevUpdateActiveSCSIHostDevices(virHostdevManagerPtr mgr, - virDomainHostdevDefPtr hostdev, - virDomainHostdevSubsysSCSIPtr scsisrc, +virHostdevUpdateActiveSCSIHostDevices(virHostdevManager *mgr, + virDomainHostdevDef *hostdev, + virDomainHostdevSubsysSCSI *scsisrc, const char *drv_name, const char *dom_name) { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; g_autoptr(virSCSIDevice) scsi = NULL; - virSCSIDevicePtr tmp = NULL; + virSCSIDevice *tmp = NULL; if (!(scsi = virSCSIDeviceNew(NULL, scsihostsrc->adapter, scsihostsrc->bus, @@ -1234,13 +1234,13 @@ virHostdevUpdateActiveSCSIHostDevices(virHostdevManagerPtr mgr, } int -virHostdevUpdateActiveSCSIDevices(virHostdevManagerPtr mgr, - virDomainHostdevDefPtr *hostdevs, +virHostdevUpdateActiveSCSIDevices(virHostdevManager *mgr, + virDomainHostdevDef **hostdevs, int nhostdevs, const char *drv_name, const char *dom_name) { - virDomainHostdevDefPtr hostdev = NULL; + virDomainHostdevDef *hostdev = NULL; size_t i; int ret = -1; @@ -1249,7 +1249,7 @@ virHostdevUpdateActiveSCSIDevices(virHostdevManagerPtr mgr, virObjectLock(mgr->activeSCSIHostdevs); for (i = 0; i < nhostdevs; i++) { - virDomainHostdevSubsysSCSIPtr scsisrc; + virDomainHostdevSubsysSCSI *scsisrc; hostdev = hostdevs[i]; scsisrc = &hostdev->source.subsys.u.scsi; @@ -1273,8 +1273,8 @@ virHostdevUpdateActiveSCSIDevices(virHostdevManagerPtr mgr, int -virHostdevUpdateActiveMediatedDevices(virHostdevManagerPtr mgr, - virDomainHostdevDefPtr *hostdevs, +virHostdevUpdateActiveMediatedDevices(virHostdevManager *mgr, + virDomainHostdevDef **hostdevs, int nhostdevs, const char *drv_name, const char *dom_name) @@ -1288,8 +1288,8 @@ virHostdevUpdateActiveMediatedDevices(virHostdevManagerPtr mgr, virObjectLock(mgr->activeMediatedHostdevs); for (i = 0; i < nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = hostdevs[i]; - virDomainHostdevSubsysMediatedDevPtr mdevsrc; + virDomainHostdevDef *hostdev = hostdevs[i]; + virDomainHostdevSubsysMediatedDev *mdevsrc; mdevsrc = &hostdev->source.subsys.u.mdev; @@ -1313,20 +1313,20 @@ virHostdevUpdateActiveMediatedDevices(virHostdevManagerPtr mgr, static int -virHostdevMarkUSBDevices(virHostdevManagerPtr mgr, +virHostdevMarkUSBDevices(virHostdevManager *mgr, const char *drv_name, const char *dom_name, - virUSBDeviceListPtr list) + virUSBDeviceList *list) { size_t i, j; unsigned int count; - virUSBDevicePtr tmp; + virUSBDevice *tmp; virObjectLock(mgr->activeUSBHostdevs); count = virUSBDeviceListCount(list); for (i = 0; i < count; i++) { - virUSBDevicePtr usb = virUSBDeviceListGet(list, i); + virUSBDevice *usb = virUSBDeviceListGet(list, i); if ((tmp = virUSBDeviceListFind(mgr->activeUSBHostdevs, usb))) { const char *other_drvname; const char *other_domname; @@ -1372,11 +1372,11 @@ virHostdevMarkUSBDevices(virHostdevManagerPtr mgr, int -virHostdevFindUSBDevice(virDomainHostdevDefPtr hostdev, +virHostdevFindUSBDevice(virDomainHostdevDef *hostdev, bool mandatory, - virUSBDevicePtr *usb) + virUSBDevice **usb) { - virDomainHostdevSubsysUSBPtr usbsrc = &hostdev->source.subsys.u.usb; + virDomainHostdevSubsysUSB *usbsrc = &hostdev->source.subsys.u.usb; unsigned vendor = usbsrc->vendor; unsigned product = usbsrc->product; unsigned bus = usbsrc->bus; @@ -1455,16 +1455,16 @@ virHostdevFindUSBDevice(virDomainHostdevDefPtr hostdev, } int -virHostdevPrepareUSBDevices(virHostdevManagerPtr mgr, +virHostdevPrepareUSBDevices(virHostdevManager *mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs, unsigned int flags) { size_t i; g_autoptr(virUSBDeviceList) list = NULL; - virUSBDevicePtr tmp; + virUSBDevice *tmp; bool coldBoot = !!(flags & VIR_HOSTDEV_COLD_BOOT); if (!nhostdevs) @@ -1481,7 +1481,7 @@ virHostdevPrepareUSBDevices(virHostdevManagerPtr mgr, /* Loop 1: build temporary list */ for (i = 0; i < nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = hostdevs[i]; + virDomainHostdevDef *hostdev = hostdevs[i]; bool required = true; g_autoptr(virUSBDevice) usb = NULL; @@ -1523,11 +1523,11 @@ virHostdevPrepareUSBDevices(virHostdevManagerPtr mgr, } static int -virHostdevPrepareSCSIHostDevices(virDomainHostdevDefPtr hostdev, - virDomainHostdevSubsysSCSIPtr scsisrc, - virSCSIDeviceListPtr list) +virHostdevPrepareSCSIHostDevices(virDomainHostdevDef *hostdev, + virDomainHostdevSubsysSCSI *scsisrc, + virSCSIDeviceList *list) { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; g_autoptr(virSCSIDevice) scsi = NULL; if (hostdev->managed) { @@ -1550,16 +1550,16 @@ virHostdevPrepareSCSIHostDevices(virDomainHostdevDefPtr hostdev, } int -virHostdevPrepareSCSIDevices(virHostdevManagerPtr mgr, +virHostdevPrepareSCSIDevices(virHostdevManager *mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { size_t i, j; int count; g_autoptr(virSCSIDeviceList) list = NULL; - virSCSIDevicePtr tmp; + virSCSIDevice *tmp; if (!nhostdevs) return 0; @@ -1574,8 +1574,8 @@ virHostdevPrepareSCSIDevices(virHostdevManagerPtr mgr, /* Loop 1: build temporary list */ for (i = 0; i < nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = hostdevs[i]; - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; + virDomainHostdevDef *hostdev = hostdevs[i]; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; if (!virHostdevIsSCSIDevice(hostdev)) continue; @@ -1596,7 +1596,7 @@ virHostdevPrepareSCSIDevices(virHostdevManagerPtr mgr, count = virSCSIDeviceListCount(list); for (i = 0; i < count; i++) { - virSCSIDevicePtr scsi = virSCSIDeviceListGet(list, i); + virSCSIDevice *scsi = virSCSIDeviceListGet(list, i); if ((tmp = virSCSIDeviceListFind(mgr->activeSCSIHostdevs, scsi))) { bool scsi_shareable = virSCSIDeviceGetShareable(scsi); @@ -1647,14 +1647,14 @@ virHostdevPrepareSCSIDevices(virHostdevManagerPtr mgr, } int -virHostdevPrepareSCSIVHostDevices(virHostdevManagerPtr mgr, +virHostdevPrepareSCSIVHostDevices(virHostdevManager *mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { g_autoptr(virSCSIVHostDeviceList) list = NULL; - virSCSIVHostDevicePtr tmp; + virSCSIVHostDevice *tmp; size_t i, j; if (!nhostdevs) @@ -1670,8 +1670,8 @@ virHostdevPrepareSCSIVHostDevices(virHostdevManagerPtr mgr, /* Loop 1: build temporary list */ for (i = 0; i < nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = hostdevs[i]; - virDomainHostdevSubsysSCSIVHostPtr hostsrc = &hostdev->source.subsys.u.scsi_host; + virDomainHostdevDef *hostdev = hostdevs[i]; + virDomainHostdevSubsysSCSIVHost *hostsrc = &hostdev->source.subsys.u.scsi_host; g_autoptr(virSCSIVHostDevice) host = NULL; if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS || @@ -1732,10 +1732,10 @@ virHostdevPrepareSCSIVHostDevices(virHostdevManagerPtr mgr, int -virHostdevPrepareMediatedDevices(virHostdevManagerPtr mgr, +virHostdevPrepareMediatedDevices(virHostdevManager *mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { size_t i; @@ -1753,8 +1753,8 @@ virHostdevPrepareMediatedDevices(virHostdevManagerPtr mgr, /* Loop 1: Build a temporary list of ALL mediated devices. */ for (i = 0; i < nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = hostdevs[i]; - virDomainHostdevSubsysMediatedDevPtr src = &hostdev->source.subsys.u.mdev; + virDomainHostdevDef *hostdev = hostdevs[i]; + virDomainHostdevSubsysMediatedDev *src = &hostdev->source.subsys.u.mdev; g_autoptr(virMediatedDevice) mdev = NULL; if (!virHostdevIsMdevDevice(hostdev)) @@ -1780,7 +1780,7 @@ virHostdevPrepareMediatedDevices(virHostdevManagerPtr mgr, * in cleanup label. */ while (virMediatedDeviceListCount(list) > 0) { - virMediatedDevicePtr tmp = virMediatedDeviceListGet(list, 0); + virMediatedDevice *tmp = virMediatedDeviceListGet(list, 0); virMediatedDeviceListSteal(list, tmp); } @@ -1788,10 +1788,10 @@ virHostdevPrepareMediatedDevices(virHostdevManagerPtr mgr, } void -virHostdevReAttachUSBDevices(virHostdevManagerPtr mgr, +virHostdevReAttachUSBDevices(virHostdevManager *mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { size_t i; @@ -1801,10 +1801,10 @@ virHostdevReAttachUSBDevices(virHostdevManagerPtr mgr, virObjectLock(mgr->activeUSBHostdevs); for (i = 0; i < nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = hostdevs[i]; - virDomainHostdevSubsysUSBPtr usbsrc = &hostdev->source.subsys.u.usb; + virDomainHostdevDef *hostdev = hostdevs[i]; + virDomainHostdevSubsysUSB *usbsrc = &hostdev->source.subsys.u.usb; g_autoptr(virUSBDevice) usb = NULL; - virUSBDevicePtr tmp; + virUSBDevice *tmp; const char *usedby_drvname; const char *usedby_domname; @@ -1848,15 +1848,15 @@ virHostdevReAttachUSBDevices(virHostdevManagerPtr mgr, } static void -virHostdevReAttachSCSIHostDevices(virHostdevManagerPtr mgr, - virDomainHostdevDefPtr hostdev, - virDomainHostdevSubsysSCSIPtr scsisrc, +virHostdevReAttachSCSIHostDevices(virHostdevManager *mgr, + virDomainHostdevDef *hostdev, + virDomainHostdevSubsysSCSI *scsisrc, const char *drv_name, const char *dom_name) { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; g_autoptr(virSCSIDevice) scsi = NULL; - virSCSIDevicePtr tmp; + virSCSIDevice *tmp; if (!(scsi = virSCSIDeviceNew(NULL, scsihostsrc->adapter, scsihostsrc->bus, @@ -1888,10 +1888,10 @@ virHostdevReAttachSCSIHostDevices(virHostdevManagerPtr mgr, } void -virHostdevReAttachSCSIDevices(virHostdevManagerPtr mgr, +virHostdevReAttachSCSIDevices(virHostdevManager *mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { size_t i; @@ -1901,8 +1901,8 @@ virHostdevReAttachSCSIDevices(virHostdevManagerPtr mgr, virObjectLock(mgr->activeSCSIHostdevs); for (i = 0; i < nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = hostdevs[i]; - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; + virDomainHostdevDef *hostdev = hostdevs[i]; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; if (!virHostdevIsSCSIDevice(hostdev)) continue; @@ -1917,10 +1917,10 @@ virHostdevReAttachSCSIDevices(virHostdevManagerPtr mgr, } void -virHostdevReAttachSCSIVHostDevices(virHostdevManagerPtr mgr, +virHostdevReAttachSCSIVHostDevices(virHostdevManager *mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { size_t i; @@ -1931,9 +1931,9 @@ virHostdevReAttachSCSIVHostDevices(virHostdevManagerPtr mgr, virObjectLock(mgr->activeSCSIVHostHostdevs); for (i = 0; i < nhostdevs; i++) { g_autoptr(virSCSIVHostDevice) host = NULL; - virSCSIVHostDevicePtr tmp; - virDomainHostdevDefPtr hostdev = hostdevs[i]; - virDomainHostdevSubsysSCSIVHostPtr hostsrc = &hostdev->source.subsys.u.scsi_host; + virSCSIVHostDevice *tmp; + virDomainHostdevDef *hostdev = hostdevs[i]; + virDomainHostdevSubsysSCSIVHost *hostsrc = &hostdev->source.subsys.u.scsi_host; const char *usedby_drvname; const char *usedby_domname; @@ -1984,10 +1984,10 @@ virHostdevReAttachSCSIVHostDevices(virHostdevManagerPtr mgr, * list of active host devices. */ void -virHostdevReAttachMediatedDevices(virHostdevManagerPtr mgr, +virHostdevReAttachMediatedDevices(virHostdevManager *mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { const char *used_by_drvname = NULL; @@ -2000,9 +2000,9 @@ virHostdevReAttachMediatedDevices(virHostdevManagerPtr mgr, virObjectLock(mgr->activeMediatedHostdevs); for (i = 0; i < nhostdevs; i++) { g_autofree char *sysfspath = NULL; - virMediatedDevicePtr tmp; - virDomainHostdevSubsysMediatedDevPtr mdevsrc; - virDomainHostdevDefPtr hostdev = hostdevs[i]; + virMediatedDevice *tmp; + virDomainHostdevSubsysMediatedDev *mdevsrc; + virDomainHostdevDef *hostdev = hostdevs[i]; if (!virHostdevIsMdevDevice(hostdev)) continue; @@ -2031,8 +2031,8 @@ virHostdevReAttachMediatedDevices(virHostdevManagerPtr mgr, } int -virHostdevPCINodeDeviceDetach(virHostdevManagerPtr mgr, - virPCIDevicePtr pci) +virHostdevPCINodeDeviceDetach(virHostdevManager *mgr, + virPCIDevice *pci) { struct virHostdevIsPCINodeDeviceUsedData data = {mgr, NULL, NULL, false}; int ret = -1; @@ -2057,8 +2057,8 @@ virHostdevPCINodeDeviceDetach(virHostdevManagerPtr mgr, } int -virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr mgr, - virPCIDevicePtr pci) +virHostdevPCINodeDeviceReAttach(virHostdevManager *mgr, + virPCIDevice *pci) { struct virHostdevIsPCINodeDeviceUsedData data = {mgr, NULL, NULL, false}; int ret = -1; @@ -2087,8 +2087,8 @@ virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr mgr, } int -virHostdevPCINodeDeviceReset(virHostdevManagerPtr mgr, - virPCIDevicePtr pci) +virHostdevPCINodeDeviceReset(virHostdevManager *mgr, + virPCIDevice *pci) { int ret = -1; @@ -2106,9 +2106,9 @@ virHostdevPCINodeDeviceReset(virHostdevManagerPtr mgr, } int -virHostdevPrepareDomainDevices(virHostdevManagerPtr mgr, +virHostdevPrepareDomainDevices(virHostdevManager *mgr, const char *driver, - virDomainDefPtr def, + virDomainDef *def, unsigned int flags) { if (!def->nhostdevs) @@ -2146,9 +2146,9 @@ virHostdevPrepareDomainDevices(virHostdevManagerPtr mgr, } void -virHostdevReAttachDomainDevices(virHostdevManagerPtr mgr, +virHostdevReAttachDomainDevices(virHostdevManager *mgr, const char *driver, - virDomainDefPtr def, + virDomainDef *def, unsigned int flags) { if (!def->nhostdevs || !mgr) @@ -2171,9 +2171,9 @@ virHostdevReAttachDomainDevices(virHostdevManagerPtr mgr, } int -virHostdevUpdateActiveDomainDevices(virHostdevManagerPtr mgr, +virHostdevUpdateActiveDomainDevices(virHostdevManager *mgr, const char *driver, - virDomainDefPtr def, + virDomainDef *def, unsigned int flags) { if (!def->nhostdevs) @@ -2208,12 +2208,12 @@ virHostdevUpdateActiveDomainDevices(virHostdevManagerPtr mgr, static int -virHostdevGetNVMeDeviceList(virNVMeDeviceListPtr nvmeDevices, - virStorageSourcePtr src, +virHostdevGetNVMeDeviceList(virNVMeDeviceList *nvmeDevices, + virStorageSource *src, const char *drv_name, const char *dom_name) { - virStorageSourcePtr n; + virStorageSource *n; for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) { g_autoptr(virNVMeDevice) dev = NULL; @@ -2238,15 +2238,15 @@ virHostdevGetNVMeDeviceList(virNVMeDeviceListPtr nvmeDevices, int -virHostdevPrepareOneNVMeDevice(virHostdevManagerPtr hostdev_mgr, +virHostdevPrepareOneNVMeDevice(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virStorageSourcePtr src) + virStorageSource *src) { g_autoptr(virNVMeDeviceList) nvmeDevices = NULL; g_autoptr(virPCIDeviceList) pciDevices = NULL; const unsigned int pciFlags = 0; - virNVMeDevicePtr temp = NULL; + virNVMeDevice *temp = NULL; size_t i; ssize_t lastGoodNVMeIdx = -1; int ret = -1; @@ -2292,7 +2292,7 @@ virHostdevPrepareOneNVMeDevice(virHostdevManagerPtr hostdev_mgr, /* Let's check if all PCI devices are NVMe disks. */ for (i = 0; i < virPCIDeviceListCount(pciDevices); i++) { - virPCIDevicePtr pci = virPCIDeviceListGet(pciDevices, i); + virPCIDevice *pci = virPCIDeviceListGet(pciDevices, i); g_autofree char *drvPath = NULL; g_autofree char *drvName = NULL; int stub = VIR_PCI_STUB_DRIVER_NONE; @@ -2347,10 +2347,10 @@ virHostdevPrepareOneNVMeDevice(virHostdevManagerPtr hostdev_mgr, int -virHostdevPrepareNVMeDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevPrepareNVMeDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainDiskDefPtr *disks, + virDomainDiskDef **disks, size_t ndisks) { size_t i; @@ -2382,10 +2382,10 @@ virHostdevPrepareNVMeDevices(virHostdevManagerPtr hostdev_mgr, int -virHostdevReAttachOneNVMeDevice(virHostdevManagerPtr hostdev_mgr, +virHostdevReAttachOneNVMeDevice(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virStorageSourcePtr src) + virStorageSource *src) { g_autoptr(virNVMeDeviceList) nvmeDevices = NULL; g_autoptr(virPCIDeviceList) pciDevices = NULL; @@ -2411,7 +2411,7 @@ virHostdevReAttachOneNVMeDevice(virHostdevManagerPtr hostdev_mgr, drv_name, dom_name, pciDevices, NULL, 0); for (i = 0; i < virNVMeDeviceListCount(nvmeDevices); i++) { - virNVMeDevicePtr temp = virNVMeDeviceListGet(nvmeDevices, i); + virNVMeDevice *temp = virNVMeDeviceListGet(nvmeDevices, i); if (virNVMeDeviceListDel(hostdev_mgr->activeNVMeHostdevs, temp) < 0) goto cleanup; @@ -2425,10 +2425,10 @@ virHostdevReAttachOneNVMeDevice(virHostdevManagerPtr hostdev_mgr, int -virHostdevReAttachNVMeDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevReAttachNVMeDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainDiskDefPtr *disks, + virDomainDiskDef **disks, size_t ndisks) { size_t i; @@ -2451,15 +2451,15 @@ virHostdevReAttachNVMeDevices(virHostdevManagerPtr hostdev_mgr, int -virHostdevUpdateActiveNVMeDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevUpdateActiveNVMeDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainDiskDefPtr *disks, + virDomainDiskDef **disks, size_t ndisks) { g_autoptr(virNVMeDeviceList) nvmeDevices = NULL; g_autoptr(virPCIDeviceList) pciDevices = NULL; - virNVMeDevicePtr temp = NULL; + virNVMeDevice *temp = NULL; size_t i; ssize_t lastGoodNVMeIdx = -1; ssize_t lastGoodPCIIdx = -1; @@ -2494,7 +2494,7 @@ virHostdevUpdateActiveNVMeDevices(virHostdevManagerPtr hostdev_mgr, } for (i = 0; i < virPCIDeviceListCount(pciDevices); i++) { - virPCIDevicePtr actual = virPCIDeviceListGet(pciDevices, i); + virPCIDevice *actual = virPCIDeviceListGet(pciDevices, i); /* We must restore some attributes that were lost on daemon restart. */ virPCIDeviceSetUnbindFromStub(actual, true); @@ -2523,7 +2523,7 @@ virHostdevUpdateActiveNVMeDevices(virHostdevManagerPtr hostdev_mgr, lastGoodNVMeIdx--; } while (lastGoodPCIIdx >= 0) { - virPCIDevicePtr actual = virPCIDeviceListGet(pciDevices, i); + virPCIDevice *actual = virPCIDeviceListGet(pciDevices, i); virPCIDeviceListDel(hostdev_mgr->activePCIHostdevs, virPCIDeviceGetAddress(actual)); diff --git a/src/hypervisor/virhostdev.h b/src/hypervisor/virhostdev.h index b08cceac6f..642d753ffb 100644 --- a/src/hypervisor/virhostdev.h +++ b/src/hypervisor/virhostdev.h @@ -42,196 +42,195 @@ typedef enum { typedef struct _virHostdevManager virHostdevManager; -typedef virHostdevManager *virHostdevManagerPtr; struct _virHostdevManager { virObject parent; char *stateDir; - virPCIDeviceListPtr activePCIHostdevs; - virPCIDeviceListPtr inactivePCIHostdevs; - virUSBDeviceListPtr activeUSBHostdevs; - virSCSIDeviceListPtr activeSCSIHostdevs; - virSCSIVHostDeviceListPtr activeSCSIVHostHostdevs; - virMediatedDeviceListPtr activeMediatedHostdevs; + virPCIDeviceList *activePCIHostdevs; + virPCIDeviceList *inactivePCIHostdevs; + virUSBDeviceList *activeUSBHostdevs; + virSCSIDeviceList *activeSCSIHostdevs; + virSCSIVHostDeviceList *activeSCSIVHostHostdevs; + virMediatedDeviceList *activeMediatedHostdevs; /* NVMe devices are PCI devices really, but one NVMe disk can * have multiple namespaces. */ - virNVMeDeviceListPtr activeNVMeHostdevs; + virNVMeDeviceList *activeNVMeHostdevs; }; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virHostdevManager, virObjectUnref); -virHostdevManagerPtr virHostdevManagerGetDefault(void); +virHostdevManager *virHostdevManagerGetDefault(void); int -virHostdevPreparePCIDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevPreparePCIDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, const unsigned char *uuid, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); int -virHostdevFindUSBDevice(virDomainHostdevDefPtr hostdev, +virHostdevFindUSBDevice(virDomainHostdevDef *hostdev, bool mandatory, - virUSBDevicePtr *usb) + virUSBDevice **usb) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); int -virHostdevPrepareUSBDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevPrepareUSBDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int -virHostdevPrepareSCSIDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevPrepareSCSIDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int -virHostdevPrepareSCSIVHostDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevPrepareSCSIVHostDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int -virHostdevPrepareMediatedDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevPrepareMediatedDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); void -virHostdevReAttachPCIDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevReAttachPCIDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) ATTRIBUTE_NONNULL(1); void -virHostdevReAttachUSBDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevReAttachUSBDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) ATTRIBUTE_NONNULL(1); void -virHostdevReAttachSCSIDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevReAttachSCSIDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); void -virHostdevReAttachSCSIVHostDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevReAttachSCSIVHostDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) ATTRIBUTE_NONNULL(1); void -virHostdevReAttachMediatedDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevReAttachMediatedDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) ATTRIBUTE_NONNULL(1); int -virHostdevUpdateActivePCIDevices(virHostdevManagerPtr mgr, - virDomainHostdevDefPtr *hostdevs, +virHostdevUpdateActivePCIDevices(virHostdevManager *mgr, + virDomainHostdevDef **hostdevs, int nhostdevs, const char *drv_name, const char *dom_name) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5); int -virHostdevUpdateActiveUSBDevices(virHostdevManagerPtr mgr, - virDomainHostdevDefPtr *hostdevs, +virHostdevUpdateActiveUSBDevices(virHostdevManager *mgr, + virDomainHostdevDef **hostdevs, int nhostdevs, const char *drv_name, const char *dom_name) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5); int -virHostdevUpdateActiveSCSIDevices(virHostdevManagerPtr mgr, - virDomainHostdevDefPtr *hostdevs, +virHostdevUpdateActiveSCSIDevices(virHostdevManager *mgr, + virDomainHostdevDef **hostdevs, int nhostdevs, const char *drv_name, const char *dom_name) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5); int -virHostdevUpdateActiveMediatedDevices(virHostdevManagerPtr mgr, - virDomainHostdevDefPtr *hostdevs, +virHostdevUpdateActiveMediatedDevices(virHostdevManager *mgr, + virDomainHostdevDef **hostdevs, int nhostdevs, const char *drv_name, const char *dom_name) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5); int -virHostdevUpdateActiveDomainDevices(virHostdevManagerPtr mgr, +virHostdevUpdateActiveDomainDevices(virHostdevManager *mgr, const char *driver, - virDomainDefPtr def, + virDomainDef *def, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int -virHostdevPrepareDomainDevices(virHostdevManagerPtr mgr, +virHostdevPrepareDomainDevices(virHostdevManager *mgr, const char *driver, - virDomainDefPtr def, + virDomainDef *def, unsigned int flags) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); void -virHostdevReAttachDomainDevices(virHostdevManagerPtr mgr, +virHostdevReAttachDomainDevices(virHostdevManager *mgr, const char *driver, - virDomainDefPtr def, + virDomainDef *def, unsigned int flags) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); /* functions used by NodeDevDetach/Reattach/Reset */ -int virHostdevPCINodeDeviceDetach(virHostdevManagerPtr mgr, - virPCIDevicePtr pci) +int virHostdevPCINodeDeviceDetach(virHostdevManager *mgr, + virPCIDevice *pci) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virHostdevPCINodeDeviceReAttach(virHostdevManagerPtr mgr, - virPCIDevicePtr pci) +int virHostdevPCINodeDeviceReAttach(virHostdevManager *mgr, + virPCIDevice *pci) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virHostdevPCINodeDeviceReset(virHostdevManagerPtr mgr, - virPCIDevicePtr pci) +int virHostdevPCINodeDeviceReset(virHostdevManager *mgr, + virPCIDevice *pci) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int -virHostdevPrepareOneNVMeDevice(virHostdevManagerPtr hostdev_mgr, +virHostdevPrepareOneNVMeDevice(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virStorageSourcePtr src); + virStorageSource *src); int -virHostdevPrepareNVMeDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevPrepareNVMeDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainDiskDefPtr *disks, + virDomainDiskDef **disks, size_t ndisks); int -virHostdevReAttachOneNVMeDevice(virHostdevManagerPtr hostdev_mgr, +virHostdevReAttachOneNVMeDevice(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virStorageSourcePtr src); + virStorageSource *src); int -virHostdevReAttachNVMeDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevReAttachNVMeDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainDiskDefPtr *disks, + virDomainDiskDef **disks, size_t ndisks); int -virHostdevUpdateActiveNVMeDevices(virHostdevManagerPtr hostdev_mgr, +virHostdevUpdateActiveNVMeDevices(virHostdevManager *hostdev_mgr, const char *drv_name, const char *dom_name, - virDomainDiskDefPtr *disks, + virDomainDiskDef **disks, size_t ndisks); bool virHostdevIsPCIDevice(const virDomainHostdevDef *hostdev); diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c index feebf414a0..416e0af36f 100644 --- a/src/interface/interface_backend_netcf.c +++ b/src/interface/interface_backend_netcf.c @@ -56,7 +56,7 @@ typedef struct bool privileged; } virNetcfDriverState, *virNetcfDriverStatePtr; -static virClassPtr virNetcfDriverStateClass; +static virClass *virNetcfDriverStateClass; static void virNetcfDriverStateDispose(void *obj); static int @@ -188,7 +188,7 @@ netcfStateReload(void) static virDrvOpenStatus netcfConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -387,7 +387,7 @@ static int netcfConnectNumOfInterfacesImpl(virConnectPtr conn, } for (i = 0; i < count; i++) { - virInterfaceDefPtr def; + virInterfaceDef *def; struct netcf_if *iface; iface = ncf_lookup_by_name(driver->netcf, names[i]); @@ -481,7 +481,7 @@ static int netcfConnectListInterfacesImpl(virConnectPtr conn, } for (i = 0; i < count && want < nnames; i++) { - virInterfaceDefPtr def; + virInterfaceDef *def; struct netcf_if *iface; iface = ncf_lookup_by_name(driver->netcf, allnames[i]); @@ -665,7 +665,7 @@ netcfConnectListAllInterfaces(virConnectPtr conn, tmp_iface_objs = g_new0(virInterfacePtr, count + 1); for (i = 0; i < count; i++) { - virInterfaceDefPtr def; + virInterfaceDef *def; iface = ncf_lookup_by_name(driver->netcf, names[i]); if (!iface) { @@ -743,7 +743,7 @@ static virInterfacePtr netcfInterfaceLookupByName(virConnectPtr conn, { struct netcf_if *iface; virInterfacePtr ret = NULL; - virInterfaceDefPtr def = NULL; + virInterfaceDef *def = NULL; virObjectLock(driver); iface = ncf_lookup_by_name(driver->netcf, name); @@ -783,7 +783,7 @@ static virInterfacePtr netcfInterfaceLookupByMACString(virConnectPtr conn, struct netcf_if *iface; int niface; virInterfacePtr ret = NULL; - virInterfaceDefPtr def = NULL; + virInterfaceDef *def = NULL; virObjectLock(driver); niface = ncf_lookup_by_mac_string(driver->netcf, macstr, 1, &iface); @@ -830,7 +830,7 @@ static char *netcfInterfaceGetXMLDesc(virInterfacePtr ifinfo, { struct netcf_if *iface = NULL; char *xmlstr = NULL; - virInterfaceDefPtr ifacedef = NULL; + virInterfaceDef *ifacedef = NULL; char *ret = NULL; bool active; @@ -891,7 +891,7 @@ static virInterfacePtr netcfInterfaceDefineXML(virConnectPtr conn, { struct netcf_if *iface = NULL; char *xmlstr = NULL; - virInterfaceDefPtr ifacedef = NULL; + virInterfaceDef *ifacedef = NULL; virInterfacePtr ret = NULL; virCheckFlags(0, NULL); @@ -937,7 +937,7 @@ static virInterfacePtr netcfInterfaceDefineXML(virConnectPtr conn, static int netcfInterfaceUndefine(virInterfacePtr ifinfo) { struct netcf_if *iface = NULL; - virInterfaceDefPtr def = NULL; + virInterfaceDef *def = NULL; int ret = -1; virObjectLock(driver); @@ -977,7 +977,7 @@ static int netcfInterfaceCreate(virInterfacePtr ifinfo, unsigned int flags) { struct netcf_if *iface = NULL; - virInterfaceDefPtr def = NULL; + virInterfaceDef *def = NULL; int ret = -1; bool active; @@ -1029,7 +1029,7 @@ static int netcfInterfaceDestroy(virInterfacePtr ifinfo, unsigned int flags) { struct netcf_if *iface = NULL; - virInterfaceDefPtr def = NULL; + virInterfaceDef *def = NULL; int ret = -1; bool active; @@ -1080,7 +1080,7 @@ static int netcfInterfaceDestroy(virInterfacePtr ifinfo, static int netcfInterfaceIsActive(virInterfacePtr ifinfo) { struct netcf_if *iface = NULL; - virInterfaceDefPtr def = NULL; + virInterfaceDef *def = NULL; int ret = -1; bool active; diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c index d5bd7c8b18..0217f16607 100644 --- a/src/interface/interface_backend_udev.c +++ b/src/interface/interface_backend_udev.c @@ -165,7 +165,7 @@ udevNumOfInterfacesByStatus(virConnectPtr conn, virUdevStatus status, udev_list_entry_foreach(dev_entry, devices) { struct udev_device *dev; const char *path; - virInterfaceDefPtr def; + virInterfaceDef *def; path = udev_list_entry_get_name(dev_entry); dev = udev_device_new_from_syspath(udev, path); @@ -218,7 +218,7 @@ udevListInterfacesByStatus(virConnectPtr conn, udev_list_entry_foreach(dev_entry, devices) { struct udev_device *dev; const char *path; - virInterfaceDefPtr def; + virInterfaceDef *def; /* Ensure we won't exceed the size of our array */ if (count > names_len) @@ -355,7 +355,7 @@ udevConnectListAllInterfaces(virConnectPtr conn, const char *path; const char *name; const char *macaddr; - virInterfaceDefPtr def; + virInterfaceDef *def; path = udev_list_entry_get_name(dev_entry); dev = udev_device_new_from_syspath(udev, path); @@ -413,7 +413,7 @@ udevInterfaceLookupByName(virConnectPtr conn, const char *name) struct udev *udev = udev_ref(driver->udev); struct udev_device *dev; virInterfacePtr ret = NULL; - virInterfaceDefPtr def = NULL; + virInterfaceDef *def = NULL; /* get a device reference based on the device name */ dev = udev_device_new_from_subsystem_sysname(udev, "net", name); @@ -447,7 +447,7 @@ udevInterfaceLookupByMACString(virConnectPtr conn, const char *macstr) struct udev_enumerate *enumerate = NULL; struct udev_list_entry *dev_entry; struct udev_device *dev; - virInterfaceDefPtr def = NULL; + virInterfaceDef *def = NULL; virInterfacePtr ret = NULL; enumerate = udevGetDevices(udev, VIR_UDEV_IFACE_ALL); @@ -1085,7 +1085,7 @@ udevInterfaceIsActive(virInterfacePtr ifinfo) { struct udev *udev = udev_ref(driver->udev); struct udev_device *dev; - virInterfaceDefPtr def = NULL; + virInterfaceDef *def = NULL; int status = -1; dev = udev_device_new_from_subsystem_sysname(udev, "net", @@ -1193,7 +1193,7 @@ udevStateCleanup(void) static virDrvOpenStatus udevConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); diff --git a/src/libvirt.c b/src/libvirt.c index f2f0efa0cb..80bdcd1db3 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -89,17 +89,17 @@ VIR_LOG_INIT("libvirt"); #define MAX_DRIVERS 21 -static virConnectDriverPtr virConnectDriverTab[MAX_DRIVERS]; +static virConnectDriver *virConnectDriverTab[MAX_DRIVERS]; static int virConnectDriverTabCount; -static virStateDriverPtr virStateDriverTab[MAX_DRIVERS]; +static virStateDriver *virStateDriverTab[MAX_DRIVERS]; static int virStateDriverTabCount; -static virNetworkDriverPtr virSharedNetworkDriver; -static virInterfaceDriverPtr virSharedInterfaceDriver; -static virStorageDriverPtr virSharedStorageDriver; -static virNodeDeviceDriverPtr virSharedNodeDeviceDriver; -static virSecretDriverPtr virSharedSecretDriver; -static virNWFilterDriverPtr virSharedNWFilterDriver; +static virNetworkDriver *virSharedNetworkDriver; +static virInterfaceDriver *virSharedInterfaceDriver; +static virStorageDriver *virSharedStorageDriver; +static virNodeDeviceDriver *virSharedNodeDeviceDriver; +static virSecretDriver *virSharedSecretDriver; +static virNWFilterDriver *virSharedNWFilterDriver; static int @@ -357,7 +357,7 @@ DllMain(HINSTANCE instance G_GNUC_UNUSED, * Returns 0 on success, or -1 in case of error. */ int -virSetSharedNetworkDriver(virNetworkDriverPtr driver) +virSetSharedNetworkDriver(virNetworkDriver *driver) { virCheckNonNullArgReturn(driver, -1); @@ -383,7 +383,7 @@ virSetSharedNetworkDriver(virNetworkDriverPtr driver) * Returns the driver priority or -1 in case of error. */ int -virSetSharedInterfaceDriver(virInterfaceDriverPtr driver) +virSetSharedInterfaceDriver(virInterfaceDriver *driver) { virCheckNonNullArgReturn(driver, -1); @@ -409,7 +409,7 @@ virSetSharedInterfaceDriver(virInterfaceDriverPtr driver) * Returns the driver priority or -1 in case of error. */ int -virSetSharedStorageDriver(virStorageDriverPtr driver) +virSetSharedStorageDriver(virStorageDriver *driver) { virCheckNonNullArgReturn(driver, -1); @@ -435,7 +435,7 @@ virSetSharedStorageDriver(virStorageDriverPtr driver) * Returns the driver priority or -1 in case of error. */ int -virSetSharedNodeDeviceDriver(virNodeDeviceDriverPtr driver) +virSetSharedNodeDeviceDriver(virNodeDeviceDriver *driver) { virCheckNonNullArgReturn(driver, -1); @@ -461,7 +461,7 @@ virSetSharedNodeDeviceDriver(virNodeDeviceDriverPtr driver) * Returns the driver priority or -1 in case of error. */ int -virSetSharedSecretDriver(virSecretDriverPtr driver) +virSetSharedSecretDriver(virSecretDriver *driver) { virCheckNonNullArgReturn(driver, -1); @@ -487,7 +487,7 @@ virSetSharedSecretDriver(virSecretDriverPtr driver) * Returns the driver priority or -1 in case of error. */ int -virSetSharedNWFilterDriver(virNWFilterDriverPtr driver) +virSetSharedNWFilterDriver(virNWFilterDriver *driver) { virCheckNonNullArgReturn(driver, -1); @@ -515,7 +515,7 @@ virSetSharedNWFilterDriver(virNWFilterDriverPtr driver) * Returns the driver priority or -1 in case of error. */ int -virRegisterConnectDriver(virConnectDriverPtr driver, +virRegisterConnectDriver(virConnectDriver *driver, bool setSharedDrivers) { VIR_DEBUG("driver=%p name=%s", driver, @@ -588,7 +588,7 @@ virHasDriverForURIScheme(const char *scheme) * Returns the driver priority or -1 in case of error. */ int -virRegisterStateDriver(virStateDriverPtr driver) +virRegisterStateDriver(virStateDriver *driver) { virCheckNonNullArgReturn(driver, -1); @@ -829,7 +829,7 @@ virGetVersion(unsigned long *libVer, const char *type G_GNUC_UNUSED, static int -virConnectGetDefaultURI(virConfPtr conf, +virConnectGetDefaultURI(virConf *conf, char **name) { const char *defname = getenv("LIBVIRT_DEFAULT_URI"); @@ -853,7 +853,7 @@ virConnectGetDefaultURI(virConfPtr conf, * offer the suggested fix. */ static int -virConnectCheckURIMissingSlash(const char *uristr, virURIPtr uri) +virConnectCheckURIMissingSlash(const char *uristr, virURI *uri) { if (!uri->path || !uri->server) return 0; @@ -1011,7 +1011,7 @@ virConnectOpenInternal(const char *name, goto failed; if (virAccessManagerGetDefault() == NULL) { - virAccessManagerPtr acl; + virAccessManager *acl; virResetLastError(); diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c index 8faca38cbc..6c1199552d 100644 --- a/src/libxl/libxl_capabilities.c +++ b/src/libxl/libxl_capabilities.c @@ -62,7 +62,7 @@ struct guest_arch { #define XEN_CAP_REGEX "(xen|hvm)-[[:digit:]]+\\.[[:digit:]]+-(aarch64|armv7l|x86_32|x86_64|ia64|powerpc64)(p|be)?" static int -libxlCapsAddCPUID(virCPUDataPtr data, virCPUx86CPUID *cpuid, ssize_t ncaps) +libxlCapsAddCPUID(virCPUData *data, virCPUx86CPUID *cpuid, ssize_t ncaps) { virCPUx86DataItem item = { 0 }; size_t i; @@ -106,12 +106,12 @@ libxlCapsAddCPUID(virCPUDataPtr data, virCPUx86CPUID *cpuid, ssize_t ncaps) * word 8 | - Non existent - | CPUID.80000008.EBX | * */ -static virCPUDataPtr -libxlCapsNodeData(virCPUDefPtr cpu, libxl_hwcap hwcap, +static virCPUData * +libxlCapsNodeData(virCPUDef *cpu, libxl_hwcap hwcap, enum libxlHwcapVersion version) { ssize_t ncaps; - virCPUDataPtr cpudata = NULL; + virCPUData *cpudata = NULL; virCPUx86CPUID cpuid[] = { { .eax_in = 0x00000001, .edx = hwcap[0] }, @@ -155,11 +155,11 @@ libxlCapsNodeData(virCPUDefPtr cpu, libxl_hwcap hwcap, * the X'th 32-bit word of hw_cap. */ static int -libxlCapsInitCPU(virCapsPtr caps, libxl_physinfo *phy_info, +libxlCapsInitCPU(virCaps *caps, libxl_physinfo *phy_info, enum libxlHwcapVersion version) { - virCPUDataPtr data = NULL; - virCPUDefPtr cpu = NULL; + virCPUData *data = NULL; + virCPUDef *cpu = NULL; int ret = -1; int host_pae; int host_lm; @@ -208,7 +208,7 @@ libxlCapsInitCPU(virCapsPtr caps, libxl_physinfo *phy_info, } static int -libxlCapsInitHost(libxl_ctx *ctx, virCapsPtr caps) +libxlCapsInitHost(libxl_ctx *ctx, virCaps *caps) { const libxl_version_info *ver_info; enum libxlHwcapVersion version; @@ -243,13 +243,13 @@ libxlCapsInitHost(libxl_ctx *ctx, virCapsPtr caps) } static int -libxlCapsInitNuma(libxl_ctx *ctx, virCapsPtr caps) +libxlCapsInitNuma(libxl_ctx *ctx, virCaps *caps) { libxl_numainfo *numa_info = NULL; libxl_cputopology *cpu_topo = NULL; int nr_nodes = 0, nr_cpus = 0, nr_siblings = 0; - virCapsHostNUMACellCPUPtr *cpus = NULL; - virCapsHostNUMACellSiblingInfoPtr siblings = NULL; + virCapsHostNUMACellCPU **cpus = NULL; + virCapsHostNUMACellSiblingInfo *siblings = NULL; int *nr_cpus_node = NULL; size_t i; int ret = -1; @@ -269,7 +269,7 @@ libxlCapsInitNuma(libxl_ctx *ctx, virCapsPtr caps) } } - cpus = g_new0(virCapsHostNUMACellCPUPtr, nr_nodes); + cpus = g_new0(virCapsHostNUMACellCPU *, nr_nodes); nr_cpus_node = g_new0(int, nr_nodes); @@ -360,7 +360,7 @@ libxlCapsInitNuma(libxl_ctx *ctx, virCapsPtr caps) } static int -libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps) +libxlCapsInitGuests(libxl_ctx *ctx, virCaps *caps) { const libxl_version_info *ver_info; g_autoptr(GRegex) regex = NULL; @@ -504,11 +504,11 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps) } for (i = 0; i < nr_guest_archs; ++i) { - virCapsGuestPtr guest; + virCapsGuest *guest; char const *const xen_machines[] = { guest_archs[i].hvm ? "xenfv" : (guest_archs[i].pvh ? "xenpvh" : "xenpv")}; - virCapsGuestMachinePtr *machines; + virCapsGuestMachine **machines; if ((machines = virCapabilitiesAllocMachines(xen_machines, 1)) == NULL) return -1; @@ -565,11 +565,11 @@ libxlCapsInitGuests(libxl_ctx *ctx, virCapsPtr caps) static int libxlMakeDomainOSCaps(const char *machine, - virDomainCapsOSPtr os, - virFirmwarePtr *firmwares, + virDomainCapsOS *os, + virFirmware **firmwares, size_t nfirmwares) { - virDomainCapsLoaderPtr capsLoader = &os->loader; + virDomainCapsLoader *capsLoader = &os->loader; size_t i; os->supported = VIR_TRISTATE_BOOL_YES; @@ -598,7 +598,7 @@ libxlMakeDomainOSCaps(const char *machine, } static int -libxlMakeDomainDeviceDiskCaps(virDomainCapsDeviceDiskPtr dev) +libxlMakeDomainDeviceDiskCaps(virDomainCapsDeviceDisk *dev) { dev->supported = VIR_TRISTATE_BOOL_YES; dev->diskDevice.report = true; @@ -618,7 +618,7 @@ libxlMakeDomainDeviceDiskCaps(virDomainCapsDeviceDiskPtr dev) } static int -libxlMakeDomainDeviceGraphicsCaps(virDomainCapsDeviceGraphicsPtr dev) +libxlMakeDomainDeviceGraphicsCaps(virDomainCapsDeviceGraphics *dev) { dev->supported = VIR_TRISTATE_BOOL_YES; dev->type.report = true; @@ -632,7 +632,7 @@ libxlMakeDomainDeviceGraphicsCaps(virDomainCapsDeviceGraphicsPtr dev) } static int -libxlMakeDomainDeviceVideoCaps(virDomainCapsDeviceVideoPtr dev) +libxlMakeDomainDeviceVideoCaps(virDomainCapsDeviceVideo *dev) { dev->supported = VIR_TRISTATE_BOOL_YES; dev->modelType.report = true; @@ -655,7 +655,7 @@ bool libxlCapsHasPVUSB(void) } static int -libxlMakeDomainDeviceHostdevCaps(virDomainCapsDeviceHostdevPtr dev) +libxlMakeDomainDeviceHostdevCaps(virDomainCapsDeviceHostdev *dev) { dev->supported = VIR_TRISTATE_BOOL_YES; dev->mode.report = true; @@ -690,10 +690,10 @@ libxlMakeDomainDeviceHostdevCaps(virDomainCapsDeviceHostdevPtr dev) return 0; } -virCapsPtr +virCaps * libxlMakeCapabilities(libxl_ctx *ctx) { - virCapsPtr caps; + virCaps *caps; #ifdef LIBXL_HAVE_NO_SUSPEND_RESUME if ((caps = virCapabilitiesNew(virArchFromHost(), false, false)) == NULL) @@ -729,15 +729,15 @@ libxlMakeCapabilities(libxl_ctx *ctx) #define PV_MAX_VCPUS 512 int -libxlMakeDomainCapabilities(virDomainCapsPtr domCaps, - virFirmwarePtr *firmwares, +libxlMakeDomainCapabilities(virDomainCaps *domCaps, + virFirmware **firmwares, size_t nfirmwares) { - virDomainCapsOSPtr os = &domCaps->os; - virDomainCapsDeviceDiskPtr disk = &domCaps->disk; - virDomainCapsDeviceGraphicsPtr graphics = &domCaps->graphics; - virDomainCapsDeviceVideoPtr video = &domCaps->video; - virDomainCapsDeviceHostdevPtr hostdev = &domCaps->hostdev; + virDomainCapsOS *os = &domCaps->os; + virDomainCapsDeviceDisk *disk = &domCaps->disk; + virDomainCapsDeviceGraphics *graphics = &domCaps->graphics; + virDomainCapsDeviceVideo *video = &domCaps->video; + virDomainCapsDeviceHostdev *hostdev = &domCaps->hostdev; if (STREQ(domCaps->machine, "xenfv")) domCaps->maxvcpus = HVM_MAX_VCPUS; @@ -767,7 +767,7 @@ int libxlDomainGetEmulatorType(const virDomainDef *def) { int ret = LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; g_autofree char *output = NULL; if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) { diff --git a/src/libxl/libxl_capabilities.h b/src/libxl/libxl_capabilities.h index 4e8e2bb59b..4e0b55e321 100644 --- a/src/libxl/libxl_capabilities.h +++ b/src/libxl/libxl_capabilities.h @@ -41,12 +41,12 @@ bool libxlCapsHasPVUSB(void) G_GNUC_NO_INLINE; -virCapsPtr +virCaps * libxlMakeCapabilities(libxl_ctx *ctx); int -libxlMakeDomainCapabilities(virDomainCapsPtr domCaps, - virFirmwarePtr *firmwares, +libxlMakeDomainCapabilities(virDomainCaps *domCaps, + virFirmware **firmwares, size_t nfirmwares); int diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index d84522cdb4..3ccb00ec35 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -54,7 +54,7 @@ VIR_LOG_INIT("libxl.libxl_conf"); -static virClassPtr libxlDriverConfigClass; +static virClass *libxlDriverConfigClass; static void libxlDriverConfigDispose(void *obj); static int libxlConfigOnceInit(void) @@ -70,7 +70,7 @@ VIR_ONCE_GLOBAL_INIT(libxlConfig); static void libxlDriverConfigDispose(void *obj) { - libxlDriverConfigPtr cfg = obj; + libxlDriverConfig *cfg = obj; virObjectUnref(cfg->caps); libxl_ctx_free(cfg->ctx); @@ -123,7 +123,7 @@ libxlActionFromVirLifecycle(virDomainLifecycleAction action) static int libxlMakeDomCreateInfo(libxl_ctx *ctx, - virDomainDefPtr def, + virDomainDef *def, libxl_domain_create_info *c_info) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -210,9 +210,9 @@ libxlMakeDomCreateInfo(libxl_ctx *ctx, } static int -libxlMakeChrdevStr(virDomainChrDefPtr def, char **buf) +libxlMakeChrdevStr(virDomainChrDef *def, char **buf) { - virDomainChrSourceDefPtr srcdef = def->source; + virDomainChrSourceDef *srcdef = def->source; const char *type = virDomainChrTypeToString(srcdef->type); if (!type) { @@ -284,9 +284,9 @@ libxlMakeChrdevStr(virDomainChrDefPtr def, char **buf) } static int -libxlMakeDomBuildInfo(virDomainDefPtr def, - libxlDriverConfigPtr cfg, - virCapsPtr caps, +libxlMakeDomBuildInfo(virDomainDef *def, + libxlDriverConfig *cfg, + virCaps *caps, libxl_domain_config *d_config) { virDomainClockDef clock = def->clock; @@ -539,7 +539,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, * Use first sound device. man xl.cfg(5) describes soundhw as * a single device. From the man page: soundhw=DEVICE */ - virDomainSoundDefPtr snd = def->sounds[0]; + virDomainSoundDef *snd = def->sounds[0]; b_info->u.hvm.soundhw = g_strdup(virDomainSoundModelTypeToString(snd->model)); } @@ -770,7 +770,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, b_info->max_vcpus); if (def->namespaceData) { - libxlDomainXmlNsDefPtr nsdata = def->namespaceData; + libxlDomainXmlNsDef *nsdata = def->namespaceData; if (nsdata->num_args > 0) b_info->extra = g_strdupv(nsdata->args); @@ -781,7 +781,7 @@ libxlMakeDomBuildInfo(virDomainDefPtr def, #ifdef LIBXL_HAVE_VNUMA static int -libxlMakeVnumaList(virDomainDefPtr def, +libxlMakeVnumaList(virDomainDef *def, libxl_ctx *ctx, libxl_domain_config *d_config) { @@ -790,8 +790,8 @@ libxlMakeVnumaList(virDomainDefPtr def, size_t nr_nodes; size_t num_vnuma; bool simulate = false; - virBitmapPtr bitmap = NULL; - virDomainNumaPtr numa = def->numa; + virBitmap *bitmap = NULL; + virDomainNuma *numa = def->numa; libxl_domain_build_info *b_info = &d_config->b_info; libxl_physinfo physinfo; libxl_vnode_info *vnuma_nodes = NULL; @@ -918,7 +918,7 @@ libxlDiskSetDiscard(libxl_device_disk *x_disk, int discard) } static char * -libxlMakeNetworkDiskSrcStr(virStorageSourcePtr src, +libxlMakeNetworkDiskSrcStr(virStorageSource *src, const char *username, const char *secret) { @@ -992,7 +992,7 @@ libxlMakeNetworkDiskSrcStr(virStorageSourcePtr src, } static int -libxlMakeNetworkDiskSrc(virStorageSourcePtr src, char **srcstr) +libxlMakeNetworkDiskSrc(virStorageSource *src, char **srcstr) { virConnectPtr conn = NULL; g_autofree char *base64secret = NULL; @@ -1032,7 +1032,7 @@ libxlMakeNetworkDiskSrc(virStorageSourcePtr src, char **srcstr) } int -libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk) +libxlMakeDisk(virDomainDiskDef *l_disk, libxl_device_disk *x_disk) { const char *driver = virDomainDiskGetDriver(l_disk); int format = virDomainDiskGetFormat(l_disk); @@ -1183,9 +1183,9 @@ libxlMakeDisk(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk) } static int -libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config) +libxlMakeDiskList(virDomainDef *def, libxl_domain_config *d_config) { - virDomainDiskDefPtr *l_disks = def->disks; + virDomainDiskDef **l_disks = def->disks; int ndisks = def->ndisks; libxl_device_disk *x_disks; size_t i; @@ -1217,7 +1217,7 @@ libxlMakeDiskList(virDomainDefPtr def, libxl_domain_config *d_config) * libxl when not explicitly specified by the user. */ void -libxlUpdateDiskDef(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk) +libxlUpdateDiskDef(virDomainDiskDef *l_disk, libxl_device_disk *x_disk) { const char *driver = NULL; @@ -1242,8 +1242,8 @@ libxlUpdateDiskDef(virDomainDiskDefPtr l_disk, libxl_device_disk *x_disk) } int -libxlMakeNic(virDomainDefPtr def, - virDomainNetDefPtr l_nic, +libxlMakeNic(virDomainDef *def, + virDomainNetDef *l_nic, libxl_device_nic *x_nic, bool attach) { @@ -1454,9 +1454,9 @@ libxlMakeNic(virDomainDefPtr def, } static int -libxlMakeNicList(virDomainDefPtr def, libxl_domain_config *d_config) +libxlMakeNicList(virDomainDef *def, libxl_domain_config *d_config) { - virDomainNetDefPtr *l_nics = def->nets; + virDomainNetDef **l_nics = def->nets; size_t nnics = def->nnets; libxl_device_nic *x_nics; size_t i, nvnics = 0; @@ -1494,12 +1494,12 @@ libxlMakeNicList(virDomainDefPtr def, libxl_domain_config *d_config) } int -libxlMakeVfb(virPortAllocatorRangePtr graphicsports, - virDomainGraphicsDefPtr l_vfb, +libxlMakeVfb(virPortAllocatorRange *graphicsports, + virDomainGraphicsDef *l_vfb, libxl_device_vfb *x_vfb) { unsigned short port; - virDomainGraphicsListenDefPtr glisten = NULL; + virDomainGraphicsListenDef *glisten = NULL; libxl_device_vfb_init(x_vfb); @@ -1550,11 +1550,11 @@ libxlMakeVfb(virPortAllocatorRangePtr graphicsports, } static int -libxlMakeVfbList(virPortAllocatorRangePtr graphicsports, - virDomainDefPtr def, +libxlMakeVfbList(virPortAllocatorRange *graphicsports, + virDomainDef *def, libxl_domain_config *d_config) { - virDomainGraphicsDefPtr *l_vfbs = def->graphics; + virDomainGraphicsDef **l_vfbs = def->graphics; int nvfbs = def->ngraphics; libxl_device_vfb *x_vfbs; libxl_device_vkb *x_vkbs; @@ -1595,8 +1595,8 @@ libxlMakeVfbList(virPortAllocatorRangePtr graphicsports, * populate libxl_domain_config->vfbs. */ static int -libxlMakeBuildInfoVfb(virPortAllocatorRangePtr graphicsports, - virDomainDefPtr def, +libxlMakeBuildInfoVfb(virPortAllocatorRange *graphicsports, + virDomainDef *def, libxl_domain_config *d_config) { libxl_domain_build_info *b_info = &d_config->b_info; @@ -1614,9 +1614,9 @@ libxlMakeBuildInfoVfb(virPortAllocatorRangePtr graphicsports, * libxl_domain_config->vfbs. Prior to calling this function, */ for (i = 0; i < def->ngraphics; i++) { - virDomainGraphicsDefPtr l_vfb = def->graphics[i]; + virDomainGraphicsDef *l_vfb = def->graphics[i]; unsigned short port; - virDomainGraphicsListenDefPtr glisten = NULL; + virDomainGraphicsListenDef *glisten = NULL; if (l_vfb->type != VIR_DOMAIN_GRAPHICS_TYPE_SPICE) continue; @@ -1703,8 +1703,8 @@ libxlMakeBuildInfoVfb(virPortAllocatorRangePtr graphicsports, * Otherwise autoballooning is enabled. */ static int -libxlGetAutoballoonConf(libxlDriverConfigPtr cfg, - virConfPtr conf) +libxlGetAutoballoonConf(libxlDriverConfig *cfg, + virConf *conf) { g_autoptr(GRegex) regex = NULL; g_autoptr(GError) err = NULL; @@ -1728,10 +1728,10 @@ libxlGetAutoballoonConf(libxlDriverConfigPtr cfg, return 0; } -libxlDriverConfigPtr +libxlDriverConfig * libxlDriverConfigNew(void) { - libxlDriverConfigPtr cfg; + libxlDriverConfig *cfg; if (libxlConfigInitialize() < 0) return NULL; @@ -1757,7 +1757,7 @@ libxlDriverConfigNew(void) return NULL; } #else - cfg->firmwares = g_new0(virFirmwarePtr, 1); + cfg->firmwares = g_new0(virFirmware *, 1); cfg->nfirmwares = 1; cfg->firmwares[0] = g_new0(virFirmware, 1); cfg->firmwares[0]->name = g_strdup(LIBXL_FIRMWARE_DIR "/ovmf.bin"); @@ -1777,7 +1777,7 @@ libxlDriverConfigNew(void) } int -libxlDriverConfigInit(libxlDriverConfigPtr cfg) +libxlDriverConfigInit(libxlDriverConfig *cfg) { uint64_t free_mem; @@ -1819,10 +1819,10 @@ libxlDriverConfigInit(libxlDriverConfigPtr cfg) return 0; } -libxlDriverConfigPtr -libxlDriverConfigGet(libxlDriverPrivatePtr driver) +libxlDriverConfig * +libxlDriverConfigGet(libxlDriverPrivate *driver) { - libxlDriverConfigPtr cfg; + libxlDriverConfig *cfg; libxlDriverLock(driver); cfg = virObjectRef(driver->config); @@ -1830,7 +1830,7 @@ libxlDriverConfigGet(libxlDriverPrivatePtr driver) return cfg; } -int libxlDriverConfigLoadFile(libxlDriverConfigPtr cfg, +int libxlDriverConfigLoadFile(libxlDriverConfig *cfg, const char *filename) { g_autoptr(virConf) conf = NULL; @@ -1877,7 +1877,7 @@ int libxlDriverConfigLoadFile(libxlDriverConfigPtr cfg, * either the user-specified value or total physical memory as a default. */ int -libxlDriverGetDom0MaxmemConf(libxlDriverConfigPtr cfg, +libxlDriverGetDom0MaxmemConf(libxlDriverConfig *cfg, unsigned long long *maxmem) { char **cmd_tokens = NULL; @@ -1951,7 +1951,7 @@ libxlDriverGetDom0MaxmemConf(libxlDriverConfigPtr cfg, #ifdef LIBXL_HAVE_DEVICE_CHANNEL static int -libxlPrepareChannel(virDomainChrDefPtr channel, +libxlPrepareChannel(virDomainChrDef *channel, const char *channelDir, const char *domainName) { @@ -1972,7 +1972,7 @@ libxlPrepareChannel(virDomainChrDefPtr channel, } static int -libxlMakeChannel(virDomainChrDefPtr l_channel, +libxlMakeChannel(virDomainChrDef *l_channel, libxl_device_channel *x_channel) { libxl_device_channel_init(x_channel); @@ -2010,10 +2010,10 @@ libxlMakeChannel(virDomainChrDefPtr l_channel, static int libxlMakeChannelList(const char *channelDir, - virDomainDefPtr def, + virDomainDef *def, libxl_domain_config *d_config) { - virDomainChrDefPtr *l_channels = def->channels; + virDomainChrDef **l_channels = def->channels; size_t nchannels = def->nchannels; libxl_device_channel *x_channels; size_t i, nvchannels = 0; @@ -2049,7 +2049,7 @@ libxlMakeChannelList(const char *channelDir, #ifdef LIBXL_HAVE_PVUSB int -libxlMakeUSBController(virDomainControllerDefPtr controller, +libxlMakeUSBController(virDomainControllerDef *controller, libxl_device_usbctrl *usbctrl) { usbctrl->devid = controller->idx; @@ -2088,10 +2088,10 @@ libxlMakeUSBController(virDomainControllerDefPtr controller, } static int -libxlMakeDefaultUSBControllers(virDomainDefPtr def, +libxlMakeDefaultUSBControllers(virDomainDef *def, libxl_domain_config *d_config) { - virDomainControllerDefPtr l_controller = NULL; + virDomainControllerDef *l_controller = NULL; libxl_device_usbctrl *x_controllers = NULL; size_t nusbdevs = 0; size_t ncontrollers; @@ -2142,9 +2142,9 @@ libxlMakeDefaultUSBControllers(virDomainDefPtr def, } static int -libxlMakeUSBControllerList(virDomainDefPtr def, libxl_domain_config *d_config) +libxlMakeUSBControllerList(virDomainDef *def, libxl_domain_config *d_config) { - virDomainControllerDefPtr *l_controllers = def->controllers; + virDomainControllerDef **l_controllers = def->controllers; size_t ncontrollers = def->ncontrollers; size_t nusbctrls = 0; libxl_device_usbctrl *x_usbctrls; @@ -2187,10 +2187,10 @@ libxlMakeUSBControllerList(virDomainDefPtr def, libxl_domain_config *d_config) } int -libxlMakeUSB(virDomainHostdevDefPtr hostdev, libxl_device_usbdev *usbdev) +libxlMakeUSB(virDomainHostdevDef *hostdev, libxl_device_usbdev *usbdev) { - virDomainHostdevSubsysUSBPtr usbsrc = &hostdev->source.subsys.u.usb; - virUSBDevicePtr usb = NULL; + virDomainHostdevSubsysUSB *usbsrc = &hostdev->source.subsys.u.usb; + virUSBDevice *usb = NULL; int ret = -1; if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) @@ -2223,9 +2223,9 @@ libxlMakeUSB(virDomainHostdevDefPtr hostdev, libxl_device_usbdev *usbdev) } static int -libxlMakeUSBList(virDomainDefPtr def, libxl_domain_config *d_config) +libxlMakeUSBList(virDomainDef *def, libxl_domain_config *d_config) { - virDomainHostdevDefPtr *l_hostdevs = def->hostdevs; + virDomainHostdevDef **l_hostdevs = def->hostdevs; size_t nhostdevs = def->nhostdevs; size_t nusbdevs = 0; libxl_device_usbdev *x_usbdevs; @@ -2267,9 +2267,9 @@ libxlMakeUSBList(virDomainDefPtr def, libxl_domain_config *d_config) #endif int -libxlMakePCI(virDomainHostdevDefPtr hostdev, libxl_device_pci *pcidev) +libxlMakePCI(virDomainHostdevDef *hostdev, libxl_device_pci *pcidev) { - virDomainHostdevSubsysPCIPtr pcisrc = &hostdev->source.subsys.u.pci; + virDomainHostdevSubsysPCI *pcisrc = &hostdev->source.subsys.u.pci; if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) return -1; if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) @@ -2285,9 +2285,9 @@ libxlMakePCI(virDomainHostdevDefPtr hostdev, libxl_device_pci *pcidev) } static int -libxlMakePCIList(virDomainDefPtr def, libxl_domain_config *d_config) +libxlMakePCIList(virDomainDef *def, libxl_domain_config *d_config) { - virDomainHostdevDefPtr *l_hostdevs = def->hostdevs; + virDomainHostdevDef **l_hostdevs = def->hostdevs; size_t nhostdevs = def->nhostdevs; size_t npcidevs = 0; libxl_device_pci *x_pcidevs; @@ -2328,7 +2328,7 @@ libxlMakePCIList(virDomainDefPtr def, libxl_domain_config *d_config) } static int -libxlMakeVideo(virDomainDefPtr def, libxl_domain_config *d_config) +libxlMakeVideo(virDomainDef *def, libxl_domain_config *d_config) { libxl_domain_build_info *b_info = &d_config->b_info; @@ -2406,11 +2406,11 @@ libxlMakeVideo(virDomainDefPtr def, libxl_domain_config *d_config) } int -libxlDriverNodeGetInfo(libxlDriverPrivatePtr driver, virNodeInfoPtr info) +libxlDriverNodeGetInfo(libxlDriverPrivate *driver, virNodeInfoPtr info) { libxl_physinfo phy_info; virArch hostarch = virArchFromHost(); - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); int ret = -1; libxl_physinfo_init(&phy_info); @@ -2444,12 +2444,12 @@ libxlDriverNodeGetInfo(libxlDriverPrivatePtr driver, virNodeInfoPtr info) } int -libxlBuildDomainConfig(virPortAllocatorRangePtr graphicsports, - virDomainDefPtr def, - libxlDriverConfigPtr cfg, +libxlBuildDomainConfig(virPortAllocatorRange *graphicsports, + virDomainDef *def, + libxlDriverConfig *cfg, libxl_domain_config *d_config) { - virCapsPtr caps = cfg->caps; + virCaps *caps = cfg->caps; libxl_ctx *ctx = cfg->ctx; libxl_domain_config_init(d_config); @@ -2507,8 +2507,8 @@ libxlBuildDomainConfig(virPortAllocatorRangePtr graphicsports, return 0; } -virDomainXMLOptionPtr -libxlCreateXMLConf(libxlDriverPrivatePtr driver) +virDomainXMLOption * +libxlCreateXMLConf(libxlDriverPrivate *driver) { libxlDomainDefParserConfig.priv = driver; return virDomainXMLOptionNew(&libxlDomainDefParserConfig, diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h index fc652df61e..f833daf669 100644 --- a/src/libxl/libxl_conf.h +++ b/src/libxl/libxl_conf.h @@ -64,11 +64,8 @@ typedef struct _libxlDriverPrivate libxlDriverPrivate; -typedef libxlDriverPrivate *libxlDriverPrivatePtr; typedef struct _libxlDriverConfig libxlDriverConfig; -typedef libxlDriverConfig *libxlDriverConfigPtr; - struct _libxlDriverConfig { virObject parent; @@ -76,7 +73,7 @@ struct _libxlDriverConfig { unsigned int version; /* log stream for driver-wide libxl ctx */ - libxlLoggerPtr logger; + libxlLogger *logger; /* libxl ctx for driver wide ops; getVersion, getNodeInfo, ... */ libxl_ctx *ctx; @@ -92,7 +89,7 @@ struct _libxlDriverConfig { bool nested_hvm; /* Once created, caps are immutable */ - virCapsPtr caps; + virCaps *caps; char *configBaseDir; char *configDir; @@ -104,7 +101,7 @@ struct _libxlDriverConfig { char *autoDumpDir; char *channelDir; - virFirmwarePtr *firmwares; + virFirmware **firmwares; size_t nfirmwares; }; @@ -114,10 +111,10 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(libxlDriverConfig, virObjectUnref); struct _libxlDriverPrivate { virMutex lock; - virHostdevManagerPtr hostdevMgr; + virHostdevManager *hostdevMgr; /* Require lock to get reference on 'config', * then lockless thereafter */ - libxlDriverConfigPtr config; + libxlDriverConfig *config; /* pid file FD, ensures two copies of the driver can't use the same root */ int lockFD; @@ -130,25 +127,25 @@ struct _libxlDriverPrivate { void *inhibitOpaque; /* Immutable pointer, self-locking APIs */ - virDomainObjListPtr domains; + virDomainObjList *domains; /* Immutable pointer, immutable object */ - virDomainXMLOptionPtr xmlopt; + virDomainXMLOption *xmlopt; /* Immutable pointer, self-locking APIs */ - virObjectEventStatePtr domainEventState; + virObjectEventState *domainEventState; /* Immutable pointer, immutable object */ - virPortAllocatorRangePtr reservedGraphicsPorts; + virPortAllocatorRange *reservedGraphicsPorts; /* Immutable pointer, immutable object */ - virPortAllocatorRangePtr migrationPorts; + virPortAllocatorRange *migrationPorts; /* Immutable pointer, lockless APIs */ - virSysinfoDefPtr hostsysinfo; + virSysinfoDef *hostsysinfo; /* Immutable pointer. lockless access */ - virLockManagerPluginPtr lockManager; + virLockManagerPlugin *lockManager; }; #define LIBXL_SAVE_MAGIC "libvirt-xml\n \0 \r" @@ -159,7 +156,6 @@ struct _libxlDriverPrivate { #endif typedef struct _libxlSavefileHeader libxlSavefileHeader; -typedef libxlSavefileHeader *libxlSavefileHeaderPtr; struct _libxlSavefileHeader { char magic[sizeof(LIBXL_SAVE_MAGIC)-1]; uint32_t version; @@ -170,60 +166,59 @@ struct _libxlSavefileHeader { typedef struct _libxlDomainXmlNsDef libxlDomainXmlNsDef; -typedef libxlDomainXmlNsDef *libxlDomainXmlNsDefPtr; struct _libxlDomainXmlNsDef { size_t num_args; char **args; }; -libxlDriverConfigPtr +libxlDriverConfig * libxlDriverConfigNew(void); int -libxlDriverConfigInit(libxlDriverConfigPtr cfg); +libxlDriverConfigInit(libxlDriverConfig *cfg); -libxlDriverConfigPtr -libxlDriverConfigGet(libxlDriverPrivatePtr driver); +libxlDriverConfig * +libxlDriverConfigGet(libxlDriverPrivate *driver); int -libxlDriverNodeGetInfo(libxlDriverPrivatePtr driver, +libxlDriverNodeGetInfo(libxlDriverPrivate *driver, virNodeInfoPtr info); -int libxlDriverConfigLoadFile(libxlDriverConfigPtr cfg, +int libxlDriverConfigLoadFile(libxlDriverConfig *cfg, const char *filename); int -libxlDriverGetDom0MaxmemConf(libxlDriverConfigPtr cfg, +libxlDriverGetDom0MaxmemConf(libxlDriverConfig *cfg, unsigned long long *maxmem); int -libxlMakeDisk(virDomainDiskDefPtr l_dev, libxl_device_disk *x_dev); +libxlMakeDisk(virDomainDiskDef *l_dev, libxl_device_disk *x_dev); void -libxlUpdateDiskDef(virDomainDiskDefPtr l_dev, libxl_device_disk *x_dev); +libxlUpdateDiskDef(virDomainDiskDef *l_dev, libxl_device_disk *x_dev); int -libxlMakeNic(virDomainDefPtr def, - virDomainNetDefPtr l_nic, +libxlMakeNic(virDomainDef *def, + virDomainNetDef *l_nic, libxl_device_nic *x_nic, bool attach); int -libxlMakeVfb(virPortAllocatorRangePtr graphicsports, - virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb); +libxlMakeVfb(virPortAllocatorRange *graphicsports, + virDomainGraphicsDef *l_vfb, libxl_device_vfb *x_vfb); int -libxlMakePCI(virDomainHostdevDefPtr hostdev, libxl_device_pci *pcidev); +libxlMakePCI(virDomainHostdevDef *hostdev, libxl_device_pci *pcidev); #ifdef LIBXL_HAVE_PVUSB int -libxlMakeUSBController(virDomainControllerDefPtr controller, +libxlMakeUSBController(virDomainControllerDef *controller, libxl_device_usbctrl *usbctrl); int -libxlMakeUSB(virDomainHostdevDefPtr hostdev, libxl_device_usbdev *usbdev); +libxlMakeUSB(virDomainHostdevDef *hostdev, libxl_device_usbdev *usbdev); #endif -virDomainXMLOptionPtr -libxlCreateXMLConf(libxlDriverPrivatePtr driver); +virDomainXMLOption * +libxlCreateXMLConf(libxlDriverPrivate *driver); #ifdef LIBXL_HAVE_DEVICE_CHANNEL # define LIBXL_ATTR_UNUSED @@ -231,19 +226,19 @@ libxlCreateXMLConf(libxlDriverPrivatePtr driver); # define LIBXL_ATTR_UNUSED G_GNUC_UNUSED #endif int -libxlBuildDomainConfig(virPortAllocatorRangePtr graphicsports, - virDomainDefPtr def, - libxlDriverConfigPtr cfg, +libxlBuildDomainConfig(virPortAllocatorRange *graphicsports, + virDomainDef *def, + libxlDriverConfig *cfg, libxl_domain_config *d_config); static inline void -libxlDriverLock(libxlDriverPrivatePtr driver) +libxlDriverLock(libxlDriverPrivate *driver) { virMutexLock(&driver->lock); } static inline void -libxlDriverUnlock(libxlDriverPrivatePtr driver) +libxlDriverUnlock(libxlDriverPrivate *driver) { virMutexUnlock(&driver->lock); } diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c index 7ffafb9023..a25d65629a 100644 --- a/src/libxl/libxl_domain.c +++ b/src/libxl/libxl_domain.c @@ -51,7 +51,7 @@ VIR_ENUM_IMPL(libxlDomainJob, "modify", ); -static virClassPtr libxlDomainObjPrivateClass; +static virClass *libxlDomainObjPrivateClass; static void libxlDomainObjPrivateDispose(void *obj); @@ -68,7 +68,7 @@ libxlDomainObjPrivateOnceInit(void) VIR_ONCE_GLOBAL_INIT(libxlDomainObjPrivate); static int -libxlDomainObjInitJob(libxlDomainObjPrivatePtr priv) +libxlDomainObjInitJob(libxlDomainObjPrivate *priv) { memset(&priv->job, 0, sizeof(priv->job)); @@ -81,7 +81,7 @@ libxlDomainObjInitJob(libxlDomainObjPrivatePtr priv) } static void -libxlDomainObjResetJob(libxlDomainObjPrivatePtr priv) +libxlDomainObjResetJob(libxlDomainObjPrivate *priv) { struct libxlDomainJobObj *job = &priv->job; @@ -90,7 +90,7 @@ libxlDomainObjResetJob(libxlDomainObjPrivatePtr priv) } static void -libxlDomainObjFreeJob(libxlDomainObjPrivatePtr priv) +libxlDomainObjFreeJob(libxlDomainObjPrivate *priv) { ignore_value(virCondDestroy(&priv->job.cond)); VIR_FREE(priv->job.current); @@ -100,7 +100,7 @@ libxlDomainObjFreeJob(libxlDomainObjPrivatePtr priv) #define LIBXL_JOB_WAIT_TIME (1000ull * 30) /* - * obj must be locked before calling, libxlDriverPrivatePtr must NOT be locked + * obj must be locked before calling, libxlDriverPrivate *must NOT be locked * * This must be called by anything that will change the VM state * in any way @@ -109,11 +109,11 @@ libxlDomainObjFreeJob(libxlDomainObjPrivatePtr priv) * successful calls must be followed by EndJob eventually */ int -libxlDomainObjBeginJob(libxlDriverPrivatePtr driver G_GNUC_UNUSED, - virDomainObjPtr obj, +libxlDomainObjBeginJob(libxlDriverPrivate *driver G_GNUC_UNUSED, + virDomainObj *obj, enum libxlDomainJob job) { - libxlDomainObjPrivatePtr priv = obj->privateData; + libxlDomainObjPrivate *priv = obj->privateData; unsigned long long now; unsigned long long then; @@ -167,10 +167,10 @@ libxlDomainObjBeginJob(libxlDriverPrivatePtr driver G_GNUC_UNUSED, * and obj is disposed. */ void -libxlDomainObjEndJob(libxlDriverPrivatePtr driver G_GNUC_UNUSED, - virDomainObjPtr obj) +libxlDomainObjEndJob(libxlDriverPrivate *driver G_GNUC_UNUSED, + virDomainObj *obj) { - libxlDomainObjPrivatePtr priv = obj->privateData; + libxlDomainObjPrivate *priv = obj->privateData; enum libxlDomainJob job = priv->job.active; VIR_DEBUG("Stopping job: %s", @@ -204,7 +204,7 @@ libxlDomainJobUpdateTime(struct libxlDomainJobObj *job) static void * libxlDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED) { - libxlDomainObjPrivatePtr priv; + libxlDomainObjPrivate *priv; if (libxlDomainObjPrivateInitialize() < 0) return NULL; @@ -229,7 +229,7 @@ libxlDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED) static void libxlDomainObjPrivateDispose(void *obj) { - libxlDomainObjPrivatePtr priv = obj; + libxlDomainObjPrivate *priv = obj; libxlDomainObjFreeJob(priv); virChrdevFree(priv->devs); @@ -238,7 +238,7 @@ libxlDomainObjPrivateDispose(void *obj) static void libxlDomainObjPrivateFree(void *data) { - libxlDomainObjPrivatePtr priv = data; + libxlDomainObjPrivate *priv = data; g_free(priv->lockState); virObjectUnref(priv); @@ -246,10 +246,10 @@ libxlDomainObjPrivateFree(void *data) static int libxlDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, - virDomainObjPtr vm, - virDomainDefParserConfigPtr config G_GNUC_UNUSED) + virDomainObj *vm, + virDomainDefParserConfig *config G_GNUC_UNUSED) { - libxlDomainObjPrivatePtr priv = vm->privateData; + libxlDomainObjPrivate *priv = vm->privateData; priv->lockState = virXPathString("string(./lockstate)", ctxt); @@ -257,10 +257,10 @@ libxlDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, } static int -libxlDomainObjPrivateXMLFormat(virBufferPtr buf, - virDomainObjPtr vm) +libxlDomainObjPrivateXMLFormat(virBuffer *buf, + virDomainObj *vm) { - libxlDomainObjPrivatePtr priv = vm->privateData; + libxlDomainObjPrivate *priv = vm->privateData; if (priv->lockState) virBufferAsprintf(buf, "%s\n", priv->lockState); @@ -277,7 +277,7 @@ virDomainXMLPrivateDataCallbacks libxlDomainXMLPrivateDataCallbacks = { static int -libxlDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, +libxlDomainDeviceDefPostParse(virDomainDeviceDef *dev, const virDomainDef *def, unsigned int parseFlags G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED, @@ -293,8 +293,8 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, (dev->type == VIR_DOMAIN_DEVICE_NET && dev->data.net->type == VIR_DOMAIN_NET_TYPE_HOSTDEV)) { - virDomainHostdevDefPtr hostdev; - virDomainHostdevSubsysPCIPtr pcisrc; + virDomainHostdevDef *hostdev; + virDomainHostdevSubsysPCI *pcisrc; if (dev->type == VIR_DOMAIN_DEVICE_NET) hostdev = &dev->data.net->data.hostdev.def; @@ -358,7 +358,7 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, } if (dev->type == VIR_DOMAIN_DEVICE_DISK) { - virDomainDiskDefPtr disk = dev->data.disk; + virDomainDiskDef *disk = dev->data.disk; int actual_type = virStorageSourceGetActualType(disk->src); int format = virDomainDiskGetFormat(disk); @@ -377,12 +377,12 @@ libxlDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, } static int -libxlDomainDefPostParse(virDomainDefPtr def, +libxlDomainDefPostParse(virDomainDef *def, unsigned int parseFlags G_GNUC_UNUSED, void *opaque, void *parseOpaque G_GNUC_UNUSED) { - libxlDriverPrivatePtr driver = opaque; + libxlDriverPrivate *driver = opaque; g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver); if (!virCapabilitiesDomainSupported(cfg->caps, def->os.type, @@ -393,7 +393,7 @@ libxlDomainDefPostParse(virDomainDefPtr def, /* Xen PV domains always have a PV console, so add one to the domain config * via post-parse callback if not explicitly specified in the XML. */ if (def->os.type != VIR_DOMAIN_OSTYPE_HVM && def->nconsoles == 0) { - virDomainChrDefPtr chrdef; + virDomainChrDef *chrdef; if (!(chrdef = virDomainChrDefNew(NULL))) return -1; @@ -403,7 +403,7 @@ libxlDomainDefPostParse(virDomainDefPtr def, chrdef->target.port = 0; chrdef->targetType = VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_XEN; - def->consoles = g_new0(virDomainChrDefPtr, 1); + def->consoles = g_new0(virDomainChrDef *, 1); def->nconsoles = 1; def->consoles[0] = chrdef; } @@ -425,7 +425,7 @@ libxlDomainDefPostParse(virDomainDefPtr def, /* add implicit balloon device */ if (def->memballoon == NULL) { - virDomainMemballoonDefPtr memballoon; + virDomainMemballoonDef *memballoon; memballoon = g_new0(virDomainMemballoonDef, 1); @@ -451,8 +451,8 @@ virDomainDefParserConfig libxlDomainDefParserConfig = { static void -libxlDomainShutdownHandleDestroy(libxlDriverPrivatePtr driver, - virDomainObjPtr vm) +libxlDomainShutdownHandleDestroy(libxlDriverPrivate *driver, + virDomainObj *vm) { libxlDomainDestroyInternal(driver, vm); libxlDomainCleanup(driver, vm); @@ -462,8 +462,8 @@ libxlDomainShutdownHandleDestroy(libxlDriverPrivatePtr driver, static void -libxlDomainShutdownHandleRestart(libxlDriverPrivatePtr driver, - virDomainObjPtr vm) +libxlDomainShutdownHandleRestart(libxlDriverPrivate *driver, + virDomainObj *vm) { libxlDomainDestroyInternal(driver, vm); libxlDomainCleanup(driver, vm); @@ -476,8 +476,8 @@ libxlDomainShutdownHandleRestart(libxlDriverPrivatePtr driver, struct libxlShutdownThreadInfo { - libxlDriverPrivatePtr driver; - virDomainObjPtr vm; + libxlDriverPrivate *driver; + virDomainObj *vm; libxl_event *event; }; @@ -486,10 +486,10 @@ static void libxlDomainShutdownThread(void *opaque) { struct libxlShutdownThreadInfo *shutdown_info = opaque; - virDomainObjPtr vm = shutdown_info->vm; + virDomainObj *vm = shutdown_info->vm; libxl_event *ev = shutdown_info->event; - libxlDriverPrivatePtr driver = shutdown_info->driver; - virObjectEventPtr dom_event = NULL; + libxlDriverPrivate *driver = shutdown_info->driver; + virObjectEvent *dom_event = NULL; libxl_shutdown_reason xl_reason = ev->u.domain_shutdown.shutdown_reason; g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver); libxl_domain_config d_config; @@ -570,7 +570,7 @@ libxlDomainShutdownThread(void *opaque) } #ifdef LIBXL_HAVE_SOFT_RESET } else if (xl_reason == LIBXL_SHUTDOWN_REASON_SOFT_RESET) { - libxlDomainObjPrivatePtr priv = vm->privateData; + libxlDomainObjPrivate *priv = vm->privateData; if (libxlRetrieveDomainConfigurationWrapper(cfg->ctx, vm->def->id, &d_config) != 0) { @@ -612,10 +612,10 @@ libxlDomainShutdownThread(void *opaque) } static void -libxlDomainHandleDeath(libxlDriverPrivatePtr driver, virDomainObjPtr vm) +libxlDomainHandleDeath(libxlDriverPrivate *driver, virDomainObj *vm) { - virObjectEventPtr dom_event = NULL; - libxlDomainObjPrivatePtr priv = vm->privateData; + virObjectEvent *dom_event = NULL; + libxlDomainObjPrivate *priv = vm->privateData; if (priv->ignoreDeathEvent) { priv->ignoreDeathEvent = false; @@ -643,9 +643,9 @@ libxlDomainHandleDeath(libxlDriverPrivatePtr driver, virDomainObjPtr vm) void libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event) { - libxlDriverPrivatePtr driver = data; + libxlDriverPrivate *driver = data; libxl_shutdown_reason xl_reason = event->u.domain_shutdown.shutdown_reason; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; g_autoptr(libxlDriverConfig) cfg = NULL; if (event->type != LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN && @@ -668,7 +668,7 @@ libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event) } if (event->type == LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN) { - libxlDomainObjPrivatePtr priv = vm->privateData; + libxlDomainObjPrivate *priv = vm->privateData; struct libxlShutdownThreadInfo *shutdown_info = NULL; virThread thread; g_autofree char *name = NULL; @@ -719,7 +719,7 @@ libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event) } char * -libxlDomainManagedSavePath(libxlDriverPrivatePtr driver, virDomainObjPtr vm) +libxlDomainManagedSavePath(libxlDriverPrivate *driver, virDomainObj *vm) { char *ret; g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver); @@ -734,14 +734,14 @@ libxlDomainManagedSavePath(libxlDriverPrivatePtr driver, virDomainObjPtr vm) * Returns the opened fd on success, -1 on failure. */ int -libxlDomainSaveImageOpen(libxlDriverPrivatePtr driver, - libxlDriverConfigPtr cfg G_GNUC_UNUSED, +libxlDomainSaveImageOpen(libxlDriverPrivate *driver, + libxlDriverConfig *cfg G_GNUC_UNUSED, const char *from, - virDomainDefPtr *ret_def, - libxlSavefileHeaderPtr ret_hdr) + virDomainDef **ret_def, + libxlSavefileHeader *ret_hdr) { int fd; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; libxlSavefileHeader hdr; g_autofree char *xml = NULL; @@ -801,14 +801,14 @@ libxlDomainSaveImageOpen(libxlDriverPrivatePtr driver, /* * Internal domain destroy function. * - * virDomainObjPtr must be locked on invocation + * virDomainObj *must be locked on invocation */ int -libxlDomainDestroyInternal(libxlDriverPrivatePtr driver, - virDomainObjPtr vm) +libxlDomainDestroyInternal(libxlDriverPrivate *driver, + virDomainObj *vm) { g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver); - libxlDomainObjPrivatePtr priv = vm->privateData; + libxlDomainObjPrivate *priv = vm->privateData; int ret = -1; /* Ignore next LIBXL_EVENT_TYPE_DOMAIN_DEATH as the caller will handle @@ -830,17 +830,17 @@ libxlDomainDestroyInternal(libxlDriverPrivatePtr driver, /* * Cleanup function for domain that has reached shutoff state. * - * virDomainObjPtr must be locked on invocation + * virDomainObj *must be locked on invocation */ void -libxlDomainCleanup(libxlDriverPrivatePtr driver, - virDomainObjPtr vm) +libxlDomainCleanup(libxlDriverPrivate *driver, + virDomainObj *vm) { - libxlDomainObjPrivatePtr priv = vm->privateData; + libxlDomainObjPrivate *priv = vm->privateData; g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver); int vnc_port; char *file; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; unsigned int hostdev_flags = VIR_HOSTDEV_SP_PCI; g_autoptr(virConnect) conn = NULL; @@ -898,7 +898,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver, size_t i; for (i = 0; i < vm->def->nnets; i++) { - virDomainNetDefPtr net = vm->def->nets[i]; + virDomainNetDef *net = vm->def->nets[i]; if (net->ifname && STRPREFIX(net->ifname, LIBXL_GENERATED_PREFIX_XEN)) @@ -938,11 +938,11 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver, /* * Core dump domain to default dump path. * - * virDomainObjPtr must be locked on invocation + * virDomainObj *must be locked on invocation */ int -libxlDomainAutoCoreDump(libxlDriverPrivatePtr driver, - virDomainObjPtr vm) +libxlDomainAutoCoreDump(libxlDriverPrivate *driver, + virDomainObj *vm) { g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver); g_autoptr(GDateTime) now = g_date_time_new_now_local(); @@ -963,12 +963,12 @@ libxlDomainAutoCoreDump(libxlDriverPrivatePtr driver, } int -libxlDomainSetVcpuAffinities(libxlDriverPrivatePtr driver, virDomainObjPtr vm) +libxlDomainSetVcpuAffinities(libxlDriverPrivate *driver, virDomainObj *vm) { g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver); - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; libxl_bitmap map; - virBitmapPtr cpumask = NULL; + virBitmap *cpumask = NULL; size_t i; int ret = -1; @@ -1042,13 +1042,13 @@ libxlDomainFreeMem(libxl_ctx *ctx, libxl_domain_config *d_config) } static int -libxlNetworkPrepareDevices(virDomainDefPtr def) +libxlNetworkPrepareDevices(virDomainDef *def) { size_t i; g_autoptr(virConnect) conn = NULL; for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; virDomainNetType actualType; /* If appropriate, grab a physical device from the configured @@ -1076,8 +1076,8 @@ libxlNetworkPrepareDevices(virDomainDefPtr def) * network / determined at runtime, we need to do it * separately. */ - virDomainHostdevDefPtr hostdev = virDomainNetGetActualHostdev(net); - virDomainHostdevSubsysPCIPtr pcisrc = &hostdev->source.subsys.u.pci; + virDomainHostdevDef *hostdev = virDomainNetGetActualHostdev(net); + virDomainHostdevSubsysPCI *pcisrc = &hostdev->source.subsys.u.pci; if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) @@ -1094,9 +1094,9 @@ libxlNetworkPrepareDevices(virDomainDefPtr def) static void libxlConsoleCallback(libxl_ctx *ctx, libxl_event *ev, void *for_callback) { - virDomainObjPtr vm = for_callback; + virDomainObj *vm = for_callback; size_t i; - virDomainChrDefPtr chr; + virDomainChrDef *chr; char *console = NULL; int ret; @@ -1155,12 +1155,12 @@ libxlConsoleCallback(libxl_ctx *ctx, libxl_event *ev, void *for_callback) * parameter. User-provided interface names are skipped. */ static void -libxlDomainCreateIfaceNames(virDomainDefPtr def, libxl_domain_config *d_config) +libxlDomainCreateIfaceNames(virDomainDef *def, libxl_domain_config *d_config) { size_t i; for (i = 0; i < def->nnets && i < d_config->num_nics; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; libxl_device_nic *x_nic = &d_config->nics[i]; const char *suffix = x_nic->nictype != LIBXL_NIC_TYPE_VIF ? "-emu" : ""; @@ -1174,7 +1174,7 @@ libxlDomainCreateIfaceNames(virDomainDefPtr def, libxl_domain_config *d_config) } static void -libxlDomainUpdateDiskParams(virDomainDefPtr def, libxl_ctx *ctx) +libxlDomainUpdateDiskParams(virDomainDef *def, libxl_ctx *ctx) { libxl_device_disk *disks; int num_disks = 0; @@ -1199,10 +1199,10 @@ libxlDomainUpdateDiskParams(virDomainDefPtr def, libxl_ctx *ctx) #ifdef LIBXL_HAVE_DEVICE_CHANNEL static void -libxlDomainCreateChannelPTY(virDomainDefPtr def, libxl_ctx *ctx) +libxlDomainCreateChannelPTY(virDomainDef *def, libxl_ctx *ctx) { libxl_device_channel *x_channels; - virDomainChrDefPtr chr; + virDomainChrDef *chr; size_t i; int nchannels; @@ -1242,27 +1242,27 @@ libxlDomainCreateChannelPTY(virDomainDefPtr def, libxl_ctx *ctx) /* * Start a domain through libxenlight. * - * virDomainObjPtr must be locked and a job acquired on invocation + * virDomainObj *must be locked and a job acquired on invocation */ static int -libxlDomainStart(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainStart(libxlDriverPrivate *driver, + virDomainObj *vm, bool start_paused, int restore_fd, uint32_t restore_ver LIBXL_DOMSTART_RESTORE_VER_ATTR) { libxl_domain_config d_config; - virDomainDefPtr def = NULL; - virObjectEventPtr event = NULL; + virDomainDef *def = NULL; + virObjectEvent *event = NULL; libxlSavefileHeader hdr; int ret = -1; uint32_t domid = 0; g_autofree char *dom_xml = NULL; g_autofree char *managed_save_path = NULL; int managed_save_fd = -1; - libxlDomainObjPrivatePtr priv = vm->privateData; + libxlDomainObjPrivate *priv = vm->privateData; g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver); - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; libxl_asyncprogress_how aop_console_how; libxl_domain_restore_params params; unsigned int hostdev_flags = VIR_HOSTDEV_SP_PCI; @@ -1514,16 +1514,16 @@ libxlDomainStart(libxlDriverPrivatePtr driver, } int -libxlDomainStartNew(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainStartNew(libxlDriverPrivate *driver, + virDomainObj *vm, bool start_paused) { return libxlDomainStart(driver, vm, start_paused, -1, LIBXL_SAVE_VERSION); } int -libxlDomainStartRestore(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainStartRestore(libxlDriverPrivate *driver, + virDomainObj *vm, bool start_paused, int restore_fd, uint32_t restore_ver) @@ -1533,12 +1533,12 @@ libxlDomainStartRestore(libxlDriverPrivatePtr driver, } bool -libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver, - virDomainDefPtr src, - virDomainDefPtr dst) +libxlDomainDefCheckABIStability(libxlDriverPrivate *driver, + virDomainDef *src, + virDomainDef *dst) { - virDomainDefPtr migratableDefSrc = NULL; - virDomainDefPtr migratableDefDst = NULL; + virDomainDef *migratableDefSrc = NULL; + virDomainDef *migratableDefDst = NULL; bool ret = false; if (!(migratableDefSrc = virDomainDefCopy(src, driver->xmlopt, NULL, true)) || @@ -1559,7 +1559,7 @@ libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver, static void libxlDomainDefNamespaceFree(void *nsdata) { - libxlDomainXmlNsDefPtr def = nsdata; + libxlDomainXmlNsDef *def = nsdata; if (!def) return; @@ -1573,7 +1573,7 @@ static int libxlDomainDefNamespaceParse(xmlXPathContextPtr ctxt, void **data) { - libxlDomainXmlNsDefPtr nsdata = NULL; + libxlDomainXmlNsDef *nsdata = NULL; g_autofree xmlNodePtr *nodes = NULL; ssize_t nnodes; size_t i; @@ -1606,10 +1606,10 @@ libxlDomainDefNamespaceParse(xmlXPathContextPtr ctxt, static int -libxlDomainDefNamespaceFormatXML(virBufferPtr buf, +libxlDomainDefNamespaceFormatXML(virBuffer *buf, void *nsdata) { - libxlDomainXmlNsDefPtr cmd = nsdata; + libxlDomainXmlNsDef *cmd = nsdata; size_t i; if (!cmd->num_args) diff --git a/src/libxl/libxl_domain.h b/src/libxl/libxl_domain.h index 5fb76bd303..8223b1d255 100644 --- a/src/libxl/libxl_domain.h +++ b/src/libxl/libxl_domain.h @@ -55,17 +55,16 @@ struct libxlDomainJobObj { }; typedef struct _libxlDomainObjPrivate libxlDomainObjPrivate; -typedef libxlDomainObjPrivate *libxlDomainObjPrivatePtr; struct _libxlDomainObjPrivate { virObjectLockable parent; /* console */ - virChrdevsPtr devs; + virChrdevs *devs; libxl_evgen_domain_death *deathW; /* Flag to indicate the upcoming LIBXL_EVENT_TYPE_DOMAIN_DEATH is caused * by libvirt and should not be handled separately */ bool ignoreDeathEvent; - virThreadPtr migrationDstReceiveThr; + virThread *migrationDstReceiveThr; unsigned short migrationPort; char *lockState; bool lockProcessRunning; @@ -82,41 +81,41 @@ extern virXMLNamespace libxlDriverDomainXMLNamespace; extern const struct libxl_event_hooks ev_hooks; int -libxlDomainObjPrivateInitCtx(virDomainObjPtr vm); +libxlDomainObjPrivateInitCtx(virDomainObj *vm); int -libxlDomainObjBeginJob(libxlDriverPrivatePtr driver, - virDomainObjPtr obj, +libxlDomainObjBeginJob(libxlDriverPrivate *driver, + virDomainObj *obj, enum libxlDomainJob job) G_GNUC_WARN_UNUSED_RESULT; void -libxlDomainObjEndJob(libxlDriverPrivatePtr driver, - virDomainObjPtr obj); +libxlDomainObjEndJob(libxlDriverPrivate *driver, + virDomainObj *obj); int libxlDomainJobUpdateTime(struct libxlDomainJobObj *job) G_GNUC_WARN_UNUSED_RESULT; char * -libxlDomainManagedSavePath(libxlDriverPrivatePtr driver, - virDomainObjPtr vm); +libxlDomainManagedSavePath(libxlDriverPrivate *driver, + virDomainObj *vm); int -libxlDomainSaveImageOpen(libxlDriverPrivatePtr driver, - libxlDriverConfigPtr cfg, +libxlDomainSaveImageOpen(libxlDriverPrivate *driver, + libxlDriverConfig *cfg, const char *from, - virDomainDefPtr *ret_def, - libxlSavefileHeaderPtr ret_hdr) + virDomainDef **ret_def, + libxlSavefileHeader *ret_hdr) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5); int -libxlDomainDestroyInternal(libxlDriverPrivatePtr driver, - virDomainObjPtr vm); +libxlDomainDestroyInternal(libxlDriverPrivate *driver, + virDomainObj *vm); void -libxlDomainCleanup(libxlDriverPrivatePtr driver, - virDomainObjPtr vm); +libxlDomainCleanup(libxlDriverPrivate *driver, + virDomainObj *vm); /* * Note: Xen 4.3 removed the const from the event handler signature. @@ -134,26 +133,26 @@ libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event); int -libxlDomainAutoCoreDump(libxlDriverPrivatePtr driver, - virDomainObjPtr vm); +libxlDomainAutoCoreDump(libxlDriverPrivate *driver, + virDomainObj *vm); int -libxlDomainSetVcpuAffinities(libxlDriverPrivatePtr driver, - virDomainObjPtr vm); +libxlDomainSetVcpuAffinities(libxlDriverPrivate *driver, + virDomainObj *vm); int -libxlDomainStartNew(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainStartNew(libxlDriverPrivate *driver, + virDomainObj *vm, bool start_paused); int -libxlDomainStartRestore(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainStartRestore(libxlDriverPrivate *driver, + virDomainObj *vm, bool start_paused, int restore_fd, uint32_t restore_ver); bool -libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver, - virDomainDefPtr src, - virDomainDefPtr dst); +libxlDomainDefCheckABIStability(libxlDriverPrivate *driver, + virDomainDef *src, + virDomainDef *dst); diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index bb23ec363a..d924e033d9 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -88,11 +88,10 @@ VIR_LOG_INIT("libxl.libxl_driver"); } while (0) -static libxlDriverPrivatePtr libxl_driver; +static libxlDriverPrivate *libxl_driver; /* Object used to store info related to libxl event registrations */ typedef struct _libxlOSEventHookInfo libxlOSEventHookInfo; -typedef libxlOSEventHookInfo *libxlOSEventHookInfoPtr; struct _libxlOSEventHookInfo { libxl_ctx *ctx; void *xl_priv; @@ -101,7 +100,6 @@ struct _libxlOSEventHookInfo { /* Object used to store disk statistics across multiple xen backends */ typedef struct _libxlBlockStats libxlBlockStats; -typedef libxlBlockStats *libxlBlockStatsPtr; struct _libxlBlockStats { long long rd_req; long long rd_bytes; @@ -120,7 +118,7 @@ struct _libxlBlockStats { /* Function declarations */ static int -libxlDomainManagedSaveLoad(virDomainObjPtr vm, +libxlDomainManagedSaveLoad(virDomainObj *vm, void *opaque); @@ -137,7 +135,7 @@ libxlFDEventCallback(int watch G_GNUC_UNUSED, int vir_events, void *fd_info) { - libxlOSEventHookInfoPtr info = fd_info; + libxlOSEventHookInfo *info = fd_info; int events = 0; if (vir_events & VIR_EVENT_HANDLE_READABLE) @@ -160,7 +158,7 @@ libxlFDRegisterEventHook(void *priv, void *xl_priv) { int vir_events = VIR_EVENT_HANDLE_ERROR; - libxlOSEventHookInfoPtr info; + libxlOSEventHookInfo *info; info = g_new0(libxlOSEventHookInfo, 1); @@ -190,7 +188,7 @@ libxlFDModifyEventHook(void *priv G_GNUC_UNUSED, void **hndp, short events) { - libxlOSEventHookInfoPtr info = *hndp; + libxlOSEventHookInfo *info = *hndp; int vir_events = VIR_EVENT_HANDLE_ERROR; if (events & POLLIN) @@ -208,7 +206,7 @@ libxlFDDeregisterEventHook(void *priv G_GNUC_UNUSED, int fd G_GNUC_UNUSED, void *hnd) { - libxlOSEventHookInfoPtr info = hnd; + libxlOSEventHookInfo *info = hnd; virEventRemoveHandle(info->id); } @@ -216,7 +214,7 @@ libxlFDDeregisterEventHook(void *priv G_GNUC_UNUSED, static void libxlTimerCallback(int timer G_GNUC_UNUSED, void *timer_info) { - libxlOSEventHookInfoPtr info = timer_info; + libxlOSEventHookInfo *info = timer_info; /* * libxl expects the event to be deregistered when calling @@ -235,7 +233,7 @@ libxlTimeoutRegisterEventHook(void *priv, struct timeval abs_t, void *xl_priv) { - libxlOSEventHookInfoPtr info; + libxlOSEventHookInfo *info; gint64 now_us; gint64 abs_us; gint64 res_ms; @@ -284,7 +282,7 @@ libxlTimeoutModifyEventHook(void *priv G_GNUC_UNUSED, void **hndp, struct timeval abs_t G_GNUC_UNUSED) { - libxlOSEventHookInfoPtr info = *hndp; + libxlOSEventHookInfo *info = *hndp; /* Make the timeout fire */ virEventUpdateTimeout(info->id, 0); @@ -296,16 +294,16 @@ static void libxlTimeoutDeregisterEventHook(void *priv G_GNUC_UNUSED, void *hnd) { - libxlOSEventHookInfoPtr info = hnd; + libxlOSEventHookInfo *info = hnd; virEventRemoveTimeout(info->id); } -static virDomainObjPtr +static virDomainObj * libxlDomObjFromDomain(virDomainPtr dom) { - virDomainObjPtr vm; - libxlDriverPrivatePtr driver = dom->conn->privateData; + virDomainObj *vm; + libxlDriverPrivate *driver = dom->conn->privateData; char uuidstr[VIR_UUID_STRING_BUFLEN]; vm = virDomainObjListFindByUUID(driver->domains, dom->uuid); @@ -321,10 +319,10 @@ libxlDomObjFromDomain(virDomainPtr dom) } static int -libxlAutostartDomain(virDomainObjPtr vm, +libxlAutostartDomain(virDomainObj *vm, void *opaque) { - libxlDriverPrivatePtr driver = opaque; + libxlDriverPrivate *driver = opaque; int ret = -1; virObjectRef(vm); @@ -354,13 +352,13 @@ libxlAutostartDomain(virDomainObjPtr vm, static void -libxlReconnectNotifyNets(virDomainDefPtr def) +libxlReconnectNotifyNets(virDomainDef *def) { size_t i; g_autoptr(virConnect) conn = NULL; for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; /* keep others from trying to use the macvtap device name, but * don't return error if this happens, since that causes the * domain to be unceremoniously killed, which would be *very* @@ -382,17 +380,17 @@ libxlReconnectNotifyNets(virDomainDefPtr def) * with libxenlight driver. */ static int -libxlReconnectDomain(virDomainObjPtr vm, +libxlReconnectDomain(virDomainObj *vm, void *opaque) { - libxlDriverPrivatePtr driver = opaque; - libxlDomainObjPrivatePtr priv = vm->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverPrivate *driver = opaque; + libxlDomainObjPrivate *priv = vm->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); int rc; libxl_dominfo d_info; int len; uint8_t *data = NULL; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; unsigned int hostdev_flags = VIR_HOSTDEV_SP_PCI; int ret = -1; @@ -492,7 +490,7 @@ libxlReconnectDomain(virDomainObjPtr vm, } static void -libxlReconnectDomains(libxlDriverPrivatePtr driver) +libxlReconnectDomains(libxlDriverPrivate *driver) { virDomainObjListForEach(driver->domains, true, libxlReconnectDomain, driver); } @@ -583,11 +581,11 @@ const struct libxl_event_hooks ev_hooks = { }; static int -libxlAddDom0(libxlDriverPrivatePtr driver) +libxlAddDom0(libxlDriverPrivate *driver) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainDefPtr def = NULL; - virDomainObjPtr vm = NULL; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainDef *def = NULL; + virDomainObj *vm = NULL; libxl_dominfo d_info; unsigned long long maxmem; int ret = -1; @@ -655,7 +653,7 @@ libxlStateInitialize(bool privileged, virStateInhibitCallback callback, void *opaque) { - libxlDriverConfigPtr cfg; + libxlDriverConfig *cfg; g_autofree char *driverConf = NULL; bool autostart = true; @@ -833,7 +831,7 @@ libxlStateInitialize(bool privileged, static int libxlStateReload(void) { - libxlDriverConfigPtr cfg; + libxlDriverConfig *cfg; if (!libxl_driver) return 0; @@ -870,7 +868,7 @@ libxlConnectURIProbe(char **uri) static virDrvOpenStatus libxlConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -919,8 +917,8 @@ libxlConnectGetType(virConnectPtr conn) static int libxlConnectGetVersion(virConnectPtr conn, unsigned long *version) { - libxlDriverPrivatePtr driver = conn->privateData; - libxlDriverConfigPtr cfg; + libxlDriverPrivate *driver = conn->privateData; + libxlDriverConfig *cfg; if (virConnectGetVersionEnsureACL(conn) < 0) return 0; @@ -943,7 +941,7 @@ static char *libxlConnectGetHostname(virConnectPtr conn) static char * libxlConnectGetSysinfo(virConnectPtr conn, unsigned int flags) { - libxlDriverPrivatePtr driver = conn->privateData; + libxlDriverPrivate *driver = conn->privateData; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; virCheckFlags(0, NULL); @@ -966,8 +964,8 @@ static int libxlConnectGetMaxVcpus(virConnectPtr conn, const char *type G_GNUC_UNUSED) { int ret; - libxlDriverPrivatePtr driver = conn->privateData; - libxlDriverConfigPtr cfg; + libxlDriverPrivate *driver = conn->privateData; + libxlDriverConfig *cfg; if (virConnectGetMaxVcpusEnsureACL(conn) < 0) return -1; @@ -997,9 +995,9 @@ libxlNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) static char * libxlConnectGetCapabilities(virConnectPtr conn) { - libxlDriverPrivatePtr driver = conn->privateData; + libxlDriverPrivate *driver = conn->privateData; char *xml; - libxlDriverConfigPtr cfg; + libxlDriverConfig *cfg; if (virConnectGetCapabilitiesEnsureACL(conn) < 0) return NULL; @@ -1014,7 +1012,7 @@ libxlConnectGetCapabilities(virConnectPtr conn) static int libxlConnectListDomains(virConnectPtr conn, int *ids, int nids) { - libxlDriverPrivatePtr driver = conn->privateData; + libxlDriverPrivate *driver = conn->privateData; if (virConnectListDomainsEnsureACL(conn) < 0) return -1; @@ -1026,7 +1024,7 @@ libxlConnectListDomains(virConnectPtr conn, int *ids, int nids) static int libxlConnectNumOfDomains(virConnectPtr conn) { - libxlDriverPrivatePtr driver = conn->privateData; + libxlDriverPrivate *driver = conn->privateData; if (virConnectNumOfDomainsEnsureACL(conn) < 0) return -1; @@ -1039,11 +1037,11 @@ static virDomainPtr libxlDomainCreateXML(virConnectPtr conn, const char *xml, unsigned int flags) { - libxlDriverPrivatePtr driver = conn->privateData; - virDomainDefPtr def; - virDomainObjPtr vm = NULL; + libxlDriverPrivate *driver = conn->privateData; + virDomainDef *def; + virDomainObj *vm = NULL; virDomainPtr dom = NULL; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; virCheckFlags(VIR_DOMAIN_START_PAUSED | @@ -1095,8 +1093,8 @@ libxlDomainCreateXML(virConnectPtr conn, const char *xml, static virDomainPtr libxlDomainLookupByID(virConnectPtr conn, int id) { - libxlDriverPrivatePtr driver = conn->privateData; - virDomainObjPtr vm; + libxlDriverPrivate *driver = conn->privateData; + virDomainObj *vm; virDomainPtr dom = NULL; vm = virDomainObjListFindByID(driver->domains, id); @@ -1118,8 +1116,8 @@ libxlDomainLookupByID(virConnectPtr conn, int id) static virDomainPtr libxlDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - libxlDriverPrivatePtr driver = conn->privateData; - virDomainObjPtr vm; + libxlDriverPrivate *driver = conn->privateData; + virDomainObj *vm; virDomainPtr dom = NULL; vm = virDomainObjListFindByUUID(driver->domains, uuid); @@ -1141,8 +1139,8 @@ libxlDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) static virDomainPtr libxlDomainLookupByName(virConnectPtr conn, const char *name) { - libxlDriverPrivatePtr driver = conn->privateData; - virDomainObjPtr vm; + libxlDriverPrivate *driver = conn->privateData; + virDomainObj *vm; virDomainPtr dom = NULL; vm = virDomainObjListFindByName(driver->domains, name); @@ -1164,10 +1162,10 @@ libxlDomainLookupByName(virConnectPtr conn, const char *name) static int libxlDomainSuspend(virDomainPtr dom) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; - virObjectEventPtr event = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; + virObjectEvent *event = NULL; int ret = -1; if (!(vm = libxlDomObjFromDomain(dom))) @@ -1217,10 +1215,10 @@ libxlDomainSuspend(virDomainPtr dom) static int libxlDomainResume(virDomainPtr dom) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; - virObjectEventPtr event = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; + virObjectEvent *event = NULL; int ret = -1; if (!(vm = libxlDomObjFromDomain(dom))) @@ -1270,9 +1268,9 @@ libxlDomainResume(virDomainPtr dom) static int libxlDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; int ret = -1; virCheckFlags(VIR_DOMAIN_SHUTDOWN_ACPI_POWER_BTN | @@ -1335,9 +1333,9 @@ libxlDomainShutdown(virDomainPtr dom) static int libxlDomainReboot(virDomainPtr dom, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; int ret = -1; virCheckFlags(VIR_DOMAIN_REBOOT_PARAVIRT, -1); @@ -1376,11 +1374,11 @@ static int libxlDomainDestroyFlags(virDomainPtr dom, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; int ret = -1; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; virCheckFlags(0, -1); @@ -1439,11 +1437,11 @@ libxlDomainPMSuspendForDuration(virDomainPtr dom, unsigned long long duration, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virObjectEventPtr event = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virObjectEvent *event = NULL; virCheckFlags(0, -1); if (target != VIR_NODE_SUSPEND_TARGET_MEM) { @@ -1471,7 +1469,7 @@ libxlDomainPMSuspendForDuration(virDomainPtr dom, if (virDomainObjCheckActive(vm) < 0) goto endjob; - /* Unlock virDomainObjPtr to not deadlock with even handler, which will try + /* Unlock virDomainObj *to not deadlock with even handler, which will try * to send lifecycle event */ virObjectUnlock(vm); @@ -1503,12 +1501,12 @@ libxlDomainPMSuspendForDuration(virDomainPtr dom, static int libxlDomainPMWakeup(virDomainPtr dom, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; - virObjectEventPtr event = NULL; - libxlDomainObjPrivatePtr priv; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + virObjectEvent *event = NULL; + libxlDomainObjPrivate *priv; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); virCheckFlags(0, -1); @@ -1567,7 +1565,7 @@ libxlDomainPMWakeup(virDomainPtr dom, unsigned int flags) static char * libxlDomainGetOSType(virDomainPtr dom) { - virDomainObjPtr vm; + virDomainObj *vm; char *type = NULL; if (!(vm = libxlDomObjFromDomain(dom))) @@ -1586,7 +1584,7 @@ libxlDomainGetOSType(virDomainPtr dom) static unsigned long long libxlDomainGetMaxMemory(virDomainPtr dom) { - virDomainObjPtr vm; + virDomainObj *vm; unsigned long long ret = 0; if (!(vm = libxlDomObjFromDomain(dom))) @@ -1611,11 +1609,11 @@ libxlDomainGetMaxMemory(virDomainPtr dom) * domain configuration if needed. Return -1 on error. */ static int -virDomainLiveConfigHelperMethod(virCapsPtr caps G_GNUC_UNUSED, - virDomainXMLOptionPtr xmlopt, - virDomainObjPtr dom, +virDomainLiveConfigHelperMethod(virCaps *caps G_GNUC_UNUSED, + virDomainXMLOption *xmlopt, + virDomainObj *dom, unsigned int *flags, - virDomainDefPtr *persistentDef) + virDomainDef **persistentDef) { if (virDomainObjUpdateModificationImpact(dom, flags) < 0) return -1; @@ -1636,10 +1634,10 @@ static int libxlDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; - virDomainDefPtr persistentDef = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; + virDomainDef *persistentDef = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_MEM_LIVE | @@ -1741,9 +1739,9 @@ libxlDomainSetMaxMemory(virDomainPtr dom, unsigned long memory) static int libxlDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; libxl_dominfo d_info; int ret = -1; @@ -1788,7 +1786,7 @@ libxlDomainGetState(virDomainPtr dom, int *reason, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -1808,17 +1806,17 @@ libxlDomainGetState(virDomainPtr dom, } /* - * virDomainObjPtr must be locked on invocation + * virDomainObj *must be locked on invocation */ static int -libxlDoDomainSave(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDoDomainSave(libxlDriverPrivate *driver, + virDomainObj *vm, const char *to, bool managed) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); libxlSavefileHeader hdr; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; g_autofree char *xml = NULL; uint32_t xml_len; int fd = -1; @@ -1900,8 +1898,8 @@ static int libxlDomainSaveFlags(virDomainPtr dom, const char *to, const char *dxml, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; #ifdef LIBXL_HAVE_NO_SUSPEND_RESUME @@ -1956,10 +1954,10 @@ static int libxlDomainRestoreFlags(virConnectPtr conn, const char *from, const char *dxml, unsigned int flags) { - libxlDriverPrivatePtr driver = conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; + libxlDriverPrivate *driver = conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm = NULL; + virDomainDef *def = NULL; libxlSavefileHeader hdr; int fd = -1; int ret = -1; @@ -2023,10 +2021,10 @@ libxlDomainRestore(virConnectPtr conn, const char *from) static int libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; - virObjectEventPtr event = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; + virObjectEvent *event = NULL; bool paused = false; int ret = -1; @@ -2114,8 +2112,8 @@ libxlDomainCoreDump(virDomainPtr dom, const char *to, unsigned int flags) static int libxlDomainManagedSave(virDomainPtr dom, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + virDomainObj *vm = NULL; g_autofree char *name = NULL; int ret = -1; @@ -2163,10 +2161,10 @@ libxlDomainManagedSave(virDomainPtr dom, unsigned int flags) } static int -libxlDomainManagedSaveLoad(virDomainObjPtr vm, +libxlDomainManagedSaveLoad(virDomainObj *vm, void *opaque) { - libxlDriverPrivatePtr driver = opaque; + libxlDriverPrivate *driver = opaque; char *name; int ret = -1; @@ -2187,7 +2185,7 @@ libxlDomainManagedSaveLoad(virDomainObjPtr vm, static int libxlDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; virCheckFlags(0, -1); @@ -2208,8 +2206,8 @@ libxlDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) static int libxlDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; g_autofree char *name = NULL; @@ -2237,10 +2235,10 @@ static int libxlDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainDefPtr def; - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainDef *def; + virDomainObj *vm; libxl_bitmap map; uint8_t *bitmask = NULL; unsigned int maplen; @@ -2388,8 +2386,8 @@ libxlDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) static int libxlDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags) { - virDomainObjPtr vm; - virDomainDefPtr def; + virDomainObj *vm; + virDomainDef *def; int ret = -1; bool active; @@ -2455,12 +2453,12 @@ libxlDomainPinVcpuFlags(virDomainPtr dom, unsigned int vcpu, unsigned char *cpumap, int maplen, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainDefPtr targetDef = NULL; - virBitmapPtr pcpumap = NULL; - virDomainVcpuDefPtr vcpuinfo; - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainDef *targetDef = NULL; + virBitmap *pcpumap = NULL; + virDomainVcpuDef *vcpuinfo; + virDomainObj *vm; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -2540,10 +2538,10 @@ libxlDomainGetVcpuPinInfo(virDomainPtr dom, int ncpumaps, unsigned char *cpumaps, int maplen, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm = NULL; - virDomainDefPtr targetDef = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm = NULL; + virDomainDef *targetDef = NULL; g_autoptr(virBitmap) hostcpus = NULL; int ret = -1; @@ -2582,9 +2580,9 @@ static int libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo, unsigned char *cpumaps, int maplen) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; int ret = -1; libxl_vcpuinfo *vcpuinfo; int maxcpu, hostcpus; @@ -2642,10 +2640,10 @@ libxlDomainGetVcpus(virDomainPtr dom, virVcpuInfoPtr info, int maxinfo, static char * libxlDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; - virDomainDefPtr def; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; + virDomainDef *def; char *ret = NULL; virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS, NULL); @@ -2676,9 +2674,9 @@ libxlConnectDomainXMLFromNative(virConnectPtr conn, const char *nativeConfig, unsigned int flags) { - libxlDriverPrivatePtr driver = conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainDefPtr def = NULL; + libxlDriverPrivate *driver = conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainDef *def = NULL; g_autoptr(virConf) conf = NULL; char *xml = NULL; @@ -2726,9 +2724,9 @@ libxlConnectDomainXMLToNative(virConnectPtr conn, const char * nativeFormat, const char * domainXml, unsigned int flags) { - libxlDriverPrivatePtr driver = conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainDefPtr def = NULL; + libxlDriverPrivate *driver = conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainDef *def = NULL; g_autoptr(virConf) conf = NULL; int len = MAX_CONFIG_SIZE; char *ret = NULL; @@ -2773,7 +2771,7 @@ static int libxlConnectListDefinedDomains(virConnectPtr conn, char **const names, int nnames) { - libxlDriverPrivatePtr driver = conn->privateData; + libxlDriverPrivate *driver = conn->privateData; if (virConnectListDefinedDomainsEnsureACL(conn) < 0) return -1; @@ -2786,7 +2784,7 @@ libxlConnectListDefinedDomains(virConnectPtr conn, static int libxlConnectNumOfDefinedDomains(virConnectPtr conn) { - libxlDriverPrivatePtr driver = conn->privateData; + libxlDriverPrivate *driver = conn->privateData; if (virConnectNumOfDefinedDomainsEnsureACL(conn) < 0) return -1; @@ -2800,8 +2798,8 @@ static int libxlDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; virCheckFlags(VIR_DOMAIN_START_PAUSED, -1); @@ -2844,13 +2842,13 @@ libxlDomainCreate(virDomainPtr dom) static virDomainPtr libxlDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags) { - libxlDriverPrivatePtr driver = conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainDefPtr def = NULL; - virDomainObjPtr vm = NULL; + libxlDriverPrivate *driver = conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainDef *def = NULL; + virDomainObj *vm = NULL; virDomainPtr dom = NULL; - virObjectEventPtr event = NULL; - virDomainDefPtr oldDef = NULL; + virObjectEvent *event = NULL; + virDomainDef *oldDef = NULL; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; virCheckFlags(VIR_DOMAIN_DEFINE_VALIDATE, NULL); @@ -2909,10 +2907,10 @@ static int libxlDomainUndefineFlags(virDomainPtr dom, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; - virObjectEventPtr event = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; + virObjectEvent *event = NULL; g_autofree char *name = NULL; int ret = -1; @@ -2976,10 +2974,10 @@ libxlDomainUndefine(virDomainPtr dom) } static int -libxlDomainChangeEjectableMedia(virDomainObjPtr vm, virDomainDiskDefPtr disk) +libxlDomainChangeEjectableMedia(virDomainObj *vm, virDomainDiskDef *disk) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(libxl_driver); - virDomainDiskDefPtr origdisk = NULL; + libxlDriverConfig *cfg = libxlDriverConfigGet(libxl_driver); + virDomainDiskDef *origdisk = NULL; libxl_device_disk x_disk; size_t i; int ret = -1; @@ -3029,10 +3027,10 @@ libxlDomainChangeEjectableMedia(virDomainObjPtr vm, virDomainDiskDefPtr disk) } static int -libxlDomainAttachDeviceDiskLive(virDomainObjPtr vm, virDomainDeviceDefPtr dev) +libxlDomainAttachDeviceDiskLive(virDomainObj *vm, virDomainDeviceDef *dev) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(libxl_driver); - virDomainDiskDefPtr l_disk = dev->data.disk; + libxlDriverConfig *cfg = libxlDriverConfigGet(libxl_driver); + virDomainDiskDef *l_disk = dev->data.disk; libxl_device_disk x_disk; int ret = -1; @@ -3099,15 +3097,15 @@ libxlDomainAttachDeviceDiskLive(virDomainObjPtr vm, virDomainDeviceDefPtr dev) } static int -libxlDomainAttachHostPCIDevice(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +libxlDomainAttachHostPCIDevice(libxlDriverPrivate *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); libxl_device_pci pcidev; - virDomainHostdevDefPtr found; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; - virDomainHostdevSubsysPCIPtr pcisrc = &hostdev->source.subsys.u.pci; + virDomainHostdevDef *found; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; + virDomainHostdevSubsysPCI *pcisrc = &hostdev->source.subsys.u.pci; int ret = -1; libxl_device_pci_init(&pcidev); @@ -3156,11 +3154,11 @@ libxlDomainAttachHostPCIDevice(libxlDriverPrivatePtr driver, #ifdef LIBXL_HAVE_PVUSB static int -libxlDomainAttachControllerDevice(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, - virDomainControllerDefPtr controller) +libxlDomainAttachControllerDevice(libxlDriverPrivate *driver, + virDomainObj *vm, + virDomainControllerDef *controller) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); const char *type = virDomainControllerTypeToString(controller->type); libxl_device_usbctrl usbctrl; int ret = -1; @@ -3209,13 +3207,13 @@ libxlDomainAttachControllerDevice(libxlDriverPrivatePtr driver, } static int -libxlDomainAttachHostUSBDevice(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +libxlDomainAttachHostUSBDevice(libxlDriverPrivate *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); libxl_device_usbdev usbdev; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; int ret = -1; size_t i; int ports = 0, usbdevs = 0; @@ -3238,7 +3236,7 @@ libxlDomainAttachHostUSBDevice(libxlDriverPrivatePtr driver, if (ports <= usbdevs) { /* no free ports, we will create a new usb controller */ - virDomainControllerDefPtr controller; + virDomainControllerDef *controller; if (!(controller = virDomainControllerDefNew(VIR_DOMAIN_CONTROLLER_TYPE_USB))) goto cleanup; @@ -3289,9 +3287,9 @@ libxlDomainAttachHostUSBDevice(libxlDriverPrivatePtr driver, #endif static int -libxlDomainAttachHostDevice(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +libxlDomainAttachHostDevice(libxlDriverPrivate *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -3324,10 +3322,10 @@ libxlDomainAttachHostDevice(libxlDriverPrivatePtr driver, } static int -libxlDomainDetachDeviceDiskLive(virDomainObjPtr vm, virDomainDeviceDefPtr dev) +libxlDomainDetachDeviceDiskLive(virDomainObj *vm, virDomainDeviceDef *dev) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(libxl_driver); - virDomainDiskDefPtr l_disk = NULL; + libxlDriverConfig *cfg = libxlDriverConfigGet(libxl_driver); + virDomainDiskDef *l_disk = NULL; libxl_device_disk x_disk; int idx; int ret = -1; @@ -3384,11 +3382,11 @@ libxlDomainDetachDeviceDiskLive(virDomainObjPtr vm, virDomainDeviceDefPtr dev) } static int -libxlDomainAttachNetDevice(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, - virDomainNetDefPtr net) +libxlDomainAttachNetDevice(libxlDriverPrivate *driver, + virDomainObj *vm, + virDomainNetDef *net) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); virDomainNetType actualType; libxl_device_nic nic; int ret = -1; @@ -3426,8 +3424,8 @@ libxlDomainAttachNetDevice(libxlDriverPrivatePtr driver, } if (actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV) { - virDomainHostdevDefPtr hostdev = virDomainNetGetActualHostdev(net); - virDomainHostdevSubsysPCIPtr pcisrc = &hostdev->source.subsys.u.pci; + virDomainHostdevDef *hostdev = virDomainNetGetActualHostdev(net); + virDomainHostdevSubsysPCI *pcisrc = &hostdev->source.subsys.u.pci; /* For those just allocated from a network pool whose backend is * still VIR_DOMAIN_HOSTDEV_PCI_BACKEND_DEFAULT, we need to set @@ -3473,9 +3471,9 @@ libxlDomainAttachNetDevice(libxlDriverPrivatePtr driver, } static int -libxlDomainAttachDeviceLive(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +libxlDomainAttachDeviceLive(libxlDriverPrivate *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { int ret = -1; @@ -3519,13 +3517,13 @@ libxlDomainAttachDeviceLive(libxlDriverPrivatePtr driver, } static int -libxlDomainAttachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev) +libxlDomainAttachDeviceConfig(virDomainDef *vmdef, virDomainDeviceDef *dev) { - virDomainDiskDefPtr disk; - virDomainNetDefPtr net; - virDomainHostdevDefPtr hostdev; - virDomainControllerDefPtr controller; - virDomainHostdevDefPtr found; + virDomainDiskDef *disk; + virDomainNetDef *net; + virDomainHostdevDef *hostdev; + virDomainControllerDef *controller; + virDomainHostdevDef *found; char mac[VIR_MAC_STRING_BUFLEN]; switch (dev->type) { @@ -3600,12 +3598,12 @@ libxlDomainAttachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev) } static int -libxlComparePCIDevice(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr device G_GNUC_UNUSED, - virDomainDeviceInfoPtr info1, +libxlComparePCIDevice(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *device G_GNUC_UNUSED, + virDomainDeviceInfo *info1, void *opaque) { - virDomainDeviceInfoPtr info2 = opaque; + virDomainDeviceInfo *info2 = opaque; if (info1->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI || info2->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) @@ -3620,8 +3618,8 @@ libxlComparePCIDevice(virDomainDefPtr def G_GNUC_UNUSED, } static bool -libxlIsMultiFunctionDevice(virDomainDefPtr def, - virDomainDeviceInfoPtr dev) +libxlIsMultiFunctionDevice(virDomainDef *def, + virDomainDeviceInfo *dev) { if (virDomainDeviceInfoIterate(def, libxlComparePCIDevice, dev) < 0) return true; @@ -3629,17 +3627,17 @@ libxlIsMultiFunctionDevice(virDomainDefPtr def, } static int -libxlDomainDetachHostPCIDevice(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +libxlDomainDetachHostPCIDevice(libxlDriverPrivate *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys; - virDomainHostdevSubsysPCIPtr pcisrc = &subsys->u.pci; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainHostdevSubsys *subsys = &hostdev->source.subsys; + virDomainHostdevSubsysPCI *pcisrc = &subsys->u.pci; libxl_device_pci pcidev; - virDomainHostdevDefPtr detach; + virDomainHostdevDef *detach; int idx; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; int ret = -1; libxl_device_pci_init(&pcidev); @@ -3695,16 +3693,16 @@ libxlDomainDetachHostPCIDevice(libxlDriverPrivatePtr driver, #ifdef LIBXL_HAVE_PVUSB static int -libxlDomainDetachControllerDevice(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +libxlDomainDetachControllerDevice(libxlDriverPrivate *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { int idx, ret = -1; - virDomainControllerDefPtr detach = NULL; - virDomainControllerDefPtr controller = dev->data.controller; + virDomainControllerDef *detach = NULL; + virDomainControllerDef *controller = dev->data.controller; const char *type = virDomainControllerTypeToString(controller->type); libxl_device_usbctrl usbctrl; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); libxl_device_usbctrl_init(&usbctrl); @@ -3746,18 +3744,18 @@ libxlDomainDetachControllerDevice(libxlDriverPrivatePtr driver, } static int -libxlDomainDetachHostUSBDevice(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +libxlDomainDetachHostUSBDevice(libxlDriverPrivate *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys; - virDomainHostdevSubsysUSBPtr usbsrc = &subsys->u.usb; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainHostdevSubsys *subsys = &hostdev->source.subsys; + virDomainHostdevSubsysUSB *usbsrc = &subsys->u.usb; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; libxl_device_usbdev usbdev; libxl_device_usbdev *usbdevs = NULL; int num = 0; - virDomainHostdevDefPtr detach; + virDomainHostdevDef *detach; int idx; size_t i; bool found = false; @@ -3815,11 +3813,11 @@ libxlDomainDetachHostUSBDevice(libxlDriverPrivatePtr driver, #endif static int -libxlDomainDetachHostDevice(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +libxlDomainDetachHostDevice(libxlDriverPrivate *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { - virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys; + virDomainHostdevSubsys *subsys = &hostdev->source.subsys; if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -3847,13 +3845,13 @@ libxlDomainDetachHostDevice(libxlDriverPrivatePtr driver, } static int -libxlDomainDetachNetDevice(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, - virDomainNetDefPtr net) +libxlDomainDetachNetDevice(libxlDriverPrivate *driver, + virDomainObj *vm, + virDomainNetDef *net) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); int detachidx; - virDomainNetDefPtr detach = NULL; + virDomainNetDef *detach = NULL; libxl_device_nic nic; char mac[VIR_MAC_STRING_BUFLEN]; int ret = -1; @@ -3906,11 +3904,11 @@ libxlDomainDetachNetDevice(libxlDriverPrivatePtr driver, } static int -libxlDomainDetachDeviceLive(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +libxlDomainDetachDeviceLive(libxlDriverPrivate *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { - virDomainHostdevDefPtr hostdev; + virDomainHostdevDef *hostdev; int ret = -1; switch (dev->type) { @@ -3954,15 +3952,15 @@ libxlDomainDetachDeviceLive(libxlDriverPrivatePtr driver, static int -libxlDomainDetachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev) +libxlDomainDetachDeviceConfig(virDomainDef *vmdef, virDomainDeviceDef *dev) { - virDomainDiskDefPtr disk; - virDomainDiskDefPtr detach; - virDomainHostdevDefPtr hostdev; - virDomainHostdevDefPtr det_hostdev; - virDomainControllerDefPtr cont; - virDomainControllerDefPtr det_cont; - virDomainNetDefPtr net; + virDomainDiskDef *disk; + virDomainDiskDef *detach; + virDomainHostdevDef *hostdev; + virDomainHostdevDef *det_hostdev; + virDomainControllerDef *cont; + virDomainControllerDef *det_cont; + virDomainNetDef *net; int idx; switch (dev->type) { @@ -4019,9 +4017,9 @@ libxlDomainDetachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev) } static int -libxlDomainUpdateDeviceLive(virDomainObjPtr vm, virDomainDeviceDefPtr dev) +libxlDomainUpdateDeviceLive(virDomainObj *vm, virDomainDeviceDef *dev) { - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; int ret = -1; switch (dev->type) { @@ -4051,10 +4049,10 @@ libxlDomainUpdateDeviceLive(virDomainObjPtr vm, virDomainDeviceDefPtr dev) } static int -libxlDomainUpdateDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev) +libxlDomainUpdateDeviceConfig(virDomainDef *vmdef, virDomainDeviceDef *dev) { - virDomainDiskDefPtr orig; - virDomainDiskDefPtr disk; + virDomainDiskDef *orig; + virDomainDiskDef *disk; switch (dev->type) { case VIR_DOMAIN_DEVICE_DISK: @@ -4087,7 +4085,7 @@ libxlDomainUpdateDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev) static void libxlDomainAttachDeviceNormalize(const virDomainDeviceDef *devConf, - virDomainDeviceDefPtr devLive) + virDomainDeviceDef *devLive) { /* * Fixup anything that needs to be identical in the live and @@ -4114,13 +4112,13 @@ static int libxlDomainAttachDeviceFlags(virDomainPtr dom, const char *xml, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm = NULL; - virDomainDefPtr vmdef = NULL; - virDomainDeviceDefPtr devConf = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm = NULL; + virDomainDef *vmdef = NULL; + virDomainDeviceDef *devConf = NULL; virDomainDeviceDef devConfSave = { 0 }; - virDomainDeviceDefPtr devLive = NULL; + virDomainDeviceDef *devLive = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_DEVICE_MODIFY_LIVE | @@ -4213,11 +4211,11 @@ static int libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm = NULL; - virDomainDefPtr vmdef = NULL; - virDomainDeviceDefPtr dev = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm = NULL; + virDomainDef *vmdef = NULL; + virDomainDeviceDef *dev = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_DEVICE_MODIFY_LIVE | @@ -4303,11 +4301,11 @@ static int libxlDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm = NULL; - virDomainDefPtr vmdef = NULL; - virDomainDeviceDefPtr dev = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm = NULL; + virDomainDef *vmdef = NULL; + virDomainDeviceDef *dev = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_DEVICE_MODIFY_LIVE | @@ -4378,8 +4376,8 @@ static unsigned long long libxlNodeGetFreeMemory(virConnectPtr conn) { libxl_physinfo phy_info; - libxlDriverPrivatePtr driver = conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverPrivate *driver = conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); unsigned long long ret = 0; libxl_physinfo_init(&phy_info); @@ -4409,8 +4407,8 @@ libxlNodeGetCellsFreeMemory(virConnectPtr conn, int n, lastCell, numCells; int ret = -1, nr_nodes = 0; libxl_numainfo *numa_info = NULL; - libxlDriverPrivatePtr driver = conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverPrivate *driver = conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); if (virNodeGetCellsFreeMemoryEnsureACL(conn) < 0) goto cleanup; @@ -4454,7 +4452,7 @@ libxlConnectDomainEventRegister(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - libxlDriverPrivatePtr driver = conn->privateData; + libxlDriverPrivate *driver = conn->privateData; if (virConnectDomainEventRegisterEnsureACL(conn) < 0) return -1; @@ -4472,7 +4470,7 @@ static int libxlConnectDomainEventDeregister(virConnectPtr conn, virConnectDomainEventCallback callback) { - libxlDriverPrivatePtr driver = conn->privateData; + libxlDriverPrivate *driver = conn->privateData; if (virConnectDomainEventDeregisterEnsureACL(conn) < 0) return -1; @@ -4488,7 +4486,7 @@ libxlConnectDomainEventDeregister(virConnectPtr conn, static int libxlDomainGetAutostart(virDomainPtr dom, int *autostart) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (!(vm = libxlDomObjFromDomain(dom))) @@ -4508,9 +4506,9 @@ libxlDomainGetAutostart(virDomainPtr dom, int *autostart) static int libxlDomainSetAutostart(virDomainPtr dom, int autostart) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; g_autofree char *configFile = NULL; g_autofree char *autostartLink = NULL; int ret = -1; @@ -4579,9 +4577,9 @@ libxlDomainSetAutostart(virDomainPtr dom, int autostart) static char * libxlDomainGetSchedulerType(virDomainPtr dom, int *nparams) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; char * ret = NULL; const char *name = NULL; libxl_scheduler sched_id; @@ -4637,9 +4635,9 @@ libxlDomainGetSchedulerParametersFlags(virDomainPtr dom, int *nparams, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; libxl_domain_sched_params sc_info; libxl_scheduler sched_id; int ret = -1; @@ -4706,9 +4704,9 @@ libxlDomainSetSchedulerParametersFlags(virDomainPtr dom, int nparams, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; libxl_domain_sched_params sc_info; int sched_id; size_t i; @@ -4784,10 +4782,10 @@ libxlDomainOpenConsole(virDomainPtr dom, virStreamPtr st, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; - virDomainChrDefPtr chr = NULL; - libxlDomainObjPrivatePtr priv; + virDomainChrDef *chr = NULL; + libxlDomainObjPrivate *priv; virCheckFlags(VIR_DOMAIN_CONSOLE_FORCE, -1); @@ -4869,11 +4867,11 @@ libxlDomainGetNumaParameters(virDomainPtr dom, int *nparams, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainObj *vm; libxl_bitmap nodemap; - virBitmapPtr nodes = NULL; + virBitmap *nodes = NULL; int rc, ret = -1; size_t i, j; @@ -4983,7 +4981,7 @@ libxlDomainGetNumaParameters(virDomainPtr dom, static int libxlDomainIsActive(virDomainPtr dom) { - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = libxlDomObjFromDomain(dom))) @@ -5002,7 +5000,7 @@ libxlDomainIsActive(virDomainPtr dom) static int libxlDomainIsPersistent(virDomainPtr dom) { - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = libxlDomObjFromDomain(dom))) @@ -5021,7 +5019,7 @@ libxlDomainIsPersistent(virDomainPtr dom) static int libxlDomainIsUpdated(virDomainPtr dom) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (!(vm = libxlDomObjFromDomain(dom))) @@ -5042,9 +5040,9 @@ libxlDomainInterfaceStats(virDomainPtr dom, const char *device, virDomainInterfaceStatsPtr stats) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virDomainNetDefPtr net = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + virDomainObj *vm; + virDomainNetDef *net = NULL; int ret = -1; if (!(vm = libxlDomObjFromDomain(dom))) @@ -5077,12 +5075,12 @@ libxlDomainInterfaceStats(virDomainPtr dom, } static int -libxlDomainGetTotalCPUStats(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainGetTotalCPUStats(libxlDriverPrivate *driver, + virDomainObj *vm, virTypedParameterPtr params, unsigned int nparams) { - libxlDriverConfigPtr cfg; + libxlDriverConfig *cfg; libxl_dominfo d_info; int ret = -1; @@ -5112,8 +5110,8 @@ libxlDomainGetTotalCPUStats(libxlDriverPrivatePtr driver, } static int -libxlDomainGetPerCPUStats(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainGetPerCPUStats(libxlDriverPrivate *driver, + virDomainObj *vm, virTypedParameterPtr params, unsigned int nparams, int start_cpu, @@ -5122,7 +5120,7 @@ libxlDomainGetPerCPUStats(libxlDriverPrivatePtr driver, libxl_vcpuinfo *vcpuinfo; int maxcpu, hostcpus; size_t i; - libxlDriverConfigPtr cfg; + libxlDriverConfig *cfg; int ret = -1; if (nparams == 0 && ncpus != 0) @@ -5163,8 +5161,8 @@ libxlDomainGetCPUStats(virDomainPtr dom, unsigned int ncpus, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); @@ -5202,9 +5200,9 @@ libxlDomainMemoryStats(virDomainPtr dom, unsigned int nr_stats, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - libxlDriverConfigPtr cfg; - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + libxlDriverConfig *cfg; + virDomainObj *vm; libxl_dominfo d_info; unsigned mem, maxmem; size_t i = 0; @@ -5257,8 +5255,8 @@ static int libxlDomainGetJobInfo(virDomainPtr dom, virDomainJobInfoPtr info) { - libxlDomainObjPrivatePtr priv; - virDomainObjPtr vm; + libxlDomainObjPrivate *priv; + virDomainObj *vm; int ret = -1; if (!(vm = libxlDomObjFromDomain(dom))) @@ -5296,8 +5294,8 @@ libxlDomainGetJobStats(virDomainPtr dom, int *nparams, unsigned int flags) { - libxlDomainObjPrivatePtr priv; - virDomainObjPtr vm; + libxlDomainObjPrivate *priv; + virDomainObj *vm; virDomainJobInfoPtr jobInfo; int ret = -1; int maxparams = 0; @@ -5428,9 +5426,9 @@ libxlDiskSectorSize(int domid, int devno) } static int -libxlDomainBlockStatsVBD(virDomainObjPtr vm, +libxlDomainBlockStatsVBD(virDomainObj *vm, const char *dev, - libxlBlockStatsPtr stats) + libxlBlockStats *stats) { int ret = -1; int devno = libxlDiskPathToID(dev); @@ -5491,9 +5489,9 @@ libxlDomainBlockStatsVBD(virDomainObjPtr vm, } #else static int -libxlDomainBlockStatsVBD(virDomainObjPtr vm G_GNUC_UNUSED, +libxlDomainBlockStatsVBD(virDomainObj *vm G_GNUC_UNUSED, const char *dev G_GNUC_UNUSED, - libxlBlockStatsPtr stats G_GNUC_UNUSED) + libxlBlockStats *stats G_GNUC_UNUSED) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", _("platform unsupported")); @@ -5502,11 +5500,11 @@ libxlDomainBlockStatsVBD(virDomainObjPtr vm G_GNUC_UNUSED, #endif static int -libxlDomainBlockStatsGatherSingle(virDomainObjPtr vm, +libxlDomainBlockStatsGatherSingle(virDomainObj *vm, const char *path, - libxlBlockStatsPtr stats) + libxlBlockStats *stats) { - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; const char *disk_drv; int ret = -1, disk_fmt; @@ -5538,9 +5536,9 @@ libxlDomainBlockStatsGatherSingle(virDomainObjPtr vm, } static int -libxlDomainBlockStatsGather(virDomainObjPtr vm, +libxlDomainBlockStatsGather(virDomainObj *vm, const char *path, - libxlBlockStatsPtr stats) + libxlBlockStats *stats) { int ret = -1; @@ -5564,8 +5562,8 @@ libxlDomainBlockStats(virDomainPtr dom, const char *path, virDomainBlockStatsPtr stats) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + virDomainObj *vm; libxlBlockStats blkstats; int ret = -1; @@ -5609,8 +5607,8 @@ libxlDomainBlockStatsFlags(virDomainPtr dom, int *nparams, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - virDomainObjPtr vm; + libxlDriverPrivate *driver = dom->conn->privateData; + virDomainObj *vm; libxlBlockStats blkstats; int nstats; int ret = -1; @@ -5680,7 +5678,7 @@ libxlConnectDomainEventRegisterAny(virConnectPtr conn, virDomainPtr dom, int eve virConnectDomainEventGenericCallback callback, void *opaque, virFreeCallback freecb) { - libxlDriverPrivatePtr driver = conn->privateData; + libxlDriverPrivate *driver = conn->privateData; int ret; if (virConnectDomainEventRegisterAnyEnsureACL(conn) < 0) @@ -5699,7 +5697,7 @@ libxlConnectDomainEventRegisterAny(virConnectPtr conn, virDomainPtr dom, int eve static int libxlConnectDomainEventDeregisterAny(virConnectPtr conn, int callbackID) { - libxlDriverPrivatePtr driver = conn->privateData; + libxlDriverPrivate *driver = conn->privateData; if (virConnectDomainEventDeregisterAnyEnsureACL(conn) < 0) return -1; @@ -5724,7 +5722,7 @@ libxlConnectListAllDomains(virConnectPtr conn, virDomainPtr **domains, unsigned int flags) { - libxlDriverPrivatePtr driver = conn->privateData; + libxlDriverPrivate *driver = conn->privateData; virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1); @@ -5770,8 +5768,8 @@ libxlNodeDeviceDetachFlags(virNodeDevicePtr dev, const char *driverName, unsigned int flags) { - libxlDriverPrivatePtr driver = dev->conn->privateData; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + libxlDriverPrivate *driver = dev->conn->privateData; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; virCheckFlags(0, -1); @@ -5798,8 +5796,8 @@ libxlNodeDeviceDettach(virNodeDevicePtr dev) static int libxlNodeDeviceReAttach(virNodeDevicePtr dev) { - libxlDriverPrivatePtr driver = dev->conn->privateData; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + libxlDriverPrivate *driver = dev->conn->privateData; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; /* virNodeDeviceReAttachEnsureACL() is being called by * virDomainDriverNodeDeviceReAttach() */ @@ -5809,8 +5807,8 @@ libxlNodeDeviceReAttach(virNodeDevicePtr dev) static int libxlNodeDeviceReset(virNodeDevicePtr dev) { - libxlDriverPrivatePtr driver = dev->conn->privateData; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + libxlDriverPrivate *driver = dev->conn->privateData; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; /* virNodeDeviceResetEnsureACL() is being called by * virDomainDriverNodeDeviceReset() */ @@ -5826,7 +5824,7 @@ libxlDomainMigrateBegin3Params(virDomainPtr domain, unsigned int flags) { const char *xmlin = NULL; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; char *xmlout = NULL; #ifdef LIBXL_HAVE_NO_SUSPEND_RESUME @@ -5877,8 +5875,8 @@ libxlDomainMigratePrepareTunnel3Params(virConnectPtr dconn, int *cookieoutlen G_GNUC_UNUSED, unsigned int flags) { - libxlDriverPrivatePtr driver = dconn->privateData; - virDomainDefPtr def = NULL; + libxlDriverPrivate *driver = dconn->privateData; + virDomainDef *def = NULL; const char *dom_xml = NULL; const char *dname = NULL; const char *uri_in = NULL; @@ -5932,8 +5930,8 @@ libxlDomainMigratePrepare3Params(virConnectPtr dconn, char **uri_out, unsigned int flags) { - libxlDriverPrivatePtr driver = dconn->privateData; - virDomainDefPtr def = NULL; + libxlDriverPrivate *driver = dconn->privateData; + virDomainDef *def = NULL; const char *dom_xml = NULL; const char *dname = NULL; const char *uri_in = NULL; @@ -5987,8 +5985,8 @@ libxlDomainMigratePerform3Params(virDomainPtr dom, int *cookieoutlen G_GNUC_UNUSED, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + libxlDriverPrivate *driver = dom->conn->privateData; + virDomainObj *vm = NULL; const char *dom_xml = NULL; const char *dname = NULL; const char *uri = NULL; @@ -6049,8 +6047,8 @@ libxlDomainMigrateFinish3Params(virConnectPtr dconn, unsigned int flags, int cancelled) { - libxlDriverPrivatePtr driver = dconn->privateData; - virDomainObjPtr vm = NULL; + libxlDriverPrivate *driver = dconn->privateData; + virDomainObj *vm = NULL; const char *dname = NULL; virDomainPtr ret = NULL; @@ -6099,8 +6097,8 @@ libxlDomainMigrateConfirm3Params(virDomainPtr domain, unsigned int flags, int cancelled) { - libxlDriverPrivatePtr driver = domain->conn->privateData; - virDomainObjPtr vm = NULL; + libxlDriverPrivate *driver = domain->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; #ifdef LIBXL_HAVE_NO_SUSPEND_RESUME @@ -6144,7 +6142,7 @@ static int libxlNodeGetSecurityModel(virConnectPtr conn, } static int -libxlGetDHCPInterfaces(virDomainObjPtr vm, +libxlGetDHCPInterfaces(virDomainObj *vm, virDomainInterfacePtr **ifaces) { g_autoptr(virConnect) conn = NULL; @@ -6225,7 +6223,7 @@ libxlDomainInterfaceAddresses(virDomainPtr dom, unsigned int source, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; virCheckFlags(0, -1); @@ -6265,11 +6263,11 @@ libxlConnectGetDomainCapabilities(virConnectPtr conn, const char *virttype_str, unsigned int flags) { - libxlDriverPrivatePtr driver = conn->privateData; - libxlDriverConfigPtr cfg; + libxlDriverPrivate *driver = conn->privateData; + libxlDriverConfig *cfg; char *ret = NULL; int virttype = VIR_DOMAIN_VIRT_XEN; - virDomainCapsPtr domCaps = NULL; + virDomainCaps *domCaps = NULL; int arch = virArchFromHost(); /* virArch */ virCheckFlags(0, ret); @@ -6337,8 +6335,8 @@ libxlConnectCompareCPU(virConnectPtr conn, const char *xmlDesc, unsigned int flags) { - libxlDriverPrivatePtr driver = conn->privateData; - libxlDriverConfigPtr cfg; + libxlDriverPrivate *driver = conn->privateData; + libxlDriverConfig *cfg; int ret = VIR_CPU_COMPARE_ERROR; bool failIncompatible; bool validateXML; @@ -6368,8 +6366,8 @@ libxlConnectBaselineCPU(virConnectPtr conn, unsigned int ncpus, unsigned int flags) { - virCPUDefPtr *cpus = NULL; - virCPUDefPtr cpu = NULL; + virCPUDef **cpus = NULL; + virCPUDef *cpu = NULL; char *cpustr = NULL; virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES | @@ -6406,9 +6404,9 @@ libxlDomainSetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - libxlDriverPrivatePtr driver = dom->conn->privateData; + libxlDriverPrivate *driver = dom->conn->privateData; g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver); - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -6428,7 +6426,7 @@ libxlDomainSetMetadata(virDomainPtr dom, cfg->configDir, flags); if (ret == 0) { - virObjectEventPtr ev = NULL; + virObjectEvent *ev = NULL; ev = virDomainEventMetadataChangeNewFromObj(vm, type, uri); virObjectEventStateQueue(driver->domainEventState, ev); } @@ -6446,7 +6444,7 @@ libxlDomainGetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; char *ret = NULL; if (!(vm = libxlDomObjFromDomain(dom))) diff --git a/src/libxl/libxl_logger.c b/src/libxl/libxl_logger.c index 1da3357c6d..0807383d39 100644 --- a/src/libxl/libxl_logger.c +++ b/src/libxl/libxl_logger.c @@ -128,7 +128,7 @@ libvirt_destroy(xentoollog_logger *logger_in) } -libxlLoggerPtr +libxlLogger * libxlLoggerNew(const char *logDir, virLogPriority minLevel) { xentoollog_logger_libvirt logger; @@ -164,7 +164,7 @@ libxlLoggerNew(const char *logDir, virLogPriority minLevel) } void -libxlLoggerFree(libxlLoggerPtr logger) +libxlLoggerFree(libxlLogger *logger) { xentoollog_logger *xtl_logger = (xentoollog_logger*)logger; if (logger->defaultLogFile) @@ -174,7 +174,7 @@ libxlLoggerFree(libxlLoggerPtr logger) } void -libxlLoggerOpenFile(libxlLoggerPtr logger, +libxlLoggerOpenFile(libxlLogger *logger, int id, const char *name, const char *domain_config) @@ -201,7 +201,7 @@ libxlLoggerOpenFile(libxlLoggerPtr logger, } void -libxlLoggerCloseFile(libxlLoggerPtr logger, int id) +libxlLoggerCloseFile(libxlLogger *logger, int id) { g_autofree char *domidstr = NULL; domidstr = g_strdup_printf("%d", id); diff --git a/src/libxl/libxl_logger.h b/src/libxl/libxl_logger.h index a09c6496f3..934a353018 100644 --- a/src/libxl/libxl_logger.h +++ b/src/libxl/libxl_logger.h @@ -23,12 +23,11 @@ #include "util/virlog.h" typedef struct xentoollog_logger_libvirt libxlLogger; -typedef libxlLogger *libxlLoggerPtr; -libxlLoggerPtr libxlLoggerNew(const char *logDir, +libxlLogger *libxlLoggerNew(const char *logDir, virLogPriority minLevel); -void libxlLoggerFree(libxlLoggerPtr logger); +void libxlLoggerFree(libxlLogger *logger); -void libxlLoggerOpenFile(libxlLoggerPtr logger, int id, const char *name, +void libxlLoggerOpenFile(libxlLogger *logger, int id, const char *name, const char *domain_config); -void libxlLoggerCloseFile(libxlLoggerPtr logger, int id); +void libxlLoggerCloseFile(libxlLogger *logger, int id); diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c index 39d83cd26c..0af6e0d09a 100644 --- a/src/libxl/libxl_migration.c +++ b/src/libxl/libxl_migration.c @@ -49,7 +49,6 @@ VIR_LOG_INIT("libxl.libxl_migration"); typedef struct _libxlMigrationCookie libxlMigrationCookie; -typedef libxlMigrationCookie *libxlMigrationCookiePtr; struct _libxlMigrationCookie { /* Host properties */ char *srcHostname; @@ -65,20 +64,20 @@ typedef struct _libxlMigrationDstArgs { int recvfd; virConnectPtr conn; - virDomainObjPtr vm; + virDomainObj *vm; unsigned int flags; - libxlMigrationCookiePtr migcookie; + libxlMigrationCookie *migcookie; /* for freeing listen sockets */ - virNetSocketPtr *socks; + virNetSocket **socks; size_t nsocks; } libxlMigrationDstArgs; -static virClassPtr libxlMigrationDstArgsClass; +static virClass *libxlMigrationDstArgsClass; static void -libxlMigrationCookieFree(libxlMigrationCookiePtr mig) +libxlMigrationCookieFree(libxlMigrationCookie *mig) { if (!mig) return; @@ -88,10 +87,10 @@ libxlMigrationCookieFree(libxlMigrationCookiePtr mig) g_free(mig); } -static libxlMigrationCookiePtr -libxlMigrationCookieNew(virDomainObjPtr dom) +static libxlMigrationCookie * +libxlMigrationCookieNew(virDomainObj *dom) { - libxlMigrationCookiePtr mig = NULL; + libxlMigrationCookie *mig = NULL; mig = g_new0(libxlMigrationCookie, 1); @@ -113,7 +112,7 @@ libxlMigrationCookieNew(virDomainObjPtr dom) static int -libxlMigrationBakeCookie(libxlMigrationCookiePtr mig, +libxlMigrationBakeCookie(libxlMigrationCookie *mig, char **cookieout, int *cookieoutlen) { @@ -146,9 +145,9 @@ libxlMigrationBakeCookie(libxlMigrationCookiePtr mig, static int libxlMigrationEatCookie(const char *cookiein, int cookieinlen, - libxlMigrationCookiePtr *migout) + libxlMigrationCookie **migout) { - libxlMigrationCookiePtr mig = NULL; + libxlMigrationCookie *mig = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr ctxt = NULL; g_autofree char *uuidstr = NULL; @@ -248,10 +247,10 @@ static void libxlDoMigrateDstReceive(void *opaque) { libxlMigrationDstArgs *args = opaque; - virDomainObjPtr vm = args->vm; - virNetSocketPtr *socks = args->socks; + virDomainObj *vm = args->vm; + virNetSocket **socks = args->socks; size_t nsocks = args->nsocks; - libxlDriverPrivatePtr driver = args->conn->privateData; + libxlDriverPrivate *driver = args->conn->privateData; int recvfd = args->recvfd; size_t i; @@ -280,15 +279,15 @@ libxlDoMigrateDstReceive(void *opaque) static void -libxlMigrateDstReceive(virNetSocketPtr sock, +libxlMigrateDstReceive(virNetSocket *sock, int events G_GNUC_UNUSED, void *opaque) { libxlMigrationDstArgs *args = opaque; - virNetSocketPtr *socks = args->socks; + virNetSocket **socks = args->socks; size_t nsocks = args->nsocks; - libxlDomainObjPrivatePtr priv = args->vm->privateData; - virNetSocketPtr client_sock; + libxlDomainObjPrivate *priv = args->vm->privateData; + virNetSocket *client_sock; int recvfd = -1; size_t i; g_autofree char *name = NULL; @@ -339,12 +338,12 @@ libxlMigrateDstReceive(virNetSocketPtr sock, } static int -libxlDoMigrateSrcSend(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDoMigrateSrcSend(libxlDriverPrivate *driver, + virDomainObj *vm, unsigned long flags, int sockfd) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); int xl_flags = 0; int ret; @@ -364,7 +363,7 @@ libxlDoMigrateSrcSend(libxlDriverPrivatePtr driver, } static bool -libxlDomainMigrationIsAllowed(virDomainDefPtr def) +libxlDomainMigrationIsAllowed(virDomainDef *def) { /* Migration is not allowed if definition contains any hostdevs */ if (def->nhostdevs > 0) { @@ -378,16 +377,16 @@ libxlDomainMigrationIsAllowed(virDomainDefPtr def) char * libxlDomainMigrationSrcBegin(virConnectPtr conn, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlin, char **cookieout, int *cookieoutlen) { - libxlDriverPrivatePtr driver = conn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - libxlMigrationCookiePtr mig = NULL; - virDomainDefPtr tmpdef = NULL; - virDomainDefPtr def; + libxlDriverPrivate *driver = conn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + libxlMigrationCookie *mig = NULL; + virDomainDef *tmpdef = NULL; + virDomainDef *def; char *xml = NULL; /* @@ -438,13 +437,13 @@ libxlDomainMigrationSrcBegin(virConnectPtr conn, return xml; } -virDomainDefPtr -libxlDomainMigrationDstPrepareDef(libxlDriverPrivatePtr driver, +virDomainDef * +libxlDomainMigrationDstPrepareDef(libxlDriverPrivate *driver, const char *dom_xml, const char *dname) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - virDomainDefPtr def; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + virDomainDef *def; if (!dom_xml) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -470,14 +469,14 @@ libxlDomainMigrationDstPrepareDef(libxlDriverPrivatePtr driver, static int libxlDomainMigrationPrepareAny(virConnectPtr dconn, - virDomainDefPtr *def, + virDomainDef **def, const char *cookiein, int cookieinlen, - libxlMigrationCookiePtr *mig, + libxlMigrationCookie **mig, char **xmlout, bool *taint_hook) { - libxlDriverPrivatePtr driver = dconn->privateData; + libxlDriverPrivate *driver = dconn->privateData; if (libxlMigrationEatCookie(cookiein, cookieinlen, mig) < 0) return -1; @@ -511,7 +510,7 @@ libxlDomainMigrationPrepareAny(virConnectPtr dconn, VIR_DEBUG("Migrate hook filter returned nothing; using the" " original XML"); } else { - virDomainDefPtr newdef; + virDomainDef *newdef; VIR_DEBUG("Using hook-filtered domain XML: %s", *xmlout); newdef = virDomainDefParseString(*xmlout, driver->xmlopt, @@ -540,17 +539,17 @@ libxlDomainMigrationPrepareAny(virConnectPtr dconn, int libxlDomainMigrationDstPrepareTunnel3(virConnectPtr dconn, virStreamPtr st, - virDomainDefPtr *def, + virDomainDef **def, const char *cookiein, int cookieinlen, unsigned int flags) { - libxlMigrationCookiePtr mig = NULL; - libxlDriverPrivatePtr driver = dconn->privateData; - virDomainObjPtr vm = NULL; + libxlMigrationCookie *mig = NULL; + libxlDriverPrivate *driver = dconn->privateData; + virDomainObj *vm = NULL; libxlMigrationDstArgs *args = NULL; bool taint_hook = false; - libxlDomainObjPrivatePtr priv = NULL; + libxlDomainObjPrivate *priv = NULL; char *xmlout = NULL; int dataFD[2] = { -1, -1 }; int ret = -1; @@ -641,28 +640,28 @@ libxlDomainMigrationDstPrepareTunnel3(virConnectPtr dconn, int libxlDomainMigrationDstPrepare(virConnectPtr dconn, - virDomainDefPtr *def, + virDomainDef **def, const char *uri_in, char **uri_out, const char *cookiein, int cookieinlen, unsigned int flags) { - libxlDriverPrivatePtr driver = dconn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - libxlMigrationCookiePtr mig = NULL; - virDomainObjPtr vm = NULL; + libxlDriverPrivate *driver = dconn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + libxlMigrationCookie *mig = NULL; + virDomainObj *vm = NULL; char *hostname = NULL; char *xmlout = NULL; unsigned short port; char portstr[100]; - virURIPtr uri = NULL; - virNetSocketPtr *socks = NULL; + virURI *uri = NULL; + virNetSocket **socks = NULL; size_t nsocks = 0; int nsocks_listen = 0; libxlMigrationDstArgs *args = NULL; bool taint_hook = false; - libxlDomainObjPrivatePtr priv = NULL; + libxlDomainObjPrivate *priv = NULL; size_t i; int ret = -1; @@ -897,8 +896,8 @@ struct libxlTunnelControl { }; static int -libxlMigrationSrcStartTunnel(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlMigrationSrcStartTunnel(libxlDriverPrivate *driver, + virDomainObj *vm, unsigned long flags, virStreamPtr st, struct libxlTunnelControl **tnl) @@ -960,8 +959,8 @@ static void libxlMigrationSrcStopTunnel(struct libxlTunnelControl *tc) * introduced in libxl. */ static int -libxlDoMigrateSrcP2P(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDoMigrateSrcP2P(libxlDriverPrivate *driver, + virDomainObj *vm, virConnectPtr sconn, const char *xmlin, virConnectPtr dconn, @@ -1130,8 +1129,8 @@ static virConnectAuth virConnectAuthConfig = { * the migration process with an established virConnectPtr to the destination. */ int -libxlDomainMigrationSrcPerformP2P(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainMigrationSrcPerformP2P(libxlDriverPrivate *driver, + virDomainObj *vm, virConnectPtr sconn, const char *xmlin, const char *dconnuri, @@ -1143,7 +1142,7 @@ libxlDomainMigrationSrcPerformP2P(libxlDriverPrivatePtr driver, int useParams; virConnectPtr dconn = NULL; virErrorPtr orig_err = NULL; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); virObjectUnlock(vm); dconn = virConnectOpenAuth(dconnuri, &virConnectAuthConfig, 0); @@ -1195,20 +1194,20 @@ libxlDomainMigrationSrcPerformP2P(libxlDriverPrivatePtr driver, } int -libxlDomainMigrationSrcPerform(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainMigrationSrcPerform(libxlDriverPrivate *driver, + virDomainObj *vm, const char *dom_xml G_GNUC_UNUSED, const char *dconnuri G_GNUC_UNUSED, const char *uri_str, const char *dname G_GNUC_UNUSED, unsigned int flags) { - libxlDomainObjPrivatePtr priv = vm->privateData; + libxlDomainObjPrivate *priv = vm->privateData; char *hostname = NULL; unsigned short port = 0; char portstr[100]; - virURIPtr uri = NULL; - virNetSocketPtr sock; + virURI *uri = NULL; + virNetSocket *sock; int sockfd = -1; int ret = -1; @@ -1263,14 +1262,14 @@ libxlDomainMigrationSrcPerform(libxlDriverPrivatePtr driver, virDomainPtr libxlDomainMigrationDstFinish(virConnectPtr dconn, - virDomainObjPtr vm, + virDomainObj *vm, unsigned int flags, int cancelled) { - libxlDriverPrivatePtr driver = dconn->privateData; - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - libxlDomainObjPrivatePtr priv = vm->privateData; - virObjectEventPtr event = NULL; + libxlDriverPrivate *driver = dconn->privateData; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + libxlDomainObjPrivate *priv = vm->privateData; + virObjectEvent *event = NULL; virDomainPtr dom = NULL; if (priv->migrationDstReceiveThr) { @@ -1320,7 +1319,7 @@ libxlDomainMigrationDstFinish(virConnectPtr dconn, if (flags & VIR_MIGRATE_PERSIST_DEST) { unsigned int oldPersist = vm->persistent; - virDomainDefPtr vmdef; + virDomainDef *vmdef; vm->persistent = 1; if (!(vmdef = virDomainObjGetPersistentDef(driver->xmlopt, vm, NULL))) @@ -1363,14 +1362,14 @@ libxlDomainMigrationDstFinish(virConnectPtr dconn, } int -libxlDomainMigrationSrcConfirm(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainMigrationSrcConfirm(libxlDriverPrivate *driver, + virDomainObj *vm, unsigned int flags, int cancelled) { - libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver); - libxlDomainObjPrivatePtr priv = vm->privateData; - virObjectEventPtr event = NULL; + libxlDriverConfig *cfg = libxlDriverConfigGet(driver); + libxlDomainObjPrivate *priv = vm->privateData; + virObjectEvent *event = NULL; int ret = -1; if (cancelled) { diff --git a/src/libxl/libxl_migration.h b/src/libxl/libxl_migration.h index b733d21cd2..078510c672 100644 --- a/src/libxl/libxl_migration.h +++ b/src/libxl/libxl_migration.h @@ -39,27 +39,27 @@ char * libxlDomainMigrationSrcBegin(virConnectPtr conn, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlin, char **cookieout, int *cookieoutlen); -virDomainDefPtr -libxlDomainMigrationDstPrepareDef(libxlDriverPrivatePtr driver, +virDomainDef * +libxlDomainMigrationDstPrepareDef(libxlDriverPrivate *driver, const char *dom_xml, const char *dname); int libxlDomainMigrationDstPrepareTunnel3(virConnectPtr dconn, virStreamPtr st, - virDomainDefPtr *def, + virDomainDef **def, const char *cookiein, int cookieinlen, unsigned int flags); int libxlDomainMigrationDstPrepare(virConnectPtr dconn, - virDomainDefPtr *def, + virDomainDef **def, const char *uri_in, char **uri_out, const char *cookiein, @@ -67,8 +67,8 @@ libxlDomainMigrationDstPrepare(virConnectPtr dconn, unsigned int flags); int -libxlDomainMigrationSrcPerformP2P(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainMigrationSrcPerformP2P(libxlDriverPrivate *driver, + virDomainObj *vm, virConnectPtr sconn, const char *dom_xml, const char *dconnuri, @@ -77,8 +77,8 @@ libxlDomainMigrationSrcPerformP2P(libxlDriverPrivatePtr driver, unsigned int flags); int -libxlDomainMigrationSrcPerform(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainMigrationSrcPerform(libxlDriverPrivate *driver, + virDomainObj *vm, const char *dom_xml, const char *dconnuri, const char *uri_str, @@ -87,12 +87,12 @@ libxlDomainMigrationSrcPerform(libxlDriverPrivatePtr driver, virDomainPtr libxlDomainMigrationDstFinish(virConnectPtr dconn, - virDomainObjPtr vm, + virDomainObj *vm, unsigned int flags, int cancelled); int -libxlDomainMigrationSrcConfirm(libxlDriverPrivatePtr driver, - virDomainObjPtr vm, +libxlDomainMigrationSrcConfirm(libxlDriverPrivate *driver, + virDomainObj *vm, unsigned int flags, int cancelled); diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index 49a816add2..12a44280cb 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -40,12 +40,12 @@ * Convenience method to grab a long int from the config file object */ int -xenConfigGetBool(virConfPtr conf, +xenConfigGetBool(virConf *conf, const char *name, int *value, int def) { - virConfValuePtr val; + virConfValue *val; *value = 0; if (!(val = virConfGetValue(conf, name))) { @@ -70,12 +70,12 @@ xenConfigGetBool(virConfPtr conf, * Convenience method to grab a int from the config file object */ int -xenConfigGetULong(virConfPtr conf, +xenConfigGetULong(virConf *conf, const char *name, unsigned long *value, unsigned long def) { - virConfValuePtr val; + virConfValue *val; *value = 0; if (!(val = virConfGetValue(conf, name))) { @@ -104,12 +104,12 @@ xenConfigGetULong(virConfPtr conf, * Convenience method to grab a int from the config file object */ static int -xenConfigGetULongLong(virConfPtr conf, +xenConfigGetULongLong(virConf *conf, const char *name, unsigned long long *value, unsigned long long def) { - virConfValuePtr val; + virConfValue *val; *value = 0; if (!(val = virConfGetValue(conf, name))) { @@ -135,7 +135,7 @@ xenConfigGetULongLong(virConfPtr conf, static int -xenConfigCopyStringInternal(virConfPtr conf, +xenConfigCopyStringInternal(virConf *conf, const char *name, char **value, int allowMissing) @@ -159,14 +159,14 @@ xenConfigCopyStringInternal(virConfPtr conf, int -xenConfigCopyString(virConfPtr conf, const char *name, char **value) +xenConfigCopyString(virConf *conf, const char *name, char **value) { return xenConfigCopyStringInternal(conf, name, value, 0); } int -xenConfigCopyStringOpt(virConfPtr conf, const char *name, char **value) +xenConfigCopyStringOpt(virConf *conf, const char *name, char **value) { return xenConfigCopyStringInternal(conf, name, value, 1); } @@ -176,7 +176,7 @@ xenConfigCopyStringOpt(virConfPtr conf, const char *name, char **value) * Convenience method to grab a string UUID from the config file object */ static int -xenConfigGetUUID(virConfPtr conf, const char *name, unsigned char *uuid) +xenConfigGetUUID(virConf *conf, const char *name, unsigned char *uuid) { g_autofree char *string = NULL; int rc; @@ -221,7 +221,7 @@ xenConfigGetUUID(virConfPtr conf, const char *name, unsigned char *uuid) * Convenience method to grab a string from the config file object */ int -xenConfigGetString(virConfPtr conf, +xenConfigGetString(virConf *conf, const char *name, char **value, const char *def) @@ -244,9 +244,9 @@ xenConfigGetString(virConfPtr conf, int -xenConfigSetInt(virConfPtr conf, const char *setting, long long l) +xenConfigSetInt(virConf *conf, const char *setting, long long l) { - virConfValuePtr value = NULL; + virConfValue *value = NULL; if ((long)l != l) { virReportError(VIR_ERR_OVERFLOW, _("failed to store %lld to %s"), @@ -264,9 +264,9 @@ xenConfigSetInt(virConfPtr conf, const char *setting, long long l) int -xenConfigSetString(virConfPtr conf, const char *setting, const char *str) +xenConfigSetString(virConf *conf, const char *setting, const char *str) { - virConfValuePtr value = NULL; + virConfValue *value = NULL; value = g_new0(virConfValue, 1); @@ -279,7 +279,7 @@ xenConfigSetString(virConfPtr conf, const char *setting, const char *str) static int -xenParseMem(virConfPtr conf, virDomainDefPtr def) +xenParseMem(virConf *conf, virDomainDef *def) { unsigned long long memory; @@ -299,7 +299,7 @@ xenParseMem(virConfPtr conf, virDomainDefPtr def) static int -xenParseTimeOffset(virConfPtr conf, virDomainDefPtr def) +xenParseTimeOffset(virConf *conf, virDomainDef *def) { int vmlocaltime; @@ -329,7 +329,7 @@ xenParseTimeOffset(virConfPtr conf, virDomainDefPtr def) static int -xenParseEventsActions(virConfPtr conf, virDomainDefPtr def) +xenParseEventsActions(virConf *conf, virDomainDef *def) { g_autofree char *on_poweroff = NULL; g_autofree char *on_reboot = NULL; @@ -366,10 +366,10 @@ xenParseEventsActions(virConfPtr conf, virDomainDefPtr def) } -static virDomainHostdevDefPtr +static virDomainHostdevDef * xenParsePCI(char *entry) { - virDomainHostdevDefPtr hostdev = NULL; + virDomainHostdevDef *hostdev = NULL; g_auto(GStrv) tokens = NULL; g_auto(GStrv) options = NULL; size_t nexttoken = 0; @@ -479,7 +479,7 @@ xenHandleConfGetValueStringListErrors(int ret) static int -xenParsePCIList(virConfPtr conf, virDomainDefPtr def) +xenParsePCIList(virConf *conf, virDomainDef *def) { g_auto(GStrv) pcis = NULL; char **entries = NULL; @@ -490,7 +490,7 @@ xenParsePCIList(virConfPtr conf, virDomainDefPtr def) for (entries = pcis; *entries; entries++) { char *entry = *entries; - virDomainHostdevDefPtr hostdev; + virDomainHostdevDef *hostdev; if (!(hostdev = xenParsePCI(entry))) return -1; @@ -506,9 +506,9 @@ xenParsePCIList(virConfPtr conf, virDomainDefPtr def) static int -xenParseCPU(virConfPtr conf, - virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt) +xenParseCPU(virConf *conf, + virDomainDef *def, + virDomainXMLOption *xmlopt) { unsigned long count = 0; g_autofree char *cpus = NULL; @@ -541,10 +541,10 @@ xenParseCPU(virConfPtr conf, static int -xenParseHypervisorFeatures(virConfPtr conf, virDomainDefPtr def) +xenParseHypervisorFeatures(virConf *conf, virDomainDef *def) { g_autofree char *strval = NULL; - virDomainTimerDefPtr timer; + virDomainTimerDef *timer; int val = 0; if (xenConfigGetString(conf, "tsc_mode", &strval, NULL) < 0) @@ -650,12 +650,12 @@ xenParseHypervisorFeatures(virConfPtr conf, virDomainDefPtr def) #define MAX_VFB 1024 static int -xenParseVfb(virConfPtr conf, virDomainDefPtr def) +xenParseVfb(virConf *conf, virDomainDef *def) { int val; char *listenAddr = NULL; int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM; - virDomainGraphicsDefPtr graphics = NULL; + virDomainGraphicsDef *graphics = NULL; if (hvm) { if (xenConfigGetBool(conf, "vnc", &val, 0) < 0) @@ -683,7 +683,7 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) goto cleanup; if (xenConfigCopyStringOpt(conf, "keymap", &graphics->data.vnc.keymap) < 0) goto cleanup; - def->graphics = g_new0(virDomainGraphicsDefPtr, 1); + def->graphics = g_new0(virDomainGraphicsDef *, 1); def->graphics[0] = graphics; def->ngraphics = 1; graphics = NULL; @@ -697,7 +697,7 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) goto cleanup; if (xenConfigCopyStringOpt(conf, "xauthority", &graphics->data.sdl.xauth) < 0) goto cleanup; - def->graphics = g_new0(virDomainGraphicsDefPtr, 1); + def->graphics = g_new0(virDomainGraphicsDef *, 1); def->graphics[0] = graphics; def->ngraphics = 1; graphics = NULL; @@ -775,7 +775,7 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) goto cleanup; VIR_FREE(listenAddr); } - def->graphics = g_new0(virDomainGraphicsDefPtr, 1); + def->graphics = g_new0(virDomainGraphicsDef *, 1); def->graphics[0] = graphics; def->ngraphics = 1; graphics = NULL; @@ -803,13 +803,13 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) * * Returns a character device object or NULL in case of failure. */ -static virDomainChrDefPtr +static virDomainChrDef * xenParseSxprChar(const char *value, const char *tty) { const char *prefix; char *tmp; - virDomainChrDefPtr def; + virDomainChrDef *def; if (!(def = virDomainChrDefNew(NULL))) return NULL; @@ -936,10 +936,10 @@ xenParseSxprChar(const char *value, static int -xenParseCharDev(virConfPtr conf, virDomainDefPtr def, const char *nativeFormat) +xenParseCharDev(virConf *conf, virDomainDef *def, const char *nativeFormat) { g_auto(GStrv) serials = NULL; - virDomainChrDefPtr chr = NULL; + virDomainChrDef *chr = NULL; if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) { g_autofree char *parallel = NULL; @@ -951,7 +951,7 @@ xenParseCharDev(virConfPtr conf, virDomainDefPtr def, const char *nativeFormat) !(chr = xenParseSxprChar(parallel, NULL))) goto cleanup; if (chr) { - def->parallels = g_new0(virDomainChrDefPtr, 1); + def->parallels = g_new0(virDomainChrDef *, 1); chr->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_PARALLEL; chr->target.port = 0; @@ -998,7 +998,7 @@ xenParseCharDev(virConfPtr conf, virDomainDefPtr def, const char *nativeFormat) !(chr = xenParseSxprChar(serial, NULL))) goto cleanup; if (chr) { - def->serials = g_new0(virDomainChrDefPtr, 1); + def->serials = g_new0(virDomainChrDef *, 1); chr->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL; chr->target.port = 0; def->serials[0] = chr; @@ -1006,7 +1006,7 @@ xenParseCharDev(virConfPtr conf, virDomainDefPtr def, const char *nativeFormat) } } } else { - def->consoles = g_new0(virDomainChrDefPtr, 1); + def->consoles = g_new0(virDomainChrDef *, 1); def->nconsoles = 1; if (!(def->consoles[0] = xenParseSxprChar("pty", NULL))) goto cleanup; @@ -1024,7 +1024,7 @@ xenParseCharDev(virConfPtr conf, virDomainDefPtr def, const char *nativeFormat) static int -xenParseVifBridge(virDomainNetDefPtr net, const char *bridge) +xenParseVifBridge(virDomainNetDef *net, const char *bridge) { char *vlanstr; unsigned int tag; @@ -1133,11 +1133,11 @@ xenParseSxprVifRate(const char *rate, unsigned long long *kbytes_per_sec) } -static virDomainNetDefPtr +static virDomainNetDef * xenParseVif(char *entry, const char *vif_typename) { - virDomainNetDefPtr net = NULL; - virDomainNetDefPtr ret = NULL; + virDomainNetDef *net = NULL; + virDomainNetDef *ret = NULL; g_auto(GStrv) keyvals = NULL; GStrv keyval; const char *script = NULL; @@ -1234,7 +1234,7 @@ xenParseVif(char *entry, const char *vif_typename) net->ifname = g_strdup(vifname); if (rate) { - virNetDevBandwidthPtr bandwidth; + virNetDevBandwidth *bandwidth; unsigned long long kbytes_per_sec; if (xenParseSxprVifRate(rate, &kbytes_per_sec) < 0) @@ -1255,15 +1255,15 @@ xenParseVif(char *entry, const char *vif_typename) static int -xenParseVifList(virConfPtr conf, virDomainDefPtr def, const char *vif_typename) +xenParseVifList(virConf *conf, virDomainDef *def, const char *vif_typename) { - virConfValuePtr list = virConfGetValue(conf, "vif"); + virConfValue *list = virConfGetValue(conf, "vif"); if (!list || list->type != VIR_CONF_LIST) return 0; for (list = list->list; list; list = list->next) { - virDomainNetDefPtr net = NULL; + virDomainNetDef *net = NULL; int rc; if ((list->type != VIR_CONF_STRING) || (list->str == NULL)) @@ -1293,7 +1293,7 @@ xenParseVifList(virConfPtr conf, virDomainDefPtr def, const char *vif_typename) * Returns 0 if successful or -1 if failed. */ static int -xenParseSxprSound(virDomainDefPtr def, +xenParseSxprSound(virDomainDef *def, const char *str) { if (STREQ(str, "all")) { @@ -1312,11 +1312,11 @@ xenParseSxprSound(virDomainDefPtr def, * Hence use of MODEL_ES1370 + 1, instead of MODEL_LAST */ - def->sounds = g_new0(virDomainSoundDefPtr, + def->sounds = g_new0(virDomainSoundDef *, VIR_DOMAIN_SOUND_MODEL_ES1370 + 1); for (i = 0; i < (VIR_DOMAIN_SOUND_MODEL_ES1370 + 1); i++) { - virDomainSoundDefPtr sound = g_new0(virDomainSoundDef, 1); + virDomainSoundDef *sound = g_new0(virDomainSoundDef, 1); sound->model = i; def->sounds[def->nsounds++] = sound; } @@ -1327,7 +1327,7 @@ xenParseSxprSound(virDomainDefPtr def, while (*sound != '\0') { char *next = strchr(sound, ','); - virDomainSoundDefPtr snddef; + virDomainSoundDef *snddef; if (next) *next = '\0'; @@ -1352,7 +1352,7 @@ xenParseSxprSound(virDomainDefPtr def, static int -xenParseEmulatedDevices(virConfPtr conf, virDomainDefPtr def) +xenParseEmulatedDevices(virConf *conf, virDomainDef *def) { g_autofree char *str = NULL; @@ -1370,9 +1370,9 @@ xenParseEmulatedDevices(virConfPtr conf, virDomainDefPtr def) static int -xenParseGeneralMeta(virConfPtr conf, virDomainDefPtr def, virCapsPtr caps) +xenParseGeneralMeta(virConf *conf, virDomainDef *def, virCaps *caps) { - virCapsDomainDataPtr capsdata = NULL; + virCapsDomainData *capsdata = NULL; g_autofree char *str = NULL; int ret = -1; @@ -1421,11 +1421,11 @@ xenParseGeneralMeta(virConfPtr conf, virDomainDefPtr def, virCapsPtr caps) * A convenience function for parsing all config common to both XM and XL */ int -xenParseConfigCommon(virConfPtr conf, - virDomainDefPtr def, - virCapsPtr caps, +xenParseConfigCommon(virConf *conf, + virDomainDef *def, + virCaps *caps, const char *nativeFormat, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { if (xenParseGeneralMeta(conf, def, caps) < 0) return -1; @@ -1487,8 +1487,8 @@ xenParseConfigCommon(virConfPtr conf, * Returns 0 in case of success, -1 in case of error */ static int -xenFormatSxprChr(virDomainChrDefPtr def, - virBufferPtr buf) +xenFormatSxprChr(virDomainChrDef *def, + virBuffer *buf) { const char *type = virDomainChrTypeToString(def->source->type); @@ -1553,11 +1553,11 @@ xenFormatSxprChr(virDomainChrDefPtr def, static int -xenFormatSerial(virConfValuePtr list, virDomainChrDefPtr serial) +xenFormatSerial(virConfValue *list, virDomainChrDef *serial) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virConfValuePtr val; - virConfValuePtr tmp; + virConfValue *val; + virConfValue *tmp; int ret; if (serial) { @@ -1584,7 +1584,7 @@ xenFormatSerial(virConfValuePtr list, virDomainChrDefPtr serial) } char * -xenMakeIPList(virNetDevIPInfoPtr guestIP) +xenMakeIPList(virNetDevIPInfo *guestIP) { size_t i; char **address_array; @@ -1606,14 +1606,14 @@ xenMakeIPList(virNetDevIPInfoPtr guestIP) static int xenFormatNet(virConnectPtr conn, - virConfValuePtr list, - virDomainNetDefPtr net, + virConfValue *list, + virDomainNetDef *net, int hvm, const char *vif_typename) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virConfValuePtr val; - virConfValuePtr tmp; + virConfValue *val; + virConfValue *tmp; char macaddr[VIR_MAC_STRING_BUFLEN]; virBufferAsprintf(&buf, "mac=%s", virMacAddrFormat(&net->mac, macaddr)); @@ -1745,9 +1745,9 @@ xenFormatNet(virConnectPtr conn, static int -xenFormatPCI(virConfPtr conf, virDomainDefPtr def) +xenFormatPCI(virConf *conf, virDomainDef *def) { - virConfValuePtr pciVal = NULL; + virConfValue *pciVal = NULL; int hasPCI = 0; size_t i; @@ -1767,8 +1767,8 @@ xenFormatPCI(virConfPtr conf, virDomainDefPtr def) for (i = 0; i < def->nhostdevs; i++) { if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI) { - virConfValuePtr val; - virConfValuePtr tmp; + virConfValue *val; + virConfValue *tmp; char *buf; const char *permissive_str = NULL; @@ -1819,7 +1819,7 @@ xenFormatPCI(virConfPtr conf, virDomainDefPtr def) static int -xenFormatGeneralMeta(virConfPtr conf, virDomainDefPtr def) +xenFormatGeneralMeta(virConf *conf, virDomainDef *def) { char uuid[VIR_UUID_STRING_BUFLEN]; @@ -1835,7 +1835,7 @@ xenFormatGeneralMeta(virConfPtr conf, virDomainDefPtr def) static int -xenFormatMem(virConfPtr conf, virDomainDefPtr def) +xenFormatMem(virConf *conf, virDomainDef *def) { if (xenConfigSetInt(conf, "maxmem", VIR_DIV_UP(virDomainDefGetMemoryTotal(def), 1024)) < 0) @@ -1850,7 +1850,7 @@ xenFormatMem(virConfPtr conf, virDomainDefPtr def) static int -xenFormatTimeOffset(virConfPtr conf, virDomainDefPtr def) +xenFormatTimeOffset(virConf *conf, virDomainDef *def) { int vmlocaltime; @@ -1914,7 +1914,7 @@ xenFormatTimeOffset(virConfPtr conf, virDomainDefPtr def) static int -xenFormatEventActions(virConfPtr conf, virDomainDefPtr def) +xenFormatEventActions(virConf *conf, virDomainDef *def) { const char *lifecycle = NULL; @@ -1949,7 +1949,7 @@ xenFormatEventActions(virConfPtr conf, virDomainDefPtr def) static int -xenFormatCharDev(virConfPtr conf, virDomainDefPtr def, +xenFormatCharDev(virConf *conf, virDomainDef *def, const char *nativeFormat) { size_t i; @@ -1988,7 +1988,7 @@ xenFormatCharDev(virConfPtr conf, virDomainDefPtr def, } else { size_t j = 0; int maxport = -1, port; - virConfValuePtr serialVal = NULL; + virConfValue *serialVal = NULL; if (STREQ(nativeFormat, XEN_CONFIG_FORMAT_XM)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -2005,7 +2005,7 @@ xenFormatCharDev(virConfPtr conf, virDomainDefPtr def, maxport = def->serials[i]->target.port; for (port = 0; port <= maxport; port++) { - virDomainChrDefPtr chr = NULL; + virDomainChrDef *chr = NULL; for (j = 0; j < def->nserials; j++) { if (def->serials[j]->target.port == port) { @@ -2040,7 +2040,7 @@ xenFormatCharDev(virConfPtr conf, virDomainDefPtr def, static int -xenFormatCPUAllocation(virConfPtr conf, virDomainDefPtr def) +xenFormatCPUAllocation(virConf *conf, virDomainDef *def) { g_autofree char *cpus = NULL; @@ -2064,7 +2064,7 @@ xenFormatCPUAllocation(virConfPtr conf, virDomainDefPtr def) static int -xenFormatHypervisorFeatures(virConfPtr conf, virDomainDefPtr def) +xenFormatHypervisorFeatures(virConf *conf, virDomainDef *def) { size_t i; bool hvm = !!(def->os.type == VIR_DOMAIN_OSTYPE_HVM); @@ -2174,7 +2174,7 @@ xenFormatHypervisorFeatures(virConfPtr conf, virDomainDefPtr def) static int -xenFormatEmulator(virConfPtr conf, virDomainDefPtr def) +xenFormatEmulator(virConf *conf, virDomainDef *def) { if (def->emulator && xenConfigSetString(conf, "device_model_override", def->emulator) < 0) @@ -2185,7 +2185,7 @@ xenFormatEmulator(virConfPtr conf, virDomainDefPtr def) static int -xenFormatVfb(virConfPtr conf, virDomainDefPtr def) +xenFormatVfb(virConf *conf, virDomainDef *def) { int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM ? 1 : 0; @@ -2209,7 +2209,7 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def) def->graphics[0]->data.sdl.xauth) < 0) return -1; } else { - virDomainGraphicsListenDefPtr glisten; + virDomainGraphicsListenDef *glisten; if (xenConfigSetInt(conf, "sdl", 0) < 0) return -1; @@ -2242,8 +2242,8 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def) return -1; } } else { - virConfValuePtr vfb; - virConfValuePtr disp; + virConfValue *vfb; + virConfValue *disp; char *vfbstr = NULL; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -2256,7 +2256,7 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def) virBufferAsprintf(&buf, ",xauthority=%s", def->graphics[0]->data.sdl.xauth); } else { - virDomainGraphicsListenDefPtr glisten + virDomainGraphicsListenDef *glisten = virDomainGraphicsGetListen(def->graphics[0], 0); virBufferAddLit(&buf, "type=vnc"); @@ -2295,7 +2295,7 @@ xenFormatVfb(virConfPtr conf, virDomainDefPtr def) static int -xenFormatSound(virConfPtr conf, virDomainDefPtr def) +xenFormatSound(virConf *conf, virDomainDef *def) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char * model; @@ -2325,12 +2325,12 @@ xenFormatSound(virConfPtr conf, virDomainDefPtr def) static int -xenFormatVif(virConfPtr conf, +xenFormatVif(virConf *conf, virConnectPtr conn, - virDomainDefPtr def, + virDomainDef *def, const char *vif_typename) { - virConfValuePtr netVal = NULL; + virConfValue *netVal = NULL; size_t i; int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM; @@ -2364,8 +2364,8 @@ xenFormatVif(virConfPtr conf, * A convenience function for formatting all config common to both XM and XL */ int -xenFormatConfigCommon(virConfPtr conf, - virDomainDefPtr def, +xenFormatConfigCommon(virConf *conf, + virDomainDef *def, virConnectPtr conn, const char *nativeFormat) { @@ -2419,7 +2419,7 @@ xenFormatConfigCommon(virConfPtr conf, int -xenDomainDefAddImplicitInputDevice(virDomainDefPtr def) +xenDomainDefAddImplicitInputDevice(virDomainDef *def) { virDomainInputBus implicitInputBus = VIR_DOMAIN_INPUT_BUS_XEN; diff --git a/src/libxl/xen_common.h b/src/libxl/xen_common.h index 231fa0d078..b21046e959 100644 --- a/src/libxl/xen_common.h +++ b/src/libxl/xen_common.h @@ -28,42 +28,42 @@ #define XEN_CONFIG_FORMAT_XM "xen-xm" #define XEN_CONFIG_FORMAT_SEXPR "xen-sxpr" -int xenConfigGetString(virConfPtr conf, +int xenConfigGetString(virConf *conf, const char *name, char **value, const char *def); -int xenConfigGetBool(virConfPtr conf, const char *name, int *value, int def); +int xenConfigGetBool(virConf *conf, const char *name, int *value, int def); -int xenConfigSetInt(virConfPtr conf, const char *name, long long value); +int xenConfigSetInt(virConf *conf, const char *name, long long value); -int xenConfigSetString(virConfPtr conf, const char *setting, const char *value); +int xenConfigSetString(virConf *conf, const char *setting, const char *value); -int xenConfigGetULong(virConfPtr conf, +int xenConfigGetULong(virConf *conf, const char *name, unsigned long *value, unsigned long def); int -xenConfigCopyString(virConfPtr conf, +xenConfigCopyString(virConf *conf, const char *name, char **value); -int xenConfigCopyStringOpt(virConfPtr conf, +int xenConfigCopyStringOpt(virConf *conf, const char *name, char **value); -int xenParseConfigCommon(virConfPtr conf, - virDomainDefPtr def, - virCapsPtr caps, +int xenParseConfigCommon(virConf *conf, + virDomainDef *def, + virCaps *caps, const char *nativeFormat, - virDomainXMLOptionPtr xmlopt); + virDomainXMLOption *xmlopt); -int xenFormatConfigCommon(virConfPtr conf, - virDomainDefPtr def, +int xenFormatConfigCommon(virConf *conf, + virDomainDef *def, virConnectPtr conn, const char *nativeFormat); -char *xenMakeIPList(virNetDevIPInfoPtr guestIP); +char *xenMakeIPList(virNetDevIPInfo *guestIP); -int xenDomainDefAddImplicitInputDevice(virDomainDefPtr def); +int xenDomainDefAddImplicitInputDevice(virDomainDef *def); diff --git a/src/libxl/xen_xl.c b/src/libxl/xen_xl.c index e8a75979d4..8fa91ce66a 100644 --- a/src/libxl/xen_xl.c +++ b/src/libxl/xen_xl.c @@ -62,7 +62,7 @@ extern int xlu_disk_parse(XLU_Config *cfg, libxl_device_disk *disk); #endif -static int xenParseCmdline(virConfPtr conf, char **r_cmdline) +static int xenParseCmdline(virConf *conf, char **r_cmdline) { char *cmdline = NULL; g_autofree char *root = NULL; @@ -97,7 +97,7 @@ static int xenParseCmdline(virConfPtr conf, char **r_cmdline) } static int -xenParseXLOS(virConfPtr conf, virDomainDefPtr def, virCapsPtr caps) +xenParseXLOS(virConf *conf, virDomainDef *def, virCaps *caps) { size_t i; @@ -175,7 +175,7 @@ xenParseXLOS(virConfPtr conf, virDomainDefPtr def, virCapsPtr caps) } if (!def->cpu) { - virCPUDefPtr cpu = virCPUDefNew(); + virCPUDef *cpu = virCPUDefNew(); cpu->mode = VIR_CPU_MODE_HOST_PASSTHROUGH; cpu->type = VIR_CPU_TYPE_GUEST; cpu->nfeatures = 0; @@ -245,7 +245,7 @@ xenTranslateCPUFeature(const char *feature_name, bool from_libxl) } static int -xenParseXLCPUID(virConfPtr conf, virDomainDefPtr def) +xenParseXLCPUID(virConf *conf, virDomainDef *def) { g_autofree char *cpuid_str = NULL; char **cpuid_pairs = NULL; @@ -330,9 +330,9 @@ xenParseXLCPUID(virConfPtr conf, virDomainDefPtr def) static int -xenParseXLSpice(virConfPtr conf, virDomainDefPtr def) +xenParseXLSpice(virConf *conf, virDomainDef *def) { - virDomainGraphicsDefPtr graphics = NULL; + virDomainGraphicsDef *graphics = NULL; unsigned long port; char *listenAddr = NULL; int val; @@ -388,7 +388,7 @@ xenParseXLSpice(virConfPtr conf, virDomainDefPtr def) else graphics->data.spice.copypaste = VIR_TRISTATE_BOOL_NO; - def->graphics = g_new0(virDomainGraphicsDefPtr, 1); + def->graphics = g_new0(virDomainGraphicsDef *, 1); def->graphics[0] = graphics; def->ngraphics = 1; } @@ -404,8 +404,8 @@ xenParseXLSpice(virConfPtr conf, virDomainDefPtr def) #ifdef LIBXL_HAVE_VNUMA static int -xenParseXLVnuma(virConfPtr conf, - virDomainDefPtr def) +xenParseXLVnuma(virConf *conf, + virDomainDef *def) { int ret = -1; char *tmp = NULL; @@ -413,10 +413,10 @@ xenParseXLVnuma(virConfPtr conf, size_t vcpus = 0; size_t nr_nodes = 0; size_t vnodeCnt = 0; - virCPUDefPtr cpu = NULL; - virConfValuePtr list; - virConfValuePtr vnode; - virDomainNumaPtr numa; + virCPUDef *cpu = NULL; + virConfValue *list; + virConfValue *vnode; + virDomainNuma *numa; numa = def->numa; if (numa == NULL) @@ -440,7 +440,7 @@ xenParseXLVnuma(virConfPtr conf, list = list->list; while (list) { int pnode = -1; - virBitmapPtr cpumask = NULL; + virBitmap *cpumask = NULL; unsigned long long kbsize = 0; /* Is there a sublist (vnode)? */ @@ -594,10 +594,10 @@ xenParseXLVnuma(virConfPtr conf, #endif static int -xenParseXLXenbusLimits(virConfPtr conf, virDomainDefPtr def) +xenParseXLXenbusLimits(virConf *conf, virDomainDef *def) { int ctlr_idx; - virDomainControllerDefPtr xenbus_ctlr; + virDomainControllerDef *xenbus_ctlr; unsigned long limit; ctlr_idx = virDomainControllerFindByType(def, VIR_DOMAIN_CONTROLLER_TYPE_XENBUS); @@ -625,7 +625,7 @@ xenParseXLXenbusLimits(virConfPtr conf, virDomainDefPtr def) } static int -xenParseXLDiskSrc(virDomainDiskDefPtr disk, char *srcstr) +xenParseXLDiskSrc(virDomainDiskDef *disk, char *srcstr) { char *tmpstr = NULL; int ret = -1; @@ -688,13 +688,13 @@ xenParseXLDiskSrc(virDomainDiskDefPtr disk, char *srcstr) * */ static int -xenParseXLDisk(virConfPtr conf, virDomainDefPtr def) +xenParseXLDisk(virConf *conf, virDomainDef *def) { int ret = -1; - virConfValuePtr list = virConfGetValue(conf, "disk"); + virConfValue *list = virConfGetValue(conf, "disk"); XLU_Config *xluconf; libxl_device_disk *libxldisk; - virDomainDiskDefPtr disk = NULL; + virDomainDiskDef *disk = NULL; libxldisk = g_new0(libxl_device_disk, 1); @@ -825,10 +825,10 @@ xenParseXLDisk(virConfPtr conf, virDomainDefPtr def) } static int -xenParseXLInputDevs(virConfPtr conf, virDomainDefPtr def) +xenParseXLInputDevs(virConf *conf, virDomainDef *def) { const char *str; - virConfValuePtr val; + virConfValue *val; if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) { val = virConfGetValue(conf, "usbdevice"); @@ -856,7 +856,7 @@ xenParseXLInputDevs(virConfPtr conf, virDomainDefPtr def) (STREQ(str, "tablet") || STREQ(str, "mouse") || STREQ(str, "keyboard"))) { - virDomainInputDefPtr input; + virDomainInputDef *input; input = g_new0(virDomainInputDef, 1); @@ -879,10 +879,10 @@ xenParseXLInputDevs(virConfPtr conf, virDomainDefPtr def) } static int -xenParseXLUSBController(virConfPtr conf, virDomainDefPtr def) +xenParseXLUSBController(virConf *conf, virDomainDef *def) { - virConfValuePtr list = virConfGetValue(conf, "usbctrl"); - virDomainControllerDefPtr controller = NULL; + virConfValue *list = virConfGetValue(conf, "usbctrl"); + virDomainControllerDef *controller = NULL; if (list && list->type == VIR_CONF_LIST) { list = list->list; @@ -954,10 +954,10 @@ xenParseXLUSBController(virConfPtr conf, virDomainDefPtr def) } static int -xenParseXLUSB(virConfPtr conf, virDomainDefPtr def) +xenParseXLUSB(virConf *conf, virDomainDef *def) { - virConfValuePtr list = virConfGetValue(conf, "usbdev"); - virDomainHostdevDefPtr hostdev = NULL; + virConfValue *list = virConfGetValue(conf, "usbdev"); + virDomainHostdevDef *hostdev = NULL; if (list && list->type == VIR_CONF_LIST) { list = list->list; @@ -1021,10 +1021,10 @@ xenParseXLUSB(virConfPtr conf, virDomainDefPtr def) } static int -xenParseXLChannel(virConfPtr conf, virDomainDefPtr def) +xenParseXLChannel(virConf *conf, virDomainDef *def) { - virConfValuePtr list = virConfGetValue(conf, "channel"); - virDomainChrDefPtr channel = NULL; + virConfValue *list = virConfGetValue(conf, "channel"); + virDomainChrDef *channel = NULL; char *name = NULL; char *path = NULL; @@ -1103,12 +1103,12 @@ xenParseXLChannel(virConfPtr conf, virDomainDefPtr def) } static int -xenParseXLNamespaceData(virConfPtr conf, virDomainDefPtr def) +xenParseXLNamespaceData(virConf *conf, virDomainDef *def) { - virConfValuePtr list = virConfGetValue(conf, "device_model_args"); - virConfValuePtr next; + virConfValue *list = virConfGetValue(conf, "device_model_args"); + virConfValue *next; size_t nargs = 0; - libxlDomainXmlNsDefPtr nsdata = NULL; + libxlDomainXmlNsDef *nsdata = NULL; size_t n = 0; if (!list || list->type != VIR_CONF_LIST) @@ -1141,12 +1141,12 @@ xenParseXLNamespaceData(virConfPtr conf, virDomainDefPtr def) return 0; } -virDomainDefPtr -xenParseXL(virConfPtr conf, - virCapsPtr caps, - virDomainXMLOptionPtr xmlopt) +virDomainDef * +xenParseXL(virConf *conf, + virCaps *caps, + virDomainXMLOption *xmlopt) { - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; if (!(def = virDomainDefNew())) return NULL; @@ -1207,7 +1207,7 @@ xenParseXL(virConfPtr conf, static int -xenFormatXLOS(virConfPtr conf, virDomainDefPtr def) +xenFormatXLOS(virConf *conf, virDomainDef *def) { size_t i; @@ -1326,7 +1326,7 @@ xenFormatXLOS(virConfPtr conf, virDomainDefPtr def) } static int -xenFormatXLCPUID(virConfPtr conf, virDomainDefPtr def) +xenFormatXLCPUID(virConf *conf, virDomainDef *def) { char **cpuid_pairs = NULL; g_autofree char *cpuid_string = NULL; @@ -1392,11 +1392,11 @@ xenFormatXLCPUID(virConfPtr conf, virDomainDefPtr def) #ifdef LIBXL_HAVE_VNUMA static int -xenFormatXLVnode(virConfValuePtr list, - virBufferPtr buf) +xenFormatXLVnode(virConfValue *list, + virBuffer *buf) { - virConfValuePtr numaPnode; - virConfValuePtr tmp; + virConfValue *numaPnode; + virConfValue *tmp; numaPnode = g_new0(virConfValue, 1); @@ -1416,17 +1416,17 @@ xenFormatXLVnode(virConfValuePtr list, } static int -xenFormatXLVnuma(virConfValuePtr list, - virDomainNumaPtr numa, +xenFormatXLVnuma(virConfValue *list, + virDomainNuma *numa, size_t node, size_t nr_nodes) { int ret = -1; size_t i; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virConfValuePtr numaVnode; - virConfValuePtr tmp; - virBitmapPtr cpumask = virDomainNumaGetNodeCpumask(numa, node); + virConfValue *numaVnode; + virConfValue *tmp; + virBitmap *cpumask = virDomainNumaGetNodeCpumask(numa, node); size_t nodeSize = virDomainNumaGetNodeMemorySize(numa, node) / 1024; g_autofree char *nodeVcpus = NULL; @@ -1475,11 +1475,11 @@ xenFormatXLVnuma(virConfValuePtr list, } static int -xenFormatXLDomainVnuma(virConfPtr conf, - virDomainDefPtr def) +xenFormatXLDomainVnuma(virConf *conf, + virDomainDef *def) { - virDomainNumaPtr numa = def->numa; - virConfValuePtr vnumaVal; + virDomainNuma *numa = def->numa; + virConfValue *vnumaVal; size_t i; size_t nr_nodes; @@ -1514,7 +1514,7 @@ xenFormatXLDomainVnuma(virConfPtr conf, #endif static int -xenFormatXLXenbusLimits(virConfPtr conf, virDomainDefPtr def) +xenFormatXLXenbusLimits(virConf *conf, virDomainDef *def) { size_t i; @@ -1540,7 +1540,7 @@ xenFormatXLXenbusLimits(virConfPtr conf, virDomainDefPtr def) } static char * -xenFormatXLDiskSrcNet(virStorageSourcePtr src) +xenFormatXLDiskSrcNet(virStorageSource *src) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t i; @@ -1603,7 +1603,7 @@ xenFormatXLDiskSrcNet(virStorageSourcePtr src) static int -xenFormatXLDiskSrc(virStorageSourcePtr src, char **srcstr) +xenFormatXLDiskSrc(virStorageSource *src, char **srcstr) { int actualType = virStorageSourceGetActualType(src); @@ -1637,11 +1637,11 @@ xenFormatXLDiskSrc(virStorageSourcePtr src, char **srcstr) static int -xenFormatXLDisk(virConfValuePtr list, virDomainDiskDefPtr disk) +xenFormatXLDisk(virConfValue *list, virDomainDiskDef *disk) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virConfValuePtr val; - virConfValuePtr tmp; + virConfValue *val; + virConfValue *tmp; int format = virDomainDiskGetFormat(disk); const char *driver = virDomainDiskGetDriver(disk); g_autofree char *target = NULL; @@ -1735,9 +1735,9 @@ xenFormatXLDisk(virConfValuePtr list, virDomainDiskDefPtr disk) static int -xenFormatXLDomainDisks(virConfPtr conf, virDomainDefPtr def) +xenFormatXLDomainDisks(virConf *conf, virDomainDef *def) { - virConfValuePtr diskVal; + virConfValue *diskVal; size_t i; diskVal = g_new0(virConfValue, 1); @@ -1770,10 +1770,10 @@ xenFormatXLDomainDisks(virConfPtr conf, virDomainDefPtr def) static int -xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def) +xenFormatXLSpice(virConf *conf, virDomainDef *def) { - virDomainGraphicsListenDefPtr glisten; - virDomainGraphicsDefPtr graphics; + virDomainGraphicsListenDef *glisten; + virDomainGraphicsDef *graphics; if (def->os.type == VIR_DOMAIN_OSTYPE_HVM && def->graphics) { graphics = def->graphics[0]; @@ -1857,12 +1857,12 @@ xenFormatXLSpice(virConfPtr conf, virDomainDefPtr def) } static int -xenFormatXLInputDevs(virConfPtr conf, virDomainDefPtr def) +xenFormatXLInputDevs(virConf *conf, virDomainDef *def) { size_t i; const char *devtype; - virConfValuePtr usbdevices = NULL; - virConfValuePtr lastdev; + virConfValue *usbdevices = NULL; + virConfValue *lastdev; if (def->os.type == VIR_DOMAIN_OSTYPE_HVM) { usbdevices = g_new0(virConfValue, 1); @@ -1921,10 +1921,10 @@ xenFormatXLInputDevs(virConfPtr conf, virDomainDefPtr def) } static int -xenFormatXLUSBController(virConfPtr conf, - virDomainDefPtr def) +xenFormatXLUSBController(virConf *conf, + virDomainDef *def) { - virConfValuePtr usbctrlVal = NULL; + virConfValue *usbctrlVal = NULL; int hasUSBCtrl = 0; size_t i; @@ -1945,8 +1945,8 @@ xenFormatXLUSBController(virConfPtr conf, for (i = 0; i < def->ncontrollers; i++) { if (def->controllers[i]->type == VIR_DOMAIN_CONTROLLER_TYPE_USB) { - virConfValuePtr val; - virConfValuePtr tmp; + virConfValue *val; + virConfValue *tmp; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; if (def->controllers[i]->model != -1) { @@ -1998,10 +1998,10 @@ xenFormatXLUSBController(virConfPtr conf, static int -xenFormatXLUSB(virConfPtr conf, - virDomainDefPtr def) +xenFormatXLUSB(virConf *conf, + virDomainDef *def) { - virConfValuePtr usbVal = NULL; + virConfValue *usbVal = NULL; int hasUSB = 0; size_t i; @@ -2024,8 +2024,8 @@ xenFormatXLUSB(virConfPtr conf, for (i = 0; i < def->nhostdevs; i++) { if (def->hostdevs[i]->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && def->hostdevs[i]->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB) { - virConfValuePtr val; - virConfValuePtr tmp; + virConfValue *val; + virConfValue *tmp; char *buf; buf = g_strdup_printf("hostbus=%x,hostaddr=%x", @@ -2057,12 +2057,12 @@ xenFormatXLUSB(virConfPtr conf, } static int -xenFormatXLChannel(virConfValuePtr list, virDomainChrDefPtr channel) +xenFormatXLChannel(virConfValue *list, virDomainChrDef *channel) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; int sourceType = channel->source->type; - virConfValuePtr val; - virConfValuePtr tmp; + virConfValue *val; + virConfValue *tmp; /* connection */ virBufferAddLit(&buf, "connection="); @@ -2098,9 +2098,9 @@ xenFormatXLChannel(virConfValuePtr list, virDomainChrDefPtr channel) } static int -xenFormatXLDomainChannels(virConfPtr conf, virDomainDefPtr def) +xenFormatXLDomainChannels(virConf *conf, virDomainDef *def) { - virConfValuePtr channelVal = NULL; + virConfValue *channelVal = NULL; size_t i; channelVal = g_new0(virConfValue, 1); @@ -2109,7 +2109,7 @@ xenFormatXLDomainChannels(virConfPtr conf, virDomainDefPtr def) channelVal->list = NULL; for (i = 0; i < def->nchannels; i++) { - virDomainChrDefPtr chr = def->channels[i]; + virDomainChrDef *chr = def->channels[i]; if (chr->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_XEN) continue; @@ -2134,10 +2134,10 @@ xenFormatXLDomainChannels(virConfPtr conf, virDomainDefPtr def) } static int -xenFormatXLDomainNamespaceData(virConfPtr conf, virDomainDefPtr def) +xenFormatXLDomainNamespaceData(virConf *conf, virDomainDef *def) { - libxlDomainXmlNsDefPtr nsdata = def->namespaceData; - virConfValuePtr args = NULL; + libxlDomainXmlNsDef *nsdata = def->namespaceData; + virConfValue *args = NULL; size_t i; if (!nsdata) @@ -2152,8 +2152,8 @@ xenFormatXLDomainNamespaceData(virConfPtr conf, virDomainDefPtr def) args->list = NULL; for (i = 0; i < nsdata->num_args; i++) { - virConfValuePtr val; - virConfValuePtr tmp; + virConfValue *val; + virConfValue *tmp; val = g_new0(virConfValue, 1); @@ -2179,8 +2179,8 @@ xenFormatXLDomainNamespaceData(virConfPtr conf, virDomainDefPtr def) return -1; } -virConfPtr -xenFormatXL(virDomainDefPtr def, virConnectPtr conn) +virConf * +xenFormatXL(virDomainDef *def, virConnectPtr conn) { g_autoptr(virConf) conf = NULL; diff --git a/src/libxl/xen_xl.h b/src/libxl/xen_xl.h index 24f6470283..c997562956 100644 --- a/src/libxl/xen_xl.h +++ b/src/libxl/xen_xl.h @@ -26,10 +26,10 @@ #include "domain_conf.h" #include "xen_common.h" -virDomainDefPtr xenParseXL(virConfPtr conn, - virCapsPtr caps, - virDomainXMLOptionPtr xmlopt); +virDomainDef *xenParseXL(virConf *conn, + virCaps *caps, + virDomainXMLOption *xmlopt); -virConfPtr xenFormatXL(virDomainDefPtr def, virConnectPtr); +virConf *xenFormatXL(virDomainDef *def, virConnectPtr); const char *xenTranslateCPUFeature(const char *feature_name, bool from_libxl); diff --git a/src/libxl/xen_xm.c b/src/libxl/xen_xm.c index a2c1682fcf..feec25b9f4 100644 --- a/src/libxl/xen_xm.c +++ b/src/libxl/xen_xm.c @@ -35,7 +35,7 @@ #define VIR_FROM_THIS VIR_FROM_XENXM static int -xenParseXMOS(virConfPtr conf, virDomainDefPtr def) +xenParseXMOS(virConf *conf, virDomainDef *def) { size_t i; @@ -102,10 +102,10 @@ xenParseXMOS(virConfPtr conf, virDomainDefPtr def) } -static virDomainDiskDefPtr +static virDomainDiskDef * xenParseXMDisk(char *entry, int hvm) { - virDomainDiskDefPtr disk = NULL; + virDomainDiskDef *disk = NULL; char *head; char *offset; char *tmp; @@ -236,7 +236,7 @@ xenParseXMDisk(char *entry, int hvm) static int -xenParseXMDiskList(virConfPtr conf, virDomainDefPtr def) +xenParseXMDiskList(virConf *conf, virDomainDef *def) { char **disks = NULL, **entries; int hvm = def->os.type == VIR_DOMAIN_OSTYPE_HVM; @@ -248,7 +248,7 @@ xenParseXMDiskList(virConfPtr conf, virDomainDefPtr def) return rc; for (entries = disks; *entries; entries++) { - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; char *entry = *entries; if (!(disk = xenParseXMDisk(entry, hvm))) @@ -271,12 +271,12 @@ xenParseXMDiskList(virConfPtr conf, virDomainDefPtr def) static int -xenFormatXMDisk(virConfValuePtr list, - virDomainDiskDefPtr disk) +xenFormatXMDisk(virConfValue *list, + virDomainDiskDef *disk) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virConfValuePtr val; - virConfValuePtr tmp; + virConfValue *val; + virConfValue *tmp; const char *src = virDomainDiskGetSource(disk); int format = virDomainDiskGetFormat(disk); const char *driver = virDomainDiskGetDriver(disk); @@ -346,9 +346,9 @@ xenFormatXMDisk(virConfValuePtr list, static int -xenFormatXMDisks(virConfPtr conf, virDomainDefPtr def) +xenFormatXMDisks(virConf *conf, virDomainDef *def) { - virConfValuePtr diskVal = NULL; + virConfValue *diskVal = NULL; size_t i = 0; diskVal = g_new0(virConfValue, 1); @@ -381,7 +381,7 @@ xenFormatXMDisks(virConfPtr conf, virDomainDefPtr def) static int -xenParseXMInputDevs(virConfPtr conf, virDomainDefPtr def) +xenParseXMInputDevs(virConf *conf, virDomainDef *def) { g_autofree char *str = NULL; @@ -392,7 +392,7 @@ xenParseXMInputDevs(virConfPtr conf, virDomainDefPtr def) (STREQ(str, "tablet") || STREQ(str, "mouse") || STREQ(str, "keyboard"))) { - virDomainInputDefPtr input; + virDomainInputDef *input; input = g_new0(virDomainInputDef, 1); input->bus = VIR_DOMAIN_INPUT_BUS_USB; @@ -414,12 +414,12 @@ xenParseXMInputDevs(virConfPtr conf, virDomainDefPtr def) /* * Convert an XM config record into a virDomainDef object. */ -virDomainDefPtr -xenParseXM(virConfPtr conf, - virCapsPtr caps, - virDomainXMLOptionPtr xmlopt) +virDomainDef * +xenParseXM(virConf *conf, + virCaps *caps, + virDomainXMLOption *xmlopt) { - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; if (!(def = virDomainDefNew())) return NULL; @@ -452,7 +452,7 @@ xenParseXM(virConfPtr conf, } static int -xenFormatXMOS(virConfPtr conf, virDomainDefPtr def) +xenFormatXMOS(virConf *conf, virDomainDef *def) { size_t i; @@ -521,7 +521,7 @@ xenFormatXMOS(virConfPtr conf, virDomainDefPtr def) static int -xenFormatXMInputDevs(virConfPtr conf, virDomainDefPtr def) +xenFormatXMInputDevs(virConf *conf, virDomainDef *def) { size_t i; const char *devtype; @@ -562,9 +562,9 @@ G_STATIC_ASSERT(MAX_VIRT_CPUS <= sizeof(1UL) * CHAR_BIT); /* * Convert a virDomainDef object into an XM config record. */ -virConfPtr +virConf * xenFormatXM(virConnectPtr conn, - virDomainDefPtr def) + virDomainDef *def) { g_autoptr(virConf) conf = NULL; diff --git a/src/libxl/xen_xm.h b/src/libxl/xen_xm.h index 5546b2ddf4..afb4f51ff7 100644 --- a/src/libxl/xen_xm.h +++ b/src/libxl/xen_xm.h @@ -26,7 +26,7 @@ #include "virconf.h" #include "domain_conf.h" -virConfPtr xenFormatXM(virConnectPtr conn, virDomainDefPtr def); +virConf *xenFormatXM(virConnectPtr conn, virDomainDef *def); -virDomainDefPtr xenParseXM(virConfPtr conf, - virCapsPtr caps, virDomainXMLOptionPtr xmlopt); +virDomainDef *xenParseXM(virConf *conf, + virCaps *caps, virDomainXMLOption *xmlopt); diff --git a/src/locking/domain_lock.c b/src/locking/domain_lock.c index bc281eac54..9934e91aa9 100644 --- a/src/locking/domain_lock.c +++ b/src/locking/domain_lock.c @@ -32,8 +32,8 @@ VIR_LOG_INIT("locking.domain_lock"); -static int virDomainLockManagerAddLease(virLockManagerPtr lock, - virDomainLeaseDefPtr lease) +static int virDomainLockManagerAddLease(virLockManager *lock, + virDomainLeaseDef *lease) { unsigned int leaseFlags = 0; virLockManagerParam lparams[] = { @@ -68,8 +68,8 @@ static int virDomainLockManagerAddLease(virLockManagerPtr lock, } -static int virDomainLockManagerAddImage(virLockManagerPtr lock, - virStorageSourcePtr src) +static int virDomainLockManagerAddImage(virLockManager *lock, + virStorageSource *src) { unsigned int diskFlags = 0; int type = virStorageSourceGetActualType(src); @@ -101,13 +101,13 @@ static int virDomainLockManagerAddImage(virLockManagerPtr lock, } -static virLockManagerPtr virDomainLockManagerNew(virLockManagerPluginPtr plugin, +static virLockManager *virDomainLockManagerNew(virLockManagerPlugin *plugin, const char *uri, - virDomainObjPtr dom, + virDomainObj *dom, bool withResources, unsigned int flags) { - virLockManagerPtr lock; + virLockManager *lock; size_t i; virLockManagerParam params[] = { { .type = VIR_LOCK_MANAGER_PARAM_TYPE_UUID, @@ -150,7 +150,7 @@ static virLockManagerPtr virDomainLockManagerNew(virLockManagerPluginPtr plugin, VIR_DEBUG("Adding disks"); for (i = 0; i < dom->def->ndisks; i++) { - virDomainDiskDefPtr disk = dom->def->disks[i]; + virDomainDiskDef *disk = dom->def->disks[i]; if (virDomainLockManagerAddImage(lock, disk->src) < 0) goto error; @@ -165,13 +165,13 @@ static virLockManagerPtr virDomainLockManagerNew(virLockManagerPluginPtr plugin, } -int virDomainLockProcessStart(virLockManagerPluginPtr plugin, +int virDomainLockProcessStart(virLockManagerPlugin *plugin, const char *uri, - virDomainObjPtr dom, + virDomainObj *dom, bool paused, int *fd) { - virLockManagerPtr lock; + virLockManager *lock; int ret; int flags = VIR_LOCK_MANAGER_ACQUIRE_RESTRICT; @@ -193,11 +193,11 @@ int virDomainLockProcessStart(virLockManagerPluginPtr plugin, return ret; } -int virDomainLockProcessPause(virLockManagerPluginPtr plugin, - virDomainObjPtr dom, +int virDomainLockProcessPause(virLockManagerPlugin *plugin, + virDomainObj *dom, char **state) { - virLockManagerPtr lock; + virLockManager *lock; int ret; VIR_DEBUG("plugin=%p dom=%p state=%p", @@ -212,12 +212,12 @@ int virDomainLockProcessPause(virLockManagerPluginPtr plugin, return ret; } -int virDomainLockProcessResume(virLockManagerPluginPtr plugin, +int virDomainLockProcessResume(virLockManagerPlugin *plugin, const char *uri, - virDomainObjPtr dom, + virDomainObj *dom, const char *state) { - virLockManagerPtr lock; + virLockManager *lock; int ret; VIR_DEBUG("plugin=%p dom=%p state=%s", @@ -232,11 +232,11 @@ int virDomainLockProcessResume(virLockManagerPluginPtr plugin, return ret; } -int virDomainLockProcessInquire(virLockManagerPluginPtr plugin, - virDomainObjPtr dom, +int virDomainLockProcessInquire(virLockManagerPlugin *plugin, + virDomainObj *dom, char **state) { - virLockManagerPtr lock; + virLockManager *lock; int ret; VIR_DEBUG("plugin=%p dom=%p state=%p", @@ -252,12 +252,12 @@ int virDomainLockProcessInquire(virLockManagerPluginPtr plugin, } -int virDomainLockImageAttach(virLockManagerPluginPtr plugin, +int virDomainLockImageAttach(virLockManagerPlugin *plugin, const char *uri, - virDomainObjPtr dom, - virStorageSourcePtr src) + virDomainObj *dom, + virStorageSource *src) { - virLockManagerPtr lock; + virLockManager *lock; int ret = -1; VIR_DEBUG("plugin=%p dom=%p src=%p", plugin, dom, src); @@ -281,11 +281,11 @@ int virDomainLockImageAttach(virLockManagerPluginPtr plugin, } -int virDomainLockImageDetach(virLockManagerPluginPtr plugin, - virDomainObjPtr dom, - virStorageSourcePtr src) +int virDomainLockImageDetach(virLockManagerPlugin *plugin, + virDomainObj *dom, + virStorageSource *src) { - virLockManagerPtr lock; + virLockManager *lock; int ret = -1; VIR_DEBUG("plugin=%p dom=%p src=%p", plugin, dom, src); @@ -308,12 +308,12 @@ int virDomainLockImageDetach(virLockManagerPluginPtr plugin, } -int virDomainLockLeaseAttach(virLockManagerPluginPtr plugin, +int virDomainLockLeaseAttach(virLockManagerPlugin *plugin, const char *uri, - virDomainObjPtr dom, - virDomainLeaseDefPtr lease) + virDomainObj *dom, + virDomainLeaseDef *lease) { - virLockManagerPtr lock; + virLockManager *lock; int ret = -1; VIR_DEBUG("plugin=%p dom=%p lease=%p", @@ -337,11 +337,11 @@ int virDomainLockLeaseAttach(virLockManagerPluginPtr plugin, return ret; } -int virDomainLockLeaseDetach(virLockManagerPluginPtr plugin, - virDomainObjPtr dom, - virDomainLeaseDefPtr lease) +int virDomainLockLeaseDetach(virLockManagerPlugin *plugin, + virDomainObj *dom, + virDomainLeaseDef *lease) { - virLockManagerPtr lock; + virLockManager *lock; int ret = -1; VIR_DEBUG("plugin=%p dom=%p lease=%p", diff --git a/src/locking/domain_lock.h b/src/locking/domain_lock.h index 6f197bf08b..34a2a5fcb3 100644 --- a/src/locking/domain_lock.h +++ b/src/locking/domain_lock.h @@ -25,34 +25,34 @@ #include "domain_conf.h" #include "lock_manager.h" -int virDomainLockProcessStart(virLockManagerPluginPtr plugin, +int virDomainLockProcessStart(virLockManagerPlugin *plugin, const char *uri, - virDomainObjPtr dom, + virDomainObj *dom, bool paused, int *fd); -int virDomainLockProcessPause(virLockManagerPluginPtr plugin, - virDomainObjPtr dom, +int virDomainLockProcessPause(virLockManagerPlugin *plugin, + virDomainObj *dom, char **state); -int virDomainLockProcessResume(virLockManagerPluginPtr plugin, +int virDomainLockProcessResume(virLockManagerPlugin *plugin, const char *uri, - virDomainObjPtr dom, + virDomainObj *dom, const char *state); -int virDomainLockProcessInquire(virLockManagerPluginPtr plugin, - virDomainObjPtr dom, +int virDomainLockProcessInquire(virLockManagerPlugin *plugin, + virDomainObj *dom, char **state); -int virDomainLockImageAttach(virLockManagerPluginPtr plugin, +int virDomainLockImageAttach(virLockManagerPlugin *plugin, const char *uri, - virDomainObjPtr dom, - virStorageSourcePtr src); -int virDomainLockImageDetach(virLockManagerPluginPtr plugin, - virDomainObjPtr dom, - virStorageSourcePtr src); + virDomainObj *dom, + virStorageSource *src); +int virDomainLockImageDetach(virLockManagerPlugin *plugin, + virDomainObj *dom, + virStorageSource *src); -int virDomainLockLeaseAttach(virLockManagerPluginPtr plugin, +int virDomainLockLeaseAttach(virLockManagerPlugin *plugin, const char *uri, - virDomainObjPtr dom, - virDomainLeaseDefPtr lease); -int virDomainLockLeaseDetach(virLockManagerPluginPtr plugin, - virDomainObjPtr dom, - virDomainLeaseDefPtr lease); + virDomainObj *dom, + virDomainLeaseDef *lease); +int virDomainLockLeaseDetach(virLockManagerPlugin *plugin, + virDomainObj *dom, + virDomainLeaseDef *lease); diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c index ffde2017ac..05fc68dc54 100644 --- a/src/locking/lock_daemon.c +++ b/src/locking/lock_daemon.c @@ -58,31 +58,31 @@ VIR_LOG_INIT("locking.lock_daemon"); struct _virLockDaemon { GMutex lock; - virNetDaemonPtr dmn; + virNetDaemon *dmn; GHashTable *lockspaces; - virLockSpacePtr defaultLockspace; + virLockSpace *defaultLockspace; }; -virLockDaemonPtr lockDaemon = NULL; +virLockDaemon *lockDaemon = NULL; static bool execRestart; static void * -virLockDaemonClientNew(virNetServerClientPtr client, +virLockDaemonClientNew(virNetServerClient *client, void *opaque); static void virLockDaemonClientFree(void *opaque); static void * -virLockDaemonClientNewPostExecRestart(virNetServerClientPtr client, - virJSONValuePtr object, +virLockDaemonClientNewPostExecRestart(virNetServerClient *client, + virJSONValue *object, void *opaque); -static virJSONValuePtr -virLockDaemonClientPreExecRestart(virNetServerClientPtr client, +static virJSONValue * +virLockDaemonClientPreExecRestart(virNetServerClient *client, void *opaque); static void -virLockDaemonFree(virLockDaemonPtr lockd) +virLockDaemonFree(virLockDaemon *lockd) { if (!lockd) return; @@ -96,13 +96,13 @@ virLockDaemonFree(virLockDaemonPtr lockd) } static inline void -virLockDaemonLock(virLockDaemonPtr lockd) +virLockDaemonLock(virLockDaemon *lockd) { g_mutex_lock(&lockd->lock); } static inline void -virLockDaemonUnlock(virLockDaemonPtr lockd) +virLockDaemonUnlock(virLockDaemon *lockd) { g_mutex_unlock(&lockd->lock); } @@ -112,11 +112,11 @@ static void virLockDaemonLockSpaceDataFree(void *data) virLockSpaceFree(data); } -static virLockDaemonPtr -virLockDaemonNew(virLockDaemonConfigPtr config, bool privileged) +static virLockDaemon * +virLockDaemonNew(virLockDaemonConfig *config, bool privileged) { - virLockDaemonPtr lockd; - virNetServerPtr srv = NULL; + virLockDaemon *lockd; + virNetServer *srv = NULL; lockd = g_new0(virLockDaemon, 1); @@ -168,10 +168,10 @@ virLockDaemonNew(virLockDaemonConfigPtr config, bool privileged) } -static virNetServerPtr -virLockDaemonNewServerPostExecRestart(virNetDaemonPtr dmn G_GNUC_UNUSED, +static virNetServer * +virLockDaemonNewServerPostExecRestart(virNetDaemon *dmn G_GNUC_UNUSED, const char *name, - virJSONValuePtr object, + virJSONValue *object, void *opaque) { if (STREQ(name, "virtlockd")) { @@ -199,12 +199,12 @@ virLockDaemonNewServerPostExecRestart(virNetDaemonPtr dmn G_GNUC_UNUSED, } -static virLockDaemonPtr -virLockDaemonNewPostExecRestart(virJSONValuePtr object, bool privileged) +static virLockDaemon * +virLockDaemonNewPostExecRestart(virJSONValue *object, bool privileged) { - virLockDaemonPtr lockd; - virJSONValuePtr child; - virJSONValuePtr lockspaces; + virLockDaemon *lockd; + virJSONValue *child; + virJSONValue *lockspaces; size_t i; const char *serverNames[] = { "virtlockd" }; @@ -238,7 +238,7 @@ virLockDaemonNewPostExecRestart(virJSONValuePtr object, bool privileged) } for (i = 0; i < virJSONValueArraySize(lockspaces); i++) { - virLockSpacePtr lockspace; + virLockSpace *lockspace; child = virJSONValueArrayGet(lockspaces, i); @@ -281,9 +281,9 @@ virLockDaemonNewPostExecRestart(virJSONValuePtr object, bool privileged) } -int virLockDaemonAddLockSpace(virLockDaemonPtr lockd, +int virLockDaemonAddLockSpace(virLockDaemon *lockd, const char *path, - virLockSpacePtr lockspace) + virLockSpace *lockspace) { int ret; virLockDaemonLock(lockd); @@ -292,10 +292,10 @@ int virLockDaemonAddLockSpace(virLockDaemonPtr lockd, return ret; } -virLockSpacePtr virLockDaemonFindLockSpace(virLockDaemonPtr lockd, +virLockSpace *virLockDaemonFindLockSpace(virLockDaemon *lockd, const char *path) { - virLockSpacePtr lockspace; + virLockSpace *lockspace; virLockDaemonLock(lockd); if (path && STRNEQ(path, "")) lockspace = virHashLookup(lockd->lockspaces, path); @@ -323,7 +323,7 @@ virLockDaemonVersion(const char *argv0) } static void -virLockDaemonShutdownHandler(virNetDaemonPtr dmn, +virLockDaemonShutdownHandler(virNetDaemon *dmn, siginfo_t *sig G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { @@ -331,7 +331,7 @@ virLockDaemonShutdownHandler(virNetDaemonPtr dmn, } static void -virLockDaemonExecRestartHandler(virNetDaemonPtr dmn, +virLockDaemonExecRestartHandler(virNetDaemon *dmn, siginfo_t *sig G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { @@ -340,7 +340,7 @@ virLockDaemonExecRestartHandler(virNetDaemonPtr dmn, } static int -virLockDaemonSetupSignals(virNetDaemonPtr dmn) +virLockDaemonSetupSignals(virNetDaemon *dmn) { if (virNetDaemonAddSignalHandler(dmn, SIGINT, virLockDaemonShutdownHandler, NULL) < 0) return -1; @@ -355,7 +355,7 @@ virLockDaemonSetupSignals(virNetDaemonPtr dmn) struct virLockDaemonClientReleaseData { - virLockDaemonClientPtr client; + virLockDaemonClient *client; bool hadSomeLeases; bool gotError; }; @@ -365,7 +365,7 @@ virLockDaemonClientReleaseLockspace(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virLockSpacePtr lockspace = payload; + virLockSpace *lockspace = payload; struct virLockDaemonClientReleaseData *data = opaque; int rc; @@ -382,7 +382,7 @@ virLockDaemonClientReleaseLockspace(void *payload, static void virLockDaemonClientFree(void *opaque) { - virLockDaemonClientPtr priv = opaque; + virLockDaemonClient *priv = opaque; if (!priv) return; @@ -441,10 +441,10 @@ virLockDaemonClientFree(void *opaque) static void * -virLockDaemonClientNew(virNetServerClientPtr client, +virLockDaemonClientNew(virNetServerClient *client, void *opaque) { - virLockDaemonClientPtr priv; + virLockDaemonClient *priv; uid_t clientuid; gid_t clientgid; unsigned long long timestamp; @@ -494,11 +494,11 @@ virLockDaemonClientNew(virNetServerClientPtr client, static void * -virLockDaemonClientNewPostExecRestart(virNetServerClientPtr client, - virJSONValuePtr object, +virLockDaemonClientNewPostExecRestart(virNetServerClient *client, + virJSONValue *object, void *opaque) { - virLockDaemonClientPtr priv = virLockDaemonClientNew(client, opaque); + virLockDaemonClient *priv = virLockDaemonClientNew(client, opaque); unsigned int ownerPid; const char *ownerUUID; const char *ownerName; @@ -546,12 +546,12 @@ virLockDaemonClientNewPostExecRestart(virNetServerClientPtr client, } -static virJSONValuePtr -virLockDaemonClientPreExecRestart(virNetServerClientPtr client G_GNUC_UNUSED, +static virJSONValue * +virLockDaemonClientPreExecRestart(virNetServerClient *client G_GNUC_UNUSED, void *opaque) { - virLockDaemonClientPtr priv = opaque; - virJSONValuePtr object = virJSONValueNewObject(); + virLockDaemonClient *priv = opaque; + virJSONValue *object = virJSONValueNewObject(); char uuidstr[VIR_UUID_STRING_BUFLEN]; if (virJSONValueObjectAppendBoolean(object, "restricted", priv->restricted) < 0) { @@ -635,7 +635,7 @@ virLockDaemonPostExecRestart(const char *state_file, char *wantmagic = NULL; int ret = -1; char *state = NULL; - virJSONValuePtr object = NULL; + virJSONValue *object = NULL; VIR_DEBUG("Running post-restart exec"); @@ -694,7 +694,7 @@ virLockDaemonPostExecRestart(const char *state_file, static int virLockDaemonPreExecRestart(const char *state_file, - virNetDaemonPtr dmn, + virNetDaemon *dmn, char **argv) { g_autoptr(virJSONValue) object = virJSONValueNewObject(); @@ -703,8 +703,8 @@ virLockDaemonPreExecRestart(const char *state_file, g_autoptr(virJSONValue) daemon = NULL; g_autofree char *state = NULL; g_autofree char *magic = NULL; - g_autofree virHashKeyValuePairPtr pairs = NULL; - virHashKeyValuePairPtr tmp; + g_autofree virHashKeyValuePair *pairs = NULL; + virHashKeyValuePair *tmp; VIR_DEBUG("Running pre-restart exec"); @@ -722,7 +722,7 @@ virLockDaemonPreExecRestart(const char *state_file, tmp = pairs = virHashGetItems(lockDaemon->lockspaces, NULL, false); while (tmp && tmp->key) { - virLockSpacePtr lockspace = (virLockSpacePtr)tmp->value; + virLockSpace *lockspace = (virLockSpace *)tmp->value; g_autoptr(virJSONValue) child = NULL; if (!(child = virLockSpacePreExecRestart(lockspace))) @@ -820,10 +820,10 @@ virLockDaemonUsage(const char *argv0, bool privileged) } int main(int argc, char **argv) { - virNetServerPtr lockSrv = NULL; - virNetServerPtr adminSrv = NULL; - virNetServerProgramPtr lockProgram = NULL; - virNetServerProgramPtr adminProgram = NULL; + virNetServer *lockSrv = NULL; + virNetServer *adminSrv = NULL; + virNetServerProgram *lockProgram = NULL; + virNetServerProgram *adminProgram = NULL; char *remote_config_file = NULL; int statuswrite = -1; int ret = 1; @@ -839,7 +839,7 @@ int main(int argc, char **argv) { bool implicit_conf = false; mode_t old_umask; bool privileged = false; - virLockDaemonConfigPtr config = NULL; + virLockDaemonConfig *config = NULL; int rv; struct option opts[] = { diff --git a/src/locking/lock_daemon.h b/src/locking/lock_daemon.h index de229a411a..6bd64e9211 100644 --- a/src/locking/lock_daemon.h +++ b/src/locking/lock_daemon.h @@ -23,10 +23,8 @@ #include "virlockspace.h" typedef struct _virLockDaemon virLockDaemon; -typedef virLockDaemon *virLockDaemonPtr; typedef struct _virLockDaemonClient virLockDaemonClient; -typedef virLockDaemonClient *virLockDaemonClientPtr; struct _virLockDaemonClient { GMutex lock; @@ -40,11 +38,11 @@ struct _virLockDaemonClient { pid_t clientPid; }; -extern virLockDaemonPtr lockDaemon; +extern virLockDaemon *lockDaemon; -int virLockDaemonAddLockSpace(virLockDaemonPtr lockd, +int virLockDaemonAddLockSpace(virLockDaemon *lockd, const char *path, - virLockSpacePtr lockspace); + virLockSpace *lockspace); -virLockSpacePtr virLockDaemonFindLockSpace(virLockDaemonPtr lockd, +virLockSpace *virLockDaemonFindLockSpace(virLockDaemon *lockd, const char *path); diff --git a/src/locking/lock_daemon_config.c b/src/locking/lock_daemon_config.c index f693911997..6106ae02b3 100644 --- a/src/locking/lock_daemon_config.c +++ b/src/locking/lock_daemon_config.c @@ -52,10 +52,10 @@ virLockDaemonConfigFilePath(bool privileged, char **configfile) } -virLockDaemonConfigPtr +virLockDaemonConfig * virLockDaemonConfigNew(bool privileged G_GNUC_UNUSED) { - virLockDaemonConfigPtr data; + virLockDaemonConfig *data; data = g_new0(virLockDaemonConfig, 1); @@ -66,7 +66,7 @@ virLockDaemonConfigNew(bool privileged G_GNUC_UNUSED) } void -virLockDaemonConfigFree(virLockDaemonConfigPtr data) +virLockDaemonConfigFree(virLockDaemonConfig *data) { if (!data) return; @@ -78,8 +78,8 @@ virLockDaemonConfigFree(virLockDaemonConfigPtr data) } static int -virLockDaemonConfigLoadOptions(virLockDaemonConfigPtr data, - virConfPtr conf) +virLockDaemonConfigLoadOptions(virLockDaemonConfig *data, + virConf *conf) { if (virConfGetValueUInt(conf, "log_level", &data->log_level) < 0) return -1; @@ -100,7 +100,7 @@ virLockDaemonConfigLoadOptions(virLockDaemonConfigPtr data, * Only used in the remote case, hence the name. */ int -virLockDaemonConfigLoadFile(virLockDaemonConfigPtr data, +virLockDaemonConfigLoadFile(virLockDaemonConfig *data, const char *filename, bool allow_missing) { diff --git a/src/locking/lock_daemon_config.h b/src/locking/lock_daemon_config.h index 0f47ab1ed0..c9137fbc6a 100644 --- a/src/locking/lock_daemon_config.h +++ b/src/locking/lock_daemon_config.h @@ -24,8 +24,6 @@ #include "internal.h" typedef struct _virLockDaemonConfig virLockDaemonConfig; -typedef virLockDaemonConfig *virLockDaemonConfigPtr; - struct _virLockDaemonConfig { unsigned int log_level; char *log_filters; @@ -36,8 +34,8 @@ struct _virLockDaemonConfig { int virLockDaemonConfigFilePath(bool privileged, char **configfile); -virLockDaemonConfigPtr virLockDaemonConfigNew(bool privileged); -void virLockDaemonConfigFree(virLockDaemonConfigPtr data); -int virLockDaemonConfigLoadFile(virLockDaemonConfigPtr data, +virLockDaemonConfig *virLockDaemonConfigNew(bool privileged); +void virLockDaemonConfigFree(virLockDaemonConfig *data); +int virLockDaemonConfigLoadFile(virLockDaemonConfig *data, const char *filename, bool allow_missing); diff --git a/src/locking/lock_daemon_dispatch.c b/src/locking/lock_daemon_dispatch.c index 7a6b7af79b..e8b9832453 100644 --- a/src/locking/lock_daemon_dispatch.c +++ b/src/locking/lock_daemon_dispatch.c @@ -36,17 +36,17 @@ VIR_LOG_INIT("locking.lock_daemon_dispatch"); #include "lock_daemon_dispatch_stubs.h" static int -virLockSpaceProtocolDispatchAcquireResource(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +virLockSpaceProtocolDispatchAcquireResource(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, virLockSpaceProtocolAcquireResourceArgs *args) { int rv = -1; unsigned int flags = args->flags; - virLockDaemonClientPtr priv = + virLockDaemonClient *priv = virNetServerClientGetPrivateData(client); - virLockSpacePtr lockspace; + virLockSpace *lockspace; unsigned int newFlags; g_mutex_lock(&priv->lock); @@ -96,17 +96,17 @@ virLockSpaceProtocolDispatchAcquireResource(virNetServerPtr server G_GNUC_UNUSED static int -virLockSpaceProtocolDispatchCreateResource(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +virLockSpaceProtocolDispatchCreateResource(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, virLockSpaceProtocolCreateResourceArgs *args) { int rv = -1; unsigned int flags = args->flags; - virLockDaemonClientPtr priv = + virLockDaemonClient *priv = virNetServerClientGetPrivateData(client); - virLockSpacePtr lockspace; + virLockSpace *lockspace; g_mutex_lock(&priv->lock); @@ -145,17 +145,17 @@ virLockSpaceProtocolDispatchCreateResource(virNetServerPtr server G_GNUC_UNUSED, static int -virLockSpaceProtocolDispatchDeleteResource(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +virLockSpaceProtocolDispatchDeleteResource(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, virLockSpaceProtocolDeleteResourceArgs *args) { int rv = -1; unsigned int flags = args->flags; - virLockDaemonClientPtr priv = + virLockDaemonClient *priv = virNetServerClientGetPrivateData(client); - virLockSpacePtr lockspace; + virLockSpace *lockspace; g_mutex_lock(&priv->lock); @@ -194,17 +194,17 @@ virLockSpaceProtocolDispatchDeleteResource(virNetServerPtr server G_GNUC_UNUSED, static int -virLockSpaceProtocolDispatchNew(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +virLockSpaceProtocolDispatchNew(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, virLockSpaceProtocolNewArgs *args) { int rv = -1; unsigned int flags = args->flags; - virLockDaemonClientPtr priv = + virLockDaemonClient *priv = virNetServerClientGetPrivateData(client); - virLockSpacePtr lockspace; + virLockSpace *lockspace; g_mutex_lock(&priv->lock); @@ -250,15 +250,15 @@ virLockSpaceProtocolDispatchNew(virNetServerPtr server G_GNUC_UNUSED, static int -virLockSpaceProtocolDispatchRegister(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +virLockSpaceProtocolDispatchRegister(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, virLockSpaceProtocolRegisterArgs *args) { int rv = -1; unsigned int flags = args->flags; - virLockDaemonClientPtr priv = + virLockDaemonClient *priv = virNetServerClientGetPrivateData(client); g_mutex_lock(&priv->lock); @@ -295,17 +295,17 @@ virLockSpaceProtocolDispatchRegister(virNetServerPtr server G_GNUC_UNUSED, static int -virLockSpaceProtocolDispatchReleaseResource(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +virLockSpaceProtocolDispatchReleaseResource(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, virLockSpaceProtocolReleaseResourceArgs *args) { int rv = -1; unsigned int flags = args->flags; - virLockDaemonClientPtr priv = + virLockDaemonClient *priv = virNetServerClientGetPrivateData(client); - virLockSpacePtr lockspace; + virLockSpace *lockspace; g_mutex_lock(&priv->lock); @@ -346,15 +346,15 @@ virLockSpaceProtocolDispatchReleaseResource(virNetServerPtr server G_GNUC_UNUSED static int -virLockSpaceProtocolDispatchRestrict(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +virLockSpaceProtocolDispatchRestrict(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, virLockSpaceProtocolRestrictArgs *args) { int rv = -1; unsigned int flags = args->flags; - virLockDaemonClientPtr priv = + virLockDaemonClient *priv = virNetServerClientGetPrivateData(client); g_mutex_lock(&priv->lock); @@ -385,16 +385,16 @@ virLockSpaceProtocolDispatchRestrict(virNetServerPtr server G_GNUC_UNUSED, static int -virLockSpaceProtocolDispatchCreateLockSpace(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +virLockSpaceProtocolDispatchCreateLockSpace(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, virLockSpaceProtocolCreateLockSpaceArgs *args) { int rv = -1; - virLockDaemonClientPtr priv = + virLockDaemonClient *priv = virNetServerClientGetPrivateData(client); - virLockSpacePtr lockspace; + virLockSpace *lockspace; g_mutex_lock(&priv->lock); diff --git a/src/locking/lock_driver.h b/src/locking/lock_driver.h index e53c28ee33..087a918882 100644 --- a/src/locking/lock_driver.h +++ b/src/locking/lock_driver.h @@ -25,13 +25,10 @@ #include "domain_conf.h" typedef struct _virLockManager virLockManager; -typedef virLockManager *virLockManagerPtr; typedef struct _virLockDriver virLockDriver; -typedef virLockDriver *virLockDriverPtr; typedef struct _virLockManagerParam virLockManagerParam; -typedef virLockManagerParam *virLockManagerParamPtr; typedef enum { /* State passing is used to re-acquire existing leases */ @@ -169,10 +166,10 @@ typedef int (*virLockDriverDeinit)(void); * * Returns 0 if successful initialized a new context, -1 on error */ -typedef int (*virLockDriverNew)(virLockManagerPtr man, +typedef int (*virLockDriverNew)(virLockManager *man, unsigned int type, size_t nparams, - virLockManagerParamPtr params, + virLockManagerParam *params, unsigned int flags); /** @@ -182,7 +179,7 @@ typedef int (*virLockDriverNew)(virLockManagerPtr man, * Release any resources associated with the lock manager * context private data */ -typedef void (*virLockDriverFree)(virLockManagerPtr man); +typedef void (*virLockDriverFree)(virLockManager *man); /** * virLockDriverAddResource: @@ -216,11 +213,11 @@ typedef void (*virLockDriverFree)(virLockManagerPtr man); * * Returns 0 on success, or -1 on failure */ -typedef int (*virLockDriverAddResource)(virLockManagerPtr man, +typedef int (*virLockDriverAddResource)(virLockManager *man, unsigned int type, const char *name, size_t nparams, - virLockManagerParamPtr params, + virLockManagerParam *params, unsigned int flags); /** @@ -245,7 +242,7 @@ typedef int (*virLockDriverAddResource)(virLockManagerPtr man, * * Returns 0 on success, or -1 on failure */ -typedef int (*virLockDriverAcquire)(virLockManagerPtr man, +typedef int (*virLockDriverAcquire)(virLockManager *man, const char *state, unsigned int flags, virDomainLockFailureAction action, @@ -262,7 +259,7 @@ typedef int (*virLockDriverAcquire)(virLockManagerPtr man, * * Returns 0 on success, or -1 on failure */ -typedef int (*virLockDriverRelease)(virLockManagerPtr man, +typedef int (*virLockDriverRelease)(virLockManager *man, char **state, unsigned int flags); @@ -279,13 +276,13 @@ typedef int (*virLockDriverRelease)(virLockManagerPtr man, * * Returns 0 on success, or -1 on failure. */ -typedef int (*virLockDriverInquire)(virLockManagerPtr man, +typedef int (*virLockDriverInquire)(virLockManager *man, char **state, unsigned int flags); struct _virLockManager { - virLockDriverPtr driver; + virLockDriver *driver; void *privateData; }; diff --git a/src/locking/lock_driver_lockd.c b/src/locking/lock_driver_lockd.c index 6137e94e3c..823b918db3 100644 --- a/src/locking/lock_driver_lockd.c +++ b/src/locking/lock_driver_lockd.c @@ -44,13 +44,10 @@ VIR_LOG_INIT("locking.lock_driver_lockd"); typedef struct _virLockManagerLockDaemonPrivate virLockManagerLockDaemonPrivate; -typedef virLockManagerLockDaemonPrivate *virLockManagerLockDaemonPrivatePtr; typedef struct _virLockManagerLockDaemonResource virLockManagerLockDaemonResource; -typedef virLockManagerLockDaemonResource *virLockManagerLockDaemonResourcePtr; typedef struct _virLockManagerLockDaemonDriver virLockManagerLockDaemonDriver; -typedef virLockManagerLockDaemonDriver *virLockManagerLockDaemonDriverPtr; struct _virLockManagerLockDaemonResource { char *lockspace; @@ -65,7 +62,7 @@ struct _virLockManagerLockDaemonPrivate { pid_t pid; size_t nresources; - virLockManagerLockDaemonResourcePtr resources; + virLockManagerLockDaemonResource *resources; bool hasRWDisks; }; @@ -80,7 +77,7 @@ struct _virLockManagerLockDaemonDriver { char *scsiLockSpaceDir; }; -static virLockManagerLockDaemonDriverPtr driver; +static virLockManagerLockDaemonDriver *driver; static int virLockManagerLockDaemonLoadConfig(const char *configFile) { @@ -136,12 +133,12 @@ static char *virLockManagerLockDaemonPath(bool privileged) static int -virLockManagerLockDaemonConnectionRegister(virLockManagerPtr lock, - virNetClientPtr client, - virNetClientProgramPtr program, +virLockManagerLockDaemonConnectionRegister(virLockManager *lock, + virNetClient *client, + virNetClientProgram *program, int *counter) { - virLockManagerLockDaemonPrivatePtr priv = lock->privateData; + virLockManagerLockDaemonPrivate *priv = lock->privateData; virLockSpaceProtocolRegisterArgs args; memset(&args, 0, sizeof(args)); @@ -166,9 +163,9 @@ virLockManagerLockDaemonConnectionRegister(virLockManagerPtr lock, static int -virLockManagerLockDaemonConnectionRestrict(virLockManagerPtr lock G_GNUC_UNUSED, - virNetClientPtr client, - virNetClientProgramPtr program, +virLockManagerLockDaemonConnectionRestrict(virLockManager *lock G_GNUC_UNUSED, + virNetClient *client, + virNetClientProgram *program, int *counter) { virLockSpaceProtocolRestrictArgs args; @@ -190,10 +187,10 @@ virLockManagerLockDaemonConnectionRestrict(virLockManagerPtr lock G_GNUC_UNUSED, } -static virNetClientPtr virLockManagerLockDaemonConnectionNew(bool privileged, - virNetClientProgramPtr *prog) +static virNetClient *virLockManagerLockDaemonConnectionNew(bool privileged, + virNetClientProgram **prog) { - virNetClientPtr client = NULL; + virNetClient *client = NULL; char *lockdpath; char *daemonPath = NULL; @@ -240,12 +237,12 @@ static virNetClientPtr virLockManagerLockDaemonConnectionNew(bool privileged, } -static virNetClientPtr -virLockManagerLockDaemonConnect(virLockManagerPtr lock, - virNetClientProgramPtr *program, +static virNetClient * +virLockManagerLockDaemonConnect(virLockManager *lock, + virNetClientProgram **program, int *counter) { - virNetClientPtr client; + virNetClient *client; if (!(client = virLockManagerLockDaemonConnectionNew(geteuid() == 0, program))) return NULL; @@ -267,8 +264,8 @@ virLockManagerLockDaemonConnect(virLockManagerPtr lock, static int virLockManagerLockDaemonSetupLockspace(const char *path) { - virNetClientPtr client; - virNetClientProgramPtr program = NULL; + virNetClient *client; + virNetClientProgram *program = NULL; virLockSpaceProtocolCreateLockSpaceArgs args; int rv = -1; int counter = 0; @@ -361,7 +358,7 @@ static int virLockManagerLockDaemonDeinit(void) } static void -virLockManagerLockDaemonPrivateFree(virLockManagerLockDaemonPrivatePtr priv) +virLockManagerLockDaemonPrivateFree(virLockManagerLockDaemonPrivate *priv) { size_t i; @@ -378,7 +375,7 @@ virLockManagerLockDaemonPrivateFree(virLockManagerLockDaemonPrivatePtr priv) g_free(priv); } -static void virLockManagerLockDaemonFree(virLockManagerPtr lock) +static void virLockManagerLockDaemonFree(virLockManager *lock) { if (!lock) return; @@ -388,13 +385,13 @@ static void virLockManagerLockDaemonFree(virLockManagerPtr lock) } -static int virLockManagerLockDaemonNew(virLockManagerPtr lock, +static int virLockManagerLockDaemonNew(virLockManager *lock, unsigned int type, size_t nparams, - virLockManagerParamPtr params, + virLockManagerParam *params, unsigned int flags) { - virLockManagerLockDaemonPrivatePtr priv = NULL; + virLockManagerLockDaemonPrivate *priv = NULL; size_t i; int ret = -1; @@ -522,14 +519,14 @@ virLockManagerGetLVMKey(const char *path, #endif -static int virLockManagerLockDaemonAddResource(virLockManagerPtr lock, +static int virLockManagerLockDaemonAddResource(virLockManager *lock, unsigned int type, const char *name, size_t nparams, - virLockManagerParamPtr params, + virLockManagerParam *params, unsigned int flags) { - virLockManagerLockDaemonPrivatePtr priv = lock->privateData; + virLockManagerLockDaemonPrivate *priv = lock->privateData; char *newName = NULL; char *newLockspace = NULL; bool autoCreate = false; @@ -661,17 +658,17 @@ static int virLockManagerLockDaemonAddResource(virLockManagerPtr lock, } -static int virLockManagerLockDaemonAcquire(virLockManagerPtr lock, +static int virLockManagerLockDaemonAcquire(virLockManager *lock, const char *state G_GNUC_UNUSED, unsigned int flags, virDomainLockFailureAction action G_GNUC_UNUSED, int *fd) { - virNetClientPtr client = NULL; - virNetClientProgramPtr program = NULL; + virNetClient *client = NULL; + virNetClientProgram *program = NULL; int counter = 0; int rv = -1; - virLockManagerLockDaemonPrivatePtr priv = lock->privateData; + virLockManagerLockDaemonPrivate *priv = lock->privateData; virCheckFlags(VIR_LOCK_MANAGER_ACQUIRE_REGISTER_ONLY | VIR_LOCK_MANAGER_ACQUIRE_RESTRICT, -1); @@ -729,16 +726,16 @@ static int virLockManagerLockDaemonAcquire(virLockManagerPtr lock, return rv; } -static int virLockManagerLockDaemonRelease(virLockManagerPtr lock, +static int virLockManagerLockDaemonRelease(virLockManager *lock, char **state, unsigned int flags) { - virNetClientPtr client = NULL; - virNetClientProgramPtr program = NULL; + virNetClient *client = NULL; + virNetClientProgram *program = NULL; int counter = 0; int rv = -1; size_t i; - virLockManagerLockDaemonPrivatePtr priv = lock->privateData; + virLockManagerLockDaemonPrivate *priv = lock->privateData; virCheckFlags(0, -1); @@ -783,7 +780,7 @@ static int virLockManagerLockDaemonRelease(virLockManagerPtr lock, } -static int virLockManagerLockDaemonInquire(virLockManagerPtr lock G_GNUC_UNUSED, +static int virLockManagerLockDaemonInquire(virLockManager *lock G_GNUC_UNUSED, char **state, unsigned int flags) { diff --git a/src/locking/lock_driver_nop.c b/src/locking/lock_driver_nop.c index 1e28a42dc0..13934bbc37 100644 --- a/src/locking/lock_driver_nop.c +++ b/src/locking/lock_driver_nop.c @@ -47,27 +47,27 @@ static int virLockManagerNopDeinit(void) } -static int virLockManagerNopNew(virLockManagerPtr lock G_GNUC_UNUSED, +static int virLockManagerNopNew(virLockManager *lock G_GNUC_UNUSED, unsigned int type G_GNUC_UNUSED, size_t nparams G_GNUC_UNUSED, - virLockManagerParamPtr params G_GNUC_UNUSED, + virLockManagerParam *params G_GNUC_UNUSED, unsigned int flags_unused G_GNUC_UNUSED) { return 0; } -static int virLockManagerNopAddResource(virLockManagerPtr lock G_GNUC_UNUSED, +static int virLockManagerNopAddResource(virLockManager *lock G_GNUC_UNUSED, unsigned int type G_GNUC_UNUSED, const char *name G_GNUC_UNUSED, size_t nparams G_GNUC_UNUSED, - virLockManagerParamPtr params G_GNUC_UNUSED, + virLockManagerParam *params G_GNUC_UNUSED, unsigned int flags_unused G_GNUC_UNUSED) { return 0; } -static int virLockManagerNopAcquire(virLockManagerPtr lock G_GNUC_UNUSED, +static int virLockManagerNopAcquire(virLockManager *lock G_GNUC_UNUSED, const char *state G_GNUC_UNUSED, unsigned int flags_unused G_GNUC_UNUSED, virDomainLockFailureAction action G_GNUC_UNUSED, @@ -76,7 +76,7 @@ static int virLockManagerNopAcquire(virLockManagerPtr lock G_GNUC_UNUSED, return 0; } -static int virLockManagerNopRelease(virLockManagerPtr lock G_GNUC_UNUSED, +static int virLockManagerNopRelease(virLockManager *lock G_GNUC_UNUSED, char **state, unsigned int flags_unused G_GNUC_UNUSED) { @@ -86,7 +86,7 @@ static int virLockManagerNopRelease(virLockManagerPtr lock G_GNUC_UNUSED, return 0; } -static int virLockManagerNopInquire(virLockManagerPtr lock G_GNUC_UNUSED, +static int virLockManagerNopInquire(virLockManager *lock G_GNUC_UNUSED, char **state, unsigned int flags_unused G_GNUC_UNUSED) { @@ -96,7 +96,7 @@ static int virLockManagerNopInquire(virLockManagerPtr lock G_GNUC_UNUSED, return 0; } -static void virLockManagerNopFree(virLockManagerPtr lock G_GNUC_UNUSED) +static void virLockManagerNopFree(virLockManager *lock G_GNUC_UNUSED) { } diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sanlock.c index 1d8f109375..46e2cbc4f0 100644 --- a/src/locking/lock_driver_sanlock.c +++ b/src/locking/lock_driver_sanlock.c @@ -59,10 +59,8 @@ VIR_LOG_INIT("locking.lock_driver_sanlock"); #endif typedef struct _virLockManagerSanlockDriver virLockManagerSanlockDriver; -typedef virLockManagerSanlockDriver *virLockManagerSanlockDriverPtr; typedef struct _virLockManagerSanlockPrivate virLockManagerSanlockPrivate; -typedef virLockManagerSanlockPrivate *virLockManagerSanlockPrivatePtr; struct _virLockManagerSanlockDriver { bool requireLeaseForDisks; @@ -76,7 +74,7 @@ struct _virLockManagerSanlockDriver { gid_t group; }; -static virLockManagerSanlockDriverPtr sanlockDriver; +static virLockManagerSanlockDriver *sanlockDriver; struct _virLockManagerSanlockPrivate { const char *vm_uri; @@ -116,7 +114,7 @@ virLockManagerSanlockError(int err, * sanlock plugin for the libvirt virLockManager API */ static int -virLockManagerSanlockLoadConfig(virLockManagerSanlockDriverPtr driver, +virLockManagerSanlockLoadConfig(virLockManagerSanlockDriver *driver, const char *configFile) { g_autoptr(virConf) conf = NULL; @@ -173,7 +171,7 @@ virLockManagerSanlockLoadConfig(virLockManagerSanlockDriverPtr driver, } static int -virLockManagerSanlockInitLockspace(virLockManagerSanlockDriverPtr driver, +virLockManagerSanlockInitLockspace(virLockManagerSanlockDriver *driver, struct sanlk_lockspace *ls) { int ret; @@ -189,7 +187,7 @@ virLockManagerSanlockInitLockspace(virLockManagerSanlockDriverPtr driver, #define LOCKSPACE_RETRIES 10 static int -virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriverPtr driver) +virLockManagerSanlockSetupLockspace(virLockManagerSanlockDriver *driver) { int fd = -1; struct stat st; @@ -388,7 +386,7 @@ static int virLockManagerSanlockInit(unsigned int version, const char *configFile, unsigned int flags) { - virLockManagerSanlockDriverPtr driver; + virLockManagerSanlockDriver *driver; VIR_DEBUG("version=%u configFile=%s flags=0x%x", version, NULLSTR(configFile), flags); @@ -442,14 +440,14 @@ static int virLockManagerSanlockDeinit(void) } -static int virLockManagerSanlockNew(virLockManagerPtr lock, +static int virLockManagerSanlockNew(virLockManager *lock, unsigned int type, size_t nparams, - virLockManagerParamPtr params, + virLockManagerParam *params, unsigned int flags) { - virLockManagerParamPtr param; - virLockManagerSanlockPrivatePtr priv; + virLockManagerParam *param; + virLockManagerSanlockPrivate *priv; size_t i; int resCount = 0; @@ -505,9 +503,9 @@ static int virLockManagerSanlockNew(virLockManagerPtr lock, return 0; } -static void virLockManagerSanlockFree(virLockManagerPtr lock) +static void virLockManagerSanlockFree(virLockManager *lock) { - virLockManagerSanlockPrivatePtr priv = lock->privateData; + virLockManagerSanlockPrivate *priv = lock->privateData; size_t i; if (!priv) @@ -521,13 +519,13 @@ static void virLockManagerSanlockFree(virLockManagerPtr lock) } -static int virLockManagerSanlockAddLease(virLockManagerPtr lock, +static int virLockManagerSanlockAddLease(virLockManager *lock, const char *name, size_t nparams, - virLockManagerParamPtr params, + virLockManagerParam *params, bool shared) { - virLockManagerSanlockPrivatePtr priv = lock->privateData; + virLockManagerSanlockPrivate *priv = lock->privateData; g_autofree struct sanlk_resource *res = NULL; size_t i; @@ -572,14 +570,14 @@ static int virLockManagerSanlockAddLease(virLockManagerPtr lock, static int -virLockManagerSanlockAddDisk(virLockManagerSanlockDriverPtr driver, - virLockManagerPtr lock, +virLockManagerSanlockAddDisk(virLockManagerSanlockDriver *driver, + virLockManager *lock, const char *name, size_t nparams, - virLockManagerParamPtr params G_GNUC_UNUSED, + virLockManagerParam *params G_GNUC_UNUSED, bool shared) { - virLockManagerSanlockPrivatePtr priv = lock->privateData; + virLockManagerSanlockPrivate *priv = lock->privateData; g_autofree struct sanlk_resource *res = NULL; g_autofree char *path = NULL; g_autofree char *hash = NULL; @@ -628,7 +626,7 @@ virLockManagerSanlockAddDisk(virLockManagerSanlockDriverPtr driver, static int -virLockManagerSanlockCreateLease(virLockManagerSanlockDriverPtr driver, +virLockManagerSanlockCreateLease(virLockManagerSanlockDriver *driver, struct sanlk_resource *res) { int fd = -1; @@ -716,15 +714,15 @@ virLockManagerSanlockCreateLease(virLockManagerSanlockDriverPtr driver, } -static int virLockManagerSanlockAddResource(virLockManagerPtr lock, +static int virLockManagerSanlockAddResource(virLockManager *lock, unsigned int type, const char *name, size_t nparams, - virLockManagerParamPtr params, + virLockManagerParam *params, unsigned int flags) { - virLockManagerSanlockDriverPtr driver = sanlockDriver; - virLockManagerSanlockPrivatePtr priv = lock->privateData; + virLockManagerSanlockDriver *driver = sanlockDriver; + virLockManagerSanlockPrivate *priv = lock->privateData; virCheckFlags(VIR_LOCK_MANAGER_RESOURCE_READONLY | VIR_LOCK_MANAGER_RESOURCE_SHARED, -1); @@ -856,14 +854,14 @@ virLockManagerSanlockRegisterKillscript(int sock, return ret; } -static int virLockManagerSanlockAcquire(virLockManagerPtr lock, +static int virLockManagerSanlockAcquire(virLockManager *lock, const char *state, unsigned int flags, virDomainLockFailureAction action, int *fd) { - virLockManagerSanlockDriverPtr driver = sanlockDriver; - virLockManagerSanlockPrivatePtr priv = lock->privateData; + virLockManagerSanlockDriver *driver = sanlockDriver; + virLockManagerSanlockPrivate *priv = lock->privateData; struct sanlk_options *opt = NULL; struct sanlk_resource **res_args; int res_count; @@ -1021,11 +1019,11 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock, } -static int virLockManagerSanlockRelease(virLockManagerPtr lock, +static int virLockManagerSanlockRelease(virLockManager *lock, char **state, unsigned int flags) { - virLockManagerSanlockPrivatePtr priv = lock->privateData; + virLockManagerSanlockPrivate *priv = lock->privateData; int res_count = priv->res_count; int rv; @@ -1073,11 +1071,11 @@ static int virLockManagerSanlockRelease(virLockManagerPtr lock, return 0; } -static int virLockManagerSanlockInquire(virLockManagerPtr lock, +static int virLockManagerSanlockInquire(virLockManager *lock, char **state, unsigned int flags) { - virLockManagerSanlockPrivatePtr priv = lock->privateData; + virLockManagerSanlockPrivate *priv = lock->privateData; int rv, res_count; virCheckFlags(0, -1); diff --git a/src/locking/lock_manager.c b/src/locking/lock_manager.c index 90ec5cdfbe..82205865b2 100644 --- a/src/locking/lock_manager.c +++ b/src/locking/lock_manager.c @@ -59,13 +59,13 @@ VIR_LOG_INIT("locking.lock_manager"); struct _virLockManagerPlugin { char *name; - virLockDriverPtr driver; + virLockDriver *driver; void *handle; int refs; }; static void virLockManagerLogParams(size_t nparams, - virLockManagerParamPtr params) + virLockManagerParam *params) { size_t i; char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -117,14 +117,14 @@ static void virLockManagerLogParams(size_t nparams, * Returns a plugin object, or NULL if loading failed. */ #if WITH_DLFCN_H -virLockManagerPluginPtr virLockManagerPluginNew(const char *name, +virLockManagerPlugin *virLockManagerPluginNew(const char *name, const char *driverName, const char *configDir, unsigned int flags) { void *handle = NULL; - virLockDriverPtr driver; - virLockManagerPluginPtr plugin = NULL; + virLockDriver *driver; + virLockManagerPlugin *plugin = NULL; char *modfile = NULL; char *configFile = NULL; @@ -191,7 +191,7 @@ virLockManagerPluginPtr virLockManagerPluginNew(const char *name, return NULL; } #else /* !WITH_DLFCN_H */ -virLockManagerPluginPtr +virLockManagerPlugin * virLockManagerPluginNew(const char *name G_GNUC_UNUSED, const char *driverName G_GNUC_UNUSED, const char *configDir G_GNUC_UNUSED, @@ -210,7 +210,7 @@ virLockManagerPluginNew(const char *name G_GNUC_UNUSED, * * Acquires an additional reference on the plugin. */ -void virLockManagerPluginRef(virLockManagerPluginPtr plugin) +void virLockManagerPluginRef(virLockManagerPlugin *plugin) { plugin->refs++; } @@ -227,7 +227,7 @@ void virLockManagerPluginRef(virLockManagerPluginPtr plugin) * */ #if WITH_DLFCN_H -void virLockManagerPluginUnref(virLockManagerPluginPtr plugin) +void virLockManagerPluginUnref(virLockManagerPlugin *plugin) { if (!plugin) return; @@ -249,13 +249,13 @@ void virLockManagerPluginUnref(virLockManagerPluginPtr plugin) g_free(plugin); } #else /* !WITH_DLFCN_H */ -void virLockManagerPluginUnref(virLockManagerPluginPtr plugin G_GNUC_UNUSED) +void virLockManagerPluginUnref(virLockManagerPlugin *plugin G_GNUC_UNUSED) { } #endif /* !WITH_DLFCN_H */ -const char *virLockManagerPluginGetName(virLockManagerPluginPtr plugin) +const char *virLockManagerPluginGetName(virLockManagerPlugin *plugin) { VIR_DEBUG("plugin=%p", plugin); @@ -263,7 +263,7 @@ const char *virLockManagerPluginGetName(virLockManagerPluginPtr plugin) } -bool virLockManagerPluginUsesState(virLockManagerPluginPtr plugin) +bool virLockManagerPluginUsesState(virLockManagerPlugin *plugin) { VIR_DEBUG("plugin=%p", plugin); @@ -271,7 +271,7 @@ bool virLockManagerPluginUsesState(virLockManagerPluginPtr plugin) } -virLockDriverPtr virLockManagerPluginGetDriver(virLockManagerPluginPtr plugin) +virLockDriver *virLockManagerPluginGetDriver(virLockManagerPlugin *plugin) { VIR_DEBUG("plugin=%p", plugin); @@ -289,13 +289,13 @@ virLockDriverPtr virLockManagerPluginGetDriver(virLockManagerPluginPtr plugin) * * Returns a new lock manager context */ -virLockManagerPtr virLockManagerNew(virLockDriverPtr driver, +virLockManager *virLockManagerNew(virLockDriver *driver, unsigned int type, size_t nparams, - virLockManagerParamPtr params, + virLockManagerParam *params, unsigned int flags) { - virLockManagerPtr lock; + virLockManager *lock; VIR_DEBUG("driver=%p type=%u nparams=%zu params=%p flags=0x%x", driver, type, nparams, params, flags); virLockManagerLogParams(nparams, params); @@ -315,11 +315,11 @@ virLockManagerPtr virLockManagerNew(virLockDriverPtr driver, } -int virLockManagerAddResource(virLockManagerPtr lock, +int virLockManagerAddResource(virLockManager *lock, unsigned int type, const char *name, size_t nparams, - virLockManagerParamPtr params, + virLockManagerParam *params, unsigned int flags) { VIR_DEBUG("lock=%p type=%u name=%s nparams=%zu params=%p flags=0x%x", @@ -334,7 +334,7 @@ int virLockManagerAddResource(virLockManagerPtr lock, flags); } -int virLockManagerAcquire(virLockManagerPtr lock, +int virLockManagerAcquire(virLockManager *lock, const char *state, unsigned int flags, virDomainLockFailureAction action, @@ -352,7 +352,7 @@ int virLockManagerAcquire(virLockManagerPtr lock, } -int virLockManagerRelease(virLockManagerPtr lock, +int virLockManagerRelease(virLockManager *lock, char **state, unsigned int flags) { @@ -364,7 +364,7 @@ int virLockManagerRelease(virLockManagerPtr lock, } -int virLockManagerInquire(virLockManagerPtr lock, +int virLockManagerInquire(virLockManager *lock, char **state, unsigned int flags) { @@ -376,7 +376,7 @@ int virLockManagerInquire(virLockManagerPtr lock, } -int virLockManagerFree(virLockManagerPtr lock) +int virLockManagerFree(virLockManager *lock) { VIR_DEBUG("lock=%p", lock); diff --git a/src/locking/lock_manager.h b/src/locking/lock_manager.h index 4a19f58879..774931f7d6 100644 --- a/src/locking/lock_manager.h +++ b/src/locking/lock_manager.h @@ -25,43 +25,42 @@ #include "lock_driver.h" typedef struct _virLockManagerPlugin virLockManagerPlugin; -typedef virLockManagerPlugin *virLockManagerPluginPtr; -virLockManagerPluginPtr virLockManagerPluginNew(const char *name, +virLockManagerPlugin *virLockManagerPluginNew(const char *name, const char *driverName, const char *configDir, unsigned int flags); -void virLockManagerPluginRef(virLockManagerPluginPtr plugin); -void virLockManagerPluginUnref(virLockManagerPluginPtr plugin); +void virLockManagerPluginRef(virLockManagerPlugin *plugin); +void virLockManagerPluginUnref(virLockManagerPlugin *plugin); -const char *virLockManagerPluginGetName(virLockManagerPluginPtr plugin); -bool virLockManagerPluginUsesState(virLockManagerPluginPtr plugin); +const char *virLockManagerPluginGetName(virLockManagerPlugin *plugin); +bool virLockManagerPluginUsesState(virLockManagerPlugin *plugin); -virLockDriverPtr virLockManagerPluginGetDriver(virLockManagerPluginPtr plugin); +virLockDriver *virLockManagerPluginGetDriver(virLockManagerPlugin *plugin); -virLockManagerPtr virLockManagerNew(virLockDriverPtr driver, +virLockManager *virLockManagerNew(virLockDriver *driver, unsigned int type, size_t nparams, - virLockManagerParamPtr params, + virLockManagerParam *params, unsigned int flags); -int virLockManagerAddResource(virLockManagerPtr manager, +int virLockManagerAddResource(virLockManager *manager, unsigned int type, const char *name, size_t nparams, - virLockManagerParamPtr params, + virLockManagerParam *params, unsigned int flags); -int virLockManagerAcquire(virLockManagerPtr manager, +int virLockManagerAcquire(virLockManager *manager, const char *state, unsigned int flags, virDomainLockFailureAction action, int *fd); -int virLockManagerRelease(virLockManagerPtr manager, +int virLockManagerRelease(virLockManager *manager, char **state, unsigned int flags); -int virLockManagerInquire(virLockManagerPtr manager, +int virLockManagerInquire(virLockManager *manager, char **state, unsigned int flags); -int virLockManagerFree(virLockManagerPtr manager); +int virLockManagerFree(virLockManager *manager); diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c index e81de50899..1b04fbdae8 100644 --- a/src/logging/log_daemon.c +++ b/src/logging/log_daemon.c @@ -57,30 +57,30 @@ VIR_LOG_INIT("logging.log_daemon"); struct _virLogDaemon { GMutex lock; - virNetDaemonPtr dmn; - virLogHandlerPtr handler; + virNetDaemon *dmn; + virLogHandler *handler; }; -virLogDaemonPtr logDaemon = NULL; +virLogDaemon *logDaemon = NULL; static bool execRestart; static void * -virLogDaemonClientNew(virNetServerClientPtr client, +virLogDaemonClientNew(virNetServerClient *client, void *opaque); static void virLogDaemonClientFree(void *opaque); static void * -virLogDaemonClientNewPostExecRestart(virNetServerClientPtr client, - virJSONValuePtr object, +virLogDaemonClientNewPostExecRestart(virNetServerClient *client, + virJSONValue *object, void *opaque); -static virJSONValuePtr -virLogDaemonClientPreExecRestart(virNetServerClientPtr client, +static virJSONValue * +virLogDaemonClientPreExecRestart(virNetServerClient *client, void *opaque); static void -virLogDaemonFree(virLogDaemonPtr logd) +virLogDaemonFree(virLogDaemon *logd) { if (!logd) return; @@ -96,7 +96,7 @@ virLogDaemonFree(virLogDaemonPtr logd) static void virLogDaemonInhibitor(bool inhibit, void *opaque) { - virLogDaemonPtr dmn = opaque; + virLogDaemon *dmn = opaque; /* virtlogd uses inhibition only to stop session daemon being killed after * the specified timeout, for the system daemon this is taken care of by @@ -110,11 +110,11 @@ virLogDaemonInhibitor(bool inhibit, void *opaque) virNetDaemonRemoveShutdownInhibition(dmn->dmn); } -static virLogDaemonPtr -virLogDaemonNew(virLogDaemonConfigPtr config, bool privileged) +static virLogDaemon * +virLogDaemonNew(virLogDaemonConfig *config, bool privileged) { - virLogDaemonPtr logd; - virNetServerPtr srv = NULL; + virLogDaemon *logd; + virNetServer *srv = NULL; logd = g_new0(virLogDaemon, 1); @@ -167,17 +167,17 @@ virLogDaemonNew(virLogDaemonConfigPtr config, bool privileged) } -virLogHandlerPtr -virLogDaemonGetHandler(virLogDaemonPtr dmn) +virLogHandler * +virLogDaemonGetHandler(virLogDaemon *dmn) { return dmn->handler; } -static virNetServerPtr -virLogDaemonNewServerPostExecRestart(virNetDaemonPtr dmn, +static virNetServer * +virLogDaemonNewServerPostExecRestart(virNetDaemon *dmn, const char *name, - virJSONValuePtr object, + virJSONValue *object, void *opaque) { if (STREQ(name, "virtlogd")) { @@ -205,12 +205,12 @@ virLogDaemonNewServerPostExecRestart(virNetDaemonPtr dmn, } -static virLogDaemonPtr -virLogDaemonNewPostExecRestart(virJSONValuePtr object, bool privileged, - virLogDaemonConfigPtr config) +static virLogDaemon * +virLogDaemonNewPostExecRestart(virJSONValue *object, bool privileged, + virLogDaemonConfig *config) { - virLogDaemonPtr logd; - virJSONValuePtr child; + virLogDaemon *logd; + virJSONValue *child; const char *serverNames[] = { "virtlogd" }; logd = g_new0(virLogDaemon, 1); @@ -270,7 +270,7 @@ virLogDaemonVersion(const char *argv0) } static void -virLogDaemonShutdownHandler(virNetDaemonPtr dmn, +virLogDaemonShutdownHandler(virNetDaemon *dmn, siginfo_t *sig G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { @@ -278,7 +278,7 @@ virLogDaemonShutdownHandler(virNetDaemonPtr dmn, } static void -virLogDaemonExecRestartHandler(virNetDaemonPtr dmn, +virLogDaemonExecRestartHandler(virNetDaemon *dmn, siginfo_t *sig G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { @@ -287,7 +287,7 @@ virLogDaemonExecRestartHandler(virNetDaemonPtr dmn, } static int -virLogDaemonSetupSignals(virNetDaemonPtr dmn) +virLogDaemonSetupSignals(virNetDaemon *dmn) { if (virNetDaemonAddSignalHandler(dmn, SIGINT, virLogDaemonShutdownHandler, NULL) < 0) return -1; @@ -304,7 +304,7 @@ virLogDaemonSetupSignals(virNetDaemonPtr dmn) static void virLogDaemonClientFree(void *opaque) { - virLogDaemonClientPtr priv = opaque; + virLogDaemonClient *priv = opaque; if (!priv) return; @@ -319,10 +319,10 @@ virLogDaemonClientFree(void *opaque) static void * -virLogDaemonClientNew(virNetServerClientPtr client, +virLogDaemonClientNew(virNetServerClient *client, void *opaque) { - virLogDaemonClientPtr priv; + virLogDaemonClient *priv; uid_t clientuid; gid_t clientgid; unsigned long long timestamp; @@ -371,11 +371,11 @@ virLogDaemonClientNew(virNetServerClientPtr client, static void * -virLogDaemonClientNewPostExecRestart(virNetServerClientPtr client, - virJSONValuePtr object G_GNUC_UNUSED, +virLogDaemonClientNewPostExecRestart(virNetServerClient *client, + virJSONValue *object G_GNUC_UNUSED, void *opaque) { - virLogDaemonClientPtr priv = virLogDaemonClientNew(client, opaque); + virLogDaemonClient *priv = virLogDaemonClientNew(client, opaque); if (!priv) return NULL; @@ -384,11 +384,11 @@ virLogDaemonClientNewPostExecRestart(virNetServerClientPtr client, } -static virJSONValuePtr -virLogDaemonClientPreExecRestart(virNetServerClientPtr client G_GNUC_UNUSED, +static virJSONValue * +virLogDaemonClientPreExecRestart(virNetServerClient *client G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { - virJSONValuePtr object = virJSONValueNewObject(); + virJSONValue *object = virJSONValueNewObject(); return object; } @@ -435,13 +435,13 @@ virLogDaemonPostExecRestart(const char *state_file, const char *pid_file, int *pid_file_fd, bool privileged, - virLogDaemonConfigPtr config) + virLogDaemonConfig *config) { const char *gotmagic; char *wantmagic = NULL; int ret = -1; char *state = NULL; - virJSONValuePtr object = NULL; + virJSONValue *object = NULL; VIR_DEBUG("Running post-restart exec"); @@ -502,7 +502,7 @@ virLogDaemonPostExecRestart(const char *state_file, static int virLogDaemonPreExecRestart(const char *state_file, - virNetDaemonPtr dmn, + virNetDaemon *dmn, char **argv) { g_autoptr(virJSONValue) object = virJSONValueNewObject(); @@ -608,10 +608,10 @@ virLogDaemonUsage(const char *argv0, bool privileged) } int main(int argc, char **argv) { - virNetServerPtr logSrv = NULL; - virNetServerPtr adminSrv = NULL; - virNetServerProgramPtr logProgram = NULL; - virNetServerProgramPtr adminProgram = NULL; + virNetServer *logSrv = NULL; + virNetServer *adminSrv = NULL; + virNetServerProgram *logProgram = NULL; + virNetServerProgram *adminProgram = NULL; char *remote_config_file = NULL; int statuswrite = -1; int ret = 1; @@ -627,7 +627,7 @@ int main(int argc, char **argv) { bool implicit_conf = false; mode_t old_umask; bool privileged = false; - virLogDaemonConfigPtr config = NULL; + virLogDaemonConfig *config = NULL; int rv; struct option opts[] = { diff --git a/src/logging/log_daemon.h b/src/logging/log_daemon.h index 7a7961b903..ead90047de 100644 --- a/src/logging/log_daemon.h +++ b/src/logging/log_daemon.h @@ -23,17 +23,14 @@ #include "log_handler.h" typedef struct _virLogDaemon virLogDaemon; -typedef virLogDaemon *virLogDaemonPtr; typedef struct _virLogDaemonClient virLogDaemonClient; -typedef virLogDaemonClient *virLogDaemonClientPtr; - struct _virLogDaemonClient { GMutex lock; pid_t clientPid; }; -extern virLogDaemonPtr logDaemon; +extern virLogDaemon *logDaemon; -virLogHandlerPtr virLogDaemonGetHandler(virLogDaemonPtr dmn); +virLogHandler *virLogDaemonGetHandler(virLogDaemon *dmn); diff --git a/src/logging/log_daemon_config.c b/src/logging/log_daemon_config.c index 075cf766ec..84a2946395 100644 --- a/src/logging/log_daemon_config.c +++ b/src/logging/log_daemon_config.c @@ -53,10 +53,10 @@ virLogDaemonConfigFilePath(bool privileged, char **configfile) } -virLogDaemonConfigPtr +virLogDaemonConfig * virLogDaemonConfigNew(bool privileged G_GNUC_UNUSED) { - virLogDaemonConfigPtr data; + virLogDaemonConfig *data; data = g_new0(virLogDaemonConfig, 1); @@ -69,7 +69,7 @@ virLogDaemonConfigNew(bool privileged G_GNUC_UNUSED) } void -virLogDaemonConfigFree(virLogDaemonConfigPtr data) +virLogDaemonConfigFree(virLogDaemonConfig *data) { if (!data) return; @@ -81,8 +81,8 @@ virLogDaemonConfigFree(virLogDaemonConfigPtr data) } static int -virLogDaemonConfigLoadOptions(virLogDaemonConfigPtr data, - virConfPtr conf) +virLogDaemonConfigLoadOptions(virLogDaemonConfig *data, + virConf *conf) { if (virConfGetValueUInt(conf, "log_level", &data->log_level) < 0) return -1; @@ -106,7 +106,7 @@ virLogDaemonConfigLoadOptions(virLogDaemonConfigPtr data, /* Read the config file if it exists. */ int -virLogDaemonConfigLoadFile(virLogDaemonConfigPtr data, +virLogDaemonConfigLoadFile(virLogDaemonConfig *data, const char *filename, bool allow_missing) { diff --git a/src/logging/log_daemon_config.h b/src/logging/log_daemon_config.h index 957c20c893..2ab0f67c96 100644 --- a/src/logging/log_daemon_config.h +++ b/src/logging/log_daemon_config.h @@ -24,8 +24,6 @@ #include "internal.h" typedef struct _virLogDaemonConfig virLogDaemonConfig; -typedef virLogDaemonConfig *virLogDaemonConfigPtr; - struct _virLogDaemonConfig { unsigned int log_level; char *log_filters; @@ -39,8 +37,8 @@ struct _virLogDaemonConfig { int virLogDaemonConfigFilePath(bool privileged, char **configfile); -virLogDaemonConfigPtr virLogDaemonConfigNew(bool privileged); -void virLogDaemonConfigFree(virLogDaemonConfigPtr data); -int virLogDaemonConfigLoadFile(virLogDaemonConfigPtr data, +virLogDaemonConfig *virLogDaemonConfigNew(bool privileged); +void virLogDaemonConfigFree(virLogDaemonConfig *data); +int virLogDaemonConfigLoadFile(virLogDaemonConfig *data, const char *filename, bool allow_missing); diff --git a/src/logging/log_daemon_dispatch.c b/src/logging/log_daemon_dispatch.c index 73b5efd5a0..7a0a310576 100644 --- a/src/logging/log_daemon_dispatch.c +++ b/src/logging/log_daemon_dispatch.c @@ -37,10 +37,10 @@ VIR_LOG_INIT("logging.log_daemon_dispatch"); #include "log_daemon_dispatch_stubs.h" static int -virLogManagerProtocolDispatchDomainOpenLogFile(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client G_GNUC_UNUSED, - virNetMessagePtr msg, - virNetMessageErrorPtr rerr, +virLogManagerProtocolDispatchDomainOpenLogFile(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client G_GNUC_UNUSED, + virNetMessage *msg, + struct virNetMessageError *rerr, virLogManagerProtocolDomainOpenLogFileArgs *args, virLogManagerProtocolDomainOpenLogFileRet *ret) { @@ -76,10 +76,10 @@ virLogManagerProtocolDispatchDomainOpenLogFile(virNetServerPtr server G_GNUC_UNU static int -virLogManagerProtocolDispatchDomainGetLogFilePosition(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client G_GNUC_UNUSED, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +virLogManagerProtocolDispatchDomainGetLogFilePosition(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client G_GNUC_UNUSED, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, virLogManagerProtocolDomainGetLogFilePositionArgs *args, virLogManagerProtocolDomainGetLogFilePositionRet *ret) { @@ -106,10 +106,10 @@ virLogManagerProtocolDispatchDomainGetLogFilePosition(virNetServerPtr server G_G static int -virLogManagerProtocolDispatchDomainReadLogFile(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client G_GNUC_UNUSED, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +virLogManagerProtocolDispatchDomainReadLogFile(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client G_GNUC_UNUSED, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, virLogManagerProtocolDomainReadLogFileArgs *args, virLogManagerProtocolDomainReadLogFileRet *ret) { @@ -144,10 +144,10 @@ virLogManagerProtocolDispatchDomainReadLogFile(virNetServerPtr server G_GNUC_UNU static int -virLogManagerProtocolDispatchDomainAppendLogFile(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client G_GNUC_UNUSED, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +virLogManagerProtocolDispatchDomainAppendLogFile(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client G_GNUC_UNUSED, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, virLogManagerProtocolDomainAppendLogFileArgs *args, virLogManagerProtocolDomainAppendLogFileRet *ret) { diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c index 9e027c7579..dde3506fe9 100644 --- a/src/logging/log_handler.c +++ b/src/logging/log_handler.c @@ -44,10 +44,8 @@ VIR_LOG_INIT("logging.log_handler"); #define DEFAULT_MODE 0600 typedef struct _virLogHandlerLogFile virLogHandlerLogFile; -typedef virLogHandlerLogFile *virLogHandlerLogFilePtr; - struct _virLogHandlerLogFile { - virRotatingFileWriterPtr file; + virRotatingFileWriter *file; int watch; int pipefd; /* Read from QEMU via this */ bool drained; @@ -64,14 +62,14 @@ struct _virLogHandler { size_t max_size; size_t max_backups; - virLogHandlerLogFilePtr *files; + virLogHandlerLogFile **files; size_t nfiles; virLogHandlerShutdownInhibitor inhibitor; void *opaque; }; -static virClassPtr virLogHandlerClass; +static virClass *virLogHandlerClass; static void virLogHandlerDispose(void *obj); static int @@ -87,7 +85,7 @@ VIR_ONCE_GLOBAL_INIT(virLogHandler); static void -virLogHandlerLogFileFree(virLogHandlerLogFilePtr file) +virLogHandlerLogFileFree(virLogHandlerLogFile *file) { if (!file) return; @@ -105,8 +103,8 @@ virLogHandlerLogFileFree(virLogHandlerLogFilePtr file) static void -virLogHandlerLogFileClose(virLogHandlerPtr handler, - virLogHandlerLogFilePtr file) +virLogHandlerLogFileClose(virLogHandler *handler, + virLogHandlerLogFile *file) { size_t i; @@ -120,8 +118,8 @@ virLogHandlerLogFileClose(virLogHandlerPtr handler, } -static virLogHandlerLogFilePtr -virLogHandlerGetLogFileFromWatch(virLogHandlerPtr handler, +static virLogHandlerLogFile * +virLogHandlerGetLogFileFromWatch(virLogHandler *handler, int watch) { size_t i; @@ -141,8 +139,8 @@ virLogHandlerDomainLogFileEvent(int watch, int events G_GNUC_UNUSED, void *opaque) { - virLogHandlerPtr handler = opaque; - virLogHandlerLogFilePtr logfile; + virLogHandler *handler = opaque; + virLogHandlerLogFile *logfile; char buf[1024]; ssize_t len; @@ -186,14 +184,14 @@ virLogHandlerDomainLogFileEvent(int watch, } -virLogHandlerPtr +virLogHandler * virLogHandlerNew(bool privileged, size_t max_size, size_t max_backups, virLogHandlerShutdownInhibitor inhibitor, void *opaque) { - virLogHandlerPtr handler; + virLogHandler *handler; if (virLogHandlerInitialize() < 0) return NULL; @@ -211,11 +209,11 @@ virLogHandlerNew(bool privileged, } -static virLogHandlerLogFilePtr -virLogHandlerLogFilePostExecRestart(virLogHandlerPtr handler, - virJSONValuePtr object) +static virLogHandlerLogFile * +virLogHandlerLogFilePostExecRestart(virLogHandler *handler, + virJSONValue *object) { - virLogHandlerLogFilePtr file; + virLogHandlerLogFile *file; const char *path; const char *domuuid; const char *tmp; @@ -282,16 +280,16 @@ virLogHandlerLogFilePostExecRestart(virLogHandlerPtr handler, } -virLogHandlerPtr -virLogHandlerNewPostExecRestart(virJSONValuePtr object, +virLogHandler * +virLogHandlerNewPostExecRestart(virJSONValue *object, bool privileged, size_t max_size, size_t max_backups, virLogHandlerShutdownInhibitor inhibitor, void *opaque) { - virLogHandlerPtr handler; - virJSONValuePtr files; + virLogHandler *handler; + virJSONValue *files; size_t i; if (!(handler = virLogHandlerNew(privileged, @@ -314,8 +312,8 @@ virLogHandlerNewPostExecRestart(virJSONValuePtr object, } for (i = 0; i < virJSONValueArraySize(files); i++) { - virLogHandlerLogFilePtr file; - virJSONValuePtr child = virJSONValueArrayGet(files, i); + virLogHandlerLogFile *file; + virJSONValue *child = virJSONValueArrayGet(files, i); if (!(file = virLogHandlerLogFilePostExecRestart(handler, child))) goto error; @@ -345,7 +343,7 @@ virLogHandlerNewPostExecRestart(virJSONValuePtr object, static void virLogHandlerDispose(void *obj) { - virLogHandlerPtr handler = obj; + virLogHandler *handler = obj; size_t i; for (i = 0; i < handler->nfiles; i++) { @@ -357,7 +355,7 @@ virLogHandlerDispose(void *obj) int -virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler, +virLogHandlerDomainOpenLogFile(virLogHandler *handler, const char *driver, const unsigned char *domuuid, const char *domname, @@ -367,7 +365,7 @@ virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler, off_t *offset) { size_t i; - virLogHandlerLogFilePtr file = NULL; + virLogHandlerLogFile *file = NULL; int pipefd[2] = { -1, -1 }; virObjectLock(handler); @@ -432,7 +430,7 @@ virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler, static void -virLogHandlerDomainLogFileDrain(virLogHandlerLogFilePtr file) +virLogHandlerDomainLogFileDrain(virLogHandlerLogFile *file) { char buf[1024]; ssize_t len; @@ -472,13 +470,13 @@ virLogHandlerDomainLogFileDrain(virLogHandlerLogFilePtr file) int -virLogHandlerDomainGetLogFilePosition(virLogHandlerPtr handler, +virLogHandlerDomainGetLogFilePosition(virLogHandler *handler, const char *path, unsigned int flags, ino_t *inode, off_t *offset) { - virLogHandlerLogFilePtr file = NULL; + virLogHandlerLogFile *file = NULL; int ret = -1; size_t i; @@ -515,14 +513,14 @@ virLogHandlerDomainGetLogFilePosition(virLogHandlerPtr handler, char * -virLogHandlerDomainReadLogFile(virLogHandlerPtr handler, +virLogHandlerDomainReadLogFile(virLogHandler *handler, const char *path, ino_t inode, off_t offset, size_t maxlen, unsigned int flags) { - virRotatingFileReaderPtr file = NULL; + virRotatingFileReader *file = NULL; char *data = NULL; ssize_t got; @@ -556,7 +554,7 @@ virLogHandlerDomainReadLogFile(virLogHandlerPtr handler, int -virLogHandlerDomainAppendLogFile(virLogHandlerPtr handler, +virLogHandlerDomainAppendLogFile(virLogHandler *handler, const char *driver G_GNUC_UNUSED, const unsigned char *domuuid G_GNUC_UNUSED, const char *domname G_GNUC_UNUSED, @@ -565,8 +563,8 @@ virLogHandlerDomainAppendLogFile(virLogHandlerPtr handler, unsigned int flags) { size_t i; - virRotatingFileWriterPtr writer = NULL; - virRotatingFileWriterPtr newwriter = NULL; + virRotatingFileWriter *writer = NULL; + virRotatingFileWriter *newwriter = NULL; int ret = -1; virCheckFlags(0, -1); @@ -605,8 +603,8 @@ virLogHandlerDomainAppendLogFile(virLogHandlerPtr handler, } -virJSONValuePtr -virLogHandlerPreExecRestart(virLogHandlerPtr handler) +virJSONValue * +virLogHandlerPreExecRestart(virLogHandler *handler) { g_autoptr(virJSONValue) ret = virJSONValueNewObject(); g_autoptr(virJSONValue) files = virJSONValueNewArray(); diff --git a/src/logging/log_handler.h b/src/logging/log_handler.h index 8c8562e0c5..099378b361 100644 --- a/src/logging/log_handler.h +++ b/src/logging/log_handler.h @@ -24,27 +24,26 @@ #include "virjson.h" typedef struct _virLogHandler virLogHandler; -typedef virLogHandler *virLogHandlerPtr; typedef void (*virLogHandlerShutdownInhibitor)(bool inhibit, void *opaque); -virLogHandlerPtr virLogHandlerNew(bool privileged, +virLogHandler *virLogHandlerNew(bool privileged, size_t max_size, size_t max_backups, virLogHandlerShutdownInhibitor inhibitor, void *opaque); -virLogHandlerPtr virLogHandlerNewPostExecRestart(virJSONValuePtr child, +virLogHandler *virLogHandlerNewPostExecRestart(virJSONValue *child, bool privileged, size_t max_size, size_t max_backups, virLogHandlerShutdownInhibitor inhibitor, void *opaque); -void virLogHandlerFree(virLogHandlerPtr handler); +void virLogHandlerFree(virLogHandler *handler); -int virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler, +int virLogHandlerDomainOpenLogFile(virLogHandler *handler, const char *driver, const unsigned char *domuuid, const char *domname, @@ -53,20 +52,20 @@ int virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler, ino_t *inode, off_t *offset); -int virLogHandlerDomainGetLogFilePosition(virLogHandlerPtr handler, +int virLogHandlerDomainGetLogFilePosition(virLogHandler *handler, const char *path, unsigned int flags, ino_t *inode, off_t *offset); -char *virLogHandlerDomainReadLogFile(virLogHandlerPtr handler, +char *virLogHandlerDomainReadLogFile(virLogHandler *handler, const char *path, ino_t inode, off_t offset, size_t maxlen, unsigned int flags); -int virLogHandlerDomainAppendLogFile(virLogHandlerPtr handler, +int virLogHandlerDomainAppendLogFile(virLogHandler *handler, const char *driver, const unsigned char *domuuid, const char *domname, @@ -74,4 +73,4 @@ int virLogHandlerDomainAppendLogFile(virLogHandlerPtr handler, const char *message, unsigned int flags); -virJSONValuePtr virLogHandlerPreExecRestart(virLogHandlerPtr handler); +virJSONValue *virLogHandlerPreExecRestart(virLogHandler *handler); diff --git a/src/logging/log_manager.c b/src/logging/log_manager.c index 56927c1d6d..f66ebda495 100644 --- a/src/logging/log_manager.c +++ b/src/logging/log_manager.c @@ -34,8 +34,8 @@ #define VIR_FROM_THIS VIR_FROM_LOGGING struct _virLogManager { - virNetClientPtr client; - virNetClientProgramPtr program; + virNetClient *client; + virNetClientProgram *program; unsigned int serial; }; @@ -57,11 +57,11 @@ virLogManagerDaemonPath(bool privileged) } -static virNetClientPtr +static virNetClient * virLogManagerConnect(bool privileged, - virNetClientProgramPtr *prog) + virNetClientProgram **prog) { - virNetClientPtr client = NULL; + virNetClient *client = NULL; char *logdpath; char *daemonPath = NULL; @@ -108,10 +108,10 @@ virLogManagerConnect(bool privileged, } -virLogManagerPtr +virLogManager * virLogManagerNew(bool privileged) { - virLogManagerPtr mgr; + virLogManager *mgr; mgr = g_new0(virLogManager, 1); @@ -127,7 +127,7 @@ virLogManagerNew(bool privileged) void -virLogManagerFree(virLogManagerPtr mgr) +virLogManagerFree(virLogManager *mgr) { if (!mgr) return; @@ -142,7 +142,7 @@ virLogManagerFree(virLogManagerPtr mgr) int -virLogManagerDomainOpenLogFile(virLogManagerPtr mgr, +virLogManagerDomainOpenLogFile(virLogManager *mgr, const char *driver, const unsigned char *domuuid, const char *domname, @@ -204,7 +204,7 @@ virLogManagerDomainOpenLogFile(virLogManagerPtr mgr, int -virLogManagerDomainGetLogFilePosition(virLogManagerPtr mgr, +virLogManagerDomainGetLogFilePosition(virLogManager *mgr, const char *path, unsigned int flags, ino_t *inode, @@ -236,7 +236,7 @@ virLogManagerDomainGetLogFilePosition(virLogManagerPtr mgr, char * -virLogManagerDomainReadLogFile(virLogManagerPtr mgr, +virLogManagerDomainReadLogFile(virLogManager *mgr, const char *path, ino_t inode, off_t offset, @@ -269,7 +269,7 @@ virLogManagerDomainReadLogFile(virLogManagerPtr mgr, int -virLogManagerDomainAppendMessage(virLogManagerPtr mgr, +virLogManagerDomainAppendMessage(virLogManager *mgr, const char *driver, const unsigned char *domuuid, const char *domname, diff --git a/src/logging/log_manager.h b/src/logging/log_manager.h index ae3ae2b4c5..9a8f9b6af8 100644 --- a/src/logging/log_manager.h +++ b/src/logging/log_manager.h @@ -23,13 +23,12 @@ #include "internal.h" typedef struct _virLogManager virLogManager; -typedef virLogManager *virLogManagerPtr; -virLogManagerPtr virLogManagerNew(bool privileged); +virLogManager *virLogManagerNew(bool privileged); -void virLogManagerFree(virLogManagerPtr mgr); +void virLogManagerFree(virLogManager *mgr); -int virLogManagerDomainOpenLogFile(virLogManagerPtr mgr, +int virLogManagerDomainOpenLogFile(virLogManager *mgr, const char *driver, const unsigned char *domuuid, const char *domname, @@ -38,20 +37,20 @@ int virLogManagerDomainOpenLogFile(virLogManagerPtr mgr, ino_t *inode, off_t *offset); -int virLogManagerDomainGetLogFilePosition(virLogManagerPtr mgr, +int virLogManagerDomainGetLogFilePosition(virLogManager *mgr, const char *path, unsigned int flags, ino_t *inode, off_t *offset); -char *virLogManagerDomainReadLogFile(virLogManagerPtr mgr, +char *virLogManagerDomainReadLogFile(virLogManager *mgr, const char *path, ino_t inode, off_t offset, size_t maxlen, unsigned int flags); -int virLogManagerDomainAppendMessage(virLogManagerPtr mgr, +int virLogManagerDomainAppendMessage(virLogManager *mgr, const char *driver, const unsigned char *domuuid, const char *domname, diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c index af4322d6cf..1861ccf4db 100644 --- a/src/lxc/lxc_cgroup.c +++ b/src/lxc/lxc_cgroup.c @@ -35,8 +35,8 @@ VIR_LOG_INIT("lxc.lxc_cgroup"); -static int virLXCCgroupSetupCpuTune(virDomainDefPtr def, - virCgroupPtr cgroup) +static int virLXCCgroupSetupCpuTune(virDomainDef *def, + virCgroup *cgroup) { if (def->cputune.sharesSpecified) { if (virCgroupSetCpuShares(cgroup, def->cputune.shares) < 0) @@ -48,9 +48,9 @@ static int virLXCCgroupSetupCpuTune(virDomainDefPtr def, } -static int virLXCCgroupSetupCpusetTune(virDomainDefPtr def, - virCgroupPtr cgroup, - virBitmapPtr nodemask) +static int virLXCCgroupSetupCpusetTune(virDomainDef *def, + virCgroup *cgroup, + virBitmap *nodemask) { g_autofree char *mask = NULL; virDomainNumatuneMemMode mode; @@ -77,15 +77,15 @@ static int virLXCCgroupSetupCpusetTune(virDomainDefPtr def, } -static int virLXCCgroupSetupBlkioTune(virDomainDefPtr def, - virCgroupPtr cgroup) +static int virLXCCgroupSetupBlkioTune(virDomainDef *def, + virCgroup *cgroup) { return virDomainCgroupSetupBlkio(cgroup, def->blkio); } -static int virLXCCgroupSetupMemTune(virDomainDefPtr def, - virCgroupPtr cgroup) +static int virLXCCgroupSetupMemTune(virDomainDef *def, + virCgroup *cgroup) { if (virCgroupSetMemory(cgroup, virDomainDefGetMemoryInitial(def)) < 0) return -1; @@ -94,22 +94,22 @@ static int virLXCCgroupSetupMemTune(virDomainDefPtr def, } -static int virLXCCgroupGetMemSwapUsage(virCgroupPtr cgroup, - virLXCMeminfoPtr meminfo) +static int virLXCCgroupGetMemSwapUsage(virCgroup *cgroup, + struct virLXCMeminfo *meminfo) { return virCgroupGetMemSwapUsage(cgroup, &meminfo->swapusage); } -static int virLXCCgroupGetMemSwapTotal(virCgroupPtr cgroup, - virLXCMeminfoPtr meminfo) +static int virLXCCgroupGetMemSwapTotal(virCgroup *cgroup, + struct virLXCMeminfo *meminfo) { return virCgroupGetMemSwapHardLimit(cgroup, &meminfo->swaptotal); } -static int virLXCCgroupGetMemUsage(virCgroupPtr cgroup, - virLXCMeminfoPtr meminfo) +static int virLXCCgroupGetMemUsage(virCgroup *cgroup, + struct virLXCMeminfo *meminfo) { int ret; unsigned long memUsage; @@ -121,15 +121,15 @@ static int virLXCCgroupGetMemUsage(virCgroupPtr cgroup, } -static int virLXCCgroupGetMemTotal(virCgroupPtr cgroup, - virLXCMeminfoPtr meminfo) +static int virLXCCgroupGetMemTotal(virCgroup *cgroup, + struct virLXCMeminfo *meminfo) { return virCgroupGetMemoryHardLimit(cgroup, &meminfo->memtotal); } -static int virLXCCgroupGetMemStat(virCgroupPtr cgroup, - virLXCMeminfoPtr meminfo) +static int virLXCCgroupGetMemStat(virCgroup *cgroup, + struct virLXCMeminfo *meminfo) { return virCgroupGetMemoryStat(cgroup, &meminfo->cached, @@ -141,7 +141,7 @@ static int virLXCCgroupGetMemStat(virCgroupPtr cgroup, } -int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo) +int virLXCCgroupGetMeminfo(struct virLXCMeminfo *meminfo) { g_autoptr(virCgroup) cgroup = NULL; @@ -169,8 +169,6 @@ int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo) typedef struct _virLXCCgroupDevicePolicy virLXCCgroupDevicePolicy; -typedef virLXCCgroupDevicePolicy *virLXCCgroupDevicePolicyPtr; - struct _virLXCCgroupDevicePolicy { char type; int major; @@ -179,11 +177,11 @@ struct _virLXCCgroupDevicePolicy { int -virLXCSetupHostUSBDeviceCgroup(virUSBDevicePtr dev G_GNUC_UNUSED, +virLXCSetupHostUSBDeviceCgroup(virUSBDevice *dev G_GNUC_UNUSED, const char *path, void *opaque) { - virCgroupPtr cgroup = opaque; + virCgroup *cgroup = opaque; VIR_DEBUG("Process path '%s' for USB device", path); if (virCgroupAllowDevicePath(cgroup, path, @@ -195,11 +193,11 @@ virLXCSetupHostUSBDeviceCgroup(virUSBDevicePtr dev G_GNUC_UNUSED, int -virLXCTeardownHostUSBDeviceCgroup(virUSBDevicePtr dev G_GNUC_UNUSED, +virLXCTeardownHostUSBDeviceCgroup(virUSBDevice *dev G_GNUC_UNUSED, const char *path, void *opaque) { - virCgroupPtr cgroup = opaque; + virCgroup *cgroup = opaque; VIR_DEBUG("Process path '%s' for USB device", path); if (virCgroupDenyDevicePath(cgroup, path, @@ -210,8 +208,8 @@ virLXCTeardownHostUSBDeviceCgroup(virUSBDevicePtr dev G_GNUC_UNUSED, } -static int virLXCCgroupSetupDeviceACL(virDomainDefPtr def, - virCgroupPtr cgroup) +static int virLXCCgroupSetupDeviceACL(virDomainDef *def, + virCgroup *cgroup) { int capMknod = def->caps_features[VIR_DOMAIN_PROCES_CAPS_FEATURE_MKNOD]; size_t i; @@ -237,7 +235,7 @@ static int virLXCCgroupSetupDeviceACL(virDomainDefPtr def, } for (i = 0; devices[i].type != 0; i++) { - virLXCCgroupDevicePolicyPtr dev = &devices[i]; + virLXCCgroupDevicePolicy *dev = &devices[i]; if (virCgroupAllowDevice(cgroup, dev->type, dev->major, @@ -276,9 +274,9 @@ static int virLXCCgroupSetupDeviceACL(virDomainDefPtr def, VIR_DEBUG("Allowing any hostdev block devs"); for (i = 0; i < def->nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = def->hostdevs[i]; - virDomainHostdevSubsysUSBPtr usbsrc = &hostdev->source.subsys.u.usb; - virUSBDevicePtr usb; + virDomainHostdevDef *hostdev = def->hostdevs[i]; + virDomainHostdevSubsysUSB *usbsrc = &hostdev->source.subsys.u.usb; + virUSBDevice *usb; switch (hostdev->mode) { case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS: @@ -330,7 +328,7 @@ static int virLXCCgroupSetupDeviceACL(virDomainDefPtr def, /* Sync'ed with Host clock */ for (i = 0; i < def->clock.ntimers; i++) { - virDomainTimerDefPtr timer = def->clock.timers[i]; + virDomainTimerDef *timer = def->clock.timers[i]; const char *dev = NULL; /* Check if "present" is set to "no" otherwise enable it. */ @@ -374,12 +372,12 @@ static int virLXCCgroupSetupDeviceACL(virDomainDefPtr def, } -virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def, +virCgroup *virLXCCgroupCreate(virDomainDef *def, pid_t initpid, size_t nnicindexes, int *nicindexes) { - virCgroupPtr cgroup = NULL; + virCgroup *cgroup = NULL; g_autofree char *machineName = virLXCDomainGetMachineName(def, 0); if (!machineName) @@ -420,9 +418,9 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def, } -int virLXCCgroupSetup(virDomainDefPtr def, - virCgroupPtr cgroup, - virBitmapPtr nodemask) +int virLXCCgroupSetup(virDomainDef *def, + virCgroup *cgroup, + virBitmap *nodemask) { if (virLXCCgroupSetupCpuTune(def, cgroup) < 0) return -1; diff --git a/src/lxc/lxc_cgroup.h b/src/lxc/lxc_cgroup.h index 63e9e837b0..2b323371f9 100644 --- a/src/lxc/lxc_cgroup.h +++ b/src/lxc/lxc_cgroup.h @@ -26,23 +26,23 @@ #include "lxc_fuse.h" #include "virusb.h" -virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def, +virCgroup *virLXCCgroupCreate(virDomainDef *def, pid_t initpid, size_t nnicindexes, int *nicindexes); -virCgroupPtr virLXCCgroupJoin(virDomainDefPtr def); -int virLXCCgroupSetup(virDomainDefPtr def, - virCgroupPtr cgroup, - virBitmapPtr nodemask); +virCgroup *virLXCCgroupJoin(virDomainDef *def); +int virLXCCgroupSetup(virDomainDef *def, + virCgroup *cgroup, + virBitmap *nodemask); -int virLXCCgroupGetMeminfo(virLXCMeminfoPtr meminfo); +int virLXCCgroupGetMeminfo(struct virLXCMeminfo *meminfo); int -virLXCSetupHostUSBDeviceCgroup(virUSBDevicePtr dev, +virLXCSetupHostUSBDeviceCgroup(virUSBDevice *dev, const char *path, void *opaque); int -virLXCTeardownHostUSBDeviceCgroup(virUSBDevicePtr dev, +virLXCTeardownHostUSBDeviceCgroup(virUSBDevice *dev, const char *path, void *opaque); diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c index e6ad91205e..af7be88db5 100644 --- a/src/lxc/lxc_conf.c +++ b/src/lxc/lxc_conf.c @@ -41,7 +41,7 @@ VIR_LOG_INIT("lxc.lxc_conf"); -static virClassPtr virLXCDriverConfigClass; +static virClass *virLXCDriverConfigClass; static void virLXCDriverConfigDispose(void *obj); static int virLXCConfigOnceInit(void) @@ -56,10 +56,10 @@ VIR_ONCE_GLOBAL_INIT(virLXCConfig); /* Functions */ -virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver) +virCaps *virLXCDriverCapsInit(virLXCDriver *driver) { - virCapsPtr caps; - virCapsGuestPtr guest; + virCaps *caps; + virCapsGuest *guest; virArch altArch; g_autofree char *lxc_path = NULL; @@ -171,20 +171,20 @@ virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver) /** * virLXCDriverGetCapabilities: * - * Get a reference to the virCapsPtr instance for the + * Get a reference to the virCaps *instance for the * driver. If @refresh is true, the capabilities will be * rebuilt first * * The caller must release the reference with virObjetUnref * - * Returns: a reference to a virCapsPtr instance or NULL + * Returns: a reference to a virCaps *instance or NULL */ -virCapsPtr virLXCDriverGetCapabilities(virLXCDriverPtr driver, +virCaps *virLXCDriverGetCapabilities(virLXCDriver *driver, bool refresh) { - virCapsPtr ret; + virCaps *ret; if (refresh) { - virCapsPtr caps = NULL; + virCaps *caps = NULL; if ((caps = virLXCDriverCapsInit(driver)) == NULL) return NULL; @@ -208,8 +208,8 @@ virCapsPtr virLXCDriverGetCapabilities(virLXCDriverPtr driver, } -virDomainXMLOptionPtr -lxcDomainXMLConfInit(virLXCDriverPtr driver, const char *defsecmodel) +virDomainXMLOption * +lxcDomainXMLConfInit(virLXCDriver *driver, const char *defsecmodel) { virLXCDriverDomainDefParserConfig.priv = driver; virLXCDriverDomainDefParserConfig.defSecModel = defsecmodel; @@ -220,10 +220,10 @@ lxcDomainXMLConfInit(virLXCDriverPtr driver, const char *defsecmodel) } -virLXCDriverConfigPtr +virLXCDriverConfig * virLXCDriverConfigNew(void) { - virLXCDriverConfigPtr cfg; + virLXCDriverConfig *cfg; if (virLXCConfigInitialize() < 0) return NULL; @@ -244,7 +244,7 @@ virLXCDriverConfigNew(void) } int -virLXCLoadDriverConfig(virLXCDriverConfigPtr cfg, +virLXCLoadDriverConfig(virLXCDriverConfig *cfg, const char *filename) { g_autoptr(virConf) conf = NULL; @@ -272,9 +272,9 @@ virLXCLoadDriverConfig(virLXCDriverConfigPtr cfg, return 0; } -virLXCDriverConfigPtr virLXCDriverGetConfig(virLXCDriverPtr driver) +virLXCDriverConfig *virLXCDriverGetConfig(virLXCDriver *driver) { - virLXCDriverConfigPtr cfg; + virLXCDriverConfig *cfg; lxcDriverLock(driver); cfg = virObjectRef(driver->config); lxcDriverUnlock(driver); @@ -284,7 +284,7 @@ virLXCDriverConfigPtr virLXCDriverGetConfig(virLXCDriverPtr driver) static void virLXCDriverConfigDispose(void *obj) { - virLXCDriverConfigPtr cfg = obj; + virLXCDriverConfig *cfg = obj; g_free(cfg->configDir); g_free(cfg->autostartDir); diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h index 664bafc7b9..8993013ea4 100644 --- a/src/lxc/lxc_conf.h +++ b/src/lxc/lxc_conf.h @@ -43,11 +43,8 @@ #define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart" typedef struct _virLXCDriver virLXCDriver; -typedef virLXCDriver *virLXCDriverPtr; typedef struct _virLXCDriverConfig virLXCDriverConfig; -typedef virLXCDriverConfig *virLXCDriverConfigPtr; - struct _virLXCDriverConfig { virObject parent; @@ -68,20 +65,20 @@ struct _virLXCDriver { /* Require lock to get reference on 'config', * then lockless thereafter */ - virLXCDriverConfigPtr config; + virLXCDriverConfig *config; /* pid file FD, ensures two copies of the driver can't use the same root */ int lockFD; /* Require lock to get a reference on the object, * lockless access thereafter */ - virCapsPtr caps; + virCaps *caps; /* Immutable pointer, Immutable object */ - virDomainXMLOptionPtr xmlopt; + virDomainXMLOption *xmlopt; /* Immutable pointer, lockless APIs */ - virSysinfoDefPtr hostsysinfo; + virSysinfoDef *hostsysinfo; /* Atomic inc/dec only */ unsigned int nactive; @@ -91,35 +88,35 @@ struct _virLXCDriver { void *inhibitOpaque; /* Immutable pointer, self-locking APIs */ - virDomainObjListPtr domains; + virDomainObjList *domains; - virHostdevManagerPtr hostdevMgr; + virHostdevManager *hostdevMgr; /* Immutable pointer, self-locking APIs */ - virObjectEventStatePtr domainEventState; + virObjectEventState *domainEventState; /* Immutable pointer. self-locking APIs */ - virSecurityManagerPtr securityManager; + virSecurityManager *securityManager; /* Immutable pointer, self-locking APIs */ - virCloseCallbacksPtr closeCallbacks; + virCloseCallbacks *closeCallbacks; }; -virLXCDriverConfigPtr virLXCDriverConfigNew(void); -virLXCDriverConfigPtr virLXCDriverGetConfig(virLXCDriverPtr driver); -int virLXCLoadDriverConfig(virLXCDriverConfigPtr cfg, +virLXCDriverConfig *virLXCDriverConfigNew(void); +virLXCDriverConfig *virLXCDriverGetConfig(virLXCDriver *driver); +int virLXCLoadDriverConfig(virLXCDriverConfig *cfg, const char *filename); -virCapsPtr virLXCDriverCapsInit(virLXCDriverPtr driver); -virCapsPtr virLXCDriverGetCapabilities(virLXCDriverPtr driver, +virCaps *virLXCDriverCapsInit(virLXCDriver *driver); +virCaps *virLXCDriverGetCapabilities(virLXCDriver *driver, bool refresh); -virDomainXMLOptionPtr lxcDomainXMLConfInit(virLXCDriverPtr driver, +virDomainXMLOption *lxcDomainXMLConfInit(virLXCDriver *driver, const char *defsecmodel); -static inline void lxcDriverLock(virLXCDriverPtr driver) +static inline void lxcDriverLock(virLXCDriver *driver) { virMutexLock(&driver->lock); } -static inline void lxcDriverUnlock(virLXCDriverPtr driver) +static inline void lxcDriverUnlock(virLXCDriver *driver) { virMutexUnlock(&driver->lock); } diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 70b776e172..1ff3159fd2 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -73,8 +73,8 @@ typedef char lxc_message_t; typedef struct __lxc_child_argv lxc_child_argv_t; struct __lxc_child_argv { - virDomainDefPtr config; - virSecurityManagerPtr securityDriver; + virDomainDef *config; + virSecurityManager *securityDriver; size_t nveths; char **veths; int monitor; @@ -86,7 +86,7 @@ struct __lxc_child_argv { int *nsInheritFDs; }; -static int lxcContainerMountFSBlock(virDomainFSDefPtr fs, +static int lxcContainerMountFSBlock(virDomainFSDef *fs, const char *srcprefix, const char *sec_mount_options); @@ -164,16 +164,16 @@ int lxcContainerHasReboot(void) * lxcContainerBuildInitCmd: * @vmDef: pointer to vm definition structure * - * Build a virCommandPtr for launching the container 'init' process + * Build a virCommand *for launching the container 'init' process * - * Returns a virCommandPtr + * Returns a virCommand * */ -static virCommandPtr lxcContainerBuildInitCmd(virDomainDefPtr vmDef, +static virCommand *lxcContainerBuildInitCmd(virDomainDef *vmDef, char **ttyPaths, size_t nttyPaths) { char uuidstr[VIR_UUID_STRING_BUFLEN]; - virCommandPtr cmd; + virCommand *cmd; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t i; @@ -407,7 +407,7 @@ int lxcContainerWaitForContinue(int control) * * Returns 0 on success or -1 in case of error */ -static int lxcContainerSetID(virDomainDefPtr def) +static int lxcContainerSetID(virDomainDef *def) { /* Only call virSetUIDGID when user namespace is enabled * for this container. And user namespace is only enabled @@ -427,11 +427,11 @@ static int lxcContainerSetID(virDomainDefPtr def) } -static virDomainNetDefPtr -lxcContainerGetNetDef(virDomainDefPtr vmDef, const char *devName) +static virDomainNetDef * +lxcContainerGetNetDef(virDomainDef *vmDef, const char *devName) { size_t i; - virDomainNetDefPtr netDef; + virDomainNetDef *netDef; for (i = 0; i < vmDef->nnets; i++) { netDef = vmDef->nets[i]; @@ -454,13 +454,13 @@ lxcContainerGetNetDef(virDomainDefPtr vmDef, const char *devName) * Returns 0 on success or nonzero in case of error */ static int -lxcContainerRenameAndEnableInterfaces(virDomainDefPtr vmDef, +lxcContainerRenameAndEnableInterfaces(virDomainDef *vmDef, size_t nveths, char **veths) { size_t i; const char *newname; - virDomainNetDefPtr netDef; + virDomainNetDef *netDef; bool privNet = vmDef->features[VIR_DOMAIN_FEATURE_PRIVNET] == VIR_TRISTATE_SWITCH_ON; @@ -560,7 +560,7 @@ static int lxcContainerUnmountSubtree(const char *prefix, return ret; } -static int lxcContainerResolveSymlinks(virDomainFSDefPtr fs, bool gentle) +static int lxcContainerResolveSymlinks(virDomainFSDef *fs, bool gentle) { char *newroot; @@ -603,8 +603,8 @@ static int lxcContainerResolveSymlinks(virDomainFSDefPtr fs, bool gentle) return 0; } -static int lxcContainerPrepareRoot(virDomainDefPtr def, - virDomainFSDefPtr root, +static int lxcContainerPrepareRoot(virDomainDef *def, + virDomainFSDef *root, const char *sec_mount_options) { g_autofree char *dst = NULL; @@ -649,7 +649,7 @@ static int lxcContainerPrepareRoot(virDomainDefPtr def, return 0; } -static int lxcContainerPivotRoot(virDomainFSDefPtr root) +static int lxcContainerPivotRoot(virDomainFSDef *root) { g_autofree char *oldroot = NULL; g_autofree char *newroot = NULL; @@ -930,7 +930,7 @@ static int lxcContainerMountBasicFS(bool userns_enabled, } #if WITH_FUSE -static int lxcContainerMountProcFuse(virDomainDefPtr def, +static int lxcContainerMountProcFuse(virDomainDef *def, const char *stateDir) { g_autofree char *meminfo_path = NULL; @@ -952,14 +952,14 @@ static int lxcContainerMountProcFuse(virDomainDefPtr def, return 0; } #else -static int lxcContainerMountProcFuse(virDomainDefPtr def G_GNUC_UNUSED, +static int lxcContainerMountProcFuse(virDomainDef *def G_GNUC_UNUSED, const char *stateDir G_GNUC_UNUSED) { return 0; } #endif -static int lxcContainerMountFSDev(virDomainDefPtr def, +static int lxcContainerMountFSDev(virDomainDef *def, const char *stateDir) { g_autofree char *path = NULL; @@ -988,7 +988,7 @@ static int lxcContainerMountFSDev(virDomainDefPtr def, return 0; } -static int lxcContainerMountFSDevPTS(virDomainDefPtr def, +static int lxcContainerMountFSDevPTS(virDomainDef *def, const char *stateDir) { g_autofree char *path = NULL; @@ -1057,7 +1057,7 @@ static int lxcContainerSetupDevices(char **ttyPaths, size_t nttyPaths) } -static int lxcContainerMountFSBind(virDomainFSDefPtr fs, +static int lxcContainerMountFSBind(virDomainFSDef *fs, const char *srcprefix) { g_autofree char *src = NULL; @@ -1213,7 +1213,7 @@ lxcContainerMountDetectFilesystem(const char *src G_GNUC_UNUSED, * libblkid to detect the format first. We go straight to using * /etc/filesystems, and then /proc/filesystems */ -static int lxcContainerMountFSBlockAuto(virDomainFSDefPtr fs, +static int lxcContainerMountFSBlockAuto(virDomainFSDef *fs, int fsflags, const char *src, const char *srcprefix, @@ -1338,7 +1338,7 @@ static int lxcContainerMountFSBlockAuto(virDomainFSDefPtr fs, * Mount a block device 'src' on fs->dst, automatically * probing for filesystem type */ -static int lxcContainerMountFSBlockHelper(virDomainFSDefPtr fs, +static int lxcContainerMountFSBlockHelper(virDomainFSDef *fs, const char *src, const char *srcprefix, const char *sec_mount_options) @@ -1375,7 +1375,7 @@ static int lxcContainerMountFSBlockHelper(virDomainFSDefPtr fs, } -static int lxcContainerMountFSBlock(virDomainFSDefPtr fs, +static int lxcContainerMountFSBlock(virDomainFSDef *fs, const char *srcprefix, const char *sec_mount_options) { @@ -1394,7 +1394,7 @@ static int lxcContainerMountFSBlock(virDomainFSDefPtr fs, } -static int lxcContainerMountFSTmpfs(virDomainFSDefPtr fs, +static int lxcContainerMountFSTmpfs(virDomainFSDef *fs, char *sec_mount_options) { g_autofree char *data = NULL; @@ -1431,7 +1431,7 @@ static int lxcContainerMountFSTmpfs(virDomainFSDefPtr fs, } -static int lxcContainerMountFS(virDomainFSDefPtr fs, +static int lxcContainerMountFS(virDomainFSDef *fs, char *sec_mount_options) { switch (fs->type) { @@ -1469,7 +1469,7 @@ static int lxcContainerMountFS(virDomainFSDefPtr fs, } -static int lxcContainerMountAllFS(virDomainDefPtr vmDef, +static int lxcContainerMountAllFS(virDomainDef *vmDef, char *sec_mount_options) { size_t i; @@ -1568,7 +1568,7 @@ static int lxcContainerUnmountForSharedRoot(const char *stateDir, static bool -lxcNeedNetworkNamespace(virDomainDefPtr def) +lxcNeedNetworkNamespace(virDomainDef *def) { size_t i; if (def->nets != NULL) @@ -1588,11 +1588,11 @@ lxcNeedNetworkNamespace(virDomainDefPtr def) * approach to do a better-chroot-than-chroot * this is based on this thread https://lkml.org/lkml/2008/3/5/29 */ -static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef, - virDomainFSDefPtr root, +static int lxcContainerSetupPivotRoot(virDomainDef *vmDef, + virDomainFSDef *root, char **ttyPaths, size_t nttyPaths, - virSecurityManagerPtr securityDriver) + virSecurityManager *securityDriver) { g_autoptr(virCgroup) cgroup = NULL; g_autofree char *sec_mount_options = NULL; @@ -1667,14 +1667,14 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef, return 0; } -static int lxcContainerResolveAllSymlinks(virDomainDefPtr vmDef) +static int lxcContainerResolveAllSymlinks(virDomainDef *vmDef) { size_t i; VIR_DEBUG("Resolving symlinks"); for (i = 0; i < vmDef->nfss; i++) { - virDomainFSDefPtr fs = vmDef->fss[i]; + virDomainFSDef *fs = vmDef->fss[i]; /* In the first pass, be gentle as some files may depend on other filesystems to be mounted */ if (lxcContainerResolveSymlinks(fs, true) < 0) @@ -1692,7 +1692,7 @@ static int lxcContainerResolveAllSymlinks(virDomainDefPtr vmDef) */ #if WITH_CAPNG -static int lxcContainerDropCapabilities(virDomainDefPtr def, +static int lxcContainerDropCapabilities(virDomainDef *def, bool keepReboot) { int ret; @@ -1821,7 +1821,7 @@ static int lxcContainerDropCapabilities(virDomainDefPtr def, return 0; } #else -static int lxcContainerDropCapabilities(virDomainDefPtr def G_GNUC_UNUSED, +static int lxcContainerDropCapabilities(virDomainDef *def G_GNUC_UNUSED, bool keepReboot G_GNUC_UNUSED) { VIR_WARN("libcap-ng support not compiled in, unable to clear capabilities"); @@ -1855,8 +1855,8 @@ static int lxcAttachNS(int *ns_fd) * * The owner of the tty is also changed to the given user. */ -static int lxcContainerSetUserGroup(virCommandPtr cmd, - virDomainDefPtr vmDef, +static int lxcContainerSetUserGroup(virCommand *cmd, + virDomainDef *vmDef, const char *ttyPath) { uid_t uid; @@ -1897,7 +1897,7 @@ static const char hostname_validchars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789-"; -static int lxcContainerSetHostname(virDomainDefPtr def) +static int lxcContainerSetHostname(virDomainDef *def) { g_autofree char *name = NULL; const char *hostname = NULL; @@ -1934,12 +1934,12 @@ static int lxcContainerSetHostname(virDomainDefPtr def) static int lxcContainerChild(void *data) { lxc_child_argv_t *argv = data; - virDomainDefPtr vmDef = argv->config; + virDomainDef *vmDef = argv->config; int ttyfd = -1; int ret = -1; g_autofree char *ttyPath = NULL; - virDomainFSDefPtr root; - virCommandPtr cmd = NULL; + virDomainFSDef *root; + virCommand *cmd = NULL; int hasReboot; g_autofree gid_t *groups = NULL; int ngroups; @@ -2091,7 +2091,7 @@ static int lxcContainerChild(void *data) return ret; } -static int userns_required(virDomainDefPtr def) +static int userns_required(virDomainDef *def) { return def->idmap.uidmap && def->idmap.gidmap; } @@ -2133,8 +2133,8 @@ virArch lxcContainerGetAlt32bitArch(virArch arch) * * Returns PID of container on success or -1 in case of error */ -int lxcContainerStart(virDomainDefPtr def, - virSecurityManagerPtr securityDriver, +int lxcContainerStart(virDomainDef *def, + virSecurityManager *securityDriver, size_t nveths, char **veths, size_t npassFDs, @@ -2220,7 +2220,7 @@ int lxcContainerStart(virDomainDefPtr def, return pid; } -int lxcContainerChown(virDomainDefPtr def, const char *path) +int lxcContainerChown(virDomainDef *def, const char *path) { uid_t uid; gid_t gid; diff --git a/src/lxc/lxc_container.h b/src/lxc/lxc_container.h index 94a6c5309c..c11660d28b 100644 --- a/src/lxc/lxc_container.h +++ b/src/lxc/lxc_container.h @@ -44,8 +44,8 @@ int lxcContainerSendContinue(int control); int lxcContainerWaitForContinue(int control); -int lxcContainerStart(virDomainDefPtr def, - virSecurityManagerPtr securityDriver, +int lxcContainerStart(virDomainDef *def, + virSecurityManager *securityDriver, size_t nveths, char **veths, size_t npassFDs, @@ -60,6 +60,6 @@ int lxcContainerSetupHostdevCapsMakePath(const char *dev); virArch lxcContainerGetAlt32bitArch(virArch arch); -int lxcContainerChown(virDomainDefPtr def, const char *path); +int lxcContainerChown(virDomainDef *def, const char *path); bool lxcIsBasicMountLocation(const char *path); diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c index ee3c77d31a..ab5fc8b88f 100644 --- a/src/lxc/lxc_controller.c +++ b/src/lxc/lxc_controller.c @@ -72,7 +72,6 @@ VIR_LOG_INIT("lxc.lxc_controller"); typedef struct _virLXCControllerConsole virLXCControllerConsole; -typedef virLXCControllerConsole *virLXCControllerConsolePtr; struct _virLXCControllerConsole { int hostWatch; int hostFd; /* PTY FD in the host OS */ @@ -92,15 +91,14 @@ struct _virLXCControllerConsole { size_t fromContLen; char fromContBuf[1024]; - virNetDaemonPtr daemon; + virNetDaemon *daemon; }; typedef struct _virLXCController virLXCController; -typedef virLXCController *virLXCControllerPtr; struct _virLXCController { char *name; - virDomainObjPtr vm; - virDomainDefPtr def; + virDomainObj *vm; + virDomainDef *def; int handshakeFd; @@ -121,45 +119,45 @@ struct _virLXCController { int *nsFDs; size_t nconsoles; - virLXCControllerConsolePtr consoles; + virLXCControllerConsole *consoles; char *devptmx; size_t nloopDevs; int *loopDevFds; - virSecurityManagerPtr securityManager; + virSecurityManager *securityManager; - virNetDaemonPtr daemon; + virNetDaemon *daemon; bool firstClient; - virNetServerClientPtr client; - virNetServerProgramPtr prog; + virNetServerClient *client; + virNetServerProgram *prog; bool inShutdown; int timerShutdown; - virCgroupPtr cgroup; + virCgroup *cgroup; - virLXCFusePtr fuse; + struct virLXCFuse *fuse; }; #include "lxc_controller_dispatch.h" -static void virLXCControllerFree(virLXCControllerPtr ctrl); -static int virLXCControllerEventSendInit(virLXCControllerPtr ctrl, +static void virLXCControllerFree(virLXCController *ctrl); +static int virLXCControllerEventSendInit(virLXCController *ctrl, pid_t initpid); static void virLXCControllerQuitTimer(int timer G_GNUC_UNUSED, void *opaque) { - virLXCControllerPtr ctrl = opaque; + virLXCController *ctrl = opaque; VIR_DEBUG("Triggering event loop quit"); virNetDaemonQuit(ctrl->daemon); } -static virLXCDriverPtr +static virLXCDriver * virLXCControllerDriverNew(void) { - virLXCDriverPtr driver = g_new0(virLXCDriver, 1); + virLXCDriver *driver = g_new0(virLXCDriver, 1); if (virMutexInit(&driver->lock) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -176,7 +174,7 @@ virLXCControllerDriverNew(void) static void -virLXCControllerDriverFree(virLXCDriverPtr driver) +virLXCControllerDriverFree(virLXCDriver *driver) { if (!driver) return; @@ -187,10 +185,10 @@ virLXCControllerDriverFree(virLXCDriverPtr driver) } -static virLXCControllerPtr virLXCControllerNew(const char *name) +static virLXCController *virLXCControllerNew(const char *name) { - virLXCControllerPtr ctrl = g_new0(virLXCController, 1); - virLXCDriverPtr driver = NULL; + virLXCController *ctrl = g_new0(virLXCController, 1); + virLXCDriver *driver = NULL; g_autofree char *configFile = NULL; ctrl->timerShutdown = -1; @@ -227,7 +225,7 @@ static virLXCControllerPtr virLXCControllerNew(const char *name) } -static int virLXCControllerCloseLoopDevices(virLXCControllerPtr ctrl) +static int virLXCControllerCloseLoopDevices(virLXCController *ctrl) { size_t i; @@ -238,7 +236,7 @@ static int virLXCControllerCloseLoopDevices(virLXCControllerPtr ctrl) } -static void virLXCControllerStopInit(virLXCControllerPtr ctrl) +static void virLXCControllerStopInit(virLXCController *ctrl) { if (ctrl->initpid == 0) return; @@ -249,7 +247,7 @@ static void virLXCControllerStopInit(virLXCControllerPtr ctrl) } -static void virLXCControllerConsoleClose(virLXCControllerConsolePtr console) +static void virLXCControllerConsoleClose(virLXCControllerConsole *console) { if (console->hostWatch != -1) virEventRemoveHandle(console->hostWatch); @@ -266,13 +264,13 @@ static void virLXCControllerConsoleClose(virLXCControllerConsolePtr console) static void -virLXCControllerFreeFuse(virLXCControllerPtr ctrl) +virLXCControllerFreeFuse(virLXCController *ctrl) { return lxcFreeFuse(&ctrl->fuse); } -static void virLXCControllerFree(virLXCControllerPtr ctrl) +static void virLXCControllerFree(virLXCController *ctrl) { size_t i; @@ -318,7 +316,7 @@ static void virLXCControllerFree(virLXCControllerPtr ctrl) } -static int virLXCControllerAddConsole(virLXCControllerPtr ctrl, +static int virLXCControllerAddConsole(virLXCController *ctrl, int hostFd) { VIR_EXPAND_N(ctrl->consoles, ctrl->nconsoles, 1); @@ -335,7 +333,7 @@ static int virLXCControllerAddConsole(virLXCControllerPtr ctrl, } -static int virLXCControllerConsoleSetNonblocking(virLXCControllerConsolePtr console) +static int virLXCControllerConsoleSetNonblocking(virLXCControllerConsole *console) { if (virSetBlocking(console->hostFd, false) < 0 || virSetBlocking(console->contFd, false) < 0) { @@ -348,7 +346,7 @@ static int virLXCControllerConsoleSetNonblocking(virLXCControllerConsolePtr cons } -static int virLXCControllerDaemonHandshake(virLXCControllerPtr ctrl) +static int virLXCControllerDaemonHandshake(virLXCController *ctrl) { if (lxcContainerSendContinue(ctrl->handshakeFd) < 0) { virReportSystemError(errno, "%s", @@ -360,7 +358,7 @@ static int virLXCControllerDaemonHandshake(virLXCControllerPtr ctrl) } -static int virLXCControllerValidateNICs(virLXCControllerPtr ctrl) +static int virLXCControllerValidateNICs(virLXCController *ctrl) { if (ctrl->def->nnets != ctrl->nveths) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -373,7 +371,7 @@ static int virLXCControllerValidateNICs(virLXCControllerPtr ctrl) } -static int virLXCControllerGetNICIndexes(virLXCControllerPtr ctrl) +static int virLXCControllerGetNICIndexes(virLXCController *ctrl) { size_t i; @@ -434,7 +432,7 @@ static int virLXCControllerGetNICIndexes(virLXCControllerPtr ctrl) } -static int virLXCControllerValidateConsoles(virLXCControllerPtr ctrl) +static int virLXCControllerValidateConsoles(virLXCController *ctrl) { if (ctrl->def->nconsoles != ctrl->nconsoles) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -447,7 +445,7 @@ static int virLXCControllerValidateConsoles(virLXCControllerPtr ctrl) } -static int virLXCControllerSetupLoopDeviceFS(virDomainFSDefPtr fs) +static int virLXCControllerSetupLoopDeviceFS(virDomainFSDef *fs) { int lofd; char *loname = NULL; @@ -469,7 +467,7 @@ static int virLXCControllerSetupLoopDeviceFS(virDomainFSDefPtr fs) } -static int virLXCControllerSetupLoopDeviceDisk(virDomainDiskDefPtr disk) +static int virLXCControllerSetupLoopDeviceDisk(virDomainDiskDef *disk) { int lofd; g_autofree char *loname = NULL; @@ -493,7 +491,7 @@ static int virLXCControllerSetupLoopDeviceDisk(virDomainDiskDefPtr disk) } -static int virLXCControllerSetupNBDDeviceFS(virDomainFSDefPtr fs) +static int virLXCControllerSetupNBDDeviceFS(virDomainFSDef *fs) { char *dev; @@ -523,7 +521,7 @@ static int virLXCControllerSetupNBDDeviceFS(virDomainFSDefPtr fs) } -static int virLXCControllerSetupNBDDeviceDisk(virDomainDiskDefPtr disk) +static int virLXCControllerSetupNBDDeviceDisk(virDomainDiskDef *disk) { g_autofree char *dev = NULL; const char *src = virDomainDiskGetSource(disk); @@ -553,7 +551,7 @@ static int virLXCControllerSetupNBDDeviceDisk(virDomainDiskDefPtr disk) return 0; } -static int virLXCControllerAppendNBDPids(virLXCControllerPtr ctrl, +static int virLXCControllerAppendNBDPids(virLXCController *ctrl, const char *dev) { g_autofree char *pidpath = NULL; @@ -596,14 +594,14 @@ static int virLXCControllerAppendNBDPids(virLXCControllerPtr ctrl, return 0; } -static int virLXCControllerSetupLoopDevices(virLXCControllerPtr ctrl) +static int virLXCControllerSetupLoopDevices(virLXCController *ctrl) { size_t i; VIR_DEBUG("Setting up loop devices for filesystems"); for (i = 0; i < ctrl->def->nfss; i++) { - virDomainFSDefPtr fs = ctrl->def->fss[i]; + virDomainFSDef *fs = ctrl->def->fss[i]; int fd; if (fs->type != VIR_DOMAIN_FS_TYPE_FILE) @@ -653,7 +651,7 @@ static int virLXCControllerSetupLoopDevices(virLXCControllerPtr ctrl) VIR_DEBUG("Setting up loop devices for disks"); for (i = 0; i < ctrl->def->ndisks; i++) { - virDomainDiskDefPtr disk = ctrl->def->disks[i]; + virDomainDiskDef *disk = ctrl->def->disks[i]; int fd; const char *driver = virDomainDiskGetDriver(disk); int format = virDomainDiskGetFormat(disk); @@ -721,11 +719,11 @@ static int virLXCControllerSetupLoopDevices(virLXCControllerPtr ctrl) /* * To be run while still single threaded */ -static int virLXCControllerSetupCpuAffinity(virLXCControllerPtr ctrl) +static int virLXCControllerSetupCpuAffinity(virLXCController *ctrl) { int hostcpus, maxcpu = CPU_SETSIZE; - virBitmapPtr cpumap; - virBitmapPtr cpumapToSet; + virBitmap *cpumap; + virBitmap *cpumapToSet; VIR_DEBUG("Setting CPU affinity"); @@ -764,10 +762,10 @@ static int virLXCControllerSetupCpuAffinity(virLXCControllerPtr ctrl) } -static int virLXCControllerGetNumadAdvice(virLXCControllerPtr ctrl, - virBitmapPtr *mask) +static int virLXCControllerGetNumadAdvice(virLXCController *ctrl, + virBitmap **mask) { - virBitmapPtr nodemask = NULL; + virBitmap *nodemask = NULL; g_autofree char *nodeset = NULL; /* Get the advisory nodeset from numad if 'placement' of @@ -801,11 +799,11 @@ static int virLXCControllerGetNumadAdvice(virLXCControllerPtr ctrl, * * Returns 0 on success or -1 in case of error */ -static int virLXCControllerSetupResourceLimits(virLXCControllerPtr ctrl) +static int virLXCControllerSetupResourceLimits(virLXCController *ctrl) { - virBitmapPtr auto_nodeset = NULL; + virBitmap *auto_nodeset = NULL; int ret = -1; - virBitmapPtr nodeset = NULL; + virBitmap *nodeset = NULL; virDomainNumatuneMemMode mode; if (virDomainNumatuneGetMode(ctrl->def->numa, -1, &mode) == 0) { @@ -843,11 +841,11 @@ static int virLXCControllerSetupResourceLimits(virLXCControllerPtr ctrl) * Creates the cgroup and sets up the various limits associated * with it */ -static int virLXCControllerSetupCgroupLimits(virLXCControllerPtr ctrl) +static int virLXCControllerSetupCgroupLimits(virLXCController *ctrl) { - virBitmapPtr auto_nodeset = NULL; + virBitmap *auto_nodeset = NULL; int ret = -1; - virBitmapPtr nodeset = NULL; + virBitmap *nodeset = NULL; size_t i; VIR_DEBUG("Setting up cgroup resource limits"); @@ -882,9 +880,9 @@ static int virLXCControllerSetupCgroupLimits(virLXCControllerPtr ctrl) } -static void virLXCControllerClientCloseHook(virNetServerClientPtr client) +static void virLXCControllerClientCloseHook(virNetServerClient *client) { - virLXCControllerPtr ctrl = virNetServerClientGetPrivateData(client); + virLXCController *ctrl = virNetServerClientGetPrivateData(client); VIR_DEBUG("Client %p has closed", client); if (ctrl->client == client) @@ -897,14 +895,14 @@ static void virLXCControllerClientCloseHook(virNetServerClientPtr client) static void virLXCControllerClientPrivateFree(void *data) { - virLXCControllerPtr ctrl = data; + virLXCController *ctrl = data; VIR_DEBUG("Got private data free %p", ctrl); } -static void *virLXCControllerClientPrivateNew(virNetServerClientPtr client, +static void *virLXCControllerClientPrivateNew(virNetServerClient *client, void *opaque) { - virLXCControllerPtr ctrl = opaque; + virLXCController *ctrl = opaque; virNetServerClientSetCloseHook(client, virLXCControllerClientCloseHook); VIR_DEBUG("Got new client %p", client); @@ -918,10 +916,10 @@ static void *virLXCControllerClientPrivateNew(virNetServerClientPtr client, } -static int virLXCControllerSetupServer(virLXCControllerPtr ctrl) +static int virLXCControllerSetupServer(virLXCController *ctrl) { - virNetServerPtr srv = NULL; - virNetServerServicePtr svc = NULL; + virNetServer *srv = NULL; + virNetServerService *svc = NULL; g_autofree char *sockpath = NULL; sockpath = g_strdup_printf("%s/%s.sock", LXC_STATE_DIR, ctrl->name); @@ -1000,11 +998,11 @@ static bool wantReboot; static virMutex lock = VIR_MUTEX_INITIALIZER; -static void virLXCControllerSignalChildIO(virNetDaemonPtr dmn, +static void virLXCControllerSignalChildIO(virNetDaemon *dmn, siginfo_t *info G_GNUC_UNUSED, void *opaque) { - virLXCControllerPtr ctrl = opaque; + virLXCController *ctrl = opaque; int ret; int status; @@ -1023,7 +1021,7 @@ static void virLXCControllerSignalChildIO(virNetDaemonPtr dmn, } -static void virLXCControllerConsoleUpdateWatch(virLXCControllerConsolePtr console) +static void virLXCControllerConsoleUpdateWatch(virLXCControllerConsole *console) { int hostEvents = 0; int contEvents = 0; @@ -1130,7 +1128,7 @@ static void virLXCControllerConsoleUpdateWatch(virLXCControllerConsolePtr consol static void virLXCControllerConsoleEPoll(int watch, int fd, int events, void *opaque) { - virLXCControllerConsolePtr console = opaque; + virLXCControllerConsole *console = opaque; virMutexLock(&lock); VIR_DEBUG("IO event watch=%d fd=%d events=%d fromHost=%zu fromcont=%zu", @@ -1177,7 +1175,7 @@ static void virLXCControllerConsoleEPoll(int watch, int fd, int events, void *op static void virLXCControllerConsoleIO(int watch, int fd, int events, void *opaque) { - virLXCControllerConsolePtr console = opaque; + virLXCControllerConsole *console = opaque; virMutexLock(&lock); VIR_DEBUG("IO event watch=%d fd=%d events=%d fromHost=%zu fromcont=%zu", @@ -1274,7 +1272,7 @@ static void virLXCControllerConsoleIO(int watch, int fd, int events, void *opaqu * * Returns 0 on success or -1 in case of error */ -static int virLXCControllerMain(virLXCControllerPtr ctrl) +static int virLXCControllerMain(virLXCController *ctrl) { int rc = -1; size_t i; @@ -1338,7 +1336,7 @@ static int virLXCControllerMain(virLXCControllerPtr ctrl) } static unsigned int -virLXCControllerLookupUsernsMap(virDomainIdMapEntryPtr map, +virLXCControllerLookupUsernsMap(virDomainIdMapEntry *map, int num, unsigned int src) { @@ -1353,7 +1351,7 @@ virLXCControllerLookupUsernsMap(virDomainIdMapEntryPtr map, } static int -virLXCControllerSetupUsernsMap(virDomainIdMapEntryPtr map, +virLXCControllerSetupUsernsMap(virDomainIdMapEntry *map, int num, char *path) { @@ -1388,7 +1386,7 @@ virLXCControllerSetupUsernsMap(virDomainIdMapEntryPtr map, * * Returns 0 on success or -1 in case of error */ -static int virLXCControllerSetupUserns(virLXCControllerPtr ctrl) +static int virLXCControllerSetupUserns(virLXCController *ctrl) { g_autofree char *uid_map = NULL; g_autofree char *gid_map = NULL; @@ -1417,7 +1415,7 @@ static int virLXCControllerSetupUserns(virLXCControllerPtr ctrl) return 0; } -static int virLXCControllerSetupDev(virLXCControllerPtr ctrl) +static int virLXCControllerSetupDev(virLXCController *ctrl) { g_autofree char *mount_options = NULL; g_autofree char *opts = NULL; @@ -1446,7 +1444,7 @@ static int virLXCControllerSetupDev(virLXCControllerPtr ctrl) return 0; } -static int virLXCControllerPopulateDevices(virLXCControllerPtr ctrl) +static int virLXCControllerPopulateDevices(virLXCController *ctrl) { size_t i; const struct { @@ -1492,9 +1490,9 @@ static int virLXCControllerPopulateDevices(virLXCControllerPtr ctrl) static int -virLXCControllerSetupTimers(virLXCControllerPtr ctrl) +virLXCControllerSetupTimers(virLXCController *ctrl) { - virDomainDefPtr def = ctrl->def; + virDomainDef *def = ctrl->def; size_t i; /* Not sync'ed with Host clock */ @@ -1502,7 +1500,7 @@ virLXCControllerSetupTimers(virLXCControllerPtr ctrl) return 0; for (i = 0; i < def->clock.ntimers; i++) { - virDomainTimerDefPtr timer = def->clock.timers[i]; + virDomainTimerDef *timer = def->clock.timers[i]; g_autofree char *path = NULL; const char *timer_dev = NULL; struct stat sb; @@ -1563,9 +1561,9 @@ virLXCControllerSetupTimers(virLXCControllerPtr ctrl) static int -virLXCControllerSetupHostdevSubsysUSB(virDomainDefPtr vmDef, - virDomainHostdevDefPtr def, - virSecurityManagerPtr securityDriver) +virLXCControllerSetupHostdevSubsysUSB(virDomainDef *vmDef, + virDomainHostdevDef *def, + virSecurityManager *securityDriver) { g_autofree char *src = NULL; g_autofree char *dstdir = NULL; @@ -1573,7 +1571,7 @@ virLXCControllerSetupHostdevSubsysUSB(virDomainDefPtr vmDef, g_autofree char *vroot = NULL; struct stat sb; mode_t mode; - virDomainHostdevSubsysUSBPtr usbsrc = &def->source.subsys.u.usb; + virDomainHostdevSubsysUSB *usbsrc = &def->source.subsys.u.usb; src = g_strdup_printf(USB_DEVFS "/%03d/%03d", usbsrc->bus, usbsrc->device); @@ -1625,9 +1623,9 @@ virLXCControllerSetupHostdevSubsysUSB(virDomainDefPtr vmDef, static int -virLXCControllerSetupHostdevCapsStorage(virDomainDefPtr vmDef, - virDomainHostdevDefPtr def, - virSecurityManagerPtr securityDriver) +virLXCControllerSetupHostdevCapsStorage(virDomainDef *vmDef, + virDomainHostdevDef *def, + virSecurityManager *securityDriver) { g_autofree char *dst = NULL; g_autofree char *path = NULL; @@ -1699,9 +1697,9 @@ virLXCControllerSetupHostdevCapsStorage(virDomainDefPtr vmDef, static int -virLXCControllerSetupHostdevCapsMisc(virDomainDefPtr vmDef, - virDomainHostdevDefPtr def, - virSecurityManagerPtr securityDriver) +virLXCControllerSetupHostdevCapsMisc(virDomainDef *vmDef, + virDomainHostdevDef *def, + virSecurityManager *securityDriver) { g_autofree char *dst = NULL; g_autofree char *path = NULL; @@ -1772,9 +1770,9 @@ virLXCControllerSetupHostdevCapsMisc(virDomainDefPtr vmDef, } static int -virLXCControllerSetupHostdevSubsys(virDomainDefPtr vmDef, - virDomainHostdevDefPtr def, - virSecurityManagerPtr securityDriver) +virLXCControllerSetupHostdevSubsys(virDomainDef *vmDef, + virDomainHostdevDef *def, + virSecurityManager *securityDriver) { switch (def->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: @@ -1792,9 +1790,9 @@ virLXCControllerSetupHostdevSubsys(virDomainDefPtr vmDef, static int -virLXCControllerSetupHostdevCaps(virDomainDefPtr vmDef, - virDomainHostdevDefPtr def, - virSecurityManagerPtr securityDriver) +virLXCControllerSetupHostdevCaps(virDomainDef *vmDef, + virDomainHostdevDef *def, + virSecurityManager *securityDriver) { switch (def->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE: @@ -1820,15 +1818,15 @@ virLXCControllerSetupHostdevCaps(virDomainDefPtr vmDef, static int -virLXCControllerSetupAllHostdevs(virLXCControllerPtr ctrl) +virLXCControllerSetupAllHostdevs(virLXCController *ctrl) { size_t i; - virDomainDefPtr vmDef = ctrl->def; - virSecurityManagerPtr securityDriver = ctrl->securityManager; + virDomainDef *vmDef = ctrl->def; + virSecurityManager *securityDriver = ctrl->securityManager; VIR_DEBUG("Setting up hostdevs"); for (i = 0; i < vmDef->nhostdevs; i++) { - virDomainHostdevDefPtr def = vmDef->hostdevs[i]; + virDomainHostdevDef *def = vmDef->hostdevs[i]; switch (def->mode) { case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS: if (virLXCControllerSetupHostdevSubsys(vmDef, @@ -1855,9 +1853,9 @@ virLXCControllerSetupAllHostdevs(virLXCControllerPtr ctrl) } -static int virLXCControllerSetupDisk(virLXCControllerPtr ctrl, - virDomainDiskDefPtr def, - virSecurityManagerPtr securityDriver) +static int virLXCControllerSetupDisk(virLXCController *ctrl, + virDomainDiskDef *def, + virSecurityManager *securityDriver) { g_autofree char *dst = NULL; int ret = -1; @@ -1931,7 +1929,7 @@ static int virLXCControllerSetupDisk(virLXCControllerPtr ctrl, return ret; } -static int virLXCControllerSetupAllDisks(virLXCControllerPtr ctrl) +static int virLXCControllerSetupAllDisks(virLXCController *ctrl) { size_t i; VIR_DEBUG("Setting up disks"); @@ -1958,10 +1956,10 @@ static int virLXCControllerSetupAllDisks(virLXCControllerPtr ctrl) * * Returns 0 on success or -1 in case of error */ -static int virLXCControllerMoveInterfaces(virLXCControllerPtr ctrl) +static int virLXCControllerMoveInterfaces(virLXCController *ctrl) { size_t i; - virDomainDefPtr def = ctrl->def; + virDomainDef *def = ctrl->def; for (i = 0; i < ctrl->nveths; i++) { if (virNetDevSetNamespace(ctrl->veths[i], ctrl->initpid) < 0) @@ -1969,7 +1967,7 @@ static int virLXCControllerMoveInterfaces(virLXCControllerPtr ctrl) } for (i = 0; i < def->nhostdevs; i ++) { - virDomainHostdevDefPtr hdev = def->hostdevs[i]; + virDomainHostdevDef *hdev = def->hostdevs[i]; virDomainHostdevCaps hdcaps; if (hdev->mode != VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES) @@ -1996,7 +1994,7 @@ static int virLXCControllerMoveInterfaces(virLXCControllerPtr ctrl) * * Returns 0 on success or -1 in case of error */ -static int virLXCControllerDeleteInterfaces(virLXCControllerPtr ctrl) +static int virLXCControllerDeleteInterfaces(virLXCController *ctrl) { size_t i; int ret = 0; @@ -2010,7 +2008,7 @@ static int virLXCControllerDeleteInterfaces(virLXCControllerPtr ctrl) } -static int lxcSetPersonality(virDomainDefPtr def) +static int lxcSetPersonality(virDomainDef *def) { virArch altArch; @@ -2036,7 +2034,7 @@ static int lxcSetPersonality(virDomainDefPtr def) * @ttyName. Heavily borrowed from glibc, but doesn't require that * devpts == "/dev/pts" */ static int -lxcCreateTty(virLXCControllerPtr ctrl, int *ttyprimary, +lxcCreateTty(virLXCController *ctrl, int *ttyprimary, char **ttyName, char **ttyHostPath) { int ret = -1; @@ -2103,7 +2101,7 @@ virLXCControllerSetupPrivateNS(void) static int -virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl) +virLXCControllerSetupDevPTS(virLXCController *ctrl) { g_autofree char *mount_options = NULL; g_autofree char *opts = NULL; @@ -2159,19 +2157,19 @@ virLXCControllerSetupDevPTS(virLXCControllerPtr ctrl) static int -virLXCControllerSetupFuse(virLXCControllerPtr ctrl) +virLXCControllerSetupFuse(virLXCController *ctrl) { return lxcSetupFuse(&ctrl->fuse, ctrl->def); } static int -virLXCControllerStartFuse(virLXCControllerPtr ctrl) +virLXCControllerStartFuse(virLXCController *ctrl) { return lxcStartFuse(ctrl->fuse); } static int -virLXCControllerSetupConsoles(virLXCControllerPtr ctrl, +virLXCControllerSetupConsoles(virLXCController *ctrl, char **containerTTYPaths) { size_t i; @@ -2198,12 +2196,12 @@ virLXCControllerSetupConsoles(virLXCControllerPtr ctrl, static void -virLXCControllerEventSend(virLXCControllerPtr ctrl, +virLXCControllerEventSend(virLXCController *ctrl, int procnr, xdrproc_t proc, void *data) { - virNetMessagePtr msg; + virNetMessage *msg; if (!ctrl->client) { VIR_WARN("Dropping event %d because libvirtd is not connected", procnr); @@ -2241,7 +2239,7 @@ virLXCControllerEventSend(virLXCControllerPtr ctrl, static int -virLXCControllerEventSendExit(virLXCControllerPtr ctrl, +virLXCControllerEventSendExit(virLXCController *ctrl, int exitstatus) { virLXCMonitorExitEventMsg msg; @@ -2277,7 +2275,7 @@ virLXCControllerEventSendExit(virLXCControllerPtr ctrl, static int -virLXCControllerEventSendInit(virLXCControllerPtr ctrl, +virLXCControllerEventSendInit(virLXCController *ctrl, pid_t initpid) { virLXCMonitorInitEventMsg msg; @@ -2295,7 +2293,7 @@ virLXCControllerEventSendInit(virLXCControllerPtr ctrl, static int -virLXCControllerRun(virLXCControllerPtr ctrl) +virLXCControllerRun(virLXCController *ctrl) { int rc = -1; int control[2] = { -1, -1}; @@ -2459,7 +2457,7 @@ int main(int argc, char *argv[]) size_t nttyFDs = 0; g_autofree int *passFDs = NULL; size_t npassFDs = 0; - virLXCControllerPtr ctrl = NULL; + virLXCController *ctrl = NULL; size_t i; const char *securityDriver = "none"; diff --git a/src/lxc/lxc_domain.c b/src/lxc/lxc_domain.c index 255bfab495..0920e91fd1 100644 --- a/src/lxc/lxc_domain.c +++ b/src/lxc/lxc_domain.c @@ -45,7 +45,7 @@ VIR_ENUM_IMPL(virLXCDomainJob, VIR_LOG_INIT("lxc.lxc_domain"); static int -virLXCDomainObjInitJob(virLXCDomainObjPrivatePtr priv) +virLXCDomainObjInitJob(virLXCDomainObjPrivate *priv) { memset(&priv->job, 0, sizeof(priv->job)); @@ -56,7 +56,7 @@ virLXCDomainObjInitJob(virLXCDomainObjPrivatePtr priv) } static void -virLXCDomainObjResetJob(virLXCDomainObjPrivatePtr priv) +virLXCDomainObjResetJob(virLXCDomainObjPrivate *priv) { struct virLXCDomainJobObj *job = &priv->job; @@ -65,7 +65,7 @@ virLXCDomainObjResetJob(virLXCDomainObjPrivatePtr priv) } static void -virLXCDomainObjFreeJob(virLXCDomainObjPrivatePtr priv) +virLXCDomainObjFreeJob(virLXCDomainObjPrivate *priv) { ignore_value(virCondDestroy(&priv->job.cond)); } @@ -74,7 +74,7 @@ virLXCDomainObjFreeJob(virLXCDomainObjPrivatePtr priv) #define LXC_JOB_WAIT_TIME (1000ull * 30) /* - * obj must be locked before calling, virLXCDriverPtr must NOT be locked + * obj must be locked before calling, virLXCDriver *must NOT be locked * * This must be called by anything that will change the VM state * in any way @@ -83,11 +83,11 @@ virLXCDomainObjFreeJob(virLXCDomainObjPrivatePtr priv) * Successful calls must be followed by EndJob eventually. */ int -virLXCDomainObjBeginJob(virLXCDriverPtr driver G_GNUC_UNUSED, - virDomainObjPtr obj, +virLXCDomainObjBeginJob(virLXCDriver *driver G_GNUC_UNUSED, + virDomainObj *obj, enum virLXCDomainJob job) { - virLXCDomainObjPrivatePtr priv = obj->privateData; + virLXCDomainObjPrivate *priv = obj->privateData; unsigned long long now; unsigned long long then; @@ -135,10 +135,10 @@ virLXCDomainObjBeginJob(virLXCDriverPtr driver G_GNUC_UNUSED, * earlier virLXCDomainBeginJob() call */ void -virLXCDomainObjEndJob(virLXCDriverPtr driver G_GNUC_UNUSED, - virDomainObjPtr obj) +virLXCDomainObjEndJob(virLXCDriver *driver G_GNUC_UNUSED, + virDomainObj *obj) { - virLXCDomainObjPrivatePtr priv = obj->privateData; + virLXCDomainObjPrivate *priv = obj->privateData; enum virLXCDomainJob job = priv->job.active; VIR_DEBUG("Stopping job: %s", @@ -152,7 +152,7 @@ virLXCDomainObjEndJob(virLXCDriverPtr driver G_GNUC_UNUSED, static void * virLXCDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED) { - virLXCDomainObjPrivatePtr priv = g_new0(virLXCDomainObjPrivate, 1); + virLXCDomainObjPrivate *priv = g_new0(virLXCDomainObjPrivate, 1); if (virLXCDomainObjInitJob(priv) < 0) { g_free(priv); @@ -166,7 +166,7 @@ virLXCDomainObjPrivateAlloc(void *opaque G_GNUC_UNUSED) static void virLXCDomainObjPrivateFree(void *data) { - virLXCDomainObjPrivatePtr priv = data; + virLXCDomainObjPrivate *priv = data; virCgroupFree(priv->cgroup); virLXCDomainObjFreeJob(priv); @@ -194,7 +194,7 @@ static void lxcDomainDefNamespaceFree(void *nsdata) { size_t i; - lxcDomainDefPtr lxcDef = nsdata; + lxcDomainDef *lxcDef = nsdata; if (!lxcDef) return; @@ -208,7 +208,7 @@ static int lxcDomainDefNamespaceParse(xmlXPathContextPtr ctxt, void **data) { - lxcDomainDefPtr lxcDef = NULL; + lxcDomainDef *lxcDef = NULL; g_autofree xmlNodePtr *nodes = NULL; VIR_XPATH_NODE_AUTORESTORE(ctxt) int n; @@ -268,10 +268,10 @@ lxcDomainDefNamespaceParse(xmlXPathContextPtr ctxt, static int -lxcDomainDefNamespaceFormatXML(virBufferPtr buf, +lxcDomainDefNamespaceFormatXML(virBuffer *buf, void *nsdata) { - lxcDomainDefPtr lxcDef = nsdata; + lxcDomainDef *lxcDef = nsdata; size_t i; if (!lxcDef) @@ -307,10 +307,10 @@ virXMLNamespace virLXCDriverDomainXMLNamespace = { static int -virLXCDomainObjPrivateXMLFormat(virBufferPtr buf, - virDomainObjPtr vm) +virLXCDomainObjPrivateXMLFormat(virBuffer *buf, + virDomainObj *vm) { - virLXCDomainObjPrivatePtr priv = vm->privateData; + virLXCDomainObjPrivate *priv = vm->privateData; virBufferAsprintf(buf, "\n", (long long)priv->initpid); @@ -320,10 +320,10 @@ virLXCDomainObjPrivateXMLFormat(virBufferPtr buf, static int virLXCDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, - virDomainObjPtr vm, - virDomainDefParserConfigPtr config G_GNUC_UNUSED) + virDomainObj *vm, + virDomainDefParserConfig *config G_GNUC_UNUSED) { - virLXCDomainObjPrivatePtr priv = vm->privateData; + virLXCDomainObjPrivate *priv = vm->privateData; long long thepid; if (virXPathLongLong("string(./init[1]/@pid)", ctxt, &thepid) < 0) { @@ -345,12 +345,12 @@ virDomainXMLPrivateDataCallbacks virLXCDriverPrivateDataCallbacks = { }; static int -virLXCDomainDefPostParse(virDomainDefPtr def, +virLXCDomainDefPostParse(virDomainDef *def, unsigned int parseFlags G_GNUC_UNUSED, void *opaque, void *parseOpaque G_GNUC_UNUSED) { - virLXCDriverPtr driver = opaque; + virLXCDriver *driver = opaque; g_autoptr(virCaps) caps = virLXCDriverGetCapabilities(driver, false); if (!caps) return -1; @@ -369,7 +369,7 @@ virLXCDomainDefPostParse(virDomainDefPtr def, static int -virLXCDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, +virLXCDomainDeviceDefPostParse(virDomainDeviceDef *dev, const virDomainDef *def G_GNUC_UNUSED, unsigned int parseFlags G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED, @@ -391,7 +391,7 @@ virDomainDefParserConfig virLXCDriverDomainDefParserConfig = { char * -virLXCDomainGetMachineName(virDomainDefPtr def, pid_t pid) +virLXCDomainGetMachineName(virDomainDef *def, pid_t pid) { char *ret = NULL; @@ -453,10 +453,10 @@ lxcDomainInitctlCallback(pid_t pid G_GNUC_UNUSED, int -virLXCDomainSetRunlevel(virDomainObjPtr vm, +virLXCDomainSetRunlevel(virDomainObj *vm, int runlevel) { - virLXCDomainObjPrivatePtr priv = vm->privateData; + virLXCDomainObjPrivate *priv = vm->privateData; lxcDomainInitctlCallbackData data; size_t nfifos = 0; size_t i; diff --git a/src/lxc/lxc_domain.h b/src/lxc/lxc_domain.h index 3b5adcbe1c..766837bdf1 100644 --- a/src/lxc/lxc_domain.h +++ b/src/lxc/lxc_domain.h @@ -47,7 +47,6 @@ VIR_ENUM_DECL(virLXCDomainNamespace); VIR_ENUM_DECL(virLXCDomainNamespaceSource); typedef struct _lxcDomainDef lxcDomainDef; -typedef lxcDomainDef *lxcDomainDefPtr; struct _lxcDomainDef { int ns_source[VIR_LXC_DOMAIN_NAMESPACE_LAST]; /* virLXCDomainNamespaceSource */ char *ns_val[VIR_LXC_DOMAIN_NAMESPACE_LAST]; @@ -76,16 +75,15 @@ struct virLXCDomainJobObj { typedef struct _virLXCDomainObjPrivate virLXCDomainObjPrivate; -typedef virLXCDomainObjPrivate *virLXCDomainObjPrivatePtr; struct _virLXCDomainObjPrivate { - virLXCMonitorPtr monitor; + virLXCMonitor *monitor; bool doneStopEvent; int stopReason; bool wantReboot; pid_t initpid; - virCgroupPtr cgroup; + virCgroup *cgroup; char *machineName; struct virLXCDomainJobObj job; @@ -96,19 +94,19 @@ extern virDomainXMLPrivateDataCallbacks virLXCDriverPrivateDataCallbacks; extern virDomainDefParserConfig virLXCDriverDomainDefParserConfig; int -virLXCDomainObjBeginJob(virLXCDriverPtr driver, - virDomainObjPtr obj, +virLXCDomainObjBeginJob(virLXCDriver *driver, + virDomainObj *obj, enum virLXCDomainJob job) G_GNUC_WARN_UNUSED_RESULT; void -virLXCDomainObjEndJob(virLXCDriverPtr driver, - virDomainObjPtr obj); +virLXCDomainObjEndJob(virLXCDriver *driver, + virDomainObj *obj); char * -virLXCDomainGetMachineName(virDomainDefPtr def, pid_t pid); +virLXCDomainGetMachineName(virDomainDef *def, pid_t pid); int -virLXCDomainSetRunlevel(virDomainObjPtr vm, +virLXCDomainSetRunlevel(virDomainObj *vm, int runlevel); diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 2db544c945..07aeb56b0c 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -88,24 +88,24 @@ static int lxcStateInitialize(bool privileged, virStateInhibitCallback callback, void *opaque); static int lxcStateCleanup(void); -virLXCDriverPtr lxc_driver = NULL; +virLXCDriver *lxc_driver = NULL; /** * lxcDomObjFromDomain: * @domain: Domain pointer that has to be looked up * - * This function looks up @domain and returns the appropriate virDomainObjPtr + * This function looks up @domain and returns the appropriate virDomainObj * * that has to be released by calling virDomainObjEndAPI. * * Returns the domain object with incremented reference counter which is locked * on success, NULL otherwise. */ -static virDomainObjPtr +static virDomainObj * lxcDomObjFromDomain(virDomainPtr domain) { - virDomainObjPtr vm; - virLXCDriverPtr driver = domain->conn->privateData; + virDomainObj *vm; + virLXCDriver *driver = domain->conn->privateData; char uuidstr[VIR_UUID_STRING_BUFLEN]; vm = virDomainObjListFindByUUID(driver->domains, domain->uuid); @@ -135,7 +135,7 @@ lxcConnectURIProbe(char **uri) static virDrvOpenStatus lxcConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -167,7 +167,7 @@ static virDrvOpenStatus lxcConnectOpen(virConnectPtr conn, static int lxcConnectClose(virConnectPtr conn) { - virLXCDriverPtr driver = conn->privateData; + virLXCDriver *driver = conn->privateData; virCloseCallbacksRun(driver->closeCallbacks, conn, driver->domains, driver); conn->privateData = NULL; @@ -196,8 +196,8 @@ static int lxcConnectIsAlive(virConnectPtr conn G_GNUC_UNUSED) static char *lxcConnectGetCapabilities(virConnectPtr conn) { - virLXCDriverPtr driver = conn->privateData; - virCapsPtr caps; + virLXCDriver *driver = conn->privateData; + virCaps *caps; char *xml; if (virConnectGetCapabilitiesEnsureACL(conn) < 0) @@ -216,8 +216,8 @@ static char *lxcConnectGetCapabilities(virConnectPtr conn) { static virDomainPtr lxcDomainLookupByID(virConnectPtr conn, int id) { - virLXCDriverPtr driver = conn->privateData; - virDomainObjPtr vm; + virLXCDriver *driver = conn->privateData; + virDomainObj *vm; virDomainPtr dom = NULL; vm = virDomainObjListFindByID(driver->domains, id); @@ -241,8 +241,8 @@ static virDomainPtr lxcDomainLookupByID(virConnectPtr conn, static virDomainPtr lxcDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - virLXCDriverPtr driver = conn->privateData; - virDomainObjPtr vm; + virLXCDriver *driver = conn->privateData; + virDomainObj *vm; virDomainPtr dom = NULL; vm = virDomainObjListFindByUUID(driver->domains, uuid); @@ -268,8 +268,8 @@ static virDomainPtr lxcDomainLookupByUUID(virConnectPtr conn, static virDomainPtr lxcDomainLookupByName(virConnectPtr conn, const char *name) { - virLXCDriverPtr driver = conn->privateData; - virDomainObjPtr vm; + virLXCDriver *driver = conn->privateData; + virDomainObj *vm; virDomainPtr dom = NULL; vm = virDomainObjListFindByName(driver->domains, name); @@ -292,7 +292,7 @@ static virDomainPtr lxcDomainLookupByName(virConnectPtr conn, static int lxcDomainIsActive(virDomainPtr dom) { - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = lxcDomObjFromDomain(dom))) @@ -311,7 +311,7 @@ static int lxcDomainIsActive(virDomainPtr dom) static int lxcDomainIsPersistent(virDomainPtr dom) { - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = lxcDomObjFromDomain(dom))) @@ -329,7 +329,7 @@ static int lxcDomainIsPersistent(virDomainPtr dom) static int lxcDomainIsUpdated(virDomainPtr dom) { - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = lxcDomObjFromDomain(dom))) @@ -347,7 +347,7 @@ static int lxcDomainIsUpdated(virDomainPtr dom) static int lxcConnectListDomains(virConnectPtr conn, int *ids, int nids) { - virLXCDriverPtr driver = conn->privateData; + virLXCDriver *driver = conn->privateData; if (virConnectListDomainsEnsureACL(conn) < 0) return -1; @@ -358,7 +358,7 @@ static int lxcConnectListDomains(virConnectPtr conn, int *ids, int nids) static int lxcConnectNumOfDomains(virConnectPtr conn) { - virLXCDriverPtr driver = conn->privateData; + virLXCDriver *driver = conn->privateData; if (virConnectNumOfDomainsEnsureACL(conn) < 0) return -1; @@ -370,7 +370,7 @@ static int lxcConnectNumOfDomains(virConnectPtr conn) static int lxcConnectListDefinedDomains(virConnectPtr conn, char **const names, int nnames) { - virLXCDriverPtr driver = conn->privateData; + virLXCDriver *driver = conn->privateData; if (virConnectListDefinedDomainsEnsureACL(conn) < 0) return -1; @@ -383,7 +383,7 @@ static int lxcConnectListDefinedDomains(virConnectPtr conn, static int lxcConnectNumOfDefinedDomains(virConnectPtr conn) { - virLXCDriverPtr driver = conn->privateData; + virLXCDriver *driver = conn->privateData; if (virConnectNumOfDefinedDomainsEnsureACL(conn) < 0) return -1; @@ -398,14 +398,14 @@ static int lxcConnectNumOfDefinedDomains(virConnectPtr conn) static virDomainPtr lxcDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags) { - virLXCDriverPtr driver = conn->privateData; - virDomainDefPtr def = NULL; - virDomainObjPtr vm = NULL; + virLXCDriver *driver = conn->privateData; + virDomainDef *def = NULL; + virDomainObj *vm = NULL; virDomainPtr dom = NULL; - virObjectEventPtr event = NULL; - virDomainDefPtr oldDef = NULL; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); - virCapsPtr caps = NULL; + virObjectEvent *event = NULL; + virDomainDef *oldDef = NULL; + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); + virCaps *caps = NULL; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; virCheckFlags(VIR_DOMAIN_DEFINE_VALIDATE, NULL); @@ -476,11 +476,11 @@ lxcDomainDefineXML(virConnectPtr conn, const char *xml) static int lxcDomainUndefineFlags(virDomainPtr dom, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virObjectEventPtr event = NULL; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm; + virObjectEvent *event = NULL; int ret = -1; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); virCheckFlags(0, -1); @@ -527,9 +527,9 @@ static int lxcDomainUndefine(virDomainPtr dom) static int lxcDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; - virLXCDomainObjPrivatePtr priv; + virLXCDomainObjPrivate *priv; if (!(vm = lxcDomObjFromDomain(dom))) goto cleanup; @@ -577,7 +577,7 @@ lxcDomainGetState(virDomainPtr dom, int *reason, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -598,7 +598,7 @@ lxcDomainGetState(virDomainPtr dom, static char *lxcDomainGetOSType(virDomainPtr dom) { - virDomainObjPtr vm; + virDomainObj *vm; char *ret = NULL; if (!(vm = lxcDomObjFromDomain(dom))) @@ -618,7 +618,7 @@ static char *lxcDomainGetOSType(virDomainPtr dom) static unsigned long long lxcDomainGetMaxMemory(virDomainPtr dom) { - virDomainObjPtr vm; + virDomainObj *vm; unsigned long long ret = 0; if (!(vm = lxcDomObjFromDomain(dom))) @@ -637,13 +637,13 @@ lxcDomainGetMaxMemory(virDomainPtr dom) static int lxcDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, unsigned int flags) { - virDomainObjPtr vm; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; + virDomainObj *vm; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; int ret = -1; - virLXCDomainObjPrivatePtr priv; - virLXCDriverPtr driver = dom->conn->privateData; - virLXCDriverConfigPtr cfg = NULL; + virLXCDomainObjPrivate *priv; + virLXCDriver *driver = dom->conn->privateData; + virLXCDriverConfig *cfg = NULL; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG | @@ -744,12 +744,12 @@ lxcDomainSetMemoryParameters(virDomainPtr dom, int nparams, unsigned int flags) { - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; - virDomainObjPtr vm = NULL; - virLXCDomainObjPrivatePtr priv = NULL; - virLXCDriverConfigPtr cfg = NULL; - virLXCDriverPtr driver = dom->conn->privateData; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; + virDomainObj *vm = NULL; + virLXCDomainObjPrivate *priv = NULL; + virLXCDriverConfig *cfg = NULL; + virLXCDriver *driver = dom->conn->privateData; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -819,10 +819,10 @@ lxcDomainGetMemoryParameters(virDomainPtr dom, int *nparams, unsigned int flags) { - virDomainDefPtr persistentDef = NULL; - virDomainDefPtr def = NULL; - virDomainObjPtr vm = NULL; - virLXCDomainObjPrivatePtr priv = NULL; + virDomainDef *persistentDef = NULL; + virDomainDef *def = NULL; + virDomainObj *vm = NULL; + virLXCDomainObjPrivate *priv = NULL; unsigned long long val; int ret = -1; size_t i; @@ -910,8 +910,8 @@ lxcDomainGetMemoryParameters(virDomainPtr dom, static char *lxcDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm; char *ret = NULL; virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS, NULL); @@ -938,9 +938,9 @@ static char *lxcConnectDomainXMLFromNative(virConnectPtr conn, unsigned int flags) { char *xml = NULL; - virDomainDefPtr def = NULL; - virLXCDriverPtr driver = conn->privateData; - virCapsPtr caps = virLXCDriverGetCapabilities(driver, false); + virDomainDef *def = NULL; + virLXCDriver *driver = conn->privateData; + virCaps *caps = virLXCDriverGetCapabilities(driver, false); virCheckFlags(0, NULL); @@ -978,11 +978,11 @@ static int lxcDomainCreateWithFiles(virDomainPtr dom, int *files, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virObjectEventPtr event = NULL; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm; + virObjectEvent *event = NULL; int ret = -1; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); virCheckFlags(VIR_DOMAIN_START_AUTODESTROY, -1); @@ -1080,13 +1080,13 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn, int *files, unsigned int flags) { - virLXCDriverPtr driver = conn->privateData; - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; + virLXCDriver *driver = conn->privateData; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; virDomainPtr dom = NULL; - virObjectEventPtr event = NULL; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); - virCapsPtr caps = NULL; + virObjectEvent *event = NULL; + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); + virCaps *caps = NULL; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; virCheckFlags(VIR_DOMAIN_START_AUTODESTROY | @@ -1183,8 +1183,8 @@ lxcDomainCreateXML(virConnectPtr conn, static int lxcDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr seclabel) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; memset(seclabel, 0, sizeof(*seclabel)); @@ -1202,7 +1202,7 @@ static int lxcDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secla * * Comment from Dan Berrange: * - * Well the PID as stored in the virDomainObjPtr can't be changed + * Well the PID as stored in the virDomainObj *can't be changed * because you've got a locked object. The OS level PID could have * exited, though and in extreme circumstances have cycled through all * PIDs back to ours. We could sanity check that our PID still exists @@ -1210,7 +1210,7 @@ static int lxcDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secla * LXC monitor hasn't seen SIGHUP/ERR on poll(). */ if (virDomainObjIsActive(vm)) { - virLXCDomainObjPrivatePtr priv = vm->privateData; + virLXCDomainObjPrivate *priv = vm->privateData; if (!priv->initpid) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", @@ -1234,8 +1234,8 @@ static int lxcDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secla static int lxcNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr secmodel) { - virLXCDriverPtr driver = conn->privateData; - virCapsPtr caps = NULL; + virLXCDriver *driver = conn->privateData; + virCaps *caps = NULL; int ret = 0; memset(secmodel, 0, sizeof(*secmodel)); @@ -1281,7 +1281,7 @@ lxcConnectDomainEventRegister(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - virLXCDriverPtr driver = conn->privateData; + virLXCDriver *driver = conn->privateData; if (virConnectDomainEventRegisterEnsureACL(conn) < 0) return -1; @@ -1299,7 +1299,7 @@ static int lxcConnectDomainEventDeregister(virConnectPtr conn, virConnectDomainEventCallback callback) { - virLXCDriverPtr driver = conn->privateData; + virLXCDriver *driver = conn->privateData; if (virConnectDomainEventDeregisterEnsureACL(conn) < 0) return -1; @@ -1321,7 +1321,7 @@ lxcConnectDomainEventRegisterAny(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - virLXCDriverPtr driver = conn->privateData; + virLXCDriver *driver = conn->privateData; int ret; if (virConnectDomainEventRegisterAnyEnsureACL(conn) < 0) @@ -1341,7 +1341,7 @@ static int lxcConnectDomainEventDeregisterAny(virConnectPtr conn, int callbackID) { - virLXCDriverPtr driver = conn->privateData; + virLXCDriver *driver = conn->privateData; if (virConnectDomainEventDeregisterAnyEnsureACL(conn) < 0) return -1; @@ -1368,11 +1368,11 @@ static int lxcDomainDestroyFlags(virDomainPtr dom, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virObjectEventPtr event = NULL; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm; + virObjectEvent *event = NULL; int ret = -1; - virLXCDomainObjPrivatePtr priv; + virLXCDomainObjPrivate *priv; virCheckFlags(0, -1); @@ -1437,11 +1437,11 @@ static int lxcCheckNetNsSupport(void) } -static virSecurityManagerPtr -lxcSecurityInit(virLXCDriverConfigPtr cfg) +static virSecurityManager * +lxcSecurityInit(virLXCDriverConfig *cfg) { unsigned int flags = VIR_SECURITY_MANAGER_PRIVILEGED; - virSecurityManagerPtr mgr; + virSecurityManager *mgr; VIR_INFO("lxcSecurityInit %s", cfg->securityDriverName); @@ -1469,7 +1469,7 @@ static int lxcStateInitialize(bool privileged, virStateInhibitCallback callback G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { - virLXCDriverConfigPtr cfg = NULL; + virLXCDriverConfig *cfg = NULL; bool autostart = true; const char *defsecmodel; @@ -1577,12 +1577,12 @@ static int lxcStateInitialize(bool privileged, return VIR_DRV_STATE_INIT_ERROR; } -static void lxcNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque) +static void lxcNotifyLoadDomain(virDomainObj *vm, int newVM, void *opaque) { - virLXCDriverPtr driver = opaque; + virLXCDriver *driver = opaque; if (newVM) { - virObjectEventPtr event = + virObjectEvent *event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_DEFINED, VIR_DOMAIN_EVENT_DEFINED_ADDED); @@ -1599,7 +1599,7 @@ static void lxcNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque) static int lxcStateReload(void) { - virLXCDriverConfigPtr cfg = NULL; + virLXCDriverConfig *cfg = NULL; if (!lxc_driver) return 0; @@ -1697,7 +1697,7 @@ lxcDomainInterfaceAddresses(virDomainPtr dom, unsigned int source, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; virCheckFlags(0, -1); @@ -1747,8 +1747,8 @@ static char *lxcDomainGetSchedulerType(virDomainPtr dom, int *nparams) { char *ret = NULL; - virDomainObjPtr vm; - virLXCDomainObjPrivatePtr priv; + virDomainObj *vm; + virLXCDomainObjPrivate *priv; if (!(vm = lxcDomObjFromDomain(dom))) goto cleanup; @@ -1788,14 +1788,14 @@ static char *lxcDomainGetSchedulerType(virDomainPtr dom, static int -lxcGetVcpuBWLive(virCgroupPtr cgroup, unsigned long long *period, +lxcGetVcpuBWLive(virCgroup *cgroup, unsigned long long *period, long long *quota) { return virCgroupGetCpuPeriodQuota(cgroup, period, quota); } -static int lxcSetVcpuBWLive(virCgroupPtr cgroup, unsigned long long period, +static int lxcSetVcpuBWLive(virCgroup *cgroup, unsigned long long period, long long quota) { return virCgroupSetupCpuPeriodQuota(cgroup, period, quota); @@ -1808,17 +1808,17 @@ lxcDomainSetSchedulerParametersFlags(virDomainPtr dom, int nparams, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virCapsPtr caps = NULL; + virLXCDriver *driver = dom->conn->privateData; + virCaps *caps = NULL; size_t i; - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDefCopy = NULL; - virDomainDefPtr persistentDef = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virDomainDef *persistentDefCopy = NULL; + virDomainDef *persistentDef = NULL; int ret = -1; int rc; - virLXCDomainObjPrivatePtr priv; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDomainObjPrivate *priv; + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -1948,9 +1948,9 @@ lxcDomainGetSchedulerParametersFlags(virDomainPtr dom, int *nparams, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def; - virDomainDefPtr persistentDef; + virDomainObj *vm = NULL; + virDomainDef *def; + virDomainDef *persistentDef; unsigned long long shares = 0; unsigned long long period = 0; long long quota = 0; @@ -1958,7 +1958,7 @@ lxcDomainGetSchedulerParametersFlags(virDomainPtr dom, int rc; bool cpu_bw_status = false; int saved_nparams = 0; - virLXCDomainObjPrivatePtr priv; + virLXCDomainObjPrivate *priv; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG | @@ -2052,11 +2052,11 @@ lxcDomainBlockStats(virDomainPtr dom, const char *path, virDomainBlockStatsPtr stats) { - virLXCDriverPtr driver = dom->conn->privateData; + virLXCDriver *driver = dom->conn->privateData; int ret = -1; - virDomainObjPtr vm; - virDomainDiskDefPtr disk = NULL; - virLXCDomainObjPrivatePtr priv; + virDomainObj *vm; + virDomainDiskDef *disk = NULL; + virLXCDomainObjPrivate *priv; if (!(vm = lxcDomObjFromDomain(dom))) return ret; @@ -2123,11 +2123,11 @@ lxcDomainBlockStatsFlags(virDomainPtr dom, int * nparams, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; + virLXCDriver *driver = dom->conn->privateData; int tmp, ret = -1; - virDomainObjPtr vm; - virDomainDiskDefPtr disk = NULL; - virLXCDomainObjPrivatePtr priv; + virDomainObj *vm; + virDomainDiskDef *disk = NULL; + virLXCDomainObjPrivate *priv; long long rd_req, rd_bytes, wr_req, wr_bytes; virTypedParameterPtr param; @@ -2250,13 +2250,13 @@ lxcDomainSetBlkioParameters(virDomainPtr dom, int nparams, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; int ret = -1; - virLXCDriverConfigPtr cfg = NULL; - virLXCDomainObjPrivatePtr priv; + virLXCDriverConfig *cfg = NULL; + virLXCDomainObjPrivate *priv; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -2333,13 +2333,13 @@ lxcDomainGetBlkioParameters(virDomainPtr dom, int *nparams, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; int maxparams = LXC_NB_BLKIO_PARAM; unsigned int val; int ret = -1; - virLXCDomainObjPrivatePtr priv; + virLXCDomainObjPrivate *priv; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG | @@ -2417,10 +2417,10 @@ lxcDomainInterfaceStats(virDomainPtr dom, const char *device, virDomainInterfaceStatsPtr stats) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; - virLXCDriverPtr driver = dom->conn->privateData; - virDomainNetDefPtr net = NULL; + virLXCDriver *driver = dom->conn->privateData; + virDomainNetDef *net = NULL; if (!(vm = lxcDomObjFromDomain(dom))) goto cleanup; @@ -2455,7 +2455,7 @@ lxcDomainInterfaceStats(virDomainPtr dom, static int lxcDomainGetAutostart(virDomainPtr dom, int *autostart) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (!(vm = lxcDomObjFromDomain(dom))) @@ -2475,12 +2475,12 @@ static int lxcDomainGetAutostart(virDomainPtr dom, static int lxcDomainSetAutostart(virDomainPtr dom, int autostart) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm; g_autofree char *configFile = NULL; g_autofree char *autostartLink = NULL; int ret = -1; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); if (!(vm = lxcDomObjFromDomain(dom))) goto cleanup; @@ -2548,14 +2548,14 @@ static int lxcDomainSetAutostart(virDomainPtr dom, return ret; } -static int lxcFreezeContainer(virDomainObjPtr vm) +static int lxcFreezeContainer(virDomainObj *vm) { int timeout = 1000; /* In milliseconds */ int check_interval = 1; /* In milliseconds */ int exp = 10; int waited_time = 0; g_autofree char *state = NULL; - virLXCDomainObjPrivatePtr priv = vm->privateData; + virLXCDomainObjPrivate *priv = vm->privateData; while (waited_time < timeout) { int r; @@ -2628,11 +2628,11 @@ static int lxcFreezeContainer(virDomainObjPtr vm) static int lxcDomainSuspend(virDomainPtr dom) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virObjectEventPtr event = NULL; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm; + virObjectEvent *event = NULL; int ret = -1; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); if (!(vm = lxcDomObjFromDomain(dom))) goto cleanup; @@ -2675,13 +2675,13 @@ static int lxcDomainSuspend(virDomainPtr dom) static int lxcDomainResume(virDomainPtr dom) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virObjectEventPtr event = NULL; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm; + virObjectEvent *event = NULL; int ret = -1; int state; - virLXCDomainObjPrivatePtr priv; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDomainObjPrivate *priv; + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); if (!(vm = lxcDomObjFromDomain(dom))) goto cleanup; @@ -2736,9 +2736,9 @@ lxcDomainOpenConsole(virDomainPtr dom, virStreamPtr st, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; - virDomainChrDefPtr chr = NULL; + virDomainChrDef *chr = NULL; size_t i; virCheckFlags(0, -1); @@ -2798,9 +2798,9 @@ lxcDomainSendProcessSignal(virDomainPtr dom, unsigned int signum, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - virLXCDomainObjPrivatePtr priv; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + virLXCDomainObjPrivate *priv; pid_t victim; int ret = -1; @@ -2873,7 +2873,7 @@ lxcConnectListAllDomains(virConnectPtr conn, virDomainPtr **domains, unsigned int flags) { - virLXCDriverPtr driver = conn->privateData; + virLXCDriver *driver = conn->privateData; virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1); @@ -2889,9 +2889,9 @@ static int lxcDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virLXCDomainObjPrivatePtr priv; - virDomainObjPtr vm; + virLXCDriver *driver = dom->conn->privateData; + virLXCDomainObjPrivate *priv; + virDomainObj *vm; int ret = -1; int rc = -1; @@ -2965,9 +2965,9 @@ static int lxcDomainReboot(virDomainPtr dom, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virLXCDomainObjPrivatePtr priv; - virDomainObjPtr vm; + virLXCDriver *driver = dom->conn->privateData; + virLXCDomainObjPrivate *priv; + virDomainObj *vm; int ret = -1; int rc = -1; @@ -3032,13 +3032,13 @@ lxcDomainReboot(virDomainPtr dom, static int -lxcDomainAttachDeviceConfig(virDomainDefPtr vmdef, - virDomainDeviceDefPtr dev) +lxcDomainAttachDeviceConfig(virDomainDef *vmdef, + virDomainDeviceDef *dev) { int ret = -1; - virDomainDiskDefPtr disk; - virDomainNetDefPtr net; - virDomainHostdevDefPtr hostdev; + virDomainDiskDef *disk; + virDomainNetDef *net; + virDomainHostdevDef *hostdev; switch (dev->type) { case VIR_DOMAIN_DEVICE_DISK: @@ -3086,11 +3086,11 @@ lxcDomainAttachDeviceConfig(virDomainDefPtr vmdef, static int -lxcDomainUpdateDeviceConfig(virDomainDefPtr vmdef, - virDomainDeviceDefPtr dev) +lxcDomainUpdateDeviceConfig(virDomainDef *vmdef, + virDomainDeviceDef *dev) { int ret = -1; - virDomainNetDefPtr net; + virDomainNetDef *net; virDomainDeviceDef oldDev = { .type = dev->type }; int idx; @@ -3126,15 +3126,15 @@ lxcDomainUpdateDeviceConfig(virDomainDefPtr vmdef, static int -lxcDomainDetachDeviceConfig(virDomainDefPtr vmdef, - virDomainDeviceDefPtr dev) +lxcDomainDetachDeviceConfig(virDomainDef *vmdef, + virDomainDeviceDef *dev) { int ret = -1; - virDomainDiskDefPtr disk; - virDomainDiskDefPtr det_disk; - virDomainNetDefPtr net; - virDomainHostdevDefPtr hostdev; - virDomainHostdevDefPtr det_hostdev; + virDomainDiskDef *disk; + virDomainDiskDef *det_disk; + virDomainNetDef *net; + virDomainHostdevDef *hostdev; + virDomainHostdevDef *det_hostdev; int idx; switch (dev->type) { @@ -3183,11 +3183,11 @@ lxcDomainDetachDeviceConfig(virDomainDefPtr vmdef, struct lxcDomainAttachDeviceMknodData { - virLXCDriverPtr driver; + virLXCDriver *driver; mode_t mode; dev_t dev; - virDomainObjPtr vm; - virDomainDeviceDefPtr def; + virDomainObj *vm; + virDomainDeviceDef *def; char *file; }; @@ -3229,7 +3229,7 @@ lxcDomainAttachDeviceMknodHelper(pid_t pid G_GNUC_UNUSED, * to actually label the dst here, so hack the config */ switch (data->def->type) { case VIR_DOMAIN_DEVICE_DISK: { - virDomainDiskDefPtr def = data->def->data.disk; + virDomainDiskDef *def = data->def->data.disk; char *tmpsrc = def->src->path; def->src->path = data->file; if (virSecurityManagerSetImageLabel(data->driver->securityManager, @@ -3242,7 +3242,7 @@ lxcDomainAttachDeviceMknodHelper(pid_t pid G_GNUC_UNUSED, } break; case VIR_DOMAIN_DEVICE_HOSTDEV: { - virDomainHostdevDefPtr def = data->def->data.hostdev; + virDomainHostdevDef *def = data->def->data.hostdev; if (virSecurityManagerSetHostdevLabel(data->driver->securityManager, data->vm->def, def, NULL) < 0) goto cleanup; @@ -3265,14 +3265,14 @@ lxcDomainAttachDeviceMknodHelper(pid_t pid G_GNUC_UNUSED, static int -lxcDomainAttachDeviceMknod(virLXCDriverPtr driver, +lxcDomainAttachDeviceMknod(virLXCDriver *driver, mode_t mode, dev_t dev, - virDomainObjPtr vm, - virDomainDeviceDefPtr def, + virDomainObj *vm, + virDomainDeviceDef *def, char *file) { - virLXCDomainObjPrivatePtr priv = vm->privateData; + virLXCDomainObjPrivate *priv = vm->privateData; struct lxcDomainAttachDeviceMknodData data; memset(&data, 0, sizeof(data)); @@ -3317,10 +3317,10 @@ lxcDomainAttachDeviceUnlinkHelper(pid_t pid G_GNUC_UNUSED, static int -lxcDomainAttachDeviceUnlink(virDomainObjPtr vm, +lxcDomainAttachDeviceUnlink(virDomainObj *vm, char *file) { - virLXCDomainObjPrivatePtr priv = vm->privateData; + virLXCDomainObjPrivate *priv = vm->privateData; if (virProcessRunInMountNamespace(priv->initpid, lxcDomainAttachDeviceUnlinkHelper, @@ -3333,12 +3333,12 @@ lxcDomainAttachDeviceUnlink(virDomainObjPtr vm, static int -lxcDomainAttachDeviceDiskLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainAttachDeviceDiskLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { - virLXCDomainObjPrivatePtr priv = vm->privateData; - virDomainDiskDefPtr def = dev->data.disk; + virLXCDomainObjPrivate *priv = vm->privateData; + virDomainDiskDef *def = dev->data.disk; int ret = -1; struct stat sb; g_autofree char *file = NULL; @@ -3401,7 +3401,7 @@ lxcDomainAttachDeviceDiskLive(virLXCDriverPtr driver, perms) < 0) goto cleanup; - vm->def->disks = g_renew(virDomainDiskDefPtr, + vm->def->disks = g_renew(virDomainDiskDef *, vm->def->disks, vm->def->ndisks + 1); @@ -3435,11 +3435,11 @@ lxcDomainAttachDeviceDiskLive(virLXCDriverPtr driver, static int -lxcDomainAttachDeviceNetLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainNetDefPtr net) +lxcDomainAttachDeviceNetLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainNetDef *net) { - virLXCDomainObjPrivatePtr priv = vm->privateData; + virLXCDomainObjPrivate *priv = vm->privateData; int ret = -1; virDomainNetType actualType; const virNetDevBandwidth *actualBandwidth; @@ -3455,7 +3455,7 @@ lxcDomainAttachDeviceNetLive(virLXCDriverPtr driver, return -1; /* preallocate new slot for device */ - vm->def->nets = g_renew(virDomainNetDefPtr, + vm->def->nets = g_renew(virDomainNetDef *, vm->def->nets, vm->def->nnets + 1); @@ -3571,17 +3571,17 @@ lxcDomainAttachDeviceNetLive(virLXCDriverPtr driver, static int -lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { - virLXCDomainObjPrivatePtr priv = vm->privateData; - virDomainHostdevDefPtr def = dev->data.hostdev; + virLXCDomainObjPrivate *priv = vm->privateData; + virDomainHostdevDef *def = dev->data.hostdev; int ret = -1; g_autofree char *src = NULL; struct stat sb; - virUSBDevicePtr usb = NULL; - virDomainHostdevSubsysUSBPtr usbsrc; + virUSBDevice *usb = NULL; + virDomainHostdevSubsysUSB *usbsrc; if (virDomainHostdevFind(vm->def, def, NULL) >= 0) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", @@ -3608,7 +3608,7 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver, goto cleanup; } - vm->def->hostdevs = g_renew(virDomainHostdevDefPtr, + vm->def->hostdevs = g_renew(virDomainHostdevDef *, vm->def->hostdevs, vm->def->nhostdevs + 1); @@ -3643,12 +3643,12 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver, static int -lxcDomainAttachDeviceHostdevStorageLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainAttachDeviceHostdevStorageLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { - virLXCDomainObjPrivatePtr priv = vm->privateData; - virDomainHostdevDefPtr def = dev->data.hostdev; + virLXCDomainObjPrivate *priv = vm->privateData; + virDomainHostdevDef *def = dev->data.hostdev; int ret = -1; struct stat sb; @@ -3678,7 +3678,7 @@ lxcDomainAttachDeviceHostdevStorageLive(virLXCDriverPtr driver, goto cleanup; } - vm->def->hostdevs = g_renew(virDomainHostdevDefPtr, + vm->def->hostdevs = g_renew(virDomainHostdevDef *, vm->def->hostdevs, vm->def->nhostdevs + 1); @@ -3716,12 +3716,12 @@ lxcDomainAttachDeviceHostdevStorageLive(virLXCDriverPtr driver, static int -lxcDomainAttachDeviceHostdevMiscLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainAttachDeviceHostdevMiscLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { - virLXCDomainObjPrivatePtr priv = vm->privateData; - virDomainHostdevDefPtr def = dev->data.hostdev; + virLXCDomainObjPrivate *priv = vm->privateData; + virDomainHostdevDef *def = dev->data.hostdev; int ret = -1; struct stat sb; @@ -3758,7 +3758,7 @@ lxcDomainAttachDeviceHostdevMiscLive(virLXCDriverPtr driver, VIR_CGROUP_DEVICE_RWM) < 0) goto cleanup; - vm->def->hostdevs = g_renew(virDomainHostdevDefPtr, + vm->def->hostdevs = g_renew(virDomainHostdevDef *, vm->def->hostdevs, vm->def->nhostdevs + 1); @@ -3789,9 +3789,9 @@ lxcDomainAttachDeviceHostdevMiscLive(virLXCDriverPtr driver, static int -lxcDomainAttachDeviceHostdevSubsysLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainAttachDeviceHostdevSubsysLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { switch (dev->data.hostdev->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: @@ -3807,9 +3807,9 @@ lxcDomainAttachDeviceHostdevSubsysLive(virLXCDriverPtr driver, static int -lxcDomainAttachDeviceHostdevCapsLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainAttachDeviceHostdevCapsLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { switch (dev->data.hostdev->source.caps.type) { case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE: @@ -3828,11 +3828,11 @@ lxcDomainAttachDeviceHostdevCapsLive(virLXCDriverPtr driver, static int -lxcDomainAttachDeviceHostdevLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainAttachDeviceHostdevLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { - virLXCDomainObjPrivatePtr priv = vm->privateData; + virLXCDomainObjPrivate *priv = vm->privateData; if (!priv->initpid) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", @@ -3863,9 +3863,9 @@ lxcDomainAttachDeviceHostdevLive(virLXCDriverPtr driver, static int -lxcDomainAttachDeviceLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainAttachDeviceLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { int ret = -1; @@ -3901,11 +3901,11 @@ lxcDomainAttachDeviceLive(virLXCDriverPtr driver, static int -lxcDomainDetachDeviceDiskLive(virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainDetachDeviceDiskLive(virDomainObj *vm, + virDomainDeviceDef *dev) { - virLXCDomainObjPrivatePtr priv = vm->privateData; - virDomainDiskDefPtr def = NULL; + virLXCDomainObjPrivate *priv = vm->privateData; + virDomainDiskDef *def = NULL; int idx; g_autofree char *dst = NULL; const char *src; @@ -3954,12 +3954,12 @@ lxcDomainDetachDeviceDiskLive(virDomainObjPtr vm, static int -lxcDomainDetachDeviceNetLive(virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainDetachDeviceNetLive(virDomainObj *vm, + virDomainDeviceDef *dev) { int detachidx, ret = -1; virDomainNetType actualType; - virDomainNetDefPtr detach = NULL; + virDomainNetDef *detach = NULL; const virNetDevVPortProfile *vport = NULL; virErrorPtr save_err = NULL; @@ -4039,17 +4039,17 @@ lxcDomainDetachDeviceNetLive(virDomainObjPtr vm, static int -lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainDetachDeviceHostdevUSBLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { - virLXCDomainObjPrivatePtr priv = vm->privateData; - virDomainHostdevDefPtr def = NULL; + virLXCDomainObjPrivate *priv = vm->privateData; + virDomainHostdevDef *def = NULL; int idx, ret = -1; g_autofree char *dst = NULL; - virUSBDevicePtr usb = NULL; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; - virDomainHostdevSubsysUSBPtr usbsrc; + virUSBDevice *usb = NULL; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; + virDomainHostdevSubsysUSB *usbsrc; if ((idx = virDomainHostdevFind(vm->def, dev->data.hostdev, @@ -4099,11 +4099,11 @@ lxcDomainDetachDeviceHostdevUSBLive(virLXCDriverPtr driver, static int -lxcDomainDetachDeviceHostdevStorageLive(virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainDetachDeviceHostdevStorageLive(virDomainObj *vm, + virDomainDeviceDef *dev) { - virLXCDomainObjPrivatePtr priv = vm->privateData; - virDomainHostdevDefPtr def = NULL; + virLXCDomainObjPrivate *priv = vm->privateData; + virDomainHostdevDef *def = NULL; int idx; if (!priv->initpid) { @@ -4146,11 +4146,11 @@ lxcDomainDetachDeviceHostdevStorageLive(virDomainObjPtr vm, static int -lxcDomainDetachDeviceHostdevMiscLive(virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainDetachDeviceHostdevMiscLive(virDomainObj *vm, + virDomainDeviceDef *dev) { - virLXCDomainObjPrivatePtr priv = vm->privateData; - virDomainHostdevDefPtr def = NULL; + virLXCDomainObjPrivate *priv = vm->privateData; + virDomainHostdevDef *def = NULL; int idx; if (!priv->initpid) { @@ -4193,9 +4193,9 @@ lxcDomainDetachDeviceHostdevMiscLive(virDomainObjPtr vm, static int -lxcDomainDetachDeviceHostdevSubsysLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainDetachDeviceHostdevSubsysLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { switch (dev->data.hostdev->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: @@ -4211,8 +4211,8 @@ lxcDomainDetachDeviceHostdevSubsysLive(virLXCDriverPtr driver, static int -lxcDomainDetachDeviceHostdevCapsLive(virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainDetachDeviceHostdevCapsLive(virDomainObj *vm, + virDomainDeviceDef *dev) { switch (dev->data.hostdev->source.caps.type) { case VIR_DOMAIN_HOSTDEV_CAPS_TYPE_STORAGE: @@ -4231,11 +4231,11 @@ lxcDomainDetachDeviceHostdevCapsLive(virDomainObjPtr vm, static int -lxcDomainDetachDeviceHostdevLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainDetachDeviceHostdevLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { - virLXCDomainObjPrivatePtr priv = vm->privateData; + virLXCDomainObjPrivate *priv = vm->privateData; if (!priv->initpid) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", @@ -4260,9 +4260,9 @@ lxcDomainDetachDeviceHostdevLive(virLXCDriverPtr driver, static int -lxcDomainDetachDeviceLive(virLXCDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +lxcDomainDetachDeviceLive(virLXCDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { int ret = -1; @@ -4294,13 +4294,13 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom, const char *xml, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - virDomainDefPtr vmdef = NULL; - virDomainDeviceDefPtr dev = NULL; - virDomainDeviceDefPtr dev_copy = NULL; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + virDomainDef *vmdef = NULL; + virDomainDeviceDef *dev = NULL; + virDomainDeviceDef *dev_copy = NULL; int ret = -1; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -4404,12 +4404,12 @@ static int lxcDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - virDomainDefPtr vmdef = NULL; - virDomainDeviceDefPtr dev = NULL; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + virDomainDef *vmdef = NULL; + virDomainDeviceDef *dev = NULL; int ret = -1; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -4468,14 +4468,14 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom, const char *xml, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virCapsPtr caps = NULL; - virDomainObjPtr vm = NULL; - virDomainDefPtr vmdef = NULL; - virDomainDeviceDefPtr dev = NULL; - virDomainDeviceDefPtr dev_copy = NULL; + virLXCDriver *driver = dom->conn->privateData; + virCaps *caps = NULL; + virDomainObj *vm = NULL; + virDomainDef *vmdef = NULL; + virDomainDeviceDef *dev = NULL; + virDomainDeviceDef *dev_copy = NULL; int ret = -1; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -4574,9 +4574,9 @@ static int lxcDomainLxcOpenNamespace(virDomainPtr dom, int **fdlist, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virLXCDomainObjPrivatePtr priv; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm; + virLXCDomainObjPrivate *priv; int ret = -1; size_t nfds = 0; @@ -4620,7 +4620,7 @@ static int lxcDomainLxcOpenNamespace(virDomainPtr dom, static char * lxcConnectGetSysinfo(virConnectPtr conn, unsigned int flags) { - virLXCDriverPtr driver = conn->privateData; + virLXCDriver *driver = conn->privateData; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; virCheckFlags(0, NULL); @@ -4657,12 +4657,12 @@ lxcDomainMemoryStats(virDomainPtr dom, unsigned int nr_stats, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; - virLXCDomainObjPrivatePtr priv; + virLXCDomainObjPrivate *priv; unsigned long long swap_usage; unsigned long mem_usage; - virLXCDriverPtr driver = dom->conn->privateData; + virLXCDriver *driver = dom->conn->privateData; virCheckFlags(0, -1); @@ -4828,9 +4828,9 @@ lxcDomainSetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virLXCDriverConfigPtr cfg = NULL; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm; + virLXCDriverConfig *cfg = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -4852,7 +4852,7 @@ lxcDomainSetMetadata(virDomainPtr dom, cfg->configDir, flags); if (ret == 0) { - virObjectEventPtr ev = NULL; + virObjectEvent *ev = NULL; ev = virDomainEventMetadataChangeNewFromObj(vm, type, uri); virObjectEventStateQueue(driver->domainEventState, ev); } @@ -4872,7 +4872,7 @@ lxcDomainGetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; char *ret = NULL; if (!(vm = lxcDomObjFromDomain(dom))) @@ -4897,9 +4897,9 @@ lxcDomainGetCPUStats(virDomainPtr dom, unsigned int ncpus, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; - virLXCDomainObjPrivatePtr priv; + virLXCDomainObjPrivate *priv; virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); @@ -4936,8 +4936,8 @@ static char * lxcDomainGetHostname(virDomainPtr dom, unsigned int flags) { - virLXCDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virLXCDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; char macaddr[VIR_MAC_STRING_BUFLEN]; g_autoptr(virConnect) conn = NULL; size_t i, j; @@ -4962,7 +4962,7 @@ lxcDomainGetHostname(virDomainPtr dom, for (i = 0; i < vm->def->nnets; i++) { g_autoptr(virNetwork) network = NULL; - virDomainNetDefPtr net = vm->def->nets[i]; + virDomainNetDef *net = vm->def->nets[i]; g_autofree virNetworkDHCPLeasePtr *leases = NULL; int n_leases; @@ -5050,7 +5050,7 @@ lxcNodeAllocPages(virConnectPtr conn, static int lxcDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; virCheckFlags(0, -1); diff --git a/src/lxc/lxc_fuse.c b/src/lxc/lxc_fuse.c index 10ddd59a99..c2fe8f0e60 100644 --- a/src/lxc/lxc_fuse.c +++ b/src/lxc/lxc_fuse.c @@ -44,7 +44,7 @@ static int lxcProcGetattr(const char *path, struct stat *stbuf) g_autofree char *mempath = NULL; struct stat sb; struct fuse_context *context = fuse_get_context(); - virDomainDefPtr def = (virDomainDefPtr)context->private_data; + virDomainDef *def = (virDomainDef *)context->private_data; memset(stbuf, 0, sizeof(struct stat)); mempath = g_strdup_printf("/proc/%s", path); @@ -116,7 +116,7 @@ static int lxcProcHostRead(char *path, char *buf, size_t size, off_t offset) return res; } -static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def, +static int lxcProcReadMeminfo(char *hostpath, virDomainDef *def, char *buf, size_t size, off_t offset) { int res; @@ -125,7 +125,7 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def, size_t n; struct virLXCMeminfo meminfo; g_auto(virBuffer) buffer = VIR_BUFFER_INITIALIZER; - virBufferPtr new_meminfo = &buffer; + virBuffer *new_meminfo = &buffer; if (virLXCCgroupGetMeminfo(&meminfo) < 0) { virErrorSetErrnoFromLastError(); @@ -236,12 +236,12 @@ static int lxcProcRead(const char *path G_GNUC_UNUSED, int res = -ENOENT; g_autofree char *hostpath = NULL; struct fuse_context *context = NULL; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; hostpath = g_strdup_printf("/proc/%s", path); context = fuse_get_context(); - def = (virDomainDefPtr)context->private_data; + def = (virDomainDef *)context->private_data; if (STREQ(path, fuse_meminfo_path)) { if ((res = lxcProcReadMeminfo(hostpath, def, buf, size, offset)) < 0) @@ -258,7 +258,7 @@ static struct fuse_operations lxcProcOper = { .read = lxcProcRead, }; -static void lxcFuseDestroy(virLXCFusePtr fuse) +static void lxcFuseDestroy(struct virLXCFuse *fuse) { virMutexLock(&fuse->lock); fuse_unmount(fuse->mountpoint, fuse->ch); @@ -269,7 +269,7 @@ static void lxcFuseDestroy(virLXCFusePtr fuse) static void lxcFuseRun(void *opaque) { - virLXCFusePtr fuse = opaque; + struct virLXCFuse *fuse = opaque; if (fuse_loop(fuse->fuse) < 0) virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -278,11 +278,11 @@ static void lxcFuseRun(void *opaque) lxcFuseDestroy(fuse); } -int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def) +int lxcSetupFuse(struct virLXCFuse **f, virDomainDef *def) { int ret = -1; struct fuse_args args = FUSE_ARGS_INIT(0, NULL); - virLXCFusePtr fuse = g_new0(virLXCFuse, 1); + struct virLXCFuse *fuse = g_new0(virLXCFuse, 1); fuse->def = def; @@ -328,7 +328,7 @@ int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def) goto cleanup; } -int lxcStartFuse(virLXCFusePtr fuse) +int lxcStartFuse(struct virLXCFuse *fuse) { if (virThreadCreateFull(&fuse->thread, false, lxcFuseRun, "lxc-fuse", false, (void *)fuse) < 0) { @@ -339,9 +339,9 @@ int lxcStartFuse(virLXCFusePtr fuse) return 0; } -void lxcFreeFuse(virLXCFusePtr *f) +void lxcFreeFuse(struct virLXCFuse **f) { - virLXCFusePtr fuse = *f; + struct virLXCFuse *fuse = *f; /* lxcFuseRun thread create success */ if (fuse) { /* exit fuse_loop, lxcFuseRun thread may try to destroy @@ -356,18 +356,18 @@ void lxcFreeFuse(virLXCFusePtr *f) } } #else -int lxcSetupFuse(virLXCFusePtr *f G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED) +int lxcSetupFuse(struct virLXCFuse **f G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED) { return 0; } -int lxcStartFuse(virLXCFusePtr f G_GNUC_UNUSED) +int lxcStartFuse(struct virLXCFuse *f G_GNUC_UNUSED) { return 0; } -void lxcFreeFuse(virLXCFusePtr *f G_GNUC_UNUSED) +void lxcFreeFuse(struct virLXCFuse **f G_GNUC_UNUSED) { } #endif diff --git a/src/lxc/lxc_fuse.h b/src/lxc/lxc_fuse.h index 6bba5669a8..54a0a74155 100644 --- a/src/lxc/lxc_fuse.h +++ b/src/lxc/lxc_fuse.h @@ -40,10 +40,9 @@ struct virLXCMeminfo { unsigned long long swaptotal; unsigned long long swapusage; }; -typedef struct virLXCMeminfo *virLXCMeminfoPtr; struct virLXCFuse { - virDomainDefPtr def; + virDomainDef *def; virThread thread; char *mountpoint; struct fuse *fuse; @@ -51,8 +50,7 @@ struct virLXCFuse { virMutex lock; }; typedef struct virLXCFuse virLXCFuse; -typedef struct virLXCFuse *virLXCFusePtr; -int lxcSetupFuse(virLXCFusePtr *f, virDomainDefPtr def); -int lxcStartFuse(virLXCFusePtr f); -void lxcFreeFuse(virLXCFusePtr *f); +int lxcSetupFuse(struct virLXCFuse **f, virDomainDef *def); +int lxcStartFuse(struct virLXCFuse *f); +void lxcFreeFuse(struct virLXCFuse **f); diff --git a/src/lxc/lxc_hostdev.c b/src/lxc/lxc_hostdev.c index 609fbe5c87..ceb637955b 100644 --- a/src/lxc/lxc_hostdev.c +++ b/src/lxc/lxc_hostdev.c @@ -31,10 +31,10 @@ VIR_LOG_INIT("lxc.lxc_hostdev"); int -virLXCUpdateActiveUSBHostdevs(virLXCDriverPtr driver, - virDomainDefPtr def) +virLXCUpdateActiveUSBHostdevs(virLXCDriver *driver, + virDomainDef *def) { - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; if (!def->nhostdevs) return 0; @@ -45,22 +45,22 @@ virLXCUpdateActiveUSBHostdevs(virLXCDriverPtr driver, } static int -virLXCPrepareHostUSBDevices(virLXCDriverPtr driver, - virDomainDefPtr def) +virLXCPrepareHostUSBDevices(virLXCDriver *driver, + virDomainDef *def) { - virDomainHostdevDefPtr *hostdevs = def->hostdevs; + virDomainHostdevDef **hostdevs = def->hostdevs; int nhostdevs = def->nhostdevs; const char *dom_name = def->name; unsigned int flags = 0; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; return virHostdevPrepareUSBDevices(hostdev_mgr, LXC_DRIVER_NAME, dom_name, hostdevs, nhostdevs, flags); } -int virLXCPrepareHostDevices(virLXCDriverPtr driver, - virDomainDefPtr def) +int virLXCPrepareHostDevices(virLXCDriver *driver, + virDomainDef *def) { size_t i; @@ -69,7 +69,7 @@ int virLXCPrepareHostDevices(virLXCDriverPtr driver, /* Sanity check for supported configurations only */ for (i = 0; i < def->nhostdevs; i++) { - virDomainHostdevDefPtr dev = def->hostdevs[i]; + virDomainHostdevDef *dev = def->hostdevs[i]; switch (dev->mode) { case VIR_DOMAIN_HOSTDEV_MODE_SUBSYS: @@ -115,19 +115,19 @@ int virLXCPrepareHostDevices(virLXCDriverPtr driver, static void -virLXCDomainReAttachHostUSBDevices(virLXCDriverPtr driver, +virLXCDomainReAttachHostUSBDevices(virLXCDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; virHostdevReAttachUSBDevices(hostdev_mgr, LXC_DRIVER_NAME, name, hostdevs, nhostdevs); } -void virLXCDomainReAttachHostDevices(virLXCDriverPtr driver, - virDomainDefPtr def) +void virLXCDomainReAttachHostDevices(virLXCDriver *driver, + virDomainDef *def) { if (!def->nhostdevs) return; diff --git a/src/lxc/lxc_hostdev.h b/src/lxc/lxc_hostdev.h index d2cdebddc8..34b813e3e9 100644 --- a/src/lxc/lxc_hostdev.h +++ b/src/lxc/lxc_hostdev.h @@ -24,15 +24,15 @@ #include "lxc_conf.h" #include "domain_conf.h" -int virLXCUpdateActiveUSBHostdevs(virLXCDriverPtr driver, - virDomainDefPtr def); -int virLXCFindHostdevUSBDevice(virDomainHostdevDefPtr hostdev, +int virLXCUpdateActiveUSBHostdevs(virLXCDriver *driver, + virDomainDef *def); +int virLXCFindHostdevUSBDevice(virDomainHostdevDef *hostdev, bool mandatory, - virUSBDevicePtr *usb); -int virLXCPrepareHostdevUSBDevices(virLXCDriverPtr driver, + virUSBDevice **usb); +int virLXCPrepareHostdevUSBDevices(virLXCDriver *driver, const char *name, - virUSBDeviceListPtr list); -int virLXCPrepareHostDevices(virLXCDriverPtr driver, - virDomainDefPtr def); -void virLXCDomainReAttachHostDevices(virLXCDriverPtr driver, - virDomainDefPtr def); + virUSBDeviceList *list); +int virLXCPrepareHostDevices(virLXCDriver *driver, + virDomainDef *def); +void virLXCDomainReAttachHostDevices(virLXCDriver *driver, + virDomainDef *def); diff --git a/src/lxc/lxc_monitor.c b/src/lxc/lxc_monitor.c index 4e7fa3422b..445bea281d 100644 --- a/src/lxc/lxc_monitor.c +++ b/src/lxc/lxc_monitor.c @@ -37,14 +37,14 @@ VIR_LOG_INIT("lxc.lxc_monitor"); struct _virLXCMonitor { virObjectLockable parent; - virDomainObjPtr vm; + virDomainObj *vm; virLXCMonitorCallbacks cb; - virNetClientPtr client; - virNetClientProgramPtr program; + virNetClient *client; + virNetClientProgram *program; }; -static virClassPtr virLXCMonitorClass; +static virClass *virLXCMonitorClass; static void virLXCMonitorDispose(void *obj); static int virLXCMonitorOnceInit(void) @@ -58,12 +58,12 @@ static int virLXCMonitorOnceInit(void) VIR_ONCE_GLOBAL_INIT(virLXCMonitor); static void -virLXCMonitorHandleEventExit(virNetClientProgramPtr prog, - virNetClientPtr client, +virLXCMonitorHandleEventExit(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -virLXCMonitorHandleEventInit(virNetClientProgramPtr prog, - virNetClientPtr client, +virLXCMonitorHandleEventInit(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static virNetClientProgramEvent virLXCMonitorEvents[] = { @@ -79,11 +79,11 @@ static virNetClientProgramEvent virLXCMonitorEvents[] = { static void -virLXCMonitorHandleEventExit(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +virLXCMonitorHandleEventExit(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { - virLXCMonitorPtr mon = opaque; + virLXCMonitor *mon = opaque; virLXCMonitorExitEventMsg *msg = evdata; VIR_DEBUG("Event exit %d", msg->status); @@ -93,11 +93,11 @@ virLXCMonitorHandleEventExit(virNetClientProgramPtr prog G_GNUC_UNUSED, static void -virLXCMonitorHandleEventInit(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +virLXCMonitorHandleEventInit(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { - virLXCMonitorPtr mon = opaque; + virLXCMonitor *mon = opaque; virLXCMonitorInitEventMsg *msg = evdata; VIR_DEBUG("Event init %lld", (long long)msg->initpid); @@ -106,13 +106,13 @@ virLXCMonitorHandleEventInit(virNetClientProgramPtr prog G_GNUC_UNUSED, } -static void virLXCMonitorEOFNotify(virNetClientPtr client G_GNUC_UNUSED, +static void virLXCMonitorEOFNotify(virNetClient *client G_GNUC_UNUSED, int reason G_GNUC_UNUSED, void *opaque) { - virLXCMonitorPtr mon = opaque; + virLXCMonitor *mon = opaque; virLXCMonitorCallbackEOFNotify eofNotify; - virDomainObjPtr vm; + virDomainObj *vm; VIR_DEBUG("EOF notify mon=%p", mon); virObjectLock(mon); @@ -131,16 +131,16 @@ static void virLXCMonitorEOFNotify(virNetClientPtr client G_GNUC_UNUSED, static void virLXCMonitorCloseFreeCallback(void *opaque) { - virLXCMonitorPtr mon = opaque; + virLXCMonitor *mon = opaque; virObjectUnref(mon); } -virLXCMonitorPtr virLXCMonitorNew(virDomainObjPtr vm, +virLXCMonitor *virLXCMonitorNew(virDomainObj *vm, const char *socketdir, - virLXCMonitorCallbacksPtr cb) + virLXCMonitorCallbacks *cb) { - virLXCMonitorPtr mon; + virLXCMonitor *mon; g_autofree char *sockpath = NULL; if (virLXCMonitorInitialize() < 0) @@ -188,7 +188,7 @@ virLXCMonitorPtr virLXCMonitorNew(virDomainObjPtr vm, static void virLXCMonitorDispose(void *opaque) { - virLXCMonitorPtr mon = opaque; + virLXCMonitor *mon = opaque; VIR_DEBUG("mon=%p", mon); if (mon->cb.destroy) @@ -198,10 +198,10 @@ static void virLXCMonitorDispose(void *opaque) } -void virLXCMonitorClose(virLXCMonitorPtr mon) +void virLXCMonitorClose(virLXCMonitor *mon) { - virDomainObjPtr vm; - virNetClientPtr client; + virDomainObj *vm; + virNetClient *client; VIR_DEBUG("mon=%p", mon); if (mon->client) { diff --git a/src/lxc/lxc_monitor.h b/src/lxc/lxc_monitor.h index 6d0944c301..5b5954f8e9 100644 --- a/src/lxc/lxc_monitor.h +++ b/src/lxc/lxc_monitor.h @@ -25,23 +25,21 @@ #include "lxc_monitor_protocol.h" typedef struct _virLXCMonitor virLXCMonitor; -typedef virLXCMonitor *virLXCMonitorPtr; typedef struct _virLXCMonitorCallbacks virLXCMonitorCallbacks; -typedef virLXCMonitorCallbacks *virLXCMonitorCallbacksPtr; -typedef void (*virLXCMonitorCallbackDestroy)(virLXCMonitorPtr mon, - virDomainObjPtr vm); -typedef void (*virLXCMonitorCallbackEOFNotify)(virLXCMonitorPtr mon, - virDomainObjPtr vm); +typedef void (*virLXCMonitorCallbackDestroy)(virLXCMonitor *mon, + virDomainObj *vm); +typedef void (*virLXCMonitorCallbackEOFNotify)(virLXCMonitor *mon, + virDomainObj *vm); -typedef void (*virLXCMonitorCallbackExitNotify)(virLXCMonitorPtr mon, +typedef void (*virLXCMonitorCallbackExitNotify)(virLXCMonitor *mon, virLXCMonitorExitStatus status, - virDomainObjPtr vm); + virDomainObj *vm); -typedef void (*virLXCMonitorCallbackInitNotify)(virLXCMonitorPtr mon, +typedef void (*virLXCMonitorCallbackInitNotify)(virLXCMonitor *mon, pid_t pid, - virDomainObjPtr vm); + virDomainObj *vm); struct _virLXCMonitorCallbacks { virLXCMonitorCallbackDestroy destroy; @@ -50,11 +48,11 @@ struct _virLXCMonitorCallbacks { virLXCMonitorCallbackInitNotify initNotify; }; -virLXCMonitorPtr virLXCMonitorNew(virDomainObjPtr vm, +virLXCMonitor *virLXCMonitorNew(virDomainObj *vm, const char *socketdir, - virLXCMonitorCallbacksPtr cb); + virLXCMonitorCallbacks *cb); -void virLXCMonitorClose(virLXCMonitorPtr mon); +void virLXCMonitorClose(virLXCMonitor *mon); -void virLXCMonitorLock(virLXCMonitorPtr mon); -void virLXCMonitorUnlock(virLXCMonitorPtr mon); +void virLXCMonitorLock(virLXCMonitor *mon); +void virLXCMonitorUnlock(virLXCMonitor *mon); diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c index c5f2898a57..083fb50af7 100644 --- a/src/lxc/lxc_native.c +++ b/src/lxc/lxc_native.c @@ -53,14 +53,14 @@ VIR_ENUM_IMPL(virLXCNetworkConfigEntry, "ipv6.address" ); -static virDomainFSDefPtr +static virDomainFSDef * lxcCreateFSDef(int type, const char *src, const char* dst, bool readonly, unsigned long long usage) { - virDomainFSDefPtr def; + virDomainFSDef *def; if (!(def = virDomainFSDefNew(NULL))) return NULL; @@ -77,9 +77,8 @@ lxcCreateFSDef(int type, } typedef struct _lxcFstab lxcFstab; -typedef lxcFstab *lxcFstabPtr; struct _lxcFstab { - lxcFstabPtr next; + lxcFstab *next; char *src; char *dst; char *type; @@ -87,10 +86,10 @@ struct _lxcFstab { }; static void -lxcFstabFree(lxcFstabPtr fstab) +lxcFstabFree(lxcFstab *fstab) { while (fstab) { - lxcFstabPtr next = NULL; + lxcFstab *next = NULL; next = fstab->next; g_free(fstab->src); @@ -142,10 +141,10 @@ static char ** lxcStringSplit(const char *string) return NULL; } -static lxcFstabPtr +static lxcFstab * lxcParseFstabLine(char *fstabLine) { - lxcFstabPtr fstab = NULL; + lxcFstab *fstab = NULL; char **parts; if (!fstabLine) @@ -174,14 +173,14 @@ lxcParseFstabLine(char *fstabLine) } static int -lxcAddFSDef(virDomainDefPtr def, +lxcAddFSDef(virDomainDef *def, int type, const char *src, const char *dst, bool readonly, unsigned long long usage) { - virDomainFSDefPtr fsDef = NULL; + virDomainFSDef *fsDef = NULL; if (!(fsDef = lxcCreateFSDef(type, src, dst, readonly, usage))) goto error; @@ -197,8 +196,8 @@ lxcAddFSDef(virDomainDefPtr def, } static int -lxcSetRootfs(virDomainDefPtr def, - virConfPtr properties) +lxcSetRootfs(virDomainDef *def, + virConf *properties) { int type = VIR_DOMAIN_FS_TYPE_MOUNT; g_autofree char *value = NULL; @@ -249,7 +248,7 @@ lxcConvertSize(const char *size, unsigned long long *value) } static int -lxcAddFstabLine(virDomainDefPtr def, lxcFstabPtr fstab) +lxcAddFstabLine(virDomainDef *def, lxcFstab *fstab) { const char *src = NULL; g_autofree char *dst = NULL; @@ -313,11 +312,11 @@ lxcAddFstabLine(virDomainDefPtr def, lxcFstabPtr fstab) } static int -lxcFstabWalkCallback(const char* name, virConfValuePtr value, void * data) +lxcFstabWalkCallback(const char* name, virConfValue *value, void * data) { int ret = 0; - lxcFstabPtr fstabLine; - virDomainDefPtr def = data; + lxcFstab *fstabLine; + virDomainDef *def = data; /* We only care about lxc.mount.entry lines */ if (STRNEQ(name, "lxc.mount.entry")) @@ -335,7 +334,7 @@ lxcFstabWalkCallback(const char* name, virConfValuePtr value, void * data) return ret; } -static virDomainNetDefPtr +static virDomainNetDef * lxcCreateNetDef(const char *type, const char *linkdev, const char *mac, @@ -343,7 +342,7 @@ lxcCreateNetDef(const char *type, const char *macvlanmode, const char *name) { - virDomainNetDefPtr net = NULL; + virDomainNetDef *net = NULL; virMacAddr macAddr; if (!(net = virDomainNetDefNew(NULL))) @@ -391,10 +390,10 @@ lxcCreateNetDef(const char *type, return NULL; } -static virDomainHostdevDefPtr +static virDomainHostdevDef * lxcCreateHostdevDef(int mode, int type, const char *data) { - virDomainHostdevDefPtr hostdev = virDomainHostdevDefNew(); + virDomainHostdevDef *hostdev = virDomainHostdevDefNew(); if (!hostdev) return NULL; @@ -409,7 +408,6 @@ lxcCreateHostdevDef(int mode, int type, const char *data) } typedef struct _lxcNetworkParseData lxcNetworkParseData; -typedef lxcNetworkParseData *lxcNetworkParseDataPtr; struct _lxcNetworkParseData { char *type; char *link; @@ -418,7 +416,7 @@ struct _lxcNetworkParseData { char *macvlanmode; char *vlanid; char *name; - virNetDevIPAddrPtr *ips; + virNetDevIPAddr **ips; size_t nips; char *gateway_ipv4; char *gateway_ipv6; @@ -427,14 +425,14 @@ struct _lxcNetworkParseData { typedef struct { size_t ndata; - lxcNetworkParseDataPtr *parseData; + lxcNetworkParseData **parseData; } lxcNetworkParseDataArray; static int lxcAddNetworkRouteDefinition(const char *address, int family, - virNetDevIPRoutePtr **routes, + virNetDevIPRoute ***routes, size_t *nroutes) { g_autoptr(virNetDevIPRoute) route = NULL; @@ -457,10 +455,10 @@ lxcAddNetworkRouteDefinition(const char *address, } static int -lxcAddNetworkDefinition(virDomainDefPtr def, lxcNetworkParseData *data) +lxcAddNetworkDefinition(virDomainDef *def, lxcNetworkParseData *data) { - virDomainNetDefPtr net = NULL; - virDomainHostdevDefPtr hostdev = NULL; + virDomainNetDef *net = NULL; + virDomainHostdevDef *hostdev = NULL; bool isPhys, isVlan = false; size_t i; @@ -547,12 +545,12 @@ lxcAddNetworkDefinition(virDomainDefPtr def, lxcNetworkParseData *data) static int lxcNetworkParseDataIPs(const char *name, - virConfValuePtr value, + virConfValue *value, lxcNetworkParseData *parseData) { int family = AF_INET; char **ipparts = NULL; - g_autofree virNetDevIPAddrPtr ip = g_new0(virNetDevIPAddr, 1); + g_autofree virNetDevIPAddr *ip = g_new0(virNetDevIPAddr, 1); if (STREQ(name, "ipv6") || STREQ(name, "ipv6.address")) family = AF_INET6; @@ -580,7 +578,7 @@ lxcNetworkParseDataIPs(const char *name, static int lxcNetworkParseDataSuffix(const char *entry, - virConfValuePtr value, + virConfValue *value, lxcNetworkParseData *parseData) { int elem = virLXCNetworkConfigEntryTypeFromString(entry); @@ -631,7 +629,7 @@ lxcNetworkParseDataSuffix(const char *entry, } -static lxcNetworkParseDataPtr +static lxcNetworkParseData * lxcNetworkGetParseDataByIndex(lxcNetworkParseDataArray *networks, unsigned int index) { @@ -655,7 +653,7 @@ lxcNetworkGetParseDataByIndex(lxcNetworkParseDataArray *networks, static int lxcNetworkParseDataEntry(const char *name, - virConfValuePtr value, + virConfValue *value, lxcNetworkParseDataArray *networks) { lxcNetworkParseData *parseData; @@ -678,7 +676,7 @@ lxcNetworkParseDataEntry(const char *name, } -static lxcNetworkParseDataPtr +static lxcNetworkParseData * lxcNetworkGetParseDataByIndexLegacy(lxcNetworkParseDataArray *networks, const char *entry) { @@ -706,7 +704,7 @@ lxcNetworkGetParseDataByIndexLegacy(lxcNetworkParseDataArray *networks, static int lxcNetworkParseDataEntryLegacy(const char *name, - virConfValuePtr value, + virConfValue *value, lxcNetworkParseDataArray *networks) { const char *suffix = STRSKIP(name, "lxc.network."); @@ -720,7 +718,7 @@ lxcNetworkParseDataEntryLegacy(const char *name, static int -lxcNetworkWalkCallback(const char *name, virConfValuePtr value, void *data) +lxcNetworkWalkCallback(const char *name, virConfValue *value, void *data) { lxcNetworkParseDataArray *networks = data; @@ -733,7 +731,7 @@ lxcNetworkWalkCallback(const char *name, virConfValuePtr value, void *data) } static int -lxcConvertNetworkSettings(virDomainDefPtr def, virConfPtr properties) +lxcConvertNetworkSettings(virDomainDef *def, virConf *properties) { int status; bool privnet = true; @@ -741,13 +739,13 @@ lxcConvertNetworkSettings(virDomainDefPtr def, virConfPtr properties) lxcNetworkParseDataArray networks = {0, NULL}; int ret = -1; - networks.parseData = g_new0(lxcNetworkParseDataPtr, 1); + networks.parseData = g_new0(lxcNetworkParseData *, 1); if (virConfWalk(properties, lxcNetworkWalkCallback, &networks) < 0) goto error; for (i = 0; i < networks.ndata; i++) { - lxcNetworkParseDataPtr data = networks.parseData[i]; + lxcNetworkParseData *data = networks.parseData[i]; status = lxcAddNetworkDefinition(def, data); @@ -773,7 +771,7 @@ lxcConvertNetworkSettings(virDomainDefPtr def, virConfPtr properties) error: for (i = 0; i < networks.ndata; i++) { - lxcNetworkParseDataPtr data = networks.parseData[i]; + lxcNetworkParseData *data = networks.parseData[i]; for (j = 0; j < data->nips; j++) g_free(data->ips[j]); g_free(data->ips); @@ -783,11 +781,11 @@ lxcConvertNetworkSettings(virDomainDefPtr def, virConfPtr properties) } static int -lxcCreateConsoles(virDomainDefPtr def, virConfPtr properties) +lxcCreateConsoles(virDomainDef *def, virConf *properties) { g_autofree char *value = NULL; int nbttys = 0; - virDomainChrDefPtr console; + virDomainChrDef *console; size_t i; if (virConfGetValueString(properties, "lxc.tty.max", &value) <= 0) { @@ -804,7 +802,7 @@ lxcCreateConsoles(virDomainDefPtr def, virConfPtr properties) return -1; } - def->consoles = g_new0(virDomainChrDefPtr, nbttys); + def->consoles = g_new0(virDomainChrDef *, nbttys); def->nconsoles = nbttys; for (i = 0; i < nbttys; i++) { @@ -827,10 +825,10 @@ lxcCreateConsoles(virDomainDefPtr def, virConfPtr properties) } static int -lxcIdmapWalkCallback(const char *name, virConfValuePtr value, void *data) +lxcIdmapWalkCallback(const char *name, virConfValue *value, void *data) { - virDomainDefPtr def = data; - virDomainIdMapEntryPtr idmap = NULL; + virDomainDef *def = data; + virDomainIdMapEntry *idmap = NULL; char type; unsigned long start, target, count; @@ -865,7 +863,7 @@ lxcIdmapWalkCallback(const char *name, virConfValuePtr value, void *data) } static int -lxcSetMemTune(virDomainDefPtr def, virConfPtr properties) +lxcSetMemTune(virDomainDef *def, virConf *properties) { g_autofree char *value = NULL; unsigned long long size = 0; @@ -903,7 +901,7 @@ lxcSetMemTune(virDomainDefPtr def, virConfPtr properties) } static int -lxcSetCpuTune(virDomainDefPtr def, virConfPtr properties) +lxcSetCpuTune(virDomainDef *def, virConf *properties) { g_autofree char *value = NULL; @@ -939,10 +937,10 @@ lxcSetCpuTune(virDomainDefPtr def, virConfPtr properties) } static int -lxcSetCpusetTune(virDomainDefPtr def, virConfPtr properties) +lxcSetCpusetTune(virDomainDef *def, virConf *properties) { g_autofree char *value = NULL; - virBitmapPtr nodeset = NULL; + virBitmap *nodeset = NULL; if (virConfGetValueString(properties, "lxc.cgroup.cpuset.cpus", &value) > 0) { @@ -973,11 +971,11 @@ lxcSetCpusetTune(virDomainDefPtr def, virConfPtr properties) } static int -lxcBlkioDeviceWalkCallback(const char *name, virConfValuePtr value, void *data) +lxcBlkioDeviceWalkCallback(const char *name, virConfValue *value, void *data) { char **parts = NULL; - virBlkioDevicePtr device = NULL; - virDomainDefPtr def = data; + virBlkioDevice *device = NULL; + virDomainDef *def = data; size_t i = 0; g_autofree char *path = NULL; int ret = -1; @@ -1057,7 +1055,7 @@ lxcBlkioDeviceWalkCallback(const char *name, virConfValuePtr value, void *data) } static int -lxcSetBlkioTune(virDomainDefPtr def, virConfPtr properties) +lxcSetBlkioTune(virDomainDef *def, virConf *properties) { g_autofree char *value = NULL; @@ -1077,7 +1075,7 @@ lxcSetBlkioTune(virDomainDefPtr def, virConfPtr properties) } static void -lxcSetCapDrop(virDomainDefPtr def, virConfPtr properties) +lxcSetCapDrop(virDomainDef *def, virConf *properties) { g_autofree char *value = NULL; char **toDrop = NULL; @@ -1099,12 +1097,12 @@ lxcSetCapDrop(virDomainDefPtr def, virConfPtr properties) g_strfreev(toDrop); } -virDomainDefPtr +virDomainDef * lxcParseConfigString(const char *config, - virCapsPtr caps G_GNUC_UNUSED, - virDomainXMLOptionPtr xmlopt) + virCaps *caps G_GNUC_UNUSED, + virDomainXMLOption *xmlopt) { - virDomainDefPtr vmdef = NULL; + virDomainDef *vmdef = NULL; g_autoptr(virConf) properties = NULL; g_autofree char *value = NULL; diff --git a/src/lxc/lxc_native.h b/src/lxc/lxc_native.h index 813272e129..95c3fff454 100644 --- a/src/lxc/lxc_native.h +++ b/src/lxc/lxc_native.h @@ -44,6 +44,6 @@ typedef enum { VIR_ENUM_DECL(virLXCNetworkConfigEntry); -virDomainDefPtr lxcParseConfigString(const char *config, - virCapsPtr caps, - virDomainXMLOptionPtr xmlopt); +virDomainDef *lxcParseConfigString(const char *config, + virCaps *caps, + virDomainXMLOption *xmlopt); diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c index bdf96eed3d..b2a7f105a9 100644 --- a/src/lxc/lxc_process.c +++ b/src/lxc/lxc_process.c @@ -61,13 +61,13 @@ VIR_LOG_INIT("lxc.lxc_process"); #define START_POSTFIX ": starting up\n" static void -lxcProcessAutoDestroy(virDomainObjPtr dom, +lxcProcessAutoDestroy(virDomainObj *dom, virConnectPtr conn, void *opaque) { - virLXCDriverPtr driver = opaque; - virObjectEventPtr event = NULL; - virLXCDomainObjPrivatePtr priv; + virLXCDriver *driver = opaque; + virObjectEvent *event = NULL; + virLXCDomainObjPrivate *priv; VIR_DEBUG("driver=%p dom=%s conn=%p", driver, dom->def->name, conn); @@ -90,14 +90,14 @@ lxcProcessAutoDestroy(virDomainObjPtr dom, * Precondition: driver is locked */ static int -virLXCProcessReboot(virLXCDriverPtr driver, - virDomainObjPtr vm) +virLXCProcessReboot(virLXCDriver *driver, + virDomainObj *vm) { virConnectPtr conn = virCloseCallbacksGetConn(driver->closeCallbacks, vm); int reason = vm->state.reason; bool autodestroy = false; int ret = -1; - virDomainDefPtr savedDef; + virDomainDef *savedDef; VIR_DEBUG("Faking reboot"); @@ -132,8 +132,8 @@ virLXCProcessReboot(virLXCDriverPtr driver, static void -lxcProcessRemoveDomainStatus(virLXCDriverConfigPtr cfg, - virDomainObjPtr vm) +lxcProcessRemoveDomainStatus(virLXCDriverConfig *cfg, + virDomainObj *vm) { g_autofree char *file = g_strdup_printf("%s/%s.xml", cfg->stateDir, @@ -162,15 +162,15 @@ typedef enum { * If @flags is zero then whole cleanup process is done, * otherwise only selected sections are run. */ -static void virLXCProcessCleanup(virLXCDriverPtr driver, - virDomainObjPtr vm, +static void virLXCProcessCleanup(virLXCDriver *driver, + virDomainObj *vm, virDomainShutoffReason reason, unsigned int flags) { size_t i; - virLXCDomainObjPrivatePtr priv = vm->privateData; + virLXCDomainObjPrivate *priv = vm->privateData; const virNetDevVPortProfile *vport = NULL; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); g_autoptr(virConnect) conn = NULL; VIR_DEBUG("Cleanup VM name=%s pid=%d reason=%d flags=0x%x", @@ -232,7 +232,7 @@ static void virLXCProcessCleanup(virLXCDriverPtr driver, virLXCDomainReAttachHostDevices(driver, vm->def); for (i = 0; i < vm->def->nnets; i++) { - virDomainNetDefPtr iface = vm->def->nets[i]; + virDomainNetDef *iface = vm->def->nets[i]; vport = virDomainNetGetActualVirtPortProfile(iface); if (iface->ifname) { if (vport && @@ -284,7 +284,7 @@ static void virLXCProcessCleanup(virLXCDriverPtr driver, int -virLXCProcessValidateInterface(virDomainNetDefPtr net) +virLXCProcessValidateInterface(virDomainNetDef *net) { if (net->script) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -296,8 +296,8 @@ virLXCProcessValidateInterface(virDomainNetDefPtr net) char * -virLXCProcessSetupInterfaceTap(virDomainDefPtr vm, - virDomainNetDefPtr net, +virLXCProcessSetupInterfaceTap(virDomainDef *vm, + virDomainNetDef *net, const char *brname) { g_autofree char *parentVeth = NULL; @@ -359,15 +359,15 @@ virLXCProcessSetupInterfaceTap(virDomainDefPtr vm, char * -virLXCProcessSetupInterfaceDirect(virLXCDriverPtr driver, - virDomainDefPtr def, - virDomainNetDefPtr net) +virLXCProcessSetupInterfaceDirect(virLXCDriver *driver, + virDomainDef *def, + virDomainNetDef *net) { char *ret = NULL; char *res_ifname = NULL; const virNetDevBandwidth *bw; const virNetDevVPortProfile *prof; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); const char *linkdev = virDomainNetGetActualDirectDev(net); unsigned int macvlan_create_flags = VIR_NETDEV_MACVLAN_CREATE_IFUP; @@ -424,13 +424,13 @@ static const char *nsInfoLocal[VIR_LXC_DOMAIN_NAMESPACE_LAST] = { [VIR_LXC_DOMAIN_NAMESPACE_SHAREUTS] = "uts", }; -static int virLXCProcessSetupNamespaceName(virLXCDriverPtr driver, +static int virLXCProcessSetupNamespaceName(virLXCDriver *driver, int ns_type, const char *name) { int fd = -1; - virDomainObjPtr vm; - virLXCDomainObjPrivatePtr priv; + virDomainObj *vm; + virLXCDomainObjPrivate *priv; g_autofree char *path = NULL; vm = virDomainObjListFindByName(driver->domains, name); @@ -512,8 +512,8 @@ static int virLXCProcessSetupNamespaceNet(int ns_type, const char *name) * Returns 0 on success or -1 in case of error */ static int -virLXCProcessSetupNamespaces(virLXCDriverPtr driver, - lxcDomainDefPtr lxcDef, +virLXCProcessSetupNamespaces(virLXCDriver *driver, + lxcDomainDef *lxcDef, int *nsFDs) { size_t i; @@ -560,14 +560,14 @@ virLXCProcessSetupNamespaces(virLXCDriverPtr driver, * Returns 0 on success or -1 in case of error */ static int -virLXCProcessSetupInterfaces(virLXCDriverPtr driver, - virDomainDefPtr def, +virLXCProcessSetupInterfaces(virLXCDriver *driver, + virDomainDef *def, char ***veths) { int ret = -1; size_t i; size_t niface = 0; - virDomainNetDefPtr net; + virDomainNetDef *net; virDomainNetType type; g_autoptr(virConnect) netconn = NULL; virErrorPtr save_err = NULL; @@ -667,7 +667,7 @@ virLXCProcessSetupInterfaces(virLXCDriverPtr driver, if (ret < 0) { virErrorPreserveLast(&save_err); for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr iface = def->nets[i]; + virDomainNetDef *iface = def->nets[i]; const virNetDevVPortProfile *vport = virDomainNetGetActualVirtPortProfile(iface); if (vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) ignore_value(virNetDevOpenvswitchRemovePort( @@ -682,7 +682,7 @@ virLXCProcessSetupInterfaces(virLXCDriverPtr driver, } static void -virLXCProcessCleanInterfaces(virDomainDefPtr def) +virLXCProcessCleanInterfaces(virDomainDef *def) { size_t i; @@ -694,13 +694,13 @@ virLXCProcessCleanInterfaces(virDomainDefPtr def) } -extern virLXCDriverPtr lxc_driver; -static void virLXCProcessMonitorEOFNotify(virLXCMonitorPtr mon, - virDomainObjPtr vm) +extern virLXCDriver *lxc_driver; +static void virLXCProcessMonitorEOFNotify(virLXCMonitor *mon, + virDomainObj *vm) { - virLXCDriverPtr driver = lxc_driver; - virObjectEventPtr event = NULL; - virLXCDomainObjPrivatePtr priv; + virLXCDriver *driver = lxc_driver; + virObjectEvent *event = NULL; + virLXCDomainObjPrivate *priv; VIR_DEBUG("mon=%p vm=%p", mon, vm); @@ -742,11 +742,11 @@ static void virLXCProcessMonitorEOFNotify(virLXCMonitorPtr mon, virObjectEventStateQueue(driver->domainEventState, event); } -static void virLXCProcessMonitorExitNotify(virLXCMonitorPtr mon G_GNUC_UNUSED, +static void virLXCProcessMonitorExitNotify(virLXCMonitor *mon G_GNUC_UNUSED, virLXCMonitorExitStatus status, - virDomainObjPtr vm) + virDomainObj *vm) { - virLXCDomainObjPrivatePtr priv = vm->privateData; + virLXCDomainObjPrivate *priv = vm->privateData; virObjectLock(vm); @@ -794,14 +794,14 @@ virLXCProcessGetNsInode(pid_t pid, /* XXX a little evil */ -extern virLXCDriverPtr lxc_driver; -static void virLXCProcessMonitorInitNotify(virLXCMonitorPtr mon G_GNUC_UNUSED, +extern virLXCDriver *lxc_driver; +static void virLXCProcessMonitorInitNotify(virLXCMonitor *mon G_GNUC_UNUSED, pid_t initpid, - virDomainObjPtr vm) + virDomainObj *vm) { - virLXCDriverPtr driver = lxc_driver; - virLXCDomainObjPrivatePtr priv; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDriver *driver = lxc_driver; + virLXCDomainObjPrivate *priv; + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); ino_t inode = 0; virObjectLock(vm); @@ -831,11 +831,11 @@ static virLXCMonitorCallbacks monitorCallbacks = { }; -static virLXCMonitorPtr virLXCProcessConnectMonitor(virLXCDriverPtr driver, - virDomainObjPtr vm) +static virLXCMonitor *virLXCProcessConnectMonitor(virLXCDriver *driver, + virDomainObj *vm) { - virLXCMonitorPtr monitor = NULL; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCMonitor *monitor = NULL; + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); if (virSecurityManagerSetSocketLabel(driver->securityManager, vm->def) < 0) goto cleanup; @@ -864,12 +864,12 @@ static virLXCMonitorPtr virLXCProcessConnectMonitor(virLXCDriverPtr driver, } -int virLXCProcessStop(virLXCDriverPtr driver, - virDomainObjPtr vm, +int virLXCProcessStop(virLXCDriver *driver, + virDomainObj *vm, virDomainShutoffReason reason) { int rc; - virLXCDomainObjPrivatePtr priv; + virLXCDomainObjPrivate *priv; VIR_DEBUG("Stopping VM name=%s pid=%d reason=%d", vm->def->name, (int)vm->pid, (int)reason); @@ -930,9 +930,9 @@ int virLXCProcessStop(virLXCDriverPtr driver, } -static virCommandPtr -virLXCProcessBuildControllerCmd(virLXCDriverPtr driver, - virDomainObjPtr vm, +static virCommand * +virLXCProcessBuildControllerCmd(virLXCDriver *driver, + virDomainObj *vm, char **veths, int *ttyFDs, size_t nttyFDs, @@ -946,8 +946,8 @@ virLXCProcessBuildControllerCmd(virLXCDriverPtr driver, size_t i; g_autofree char *filterstr = NULL; g_autofree char *outputstr = NULL; - virCommandPtr cmd; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virCommand *cmd; + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); cmd = virCommandNew(vm->def->emulator); @@ -1042,7 +1042,7 @@ virLXCProcessIgnorableLogLine(const char *str) } static int -virLXCProcessReadLogOutputData(virDomainObjPtr vm, +virLXCProcessReadLogOutputData(virDomainObj *vm, int fd, char *buf, size_t buflen) @@ -1109,7 +1109,7 @@ virLXCProcessReadLogOutputData(virDomainObjPtr vm, static int -virLXCProcessReadLogOutput(virDomainObjPtr vm, +virLXCProcessReadLogOutput(virDomainObj *vm, char *logfile, off_t pos, char *buf, @@ -1144,9 +1144,9 @@ virLXCProcessReadLogOutput(virDomainObjPtr vm, static int -virLXCProcessEnsureRootFS(virDomainObjPtr vm) +virLXCProcessEnsureRootFS(virDomainObj *vm) { - virDomainFSDefPtr root = virDomainGetFilesystemForTarget(vm->def, "/"); + virDomainFSDef *root = virDomainGetFilesystemForTarget(vm->def, "/"); if (root) return 0; @@ -1185,8 +1185,8 @@ virLXCProcessEnsureRootFS(virDomainObjPtr vm) * Returns 0 on success or -1 in case of error */ int virLXCProcessStart(virConnectPtr conn, - virLXCDriverPtr driver, - virDomainObjPtr vm, + virLXCDriver * driver, + virDomainObj *vm, unsigned int nfiles, int *files, bool autoDestroy, virDomainRunningReason reason) @@ -1203,11 +1203,11 @@ int virLXCProcessStart(virConnectPtr conn, char ebuf[1024]; g_autofree char *timestamp = NULL; int nsInheritFDs[VIR_LXC_DOMAIN_NAMESPACE_LAST]; - virCommandPtr cmd = NULL; - virLXCDomainObjPrivatePtr priv = vm->privateData; - virCapsPtr caps = NULL; + virCommand *cmd = NULL; + virLXCDomainObjPrivate *priv = vm->privateData; + virCaps *caps = NULL; virErrorPtr err = NULL; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); g_autoptr(virCgroup) selfcgroup = NULL; int status; g_autofree char *pidfile = NULL; @@ -1257,7 +1257,7 @@ int virLXCProcessStart(virConnectPtr conn, } if (!vm->def->resource) { - virDomainResourceDefPtr res = g_new0(virDomainResourceDef, 1); + virDomainResourceDef *res = g_new0(virDomainResourceDef, 1); res->partition = g_strdup("/machine"); @@ -1564,12 +1564,12 @@ int virLXCProcessStart(virConnectPtr conn, } struct virLXCProcessAutostartData { - virLXCDriverPtr driver; + virLXCDriver *driver; virConnectPtr conn; }; static int -virLXCProcessAutostartDomain(virDomainObjPtr vm, +virLXCProcessAutostartDomain(virDomainObj *vm, void *opaque) { const struct virLXCProcessAutostartData *data = opaque; @@ -1587,7 +1587,7 @@ virLXCProcessAutostartDomain(virDomainObjPtr vm, vm->def->name, virGetLastErrorMessage()); } else { - virObjectEventPtr event = + virObjectEvent *event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED_BOOTED); @@ -1600,7 +1600,7 @@ virLXCProcessAutostartDomain(virDomainObjPtr vm, void -virLXCProcessAutostartAll(virLXCDriverPtr driver) +virLXCProcessAutostartAll(virLXCDriver *driver) { /* XXX: Figure out a better way todo this. The domain * startup code needs a connection handle in order @@ -1621,13 +1621,13 @@ virLXCProcessAutostartAll(virLXCDriverPtr driver) static void -virLXCProcessReconnectNotifyNets(virDomainDefPtr def) +virLXCProcessReconnectNotifyNets(virDomainDef *def) { size_t i; g_autoptr(virConnect) conn = NULL; for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; /* type='bridge|network|ethernet' interfaces may be using an * autogenerated netdev name, so we should update the counter @@ -1662,12 +1662,12 @@ virLXCProcessReconnectNotifyNets(virDomainDefPtr def) static int -virLXCProcessReconnectDomain(virDomainObjPtr vm, +virLXCProcessReconnectDomain(virDomainObj *vm, void *opaque) { - virLXCDriverPtr driver = opaque; - virLXCDomainObjPrivatePtr priv; - virLXCDriverConfigPtr cfg = virLXCDriverGetConfig(driver); + virLXCDriver *driver = opaque; + virLXCDomainObjPrivate *priv; + virLXCDriverConfig *cfg = virLXCDriverGetConfig(driver); int ret = -1; virObjectLock(vm); @@ -1741,8 +1741,8 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm, } -int virLXCProcessReconnectAll(virLXCDriverPtr driver, - virDomainObjListPtr doms) +int virLXCProcessReconnectAll(virLXCDriver *driver, + virDomainObjList *doms) { virDomainObjListForEach(doms, false, virLXCProcessReconnectDomain, driver); return 0; diff --git a/src/lxc/lxc_process.h b/src/lxc/lxc_process.h index 383f6f714d..33ff334b74 100644 --- a/src/lxc/lxc_process.h +++ b/src/lxc/lxc_process.h @@ -24,32 +24,32 @@ #include "lxc_conf.h" int virLXCProcessStart(virConnectPtr conn, - virLXCDriverPtr driver, - virDomainObjPtr vm, + virLXCDriver * driver, + virDomainObj *vm, unsigned int nfiles, int *files, bool autoDestroy, virDomainRunningReason reason); -int virLXCProcessStop(virLXCDriverPtr driver, - virDomainObjPtr vm, +int virLXCProcessStop(virLXCDriver *driver, + virDomainObj *vm, virDomainShutoffReason reason); -void virLXCProcessAutoDestroyRun(virLXCDriverPtr driver, +void virLXCProcessAutoDestroyRun(virLXCDriver *driver, virConnectPtr conn); -void virLXCProcessAutoDestroyShutdown(virLXCDriverPtr driver); -int virLXCProcessAutoDestroyAdd(virLXCDriverPtr driver, - virDomainObjPtr vm, +void virLXCProcessAutoDestroyShutdown(virLXCDriver *driver); +int virLXCProcessAutoDestroyAdd(virLXCDriver *driver, + virDomainObj *vm, virConnectPtr conn); -int virLXCProcessAutoDestroyRemove(virLXCDriverPtr driver, - virDomainObjPtr vm); +int virLXCProcessAutoDestroyRemove(virLXCDriver *driver, + virDomainObj *vm); -void virLXCProcessAutostartAll(virLXCDriverPtr driver); -int virLXCProcessReconnectAll(virLXCDriverPtr driver, - virDomainObjListPtr doms); +void virLXCProcessAutostartAll(virLXCDriver *driver); +int virLXCProcessReconnectAll(virLXCDriver *driver, + virDomainObjList *doms); -int virLXCProcessValidateInterface(virDomainNetDefPtr net); -char *virLXCProcessSetupInterfaceTap(virDomainDefPtr vm, - virDomainNetDefPtr net, +int virLXCProcessValidateInterface(virDomainNetDef *net); +char *virLXCProcessSetupInterfaceTap(virDomainDef *vm, + virDomainNetDef *net, const char *brname); -char *virLXCProcessSetupInterfaceDirect(virLXCDriverPtr driver, - virDomainDefPtr def, - virDomainNetDefPtr net); +char *virLXCProcessSetupInterfaceDirect(virLXCDriver *driver, + virDomainDef *def, + virDomainNetDef *net); diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 14db9ffc82..1172dbbc18 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -87,10 +87,10 @@ static virMutex bridgeNameValidateMutex = VIR_MUTEX_INITIALIZER; VIR_LOG_INIT("network.bridge_driver"); -static virNetworkDriverStatePtr network_driver; +static virNetworkDriverState *network_driver; -static virNetworkDriverStatePtr +static virNetworkDriverState * networkGetDriver(void) { /* Maybe one day we can store @network_driver in the @@ -101,23 +101,23 @@ networkGetDriver(void) static void -networkDriverLock(virNetworkDriverStatePtr driver) +networkDriverLock(virNetworkDriverState *driver) { virMutexLock(&driver->lock); } static void -networkDriverUnlock(virNetworkDriverStatePtr driver) +networkDriverUnlock(virNetworkDriverState *driver) { virMutexUnlock(&driver->lock); } -static dnsmasqCapsPtr -networkGetDnsmasqCaps(virNetworkDriverStatePtr driver) +static dnsmasqCaps * +networkGetDnsmasqCaps(virNetworkDriverState *driver) { - dnsmasqCapsPtr ret; + dnsmasqCaps *ret; networkDriverLock(driver); ret = virObjectRef(driver->dnsmasqCaps); networkDriverUnlock(driver); @@ -126,9 +126,9 @@ networkGetDnsmasqCaps(virNetworkDriverStatePtr driver) static int -networkDnsmasqCapsRefresh(virNetworkDriverStatePtr driver) +networkDnsmasqCapsRefresh(virNetworkDriverState *driver) { - dnsmasqCapsPtr caps; + dnsmasqCaps *caps; if (!(caps = dnsmasqCapsNewFromBinary(DNSMASQ))) return -1; @@ -144,7 +144,6 @@ networkDnsmasqCapsRefresh(virNetworkDriverStatePtr driver) extern virXMLNamespace networkDnsmasqXMLNamespace; typedef struct _networkDnsmasqXmlNsDef networkDnsmasqXmlNsDef; -typedef networkDnsmasqXmlNsDef *networkDnsmasqXmlNsDefPtr; struct _networkDnsmasqXmlNsDef { size_t noptions; char **options; @@ -154,7 +153,7 @@ struct _networkDnsmasqXmlNsDef { static void networkDnsmasqDefNamespaceFree(void *nsdata) { - networkDnsmasqXmlNsDefPtr def = nsdata; + networkDnsmasqXmlNsDef *def = nsdata; if (!def) return; @@ -166,7 +165,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(networkDnsmasqXmlNsDef, networkDnsmasqDefNamespace static int -networkDnsmasqDefNamespaceParseOptions(networkDnsmasqXmlNsDefPtr nsdef, +networkDnsmasqDefNamespaceParseOptions(networkDnsmasqXmlNsDef *nsdef, xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodes = NULL; @@ -211,10 +210,10 @@ networkDnsmasqDefNamespaceParse(xmlXPathContextPtr ctxt, static int -networkDnsmasqDefNamespaceFormatXML(virBufferPtr buf, +networkDnsmasqDefNamespaceFormatXML(virBuffer *buf, void *nsdata) { - networkDnsmasqXmlNsDefPtr def = nsdata; + networkDnsmasqXmlNsDef *def = nsdata; size_t i; if (!def->noptions) @@ -244,7 +243,7 @@ virXMLNamespace networkDnsmasqXMLNamespace = { }; -virNetworkXMLOptionPtr +virNetworkXMLOption * networkDnsmasqCreateXMLConf(void) { return virNetworkXMLOptionNew(&networkDnsmasqXMLNamespace); @@ -255,56 +254,56 @@ static int networkStateCleanup(void); static int -networkStartNetwork(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj); +networkStartNetwork(virNetworkDriverState *driver, + virNetworkObj *obj); static int -networkShutdownNetwork(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj); +networkShutdownNetwork(virNetworkDriverState *driver, + virNetworkObj *obj); static int -networkStartNetworkVirtual(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj); +networkStartNetworkVirtual(virNetworkDriverState *driver, + virNetworkObj *obj); static int -networkShutdownNetworkVirtual(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj); +networkShutdownNetworkVirtual(virNetworkDriverState *driver, + virNetworkObj *obj); static int -networkStartNetworkExternal(virNetworkObjPtr obj); +networkStartNetworkExternal(virNetworkObj *obj); static int -networkShutdownNetworkExternal(virNetworkObjPtr obj); +networkShutdownNetworkExternal(virNetworkObj *obj); static void -networkReloadFirewallRules(virNetworkDriverStatePtr driver, +networkReloadFirewallRules(virNetworkDriverState *driver, bool startup, bool force); static void -networkRefreshDaemons(virNetworkDriverStatePtr driver); +networkRefreshDaemons(virNetworkDriverState *driver); static int -networkPlugBandwidth(virNetworkObjPtr obj, - virMacAddrPtr mac, - virNetDevBandwidthPtr ifaceBand, +networkPlugBandwidth(virNetworkObj *obj, + virMacAddr *mac, + virNetDevBandwidth *ifaceBand, unsigned int *class_id); static int -networkUnplugBandwidth(virNetworkObjPtr obj, - virNetDevBandwidthPtr ifaceBand, +networkUnplugBandwidth(virNetworkObj *obj, + virNetDevBandwidth *ifaceBand, unsigned int *class_id); static void -networkNetworkObjTaint(virNetworkObjPtr obj, +networkNetworkObjTaint(virNetworkObj *obj, virNetworkTaintFlags taint); -static virNetworkObjPtr +static virNetworkObj * networkObjFromNetwork(virNetworkPtr net) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkObjPtr obj; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkObj *obj; char uuidstr[VIR_UUID_STRING_BUFLEN]; obj = virNetworkObjFindByUUID(driver->networks, net->uuid); @@ -320,12 +319,12 @@ networkObjFromNetwork(virNetworkPtr net) static int -networkRunHook(virNetworkObjPtr obj, - virNetworkPortDefPtr port, +networkRunHook(virNetworkObj *obj, + virNetworkPortDef *port, int op, int sub_op) { - virNetworkDefPtr def; + virNetworkDef *def; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_autofree char *xml = NULL; int hookret; @@ -365,7 +364,7 @@ networkRunHook(virNetworkObjPtr obj, static char * -networkDnsmasqLeaseFileNameDefault(virNetworkDriverStatePtr driver, +networkDnsmasqLeaseFileNameDefault(virNetworkDriverState *driver, const char *netname) { char *leasefile; @@ -376,7 +375,7 @@ networkDnsmasqLeaseFileNameDefault(virNetworkDriverStatePtr driver, static char * -networkDnsmasqLeaseFileNameCustom(virNetworkDriverStatePtr driver, +networkDnsmasqLeaseFileNameCustom(virNetworkDriverState *driver, const char *bridge) { char *leasefile; @@ -387,7 +386,7 @@ networkDnsmasqLeaseFileNameCustom(virNetworkDriverStatePtr driver, static char * -networkDnsmasqConfigFileName(virNetworkDriverStatePtr driver, +networkDnsmasqConfigFileName(virNetworkDriverState *driver, const char *netname) { char *conffile; @@ -409,7 +408,7 @@ networkRadvdPidfileBasename(const char *netname) static char * -networkRadvdConfigFileName(virNetworkDriverStatePtr driver, +networkRadvdConfigFileName(virNetworkDriverState *driver, const char *netname) { char *configfile; @@ -421,8 +420,8 @@ networkRadvdConfigFileName(virNetworkDriverStatePtr driver, /* do needed cleanup steps and remove the network from the list */ static int -networkRemoveInactive(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj) +networkRemoveInactive(virNetworkDriverState *driver, + virNetworkObj *obj) { g_autofree char *leasefile = NULL; g_autofree char *customleasefile = NULL; @@ -432,7 +431,7 @@ networkRemoveInactive(virNetworkDriverStatePtr driver, g_autofree char *statusfile = NULL; g_autofree char *macMapFile = NULL; g_autoptr(dnsmasqContext) dctx = NULL; - virNetworkDefPtr def = virNetworkObjGetPersistentDef(obj); + virNetworkDef *def = virNetworkObjGetPersistentDef(obj); /* remove the (possibly) existing dnsmasq and radvd files */ if (!(dctx = dnsmasqContextNew(def->name, @@ -510,14 +509,14 @@ networkBridgeDummyNicName(const char *brname) static int -networkNotifyPort(virNetworkObjPtr obj, - virNetworkPortDefPtr port); +networkNotifyPort(virNetworkObj *obj, + virNetworkPortDef *port); static bool -networkUpdatePort(virNetworkPortDefPtr port, +networkUpdatePort(virNetworkPortDef *port, void *opaque) { - virNetworkObjPtr obj = opaque; + virNetworkObj *obj = opaque; networkNotifyPort(obj, port); @@ -525,13 +524,13 @@ networkUpdatePort(virNetworkPortDefPtr port, } static int -networkUpdateState(virNetworkObjPtr obj, +networkUpdateState(virNetworkObj *obj, void *opaque) { - virNetworkDefPtr def; - virNetworkDriverStatePtr driver = opaque; + virNetworkDef *def; + virNetworkDriverState *driver = opaque; g_autoptr(dnsmasqCaps) dnsmasq_caps = networkGetDnsmasqCaps(driver); - virMacMapPtr macmap; + virMacMap *macmap; g_autofree char *macMapFile = NULL; int ret = -1; @@ -620,10 +619,10 @@ networkUpdateState(virNetworkObjPtr obj, static int -networkAutostartConfig(virNetworkObjPtr obj, +networkAutostartConfig(virNetworkObj *obj, void *opaque) { - virNetworkDriverStatePtr driver = opaque; + virNetworkDriverState *driver = opaque; int ret = -1; virObjectLock(obj); @@ -649,7 +648,7 @@ firewalld_dbus_signal_callback(GDBusConnection *connection G_GNUC_UNUSED, GVariant *parameters, gpointer user_data) { - virNetworkDriverStatePtr driver = user_data; + virNetworkDriverState *driver = user_data; bool reload = false; if (STREQ(interfaceName, "org.fedoraproject.FirewallD1") && @@ -896,7 +895,7 @@ networkStateCleanup(void) static virDrvOpenStatus networkConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -976,7 +975,7 @@ networkConnectSupportsFeature(virConnectPtr conn, int feature) static char * -networkBuildDnsmasqLeaseTime(virNetworkDHCPLeaseTimeDefPtr lease) +networkBuildDnsmasqLeaseTime(virNetworkDHCPLeaseTimeDef *lease) { const char *unit; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -1001,7 +1000,7 @@ networkBuildDnsmasqLeaseTime(virNetworkDHCPLeaseTimeDefPtr lease) */ static int networkBuildDnsmasqDhcpHostsList(dnsmasqContext *dctx, - virNetworkIPDefPtr ipdef) + virNetworkIPDef *ipdef) { size_t i; bool ipv6 = false; @@ -1009,7 +1008,7 @@ networkBuildDnsmasqDhcpHostsList(dnsmasqContext *dctx, if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET6)) ipv6 = true; for (i = 0; i < ipdef->nhosts; i++) { - virNetworkDHCPHostDefPtr host = &(ipdef->hosts[i]); + virNetworkDHCPHostDef *host = &(ipdef->hosts[i]); g_autofree char *leasetime = networkBuildDnsmasqLeaseTime(host->lease); if (VIR_SOCKET_ADDR_VALID(&host->ip)) @@ -1025,13 +1024,13 @@ networkBuildDnsmasqDhcpHostsList(dnsmasqContext *dctx, static int networkBuildDnsmasqHostsList(dnsmasqContext *dctx, - virNetworkDNSDefPtr dnsdef) + virNetworkDNSDef *dnsdef) { size_t i, j; if (dnsdef) { for (i = 0; i < dnsdef->nhosts; i++) { - virNetworkDNSHostDefPtr host = &(dnsdef->hosts[i]); + virNetworkDNSHostDef *host = &(dnsdef->hosts[i]); if (VIR_SOCKET_ADDR_VALID(&host->ip)) { for (j = 0; j < host->nnames; j++) if (dnsmasqAddHost(dctx, &host->ip, host->names[j]) < 0) @@ -1045,10 +1044,10 @@ networkBuildDnsmasqHostsList(dnsmasqContext *dctx, static int -networkDnsmasqConfLocalPTRs(virBufferPtr buf, - virNetworkDefPtr def) +networkDnsmasqConfLocalPTRs(virBuffer *buf, + virNetworkDef *def) { - virNetworkIPDefPtr ip; + virNetworkIPDef *ip; size_t i; int rc; @@ -1082,24 +1081,24 @@ networkDnsmasqConfLocalPTRs(virBufferPtr buf, int -networkDnsmasqConfContents(virNetworkObjPtr obj, +networkDnsmasqConfContents(virNetworkObj *obj, const char *pidfile, char **configstr, char **hostsfilestr, dnsmasqContext *dctx, - dnsmasqCapsPtr caps G_GNUC_UNUSED) + dnsmasqCaps *caps G_GNUC_UNUSED) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); g_auto(virBuffer) configbuf = VIR_BUFFER_INITIALIZER; int r; int nbleases = 0; size_t i; - virNetworkDNSDefPtr dns = &def->dns; + virNetworkDNSDef *dns = &def->dns; bool wantDNS = dns->enable != VIR_TRISTATE_BOOL_NO; - virNetworkIPDefPtr tmpipdef; - virNetworkIPDefPtr ipdef; - virNetworkIPDefPtr ipv4def; - virNetworkIPDefPtr ipv6def; + virNetworkIPDef *tmpipdef; + virNetworkIPDef *ipdef; + virNetworkIPDef *ipv4def; + virNetworkIPDef *ipv6def; bool ipv6SLAAC; *configstr = NULL; @@ -1149,7 +1148,7 @@ networkDnsmasqConfContents(virNetworkObjPtr obj, bool addNoResolv = false; for (i = 0; i < def->dns.nfwds; i++) { - virNetworkDNSForwarderPtr fwd = &def->dns.forwarders[i]; + virNetworkDNSForwarder *fwd = &def->dns.forwarders[i]; virBufferAddLit(&configbuf, "server="); if (fwd->domain) @@ -1554,7 +1553,7 @@ networkDnsmasqConfContents(virNetworkObjPtr obj, } if (def->namespaceData) { - networkDnsmasqXmlNsDefPtr dnsmasqxmlns = def->namespaceData; + networkDnsmasqXmlNsDef *dnsmasqxmlns = def->namespaceData; for (i = 0; i < dnsmasqxmlns->noptions; i++) virBufferAsprintf(&configbuf, "%s\n", dnsmasqxmlns->options[i]); } @@ -1571,13 +1570,13 @@ networkDnsmasqConfContents(virNetworkObjPtr obj, /* build the dnsmasq command line */ static int ATTRIBUTE_NONNULL(3) -networkBuildDhcpDaemonCommandLine(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj, - virCommandPtr *cmdout, +networkBuildDhcpDaemonCommandLine(virNetworkDriverState *driver, + virNetworkObj *obj, + virCommand **cmdout, char *pidfile, dnsmasqContext *dctx) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); g_autoptr(dnsmasqCaps) dnsmasq_caps = networkGetDnsmasqCaps(driver); g_autoptr(virCommand) cmd = NULL; g_autofree char *configfile = NULL; @@ -1624,11 +1623,11 @@ networkBuildDhcpDaemonCommandLine(virNetworkDriverStatePtr driver, static int -networkStartDhcpDaemon(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj) +networkStartDhcpDaemon(virNetworkDriverState *driver, + virNetworkObj *obj) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); - virNetworkIPDefPtr ipdef; + virNetworkDef *def = virNetworkObjGetDef(obj); + virNetworkIPDef *ipdef; size_t i; bool needDnsmasq = false; g_autoptr(virCommand) cmd = NULL; @@ -1710,15 +1709,15 @@ networkStartDhcpDaemon(virNetworkDriverStatePtr driver, * Returns 0 on success, -1 on failure. */ static int -networkRefreshDhcpDaemon(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj) +networkRefreshDhcpDaemon(virNetworkDriverState *driver, + virNetworkObj *obj) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); size_t i; pid_t dnsmasqPid; - virNetworkIPDefPtr ipdef; - virNetworkIPDefPtr ipv4def; - virNetworkIPDefPtr ipv6def; + virNetworkIPDef *ipdef; + virNetworkIPDef *ipv4def; + virNetworkIPDef *ipv6def; g_autoptr(dnsmasqContext) dctx = NULL; /* if no IP addresses specified, nothing to do */ @@ -1780,8 +1779,8 @@ networkRefreshDhcpDaemon(virNetworkDriverStatePtr driver, * Returns 0 on success, -1 on failure. */ static int -networkRestartDhcpDaemon(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj) +networkRestartDhcpDaemon(virNetworkDriverState *driver, + virNetworkObj *obj) { pid_t dnsmasqPid = virNetworkObjGetDnsmasqPid(obj); @@ -1802,13 +1801,13 @@ static char radvd3[] = " AdvOnLink on;\n" " AdvRouterAddr off;\n"; static int -networkRadvdConfContents(virNetworkObjPtr obj, +networkRadvdConfContents(virNetworkObj *obj, char **configstr) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); g_auto(virBuffer) configbuf = VIR_BUFFER_INITIALIZER; size_t i; - virNetworkIPDefPtr ipdef; + virNetworkIPDef *ipdef; bool v6present = false, dhcp6 = false; *configstr = NULL; @@ -1871,11 +1870,11 @@ networkRadvdConfContents(virNetworkObjPtr obj, /* write file and return its name (which must be freed by caller) */ static int -networkRadvdConfWrite(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj, +networkRadvdConfWrite(virNetworkDriverState *driver, + virNetworkObj *obj, char **configFile) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); g_autofree char *configStr = NULL; g_autofree char *myConfigFile = NULL; @@ -1907,10 +1906,10 @@ networkRadvdConfWrite(virNetworkDriverStatePtr driver, static int -networkStartRadvd(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj) +networkStartRadvd(virNetworkDriverState *driver, + virNetworkObj *obj) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); g_autoptr(dnsmasqCaps) dnsmasq_caps = networkGetDnsmasqCaps(driver); pid_t radvdPid; g_autofree char *pidfile = NULL; @@ -1990,10 +1989,10 @@ networkStartRadvd(virNetworkDriverStatePtr driver, static int -networkRefreshRadvd(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj) +networkRefreshRadvd(virNetworkDriverState *driver, + virNetworkObj *obj) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); g_autoptr(dnsmasqCaps) dnsmasq_caps = networkGetDnsmasqCaps(driver); g_autofree char *radvdpidbase = NULL; g_autofree char *pidfile = NULL; @@ -2030,9 +2029,9 @@ networkRefreshRadvd(virNetworkDriverStatePtr driver, #if 0 /* currently unused, so it causes a build error unless we #if it out */ static int -networkRestartRadvd(virNetworkObjPtr obj) +networkRestartRadvd(virNetworkObj *obj) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); g_autofree char *radvdpidbase = NULL; g_autofree char *pidfile = NULL; @@ -2053,11 +2052,11 @@ networkRestartRadvd(virNetworkObjPtr obj) static int -networkRefreshDaemonsHelper(virNetworkObjPtr obj, +networkRefreshDaemonsHelper(virNetworkObj *obj, void *opaque) { - virNetworkDefPtr def; - virNetworkDriverStatePtr driver = opaque; + virNetworkDef *def; + virNetworkDriverState *driver = opaque; virObjectLock(obj); def = virNetworkObjGetDef(obj); @@ -2101,7 +2100,7 @@ networkRefreshDaemonsHelper(virNetworkObjPtr obj, * This should be called when libvirtd is restarted. */ static void -networkRefreshDaemons(virNetworkDriverStatePtr driver) +networkRefreshDaemons(virNetworkDriverState *driver) { VIR_INFO("Refreshing network daemons"); virNetworkObjListForEach(driver->networks, @@ -2111,10 +2110,10 @@ networkRefreshDaemons(virNetworkDriverStatePtr driver) static int -networkReloadFirewallRulesHelper(virNetworkObjPtr obj, +networkReloadFirewallRulesHelper(virNetworkObj *obj, void *opaque G_GNUC_UNUSED) { - virNetworkDefPtr def; + virNetworkDef *def; virObjectLock(obj); def = virNetworkObjGetDef(obj); @@ -2154,7 +2153,7 @@ networkReloadFirewallRulesHelper(virNetworkObjPtr obj, static void -networkReloadFirewallRules(virNetworkDriverStatePtr driver, +networkReloadFirewallRules(virNetworkDriverState *driver, bool startup, bool force) { @@ -2220,9 +2219,9 @@ networkSetIPv6Sysctl(const char *bridge, static int -networkSetIPv6Sysctls(virNetworkObjPtr obj) +networkSetIPv6Sysctls(virNetworkObj *obj) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); bool enableIPv6 = !!virNetworkDefGetIPByIndex(def, AF_INET6, 0); int rc; @@ -2263,10 +2262,10 @@ networkSetIPv6Sysctls(virNetworkObjPtr obj) /* add an IP address to a bridge */ static int -networkAddAddrToBridge(virNetworkObjPtr obj, - virNetworkIPDefPtr ipdef) +networkAddAddrToBridge(virNetworkObj *obj, + virNetworkIPDef *ipdef) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); int prefix = virNetworkIPDefPrefix(ipdef); if (prefix < 0) { @@ -2284,9 +2283,9 @@ networkAddAddrToBridge(virNetworkObjPtr obj, static int -networkStartHandleMACTableManagerMode(virNetworkObjPtr obj) +networkStartHandleMACTableManagerMode(virNetworkObj *obj) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); const char *brname = def->bridge; if (brname && @@ -2300,14 +2299,14 @@ networkStartHandleMACTableManagerMode(virNetworkObjPtr obj) /* add an IP (static) route to a bridge */ static int -networkAddRouteToBridge(virNetworkObjPtr obj, - virNetDevIPRoutePtr routedef) +networkAddRouteToBridge(virNetworkObj *obj, + virNetDevIPRoute *routedef) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); int prefix = virNetDevIPRouteGetPrefix(routedef); unsigned int metric = virNetDevIPRouteGetMetric(routedef); - virSocketAddrPtr addr = virNetDevIPRouteGetAddress(routedef); - virSocketAddrPtr gateway = virNetDevIPRouteGetGateway(routedef); + virSocketAddr *addr = virNetDevIPRouteGetAddress(routedef); + virSocketAddr *gateway = virNetDevIPRouteGetGateway(routedef); if (prefix < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -2325,16 +2324,16 @@ networkAddRouteToBridge(virNetworkObjPtr obj, static int -networkStartNetworkVirtual(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj) +networkStartNetworkVirtual(virNetworkDriverState *driver, + virNetworkObj *obj) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); size_t i; bool v4present = false, v6present = false; virErrorPtr save_err = NULL; - virNetworkIPDefPtr ipdef; - virNetDevIPRoutePtr routedef; - virMacMapPtr macmap; + virNetworkIPDef *ipdef; + virNetDevIPRoute *routedef; + virMacMap *macmap; g_autofree char *macMapFile = NULL; bool dnsmasqStarted = false; bool devOnline = false; @@ -2418,7 +2417,7 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver, devOnline = true; for (i = 0; i < def->nroutes; i++) { - virSocketAddrPtr gateway = NULL; + virSocketAddr *gateway = NULL; routedef = def->routes[i]; gateway = virNetDevIPRouteGetGateway(routedef); @@ -2491,10 +2490,10 @@ networkStartNetworkVirtual(virNetworkDriverStatePtr driver, static int -networkShutdownNetworkVirtual(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj) +networkShutdownNetworkVirtual(virNetworkDriverState *driver, + virNetworkObj *obj) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); pid_t radvdPid; pid_t dnsmasqPid; @@ -2552,9 +2551,9 @@ networkShutdownNetworkVirtual(virNetworkDriverStatePtr driver, static int -networkStartNetworkBridge(virNetworkObjPtr obj) +networkStartNetworkBridge(virNetworkObj *obj) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); /* put anything here that needs to be done each time a network of * type BRIDGE, is started. On failure, undo anything you've done, @@ -2576,9 +2575,9 @@ networkStartNetworkBridge(virNetworkObjPtr obj) static int -networkShutdownNetworkBridge(virNetworkObjPtr obj G_GNUC_UNUSED) +networkShutdownNetworkBridge(virNetworkObj *obj G_GNUC_UNUSED) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); /* put anything here that needs to be done each time a network of * type BRIDGE is shutdown. On failure, undo anything you've done, @@ -2597,12 +2596,12 @@ networkShutdownNetworkBridge(virNetworkObjPtr obj G_GNUC_UNUSED) * Creates an implicit interface pool of VF's when a PF dev is given */ static int -networkCreateInterfacePool(virNetworkDefPtr netdef) +networkCreateInterfacePool(virNetworkDef *netdef) { size_t numVirtFns = 0; unsigned int maxVirtFns = 0; char **vfNames = NULL; - virPCIDeviceAddressPtr *virtFns; + virPCIDeviceAddress **virtFns; int ret = -1; size_t i; @@ -2621,9 +2620,9 @@ networkCreateInterfacePool(virNetworkDefPtr netdef) netdef->forward.ifs = g_new0(virNetworkForwardIfDef, numVirtFns); for (i = 0; i < numVirtFns; i++) { - virPCIDeviceAddressPtr thisVirtFn = virtFns[i]; + virPCIDeviceAddress *thisVirtFn = virtFns[i]; const char *thisName = vfNames[i]; - virNetworkForwardIfDefPtr thisIf + virNetworkForwardIfDef *thisIf = &netdef->forward.ifs[netdef->forward.nifs]; switch ((virNetworkForwardType) netdef->forward.type) { @@ -2702,7 +2701,7 @@ networkCreateInterfacePool(virNetworkDefPtr netdef) static int -networkStartNetworkExternal(virNetworkObjPtr obj) +networkStartNetworkExternal(virNetworkObj *obj) { /* put anything here that needs to be done each time a network of * type BRIDGE, PRIVATE, VEPA, HOSTDEV or PASSTHROUGH is started. On @@ -2714,7 +2713,7 @@ networkStartNetworkExternal(virNetworkObjPtr obj) static int -networkShutdownNetworkExternal(virNetworkObjPtr obj G_GNUC_UNUSED) +networkShutdownNetworkExternal(virNetworkObj *obj G_GNUC_UNUSED) { /* put anything here that needs to be done each time a network of * type BRIDGE, PRIVATE, VEPA, HOSTDEV or PASSTHROUGH is shutdown. On @@ -2726,10 +2725,10 @@ networkShutdownNetworkExternal(virNetworkObjPtr obj G_GNUC_UNUSED) static int -networkStartNetwork(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj) +networkStartNetwork(virNetworkDriverState *driver, + virNetworkObj *obj) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); int ret = -1; VIR_DEBUG("driver=%p, network=%p", driver, obj); @@ -2825,10 +2824,10 @@ networkStartNetwork(virNetworkDriverStatePtr driver, static int -networkShutdownNetwork(virNetworkDriverStatePtr driver, - virNetworkObjPtr obj) +networkShutdownNetwork(virNetworkDriverState *driver, + virNetworkObj *obj) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); int ret = 0; g_autofree char *stateFile = NULL; @@ -2890,9 +2889,9 @@ static virNetworkPtr networkLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkObjPtr obj; - virNetworkDefPtr def; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkObj *obj; + virNetworkDef *def; virNetworkPtr net = NULL; obj = virNetworkObjFindByUUID(driver->networks, uuid); @@ -2921,9 +2920,9 @@ static virNetworkPtr networkLookupByName(virConnectPtr conn, const char *name) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkObjPtr obj; - virNetworkDefPtr def; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkObj *obj; + virNetworkDef *def; virNetworkPtr net = NULL; obj = virNetworkObjFindByName(driver->networks, name); @@ -2948,7 +2947,7 @@ networkLookupByName(virConnectPtr conn, static int networkConnectNumOfNetworks(virConnectPtr conn) { - virNetworkDriverStatePtr driver = networkGetDriver(); + virNetworkDriverState *driver = networkGetDriver(); if (virConnectNumOfNetworksEnsureACL(conn) < 0) return -1; @@ -2964,7 +2963,7 @@ networkConnectListNetworks(virConnectPtr conn, char **const names, int maxnames) { - virNetworkDriverStatePtr driver = networkGetDriver(); + virNetworkDriverState *driver = networkGetDriver(); if (virConnectListNetworksEnsureACL(conn) < 0) return -1; @@ -2977,7 +2976,7 @@ networkConnectListNetworks(virConnectPtr conn, static int networkConnectNumOfDefinedNetworks(virConnectPtr conn) { - virNetworkDriverStatePtr driver = networkGetDriver(); + virNetworkDriverState *driver = networkGetDriver(); if (virConnectNumOfDefinedNetworksEnsureACL(conn) < 0) return -1; @@ -2993,7 +2992,7 @@ networkConnectListDefinedNetworks(virConnectPtr conn, char **const names, int maxnames) { - virNetworkDriverStatePtr driver = networkGetDriver(); + virNetworkDriverState *driver = networkGetDriver(); if (virConnectListDefinedNetworksEnsureACL(conn) < 0) return -1; @@ -3009,7 +3008,7 @@ networkConnectListAllNetworks(virConnectPtr conn, virNetworkPtr **nets, unsigned int flags) { - virNetworkDriverStatePtr driver = networkGetDriver(); + virNetworkDriverState *driver = networkGetDriver(); virCheckFlags(VIR_CONNECT_LIST_NETWORKS_FILTERS_ALL, -1); @@ -3030,7 +3029,7 @@ networkConnectNetworkEventRegisterAny(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - virNetworkDriverStatePtr driver = networkGetDriver(); + virNetworkDriverState *driver = networkGetDriver(); int ret = -1; if (virConnectNetworkEventRegisterAnyEnsureACL(conn) < 0) @@ -3049,7 +3048,7 @@ static int networkConnectNetworkEventDeregisterAny(virConnectPtr conn, int callbackID) { - virNetworkDriverStatePtr driver = networkGetDriver(); + virNetworkDriverState *driver = networkGetDriver(); if (virConnectNetworkEventDeregisterAnyEnsureACL(conn) < 0) return -1; @@ -3066,7 +3065,7 @@ networkConnectNetworkEventDeregisterAny(virConnectPtr conn, static int networkIsActive(virNetworkPtr net) { - virNetworkObjPtr obj; + virNetworkObj *obj; int ret = -1; if (!(obj = networkObjFromNetwork(net))) @@ -3086,7 +3085,7 @@ networkIsActive(virNetworkPtr net) static int networkIsPersistent(virNetworkPtr net) { - virNetworkObjPtr obj; + virNetworkObj *obj; int ret = -1; if (!(obj = networkObjFromNetwork(net))) @@ -3110,8 +3109,8 @@ networkIsPersistent(virNetworkPtr net) * than libvirt). Set this network's name to that new name. */ static int -networkFindUnusedBridgeName(virNetworkObjListPtr nets, - virNetworkDefPtr def) +networkFindUnusedBridgeName(virNetworkObjList *nets, + virNetworkDef *def) { int id = 0; const char *templ = "virbr%d"; @@ -3153,8 +3152,8 @@ networkFindUnusedBridgeName(virNetworkObjListPtr nets, * network's bridge name. */ static int -networkBridgeNameValidate(virNetworkObjListPtr nets, - virNetworkDefPtr def) +networkBridgeNameValidate(virNetworkObjList *nets, + virNetworkDef *def) { virMutexLock(&bridgeNameValidateMutex); @@ -3181,13 +3180,13 @@ networkBridgeNameValidate(virNetworkObjListPtr nets, static int -networkValidate(virNetworkDriverStatePtr driver, - virNetworkDefPtr def) +networkValidate(virNetworkDriverState *driver, + virNetworkDef *def) { size_t i, j; bool vlanUsed, vlanAllowed, badVlanUse = false; - virPortGroupDefPtr defaultPortGroup = NULL; - virNetworkIPDefPtr ipdef; + virPortGroupDef *defaultPortGroup = NULL; + virNetworkIPDef *ipdef; bool ipv4def = false, ipv6def = false; bool bandwidthAllowed = false; bool usesInterface = false, usesAddress = false; @@ -3290,7 +3289,7 @@ networkValidate(virNetworkDriverStatePtr driver, * the type of each. */ for (i = 0; i < def->forward.nifs; i++) { - virNetworkForwardIfDefPtr iface = &def->forward.ifs[i]; + virNetworkForwardIfDef *iface = &def->forward.ifs[i]; g_autofree char *sysfs_path = NULL; switch ((virNetworkForwardHostdevDeviceType)iface->type) { @@ -3480,12 +3479,12 @@ static virNetworkPtr networkCreateXML(virConnectPtr conn, const char *xml) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkDefPtr newDef; - virNetworkObjPtr obj = NULL; - virNetworkDefPtr def; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkDef *newDef; + virNetworkObj *obj = NULL; + virNetworkDef *def; virNetworkPtr net = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(newDef = virNetworkDefParseString(xml, network_driver->xmlopt))) goto cleanup; @@ -3532,12 +3531,12 @@ static virNetworkPtr networkDefineXML(virConnectPtr conn, const char *xml) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkDefPtr def = NULL; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkDef *def = NULL; bool freeDef = true; - virNetworkObjPtr obj = NULL; + virNetworkObj *obj = NULL; virNetworkPtr net = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(def = virNetworkDefParseString(xml, network_driver->xmlopt))) goto cleanup; @@ -3587,12 +3586,12 @@ networkDefineXML(virConnectPtr conn, static int networkUndefine(virNetworkPtr net) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkObjPtr obj; - virNetworkDefPtr def; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkObj *obj; + virNetworkDef *def; int ret = -1; bool active = false; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(obj = networkObjFromNetwork(net))) goto cleanup; @@ -3650,12 +3649,12 @@ networkUpdate(virNetworkPtr net, const char *xml, unsigned int flags) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkObjPtr obj = NULL; - virNetworkDefPtr def; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkObj *obj = NULL; + virNetworkDef *def; int isActive, ret = -1; size_t i; - virNetworkIPDefPtr ipdef; + virNetworkIPDef *ipdef; bool oldDhcpActive = false; bool needFirewallRefresh = false; @@ -3841,11 +3840,11 @@ networkUpdate(virNetworkPtr net, static int networkCreate(virNetworkPtr net) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkObjPtr obj; - virNetworkDefPtr def; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkObj *obj; + virNetworkDef *def; int ret = -1; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(obj = networkObjFromNetwork(net))) goto cleanup; @@ -3872,11 +3871,11 @@ networkCreate(virNetworkPtr net) static int networkDestroy(virNetworkPtr net) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkObjPtr obj; - virNetworkDefPtr def; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkObj *obj; + virNetworkDef *def; int ret = -1; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(obj = networkObjFromNetwork(net))) goto cleanup; @@ -3922,10 +3921,10 @@ static char * networkGetXMLDesc(virNetworkPtr net, unsigned int flags) { - virNetworkObjPtr obj; - virNetworkDefPtr curDef; - virNetworkDefPtr def; - virNetworkDefPtr newDef; + virNetworkObj *obj; + virNetworkDef *curDef; + virNetworkDef *def; + virNetworkDef *newDef; char *ret = NULL; virCheckFlags(VIR_NETWORK_XML_INACTIVE, NULL); @@ -3954,8 +3953,8 @@ networkGetXMLDesc(virNetworkPtr net, static char * networkGetBridgeName(virNetworkPtr net) { - virNetworkObjPtr obj; - virNetworkDefPtr def; + virNetworkObj *obj; + virNetworkDef *def; char *bridge = NULL; if (!(obj = networkObjFromNetwork(net))) @@ -3984,7 +3983,7 @@ static int networkGetAutostart(virNetworkPtr net, int *autostart) { - virNetworkObjPtr obj; + virNetworkObj *obj; int ret = -1; if (!(obj = networkObjFromNetwork(net))) @@ -4006,9 +4005,9 @@ static int networkSetAutostart(virNetworkPtr net, int autostart) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkObjPtr obj; - virNetworkDefPtr def; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkObj *obj; + virNetworkDef *def; g_autofree char *configFile = NULL; g_autofree char *autostartLink = NULL; bool new_autostart; @@ -4078,7 +4077,7 @@ networkGetDHCPLeases(virNetworkPtr net, virNetworkDHCPLeasePtr **leases, unsigned int flags) { - virNetworkDriverStatePtr driver = networkGetDriver(); + virNetworkDriverState *driver = networkGetDriver(); size_t i; size_t nleases = 0; int rv = -1; @@ -4089,8 +4088,8 @@ networkGetDHCPLeases(virNetworkPtr net, g_autofree char *custom_lease_file = NULL; g_autoptr(virJSONValue) leases_array = NULL; g_autofree virNetworkDHCPLeasePtr *leases_ret = NULL; - virNetworkObjPtr obj; - virNetworkDefPtr def; + virNetworkObj *obj; + virNetworkDef *def; virMacAddr mac_addr; virCheckFlags(0, -1); @@ -4150,7 +4149,7 @@ networkGetDHCPLeases(virNetworkPtr net, currtime = (long long)time(NULL); for (i = 0; i < size; i++) { - virJSONValuePtr lease_tmp = virJSONValueArrayGet(leases_array, i); + virJSONValue *lease_tmp = virJSONValueArrayGet(leases_array, i); long long expirytime_tmp = -1; const char *mac_tmp = NULL; @@ -4203,7 +4202,7 @@ networkGetDHCPLeases(virNetworkPtr net, /* Obtain prefix */ for (j = 0; j < def->nips; j++) { - virNetworkIPDefPtr ipdef_tmp = &def->ips[j]; + virNetworkIPDef *ipdef_tmp = &def->ips[j]; if (ipv6 && VIR_SOCKET_ADDR_IS_FAMILY(&ipdef_tmp->address, AF_INET6)) { @@ -4257,9 +4256,9 @@ networkGetDHCPLeases(virNetworkPtr net, /* A unified function to log network connections and disconnections */ static void -networkLogAllocation(virNetworkDefPtr netdef, - virNetworkForwardIfDefPtr dev, - virMacAddrPtr mac, +networkLogAllocation(virNetworkDef *netdef, + virNetworkForwardIfDef *dev, + virMacAddr *mac, bool inUse) { char macStr[VIR_MAC_STRING_BUFLEN]; @@ -4306,15 +4305,15 @@ networkLogAllocation(virNetworkDefPtr netdef, * Returns 0 on success, -1 on failure. */ static int -networkAllocatePort(virNetworkObjPtr obj, - virNetworkPortDefPtr port) +networkAllocatePort(virNetworkObj *obj, + virNetworkPortDef *port) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkDefPtr netdef = NULL; - virPortGroupDefPtr portgroup = NULL; - virNetworkForwardIfDefPtr dev = NULL; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkDef *netdef = NULL; + virPortGroupDef *portgroup = NULL; + virNetworkForwardIfDef *dev = NULL; size_t i; - virNetDevVPortProfilePtr portprofile = NULL; + virNetDevVPortProfile *portprofile = NULL; netdef = virNetworkObjGetDef(obj); VIR_DEBUG("Allocating port from net %s", netdef->name); @@ -4341,7 +4340,7 @@ networkAllocatePort(virNetworkObjPtr obj, } if (port->vlan.nTags == 0) { - virNetDevVlanPtr vlan = NULL; + virNetDevVlan *vlan = NULL; if (portgroup && portgroup->vlan.nTags > 0) vlan = &portgroup->vlan; else if (netdef->vlan.nTags > 0) @@ -4604,11 +4603,11 @@ networkAllocatePort(virNetworkObjPtr obj, * order. */ static int -networkNotifyPort(virNetworkObjPtr obj, - virNetworkPortDefPtr port) +networkNotifyPort(virNetworkObj *obj, + virNetworkPortDef *port) { - virNetworkDefPtr netdef; - virNetworkForwardIfDefPtr dev = NULL; + virNetworkDef *netdef; + virNetworkForwardIfDef *dev = NULL; size_t i; netdef = virNetworkObjGetDef(obj); @@ -4759,12 +4758,12 @@ networkNotifyPort(virNetworkObjPtr obj, * Returns 0 on success, -1 on failure. */ static int -networkReleasePort(virNetworkObjPtr obj, - virNetworkPortDefPtr port) +networkReleasePort(virNetworkObj *obj, + virNetworkPortDef *port) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkDefPtr netdef; - virNetworkForwardIfDefPtr dev = NULL; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkDef *netdef; + virNetworkForwardIfDef *dev = NULL; size_t i; netdef = virNetworkObjGetDef(obj); @@ -4881,14 +4880,14 @@ networkReleasePort(virNetworkObjPtr obj, * 1 if no QoS is set (@new_rate untouched) */ static int -networkCheckBandwidth(virNetworkObjPtr obj, - virNetDevBandwidthPtr ifaceBand, - virNetDevBandwidthPtr oldBandwidth, - virMacAddrPtr ifaceMac, +networkCheckBandwidth(virNetworkObj *obj, + virNetDevBandwidth *ifaceBand, + virNetDevBandwidth *oldBandwidth, + virMacAddr *ifaceMac, unsigned long long *new_rate) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); - virNetDevBandwidthPtr netBand = def->bandwidth; + virNetworkDef *def = virNetworkObjGetDef(obj); + virNetDevBandwidth *netBand = def->bandwidth; unsigned long long tmp_floor_sum = virNetworkObjGetFloorSum(obj); unsigned long long tmp_new_rate = 0; char ifmac[VIR_MAC_STRING_BUFLEN]; @@ -4980,10 +4979,10 @@ networkCheckBandwidth(virNetworkObjPtr obj, * Returns next free class ID or -1 if none is available. */ static ssize_t -networkNextClassID(virNetworkObjPtr obj) +networkNextClassID(virNetworkObj *obj) { ssize_t ret = 0; - virBitmapPtr classIdMap = virNetworkObjGetClassIdMap(obj); + virBitmap *classIdMap = virNetworkObjGetClassIdMap(obj); if ((ret = virBitmapNextClearBit(classIdMap, -1)) < 0) ret = virBitmapSize(classIdMap); @@ -4996,15 +4995,15 @@ networkNextClassID(virNetworkObjPtr obj) static int -networkPlugBandwidthImpl(virNetworkObjPtr obj, - virMacAddrPtr mac, - virNetDevBandwidthPtr ifaceBand, +networkPlugBandwidthImpl(virNetworkObj *obj, + virMacAddr *mac, + virNetDevBandwidth *ifaceBand, unsigned int *class_id, unsigned long long new_rate) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkDefPtr def = virNetworkObjGetDef(obj); - virBitmapPtr classIdMap = virNetworkObjGetClassIdMap(obj); + virNetworkDriverState *driver = networkGetDriver(); + virNetworkDef *def = virNetworkObjGetDef(obj); + virBitmap *classIdMap = virNetworkObjGetClassIdMap(obj); unsigned long long tmp_floor_sum = virNetworkObjGetFloorSum(obj); ssize_t next_id = 0; int plug_ret; @@ -5049,9 +5048,9 @@ networkPlugBandwidthImpl(virNetworkObjPtr obj, static int -networkPlugBandwidth(virNetworkObjPtr obj, - virMacAddrPtr mac, - virNetDevBandwidthPtr ifaceBand, +networkPlugBandwidth(virNetworkObj *obj, + virMacAddr *mac, + virNetDevBandwidth *ifaceBand, unsigned int *class_id) { int plug_ret; @@ -5078,14 +5077,14 @@ networkPlugBandwidth(virNetworkObjPtr obj, static int -networkUnplugBandwidth(virNetworkObjPtr obj, - virNetDevBandwidthPtr ifaceBand, +networkUnplugBandwidth(virNetworkObj *obj, + virNetDevBandwidth *ifaceBand, unsigned int *class_id) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); - virBitmapPtr classIdMap = virNetworkObjGetClassIdMap(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); + virBitmap *classIdMap = virNetworkObjGetClassIdMap(obj); unsigned long long tmp_floor_sum = virNetworkObjGetFloorSum(obj); - virNetworkDriverStatePtr driver = networkGetDriver(); + virNetworkDriverState *driver = networkGetDriver(); int ret = 0; unsigned long long new_rate; @@ -5133,10 +5132,10 @@ networkUnplugBandwidth(virNetworkObjPtr obj, static void -networkNetworkObjTaint(virNetworkObjPtr obj, +networkNetworkObjTaint(virNetworkObj *obj, virNetworkTaintFlags taint) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); if (virNetworkObjTaint(obj, taint)) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -5149,14 +5148,14 @@ networkNetworkObjTaint(virNetworkObjPtr obj, static int -networkUpdatePortBandwidth(virNetworkObjPtr obj, - virMacAddrPtr mac, +networkUpdatePortBandwidth(virNetworkObj *obj, + virMacAddr *mac, unsigned int *class_id, - virNetDevBandwidthPtr oldBandwidth, - virNetDevBandwidthPtr newBandwidth) + virNetDevBandwidth *oldBandwidth, + virNetDevBandwidth *newBandwidth) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkDefPtr def; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkDef *def; unsigned long long tmp_floor_sum; unsigned long long new_rate = 0; unsigned long long old_floor, new_floor; @@ -5239,9 +5238,9 @@ static virNetworkPortPtr networkPortLookupByUUID(virNetworkPtr net, const unsigned char *uuid) { - virNetworkObjPtr obj; - virNetworkDefPtr def; - virNetworkPortDefPtr portdef = NULL; + virNetworkObj *obj; + virNetworkDef *def; + virNetworkPortDef *portdef = NULL; virNetworkPortPtr ret = NULL; char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(uuid, uuidstr); @@ -5277,9 +5276,9 @@ networkPortCreateXML(virNetworkPtr net, const char *xmldesc, unsigned int flags) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkObjPtr obj; - virNetworkDefPtr def; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkObj *obj; + virNetworkDef *def; g_autoptr(virNetworkPortDef) portdef = NULL; virNetworkPortPtr ret = NULL; int rc; @@ -5347,9 +5346,9 @@ static char * networkPortGetXMLDesc(virNetworkPortPtr port, unsigned int flags) { - virNetworkObjPtr obj; - virNetworkDefPtr def; - virNetworkPortDefPtr portdef = NULL; + virNetworkObj *obj; + virNetworkDef *def; + virNetworkPortDef *portdef = NULL; char *ret = NULL; virCheckFlags(0, NULL); @@ -5385,10 +5384,10 @@ static int networkPortDelete(virNetworkPortPtr port, unsigned int flags) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkObjPtr obj; - virNetworkDefPtr def; - virNetworkPortDefPtr portdef; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkObj *obj; + virNetworkDef *def; + virNetworkPortDef *portdef; int ret = -1; virCheckFlags(0, -1); @@ -5429,10 +5428,10 @@ networkPortSetParameters(virNetworkPortPtr port, int nparams, unsigned int flags) { - virNetworkDriverStatePtr driver = networkGetDriver(); - virNetworkObjPtr obj; - virNetworkDefPtr def; - virNetworkPortDefPtr portdef; + virNetworkDriverState *driver = networkGetDriver(); + virNetworkObj *obj; + virNetworkDef *def; + virNetworkPortDef *portdef; g_autoptr(virNetDevBandwidth) bandwidth = NULL; g_autofree char *dir = NULL; int ret = -1; @@ -5520,9 +5519,9 @@ networkPortGetParameters(virNetworkPortPtr port, int *nparams, unsigned int flags) { - virNetworkObjPtr obj; - virNetworkDefPtr def; - virNetworkPortDefPtr portdef; + virNetworkObj *obj; + virNetworkDef *def; + virNetworkPortDef *portdef; int maxparams = 0; int ret = -1; @@ -5590,8 +5589,8 @@ networkListAllPorts(virNetworkPtr net, virNetworkPortPtr **ports, unsigned int flags) { - virNetworkObjPtr obj; - virNetworkDefPtr def; + virNetworkObj *obj; + virNetworkDef *def; int ret = -1; virCheckFlags(0, -1); diff --git a/src/network/bridge_driver.h b/src/network/bridge_driver.h index 2613fc629d..9475345669 100644 --- a/src/network/bridge_driver.h +++ b/src/network/bridge_driver.h @@ -27,16 +27,16 @@ #include "virdnsmasq.h" #include "virnetworkobj.h" -virNetworkXMLOptionPtr +virNetworkXMLOption * networkDnsmasqCreateXMLConf(void); int networkRegister(void); int -networkDnsmasqConfContents(virNetworkObjPtr obj, +networkDnsmasqConfContents(virNetworkObj *obj, const char *pidfile, char **configstr, char **hostsfilestr, dnsmasqContext *dctx, - dnsmasqCapsPtr caps); + dnsmasqCaps *caps); diff --git a/src/network/bridge_driver_linux.c b/src/network/bridge_driver_linux.c index 7f765bcf99..d2eab33e5f 100644 --- a/src/network/bridge_driver_linux.c +++ b/src/network/bridge_driver_linux.c @@ -91,14 +91,14 @@ static void networkSetupPrivateChains(void) static int -networkHasRunningNetworksWithFWHelper(virNetworkObjPtr obj, +networkHasRunningNetworksWithFWHelper(virNetworkObj *obj, void *opaque) { bool *activeWithFW = opaque; virObjectLock(obj); if (virNetworkObjIsActive(obj)) { - virNetworkDefPtr def = virNetworkObjGetDef(obj); + virNetworkDef *def = virNetworkObjGetDef(obj); switch ((virNetworkForwardType) def->forward.type) { case VIR_NETWORK_FORWARD_NONE: @@ -132,7 +132,7 @@ networkHasRunningNetworksWithFWHelper(virNetworkObjPtr obj, static bool -networkHasRunningNetworksWithFW(virNetworkDriverStatePtr driver) +networkHasRunningNetworksWithFW(virNetworkDriverState *driver) { bool activeWithFW = false; @@ -144,7 +144,7 @@ networkHasRunningNetworksWithFW(virNetworkDriverStatePtr driver) void -networkPreReloadFirewallRules(virNetworkDriverStatePtr driver, +networkPreReloadFirewallRules(virNetworkDriverState *driver, bool startup, bool force) { @@ -215,7 +215,7 @@ void networkPostReloadFirewallRules(bool startup G_GNUC_UNUSED) * other scenarios where we can ruin host network connectivity. * XXX: Using a proper library is preferred over parsing /proc */ -int networkCheckRouteCollision(virNetworkDefPtr def) +int networkCheckRouteCollision(virNetworkDef *def) { int len; char *cur; @@ -244,8 +244,8 @@ int networkCheckRouteCollision(virNetworkDefPtr def) while (cur) { char iface[17], dest[128], mask[128]; unsigned int addr_val, mask_val; - virNetworkIPDefPtr ipdef; - virNetDevIPRoutePtr routedef; + virNetworkIPDef *ipdef; + virNetDevIPRoute *routedef; int num; size_t i; @@ -305,7 +305,7 @@ int networkCheckRouteCollision(virNetworkDefPtr def) i++) { virSocketAddr r_mask, r_addr; - virSocketAddrPtr tmp_addr = virNetDevIPRouteGetAddress(routedef); + virSocketAddr *tmp_addr = virNetDevIPRouteGetAddress(routedef); int r_prefix = virNetDevIPRouteGetPrefix(routedef); if (!tmp_addr || @@ -335,9 +335,9 @@ static const char networkLocalMulticastIPv6[] = "ff02::/16"; static const char networkLocalBroadcast[] = "255.255.255.255/32"; static int -networkAddMasqueradingFirewallRules(virFirewallPtr fw, - virNetworkDefPtr def, - virNetworkIPDefPtr ipdef) +networkAddMasqueradingFirewallRules(virFirewall *fw, + virNetworkDef *def, + virNetworkIPDef *ipdef) { int prefix = virNetworkIPDefPrefix(ipdef); const char *forwardIf = virNetworkDefForwardIf(def, 0); @@ -452,9 +452,9 @@ networkAddMasqueradingFirewallRules(virFirewallPtr fw, } static int -networkRemoveMasqueradingFirewallRules(virFirewallPtr fw, - virNetworkDefPtr def, - virNetworkIPDefPtr ipdef) +networkRemoveMasqueradingFirewallRules(virFirewall *fw, + virNetworkDef *def, + virNetworkIPDef *ipdef) { int prefix = virNetworkIPDefPrefix(ipdef); const char *forwardIf = virNetworkDefForwardIf(def, 0); @@ -525,9 +525,9 @@ networkRemoveMasqueradingFirewallRules(virFirewallPtr fw, static int -networkAddRoutingFirewallRules(virFirewallPtr fw, - virNetworkDefPtr def, - virNetworkIPDefPtr ipdef) +networkAddRoutingFirewallRules(virFirewall *fw, + virNetworkDef *def, + virNetworkIPDef *ipdef) { int prefix = virNetworkIPDefPrefix(ipdef); const char *forwardIf = virNetworkDefForwardIf(def, 0); @@ -560,9 +560,9 @@ networkAddRoutingFirewallRules(virFirewallPtr fw, static int -networkRemoveRoutingFirewallRules(virFirewallPtr fw, - virNetworkDefPtr def, - virNetworkIPDefPtr ipdef) +networkRemoveRoutingFirewallRules(virFirewall *fw, + virNetworkDef *def, + virNetworkIPDef *ipdef) { int prefix = virNetworkIPDefPrefix(ipdef); const char *forwardIf = virNetworkDefForwardIf(def, 0); @@ -589,11 +589,11 @@ networkRemoveRoutingFirewallRules(virFirewallPtr fw, static void -networkAddGeneralIPv4FirewallRules(virFirewallPtr fw, - virNetworkDefPtr def) +networkAddGeneralIPv4FirewallRules(virFirewall *fw, + virNetworkDef *def) { size_t i; - virNetworkIPDefPtr ipv4def; + virNetworkIPDef *ipv4def; /* First look for first IPv4 address that has dhcp or tftpboot defined. */ /* We support dhcp config on 1 IPv4 interface only. */ @@ -631,11 +631,11 @@ networkAddGeneralIPv4FirewallRules(virFirewallPtr fw, } static void -networkRemoveGeneralIPv4FirewallRules(virFirewallPtr fw, - virNetworkDefPtr def) +networkRemoveGeneralIPv4FirewallRules(virFirewall *fw, + virNetworkDef *def) { size_t i; - virNetworkIPDefPtr ipv4def; + virNetworkIPDef *ipv4def; for (i = 0; (ipv4def = virNetworkDefGetIPByIndex(def, AF_INET, i)); @@ -671,8 +671,8 @@ networkRemoveGeneralIPv4FirewallRules(virFirewallPtr fw, * If any IPv6 addresses are defined, then add the rules for regular operation. */ static void -networkAddGeneralIPv6FirewallRules(virFirewallPtr fw, - virNetworkDefPtr def) +networkAddGeneralIPv6FirewallRules(virFirewall *fw, + virNetworkDef *def) { if (!virNetworkDefGetIPByIndex(def, AF_INET6, 0) && !def->ipv6nogw) { @@ -699,8 +699,8 @@ networkAddGeneralIPv6FirewallRules(virFirewallPtr fw, } static void -networkRemoveGeneralIPv6FirewallRules(virFirewallPtr fw, - virNetworkDefPtr def) +networkRemoveGeneralIPv6FirewallRules(virFirewall *fw, + virNetworkDef *def) { if (!virNetworkDefGetIPByIndex(def, AF_INET6, 0) && !def->ipv6nogw) { @@ -726,8 +726,8 @@ networkRemoveGeneralIPv6FirewallRules(virFirewallPtr fw, static void -networkAddGeneralFirewallRules(virFirewallPtr fw, - virNetworkDefPtr def) +networkAddGeneralFirewallRules(virFirewall *fw, + virNetworkDef *def) { networkAddGeneralIPv4FirewallRules(fw, def); networkAddGeneralIPv6FirewallRules(fw, def); @@ -735,19 +735,19 @@ networkAddGeneralFirewallRules(virFirewallPtr fw, static void -networkRemoveGeneralFirewallRules(virFirewallPtr fw, - virNetworkDefPtr def) +networkRemoveGeneralFirewallRules(virFirewall *fw, + virNetworkDef *def) { networkRemoveGeneralIPv4FirewallRules(fw, def); networkRemoveGeneralIPv6FirewallRules(fw, def); } static void -networkAddChecksumFirewallRules(virFirewallPtr fw, - virNetworkDefPtr def) +networkAddChecksumFirewallRules(virFirewall *fw, + virNetworkDef *def) { size_t i; - virNetworkIPDefPtr ipv4def; + virNetworkIPDef *ipv4def; /* First look for first IPv4 address that has dhcp or tftpboot defined. */ /* We support dhcp config on 1 IPv4 interface only. */ @@ -769,11 +769,11 @@ networkAddChecksumFirewallRules(virFirewallPtr fw, static void -networkRemoveChecksumFirewallRules(virFirewallPtr fw, - virNetworkDefPtr def) +networkRemoveChecksumFirewallRules(virFirewall *fw, + virNetworkDef *def) { size_t i; - virNetworkIPDefPtr ipv4def; + virNetworkIPDef *ipv4def; /* First look for first IPv4 address that has dhcp or tftpboot defined. */ /* We support dhcp config on 1 IPv4 interface only. */ @@ -790,9 +790,9 @@ networkRemoveChecksumFirewallRules(virFirewallPtr fw, static int -networkAddIPSpecificFirewallRules(virFirewallPtr fw, - virNetworkDefPtr def, - virNetworkIPDefPtr ipdef) +networkAddIPSpecificFirewallRules(virFirewall *fw, + virNetworkDef *def, + virNetworkIPDef *ipdef) { /* NB: in the case of IPv6, routing rules are added when the * forward mode is NAT. This is because IPv6 has no NAT. @@ -812,9 +812,9 @@ networkAddIPSpecificFirewallRules(virFirewallPtr fw, static int -networkRemoveIPSpecificFirewallRules(virFirewallPtr fw, - virNetworkDefPtr def, - virNetworkIPDefPtr ipdef) +networkRemoveIPSpecificFirewallRules(virFirewall *fw, + virNetworkDef *def, + virNetworkIPDef *ipdef) { if (def->forward.type == VIR_NETWORK_FORWARD_NAT) { if (VIR_SOCKET_ADDR_IS_FAMILY(&ipdef->address, AF_INET) || @@ -830,10 +830,10 @@ networkRemoveIPSpecificFirewallRules(virFirewallPtr fw, /* Add all rules for all ip addresses (and general rules) on a network */ -int networkAddFirewallRules(virNetworkDefPtr def) +int networkAddFirewallRules(virNetworkDef *def) { size_t i; - virNetworkIPDefPtr ipdef; + virNetworkIPDef *ipdef; g_autoptr(virFirewall) fw = virFirewallNew(); if (virOnce(&createdOnce, networkSetupPrivateChains) < 0) @@ -948,10 +948,10 @@ int networkAddFirewallRules(virNetworkDefPtr def) } /* Remove all rules for all ip addresses (and general rules) on a network */ -void networkRemoveFirewallRules(virNetworkDefPtr def) +void networkRemoveFirewallRules(virNetworkDef *def) { size_t i; - virNetworkIPDefPtr ipdef; + virNetworkIPDef *ipdef; g_autoptr(virFirewall) fw = virFirewallNew(); virFirewallStartTransaction(fw, VIR_FIREWALL_TRANSACTION_IGNORE_ERRORS); diff --git a/src/network/bridge_driver_nop.c b/src/network/bridge_driver_nop.c index db89c10023..6eee6043e6 100644 --- a/src/network/bridge_driver_nop.c +++ b/src/network/bridge_driver_nop.c @@ -19,7 +19,7 @@ #include -void networkPreReloadFirewallRules(virNetworkDriverStatePtr driver G_GNUC_UNUSED, +void networkPreReloadFirewallRules(virNetworkDriverState *driver G_GNUC_UNUSED, bool startup G_GNUC_UNUSED, bool force G_GNUC_UNUSED) { @@ -31,16 +31,16 @@ void networkPostReloadFirewallRules(bool startup G_GNUC_UNUSED) } -int networkCheckRouteCollision(virNetworkDefPtr def G_GNUC_UNUSED) +int networkCheckRouteCollision(virNetworkDef *def G_GNUC_UNUSED) { return 0; } -int networkAddFirewallRules(virNetworkDefPtr def G_GNUC_UNUSED) +int networkAddFirewallRules(virNetworkDef *def G_GNUC_UNUSED) { return 0; } -void networkRemoveFirewallRules(virNetworkDefPtr def G_GNUC_UNUSED) +void networkRemoveFirewallRules(virNetworkDef *def G_GNUC_UNUSED) { } diff --git a/src/network/bridge_driver_platform.h b/src/network/bridge_driver_platform.h index 48ab52c160..884fa82831 100644 --- a/src/network/bridge_driver_platform.h +++ b/src/network/bridge_driver_platform.h @@ -38,7 +38,7 @@ struct _virNetworkDriverState { int lockFD; /* Immutable pointer, self-locking APIs */ - virNetworkObjListPtr networks; + virNetworkObjList *networks; /* Immutable pointers, Immutable objects */ char *networkConfigDir; @@ -51,22 +51,21 @@ struct _virNetworkDriverState { /* Require lock to get a reference on the object, * lockless access thereafter */ - dnsmasqCapsPtr dnsmasqCaps; + dnsmasqCaps *dnsmasqCaps; /* Immutable pointer, self-locking APIs */ - virObjectEventStatePtr networkEventState; + virObjectEventState *networkEventState; - virNetworkXMLOptionPtr xmlopt; + virNetworkXMLOption *xmlopt; }; typedef struct _virNetworkDriverState virNetworkDriverState; -typedef virNetworkDriverState *virNetworkDriverStatePtr; -void networkPreReloadFirewallRules(virNetworkDriverStatePtr driver, bool startup, bool force); +void networkPreReloadFirewallRules(virNetworkDriverState *driver, bool startup, bool force); void networkPostReloadFirewallRules(bool startup); -int networkCheckRouteCollision(virNetworkDefPtr def); +int networkCheckRouteCollision(virNetworkDef *def); -int networkAddFirewallRules(virNetworkDefPtr def); +int networkAddFirewallRules(virNetworkDef *def); -void networkRemoveFirewallRules(virNetworkDefPtr def); +void networkRemoveFirewallRules(virNetworkDef *def); diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c index c11b8d89ab..e33d4a965b 100644 --- a/src/node_device/node_device_driver.c +++ b/src/node_device/node_device_driver.c @@ -45,12 +45,12 @@ #define VIR_FROM_THIS VIR_FROM_NODEDEV -virNodeDeviceDriverStatePtr driver; +virNodeDeviceDriverState *driver; virDrvOpenStatus nodeConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -106,7 +106,7 @@ int nodeConnectIsAlive(virConnectPtr conn G_GNUC_UNUSED) * the driver name for a device each time its entry is used. */ static int -nodeDeviceUpdateDriverName(virNodeDeviceDefPtr def) +nodeDeviceUpdateDriverName(virNodeDeviceDef *def) { g_autofree char *driver_link = NULL; g_autofree char *devpath = NULL; @@ -136,7 +136,7 @@ nodeDeviceUpdateDriverName(virNodeDeviceDefPtr def) #else /* XXX: Implement me for non-linux */ static int -nodeDeviceUpdateDriverName(virNodeDeviceDefPtr def G_GNUC_UNUSED) +nodeDeviceUpdateDriverName(virNodeDeviceDef *def G_GNUC_UNUSED) { return 0; } @@ -231,10 +231,10 @@ nodeConnectListAllNodeDevices(virConnectPtr conn, } -static virNodeDeviceObjPtr +static virNodeDeviceObj * nodeDeviceObjFindByName(const char *name) { - virNodeDeviceObjPtr obj; + virNodeDeviceObj *obj; if (!(obj = virNodeDeviceObjListFindByName(driver->devs, name))) { virReportError(VIR_ERR_NO_NODE_DEVICE, @@ -250,8 +250,8 @@ virNodeDevicePtr nodeDeviceLookupByName(virConnectPtr conn, const char *name) { - virNodeDeviceObjPtr obj; - virNodeDeviceDefPtr def; + virNodeDeviceObj *obj; + virNodeDeviceDef *def; virNodeDevicePtr device = NULL; if (nodeDeviceWaitInit() < 0) @@ -279,8 +279,8 @@ nodeDeviceLookupSCSIHostByWWN(virConnectPtr conn, const char *wwpn, unsigned int flags) { - virNodeDeviceObjPtr obj = NULL; - virNodeDeviceDefPtr def; + virNodeDeviceObj *obj = NULL; + virNodeDeviceDef *def; virNodeDevicePtr device = NULL; virCheckFlags(0, NULL); @@ -310,8 +310,8 @@ nodeDeviceLookupMediatedDeviceByUUID(virConnectPtr conn, const char *uuid, unsigned int flags) { - virNodeDeviceObjPtr obj = NULL; - virNodeDeviceDefPtr def; + virNodeDeviceObj *obj = NULL; + virNodeDeviceDef *def; virNodeDevicePtr device = NULL; virCheckFlags(0, NULL); @@ -334,8 +334,8 @@ char * nodeDeviceGetXMLDesc(virNodeDevicePtr device, unsigned int flags) { - virNodeDeviceObjPtr obj; - virNodeDeviceDefPtr def; + virNodeDeviceObj *obj; + virNodeDeviceDef *def; char *ret = NULL; virCheckFlags(0, NULL); @@ -364,8 +364,8 @@ nodeDeviceGetXMLDesc(virNodeDevicePtr device, char * nodeDeviceGetParent(virNodeDevicePtr device) { - virNodeDeviceObjPtr obj; - virNodeDeviceDefPtr def; + virNodeDeviceObj *obj; + virNodeDeviceDef *def; char *ret = NULL; if (!(obj = nodeDeviceObjFindByName(device->name))) @@ -391,8 +391,8 @@ nodeDeviceGetParent(virNodeDevicePtr device) int nodeDeviceNumOfCaps(virNodeDevicePtr device) { - virNodeDeviceObjPtr obj; - virNodeDeviceDefPtr def; + virNodeDeviceObj *obj; + virNodeDeviceDef *def; int ret = -1; if (!(obj = nodeDeviceObjFindByName(device->name))) @@ -416,8 +416,8 @@ nodeDeviceListCaps(virNodeDevicePtr device, char **const names, int maxnames) { - virNodeDeviceObjPtr obj; - virNodeDeviceDefPtr def; + virNodeDeviceObj *obj; + virNodeDeviceDef *def; virNodeDevCapType *list = NULL; int ncaps = 0; int ret = -1; @@ -567,9 +567,9 @@ nodeDeviceFindNewSCSIHost(virConnectPtr conn, static bool -nodeDeviceHasCapability(virNodeDeviceDefPtr def, virNodeDevCapType type) +nodeDeviceHasCapability(virNodeDeviceDef *def, virNodeDevCapType type) { - virNodeDevCapsDefPtr cap = def->caps; + virNodeDevCapsDef *cap = def->caps; while (cap != NULL) { if (cap->data.type == type) @@ -584,10 +584,10 @@ nodeDeviceHasCapability(virNodeDeviceDefPtr def, virNodeDevCapType type) /* format a json string that provides configuration information about this mdev * to the mdevctl utility */ static int -nodeDeviceDefToMdevctlConfig(virNodeDeviceDefPtr def, char **buf) +nodeDeviceDefToMdevctlConfig(virNodeDeviceDef *def, char **buf) { size_t i; - virNodeDevCapMdevPtr mdev = &def->caps->data.mdev; + virNodeDevCapMdev *mdev = &def->caps->data.mdev; g_autoptr(virJSONValue) json = virJSONValueNewObject(); if (virJSONValueObjectAppendString(json, "mdev_type", mdev->type) < 0) @@ -600,7 +600,7 @@ nodeDeviceDefToMdevctlConfig(virNodeDeviceDefPtr def, char **buf) g_autoptr(virJSONValue) attributes = virJSONValueNewArray(); for (i = 0; i < mdev->nattributes; i++) { - virMediatedDeviceAttrPtr attr = mdev->attributes[i]; + virMediatedDeviceAttr *attr = mdev->attributes[i]; g_autoptr(virJSONValue) jsonattr = virJSONValueNewObject(); if (virJSONValueObjectAppendString(jsonattr, attr->name, attr->value) < 0) @@ -625,10 +625,10 @@ nodeDeviceDefToMdevctlConfig(virNodeDeviceDefPtr def, char **buf) static char * nodeDeviceFindAddressByName(const char *name) { - virNodeDeviceDefPtr def = NULL; - virNodeDevCapsDefPtr caps = NULL; + virNodeDeviceDef *def = NULL; + virNodeDevCapsDef *caps = NULL; char *addr = NULL; - virNodeDeviceObjPtr dev = virNodeDeviceObjListFindByName(driver->devs, name); + virNodeDeviceObj *dev = virNodeDeviceObjListFindByName(driver->devs, name); if (!dev) { virReportError(VIR_ERR_NO_NODE_DEVICE, @@ -707,7 +707,7 @@ nodeDeviceGetMdevctlDefineStartCommand(virNodeDeviceDef *def, char **uuid_out, char **errmsg) { - virCommandPtr cmd; + virCommand *cmd; g_autofree char *json = NULL; g_autofree char *parent_addr = nodeDeviceFindAddressByName(def->parent); @@ -760,7 +760,7 @@ nodeDeviceGetMdevctlDefineCommand(virNodeDeviceDef *def, static int -virMdevctlStart(virNodeDeviceDefPtr def, char **uuid, char **errmsg) +virMdevctlStart(virNodeDeviceDef *def, char **uuid, char **errmsg) { int status; g_autoptr(virCommand) cmd = nodeDeviceGetMdevctlStartCommand(def, uuid, @@ -781,7 +781,7 @@ virMdevctlStart(virNodeDeviceDefPtr def, char **uuid, char **errmsg) static int -virMdevctlDefine(virNodeDeviceDefPtr def, char **uuid, char **errmsg) +virMdevctlDefine(virNodeDeviceDef *def, char **uuid, char **errmsg) { int status; g_autoptr(virCommand) cmd = nodeDeviceGetMdevctlDefineCommand(def, uuid, errmsg); @@ -803,7 +803,7 @@ virMdevctlDefine(virNodeDeviceDefPtr def, char **uuid, char **errmsg) static virNodeDevicePtr nodeDeviceCreateXMLMdev(virConnectPtr conn, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { g_autofree char *uuid = NULL; g_autofree char *errmsg = NULL; @@ -887,14 +887,14 @@ nodeDeviceCreateXML(virConnectPtr conn, } -virCommandPtr +virCommand * nodeDeviceGetMdevctlStopCommand(const char *uuid, char **errmsg) { - virCommandPtr cmd = virCommandNewArgList(MDEVCTL, - "stop", - "-u", - uuid, - NULL); + virCommand *cmd = virCommandNewArgList(MDEVCTL, + "stop", + "-u", + uuid, + NULL); virCommandSetErrorBuffer(cmd, errmsg); return cmd; @@ -912,7 +912,7 @@ nodeDeviceGetMdevctlUndefineCommand(const char *uuid, char **errmsg) return cmd; } -virCommand* +virCommand * nodeDeviceGetMdevctlCreateCommand(const char *uuid, char **errmsg) { virCommand *cmd = virCommandNewArgList(MDEVCTL, @@ -925,7 +925,7 @@ nodeDeviceGetMdevctlCreateCommand(const char *uuid, char **errmsg) } static int -virMdevctlStop(virNodeDeviceDefPtr def, char **errmsg) +virMdevctlStop(virNodeDeviceDef *def, char **errmsg) { int status; g_autoptr(virCommand) cmd = NULL; @@ -1137,8 +1137,8 @@ int nodeDeviceDestroy(virNodeDevicePtr device) { int ret = -1; - virNodeDeviceObjPtr obj = NULL; - virNodeDeviceDefPtr def; + virNodeDeviceObj *obj = NULL; + virNodeDeviceDef *def; g_autofree char *parent = NULL; g_autofree char *wwnn = NULL; g_autofree char *wwpn = NULL; diff --git a/src/node_device/node_device_driver.h b/src/node_device/node_device_driver.h index 8a935ffed6..5a64558f81 100644 --- a/src/node_device/node_device_driver.h +++ b/src/node_device/node_device_driver.h @@ -39,14 +39,14 @@ nodeDeviceLock(void); void nodeDeviceUnlock(void); -extern virNodeDeviceDriverStatePtr driver; +extern virNodeDeviceDriverState *driver; int nodedevRegister(void); virDrvOpenStatus nodeConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, - virConfPtr conf, + virConf *conf, unsigned int flags); int nodeConnectClose(virConnectPtr conn); int nodeConnectIsSecure(virConnectPtr conn); @@ -122,8 +122,8 @@ int nodeConnectNodeDeviceEventDeregisterAny(virConnectPtr conn, int callbackID); -virCommandPtr -nodeDeviceGetMdevctlStartCommand(virNodeDeviceDefPtr def, +virCommand * +nodeDeviceGetMdevctlStartCommand(virNodeDeviceDef *def, char **uuid_out, char **errmsg); @@ -132,7 +132,7 @@ nodeDeviceGetMdevctlDefineCommand(virNodeDeviceDef *def, char **uuid_out, char **errmsg); -virCommandPtr +virCommand * nodeDeviceGetMdevctlStopCommand(const char *uuid, char **errmsg); @@ -140,7 +140,7 @@ virCommand * nodeDeviceGetMdevctlUndefineCommand(const char *uuid, char **errmsg); -virCommandPtr +virCommand * nodeDeviceGetMdevctlListCommand(bool defined, char **output, char **errmsg); diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index 44f96f5ff9..325ec5b034 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -54,8 +54,6 @@ VIR_LOG_INIT("node_device.node_device_udev"); #endif typedef struct _udevEventData udevEventData; -typedef udevEventData *udevEventDataPtr; - struct _udevEventData { virObjectLockable parent; @@ -76,13 +74,13 @@ struct _udevEventData { int mdevctlTimeout; }; -static virClassPtr udevEventDataClass; +static virClass *udevEventDataClass; static void udevEventDataDispose(void *obj) { struct udev *udev = NULL; - udevEventDataPtr priv = obj; + udevEventData *priv = obj; if (priv->watch != -1) virEventRemoveHandle(priv->watch); @@ -114,10 +112,10 @@ udevEventDataOnceInit(void) VIR_ONCE_GLOBAL_INIT(udevEventData); -static udevEventDataPtr +static udevEventData * udevEventDataNew(void) { - udevEventDataPtr ret = NULL; + udevEventData *ret = NULL; if (udevEventDataInitialize() < 0) return NULL; @@ -323,7 +321,7 @@ udevGetUint64SysfsAttr(struct udev_device *udev_device, static int udevGenerateDeviceName(struct udev_device *device, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, const char *s) { nodeDeviceGenerateName(def, @@ -370,11 +368,11 @@ udevTranslatePCIIds(unsigned int vendor, static int udevProcessPCI(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { - virNodeDevCapPCIDevPtr pci_dev = &def->caps->data.pci_dev; - virPCIEDeviceInfoPtr pci_express = NULL; - virPCIDevicePtr pciDev = NULL; + virNodeDevCapPCIDev *pci_dev = &def->caps->data.pci_dev; + virPCIEDeviceInfo *pci_express = NULL; + virPCIDevice *pciDev = NULL; virPCIDeviceAddress devAddr; int ret = -1; char *p; @@ -490,9 +488,9 @@ drmGetMinorType(int minor) static int udevProcessDRMDevice(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { - virNodeDevCapDRMPtr drm = &def->caps->data.drm; + virNodeDevCapDRM *drm = &def->caps->data.drm; int minor; if (udevGenerateDeviceName(device, def, NULL) != 0) @@ -512,9 +510,9 @@ udevProcessDRMDevice(struct udev_device *device, static int udevProcessUSBDevice(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { - virNodeDevCapUSBDevPtr usb_dev = &def->caps->data.usb_dev; + virNodeDevCapUSBDev *usb_dev = &def->caps->data.usb_dev; if (udevGetUintProperty(device, "BUSNUM", &usb_dev->bus, 10) < 0) return -1; @@ -555,9 +553,9 @@ udevProcessUSBDevice(struct udev_device *device, static int udevProcessUSBInterface(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { - virNodeDevCapUSBIfPtr usb_if = &def->caps->data.usb_if; + virNodeDevCapUSBIf *usb_if = &def->caps->data.usb_if; if (udevGetUintSysfsAttr(device, "bInterfaceNumber", &usb_if->number, 16) < 0) @@ -584,10 +582,10 @@ udevProcessUSBInterface(struct udev_device *device, static int udevProcessNetworkInterface(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { const char *devtype = udev_device_get_devtype(device); - virNodeDevCapNetPtr net = &def->caps->data.net; + virNodeDevCapNet *net = &def->caps->data.net; if (devtype && STREQ(devtype, "wlan")) { net->subtype = VIR_NODE_DEV_CAP_NET_80211; @@ -622,9 +620,9 @@ udevProcessNetworkInterface(struct udev_device *device, static int udevProcessSCSIHost(struct udev_device *device G_GNUC_UNUSED, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { - virNodeDevCapSCSIHostPtr scsi_host = &def->caps->data.scsi_host; + virNodeDevCapSCSIHost *scsi_host = &def->caps->data.scsi_host; g_autofree char *filename = NULL; char *str; @@ -649,10 +647,10 @@ udevProcessSCSIHost(struct udev_device *device G_GNUC_UNUSED, static int udevProcessSCSITarget(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { const char *sysname = NULL; - virNodeDevCapSCSITargetPtr scsi_target = &def->caps->data.scsi_target; + virNodeDevCapSCSITarget *scsi_target = &def->caps->data.scsi_target; sysname = udev_device_get_sysname(device); @@ -668,7 +666,7 @@ udevProcessSCSITarget(struct udev_device *device, static int -udevGetSCSIType(virNodeDeviceDefPtr def G_GNUC_UNUSED, +udevGetSCSIType(virNodeDeviceDef *def G_GNUC_UNUSED, unsigned int type, char **typestring) { @@ -729,11 +727,11 @@ udevGetSCSIType(virNodeDeviceDefPtr def G_GNUC_UNUSED, static int udevProcessSCSIDevice(struct udev_device *device G_GNUC_UNUSED, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { int ret = -1; unsigned int tmp = 0; - virNodeDevCapSCSIPtr scsi = &def->caps->data.scsi; + virNodeDevCapSCSI *scsi = &def->caps->data.scsi; g_autofree char *filename = NULL; char *p = NULL; @@ -774,9 +772,9 @@ udevProcessSCSIDevice(struct udev_device *device G_GNUC_UNUSED, static int udevProcessDisk(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { - virNodeDevCapStoragePtr storage = &def->caps->data.storage; + virNodeDevCapStorage *storage = &def->caps->data.storage; if (udevGetUint64SysfsAttr(device, "size", &storage->num_blocks) < 0) return -1; @@ -793,10 +791,10 @@ udevProcessDisk(struct udev_device *device, static int udevProcessRemoveableMedia(struct udev_device *device, - virNodeDeviceDefPtr def, + virNodeDeviceDef *def, int has_media) { - virNodeDevCapStoragePtr storage = &def->caps->data.storage; + virNodeDevCapStorage *storage = &def->caps->data.storage; int is_removable = 0; if (udevGetIntSysfsAttr(device, "removable", &is_removable, 0) < 0) @@ -836,7 +834,7 @@ udevProcessRemoveableMedia(struct udev_device *device, static int udevProcessCDROM(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { int has_media = 0; @@ -857,7 +855,7 @@ udevProcessCDROM(struct udev_device *device, static int udevProcessFloppy(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { int has_media = 0; @@ -872,9 +870,9 @@ udevProcessFloppy(struct udev_device *device, static int udevProcessSD(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { - virNodeDevCapStoragePtr storage = &def->caps->data.storage; + virNodeDevCapStorage *storage = &def->caps->data.storage; if (udevGetUint64SysfsAttr(device, "size", &storage->num_blocks) < 0) @@ -892,9 +890,9 @@ udevProcessSD(struct udev_device *device, static int udevProcessDASD(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { - virNodeDevCapStoragePtr storage = &def->caps->data.storage; + virNodeDevCapStorage *storage = &def->caps->data.storage; if (udevGetStringSysfsAttr(device, "device/uid", &storage->serial) < 0) return -1; @@ -908,7 +906,7 @@ udevProcessDASD(struct udev_device *device, * a storage device, and we can make a good guess at what kind of * storage device it is from other information that is provided. */ static int -udevKludgeStorageType(virNodeDeviceDefPtr def) +udevKludgeStorageType(virNodeDeviceDef *def) { VIR_DEBUG("Could not find definitive storage type for device " "with sysfs path '%s', trying to guess it", @@ -944,9 +942,9 @@ udevKludgeStorageType(virNodeDeviceDefPtr def) static int udevProcessStorage(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { - virNodeDevCapStoragePtr storage = &def->caps->data.storage; + virNodeDevCapStorage *storage = &def->caps->data.storage; int ret = -1; const char* devnode; @@ -1021,7 +1019,7 @@ udevProcessStorage(struct udev_device *device, static int udevProcessSCSIGeneric(struct udev_device *dev, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { if (udevGetStringProperty(dev, "DEVNAME", &def->caps->data.sg.path) < 0 || !def->caps->data.sg.path) @@ -1036,13 +1034,13 @@ udevProcessSCSIGeneric(struct udev_device *dev, static int udevProcessMediatedDevice(struct udev_device *dev, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { int ret = -1; int iommugrp = -1; char *linkpath = NULL; char *canonicalpath = NULL; - virNodeDevCapMdevPtr data = &def->caps->data.mdev; + virNodeDevCapMdev *data = &def->caps->data.mdev; /* Because of a kernel uevent race, we might get the 'add' event prior to * the sysfs tree being ready, so any attempt to access any sysfs attribute @@ -1085,7 +1083,7 @@ udevProcessMediatedDevice(struct udev_device *dev, static int udevGetCCWAddress(const char *sysfs_path, - virNodeDevCapDataPtr data) + virNodeDevCapData *data) { char *p; @@ -1105,7 +1103,7 @@ udevGetCCWAddress(const char *sysfs_path, static int udevProcessCCW(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { int online = 0; @@ -1125,7 +1123,7 @@ udevProcessCCW(struct udev_device *device, static int udevProcessCSS(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { /* only process IO subchannel and vfio-ccw devices to keep the list sane */ if (!def->driver || @@ -1148,7 +1146,7 @@ udevProcessCSS(struct udev_device *device, static int udevGetVDPACharDev(const char *sysfs_path, - virNodeDevCapDataPtr data) + virNodeDevCapData *data) { struct dirent *entry; g_autoptr(DIR) dir = NULL; @@ -1181,7 +1179,7 @@ udevGetVDPACharDev(const char *sysfs_path, static int udevProcessVDPA(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { if (udevGenerateDeviceName(device, def, NULL) != 0) return -1; @@ -1195,10 +1193,10 @@ udevProcessVDPA(struct udev_device *device, static int udevProcessAPCard(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { char *c; - virNodeDevCapDataPtr data = &def->caps->data; + virNodeDevCapData *data = &def->caps->data; /* The sysfs path would be in the format /sys/bus/ap/devices/cardXX, where XX is the ap adapter id */ @@ -1220,10 +1218,10 @@ udevProcessAPCard(struct udev_device *device, static int udevProcessAPQueue(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { char *c; - virNodeDevCapDataPtr data = &def->caps->data; + virNodeDevCapData *data = &def->caps->data; /* The sysfs path would be in the format /sys/bus/ap/devices /XX.YYYY, where XX is the ap adapter id and YYYY is the ap @@ -1246,13 +1244,13 @@ udevProcessAPQueue(struct udev_device *device, static int udevProcessAPMatrix(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { /* Both udev_device_get_sysname and udev_device_get_subsystem return * "matrix" for an AP matrix device, so in order to prevent confusion in * naming, let's fallback to hardcoding the name. */ - virNodeDevCapDataPtr data = &def->caps->data; + virNodeDevCapData *data = &def->caps->data; data->ap_matrix.addr = g_strdup(udev_device_get_sysname(device)); def->name = g_strdup("ap_matrix"); @@ -1267,7 +1265,7 @@ udevProcessAPMatrix(struct udev_device *device, static int udevGetDeviceNodes(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { const char *devnode = NULL; struct udev_list_entry *list_entry = NULL; @@ -1369,7 +1367,7 @@ udevGetDeviceType(struct udev_device *device, static int udevGetDeviceDetails(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { switch (def->caps->data.type) { case VIR_NODE_DEV_CAP_PCI_DEV: @@ -1421,9 +1419,9 @@ udevGetDeviceDetails(struct udev_device *device, static int udevRemoveOneDeviceSysPath(const char *path) { - virNodeDeviceObjPtr obj = NULL; - virNodeDeviceDefPtr def; - virObjectEventPtr event = NULL; + virNodeDeviceObj *obj = NULL; + virNodeDeviceDef *def; + virObjectEvent *event = NULL; if (!(obj = virNodeDeviceObjListFindBySysfsPath(driver->devs, path))) { VIR_DEBUG("Failed to find device to remove that has udev path '%s'", @@ -1465,12 +1463,12 @@ udevRemoveOneDevice(struct udev_device *device) static int udevSetParent(struct udev_device *device, - virNodeDeviceDefPtr def) + virNodeDeviceDef *def) { struct udev_device *parent_device = NULL; const char *parent_sysfs_path = NULL; - virNodeDeviceObjPtr obj = NULL; - virNodeDeviceDefPtr objdef; + virNodeDeviceObj *obj = NULL; + virNodeDeviceDef *objdef; parent_device = device; do { @@ -1507,10 +1505,10 @@ udevSetParent(struct udev_device *device, static int udevAddOneDevice(struct udev_device *device) { - virNodeDeviceDefPtr def = NULL; - virNodeDeviceObjPtr obj = NULL; - virNodeDeviceDefPtr objdef; - virObjectEventPtr event = NULL; + virNodeDeviceDef *def = NULL; + virNodeDeviceObj *obj = NULL; + virNodeDeviceDef *objdef; + virObjectEvent *event = NULL; bool new_device = true; int ret = -1; bool was_persistent = false; @@ -1674,7 +1672,7 @@ udevPCITranslateDeinit(void) static int nodeStateCleanup(void) { - udevEventDataPtr priv = NULL; + udevEventData *priv = NULL; if (!driver) return -1; @@ -1746,7 +1744,7 @@ udevHandleOneDevice(struct udev_device *device) * this function */ static bool -udevEventMonitorSanityCheck(udevEventDataPtr priv, +udevEventMonitorSanityCheck(udevEventData *priv, int fd) { int rc = -1; @@ -1795,7 +1793,7 @@ udevEventMonitorSanityCheck(udevEventDataPtr priv, static void udevEventHandleThread(void *opaque G_GNUC_UNUSED) { - udevEventDataPtr priv = driver->privateData; + udevEventData *priv = driver->privateData; struct udev_device *device = NULL; /* continue rather than break from the loop on non-fatal errors */ @@ -1865,7 +1863,7 @@ udevEventHandleCallback(int watch G_GNUC_UNUSED, int events G_GNUC_UNUSED, void *data G_GNUC_UNUSED) { - udevEventDataPtr priv = driver->privateData; + udevEventData *priv = driver->privateData; virObjectLock(priv); @@ -1882,13 +1880,13 @@ udevEventHandleCallback(int watch G_GNUC_UNUSED, /* DMI is intel-compatible specific */ #if defined(__x86_64__) || defined(__i386__) || defined(__amd64__) static void -udevGetDMIData(virNodeDevCapSystemPtr syscap) +udevGetDMIData(virNodeDevCapSystem *syscap) { - udevEventDataPtr priv = driver->privateData; + udevEventData *priv = driver->privateData; struct udev *udev = NULL; struct udev_device *device = NULL; - virNodeDevCapSystemHardwarePtr hardware = &syscap->hardware; - virNodeDevCapSystemFirmwarePtr firmware = &syscap->firmware; + virNodeDevCapSystemHardware *hardware = &syscap->hardware; + virNodeDevCapSystemFirmware *firmware = &syscap->firmware; virObjectLock(priv); udev = udev_monitor_get_udev(priv->udev_monitor); @@ -1940,8 +1938,8 @@ udevGetDMIData(virNodeDevCapSystemPtr syscap) static int udevSetupSystemDev(void) { - virNodeDeviceDefPtr def = NULL; - virNodeDeviceObjPtr obj = NULL; + virNodeDeviceDef *def = NULL; + virNodeDeviceObj *obj = NULL; int ret = -1; def = g_new0(virNodeDeviceDef, 1); @@ -1974,7 +1972,7 @@ static void nodeStateInitializeEnumerate(void *opaque) { struct udev *udev = opaque; - udevEventDataPtr priv = driver->privateData; + udevEventData *priv = driver->privateData; /* Populate with known devices */ if (udevEnumerateDevices(udev) != 0) @@ -2195,7 +2193,7 @@ nodeStateInitialize(bool privileged, virStateInhibitCallback callback G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { - udevEventDataPtr priv = NULL; + udevEventData *priv = NULL; struct udev *udev = NULL; if (root != NULL) { diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c index 2e7190be1c..2481ea5371 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -105,10 +105,8 @@ struct virNWFilterSnoopState { # define VIR_IFKEY_LEN ((VIR_UUID_STRING_BUFLEN) + (VIR_MAC_STRING_BUFLEN)) typedef struct _virNWFilterSnoopReq virNWFilterSnoopReq; -typedef virNWFilterSnoopReq *virNWFilterSnoopReqPtr; typedef struct _virNWFilterSnoopIPLease virNWFilterSnoopIPLease; -typedef virNWFilterSnoopIPLease *virNWFilterSnoopIPLeasePtr; typedef enum { THREAD_STATUS_NONE, @@ -124,14 +122,14 @@ struct _virNWFilterSnoopReq { */ int refctr; - virNWFilterTechDriverPtr techdriver; - virNWFilterBindingDefPtr binding; + virNWFilterTechDriver * techdriver; + virNWFilterBindingDef * binding; int ifindex; char ifkey[VIR_IFKEY_LEN]; - virNWFilterDriverStatePtr driver; + virNWFilterDriverState * driver; /* start and end of lease list, ordered by lease time */ - virNWFilterSnoopIPLeasePtr start; - virNWFilterSnoopIPLeasePtr end; + virNWFilterSnoopIPLease * start; + virNWFilterSnoopIPLease * end; char *threadkey; virErrorPtr threadError; @@ -166,16 +164,14 @@ struct _virNWFilterSnoopReq { struct _virNWFilterSnoopIPLease { virSocketAddr ipAddress; virSocketAddr ipServer; - virNWFilterSnoopReqPtr snoopReq; + virNWFilterSnoopReq * snoopReq; unsigned int timeout; /* timer list */ - virNWFilterSnoopIPLeasePtr prev; - virNWFilterSnoopIPLeasePtr next; + virNWFilterSnoopIPLease *prev; + virNWFilterSnoopIPLease *next; }; typedef struct _virNWFilterSnoopEthHdr virNWFilterSnoopEthHdr; -typedef virNWFilterSnoopEthHdr *virNWFilterSnoopEthHdrPtr; - struct _virNWFilterSnoopEthHdr { virMacAddr eh_dst; virMacAddr eh_src; @@ -185,8 +181,6 @@ struct _virNWFilterSnoopEthHdr { G_STATIC_ASSERT(sizeof(struct _virNWFilterSnoopEthHdr) == 14); typedef struct _virNWFilterSnoopDHCPHdr virNWFilterSnoopDHCPHdr; -typedef virNWFilterSnoopDHCPHdr *virNWFilterSnoopDHCPHdrPtr; - struct _virNWFilterSnoopDHCPHdr { uint8_t d_op; uint8_t d_htype; @@ -228,8 +222,6 @@ G_STATIC_ASSERT(sizeof(struct _virNWFilterSnoopDHCPHdr) == 236); # define PCAP_FLOOD_TIMEOUT_MS 10 /* ms */ typedef struct _virNWFilterDHCPDecodeJob virNWFilterDHCPDecodeJob; -typedef virNWFilterDHCPDecodeJob *virNWFilterDHCPDecodeJobPtr; - struct _virNWFilterDHCPDecodeJob { unsigned char packet[PCAP_PBUFSIZE]; int caplen; @@ -244,8 +236,6 @@ struct _virNWFilterDHCPDecodeJob { # define MAX_QUEUED_JOBS (DHCP_PKT_BURST + 2 * DHCP_PKT_RATE) typedef struct _virNWFilterSnoopRateLimitConf virNWFilterSnoopRateLimitConf; -typedef virNWFilterSnoopRateLimitConf *virNWFilterSnoopRateLimitConfPtr; - struct _virNWFilterSnoopRateLimitConf { time_t prev; unsigned int pkt_ctr; @@ -257,8 +247,6 @@ struct _virNWFilterSnoopRateLimitConf { # define SNOOP_POLL_MAX_TIMEOUT_MS (10 * 1000) /* milliseconds */ typedef struct _virNWFilterSnoopPcapConf virNWFilterSnoopPcapConf; -typedef virNWFilterSnoopPcapConf *virNWFilterSnoopPcapConfPtr; - struct _virNWFilterSnoopPcapConf { pcap_t *handle; const pcap_direction_t dir; @@ -270,16 +258,16 @@ struct _virNWFilterSnoopPcapConf { }; /* local function prototypes */ -static int virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req, - virSocketAddrPtr ipaddr, +static int virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReq *req, + virSocketAddr *ipaddr, bool update_leasefile, bool instantiate); -static void virNWFilterSnoopReqLock(virNWFilterSnoopReqPtr req); -static void virNWFilterSnoopReqUnlock(virNWFilterSnoopReqPtr req); +static void virNWFilterSnoopReqLock(virNWFilterSnoopReq *req); +static void virNWFilterSnoopReqUnlock(virNWFilterSnoopReq *req); static void virNWFilterSnoopLeaseFileLoad(void); -static void virNWFilterSnoopLeaseFileSave(virNWFilterSnoopIPLeasePtr ipl); +static void virNWFilterSnoopLeaseFileSave(virNWFilterSnoopIPLease *ipl); /* local variables */ static struct virNWFilterSnoopState virNWFilterSnoopState = { @@ -290,7 +278,7 @@ static const unsigned char dhcp_magic[4] = { 99, 130, 83, 99 }; static char * -virNWFilterSnoopActivate(virNWFilterSnoopReqPtr req) +virNWFilterSnoopActivate(virNWFilterSnoopReq *req) { g_autofree char *key = g_strdup_printf("%p-%d", req, req->ifindex); char *ret = NULL; @@ -340,11 +328,11 @@ virNWFilterSnoopIsActive(char *threadKey) * virNWFilterSnoopListAdd - add an IP lease to a list */ static void -virNWFilterSnoopListAdd(virNWFilterSnoopIPLeasePtr plnew, - virNWFilterSnoopIPLeasePtr *start, - virNWFilterSnoopIPLeasePtr *end) +virNWFilterSnoopListAdd(virNWFilterSnoopIPLease *plnew, + virNWFilterSnoopIPLease **start, + virNWFilterSnoopIPLease **end) { - virNWFilterSnoopIPLeasePtr pl; + virNWFilterSnoopIPLease *pl; plnew->next = plnew->prev = NULL; @@ -377,9 +365,9 @@ virNWFilterSnoopListAdd(virNWFilterSnoopIPLeasePtr plnew, * virNWFilterSnoopListDel - remove an IP lease from a list */ static void -virNWFilterSnoopListDel(virNWFilterSnoopIPLeasePtr ipl, - virNWFilterSnoopIPLeasePtr *start, - virNWFilterSnoopIPLeasePtr *end) +virNWFilterSnoopListDel(virNWFilterSnoopIPLease *ipl, + virNWFilterSnoopIPLease **start, + virNWFilterSnoopIPLease **end) { if (ipl->prev) ipl->prev->next = ipl->next; @@ -398,9 +386,9 @@ virNWFilterSnoopListDel(virNWFilterSnoopIPLeasePtr ipl, * virNWFilterSnoopLeaseTimerAdd - add an IP lease to the timer list */ static void -virNWFilterSnoopIPLeaseTimerAdd(virNWFilterSnoopIPLeasePtr plnew) +virNWFilterSnoopIPLeaseTimerAdd(virNWFilterSnoopIPLease *plnew) { - virNWFilterSnoopReqPtr req = plnew->snoopReq; + virNWFilterSnoopReq *req = plnew->snoopReq; /* protect req->start / req->end */ virNWFilterSnoopReqLock(req); @@ -414,9 +402,9 @@ virNWFilterSnoopIPLeaseTimerAdd(virNWFilterSnoopIPLeasePtr plnew) * virNWFilterSnoopLeaseTimerDel - remove an IP lease from the timer list */ static void -virNWFilterSnoopIPLeaseTimerDel(virNWFilterSnoopIPLeasePtr ipl) +virNWFilterSnoopIPLeaseTimerDel(virNWFilterSnoopIPLease *ipl) { - virNWFilterSnoopReqPtr req = ipl->snoopReq; + virNWFilterSnoopReq *req = ipl->snoopReq; /* protect req->start / req->end */ virNWFilterSnoopReqLock(req); @@ -438,12 +426,12 @@ virNWFilterSnoopIPLeaseTimerDel(virNWFilterSnoopIPLeasePtr ipl) * efficient. */ static int -virNWFilterSnoopIPLeaseInstallRule(virNWFilterSnoopIPLeasePtr ipl, +virNWFilterSnoopIPLeaseInstallRule(virNWFilterSnoopIPLease *ipl, bool instantiate) { g_autofree char *ipaddr = virSocketAddrFormat(&ipl->ipAddress); int rc = -1; - virNWFilterSnoopReqPtr req; + virNWFilterSnoopReq *req; if (!ipaddr) return -1; @@ -478,7 +466,7 @@ virNWFilterSnoopIPLeaseInstallRule(virNWFilterSnoopIPLeasePtr ipl, * virNWFilterSnoopIPLeaseUpdate - update the timeout on an IP lease */ static void -virNWFilterSnoopIPLeaseUpdate(virNWFilterSnoopIPLeasePtr ipl, time_t timeout) +virNWFilterSnoopIPLeaseUpdate(virNWFilterSnoopIPLease *ipl, time_t timeout) { if (timeout < ipl->timeout) return; /* no take-backs */ @@ -491,11 +479,11 @@ virNWFilterSnoopIPLeaseUpdate(virNWFilterSnoopIPLeasePtr ipl, time_t timeout) /* * virNWFilterSnoopGetByIP - lookup IP lease by IP address */ -static virNWFilterSnoopIPLeasePtr -virNWFilterSnoopIPLeaseGetByIP(virNWFilterSnoopIPLeasePtr start, - virSocketAddrPtr ipaddr) +static virNWFilterSnoopIPLease * +virNWFilterSnoopIPLeaseGetByIP(virNWFilterSnoopIPLease *start, + virSocketAddr *ipaddr) { - virNWFilterSnoopIPLeasePtr pl; + virNWFilterSnoopIPLease *pl; for (pl = start; pl && !virSocketAddrEqual(&pl->ipAddress, ipaddr); @@ -508,7 +496,7 @@ virNWFilterSnoopIPLeaseGetByIP(virNWFilterSnoopIPLeasePtr start, * virNWFilterSnoopReqLeaseTimerRun - run the IP lease timeout list */ static unsigned int -virNWFilterSnoopReqLeaseTimerRun(virNWFilterSnoopReqPtr req) +virNWFilterSnoopReqLeaseTimerRun(virNWFilterSnoopReq *req) { time_t now = time(0); bool is_last = false; @@ -533,7 +521,7 @@ virNWFilterSnoopReqLeaseTimerRun(virNWFilterSnoopReqPtr req) * Get a reference to the given Snoop request */ static void -virNWFilterSnoopReqGet(virNWFilterSnoopReqPtr req) +virNWFilterSnoopReqGet(virNWFilterSnoopReq *req) { g_atomic_int_add(&req->refctr, 1); } @@ -543,10 +531,10 @@ virNWFilterSnoopReqGet(virNWFilterSnoopReqPtr req) * interface key. The caller must release the request with a call * to virNWFilerSnoopReqPut(req). */ -static virNWFilterSnoopReqPtr +static virNWFilterSnoopReq * virNWFilterSnoopReqNew(const char *ifkey) { - g_autofree virNWFilterSnoopReqPtr req = g_new0(virNWFilterSnoopReq, 1); + g_autofree virNWFilterSnoopReq *req = g_new0(virNWFilterSnoopReq, 1); if (ifkey == NULL || strlen(ifkey) != VIR_IFKEY_LEN - 1) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -579,9 +567,9 @@ virNWFilterSnoopReqNew(const char *ifkey) * The lease file is NOT rewritten. */ static void -virNWFilterSnoopReqFree(virNWFilterSnoopReqPtr req) +virNWFilterSnoopReqFree(virNWFilterSnoopReq *req) { - virNWFilterSnoopIPLeasePtr ipl; + virNWFilterSnoopIPLease *ipl; if (!req) return; @@ -607,7 +595,7 @@ virNWFilterSnoopReqFree(virNWFilterSnoopReqPtr req) * Lock a Snoop request 'req' */ static void -virNWFilterSnoopReqLock(virNWFilterSnoopReqPtr req) +virNWFilterSnoopReqLock(virNWFilterSnoopReq *req) { virMutexLock(&req->lock); } @@ -616,7 +604,7 @@ virNWFilterSnoopReqLock(virNWFilterSnoopReqPtr req) * Unlock a Snoop request 'req' */ static void -virNWFilterSnoopReqUnlock(virNWFilterSnoopReqPtr req) +virNWFilterSnoopReqUnlock(virNWFilterSnoopReq *req) { virMutexUnlock(&req->lock); } @@ -627,7 +615,7 @@ virNWFilterSnoopReqUnlock(virNWFilterSnoopReqPtr req) static void virNWFilterSnoopReqRelease(void *req0) { - virNWFilterSnoopReqPtr req = req0; + virNWFilterSnoopReq *req = req0; if (!req) return; @@ -649,10 +637,10 @@ virNWFilterSnoopReqRelease(void *req0) * Get a Snoop request given an interface key; caller must release * the Snoop request with a call to virNWFilterSnoopReqPut() */ -static virNWFilterSnoopReqPtr +static virNWFilterSnoopReq * virNWFilterSnoopReqGetByIFKey(const char *ifkey) { - virNWFilterSnoopReqPtr req; + virNWFilterSnoopReq *req; virNWFilterSnoopLock(); @@ -670,7 +658,7 @@ virNWFilterSnoopReqGetByIFKey(const char *ifkey) * after this call. */ static void -virNWFilterSnoopReqPut(virNWFilterSnoopReqPtr req) +virNWFilterSnoopReqPut(virNWFilterSnoopReq *req) { if (!req) return; @@ -700,11 +688,11 @@ virNWFilterSnoopReqPut(virNWFilterSnoopReqPtr req) * virNWFilterSnoopReqLeaseAdd - create or update an IP lease */ static int -virNWFilterSnoopReqLeaseAdd(virNWFilterSnoopReqPtr req, - virNWFilterSnoopIPLeasePtr plnew, +virNWFilterSnoopReqLeaseAdd(virNWFilterSnoopReq *req, + virNWFilterSnoopIPLease *plnew, bool update_leasefile) { - virNWFilterSnoopIPLeasePtr pl; + virNWFilterSnoopIPLease *pl; plnew->snoopReq = req; @@ -754,10 +742,10 @@ virNWFilterSnoopReqLeaseAdd(virNWFilterSnoopReqPtr req, * and re-build the filtering rules with them */ static int -virNWFilterSnoopReqRestore(virNWFilterSnoopReqPtr req) +virNWFilterSnoopReqRestore(virNWFilterSnoopReq *req) { int ret = 0; - virNWFilterSnoopIPLeasePtr ipl; + virNWFilterSnoopIPLease *ipl; /* protect req->start */ virNWFilterSnoopReqLock(req); @@ -796,12 +784,12 @@ virNWFilterSnoopReqRestore(virNWFilterSnoopReqPtr req) * Returns 0 on success, -1 if the instantiation of the rules failed */ static int -virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req, - virSocketAddrPtr ipaddr, bool update_leasefile, +virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReq *req, + virSocketAddr *ipaddr, bool update_leasefile, bool instantiate) { int ret = 0; - virNWFilterSnoopIPLeasePtr ipl; + virNWFilterSnoopIPLease *ipl; g_autofree char *ipstr = NULL; /* protect req->start, req->ifname and the lease */ @@ -834,7 +822,7 @@ virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req, req->binding, req->ifindex); } else { - virNWFilterVarValuePtr dhcpsrvrs = + virNWFilterVarValue *dhcpsrvrs = virHashLookup(req->binding->filterparams, NWFILTER_VARNAME_DHCPSERVER); @@ -861,7 +849,7 @@ virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req, } static int -virNWFilterSnoopDHCPGetOpt(virNWFilterSnoopDHCPHdrPtr pd, int len, +virNWFilterSnoopDHCPGetOpt(virNWFilterSnoopDHCPHdr *pd, int len, uint8_t *pmtype, uint32_t *pleasetime) { int oind, olen; @@ -923,13 +911,13 @@ virNWFilterSnoopDHCPGetOpt(virNWFilterSnoopDHCPHdrPtr pd, int len, * Returns -1 in case of error with the installation of rules */ static int -virNWFilterSnoopDHCPDecode(virNWFilterSnoopReqPtr req, - virNWFilterSnoopEthHdrPtr pep, +virNWFilterSnoopDHCPDecode(virNWFilterSnoopReq *req, + virNWFilterSnoopEthHdr *pep, int len, bool fromVM) { struct iphdr *pip; struct udphdr *pup; - virNWFilterSnoopDHCPHdrPtr pd; + virNWFilterSnoopDHCPHdr *pd; virNWFilterSnoopIPLease ipl; uint8_t mtype; uint32_t leasetime; @@ -957,7 +945,7 @@ virNWFilterSnoopDHCPDecode(virNWFilterSnoopReqPtr req, if (len < 0) return -2; - pd = (virNWFilterSnoopDHCPHdrPtr) ((char *)pup + sizeof(*pup)); + pd = (virNWFilterSnoopDHCPHdr *) ((char *)pup + sizeof(*pup)); len -= sizeof(*pup); if (len < 0) return -2; /* invalid packet length */ @@ -1107,9 +1095,9 @@ virNWFilterSnoopDHCPOpen(const char *ifname, virMacAddr *mac, */ static void virNWFilterDHCPDecodeWorker(void *jobdata, void *opaque) { - virNWFilterSnoopReqPtr req = opaque; - g_autofree virNWFilterDHCPDecodeJobPtr job = jobdata; - virNWFilterSnoopEthHdrPtr packet = (virNWFilterSnoopEthHdrPtr)job->packet; + virNWFilterSnoopReq *req = opaque; + g_autofree virNWFilterDHCPDecodeJob *job = jobdata; + virNWFilterSnoopEthHdr *packet = (virNWFilterSnoopEthHdr *)job->packet; if (virNWFilterSnoopDHCPDecode(req, packet, job->caplen, job->fromVM) == -1) { @@ -1126,12 +1114,12 @@ static void virNWFilterDHCPDecodeWorker(void *jobdata, void *opaque) * Submit a job to the worker thread doing the time-consuming work... */ static int -virNWFilterSnoopDHCPDecodeJobSubmit(virThreadPoolPtr pool, - virNWFilterSnoopEthHdrPtr pep, +virNWFilterSnoopDHCPDecodeJobSubmit(virThreadPool *pool, + virNWFilterSnoopEthHdr *pep, int len, pcap_direction_t dir, int *qCtr) { - virNWFilterDHCPDecodeJobPtr job; + virNWFilterDHCPDecodeJob *job; int ret; if (len <= MIN_VALID_DHCP_PKT_SIZE || len > sizeof(job->packet)) @@ -1168,7 +1156,7 @@ virNWFilterSnoopDHCPDecodeJobSubmit(virThreadPoolPtr pool, * return 1. If the number of packets is below the rate, it returns 0. */ static unsigned int -virNWFilterSnoopRateLimit(virNWFilterSnoopRateLimitConfPtr rl) +virNWFilterSnoopRateLimit(virNWFilterSnoopRateLimitConf *rl) { time_t now = time(0); int diff; @@ -1212,7 +1200,7 @@ virNWFilterSnoopRateLimit(virNWFilterSnoopRateLimitConfPtr rl) * sending too many packets. */ static void -virNWFilterSnoopRatePenalty(virNWFilterSnoopPcapConfPtr pc, +virNWFilterSnoopRatePenalty(virNWFilterSnoopPcapConf *pc, unsigned int diff, unsigned int limit) { if (diff > limit) { @@ -1229,7 +1217,7 @@ virNWFilterSnoopRatePenalty(virNWFilterSnoopPcapConfPtr pc, } static int -virNWFilterSnoopAdjustPoll(virNWFilterSnoopPcapConfPtr pc, +virNWFilterSnoopAdjustPoll(virNWFilterSnoopPcapConf *pc, size_t nPc, struct pollfd *pfd, int *pollTo) { @@ -1279,15 +1267,15 @@ virNWFilterSnoopAdjustPoll(virNWFilterSnoopPcapConfPtr pc, static void virNWFilterDHCPSnoopThread(void *req0) { - virNWFilterSnoopReqPtr req = req0; + virNWFilterSnoopReq *req = req0; struct pcap_pkthdr *hdr; - virNWFilterSnoopEthHdrPtr packet; + virNWFilterSnoopEthHdr *packet; int ifindex = 0; int errcount = 0; int tmp = -1, rv, n, pollTo; size_t i; g_autofree char *threadkey = NULL; - virThreadPoolPtr worker = NULL; + virThreadPool *worker = NULL; time_t last_displayed = 0, last_displayed_queue = 0; virNWFilterSnoopPcapConf pcapConf[] = { { @@ -1532,16 +1520,16 @@ virNWFilterSnoopIFKeyFMT(char *ifkey, const unsigned char *vmuuid, } int -virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver, - virNWFilterBindingDefPtr binding, - virNWFilterDriverStatePtr driver) +virNWFilterDHCPSnoopReq(virNWFilterTechDriver *techdriver, + virNWFilterBindingDef *binding, + virNWFilterDriverState *driver) { - virNWFilterSnoopReqPtr req; + virNWFilterSnoopReq *req; bool isnewreq; char ifkey[VIR_IFKEY_LEN]; int tmp; virThread thread; - virNWFilterVarValuePtr dhcpsrvrs; + virNWFilterVarValue *dhcpsrvrs; bool threadPuts = false; virNWFilterSnoopIFKeyFMT(ifkey, binding->owneruuid, &binding->mac); @@ -1696,7 +1684,7 @@ virNWFilterSnoopLeaseFileOpen(void) */ static int virNWFilterSnoopLeaseFileWrite(int lfd, const char *ifkey, - virNWFilterSnoopIPLeasePtr ipl) + virNWFilterSnoopIPLease *ipl) { g_autofree char *lbuf = NULL; g_autofree char *ipstr = virSocketAddrFormat(&ipl->ipAddress); @@ -1726,9 +1714,9 @@ virNWFilterSnoopLeaseFileWrite(int lfd, const char *ifkey, * exceeds a threshold. */ static void -virNWFilterSnoopLeaseFileSave(virNWFilterSnoopIPLeasePtr ipl) +virNWFilterSnoopLeaseFileSave(virNWFilterSnoopIPLease *ipl) { - virNWFilterSnoopReqPtr req = ipl->snoopReq; + virNWFilterSnoopReq *req = ipl->snoopReq; virNWFilterSnoopLock(); @@ -1757,7 +1745,7 @@ virNWFilterSnoopPruneIter(const void *payload, const char *name G_GNUC_UNUSED, const void *data G_GNUC_UNUSED) { - virNWFilterSnoopReqPtr req = (virNWFilterSnoopReqPtr)payload; + virNWFilterSnoopReq *req = (virNWFilterSnoopReq *)payload; bool del_req; /* clean up orphaned, expired leases */ @@ -1787,9 +1775,9 @@ virNWFilterSnoopSaveIter(void *payload, const char *name G_GNUC_UNUSED, void *data) { - virNWFilterSnoopReqPtr req = payload; + virNWFilterSnoopReq *req = payload; int tfd = *(int *)data; - virNWFilterSnoopIPLeasePtr ipl; + virNWFilterSnoopIPLease *ipl; /* protect req->start */ virNWFilterSnoopReqLock(req); @@ -1859,7 +1847,7 @@ virNWFilterSnoopLeaseFileLoad(void) char line[256], ifkey[VIR_IFKEY_LEN]; char ipstr[INET_ADDRSTRLEN], srvstr[INET_ADDRSTRLEN]; virNWFilterSnoopIPLease ipl; - virNWFilterSnoopReqPtr req; + virNWFilterSnoopReq *req; time_t now; FILE *fp; int ln = 0, tmp; @@ -1954,7 +1942,7 @@ virNWFilterSnoopRemAllReqIter(const void *payload, const char *name G_GNUC_UNUSED, const void *data G_GNUC_UNUSED) { - virNWFilterSnoopReqPtr req = (virNWFilterSnoopReqPtr)payload; + virNWFilterSnoopReq *req = (virNWFilterSnoopReq *)payload; /* protect req->binding->portdevname */ virNWFilterSnoopReqLock(req); @@ -2064,7 +2052,7 @@ virNWFilterDHCPSnoopEnd(const char *ifname) } if (ifkey) { - virNWFilterSnoopReqPtr req; + virNWFilterSnoopReq *req; req = virNWFilterSnoopReqGetByIFKey(ifkey); if (!req) { @@ -2140,9 +2128,9 @@ virNWFilterDHCPSnoopShutdown(void) } int -virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver G_GNUC_UNUSED, - virNWFilterBindingDefPtr binding G_GNUC_UNUSED, - virNWFilterDriverStatePtr driver G_GNUC_UNUSED) +virNWFilterDHCPSnoopReq(virNWFilterTechDriver *techdriver G_GNUC_UNUSED, + virNWFilterBindingDef *binding G_GNUC_UNUSED, + virNWFilterDriverState *driver G_GNUC_UNUSED) { virReportError(VIR_ERR_INTERNAL_ERROR, _("libvirt was not compiled with libpcap and \"" diff --git a/src/nwfilter/nwfilter_dhcpsnoop.h b/src/nwfilter/nwfilter_dhcpsnoop.h index 2b9a87fb79..2e7e5eebfb 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.h +++ b/src/nwfilter/nwfilter_dhcpsnoop.h @@ -26,7 +26,7 @@ int virNWFilterDHCPSnoopInit(void); void virNWFilterDHCPSnoopShutdown(void); -int virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver, - virNWFilterBindingDefPtr binding, - virNWFilterDriverStatePtr driver); +int virNWFilterDHCPSnoopReq(virNWFilterTechDriver *techdriver, + virNWFilterBindingDef *binding, + virNWFilterDriverState *driver); void virNWFilterDHCPSnoopEnd(const char *ifname); diff --git a/src/nwfilter/nwfilter_driver.c b/src/nwfilter/nwfilter_driver.c index 1541c44cf2..edb284aa4b 100644 --- a/src/nwfilter/nwfilter_driver.c +++ b/src/nwfilter/nwfilter_driver.c @@ -51,7 +51,7 @@ VIR_LOG_INIT("nwfilter.nwfilter_driver"); -static virNWFilterDriverStatePtr driver; +static virNWFilterDriverState *driver; static int nwfilterStateCleanup(void); @@ -142,7 +142,7 @@ nwfilterDriverInstallDBusMatches(GDBusConnection *sysbus G_GNUC_UNUSED) static int virNWFilterTriggerRebuildImpl(void *opaque) { - virNWFilterDriverStatePtr nwdriver = opaque; + virNWFilterDriverState *nwdriver = opaque; return virNWFilterBuildAll(nwdriver, true); } @@ -353,7 +353,7 @@ nwfilterStateCleanup(void) static virDrvOpenStatus nwfilterConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -403,10 +403,10 @@ static int nwfilterConnectIsAlive(virConnectPtr conn G_GNUC_UNUSED) } -static virNWFilterObjPtr +static virNWFilterObj * nwfilterObjFromNWFilter(const unsigned char *uuid) { - virNWFilterObjPtr obj; + virNWFilterObj *obj; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (!(obj = virNWFilterObjListFindByUUID(driver->nwfilters, uuid))) { @@ -422,8 +422,8 @@ static virNWFilterPtr nwfilterLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - virNWFilterObjPtr obj; - virNWFilterDefPtr def; + virNWFilterObj *obj; + virNWFilterDef *def; virNWFilterPtr nwfilter = NULL; nwfilterDriverLock(); @@ -449,8 +449,8 @@ static virNWFilterPtr nwfilterLookupByName(virConnectPtr conn, const char *name) { - virNWFilterObjPtr obj; - virNWFilterDefPtr def; + virNWFilterObj *obj; + virNWFilterDef *def; virNWFilterPtr nwfilter = NULL; nwfilterDriverLock(); @@ -529,9 +529,9 @@ static virNWFilterPtr nwfilterDefineXML(virConnectPtr conn, const char *xml) { - virNWFilterDefPtr def; - virNWFilterObjPtr obj = NULL; - virNWFilterDefPtr objdef; + virNWFilterDef *def; + virNWFilterObj *obj = NULL; + virNWFilterDef *objdef; virNWFilterPtr nwfilter = NULL; if (!driver->privileged) { @@ -575,8 +575,8 @@ nwfilterDefineXML(virConnectPtr conn, static int nwfilterUndefine(virNWFilterPtr nwfilter) { - virNWFilterObjPtr obj; - virNWFilterDefPtr def; + virNWFilterObj *obj; + virNWFilterDef *def; int ret = -1; nwfilterDriverLock(); @@ -617,8 +617,8 @@ static char * nwfilterGetXMLDesc(virNWFilterPtr nwfilter, unsigned int flags) { - virNWFilterObjPtr obj; - virNWFilterDefPtr def; + virNWFilterObj *obj; + virNWFilterDef *def; char *ret = NULL; virCheckFlags(0, NULL); @@ -647,8 +647,8 @@ nwfilterBindingLookupByPortDev(virConnectPtr conn, const char *portdev) { virNWFilterBindingPtr ret = NULL; - virNWFilterBindingObjPtr obj; - virNWFilterBindingDefPtr def; + virNWFilterBindingObj *obj; + virNWFilterBindingDef *def; obj = virNWFilterBindingObjListFindByPortDev(driver->bindings, portdev); @@ -689,8 +689,8 @@ static char * nwfilterBindingGetXMLDesc(virNWFilterBindingPtr binding, unsigned int flags) { - virNWFilterBindingObjPtr obj; - virNWFilterBindingDefPtr def; + virNWFilterBindingObj *obj; + virNWFilterBindingDef *def; char *ret = NULL; virCheckFlags(0, NULL); @@ -720,8 +720,8 @@ nwfilterBindingCreateXML(virConnectPtr conn, const char *xml, unsigned int flags) { - virNWFilterBindingDefPtr def; - virNWFilterBindingObjPtr obj = NULL; + virNWFilterBindingDef *def; + virNWFilterBindingObj *obj = NULL; virNWFilterBindingPtr ret = NULL; virCheckFlags(0, NULL); @@ -774,8 +774,8 @@ nwfilterBindingCreateXML(virConnectPtr conn, static int nwfilterBindingDelete(virNWFilterBindingPtr binding) { - virNWFilterBindingObjPtr obj; - virNWFilterBindingDefPtr def; + virNWFilterBindingObj *obj; + virNWFilterBindingDef *def; int ret = -1; obj = virNWFilterBindingObjListFindByPortDev(driver->bindings, binding->portdev); diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c index f4afbf9ba2..345562bab6 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -149,9 +149,9 @@ static char chainprefixes_host_temp[3] = { }; static int -printVar(virNWFilterVarCombIterPtr vars, +printVar(virNWFilterVarCombIter *vars, char *buf, int bufsize, - nwItemDescPtr item, + nwItemDesc *item, bool *done) { *done = false; @@ -182,9 +182,9 @@ printVar(virNWFilterVarCombIterPtr vars, static int -_printDataType(virNWFilterVarCombIterPtr vars, +_printDataType(virNWFilterVarCombIter *vars, char *buf, int bufsize, - nwItemDescPtr item, + nwItemDesc *item, bool asHex, bool directionIn) { bool done; @@ -325,35 +325,35 @@ _printDataType(virNWFilterVarCombIterPtr vars, static int -printDataType(virNWFilterVarCombIterPtr vars, +printDataType(virNWFilterVarCombIter *vars, char *buf, int bufsize, - nwItemDescPtr item) + nwItemDesc *item) { return _printDataType(vars, buf, bufsize, item, 0, 0); } static int -printDataTypeDirection(virNWFilterVarCombIterPtr vars, +printDataTypeDirection(virNWFilterVarCombIter *vars, char *buf, int bufsize, - nwItemDescPtr item, bool directionIn) + nwItemDesc *item, bool directionIn) { return _printDataType(vars, buf, bufsize, item, 0, directionIn); } static int -printDataTypeAsHex(virNWFilterVarCombIterPtr vars, +printDataTypeAsHex(virNWFilterVarCombIter *vars, char *buf, int bufsize, - nwItemDescPtr item) + nwItemDesc *item) { return _printDataType(vars, buf, bufsize, item, 1, 0); } static int -ebtablesHandleEthHdr(virFirewallPtr fw, - virFirewallRulePtr fwrule, - virNWFilterVarCombIterPtr vars, - ethHdrDataDefPtr ethHdr, +ebtablesHandleEthHdr(virFirewall *fw, + virFirewallRule *fwrule, + virNWFilterVarCombIter *vars, + ethHdrDataDef *ethHdr, bool reverse) { char macaddr[VIR_MAC_STRING_BUFLEN]; @@ -417,7 +417,7 @@ ebtablesHandleEthHdr(virFirewallPtr fw, static void -iptablesCreateBaseChainsFW(virFirewallPtr fw, +iptablesCreateBaseChainsFW(virFirewall *fw, virFirewallLayer layer) { virFirewallAddRuleFull(fw, layer, @@ -456,7 +456,7 @@ iptablesCreateBaseChainsFW(virFirewallPtr fw, static void -iptablesCreateTmpRootChainFW(virFirewallPtr fw, +iptablesCreateTmpRootChainFW(virFirewall *fw, virFirewallLayer layer, char prefix, bool incoming, const char *ifname) @@ -476,7 +476,7 @@ iptablesCreateTmpRootChainFW(virFirewallPtr fw, static void -iptablesCreateTmpRootChainsFW(virFirewallPtr fw, +iptablesCreateTmpRootChainsFW(virFirewall *fw, virFirewallLayer layer, const char *ifname) { @@ -487,7 +487,7 @@ iptablesCreateTmpRootChainsFW(virFirewallPtr fw, static void -_iptablesRemoveRootChainFW(virFirewallPtr fw, +_iptablesRemoveRootChainFW(virFirewall *fw, virFirewallLayer layer, char prefix, bool incoming, const char *ifname, @@ -517,7 +517,7 @@ _iptablesRemoveRootChainFW(virFirewallPtr fw, static void -iptablesRemoveRootChainFW(virFirewallPtr fw, +iptablesRemoveRootChainFW(virFirewall *fw, virFirewallLayer layer, char prefix, bool incoming, @@ -528,7 +528,7 @@ iptablesRemoveRootChainFW(virFirewallPtr fw, static void -iptablesRemoveTmpRootChainFW(virFirewallPtr fw, +iptablesRemoveTmpRootChainFW(virFirewall *fw, virFirewallLayer layer, char prefix, bool incoming, @@ -540,7 +540,7 @@ iptablesRemoveTmpRootChainFW(virFirewallPtr fw, static void -iptablesRemoveTmpRootChainsFW(virFirewallPtr fw, +iptablesRemoveTmpRootChainsFW(virFirewall *fw, virFirewallLayer layer, const char *ifname) { @@ -551,7 +551,7 @@ iptablesRemoveTmpRootChainsFW(virFirewallPtr fw, static void -iptablesRemoveRootChainsFW(virFirewallPtr fw, +iptablesRemoveRootChainsFW(virFirewall *fw, virFirewallLayer layer, const char *ifname) { @@ -562,7 +562,7 @@ iptablesRemoveRootChainsFW(virFirewallPtr fw, static void -iptablesLinkTmpRootChainFW(virFirewallPtr fw, +iptablesLinkTmpRootChainFW(virFirewall *fw, virFirewallLayer layer, const char *basechain, char prefix, @@ -593,7 +593,7 @@ iptablesLinkTmpRootChainFW(virFirewallPtr fw, static void -iptablesLinkTmpRootChainsFW(virFirewallPtr fw, +iptablesLinkTmpRootChainsFW(virFirewall *fw, virFirewallLayer layer, const char *ifname) { @@ -604,7 +604,7 @@ iptablesLinkTmpRootChainsFW(virFirewallPtr fw, static void -iptablesSetupVirtInPostFW(virFirewallPtr fw G_GNUC_UNUSED, +iptablesSetupVirtInPostFW(virFirewall *fw G_GNUC_UNUSED, virFirewallLayer layer G_GNUC_UNUSED, const char *ifname G_GNUC_UNUSED) { @@ -621,7 +621,7 @@ iptablesSetupVirtInPostFW(virFirewallPtr fw G_GNUC_UNUSED, static void -iptablesClearVirtInPostFW(virFirewallPtr fw, +iptablesClearVirtInPostFW(virFirewall *fw, virFirewallLayer layer, const char *ifname) { @@ -634,7 +634,7 @@ iptablesClearVirtInPostFW(virFirewallPtr fw, static void -_iptablesUnlinkRootChainFW(virFirewallPtr fw, +_iptablesUnlinkRootChainFW(virFirewall *fw, virFirewallLayer layer, const char *basechain, char prefix, @@ -685,7 +685,7 @@ _iptablesUnlinkRootChainFW(virFirewallPtr fw, static void -iptablesUnlinkRootChainFW(virFirewallPtr fw, +iptablesUnlinkRootChainFW(virFirewall *fw, virFirewallLayer layer, const char *basechain, char prefix, @@ -697,7 +697,7 @@ iptablesUnlinkRootChainFW(virFirewallPtr fw, static void -iptablesUnlinkTmpRootChainFW(virFirewallPtr fw, +iptablesUnlinkTmpRootChainFW(virFirewall *fw, virFirewallLayer layer, const char *basechain, char prefix, @@ -709,7 +709,7 @@ iptablesUnlinkTmpRootChainFW(virFirewallPtr fw, static void -iptablesUnlinkRootChainsFW(virFirewallPtr fw, +iptablesUnlinkRootChainsFW(virFirewall *fw, virFirewallLayer layer, const char *ifname) { @@ -720,7 +720,7 @@ iptablesUnlinkRootChainsFW(virFirewallPtr fw, static void -iptablesUnlinkTmpRootChainsFW(virFirewallPtr fw, +iptablesUnlinkTmpRootChainsFW(virFirewall *fw, virFirewallLayer layer, const char *ifname) { @@ -731,7 +731,7 @@ iptablesUnlinkTmpRootChainsFW(virFirewallPtr fw, static void -iptablesRenameTmpRootChainFW(virFirewallPtr fw, +iptablesRenameTmpRootChainFW(virFirewall *fw, virFirewallLayer layer, char prefix, bool incoming, @@ -758,7 +758,7 @@ iptablesRenameTmpRootChainFW(virFirewallPtr fw, static void -iptablesRenameTmpRootChainsFW(virFirewallPtr fw, +iptablesRenameTmpRootChainsFW(virFirewall *fw, virFirewallLayer layer, const char *ifname) { @@ -769,10 +769,10 @@ iptablesRenameTmpRootChainsFW(virFirewallPtr fw, static int -iptablesHandleSrcMacAddr(virFirewallPtr fw, - virFirewallRulePtr fwrule, - virNWFilterVarCombIterPtr vars, - nwItemDescPtr srcMacAddr, +iptablesHandleSrcMacAddr(virFirewall *fw, + virFirewallRule *fwrule, + virNWFilterVarCombIter *vars, + nwItemDesc *srcMacAddr, bool directionIn, bool *srcmacskipped) { @@ -807,10 +807,10 @@ iptablesHandleSrcMacAddr(virFirewallPtr fw, static int -iptablesHandleIPHdr(virFirewallPtr fw, - virFirewallRulePtr fwrule, - virNWFilterVarCombIterPtr vars, - ipHdrDataDefPtr ipHdr, +iptablesHandleIPHdr(virFirewall *fw, + virFirewallRule *fwrule, + virNWFilterVarCombIter *vars, + ipHdrDataDef *ipHdr, bool directionIn, bool *skipRule, bool *skipMatch) { @@ -955,10 +955,10 @@ iptablesHandleIPHdr(virFirewallPtr fw, static int -iptablesHandleIPHdrAfterStateMatch(virFirewallPtr fw, - virFirewallRulePtr fwrule, - virNWFilterVarCombIterPtr vars, - ipHdrDataDefPtr ipHdr, +iptablesHandleIPHdrAfterStateMatch(virFirewall *fw, + virFirewallRule *fwrule, + virNWFilterVarCombIter *vars, + ipHdrDataDef *ipHdr, bool directionIn) { char number[VIR_INT64_STR_BUFLEN]; @@ -1019,10 +1019,10 @@ iptablesHandleIPHdrAfterStateMatch(virFirewallPtr fw, static int -iptablesHandlePortData(virFirewallPtr fw, - virFirewallRulePtr fwrule, - virNWFilterVarCombIterPtr vars, - portDataDefPtr portData, +iptablesHandlePortData(virFirewall *fw, + virFirewallRule *fwrule, + virNWFilterVarCombIter *vars, + portDataDef *portData, bool directionIn) { char portstr[20]; @@ -1085,10 +1085,10 @@ iptablesHandlePortData(virFirewallPtr fw, static void -iptablesEnforceDirection(virFirewallPtr fw, - virFirewallRulePtr fwrule, +iptablesEnforceDirection(virFirewall *fw, + virFirewallRule *fwrule, bool directionIn, - virNWFilterRuleDefPtr rule) + virNWFilterRuleDef *rule) { switch (iptables_ctdir_corrected) { case CTDIR_STATUS_UNKNOWN: @@ -1132,13 +1132,13 @@ iptablesEnforceDirection(virFirewallPtr fw, * pointed to by res, != 0 otherwise. */ static int -_iptablesCreateRuleInstance(virFirewallPtr fw, +_iptablesCreateRuleInstance(virFirewall *fw, virFirewallLayer layer, bool directionIn, const char *chainPrefix, - virNWFilterRuleDefPtr rule, + virNWFilterRuleDef *rule, const char *ifname, - virNWFilterVarCombIterPtr vars, + virNWFilterVarCombIter *vars, const char *match, bool defMatch, const char *accept_target, bool maySkipICMP) @@ -1151,7 +1151,7 @@ _iptablesCreateRuleInstance(virFirewallPtr fw, bool skipRule = false; bool skipMatch = false; bool hasICMPType = false; - virFirewallRulePtr fwrule; + virFirewallRule *fwrule; size_t fwruleargs; PRINT_IPT_ROOT_CHAIN(chain, chainPrefix, ifname); @@ -1532,11 +1532,11 @@ printStateMatchFlags(int32_t flags, char **bufptr) } static int -iptablesCreateRuleInstanceStateCtrl(virFirewallPtr fw, +iptablesCreateRuleInstanceStateCtrl(virFirewall *fw, virFirewallLayer layer, - virNWFilterRuleDefPtr rule, + virNWFilterRuleDef *rule, const char *ifname, - virNWFilterVarCombIterPtr vars) + virNWFilterVarCombIter *vars) { int rc = 0; bool directionIn = false; @@ -1649,11 +1649,11 @@ iptablesCreateRuleInstanceStateCtrl(virFirewallPtr fw, static int -iptablesCreateRuleInstance(virFirewallPtr fw, +iptablesCreateRuleInstance(virFirewall *fw, virFirewallLayer layer, - virNWFilterRuleDefPtr rule, + virNWFilterRuleDef *rule, const char *ifname, - virNWFilterVarCombIterPtr vars) + virNWFilterVarCombIter *vars) { int rc; bool directionIn = false; @@ -1767,12 +1767,12 @@ iptablesCreateRuleInstance(virFirewallPtr fw, * pointed to by res, != 0 otherwise. */ static int -ebtablesCreateRuleInstance(virFirewallPtr fw, +ebtablesCreateRuleInstance(virFirewall *fw, char chainPrefix, const char *chainSuffix, - virNWFilterRuleDefPtr rule, + virNWFilterRuleDef *rule, const char *ifname, - virNWFilterVarCombIterPtr vars, + virNWFilterVarCombIter *vars, bool reverse) { char macaddr[VIR_MAC_STRING_BUFLEN]; @@ -1786,7 +1786,7 @@ ebtablesCreateRuleInstance(virFirewallPtr fw, char chain[MAX_CHAINNAME_LENGTH]; const char *target; bool hasMask = false; - virFirewallRulePtr fwrule; + virFirewallRule *fwrule; if (STREQ(chainSuffix, virNWFilterChainSuffixTypeToString( @@ -2427,11 +2427,11 @@ ebtablesCreateRuleInstance(virFirewallPtr fw, * pointed to by res, -1 otherwise */ static int -ebiptablesCreateRuleInstance(virFirewallPtr fw, +ebiptablesCreateRuleInstance(virFirewall *fw, const char *chainSuffix, - virNWFilterRuleDefPtr rule, + virNWFilterRuleDef *rule, const char *ifname, - virNWFilterVarCombIterPtr vars) + virNWFilterVarCombIter *vars) { if (virNWFilterRuleIsProtocolEthernet(rule)) { if (rule->tt == VIR_NWFILTER_RULE_DIRECTION_OUT || @@ -2482,7 +2482,7 @@ ebiptablesCreateRuleInstance(virFirewallPtr fw, static void -ebtablesCreateTmpRootChainFW(virFirewallPtr fw, +ebtablesCreateTmpRootChainFW(virFirewall *fw, int incoming, const char *ifname) { char chain[MAX_CHAINNAME_LENGTH]; @@ -2497,7 +2497,7 @@ ebtablesCreateTmpRootChainFW(virFirewallPtr fw, static void -ebtablesLinkTmpRootChainFW(virFirewallPtr fw, +ebtablesLinkTmpRootChainFW(virFirewall *fw, int incoming, const char *ifname) { char chain[MAX_CHAINNAME_LENGTH]; @@ -2515,7 +2515,7 @@ ebtablesLinkTmpRootChainFW(virFirewallPtr fw, static void -_ebtablesRemoveRootChainFW(virFirewallPtr fw, +_ebtablesRemoveRootChainFW(virFirewall *fw, bool incoming, const char *ifname, int isTempChain) { @@ -2540,7 +2540,7 @@ _ebtablesRemoveRootChainFW(virFirewallPtr fw, static void -ebtablesRemoveRootChainFW(virFirewallPtr fw, +ebtablesRemoveRootChainFW(virFirewall *fw, bool incoming, const char *ifname) { _ebtablesRemoveRootChainFW(fw, incoming, ifname, false); @@ -2548,7 +2548,7 @@ ebtablesRemoveRootChainFW(virFirewallPtr fw, static void -ebtablesRemoveTmpRootChainFW(virFirewallPtr fw, +ebtablesRemoveTmpRootChainFW(virFirewall *fw, bool incoming, const char *ifname) { _ebtablesRemoveRootChainFW(fw, incoming, ifname, 1); @@ -2556,7 +2556,7 @@ ebtablesRemoveTmpRootChainFW(virFirewallPtr fw, static void -_ebtablesUnlinkRootChainFW(virFirewallPtr fw, +_ebtablesUnlinkRootChainFW(virFirewall *fw, bool incoming, const char *ifname, int isTempChain) { @@ -2583,7 +2583,7 @@ _ebtablesUnlinkRootChainFW(virFirewallPtr fw, static void -ebtablesUnlinkRootChainFW(virFirewallPtr fw, +ebtablesUnlinkRootChainFW(virFirewall *fw, bool incoming, const char *ifname) { _ebtablesUnlinkRootChainFW(fw, incoming, ifname, false); @@ -2591,14 +2591,14 @@ ebtablesUnlinkRootChainFW(virFirewallPtr fw, static void -ebtablesUnlinkTmpRootChainFW(virFirewallPtr fw, +ebtablesUnlinkTmpRootChainFW(virFirewall *fw, int incoming, const char *ifname) { _ebtablesUnlinkRootChainFW(fw, incoming, ifname, 1); } static void -ebtablesCreateTmpSubChainFW(virFirewallPtr fw, +ebtablesCreateTmpSubChainFW(virFirewall *fw, bool incoming, const char *ifname, enum l3_proto_idx protoidx, @@ -2607,7 +2607,7 @@ ebtablesCreateTmpSubChainFW(virFirewallPtr fw, char rootchain[MAX_CHAINNAME_LENGTH], chain[MAX_CHAINNAME_LENGTH]; char chainPrefix = incoming ? CHAINPREFIX_HOST_IN_TEMP : CHAINPREFIX_HOST_OUT_TEMP; - virFirewallRulePtr fwrule; + virFirewallRule *fwrule; PRINT_ROOT_CHAIN(rootchain, chainPrefix, ifname); PRINT_CHAIN(chain, chainPrefix, ifname, @@ -2646,7 +2646,7 @@ ebtablesCreateTmpSubChainFW(virFirewallPtr fw, static int -ebtablesRemoveSubChainsQuery(virFirewallPtr fw, +ebtablesRemoveSubChainsQuery(virFirewall *fw, virFirewallLayer layer, const char *const *lines, void *opaque) @@ -2685,7 +2685,7 @@ ebtablesRemoveSubChainsQuery(virFirewallPtr fw, static void -_ebtablesRemoveSubChainsFW(virFirewallPtr fw, +_ebtablesRemoveSubChainsFW(virFirewall *fw, const char *ifname, const char *chainprefixes) { @@ -2702,7 +2702,7 @@ _ebtablesRemoveSubChainsFW(virFirewallPtr fw, } static void -ebtablesRemoveSubChainsFW(virFirewallPtr fw, +ebtablesRemoveSubChainsFW(virFirewall *fw, const char *ifname) { _ebtablesRemoveSubChainsFW(fw, ifname, chainprefixes_host); @@ -2710,14 +2710,14 @@ ebtablesRemoveSubChainsFW(virFirewallPtr fw, static void -ebtablesRemoveTmpSubChainsFW(virFirewallPtr fw, +ebtablesRemoveTmpSubChainsFW(virFirewall *fw, const char *ifname) { _ebtablesRemoveSubChainsFW(fw, ifname, chainprefixes_host_temp); } static void -ebtablesRenameTmpSubChainFW(virFirewallPtr fw, +ebtablesRenameTmpSubChainFW(virFirewall *fw, int incoming, const char *ifname, const char *protocol) @@ -2741,7 +2741,7 @@ ebtablesRenameTmpSubChainFW(virFirewallPtr fw, } static void -ebtablesRenameTmpRootChainFW(virFirewallPtr fw, +ebtablesRenameTmpRootChainFW(virFirewall *fw, bool incoming, const char *ifname) { @@ -2750,7 +2750,7 @@ ebtablesRenameTmpRootChainFW(virFirewallPtr fw, static int -ebtablesRenameTmpSubAndRootChainsQuery(virFirewallPtr fw, +ebtablesRenameTmpSubAndRootChainsQuery(virFirewall *fw, virFirewallLayer layer, const char *const *lines, void *opaque G_GNUC_UNUSED) @@ -2797,7 +2797,7 @@ ebtablesRenameTmpSubAndRootChainsQuery(virFirewallPtr fw, static void -ebtablesRenameTmpSubAndRootChainsFW(virFirewallPtr fw, +ebtablesRenameTmpSubAndRootChainsFW(virFirewall *fw, const char *ifname) { char rootchain[MAX_CHAINNAME_LENGTH]; @@ -2915,7 +2915,7 @@ ebtablesApplyBasicRules(const char *ifname, static int ebtablesApplyDHCPOnlyRules(const char *ifname, const virMacAddr *macaddr, - virNWFilterVarValuePtr dhcpsrvrs, + virNWFilterVarValue *dhcpsrvrs, bool leaveTemporary) { char chain_in [MAX_CHAINNAME_LENGTH], @@ -3195,12 +3195,12 @@ ebtablesGetProtoIdxByFiltername(const char *filtername) static int -iptablesRuleInstCommand(virFirewallPtr fw, +iptablesRuleInstCommand(virFirewall *fw, const char *ifname, - virNWFilterRuleInstPtr rule) + virNWFilterRuleInst *rule) { - virNWFilterVarCombIterPtr vciter; - virNWFilterVarCombIterPtr tmp; + virNWFilterVarCombIter *vciter; + virNWFilterVarCombIter *tmp; int ret = -1; /* rule->vars holds all the variables names that this rule will access. @@ -3231,12 +3231,12 @@ iptablesRuleInstCommand(virFirewallPtr fw, static int -ebtablesRuleInstCommand(virFirewallPtr fw, +ebtablesRuleInstCommand(virFirewall *fw, const char *ifname, - virNWFilterRuleInstPtr rule) + virNWFilterRuleInst *rule) { - virNWFilterVarCombIterPtr vciter; - virNWFilterVarCombIterPtr tmp; + virNWFilterVarCombIter *vciter; + virNWFilterVarCombIter *tmp; int ret = -1; /* rule->vars holds all the variables names that this rule will access. @@ -3266,7 +3266,6 @@ ebtablesRuleInstCommand(virFirewallPtr fw, } typedef struct _ebtablesSubChainInst ebtablesSubChainInst; -typedef ebtablesSubChainInst *ebtablesSubChainInstPtr; struct _ebtablesSubChainInst { virNWFilterChainPriority priority; bool incoming; @@ -3289,10 +3288,10 @@ ebtablesSubChainInstSort(const void *a, const void *b) static int ebtablesGetSubChainInsts(GHashTable *chains, bool incoming, - ebtablesSubChainInstPtr **insts, + ebtablesSubChainInst ***insts, size_t *ninsts) { - g_autofree virHashKeyValuePairPtr filter_names = NULL; + g_autofree virHashKeyValuePair *filter_names = NULL; size_t nfilter_names; size_t i; @@ -3303,7 +3302,7 @@ ebtablesGetSubChainInsts(GHashTable *chains, qsort(filter_names, nfilter_names, sizeof(*filter_names), ebiptablesFilterOrderSort); for (i = 0; filter_names[i].key; i++) { - g_autofree ebtablesSubChainInstPtr inst = NULL; + g_autofree ebtablesSubChainInst *inst = NULL; enum l3_proto_idx idx = ebtablesGetProtoIdxByFiltername( filter_names[i].key); @@ -3325,7 +3324,7 @@ ebtablesGetSubChainInsts(GHashTable *chains, static int ebiptablesApplyNewRules(const char *ifname, - virNWFilterRuleInstPtr *rules, + virNWFilterRuleInst **rules, size_t nrules) { size_t i, j; @@ -3335,7 +3334,7 @@ ebiptablesApplyNewRules(const char *ifname, bool haveEbtables = false; bool haveIptables = false; bool haveIp6tables = false; - g_autofree ebtablesSubChainInstPtr *subchains = NULL; + g_autofree ebtablesSubChainInst **subchains = NULL; size_t nsubchains = 0; int ret = -1; @@ -3535,7 +3534,7 @@ ebiptablesApplyNewRules(const char *ifname, static void -ebiptablesTearNewRulesFW(virFirewallPtr fw, const char *ifname) +ebiptablesTearNewRulesFW(virFirewall *fw, const char *ifname) { iptablesUnlinkTmpRootChainsFW(fw, VIR_FIREWALL_LAYER_IPV4, ifname); iptablesRemoveTmpRootChainsFW(fw, VIR_FIREWALL_LAYER_IPV4, ifname); @@ -3674,7 +3673,7 @@ ebiptablesDriverProbeCtdir(void) static int -ebiptablesDriverProbeStateMatchQuery(virFirewallPtr fw G_GNUC_UNUSED, +ebiptablesDriverProbeStateMatchQuery(virFirewall *fw G_GNUC_UNUSED, virFirewallLayer layer G_GNUC_UNUSED, const char *const *lines, void *opaque) diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c index 4ada797033..8aa1db23d3 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -50,17 +50,17 @@ VIR_LOG_INIT("nwfilter.nwfilter_gentech_driver"); static int _virNWFilterTeardownFilter(const char *ifname); -static virNWFilterTechDriverPtr filter_tech_drivers[] = { +static virNWFilterTechDriver *filter_tech_drivers[] = { &ebiptables_driver, NULL }; /* Serializes instantiation of filters. This is necessary * to avoid lock ordering deadlocks. eg virNWFilterInstantiateFilterUpdate - * will hold a lock on a virNWFilterObjPtr. This in turn invokes + * will hold a lock on a virNWFilterObj *. This in turn invokes * virNWFilterDoInstantiate which invokes virNWFilterDetermineMissingVarsRec * which invokes virNWFilterObjListFindInstantiateFilter. This iterates over - * every single virNWFilterObjPtr in the list. So if 2 threads try to + * every single virNWFilterObj *in the list. So if 2 threads try to * instantiate a filter in parallel, they'll both hold 1 lock at the top level * in virNWFilterInstantiateFilterUpdate which will cause the other thread * to deadlock in virNWFilterObjListFindInstantiateFilter. @@ -99,7 +99,7 @@ void virNWFilterTechDriversShutdown(void) } -virNWFilterTechDriverPtr +virNWFilterTechDriver * virNWFilterTechDriverForName(const char *name) { size_t i = 0; @@ -116,7 +116,7 @@ virNWFilterTechDriverForName(const char *name) static void -virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst) +virNWFilterRuleInstFree(virNWFilterRuleInst *inst) { if (!inst) return; @@ -218,17 +218,16 @@ virNWFilterCreateVarsFrom(GHashTable *vars1, typedef struct _virNWFilterInst virNWFilterInst; -typedef virNWFilterInst *virNWFilterInstPtr; struct _virNWFilterInst { - virNWFilterObjPtr *filters; + virNWFilterObj **filters; size_t nfilters; - virNWFilterRuleInstPtr *rules; + virNWFilterRuleInst **rules; size_t nrules; }; static void -virNWFilterInstReset(virNWFilterInstPtr inst) +virNWFilterInstReset(virNWFilterInst *inst) { size_t i; @@ -246,20 +245,20 @@ virNWFilterInstReset(virNWFilterInstPtr inst) static int -virNWFilterDefToInst(virNWFilterDriverStatePtr driver, - virNWFilterDefPtr def, +virNWFilterDefToInst(virNWFilterDriverState *driver, + virNWFilterDef *def, GHashTable *vars, enum instCase useNewFilter, bool *foundNewFilter, - virNWFilterInstPtr inst); + virNWFilterInst *inst); static int -virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def, - virNWFilterRuleDefPtr rule, +virNWFilterRuleDefToRuleInst(virNWFilterDef *def, + virNWFilterRuleDef *rule, GHashTable *vars, - virNWFilterInstPtr inst) + virNWFilterInst *inst) { - virNWFilterRuleInstPtr ruleinst; + virNWFilterRuleInst *ruleinst; int ret = -1; ruleinst = g_new0(virNWFilterRuleInst, 1); @@ -286,17 +285,17 @@ virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def, static int -virNWFilterIncludeDefToRuleInst(virNWFilterDriverStatePtr driver, - virNWFilterIncludeDefPtr inc, +virNWFilterIncludeDefToRuleInst(virNWFilterDriverState *driver, + virNWFilterIncludeDef *inc, GHashTable *vars, enum instCase useNewFilter, bool *foundNewFilter, - virNWFilterInstPtr inst) + virNWFilterInst *inst) { - virNWFilterObjPtr obj; + virNWFilterObj *obj; GHashTable *tmpvars = NULL; - virNWFilterDefPtr childdef; - virNWFilterDefPtr newChilddef; + virNWFilterDef *childdef; + virNWFilterDef *newChilddef; int ret = -1; VIR_DEBUG("Instantiating filter %s", inc->filterref); @@ -367,12 +366,12 @@ virNWFilterIncludeDefToRuleInst(virNWFilterDriverStatePtr driver, * Returns 0 on success, -1 on error */ static int -virNWFilterDefToInst(virNWFilterDriverStatePtr driver, - virNWFilterDefPtr def, +virNWFilterDefToInst(virNWFilterDriverState *driver, + virNWFilterDef *def, GHashTable *vars, enum instCase useNewFilter, bool *foundNewFilter, - virNWFilterInstPtr inst) + virNWFilterInst *inst) { size_t i; int ret = -1; @@ -403,22 +402,22 @@ virNWFilterDefToInst(virNWFilterDriverStatePtr driver, static int -virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter, +virNWFilterDetermineMissingVarsRec(virNWFilterDef *filter, GHashTable *vars, GHashTable *missing_vars, int useNewFilter, - virNWFilterDriverStatePtr driver) + virNWFilterDriverState *driver) { - virNWFilterObjPtr obj; + virNWFilterObj *obj; int rc = 0; size_t i, j; - virNWFilterDefPtr next_filter; - virNWFilterDefPtr newNext_filter; - virNWFilterVarValuePtr val; + virNWFilterDef *next_filter; + virNWFilterDef *newNext_filter; + virNWFilterVarValue *val; for (i = 0; i < filter->nentries; i++) { - virNWFilterRuleDefPtr rule = filter->filterEntries[i]->rule; - virNWFilterIncludeDefPtr inc = filter->filterEntries[i]->include; + virNWFilterRuleDef * rule = filter->filterEntries[i]->rule; + virNWFilterIncludeDef *inc = filter->filterEntries[i]->include; if (rule) { /* check all variables of this rule */ for (j = 0; j < rule->nVarAccess; j++) { @@ -498,21 +497,21 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter, * Call this function while holding the NWFilter filter update lock */ static int -virNWFilterDoInstantiate(virNWFilterTechDriverPtr techdriver, - virNWFilterBindingDefPtr binding, - virNWFilterDefPtr filter, +virNWFilterDoInstantiate(virNWFilterTechDriver *techdriver, + virNWFilterBindingDef *binding, + virNWFilterDef *filter, int ifindex, enum instCase useNewFilter, bool *foundNewFilter, bool teardownOld, - virNWFilterDriverStatePtr driver, + virNWFilterDriverState *driver, bool forceWithPendingReq) { int rc; virNWFilterInst inst; bool instantiate = true; g_autofree char *buf = NULL; - virNWFilterVarValuePtr lv; + virNWFilterVarValue *lv; const char *learning; bool reportIP = false; @@ -664,9 +663,9 @@ virNWFilterVarHashmapAddStdValue(GHashTable *table, * Call this function while holding the NWFilter filter update lock */ static int -virNWFilterInstantiateFilterUpdate(virNWFilterDriverStatePtr driver, +virNWFilterInstantiateFilterUpdate(virNWFilterDriverState *driver, bool teardownOld, - virNWFilterBindingDefPtr binding, + virNWFilterBindingDef *binding, int ifindex, enum instCase useNewFilter, bool forceWithPendingReq, @@ -674,12 +673,12 @@ virNWFilterInstantiateFilterUpdate(virNWFilterDriverStatePtr driver, { int rc = -1; const char *drvname = EBIPTABLES_DRIVER_ID; - virNWFilterTechDriverPtr techdriver; - virNWFilterObjPtr obj; - virNWFilterDefPtr filter; - virNWFilterDefPtr newFilter; + virNWFilterTechDriver *techdriver; + virNWFilterObj *obj; + virNWFilterDef *filter; + virNWFilterDef *newFilter; char vmmacaddr[VIR_MAC_STRING_BUFLEN] = {0}; - virNWFilterVarValuePtr ipaddr; + virNWFilterVarValue *ipaddr; techdriver = virNWFilterTechDriverForName(drvname); @@ -739,8 +738,8 @@ virNWFilterInstantiateFilterUpdate(virNWFilterDriverStatePtr driver, static int -virNWFilterInstantiateFilterInternal(virNWFilterDriverStatePtr driver, - virNWFilterBindingDefPtr binding, +virNWFilterInstantiateFilterInternal(virNWFilterDriverState *driver, + virNWFilterBindingDef *binding, bool teardownOld, enum instCase useNewFilter, bool *foundNewFilter) @@ -776,8 +775,8 @@ virNWFilterInstantiateFilterInternal(virNWFilterDriverStatePtr driver, int -virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver, - virNWFilterBindingDefPtr binding, +virNWFilterInstantiateFilterLate(virNWFilterDriverState *driver, + virNWFilterBindingDef *binding, int ifindex) { int rc; @@ -808,8 +807,8 @@ virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver, int -virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver, - virNWFilterBindingDefPtr binding) +virNWFilterInstantiateFilter(virNWFilterDriverState *driver, + virNWFilterBindingDef *binding) { bool foundNewFilter = false; @@ -821,8 +820,8 @@ virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver, int -virNWFilterUpdateInstantiateFilter(virNWFilterDriverStatePtr driver, - virNWFilterBindingDefPtr binding, +virNWFilterUpdateInstantiateFilter(virNWFilterDriverState *driver, + virNWFilterBindingDef *binding, bool *skipIface) { bool foundNewFilter = false; @@ -837,11 +836,11 @@ virNWFilterUpdateInstantiateFilter(virNWFilterDriverStatePtr driver, } static int -virNWFilterRollbackUpdateFilter(virNWFilterBindingDefPtr binding) +virNWFilterRollbackUpdateFilter(virNWFilterBindingDef *binding) { const char *drvname = EBIPTABLES_DRIVER_ID; int ifindex; - virNWFilterTechDriverPtr techdriver; + virNWFilterTechDriver *techdriver; techdriver = virNWFilterTechDriverForName(drvname); if (!techdriver) { @@ -863,11 +862,11 @@ virNWFilterRollbackUpdateFilter(virNWFilterBindingDefPtr binding) static int -virNWFilterTearOldFilter(virNWFilterBindingDefPtr binding) +virNWFilterTearOldFilter(virNWFilterBindingDef *binding) { const char *drvname = EBIPTABLES_DRIVER_ID; int ifindex; - virNWFilterTechDriverPtr techdriver; + virNWFilterTechDriver *techdriver; techdriver = virNWFilterTechDriverForName(drvname); if (!techdriver) { @@ -892,7 +891,7 @@ static int _virNWFilterTeardownFilter(const char *ifname) { const char *drvname = EBIPTABLES_DRIVER_ID; - virNWFilterTechDriverPtr techdriver; + virNWFilterTechDriver *techdriver; techdriver = virNWFilterTechDriverForName(drvname); if (!techdriver) { @@ -921,7 +920,7 @@ _virNWFilterTeardownFilter(const char *ifname) int -virNWFilterTeardownFilter(virNWFilterBindingDefPtr binding) +virNWFilterTeardownFilter(virNWFilterBindingDef *binding) { int ret; virMutexLock(&updateMutex); @@ -938,8 +937,8 @@ enum { }; static int -virNWFilterBuildOne(virNWFilterDriverStatePtr driver, - virNWFilterBindingDefPtr binding, +virNWFilterBuildOne(virNWFilterDriverState *driver, + virNWFilterBindingDef *binding, GHashTable *skipInterfaces, int step) { @@ -981,23 +980,23 @@ virNWFilterBuildOne(virNWFilterDriverStatePtr driver, struct virNWFilterBuildData { - virNWFilterDriverStatePtr driver; + virNWFilterDriverState *driver; GHashTable *skipInterfaces; int step; }; static int -virNWFilterBuildIter(virNWFilterBindingObjPtr binding, void *opaque) +virNWFilterBuildIter(virNWFilterBindingObj *binding, void *opaque) { struct virNWFilterBuildData *data = opaque; - virNWFilterBindingDefPtr def = virNWFilterBindingObjGetDef(binding); + virNWFilterBindingDef *def = virNWFilterBindingObjGetDef(binding); return virNWFilterBuildOne(data->driver, def, data->skipInterfaces, data->step); } int -virNWFilterBuildAll(virNWFilterDriverStatePtr driver, +virNWFilterBuildAll(virNWFilterDriverState *driver, bool newFilters) { struct virNWFilterBuildData data = { diff --git a/src/nwfilter/nwfilter_gentech_driver.h b/src/nwfilter/nwfilter_gentech_driver.h index b1cf8e6e41..56d1d7a80a 100644 --- a/src/nwfilter/nwfilter_gentech_driver.h +++ b/src/nwfilter/nwfilter_gentech_driver.h @@ -26,7 +26,7 @@ #include "virnwfilterbindingdef.h" #include "nwfilter_tech_driver.h" -virNWFilterTechDriverPtr virNWFilterTechDriverForName(const char *name); +virNWFilterTechDriver *virNWFilterTechDriverForName(const char *name); int virNWFilterTechDriversInit(bool privileged); void virNWFilterTechDriversShutdown(void); @@ -37,20 +37,20 @@ enum instCase { }; -int virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver, - virNWFilterBindingDefPtr binding); -int virNWFilterUpdateInstantiateFilter(virNWFilterDriverStatePtr driver, - virNWFilterBindingDefPtr binding, +int virNWFilterInstantiateFilter(virNWFilterDriverState *driver, + virNWFilterBindingDef *binding); +int virNWFilterUpdateInstantiateFilter(virNWFilterDriverState *driver, + virNWFilterBindingDef *binding, bool *skipIface); -int virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver, - virNWFilterBindingDefPtr binding, +int virNWFilterInstantiateFilterLate(virNWFilterDriverState *driver, + virNWFilterBindingDef *binding, int ifindex); -int virNWFilterTeardownFilter(virNWFilterBindingDefPtr binding); +int virNWFilterTeardownFilter(virNWFilterBindingDef *binding); GHashTable *virNWFilterCreateVarHashmap(const char *macaddr, const virNWFilterVarValue *value); -int virNWFilterBuildAll(virNWFilterDriverStatePtr driver, +int virNWFilterBuildAll(virNWFilterDriverState *driver, bool newFilters); diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c index ba5eea5ee5..907e4b2513 100644 --- a/src/nwfilter/nwfilter_learnipaddr.c +++ b/src/nwfilter/nwfilter_learnipaddr.c @@ -118,7 +118,6 @@ static virMutex ifaceMapLock = VIR_MUTEX_INITIALIZER; static GHashTable *ifaceLockMap; typedef struct _virNWFilterIfaceLock virNWFilterIfaceLock; -typedef virNWFilterIfaceLock *virNWFilterIfaceLockPtr; struct _virNWFilterIfaceLock { char ifname[IF_NAMESIZE]; virMutex lock; @@ -126,12 +125,11 @@ struct _virNWFilterIfaceLock { }; typedef struct _virNWFilterIPAddrLearnReq virNWFilterIPAddrLearnReq; -typedef virNWFilterIPAddrLearnReq *virNWFilterIPAddrLearnReqPtr; struct _virNWFilterIPAddrLearnReq { - virNWFilterTechDriverPtr techdriver; + virNWFilterTechDriver *techdriver; int ifindex; - virNWFilterBindingDefPtr binding; - virNWFilterDriverStatePtr driver; + virNWFilterBindingDef *binding; + virNWFilterDriverState *driver; int howDetect; /* bitmask of enum howDetect */ int status; @@ -145,7 +143,7 @@ static bool threadsTerminate; int virNWFilterLockIface(const char *ifname) { - virNWFilterIfaceLockPtr ifaceLock; + virNWFilterIfaceLock *ifaceLock; virMutexLock(&ifaceMapLock); @@ -195,7 +193,7 @@ virNWFilterLockIface(const char *ifname) void virNWFilterUnlockIface(const char *ifname) { - virNWFilterIfaceLockPtr ifaceLock; + virNWFilterIfaceLock *ifaceLock; virMutexLock(&ifaceMapLock); @@ -214,7 +212,7 @@ virNWFilterUnlockIface(const char *ifname) static void -virNWFilterIPAddrLearnReqFree(virNWFilterIPAddrLearnReqPtr req) +virNWFilterIPAddrLearnReqFree(virNWFilterIPAddrLearnReq *req) { if (!req) return; @@ -228,7 +226,7 @@ virNWFilterIPAddrLearnReqFree(virNWFilterIPAddrLearnReqPtr req) #if WITH_LIBPCAP static int -virNWFilterRegisterLearnReq(virNWFilterIPAddrLearnReqPtr req) +virNWFilterRegisterLearnReq(virNWFilterIPAddrLearnReq *req) { int res = -1; g_autofree char *ifindex_str = g_strdup_printf("%d", req->ifindex); @@ -251,7 +249,7 @@ virNWFilterTerminateLearnReq(const char *ifname) { int rc = -1; int ifindex; - virNWFilterIPAddrLearnReqPtr req; + virNWFilterIPAddrLearnReq *req; g_autofree char *ifindex_str = NULL; /* It's possible that it's already been removed as a result of @@ -308,10 +306,10 @@ freeLearnReqEntry(void *payload) #ifdef WITH_LIBPCAP -static virNWFilterIPAddrLearnReqPtr +static virNWFilterIPAddrLearnReq * virNWFilterDeregisterLearnReq(int ifindex) { - virNWFilterIPAddrLearnReqPtr res; + virNWFilterIPAddrLearnReq *res; g_autofree char *ifindex_str = g_strdup_printf("%d", ifindex); virMutexLock(&pendingLearnReqLock); @@ -388,7 +386,7 @@ learnIPAddressThread(void *arg) const u_char *packet; struct ether_header *ether_hdr; struct ether_vlan_header *vlan_hdr; - virNWFilterIPAddrLearnReqPtr req = arg; + virNWFilterIPAddrLearnReq *req = arg; uint32_t vmaddr = 0, bcastaddr = 0; unsigned int ethHdrSize; char *listen_if = (req->binding->linkdevname ? @@ -401,7 +399,7 @@ learnIPAddressThread(void *arg) uint16_t etherType; bool showError = true; enum howDetect howDetected = 0; - virNWFilterTechDriverPtr techdriver = req->techdriver; + virNWFilterTechDriver *techdriver = req->techdriver; struct pollfd fds[1]; if (virNWFilterLockIface(req->binding->portdevname) < 0) @@ -693,15 +691,15 @@ learnIPAddressThread(void *arg) * firewall rules on the interface. */ int -virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver, - virNWFilterBindingDefPtr binding, +virNWFilterLearnIPAddress(virNWFilterTechDriver *techdriver, + virNWFilterBindingDef *binding, int ifindex, - virNWFilterDriverStatePtr driver, + virNWFilterDriverState *driver, int howDetect) { int rc; virThread thread; - virNWFilterIPAddrLearnReqPtr req = NULL; + virNWFilterIPAddrLearnReq *req = NULL; if (howDetect == 0) return -1; @@ -749,10 +747,10 @@ virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver, #else int -virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver G_GNUC_UNUSED, - virNWFilterBindingDefPtr binding G_GNUC_UNUSED, +virNWFilterLearnIPAddress(virNWFilterTechDriver *techdriver G_GNUC_UNUSED, + virNWFilterBindingDef *binding G_GNUC_UNUSED, int ifindex G_GNUC_UNUSED, - virNWFilterDriverStatePtr driver G_GNUC_UNUSED, + virNWFilterDriverState *driver G_GNUC_UNUSED, int howDetect G_GNUC_UNUSED) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", diff --git a/src/nwfilter/nwfilter_learnipaddr.h b/src/nwfilter/nwfilter_learnipaddr.h index 2c214183a1..5fe5bac036 100644 --- a/src/nwfilter/nwfilter_learnipaddr.h +++ b/src/nwfilter/nwfilter_learnipaddr.h @@ -33,10 +33,10 @@ enum howDetect { DETECT_STATIC = 2, }; -int virNWFilterLearnIPAddress(virNWFilterTechDriverPtr techdriver, - virNWFilterBindingDefPtr binding, +int virNWFilterLearnIPAddress(virNWFilterTechDriver *techdriver, + virNWFilterBindingDef *binding, int ifindex, - virNWFilterDriverStatePtr driver, + virNWFilterDriverState *driver, int howDetect); bool virNWFilterHasLearnReq(int ifindex); diff --git a/src/nwfilter/nwfilter_tech_driver.h b/src/nwfilter/nwfilter_tech_driver.h index 784d397a90..8de9eda947 100644 --- a/src/nwfilter/nwfilter_tech_driver.h +++ b/src/nwfilter/nwfilter_tech_driver.h @@ -26,15 +26,13 @@ #include "virnwfilterobj.h" typedef struct _virNWFilterTechDriver virNWFilterTechDriver; -typedef virNWFilterTechDriver *virNWFilterTechDriverPtr; typedef struct _virNWFilterRuleInst virNWFilterRuleInst; -typedef virNWFilterRuleInst *virNWFilterRuleInstPtr; struct _virNWFilterRuleInst { const char *chainSuffix; virNWFilterChainPriority chainPriority; - virNWFilterRuleDefPtr def; + virNWFilterRuleDef *def; virNWFilterRulePriority priority; GHashTable *vars; }; @@ -44,7 +42,7 @@ typedef int (*virNWFilterTechDrvInit)(bool privileged); typedef void (*virNWFilterTechDrvShutdown)(void); typedef int (*virNWFilterRuleApplyNewRules)(const char *ifname, - virNWFilterRuleInstPtr *rules, + virNWFilterRuleInst **rules, size_t nrules); typedef int (*virNWFilterRuleTeardownNewRules)(const char *ifname); @@ -60,7 +58,7 @@ typedef int (*virNWFilterApplyBasicRules)(const char *ifname, typedef int (*virNWFilterApplyDHCPOnlyRules)(const char *ifname, const virMacAddr *macaddr, - virNWFilterVarValuePtr dhcpsrvs, + virNWFilterVarValue *dhcpsrvs, bool leaveTemporary); typedef int (*virNWFilterRemoveBasicRules)(const char *ifname); diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c index cf29ce30ad..2a794801ae 100644 --- a/src/openvz/openvz_conf.c +++ b/src/openvz/openvz_conf.c @@ -70,7 +70,7 @@ openvzExtractVersionInfo(const char *cmdstr, int *retversion) unsigned long version; char *help = NULL; char *tmp; - virCommandPtr cmd = virCommandNewArgList(cmdstr, "--help", NULL); + virCommand *cmd = virCommandNewArgList(cmdstr, "--help", NULL); if (retversion) *retversion = 0; @@ -141,10 +141,10 @@ openvzParseBarrierLimit(const char* value, } -virCapsPtr openvzCapsInit(void) +virCaps *openvzCapsInit(void) { g_autoptr(virCaps) caps = NULL; - virCapsGuestPtr guest; + virCapsGuest *guest; if ((caps = virCapabilitiesNew(virArchFromHost(), false, false)) == NULL) @@ -178,11 +178,11 @@ virCapsPtr openvzCapsInit(void) int -openvzReadNetworkConf(virDomainDefPtr def, +openvzReadNetworkConf(virDomainDef *def, int veid) { int ret; - virDomainNetDefPtr net = NULL; + virDomainNetDef *net = NULL; char *temp = NULL; char *token, *saveptr = NULL; @@ -291,11 +291,11 @@ openvzReadNetworkConf(virDomainDefPtr def, static int -openvzReadFSConf(virDomainDefPtr def, +openvzReadFSConf(virDomainDef *def, int veid) { int ret; - virDomainFSDefPtr fs = NULL; + virDomainFSDef *fs = NULL; g_autofree char *veid_str = NULL; char *temp = NULL; const char *param; @@ -370,7 +370,7 @@ openvzReadFSConf(virDomainDefPtr def, static int -openvzReadMemConf(virDomainDefPtr def, int veid) +openvzReadMemConf(virDomainDef *def, int veid) { int ret = -1; char *temp = NULL; @@ -458,12 +458,12 @@ int openvzLoadDomains(struct openvz_driver *driver) int veid, ret; char *status; char uuidstr[VIR_UUID_STRING_BUFLEN]; - virDomainObjPtr dom = NULL; - virDomainDefPtr def = NULL; + virDomainObj *dom = NULL; + virDomainDef *def = NULL; char *temp = NULL; char *outbuf = NULL; char *line; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; unsigned int vcpus = 0; if (openvzAssignUUIDs() < 0) @@ -1010,7 +1010,7 @@ static int openvzAssignUUIDs(void) int openvzGetVEID(const char *name) { - virCommandPtr cmd; + virCommand *cmd; char *outbuf; char *temp; int veid; @@ -1038,7 +1038,7 @@ int openvzGetVEID(const char *name) static int -openvzDomainDefPostParse(virDomainDefPtr def, +openvzDomainDefPostParse(virDomainDef *def, unsigned int parseFlags G_GNUC_UNUSED, void *opaque, void *parseOpaque G_GNUC_UNUSED) @@ -1058,7 +1058,7 @@ openvzDomainDefPostParse(virDomainDefPtr def, static int -openvzDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, +openvzDomainDeviceDefPostParse(virDomainDeviceDef *dev, const virDomainDef *def G_GNUC_UNUSED, unsigned int parseFlags G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED, @@ -1097,7 +1097,7 @@ virDomainDefParserConfig openvzDomainDefParserConfig = { .features = VIR_DOMAIN_DEF_FEATURE_NAME_SLASH, }; -virDomainXMLOptionPtr openvzXMLOption(struct openvz_driver *driver) +virDomainXMLOption *openvzXMLOption(struct openvz_driver *driver) { openvzDomainDefParserConfig.priv = driver; return virDomainXMLOptionNew(&openvzDomainDefParserConfig, diff --git a/src/openvz/openvz_conf.h b/src/openvz/openvz_conf.h index 9892f39481..9c3eff9aaf 100644 --- a/src/openvz/openvz_conf.h +++ b/src/openvz/openvz_conf.h @@ -39,9 +39,9 @@ struct openvz_driver { virMutex lock; - virCapsPtr caps; - virDomainXMLOptionPtr xmlopt; - virDomainObjListPtr domains; + virCaps *caps; + virDomainXMLOption *xmlopt; + virDomainObjList *domains; int version; }; @@ -56,11 +56,11 @@ int openvzReadVPSConfigParam(int vpsid, const char *param, char **value); int openvzWriteVPSConfigParam(int vpsid, const char *param, const char *value); int openvzReadConfigParam(const char *conf_file, const char *param, char **value); int openvzCopyDefaultConfig(int vpsid); -virCapsPtr openvzCapsInit(void); +virCaps *openvzCapsInit(void); int openvzLoadDomains(struct openvz_driver *driver); void openvzFreeDriver(struct openvz_driver *driver); int strtoI(const char *str); int openvzSetDefinedUUID(int vpsid, unsigned char *uuid); int openvzGetVEID(const char *name); -int openvzReadNetworkConf(virDomainDefPtr def, int veid); -virDomainXMLOptionPtr openvzXMLOption(struct openvz_driver *driver); +int openvzReadNetworkConf(virDomainDef *def, int veid); +virDomainXMLOption *openvzXMLOption(struct openvz_driver *driver); diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c index 9f65dff5d1..93549e914a 100644 --- a/src/openvz/openvz_driver.c +++ b/src/openvz/openvz_driver.c @@ -58,12 +58,12 @@ VIR_LOG_INIT("openvz.openvz_driver"); static int openvzGetProcessInfo(unsigned long long *cpuTime, int vpsid); static int openvzConnectGetMaxVcpus(virConnectPtr conn, const char *type); static int openvzDomainGetMaxVcpus(virDomainPtr dom); -static int openvzDomainSetVcpusInternal(virDomainObjPtr vm, +static int openvzDomainSetVcpusInternal(virDomainObj *vm, unsigned int nvcpus, - virDomainXMLOptionPtr xmlopt); -static int openvzDomainSetMemoryInternal(virDomainObjPtr vm, + virDomainXMLOption *xmlopt); +static int openvzDomainSetMemoryInternal(virDomainObj *vm, unsigned long long memory); -static int openvzGetVEStatus(virDomainObjPtr vm, int *status, int *reason); +static int openvzGetVEStatus(virDomainObj *vm, int *status, int *reason); static void openvzDriverLock(struct openvz_driver *driver) { @@ -78,11 +78,11 @@ static void openvzDriverUnlock(struct openvz_driver *driver) struct openvz_driver ovz_driver; -static virDomainObjPtr +static virDomainObj * openvzDomObjFromDomainLocked(struct openvz_driver *driver, const unsigned char *uuid) { - virDomainObjPtr vm; + virDomainObj *vm; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (!(vm = virDomainObjListFindByUUID(driver->domains, uuid))) { @@ -97,11 +97,11 @@ openvzDomObjFromDomainLocked(struct openvz_driver *driver, } -static virDomainObjPtr +static virDomainObj * openvzDomObjFromDomain(struct openvz_driver *driver, const unsigned char *uuid) { - virDomainObjPtr vm; + virDomainObj *vm; openvzDriverLock(driver); vm = openvzDomObjFromDomainLocked(driver, uuid); @@ -115,10 +115,10 @@ openvzDomObjFromDomain(struct openvz_driver *driver, 0 - OK Caller has to free the cmd */ -static virCommandPtr -openvzDomainDefineCmd(virDomainDefPtr vmdef) +static virCommand * +openvzDomainDefineCmd(virDomainDef *vmdef) { - virCommandPtr cmd = virCommandNewArgList(VZCTL, + virCommand *cmd = virCommandNewArgList(VZCTL, "--quiet", "create", NULL); @@ -141,11 +141,11 @@ openvzDomainDefineCmd(virDomainDefPtr vmdef) } -static int openvzSetInitialConfig(virDomainDefPtr vmdef) +static int openvzSetInitialConfig(virDomainDef *vmdef) { int ret = -1; int vpsid; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; if (vmdef->nfss > 1) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -200,13 +200,13 @@ static int openvzSetInitialConfig(virDomainDefPtr vmdef) static int -openvzSetDiskQuota(virDomainDefPtr vmdef, - virDomainFSDefPtr fss, +openvzSetDiskQuota(virDomainDef *vmdef, + virDomainFSDef *fss, bool persist) { int ret = -1; unsigned long long sl, hl; - virCommandPtr cmd = virCommandNewArgList(VZCTL, + virCommand *cmd = virCommandNewArgList(VZCTL, "--quiet", "set", vmdef->name, @@ -248,7 +248,7 @@ openvzDomainGetHostname(virDomainPtr dom, unsigned int flags) { char *hostname = NULL; struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; virCheckFlags(0, NULL); if (!(vm = openvzDomObjFromDomain(driver, dom->uuid))) @@ -275,7 +275,7 @@ static virDomainPtr openvzDomainLookupByID(virConnectPtr conn, int id) { struct openvz_driver *driver = conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; virDomainPtr dom = NULL; openvzDriverLock(driver); @@ -314,7 +314,7 @@ static char *openvzConnectGetHostname(virConnectPtr conn G_GNUC_UNUSED) static char *openvzDomainGetOSType(virDomainPtr dom) { struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; char *ret = NULL; if (!(vm = openvzDomObjFromDomain(driver, dom->uuid))) @@ -331,7 +331,7 @@ static virDomainPtr openvzDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { struct openvz_driver *driver = conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; virDomainPtr dom = NULL; if (!(vm = openvzDomObjFromDomain(driver, uuid))) @@ -347,7 +347,7 @@ static virDomainPtr openvzDomainLookupByName(virConnectPtr conn, const char *name) { struct openvz_driver *driver = conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; virDomainPtr dom = NULL; openvzDriverLock(driver); @@ -371,7 +371,7 @@ static int openvzDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) { struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int state; int ret = -1; @@ -410,7 +410,7 @@ openvzDomainGetState(virDomainPtr dom, unsigned int flags) { struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -428,7 +428,7 @@ openvzDomainGetState(virDomainPtr dom, static int openvzDomainIsActive(virDomainPtr dom) { struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = openvzDomObjFromDomain(driver, dom->uuid))) @@ -444,7 +444,7 @@ static int openvzDomainIsActive(virDomainPtr dom) static int openvzDomainIsPersistent(virDomainPtr dom) { struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = openvzDomObjFromDomain(driver, dom->uuid))) @@ -463,7 +463,7 @@ static int openvzDomainIsUpdated(virDomainPtr dom G_GNUC_UNUSED) static char *openvzDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) { struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; char *ret = NULL; virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS, NULL); @@ -483,7 +483,7 @@ static int openvzDomainSuspend(virDomainPtr dom) { g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL, "--quiet", "chkpnt", NULL); struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (!(vm = openvzDomObjFromDomain(driver, dom->uuid))) @@ -510,7 +510,7 @@ static int openvzDomainResume(virDomainPtr dom) { g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL, "--quiet", "chkpnt", NULL); struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (!(vm = openvzDomObjFromDomain(driver, dom->uuid))) @@ -539,7 +539,7 @@ openvzDomainShutdownFlags(virDomainPtr dom, { g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL, "--quiet", "stop", NULL); struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; int status; @@ -595,7 +595,7 @@ static int openvzDomainReboot(virDomainPtr dom, { g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL, "--quiet", "restart", NULL); struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; int status; @@ -671,15 +671,15 @@ openvzGenerateContainerVethName(int veid) static int openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid, - virDomainNetDefPtr net, - virBufferPtr configBuf) + virDomainNetDef *net, + virBuffer *configBuf) { int rc = -1; char macaddr[VIR_MAC_STRING_BUFLEN]; virMacAddr host_mac; char host_macaddr[VIR_MAC_STRING_BUFLEN]; struct openvz_driver *driver = conn->privateData; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; char *guest_ifname = NULL; if (net == NULL) @@ -779,7 +779,7 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid, static int openvzDomainSetNetworkConfig(virConnectPtr conn, - virDomainDefPtr def) + virDomainDef *def) { size_t i; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -827,8 +827,8 @@ static virDomainPtr openvzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags) { struct openvz_driver *driver = conn->privateData; - virDomainDefPtr vmdef = NULL; - virDomainObjPtr vm = NULL; + virDomainDef *vmdef = NULL; + virDomainObj *vm = NULL; virDomainPtr dom = NULL; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; @@ -917,8 +917,8 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml, { g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL, "--quiet", "start", NULL); struct openvz_driver *driver = conn->privateData; - virDomainDefPtr vmdef = NULL; - virDomainObjPtr vm = NULL; + virDomainDef *vmdef = NULL; + virDomainObj *vm = NULL; virDomainPtr dom = NULL; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; @@ -998,7 +998,7 @@ openvzDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) { g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL, "--quiet", "start", NULL); struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; int status; @@ -1051,7 +1051,7 @@ openvzDomainUndefineFlags(virDomainPtr dom, { g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL, "--quiet", "start", "destroy", NULL); struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; int status; @@ -1091,7 +1091,7 @@ static int openvzDomainSetAutostart(virDomainPtr dom, int autostart) { struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL, "--quiet", NULL); int ret = -1; @@ -1116,7 +1116,7 @@ static int openvzDomainGetAutostart(virDomainPtr dom, int *autostart) { struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; char *value = NULL; int ret = -1; @@ -1171,9 +1171,9 @@ static int openvzDomainGetMaxVcpus(virDomainPtr dom) VIR_DOMAIN_VCPU_MAXIMUM)); } -static int openvzDomainSetVcpusInternal(virDomainObjPtr vm, +static int openvzDomainSetVcpusInternal(virDomainObj *vm, unsigned int nvcpus, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL, "--quiet", NULL); char str_vcpus[32]; @@ -1202,7 +1202,7 @@ static int openvzDomainSetVcpusInternal(virDomainObjPtr vm, static int openvzDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj * vm; struct openvz_driver *driver = dom->conn->privateData; int ret = -1; @@ -1257,7 +1257,7 @@ openvzConnectURIProbe(char **uri) static virDrvOpenStatus openvzConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { struct openvz_driver *driver; @@ -1366,7 +1366,7 @@ static int openvzConnectListDomains(virConnectPtr conn G_GNUC_UNUSED, int ret; char buf[32]; char *endptr; - virCommandPtr cmd = virCommandNewArgList(VZLIST, "-ovpsid", "-H", NULL); + virCommand *cmd = virCommandNewArgList(VZLIST, "-ovpsid", "-H", NULL); virCommandSetOutputFD(cmd, &outfd); if (virCommandRunAsync(cmd, NULL) < 0) @@ -1420,7 +1420,7 @@ static int openvzConnectListDefinedDomains(virConnectPtr conn G_GNUC_UNUSED, char vpsname[32]; char buf[32]; char *endptr; - virCommandPtr cmd = virCommandNewArgList(VZLIST, + virCommand *cmd = virCommandNewArgList(VZLIST, "-ovpsid", "-H", "-S", NULL); /* the -S options lists only stopped domains */ @@ -1525,7 +1525,7 @@ static int openvzConnectNumOfDefinedDomains(virConnectPtr conn) } static int -openvzDomainSetMemoryInternal(virDomainObjPtr vm, +openvzDomainSetMemoryInternal(virDomainObj *vm, unsigned long long mem) { g_autoptr(virCommand) cmd = virCommandNewArgList(VZCTL, "--quiet", NULL); @@ -1553,7 +1553,7 @@ openvzDomainGetBarrierLimit(virDomainPtr domain, int ret = -1; char *endp, *output = NULL; const char *tmp; - virCommandPtr cmd = virCommandNewArgList(VZLIST, "--no-header", NULL); + virCommand *cmd = virCommandNewArgList(VZLIST, "--no-header", NULL); virCommandSetOutputBuffer(cmd, &output); virCommandAddArgFormat(cmd, "-o%s.b,%s.l", param, param); @@ -1591,7 +1591,7 @@ openvzDomainSetBarrierLimit(virDomainPtr domain, unsigned long long limit) { int ret = -1; - virCommandPtr cmd = virCommandNewArgList(VZCTL, "--quiet", "set", NULL); + virCommand *cmd = virCommandNewArgList(VZCTL, "--quiet", "set", NULL); /* LONG_MAX indicates unlimited so reject larger values */ if (barrier > LONG_MAX || limit > LONG_MAX) { @@ -1740,9 +1740,9 @@ openvzDomainSetMemoryParameters(virDomainPtr domain, static int -openvzGetVEStatus(virDomainObjPtr vm, int *status, int *reason) +openvzGetVEStatus(virDomainObj *vm, int *status, int *reason) { - virCommandPtr cmd; + virCommand *cmd; char *outbuf; char *line; int state; @@ -1787,8 +1787,8 @@ openvzDomainInterfaceStats(virDomainPtr dom, virDomainInterfaceStatsPtr stats) { struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; - virDomainNetDefPtr net = NULL; + virDomainObj *vm; + virDomainNetDef *net = NULL; int ret = -1; if (!(vm = openvzDomObjFromDomain(driver, dom->uuid))) @@ -1813,12 +1813,12 @@ openvzDomainInterfaceStats(virDomainPtr dom, static int -openvzUpdateDevice(virDomainDefPtr vmdef, - virDomainDeviceDefPtr dev, +openvzUpdateDevice(virDomainDef *vmdef, + virDomainDeviceDef *dev, bool persist) { - virDomainFSDefPtr fs; - virDomainFSDefPtr cur; + virDomainFSDef *fs; + virDomainFSDef *cur; int pos; if (dev->type == VIR_DOMAIN_DEVICE_FS) { @@ -1865,9 +1865,9 @@ openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml, int ret = -1; int veid; struct openvz_driver *driver = dom->conn->privateData; - virDomainDeviceDefPtr dev = NULL; - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; + virDomainDeviceDef *dev = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; bool persist = false; virCheckFlags(VIR_DOMAIN_DEVICE_MODIFY_LIVE | @@ -2021,7 +2021,7 @@ openvzDomainMigrateBegin3Params(virDomainPtr domain, int *cookieoutlen G_GNUC_UNUSED, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; struct openvz_driver *driver = domain->conn->privateData; char *xml = NULL; int status; @@ -2067,8 +2067,8 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn, struct openvz_driver *driver = dconn->privateData; const char *dom_xml = NULL; const char *uri_in = NULL; - virDomainDefPtr def = NULL; - virDomainObjPtr vm = NULL; + virDomainDef *def = NULL; + virDomainObj *vm = NULL; g_autofree char *my_hostname = NULL; const char *hostname = NULL; g_autoptr(virURI) uri = NULL; @@ -2164,10 +2164,10 @@ openvzDomainMigratePerform3Params(virDomainPtr domain, unsigned int flags) { struct openvz_driver *driver = domain->conn->privateData; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; const char *uri_str = NULL; - virURIPtr uri = NULL; - virCommandPtr cmd = NULL; + virURI *uri = NULL; + virCommand *cmd = NULL; int ret = -1; virCheckFlags(OPENVZ_MIGRATION_FLAGS, -1); @@ -2217,7 +2217,7 @@ openvzDomainMigrateFinish3Params(virConnectPtr dconn, int cancelled) { struct openvz_driver *driver = dconn->privateData; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; const char *dname = NULL; virDomainPtr dom = NULL; int status; @@ -2273,7 +2273,7 @@ openvzDomainMigrateConfirm3Params(virDomainPtr domain, int cancelled) { struct openvz_driver *driver = domain->conn->privateData; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int status; int ret = -1; @@ -2315,7 +2315,7 @@ static int openvzDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) { struct openvz_driver *driver = dom->conn->privateData; - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; virCheckFlags(0, -1); diff --git a/src/openvz/openvz_util.c b/src/openvz/openvz_util.c index 6d12056b4b..d14254c231 100644 --- a/src/openvz/openvz_util.c +++ b/src/openvz/openvz_util.c @@ -60,7 +60,7 @@ openvzVEGetStringParam(virDomainPtr domain, const char* param) int len; char *output = NULL; - virCommandPtr cmd = virCommandNewArgList(VZLIST, + virCommand *cmd = virCommandNewArgList(VZLIST, "-o", param, domain->name, diff --git a/src/qemu/THREADS.txt b/src/qemu/THREADS.txt index a7d8709a43..ff10bef9a0 100644 --- a/src/qemu/THREADS.txt +++ b/src/qemu/THREADS.txt @@ -14,7 +14,7 @@ Basic locking primitives There are a number of locks on various objects - * virQEMUDriverPtr + * virQEMUDriver * The qemu_conf.h file has inline comments describing the locking needs for each field. Any field marked immutable, self-locking @@ -23,14 +23,14 @@ There are a number of locks on various objects access to the data. No code outside qemu_conf.c should ever acquire this lock - * virDomainObjPtr + * virDomainObj * Will be locked and the reference counter will be increased after calling any of the virDomainObjListFindBy{ID,Name,UUID} methods. The preferred way of decrementing the reference counter and unlocking the domain is using the virDomainObjEndAPI() function. - Lock must be held when changing/reading any variable in the virDomainObjPtr + Lock must be held when changing/reading any variable in the virDomainObj * This lock must not be held for anything which sleeps/waits (i.e. monitor commands). @@ -38,7 +38,7 @@ There are a number of locks on various objects * qemuMonitorPrivatePtr: Job conditions - Since virDomainObjPtr lock must not be held during sleeps, the job + Since virDomainObj *lock must not be held during sleeps, the job conditions provide additional protection for code making updates. QEMU driver uses three kinds of job conditions: asynchronous, agent @@ -68,23 +68,23 @@ There are a number of locks on various objects depends whether caller wishes to communicate only with agent socket, or only with qemu monitor socket. - Immediately after acquiring the virDomainObjPtr lock, any method + Immediately after acquiring the virDomainObj *lock, any method which intends to update state must acquire asynchronous, normal or - agent job . The virDomainObjPtr lock is released while blocking on + agent job . The virDomainObj *lock is released while blocking on these condition variables. Once the job condition is acquired, a - method can safely release the virDomainObjPtr lock whenever it hits + method can safely release the virDomainObj *lock whenever it hits a piece of code which may sleep/wait, and re-acquire it after the sleep/wait. Whenever an asynchronous job wants to talk to the monitor, it needs to acquire nested job (a special kind of normal job) to obtain exclusive access to the monitor. - Since the virDomainObjPtr lock was dropped while waiting for the + Since the virDomainObj *lock was dropped while waiting for the job condition, it is possible that the domain is no longer active when the condition is finally obtained. The monitor lock is only safe to grab after verifying that the domain is still active. - * qemuMonitorPtr: Mutex + * qemuMonitor *: Mutex Lock to be used when invoking any monitor command to ensure safety wrt any asynchronous events that may be dispatched from the monitor. @@ -92,23 +92,23 @@ There are a number of locks on various objects The job condition *MUST* be held before acquiring the monitor lock - The virDomainObjPtr lock *MUST* be held before acquiring the monitor + The virDomainObj *lock *MUST* be held before acquiring the monitor lock. - The virDomainObjPtr lock *MUST* then be released when invoking the + The virDomainObj *lock *MUST* then be released when invoking the monitor command. Helper methods -------------- -To lock the virDomainObjPtr +To lock the virDomainObj * virObjectLock() - - Acquires the virDomainObjPtr lock + - Acquires the virDomainObj *lock virObjectUnlock() - - Releases the virDomainObjPtr lock + - Releases the virDomainObj *lock @@ -117,7 +117,7 @@ To acquire the normal job condition qemuDomainObjBeginJob() - Waits until the job is compatible with current async job or no async job is running - - Waits for job.cond condition 'job.active != 0' using virDomainObjPtr + - Waits for job.cond condition 'job.active != 0' using virDomainObj * mutex - Rechecks if the job is still compatible and repeats waiting if it isn't @@ -146,7 +146,7 @@ To acquire the asynchronous job condition qemuDomainObjBeginAsyncJob() - Waits until no async job is running - - Waits for job.cond condition 'job.active != 0' using virDomainObjPtr + - Waits for job.cond condition 'job.active != 0' using virDomainObj * mutex - Rechecks if any async job was started while waiting on job.cond and repeats waiting in that case @@ -163,11 +163,11 @@ To acquire the QEMU monitor lock qemuDomainObjEnterMonitor() - Acquires the qemuMonitorObjPtr lock - - Releases the virDomainObjPtr lock + - Releases the virDomainObj *lock qemuDomainObjExitMonitor() - Releases the qemuMonitorObjPtr lock - - Acquires the virDomainObjPtr lock + - Acquires the virDomainObj *lock These functions must not be used by an asynchronous job. Note that the virDomainObj is unlocked during the time in @@ -182,12 +182,12 @@ To acquire the QEMU monitor lock as part of an asynchronous job qemuDomainObjEnterMonitorAsync() - Validates that the right async job is still running - Acquires the qemuMonitorObjPtr lock - - Releases the virDomainObjPtr lock + - Releases the virDomainObj *lock - Validates that the VM is still active qemuDomainObjExitMonitor() - Releases the qemuMonitorObjPtr lock - - Acquires the virDomainObjPtr lock + - Acquires the virDomainObj *lock These functions are for use inside an asynchronous job; the caller must check for a return of -1 (VM not running, so nothing to exit). @@ -198,19 +198,19 @@ To acquire the QEMU monitor lock as part of an asynchronous job To keep a domain alive while waiting on a remote command qemuDomainObjEnterRemote() - - Releases the virDomainObjPtr lock + - Releases the virDomainObj *lock qemuDomainObjExitRemote() - - Acquires the virDomainObjPtr lock + - Acquires the virDomainObj *lock Design patterns --------------- - * Accessing something directly to do with a virDomainObjPtr + * Accessing something directly to do with a virDomainObj * - virDomainObjPtr obj; + virDomainObj *obj; obj = qemuDomObjFromDomain(dom); @@ -219,9 +219,9 @@ Design patterns virDomainObjEndAPI(&obj); - * Updating something directly to do with a virDomainObjPtr + * Updating something directly to do with a virDomainObj * - virDomainObjPtr obj; + virDomainObj *obj; obj = qemuDomObjFromDomain(dom); @@ -234,10 +234,10 @@ Design patterns virDomainObjEndAPI(&obj); - * Invoking a monitor command on a virDomainObjPtr + * Invoking a monitor command on a virDomainObj * - virDomainObjPtr obj; - qemuDomainObjPrivatePtr priv; + virDomainObj *obj; + qemuDomainObjPrivate *priv; obj = qemuDomObjFromDomain(dom); @@ -257,10 +257,10 @@ Design patterns virDomainObjEndAPI(&obj); - * Invoking an agent command on a virDomainObjPtr + * Invoking an agent command on a virDomainObj * - virDomainObjPtr obj; - qemuAgentPtr agent; + virDomainObj *obj; + qemuAgent *agent; obj = qemuDomObjFromDomain(dom); @@ -283,8 +283,8 @@ Design patterns * Running asynchronous job - virDomainObjPtr obj; - qemuDomainObjPrivatePtr priv; + virDomainObj *obj; + qemuDomainObjPrivate *priv; obj = qemuDomObjFromDomain(dom); @@ -323,8 +323,8 @@ Design patterns * Coordinating with a remote server for migration - virDomainObjPtr obj; - qemuDomainObjPrivatePtr priv; + virDomainObj *obj; + qemuDomainObjPrivate *priv; obj = qemuDomObjFromDomain(dom); diff --git a/src/qemu/qemu_agent.c b/src/qemu/qemu_agent.c index 290f91176c..5f421be6f6 100644 --- a/src/qemu/qemu_agent.c +++ b/src/qemu/qemu_agent.c @@ -66,14 +66,12 @@ VIR_LOG_INIT("qemu.qemu_agent"); * static struct { const char *type; - void (*handler)(qemuAgentPtr agent, virJSONValuePtr data); + void (*handler)(qemuAgent *agent, virJSONValue *data); } eventHandlers[] = { }; */ typedef struct _qemuAgentMessage qemuAgentMessage; -typedef qemuAgentMessage *qemuAgentMessagePtr; - struct _qemuAgentMessage { char *txBuffer; int txOffset; @@ -111,13 +109,13 @@ struct _qemuAgent { bool singleSync; bool inSync; - virDomainObjPtr vm; + virDomainObj *vm; - qemuAgentCallbacksPtr cb; + qemuAgentCallbacks *cb; /* If there's a command being processed this will be * non-NULL */ - qemuAgentMessagePtr msg; + qemuAgentMessage *msg; /* Buffer incoming data ready for agent * code to process & find message boundaries */ @@ -136,7 +134,7 @@ struct _qemuAgent { int timeout; }; -static virClassPtr qemuAgentClass; +static virClass *qemuAgentClass; static void qemuAgentDispose(void *obj); static int qemuAgentOnceInit(void) @@ -172,7 +170,7 @@ qemuAgentEscapeNonPrintable(const char *text) static void qemuAgentDispose(void *obj) { - qemuAgentPtr agent = obj; + qemuAgent *agent = obj; VIR_DEBUG("agent=%p", agent); if (agent->cb && agent->cb->destroy) (agent->cb->destroy)(agent, agent->vm); @@ -226,8 +224,8 @@ qemuAgentOpenUnix(const char *socketpath) static int -qemuAgentIOProcessEvent(qemuAgentPtr agent, - virJSONValuePtr obj) +qemuAgentIOProcessEvent(qemuAgent *agent, + virJSONValue *obj) { const char *type; VIR_DEBUG("agent=%p obj=%p", agent, obj); @@ -242,7 +240,7 @@ qemuAgentIOProcessEvent(qemuAgentPtr agent, /* for (i = 0; i < G_N_ELEMENTS(eventHandlers); i++) { if (STREQ(eventHandlers[i].type, type)) { - virJSONValuePtr data = virJSONValueObjectGet(obj, "data"); + virJSONValue *data = virJSONValueObjectGet(obj, "data"); VIR_DEBUG("handle %s handler=%p data=%p", type, eventHandlers[i].handler, data); (eventHandlers[i].handler)(agent, data); @@ -254,11 +252,11 @@ qemuAgentIOProcessEvent(qemuAgentPtr agent, } static int -qemuAgentIOProcessLine(qemuAgentPtr agent, +qemuAgentIOProcessLine(qemuAgent *agent, const char *line, - qemuAgentMessagePtr msg) + qemuAgentMessage *msg) { - virJSONValuePtr obj = NULL; + virJSONValue *obj = NULL; int ret = -1; VIR_DEBUG("Line [%s]", line); @@ -322,10 +320,10 @@ qemuAgentIOProcessLine(qemuAgentPtr agent, return ret; } -static int qemuAgentIOProcessData(qemuAgentPtr agent, +static int qemuAgentIOProcessData(qemuAgent *agent, char *data, size_t len, - qemuAgentMessagePtr msg) + qemuAgentMessage *msg) { int used = 0; size_t i = 0; @@ -362,10 +360,10 @@ static int qemuAgentIOProcessData(qemuAgentPtr agent, * replies/errors. */ static int -qemuAgentIOProcess(qemuAgentPtr agent) +qemuAgentIOProcess(qemuAgent *agent) { int len; - qemuAgentMessagePtr msg = NULL; + qemuAgentMessage *msg = NULL; /* See if there's a message ready for reply; that is, * one that has completed writing all its data. @@ -412,7 +410,7 @@ qemuAgentIOProcess(qemuAgentPtr agent) * Call this function while holding the agent lock. */ static int -qemuAgentIOWrite(qemuAgentPtr agent) +qemuAgentIOWrite(qemuAgent *agent) { int done; @@ -443,7 +441,7 @@ qemuAgentIOWrite(qemuAgentPtr agent) * Returns -1 on error, or number of bytes read */ static int -qemuAgentIORead(qemuAgentPtr agent) +qemuAgentIORead(qemuAgent *agent) { size_t avail = agent->bufferLength - agent->bufferOffset; int ret = 0; @@ -499,7 +497,7 @@ qemuAgentIO(GSocket *socket, static void -qemuAgentRegister(qemuAgentPtr agent) +qemuAgentRegister(qemuAgent *agent) { GIOCondition cond = 0; @@ -526,7 +524,7 @@ qemuAgentRegister(qemuAgentPtr agent) static void -qemuAgentUnregister(qemuAgentPtr agent) +qemuAgentUnregister(qemuAgent *agent) { if (agent->watch) { g_source_destroy(agent->watch); @@ -536,7 +534,7 @@ qemuAgentUnregister(qemuAgentPtr agent) } -static void qemuAgentUpdateWatch(qemuAgentPtr agent) +static void qemuAgentUpdateWatch(qemuAgent *agent) { qemuAgentUnregister(agent); if (agent->socket) @@ -549,7 +547,7 @@ qemuAgentIO(GSocket *socket G_GNUC_UNUSED, GIOCondition cond, gpointer opaque) { - qemuAgentPtr agent = opaque; + qemuAgent *agent = opaque; bool error = false; bool eof = false; @@ -633,11 +631,11 @@ qemuAgentIO(GSocket *socket G_GNUC_UNUSED, /* We have to unlock to avoid deadlock against command thread, * but is this safe ? I think it is, because the callback - * will try to acquire the virDomainObjPtr mutex next */ + * will try to acquire the virDomainObj *mutex next */ if (eof) { - void (*eofNotify)(qemuAgentPtr, virDomainObjPtr) + void (*eofNotify)(qemuAgent *, virDomainObj *) = agent->cb->eofNotify; - virDomainObjPtr vm = agent->vm; + virDomainObj *vm = agent->vm; /* Make sure anyone waiting wakes up now */ virCondSignal(&agent->notify); @@ -646,9 +644,9 @@ qemuAgentIO(GSocket *socket G_GNUC_UNUSED, VIR_DEBUG("Triggering EOF callback"); (eofNotify)(agent, vm); } else if (error) { - void (*errorNotify)(qemuAgentPtr, virDomainObjPtr) + void (*errorNotify)(qemuAgent *, virDomainObj *) = agent->cb->errorNotify; - virDomainObjPtr vm = agent->vm; + virDomainObj *vm = agent->vm; /* Make sure anyone waiting wakes up now */ virCondSignal(&agent->notify); @@ -665,14 +663,14 @@ qemuAgentIO(GSocket *socket G_GNUC_UNUSED, } -qemuAgentPtr -qemuAgentOpen(virDomainObjPtr vm, +qemuAgent * +qemuAgentOpen(virDomainObj *vm, const virDomainChrSourceDef *config, GMainContext *context, - qemuAgentCallbacksPtr cb, + qemuAgentCallbacks *cb, bool singleSync) { - qemuAgentPtr agent; + qemuAgent *agent; g_autoptr(GError) gerr = NULL; if (!cb || !cb->eofNotify) { @@ -730,7 +728,7 @@ qemuAgentOpen(virDomainObjPtr vm, cleanup: /* We don't want the 'destroy' callback invoked during * cleanup from construction failure, because that can - * give a double-unref on virDomainObjPtr in the caller, + * give a double-unref on virDomainObj *in the caller, * so kill the callbacks now. */ agent->cb = NULL; @@ -740,7 +738,7 @@ qemuAgentOpen(virDomainObjPtr vm, static void -qemuAgentNotifyCloseLocked(qemuAgentPtr agent) +qemuAgentNotifyCloseLocked(qemuAgent *agent) { if (agent) { agent->running = false; @@ -756,7 +754,7 @@ qemuAgentNotifyCloseLocked(qemuAgentPtr agent) void -qemuAgentNotifyClose(qemuAgentPtr agent) +qemuAgentNotifyClose(qemuAgent *agent) { if (!agent) return; @@ -769,7 +767,7 @@ qemuAgentNotifyClose(qemuAgentPtr agent) } -void qemuAgentClose(qemuAgentPtr agent) +void qemuAgentClose(qemuAgent *agent) { if (!agent) return; @@ -812,8 +810,8 @@ void qemuAgentClose(qemuAgentPtr agent) * -2 on timeout, * -1 otherwise */ -static int qemuAgentSend(qemuAgentPtr agent, - qemuAgentMessagePtr msg, +static int qemuAgentSend(qemuAgent *agent, + qemuAgentMessage *msg, int seconds) { int ret = -1; @@ -885,7 +883,7 @@ static int qemuAgentSend(qemuAgentPtr agent, * -1 otherwise */ static int -qemuAgentGuestSync(qemuAgentPtr agent) +qemuAgentGuestSync(qemuAgent *agent) { int ret = -1; int send_ret; @@ -993,7 +991,7 @@ qemuAgentStringifyErrorClass(const char *klass) * XXX see qerror.h for different klasses & fill out useful params */ static const char * -qemuAgentStringifyError(virJSONValuePtr error) +qemuAgentStringifyError(virJSONValue *error) { const char *klass = virJSONValueObjectGetString(error, "class"); const char *detail = virJSONValueObjectGetString(error, "desc"); @@ -1009,7 +1007,7 @@ qemuAgentStringifyError(virJSONValuePtr error) } static const char * -qemuAgentCommandName(virJSONValuePtr cmd) +qemuAgentCommandName(virJSONValue *cmd) { const char *name = virJSONValueObjectGetString(cmd, "execute"); if (name) @@ -1019,12 +1017,12 @@ qemuAgentCommandName(virJSONValuePtr cmd) } static int -qemuAgentCheckError(virJSONValuePtr cmd, - virJSONValuePtr reply, +qemuAgentCheckError(virJSONValue *cmd, + virJSONValue *reply, bool report_unsupported) { if (virJSONValueObjectHasKey(reply, "error")) { - virJSONValuePtr error = virJSONValueObjectGet(reply, "error"); + virJSONValue *error = virJSONValueObjectGet(reply, "error"); g_autofree char *cmdstr = virJSONValueToString(cmd, false); g_autofree char *replystr = virJSONValueToString(reply, false); @@ -1069,9 +1067,9 @@ qemuAgentCheckError(virJSONValuePtr cmd, } static int -qemuAgentCommandFull(qemuAgentPtr agent, - virJSONValuePtr cmd, - virJSONValuePtr *reply, +qemuAgentCommandFull(qemuAgent *agent, + virJSONValue *cmd, + virJSONValue **reply, int seconds, bool report_unsupported) { @@ -1134,15 +1132,15 @@ qemuAgentCommandFull(qemuAgentPtr agent, } static int -qemuAgentCommand(qemuAgentPtr agent, - virJSONValuePtr cmd, - virJSONValuePtr *reply, +qemuAgentCommand(qemuAgent *agent, + virJSONValue *cmd, + virJSONValue **reply, int seconds) { return qemuAgentCommandFull(agent, cmd, reply, seconds, true); } -static virJSONValuePtr G_GNUC_NULL_TERMINATED +static virJSONValue *G_GNUC_NULL_TERMINATED qemuAgentMakeCommand(const char *cmdname, ...) { @@ -1168,7 +1166,7 @@ qemuAgentMakeCommand(const char *cmdname, return g_steal_pointer(&obj); } -static virJSONValuePtr +static virJSONValue * qemuAgentMakeStringsArray(const char **strings, unsigned int len) { size_t i; @@ -1184,7 +1182,7 @@ qemuAgentMakeStringsArray(const char **strings, unsigned int len) return g_steal_pointer(&ret); } -void qemuAgentNotifyEvent(qemuAgentPtr agent, +void qemuAgentNotifyEvent(qemuAgent *agent, qemuAgentEvent event) { virObjectLock(agent); @@ -1209,12 +1207,12 @@ VIR_ENUM_IMPL(qemuAgentShutdownMode, "powerdown", "reboot", "halt", ); -int qemuAgentShutdown(qemuAgentPtr agent, +int qemuAgentShutdown(qemuAgent *agent, qemuAgentShutdownMode mode) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuAgentMakeCommand("guest-shutdown", "s:mode", qemuAgentShutdownModeTypeToString(mode), @@ -1248,13 +1246,13 @@ int qemuAgentShutdown(qemuAgentPtr agent, * Returns: number of file system frozen on success, * -1 on error. */ -int qemuAgentFSFreeze(qemuAgentPtr agent, const char **mountpoints, +int qemuAgentFSFreeze(qemuAgent *agent, const char **mountpoints, unsigned int nmountpoints) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr arg = NULL; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *arg = NULL; + virJSONValue *reply = NULL; if (mountpoints && nmountpoints) { arg = qemuAgentMakeStringsArray(mountpoints, nmountpoints); @@ -1296,11 +1294,11 @@ int qemuAgentFSFreeze(qemuAgentPtr agent, const char **mountpoints, * Returns: number of file system thawed on success, * -1 on error. */ -int qemuAgentFSThaw(qemuAgentPtr agent) +int qemuAgentFSThaw(qemuAgent *agent) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuAgentMakeCommand("guest-fsfreeze-thaw", NULL); @@ -1331,12 +1329,12 @@ VIR_ENUM_IMPL(qemuAgentSuspendMode, ); int -qemuAgentSuspend(qemuAgentPtr agent, +qemuAgentSuspend(qemuAgent *agent, unsigned int target) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuAgentMakeCommand(qemuAgentSuspendModeTypeToString(target), NULL); @@ -1352,14 +1350,14 @@ qemuAgentSuspend(qemuAgentPtr agent, } int -qemuAgentArbitraryCommand(qemuAgentPtr agent, +qemuAgentArbitraryCommand(qemuAgent *agent, const char *cmd_str, char **result, int timeout) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; *result = NULL; if (timeout < VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN) { @@ -1387,12 +1385,12 @@ qemuAgentArbitraryCommand(qemuAgentPtr agent, } int -qemuAgentFSTrim(qemuAgentPtr agent, +qemuAgentFSTrim(qemuAgent *agent, unsigned long long minimum) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuAgentMakeCommand("guest-fstrim", "U:minimum", minimum, @@ -1408,14 +1406,14 @@ qemuAgentFSTrim(qemuAgentPtr agent, } int -qemuAgentGetVCPUs(qemuAgentPtr agent, - qemuAgentCPUInfoPtr *info) +qemuAgentGetVCPUs(qemuAgent *agent, + qemuAgentCPUInfo **info) { int ret = -1; size_t i; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data = NULL; size_t ndata; if (!(cmd = qemuAgentMakeCommand("guest-get-vcpus", NULL))) @@ -1435,8 +1433,8 @@ qemuAgentGetVCPUs(qemuAgentPtr agent, *info = g_new0(qemuAgentCPUInfo, ndata); for (i = 0; i < ndata; i++) { - virJSONValuePtr entry = virJSONValueArrayGet(data, i); - qemuAgentCPUInfoPtr in = *info + i; + virJSONValue *entry = virJSONValueArrayGet(data, i); + qemuAgentCPUInfo *in = *info + i; if (!entry) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -1476,8 +1474,8 @@ qemuAgentGetVCPUs(qemuAgentPtr agent, /* returns the value provided by the guest agent or -1 on internal error */ static int -qemuAgentSetVCPUsCommand(qemuAgentPtr agent, - qemuAgentCPUInfoPtr info, +qemuAgentSetVCPUsCommand(qemuAgent *agent, + qemuAgentCPUInfo *info, size_t ninfo, int *nmodified) { @@ -1490,7 +1488,7 @@ qemuAgentSetVCPUsCommand(qemuAgentPtr agent, *nmodified = 0; for (i = 0; i < ninfo; i++) { - qemuAgentCPUInfoPtr in = &info[i]; + qemuAgentCPUInfo *in = &info[i]; g_autoptr(virJSONValue) cpu = virJSONValueNewObject(); /* don't set state for cpus that were not touched */ @@ -1543,8 +1541,8 @@ qemuAgentSetVCPUsCommand(qemuAgentPtr agent, * Returns -1 on error, 0 on success. */ int -qemuAgentSetVCPUs(qemuAgentPtr agent, - qemuAgentCPUInfoPtr info, +qemuAgentSetVCPUs(qemuAgent *agent, + qemuAgentCPUInfo *info, size_t ninfo) { int rv; @@ -1576,7 +1574,7 @@ qemuAgentSetVCPUs(qemuAgentPtr agent, /* modify the cpu info structure to set the correct amount of cpus */ int qemuAgentUpdateCPUInfo(unsigned int nvcpus, - qemuAgentCPUInfoPtr cpuinfo, + qemuAgentCPUInfo *cpuinfo, int ncpuinfo) { size_t i; @@ -1661,13 +1659,13 @@ qemuAgentUpdateCPUInfo(unsigned int nvcpus, * guest agent does not support the command without reporting an error */ int -qemuAgentGetHostname(qemuAgentPtr agent, +qemuAgentGetHostname(qemuAgent *agent, char **hostname, bool report_unsupported) { g_autoptr(virJSONValue) cmd = qemuAgentMakeCommand("guest-get-host-name", NULL); g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr data = NULL; + virJSONValue *data = NULL; const char *result = NULL; int rc; @@ -1697,14 +1695,14 @@ qemuAgentGetHostname(qemuAgentPtr agent, int -qemuAgentGetTime(qemuAgentPtr agent, +qemuAgentGetTime(qemuAgent *agent, long long *seconds, unsigned int *nseconds) { int ret = -1; unsigned long long json_time; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuAgentMakeCommand("guest-get-time", NULL); @@ -1739,14 +1737,14 @@ qemuAgentGetTime(qemuAgentPtr agent, * @sync: let guest agent to read domain's RTC (@setTime is ignored) */ int -qemuAgentSetTime(qemuAgentPtr agent, +qemuAgentSetTime(qemuAgent *agent, long long seconds, unsigned int nseconds, bool rtcSync) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; if (rtcSync) { cmd = qemuAgentMakeCommand("guest-set-time", NULL); @@ -1787,7 +1785,7 @@ qemuAgentSetTime(qemuAgentPtr agent, } void -qemuAgentDiskAddressFree(qemuAgentDiskAddressPtr info) +qemuAgentDiskAddressFree(qemuAgentDiskAddress *info) { if (!info) return; @@ -1801,7 +1799,7 @@ qemuAgentDiskAddressFree(qemuAgentDiskAddressPtr info) void -qemuAgentDiskInfoFree(qemuAgentDiskInfoPtr info) +qemuAgentDiskInfoFree(qemuAgentDiskInfo *info) { if (!info) return; @@ -1815,7 +1813,7 @@ qemuAgentDiskInfoFree(qemuAgentDiskInfoPtr info) void -qemuAgentFSInfoFree(qemuAgentFSInfoPtr info) +qemuAgentFSInfoFree(qemuAgentFSInfo *info) { size_t i; @@ -1834,11 +1832,11 @@ qemuAgentFSInfoFree(qemuAgentFSInfoPtr info) } -static qemuAgentDiskAddressPtr -qemuAgentGetDiskAddress(virJSONValuePtr json) +static qemuAgentDiskAddress * +qemuAgentGetDiskAddress(virJSONValue *json) { - virJSONValuePtr pci; - virJSONValuePtr ccw; + virJSONValue *pci; + virJSONValue *ccw; g_autoptr(qemuAgentDiskAddress) addr = NULL; addr = g_new0(qemuAgentDiskAddress, 1); @@ -1871,7 +1869,7 @@ qemuAgentGetDiskAddress(virJSONValuePtr json) GET_DISK_ADDR(pci, &addr->pci_controller.function, "function"); if ((ccw = virJSONValueObjectGet(json, "ccw-address"))) { - g_autofree virDomainDeviceCCWAddressPtr ccw_addr = NULL; + g_autofree virDomainDeviceCCWAddress *ccw_addr = NULL; ccw_addr = g_new0(virDomainDeviceCCWAddress, 1); @@ -1890,8 +1888,8 @@ qemuAgentGetDiskAddress(virJSONValuePtr json) static int -qemuAgentGetFSInfoFillDisks(virJSONValuePtr jsondisks, - qemuAgentFSInfoPtr fsinfo) +qemuAgentGetFSInfoFillDisks(virJSONValue *jsondisks, + qemuAgentFSInfo *fsinfo) { size_t ndisks; size_t i; @@ -1905,11 +1903,11 @@ qemuAgentGetFSInfoFillDisks(virJSONValuePtr jsondisks, ndisks = virJSONValueArraySize(jsondisks); if (ndisks) - fsinfo->disks = g_new0(qemuAgentDiskAddressPtr, ndisks); + fsinfo->disks = g_new0(qemuAgentDiskAddress *, ndisks); fsinfo->ndisks = ndisks; for (i = 0; i < fsinfo->ndisks; i++) { - virJSONValuePtr jsondisk = virJSONValueArrayGet(jsondisks, i); + virJSONValue *jsondisk = virJSONValueArrayGet(jsondisks, i); if (!jsondisk) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -1932,17 +1930,17 @@ qemuAgentGetFSInfoFillDisks(virJSONValuePtr jsondisks, * -1 otherwise (libvirt error is reported) */ int -qemuAgentGetFSInfo(qemuAgentPtr agent, - qemuAgentFSInfoPtr **info, +qemuAgentGetFSInfo(qemuAgent *agent, + qemuAgentFSInfo ***info, bool report_unsupported) { size_t i; int ret = -1; g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr data; + virJSONValue *data; size_t ndata = 0; - qemuAgentFSInfoPtr *info_ret = NULL; + qemuAgentFSInfo **info_ret = NULL; int rc; cmd = qemuAgentMakeCommand("guest-get-fsinfo", NULL); @@ -1971,12 +1969,12 @@ qemuAgentGetFSInfo(qemuAgentPtr agent, *info = NULL; goto cleanup; } - info_ret = g_new0(qemuAgentFSInfoPtr, ndata); + info_ret = g_new0(qemuAgentFSInfo *, ndata); for (i = 0; i < ndata; i++) { /* Reverse the order to arrange in mount order */ - virJSONValuePtr entry = virJSONValueArrayGet(data, ndata - 1 - i); - virJSONValuePtr disk; + virJSONValue *entry = virJSONValueArrayGet(data, ndata - 1 - i); + virJSONValue *disk; unsigned long long bytes_val; const char *result = NULL; @@ -2066,7 +2064,7 @@ qemuAgentGetFSInfo(qemuAgentPtr agent, static int qemuAgentGetInterfaceOneAddress(virDomainIPAddressPtr ip_addr, - virJSONValuePtr ip_addr_obj, + virJSONValue *ip_addr_obj, const char *name) { const char *type, *addr; @@ -2133,9 +2131,9 @@ static int qemuAgentGetInterfaceAddresses(virDomainInterfacePtr **ifaces_ret, size_t *ifaces_count, GHashTable *ifaces_store, - virJSONValuePtr iface_obj) + virJSONValue *iface_obj) { - virJSONValuePtr ip_addr_arr = NULL; + virJSONValue *ip_addr_arr = NULL; const char *hwaddr, *name = NULL; virDomainInterfacePtr iface = NULL; g_autofree char *ifname = NULL; @@ -2190,7 +2188,7 @@ qemuAgentGetInterfaceAddresses(virDomainInterfacePtr **ifaces_ret, VIR_EXPAND_N(iface->addrs, addrs_count, virJSONValueArraySize(ip_addr_arr)); for (j = 0; j < virJSONValueArraySize(ip_addr_arr); j++) { - virJSONValuePtr ip_addr_obj = virJSONValueArrayGet(ip_addr_arr, j); + virJSONValue *ip_addr_obj = virJSONValueArrayGet(ip_addr_arr, j); virDomainIPAddressPtr ip_addr = iface->addrs + iface->naddrs; iface->naddrs++; @@ -2204,7 +2202,7 @@ qemuAgentGetInterfaceAddresses(virDomainInterfacePtr **ifaces_ret, static int qemuAgentGetAllInterfaceAddresses(virDomainInterfacePtr **ifaces_ret, - virJSONValuePtr ret_array) + virJSONValue *ret_array) { g_autoptr(GHashTable) ifaces_store = NULL; size_t ifaces_count = 0; @@ -2215,7 +2213,7 @@ qemuAgentGetAllInterfaceAddresses(virDomainInterfacePtr **ifaces_ret, ifaces_store = virHashNew(NULL); for (i = 0; i < virJSONValueArraySize(ret_array); i++) { - virJSONValuePtr iface_obj = virJSONValueArrayGet(ret_array, i); + virJSONValue *iface_obj = virJSONValueArrayGet(ret_array, i); if (qemuAgentGetInterfaceAddresses(ifaces_ret, &ifaces_count, ifaces_store, iface_obj) < 0) @@ -2246,12 +2244,12 @@ qemuAgentGetAllInterfaceAddresses(virDomainInterfacePtr **ifaces_ret, * Returns: number of interfaces on success, -1 on error. */ int -qemuAgentGetInterfaces(qemuAgentPtr agent, +qemuAgentGetInterfaces(qemuAgent *agent, virDomainInterfacePtr **ifaces) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr ret_array = NULL; + virJSONValue *ret_array = NULL; if (!(cmd = qemuAgentMakeCommand("guest-network-get-interfaces", NULL))) return -1; @@ -2270,7 +2268,7 @@ qemuAgentGetInterfaces(qemuAgentPtr agent, int -qemuAgentSetUserPassword(qemuAgentPtr agent, +qemuAgentSetUserPassword(qemuAgent *agent, const char *user, const char *password, bool crypted) @@ -2301,7 +2299,7 @@ qemuAgentSetUserPassword(qemuAgentPtr agent, * -1 otherwise (libvirt error is reported) */ int -qemuAgentGetUsers(qemuAgentPtr agent, +qemuAgentGetUsers(qemuAgent *agent, virTypedParameterPtr *params, int *nparams, int *maxparams, @@ -2309,7 +2307,7 @@ qemuAgentGetUsers(qemuAgentPtr agent, { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr data = NULL; + virJSONValue *data = NULL; size_t ndata; size_t i; int rc; @@ -2334,7 +2332,7 @@ qemuAgentGetUsers(qemuAgentPtr agent, return -1; for (i = 0; i < ndata; i++) { - virJSONValuePtr entry = virJSONValueArrayGet(data, i); + virJSONValue *entry = virJSONValueArrayGet(data, i); char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; const char *strvalue; double logintime; @@ -2387,7 +2385,7 @@ qemuAgentGetUsers(qemuAgentPtr agent, * -1 otherwise (libvirt error is reported) */ int -qemuAgentGetOSInfo(qemuAgentPtr agent, +qemuAgentGetOSInfo(qemuAgent *agent, virTypedParameterPtr *params, int *nparams, int *maxparams, @@ -2395,7 +2393,7 @@ qemuAgentGetOSInfo(qemuAgentPtr agent, { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr data = NULL; + virJSONValue *data = NULL; int rc; if (!(cmd = qemuAgentMakeCommand("guest-get-osinfo", NULL))) @@ -2441,7 +2439,7 @@ qemuAgentGetOSInfo(qemuAgentPtr agent, * -1 otherwise (libvirt error is reported) */ int -qemuAgentGetTimezone(qemuAgentPtr agent, +qemuAgentGetTimezone(qemuAgent *agent, virTypedParameterPtr *params, int *nparams, int *maxparams, @@ -2449,7 +2447,7 @@ qemuAgentGetTimezone(qemuAgentPtr agent, { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr data = NULL; + virJSONValue *data = NULL; const char *name; int offset; int rc; @@ -2492,7 +2490,7 @@ qemuAgentGetTimezone(qemuAgentPtr agent, * The agent object must be locked prior to calling this function. */ void -qemuAgentSetResponseTimeout(qemuAgentPtr agent, +qemuAgentSetResponseTimeout(qemuAgent *agent, int timeout) { agent->timeout = timeout; @@ -2510,13 +2508,13 @@ qemuAgentSetResponseTimeout(qemuAgentPtr agent, * -1 otherwise (error is reported) */ int -qemuAgentSSHGetAuthorizedKeys(qemuAgentPtr agent, +qemuAgentSSHGetAuthorizedKeys(qemuAgent *agent, const char *user, char ***keys) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr data = NULL; + virJSONValue *data = NULL; if (!(cmd = qemuAgentMakeCommand("guest-ssh-get-authorized-keys", "s:username", user, @@ -2555,7 +2553,7 @@ qemuAgentSSHGetAuthorizedKeys(qemuAgentPtr agent, * -1 otherwise (error is reported) */ int -qemuAgentSSHAddAuthorizedKeys(qemuAgentPtr agent, +qemuAgentSSHAddAuthorizedKeys(qemuAgent *agent, const char *user, const char **keys, size_t nkeys, @@ -2595,7 +2593,7 @@ qemuAgentSSHAddAuthorizedKeys(qemuAgentPtr agent, * -1 otherwise (error is reported) */ int -qemuAgentSSHRemoveAuthorizedKeys(qemuAgentPtr agent, +qemuAgentSSHRemoveAuthorizedKeys(qemuAgent *agent, const char *user, const char **keys, size_t nkeys) @@ -2618,13 +2616,13 @@ qemuAgentSSHRemoveAuthorizedKeys(qemuAgentPtr agent, } -int qemuAgentGetDisks(qemuAgentPtr agent, - qemuAgentDiskInfoPtr **disks, +int qemuAgentGetDisks(qemuAgent *agent, + qemuAgentDiskInfo ***disks, bool report_unsupported) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr data = NULL; + virJSONValue *data = NULL; size_t ndata; size_t i; int rc; @@ -2644,12 +2642,12 @@ int qemuAgentGetDisks(qemuAgentPtr agent, ndata = virJSONValueArraySize(data); - *disks = g_new0(qemuAgentDiskInfoPtr, ndata); + *disks = g_new0(qemuAgentDiskInfo *, ndata); for (i = 0; i < ndata; i++) { - virJSONValuePtr addr; - virJSONValuePtr entry = virJSONValueArrayGet(data, i); - qemuAgentDiskInfoPtr disk; + virJSONValue *addr; + virJSONValue *entry = virJSONValueArrayGet(data, i); + qemuAgentDiskInfo *disk; if (!entry) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", diff --git a/src/qemu/qemu_agent.h b/src/qemu/qemu_agent.h index 0d47230161..81b45b8e5d 100644 --- a/src/qemu/qemu_agent.h +++ b/src/qemu/qemu_agent.h @@ -25,29 +25,27 @@ #include "domain_conf.h" typedef struct _qemuAgent qemuAgent; -typedef qemuAgent *qemuAgentPtr; typedef struct _qemuAgentCallbacks qemuAgentCallbacks; -typedef qemuAgentCallbacks *qemuAgentCallbacksPtr; struct _qemuAgentCallbacks { - void (*destroy)(qemuAgentPtr mon, - virDomainObjPtr vm); - void (*eofNotify)(qemuAgentPtr mon, - virDomainObjPtr vm); - void (*errorNotify)(qemuAgentPtr mon, - virDomainObjPtr vm); + void (*destroy)(qemuAgent *mon, + virDomainObj *vm); + void (*eofNotify)(qemuAgent *mon, + virDomainObj *vm); + void (*errorNotify)(qemuAgent *mon, + virDomainObj *vm); }; -qemuAgentPtr qemuAgentOpen(virDomainObjPtr vm, +qemuAgent *qemuAgentOpen(virDomainObj *vm, const virDomainChrSourceDef *config, GMainContext *context, - qemuAgentCallbacksPtr cb, + qemuAgentCallbacks *cb, bool singleSync); -void qemuAgentClose(qemuAgentPtr mon); +void qemuAgentClose(qemuAgent *mon); -void qemuAgentNotifyClose(qemuAgentPtr mon); +void qemuAgentNotifyClose(qemuAgent *mon); typedef enum { QEMU_AGENT_EVENT_NONE = 0, @@ -56,7 +54,7 @@ typedef enum { QEMU_AGENT_EVENT_RESET, } qemuAgentEvent; -void qemuAgentNotifyEvent(qemuAgentPtr mon, +void qemuAgentNotifyEvent(qemuAgent *mon, qemuAgentEvent event); typedef enum { @@ -68,7 +66,6 @@ typedef enum { } qemuAgentShutdownMode; typedef struct _qemuAgentDiskAddress qemuAgentDiskAddress; -typedef qemuAgentDiskAddress *qemuAgentDiskAddressPtr; struct _qemuAgentDiskAddress { char *serial; virPCIDeviceAddress pci_controller; @@ -77,24 +74,22 @@ struct _qemuAgentDiskAddress { unsigned int target; unsigned int unit; char *devnode; - virDomainDeviceCCWAddressPtr ccw_addr; + virDomainDeviceCCWAddress *ccw_addr; }; -void qemuAgentDiskAddressFree(qemuAgentDiskAddressPtr addr); +void qemuAgentDiskAddressFree(qemuAgentDiskAddress *addr); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuAgentDiskAddress, qemuAgentDiskAddressFree); typedef struct _qemuAgentDiskInfo qemuAgentDiskInfo; -typedef qemuAgentDiskInfo *qemuAgentDiskInfoPtr; struct _qemuAgentDiskInfo { char *name; bool partition; char **dependencies; - qemuAgentDiskAddressPtr address; + qemuAgentDiskAddress *address; char *alias; }; -void qemuAgentDiskInfoFree(qemuAgentDiskInfoPtr info); +void qemuAgentDiskInfoFree(qemuAgentDiskInfo *info); typedef struct _qemuAgentFSInfo qemuAgentFSInfo; -typedef qemuAgentFSInfo *qemuAgentFSInfoPtr; struct _qemuAgentFSInfo { char *mountpoint; /* path to mount point */ char *name; /* device name in the guest (e.g. "sda1") */ @@ -102,33 +97,32 @@ struct _qemuAgentFSInfo { long long total_bytes; long long used_bytes; size_t ndisks; - qemuAgentDiskAddressPtr *disks; + qemuAgentDiskAddress **disks; }; -void qemuAgentFSInfoFree(qemuAgentFSInfoPtr info); +void qemuAgentFSInfoFree(qemuAgentFSInfo *info); -int qemuAgentShutdown(qemuAgentPtr mon, +int qemuAgentShutdown(qemuAgent *mon, qemuAgentShutdownMode mode); -int qemuAgentFSFreeze(qemuAgentPtr mon, +int qemuAgentFSFreeze(qemuAgent *mon, const char **mountpoints, unsigned int nmountpoints); -int qemuAgentFSThaw(qemuAgentPtr mon); -int qemuAgentGetFSInfo(qemuAgentPtr mon, - qemuAgentFSInfoPtr **info, +int qemuAgentFSThaw(qemuAgent *mon); +int qemuAgentGetFSInfo(qemuAgent *mon, + qemuAgentFSInfo ***info, bool report_unsupported); -int qemuAgentSuspend(qemuAgentPtr mon, +int qemuAgentSuspend(qemuAgent *mon, unsigned int target); -int qemuAgentArbitraryCommand(qemuAgentPtr mon, +int qemuAgentArbitraryCommand(qemuAgent *mon, const char *cmd, char **result, int timeout); -int qemuAgentFSTrim(qemuAgentPtr mon, +int qemuAgentFSTrim(qemuAgent *mon, unsigned long long minimum); typedef struct _qemuAgentCPUInfo qemuAgentCPUInfo; -typedef qemuAgentCPUInfo *qemuAgentCPUInfoPtr; struct _qemuAgentCPUInfo { unsigned int id; /* logical cpu ID */ bool online; /* true if the CPU is activated */ @@ -137,69 +131,69 @@ struct _qemuAgentCPUInfo { bool modified; /* set to true if the vcpu state needs to be changed */ }; -int qemuAgentGetVCPUs(qemuAgentPtr mon, qemuAgentCPUInfoPtr *info); -int qemuAgentSetVCPUs(qemuAgentPtr mon, qemuAgentCPUInfoPtr cpus, size_t ncpus); +int qemuAgentGetVCPUs(qemuAgent *mon, qemuAgentCPUInfo **info); +int qemuAgentSetVCPUs(qemuAgent *mon, qemuAgentCPUInfo *cpus, size_t ncpus); int qemuAgentUpdateCPUInfo(unsigned int nvcpus, - qemuAgentCPUInfoPtr cpuinfo, + qemuAgentCPUInfo *cpuinfo, int ncpuinfo); int -qemuAgentGetHostname(qemuAgentPtr mon, +qemuAgentGetHostname(qemuAgent *mon, char **hostname, bool report_unsupported); -int qemuAgentGetTime(qemuAgentPtr mon, +int qemuAgentGetTime(qemuAgent *mon, long long *seconds, unsigned int *nseconds); -int qemuAgentSetTime(qemuAgentPtr mon, +int qemuAgentSetTime(qemuAgent *mon, long long seconds, unsigned int nseconds, bool sync); -int qemuAgentGetInterfaces(qemuAgentPtr mon, +int qemuAgentGetInterfaces(qemuAgent *mon, virDomainInterfacePtr **ifaces); -int qemuAgentSetUserPassword(qemuAgentPtr mon, +int qemuAgentSetUserPassword(qemuAgent *mon, const char *user, const char *password, bool crypted); -int qemuAgentGetUsers(qemuAgentPtr mon, +int qemuAgentGetUsers(qemuAgent *mon, virTypedParameterPtr *params, int *nparams, int *maxparams, bool report_unsupported); -int qemuAgentGetOSInfo(qemuAgentPtr mon, +int qemuAgentGetOSInfo(qemuAgent *mon, virTypedParameterPtr *params, int *nparams, int *maxparams, bool report_unsupported); -int qemuAgentGetTimezone(qemuAgentPtr mon, +int qemuAgentGetTimezone(qemuAgent *mon, virTypedParameterPtr *params, int *nparams, int *maxparams, bool report_unsupported); -void qemuAgentSetResponseTimeout(qemuAgentPtr mon, +void qemuAgentSetResponseTimeout(qemuAgent *mon, int timeout); -int qemuAgentSSHGetAuthorizedKeys(qemuAgentPtr agent, +int qemuAgentSSHGetAuthorizedKeys(qemuAgent *agent, const char *user, char ***keys); -int qemuAgentSSHAddAuthorizedKeys(qemuAgentPtr agent, +int qemuAgentSSHAddAuthorizedKeys(qemuAgent *agent, const char *user, const char **keys, size_t nkeys, bool reset); -int qemuAgentSSHRemoveAuthorizedKeys(qemuAgentPtr agent, +int qemuAgentSSHRemoveAuthorizedKeys(qemuAgent *agent, const char *user, const char **keys, size_t nkeys); -int qemuAgentGetDisks(qemuAgentPtr mon, - qemuAgentDiskInfoPtr **disks, +int qemuAgentGetDisks(qemuAgent *mon, + qemuAgentDiskInfo ***disks, bool report_unsupported); diff --git a/src/qemu/qemu_alias.c b/src/qemu/qemu_alias.c index 1c6f04c0ba..7c86a6eeaa 100644 --- a/src/qemu/qemu_alias.c +++ b/src/qemu/qemu_alias.c @@ -52,8 +52,8 @@ qemuDomainDeviceAliasIndex(const virDomainDeviceInfo *info, static ssize_t -qemuGetNextChrDevIndex(virDomainDefPtr def, - virDomainChrDefPtr chr, +qemuGetNextChrDevIndex(virDomainDef *def, + virDomainChrDef *chr, const char *prefix) { const virDomainChrDef **arrPtr; @@ -82,8 +82,8 @@ qemuGetNextChrDevIndex(virDomainDefPtr def, int -qemuAssignDeviceChrAlias(virDomainDefPtr def, - virDomainChrDefPtr chr, +qemuAssignDeviceChrAlias(virDomainDef *def, + virDomainChrDef *chr, ssize_t idx) { const char *prefix = NULL; @@ -121,9 +121,9 @@ qemuAssignDeviceChrAlias(virDomainDefPtr def, int -qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef, - virQEMUCapsPtr qemuCaps, - virDomainControllerDefPtr controller) +qemuAssignDeviceControllerAlias(virDomainDef *domainDef, + virQEMUCaps *qemuCaps, + virDomainControllerDef *controller) { const char *prefix = virDomainControllerTypeToString(controller->type); @@ -192,11 +192,11 @@ qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef, int -qemuAssignDeviceDiskAlias(virDomainDefPtr def, - virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps) +qemuAssignDeviceDiskAlias(virDomainDef *def, + virDomainDiskDef *disk, + virQEMUCaps *qemuCaps) { - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); const char *prefix = virDomainDiskBusTypeToString(disk->bus); int controllerModel = -1; @@ -265,7 +265,7 @@ qemuAssignDeviceDiskAlias(virDomainDefPtr def, int -qemuAssignDeviceHostdevAlias(virDomainDefPtr def, +qemuAssignDeviceHostdevAlias(virDomainDef *def, char **alias, int idx) { @@ -302,8 +302,8 @@ qemuAssignDeviceHostdevAlias(virDomainDefPtr def, int -qemuAssignDeviceNetAlias(virDomainDefPtr def, - virDomainNetDefPtr net, +qemuAssignDeviceNetAlias(virDomainDef *def, + virDomainNetDef *net, int idx) { if (net->info.alias) @@ -336,7 +336,7 @@ qemuAssignDeviceNetAlias(virDomainDefPtr def, static int -qemuAssignDeviceFSAlias(virDomainFSDefPtr fss, +qemuAssignDeviceFSAlias(virDomainFSDef *fss, int idx) { if (fss->info.alias) @@ -348,7 +348,7 @@ qemuAssignDeviceFSAlias(virDomainFSDefPtr fss, static int -qemuAssignDeviceSoundAlias(virDomainSoundDefPtr sound, +qemuAssignDeviceSoundAlias(virDomainSoundDef *sound, int idx) { if (sound->info.alias) @@ -360,7 +360,7 @@ qemuAssignDeviceSoundAlias(virDomainSoundDefPtr sound, static int -qemuAssignDeviceVideoAlias(virDomainVideoDefPtr video, +qemuAssignDeviceVideoAlias(virDomainVideoDef *video, int idx) { if (video->info.alias) @@ -372,7 +372,7 @@ qemuAssignDeviceVideoAlias(virDomainVideoDefPtr video, static int -qemuAssignDeviceHubAlias(virDomainHubDefPtr hub, +qemuAssignDeviceHubAlias(virDomainHubDef *hub, int idx) { if (hub->info.alias) @@ -384,7 +384,7 @@ qemuAssignDeviceHubAlias(virDomainHubDefPtr hub, static int -qemuAssignDeviceSmartcardAlias(virDomainSmartcardDefPtr smartcard, +qemuAssignDeviceSmartcardAlias(virDomainSmartcardDef *smartcard, int idx) { if (smartcard->info.alias) @@ -396,7 +396,7 @@ qemuAssignDeviceSmartcardAlias(virDomainSmartcardDefPtr smartcard, static int -qemuAssignDeviceMemballoonAlias(virDomainMemballoonDefPtr memballoon, +qemuAssignDeviceMemballoonAlias(virDomainMemballoonDef *memballoon, int idx) { if (memballoon->info.alias) @@ -408,7 +408,7 @@ qemuAssignDeviceMemballoonAlias(virDomainMemballoonDefPtr memballoon, static int -qemuAssignDeviceTPMAlias(virDomainTPMDefPtr tpm, +qemuAssignDeviceTPMAlias(virDomainTPMDef *tpm, int idx) { if (tpm->info.alias) @@ -420,8 +420,8 @@ qemuAssignDeviceTPMAlias(virDomainTPMDefPtr tpm, int -qemuAssignDeviceRedirdevAlias(virDomainDefPtr def, - virDomainRedirdevDefPtr redirdev, +qemuAssignDeviceRedirdevAlias(virDomainDef *def, + virDomainRedirdevDef *redirdev, int idx) { if (redirdev->info.alias) @@ -445,8 +445,8 @@ qemuAssignDeviceRedirdevAlias(virDomainDefPtr def, int -qemuAssignDeviceRNGAlias(virDomainDefPtr def, - virDomainRNGDefPtr rng) +qemuAssignDeviceRNGAlias(virDomainDef *def, + virDomainRNGDef *rng) { size_t i; int maxidx = 0; @@ -467,8 +467,8 @@ qemuAssignDeviceRNGAlias(virDomainDefPtr def, static int -qemuDeviceMemoryGetAliasID(virDomainDefPtr def, - virDomainMemoryDefPtr mem, +qemuDeviceMemoryGetAliasID(virDomainDef *def, + virDomainMemoryDef *mem, bool oldAlias, const char *prefix) { @@ -502,8 +502,8 @@ qemuDeviceMemoryGetAliasID(virDomainDefPtr def, * Returns 0 on success, -1 on error. */ int -qemuAssignDeviceMemoryAlias(virDomainDefPtr def, - virDomainMemoryDefPtr mem, +qemuAssignDeviceMemoryAlias(virDomainDef *def, + virDomainMemoryDef *mem, bool oldAlias) { const char *prefix = NULL; @@ -538,8 +538,8 @@ qemuAssignDeviceMemoryAlias(virDomainDefPtr def, int -qemuAssignDeviceShmemAlias(virDomainDefPtr def, - virDomainShmemDefPtr shmem, +qemuAssignDeviceShmemAlias(virDomainDef *def, + virDomainShmemDef *shmem, int idx) { if (shmem->info.alias) @@ -566,7 +566,7 @@ qemuAssignDeviceShmemAlias(virDomainDefPtr def, int -qemuAssignDeviceWatchdogAlias(virDomainWatchdogDefPtr watchdog) +qemuAssignDeviceWatchdogAlias(virDomainWatchdogDef *watchdog) { /* Currently, there's just one watchdog per domain */ @@ -579,8 +579,8 @@ qemuAssignDeviceWatchdogAlias(virDomainWatchdogDefPtr watchdog) } int -qemuAssignDeviceInputAlias(virDomainDefPtr def, - virDomainInputDefPtr input, +qemuAssignDeviceInputAlias(virDomainDef *def, + virDomainInputDef *input, int idx) { if (input->info.alias) @@ -603,7 +603,7 @@ qemuAssignDeviceInputAlias(virDomainDefPtr def, int -qemuAssignDeviceVsockAlias(virDomainVsockDefPtr vsock) +qemuAssignDeviceVsockAlias(virDomainVsockDef *vsock) { if (vsock->info.alias) return 0; @@ -614,7 +614,7 @@ qemuAssignDeviceVsockAlias(virDomainVsockDefPtr vsock) int -qemuAssignDeviceAliases(virDomainDefPtr def, virQEMUCapsPtr qemuCaps) +qemuAssignDeviceAliases(virDomainDef *def, virQEMUCaps *qemuCaps) { size_t i; diff --git a/src/qemu/qemu_alias.h b/src/qemu/qemu_alias.h index fc4bdf35fa..9161145a48 100644 --- a/src/qemu/qemu_alias.h +++ b/src/qemu/qemu_alias.h @@ -27,50 +27,50 @@ #include "qemu_domain.h" #include "qemu_domain_address.h" -int qemuAssignDeviceChrAlias(virDomainDefPtr def, - virDomainChrDefPtr chr, +int qemuAssignDeviceChrAlias(virDomainDef *def, + virDomainChrDef *chr, ssize_t idx); -int qemuAssignDeviceControllerAlias(virDomainDefPtr domainDef, - virQEMUCapsPtr qemuCaps, - virDomainControllerDefPtr controller); +int qemuAssignDeviceControllerAlias(virDomainDef *domainDef, + virQEMUCaps *qemuCaps, + virDomainControllerDef *controller); -int qemuAssignDeviceDiskAlias(virDomainDefPtr def, - virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps); +int qemuAssignDeviceDiskAlias(virDomainDef *def, + virDomainDiskDef *disk, + virQEMUCaps *qemuCaps); -int qemuAssignDeviceHostdevAlias(virDomainDefPtr def, +int qemuAssignDeviceHostdevAlias(virDomainDef *def, char **alias, int idx); -int qemuAssignDeviceNetAlias(virDomainDefPtr def, - virDomainNetDefPtr net, +int qemuAssignDeviceNetAlias(virDomainDef *def, + virDomainNetDef *net, int idx); -int qemuAssignDeviceRedirdevAlias(virDomainDefPtr def, - virDomainRedirdevDefPtr redirdev, +int qemuAssignDeviceRedirdevAlias(virDomainDef *def, + virDomainRedirdevDef *redirdev, int idx); -int qemuAssignDeviceRNGAlias(virDomainDefPtr def, - virDomainRNGDefPtr rng); +int qemuAssignDeviceRNGAlias(virDomainDef *def, + virDomainRNGDef *rng); -int qemuAssignDeviceMemoryAlias(virDomainDefPtr def, - virDomainMemoryDefPtr mems, +int qemuAssignDeviceMemoryAlias(virDomainDef *def, + virDomainMemoryDef *mems, bool oldAlias); -int qemuAssignDeviceShmemAlias(virDomainDefPtr def, - virDomainShmemDefPtr shmem, +int qemuAssignDeviceShmemAlias(virDomainDef *def, + virDomainShmemDef *shmem, int idx); -int qemuAssignDeviceWatchdogAlias(virDomainWatchdogDefPtr watchdog); +int qemuAssignDeviceWatchdogAlias(virDomainWatchdogDef *watchdog); -int qemuAssignDeviceInputAlias(virDomainDefPtr def, - virDomainInputDefPtr input, +int qemuAssignDeviceInputAlias(virDomainDef *def, + virDomainInputDef *input, int idx); -int qemuAssignDeviceVsockAlias(virDomainVsockDefPtr vsock); +int qemuAssignDeviceVsockAlias(virDomainVsockDef *vsock); -int qemuAssignDeviceAliases(virDomainDefPtr def, virQEMUCapsPtr qemuCaps); +int qemuAssignDeviceAliases(virDomainDef *def, virQEMUCaps *qemuCaps); int qemuDomainDeviceAliasIndex(const virDomainDeviceInfo *info, const char *prefix); diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 614b365699..df9ca5b99f 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -46,10 +46,10 @@ VIR_LOG_INIT("qemu.qemu_backup"); -static virDomainBackupDefPtr -qemuDomainGetBackup(virDomainObjPtr vm) +static virDomainBackupDef * +qemuDomainGetBackup(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!priv->backup) { virReportError(VIR_ERR_NO_DOMAIN_BACKUP, "%s", @@ -62,7 +62,7 @@ qemuDomainGetBackup(virDomainObjPtr vm) static int -qemuBackupPrepare(virDomainBackupDefPtr def) +qemuBackupPrepare(virDomainBackupDef *def) { if (def->type == VIR_DOMAIN_BACKUP_TYPE_PULL) { @@ -104,15 +104,15 @@ qemuBackupPrepare(virDomainBackupDefPtr def) struct qemuBackupDiskData { - virDomainBackupDiskDefPtr backupdisk; - virDomainDiskDefPtr domdisk; - qemuBlockJobDataPtr blockjob; - virStorageSourcePtr store; - virStorageSourcePtr terminator; - virStorageSourcePtr backingStore; + virDomainBackupDiskDef *backupdisk; + virDomainDiskDef *domdisk; + qemuBlockJobData *blockjob; + virStorageSource *store; + virStorageSource *terminator; + virStorageSource *backingStore; char *incrementalBitmap; const char *domdiskIncrementalBitmap; /* name of temporary bitmap installed on disk source */ - qemuBlockStorageSourceChainDataPtr crdata; + qemuBlockStorageSourceChainData *crdata; bool labelled; bool initialized; bool created; @@ -123,10 +123,10 @@ struct qemuBackupDiskData { static void -qemuBackupDiskDataCleanupOne(virDomainObjPtr vm, +qemuBackupDiskDataCleanupOne(virDomainObj *vm, struct qemuBackupDiskData *dd) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!dd->started) { if (dd->added) { @@ -157,7 +157,7 @@ qemuBackupDiskDataCleanupOne(virDomainObjPtr vm, static void -qemuBackupDiskDataCleanup(virDomainObjPtr vm, +qemuBackupDiskDataCleanup(virDomainObj *vm, struct qemuBackupDiskData *dd, size_t ndd) { @@ -178,11 +178,11 @@ qemuBackupDiskDataCleanup(virDomainObjPtr vm, int -qemuBackupDiskPrepareOneBitmapsChain(virStorageSourcePtr backingChain, - virStorageSourcePtr targetsrc, +qemuBackupDiskPrepareOneBitmapsChain(virStorageSource *backingChain, + virStorageSource *targetsrc, const char *targetbitmap, const char *incremental, - virJSONValuePtr actions, + virJSONValue *actions, GHashTable *blockNamedNodeData) { g_autoptr(virJSONValue) tmpactions = NULL; @@ -203,7 +203,7 @@ qemuBackupDiskPrepareOneBitmapsChain(virStorageSourcePtr backingChain, static int qemuBackupDiskPrepareOneBitmaps(struct qemuBackupDiskData *dd, - virJSONValuePtr actions, + virJSONValue *actions, bool pull, GHashTable *blockNamedNodeData) { @@ -245,15 +245,15 @@ qemuBackupDiskPrepareOneBitmaps(struct qemuBackupDiskData *dd, static int -qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, - virDomainBackupDiskDefPtr backupdisk, +qemuBackupDiskPrepareDataOne(virDomainObj *vm, + virDomainBackupDiskDef *backupdisk, struct qemuBackupDiskData *dd, - virJSONValuePtr actions, + virJSONValue *actions, bool pull, GHashTable *blockNamedNodeData, - virQEMUDriverConfigPtr cfg) + virQEMUDriverConfig *cfg) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; /* set data structure */ dd->backupdisk = backupdisk; @@ -332,7 +332,7 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, static int -qemuBackupDiskPrepareDataOnePush(virJSONValuePtr actions, +qemuBackupDiskPrepareDataOnePush(virJSONValue *actions, struct qemuBackupDiskData *dd) { qemuMonitorTransactionBackupSyncMode syncmode = QEMU_MONITOR_TRANSACTION_BACKUP_SYNC_MODE_FULL; @@ -353,7 +353,7 @@ qemuBackupDiskPrepareDataOnePush(virJSONValuePtr actions, static int -qemuBackupDiskPrepareDataOnePull(virJSONValuePtr actions, +qemuBackupDiskPrepareDataOnePull(virJSONValue *actions, struct qemuBackupDiskData *dd) { if (!dd->backupdisk->exportbitmap && @@ -373,11 +373,11 @@ qemuBackupDiskPrepareDataOnePull(virJSONValuePtr actions, static ssize_t -qemuBackupDiskPrepareData(virDomainObjPtr vm, - virDomainBackupDefPtr def, +qemuBackupDiskPrepareData(virDomainObj *vm, + virDomainBackupDef *def, GHashTable *blockNamedNodeData, - virJSONValuePtr actions, - virQEMUDriverConfigPtr cfg, + virJSONValue *actions, + virQEMUDriverConfig *cfg, struct qemuBackupDiskData **rdd) { struct qemuBackupDiskData *disks = NULL; @@ -420,12 +420,12 @@ qemuBackupDiskPrepareData(virDomainObjPtr vm, static int -qemuBackupDiskPrepareOneStorage(virDomainObjPtr vm, +qemuBackupDiskPrepareOneStorage(virDomainObj *vm, GHashTable *blockNamedNodeData, struct qemuBackupDiskData *dd, bool reuse_external) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int rc; if (!reuse_external && @@ -486,7 +486,7 @@ qemuBackupDiskPrepareOneStorage(virDomainObjPtr vm, static int -qemuBackupDiskPrepareStorage(virDomainObjPtr vm, +qemuBackupDiskPrepareStorage(virDomainObj *vm, struct qemuBackupDiskData *disks, size_t ndisks, GHashTable *blockNamedNodeData, @@ -505,7 +505,7 @@ qemuBackupDiskPrepareStorage(virDomainObjPtr vm, static void -qemuBackupDiskStarted(virDomainObjPtr vm, +qemuBackupDiskStarted(virDomainObj *vm, struct qemuBackupDiskData *dd, size_t ndd) { @@ -529,7 +529,7 @@ qemuBackupDiskStarted(virDomainObjPtr vm, * function must be called while in the monitor context. */ static int -qemuBackupBeginPullExportDisks(virDomainObjPtr vm, +qemuBackupBeginPullExportDisks(virDomainObj *vm, struct qemuBackupDiskData *disks, size_t ndisks) { @@ -554,16 +554,16 @@ qemuBackupBeginPullExportDisks(virDomainObjPtr vm, void -qemuBackupJobTerminate(virDomainObjPtr vm, +qemuBackupJobTerminate(virDomainObj *vm, qemuDomainJobStatus jobstatus) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = NULL; size_t i; for (i = 0; i < priv->backup->ndisks; i++) { - virDomainBackupDiskDefPtr backupdisk = priv->backup->disks + i; + virDomainBackupDiskDef *backupdisk = priv->backup->disks + i; if (!backupdisk->store) continue; @@ -636,12 +636,12 @@ qemuBackupJobTerminate(virDomainObjPtr vm, * if there are no outstanding active blockjobs. */ void -qemuBackupJobCancelBlockjobs(virDomainObjPtr vm, - virDomainBackupDefPtr backup, +qemuBackupJobCancelBlockjobs(virDomainObj *vm, + virDomainBackupDef *backup, bool terminatebackup, int asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; size_t i; int rc = 0; bool has_active = false; @@ -650,8 +650,8 @@ qemuBackupJobCancelBlockjobs(virDomainObjPtr vm, return; for (i = 0; i < backup->ndisks; i++) { - virDomainBackupDiskDefPtr backupdisk = backup->disks + i; - virDomainDiskDefPtr disk; + virDomainBackupDiskDef *backupdisk = backup->disks + i; + virDomainDiskDef *disk; g_autoptr(qemuBlockJobData) job = NULL; if (!backupdisk->store) @@ -695,13 +695,13 @@ qemuBackupJobCancelBlockjobs(virDomainObjPtr vm, #define QEMU_BACKUP_TLS_ALIAS_BASE "libvirt_backup" static int -qemuBackupBeginPrepareTLS(virDomainObjPtr vm, - virQEMUDriverConfigPtr cfg, - virDomainBackupDefPtr def, - virJSONValuePtr *tlsProps, - virJSONValuePtr *tlsSecretProps) +qemuBackupBeginPrepareTLS(virDomainObj *vm, + virQEMUDriverConfig *cfg, + virDomainBackupDef *def, + virJSONValue **tlsProps, + virJSONValue **tlsSecretProps) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *tlsObjAlias = qemuAliasTLSObjFromSrcAlias(QEMU_BACKUP_TLS_ALIAS_BASE); g_autoptr(qemuDomainSecretInfo) secinfo = NULL; const char *tlsKeySecretAlias = NULL; @@ -737,17 +737,17 @@ qemuBackupBeginPrepareTLS(virDomainObjPtr vm, int -qemuBackupBegin(virDomainObjPtr vm, +qemuBackupBegin(virDomainObj *vm, const char *backupXML, const char *checkpointXML, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(priv->driver); g_autoptr(virDomainBackupDef) def = NULL; g_autofree char *suffix = NULL; bool pull = false; - virDomainMomentObjPtr chk = NULL; + virDomainMomentObj *chk = NULL; g_autoptr(virDomainCheckpointDef) chkdef = NULL; g_autoptr(virJSONValue) actions = NULL; g_autoptr(virJSONValue) tlsProps = NULL; @@ -900,7 +900,7 @@ qemuBackupBegin(virDomainObjPtr vm, qemuBackupDiskStarted(vm, dd, ndd); if (chk) { - virDomainMomentObjPtr tmpchk = g_steal_pointer(&chk); + virDomainMomentObj *tmpchk = g_steal_pointer(&chk); if (qemuCheckpointCreateFinalize(priv->driver, vm, cfg, tmpchk, true) < 0) goto endjob; } @@ -952,11 +952,11 @@ qemuBackupBegin(virDomainObjPtr vm, char * -qemuBackupGetXMLDesc(virDomainObjPtr vm, +qemuBackupGetXMLDesc(virDomainObj *vm, unsigned int flags) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virDomainBackupDefPtr backup; + virDomainBackupDef *backup; virCheckFlags(0, NULL); @@ -971,21 +971,21 @@ qemuBackupGetXMLDesc(virDomainObjPtr vm, void -qemuBackupNotifyBlockjobEnd(virDomainObjPtr vm, - virDomainDiskDefPtr disk, +qemuBackupNotifyBlockjobEnd(virDomainObj *vm, + virDomainDiskDef *disk, qemuBlockjobState state, const char *errmsg, unsigned long long cur, unsigned long long end, int asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool has_running = false; bool has_cancelling = false; bool has_cancelled = false; bool has_failed = false; qemuDomainJobStatus jobstatus = QEMU_DOMAIN_JOB_STATUS_COMPLETED; - virDomainBackupDefPtr backup = priv->backup; + virDomainBackupDef *backup = priv->backup; size_t i; VIR_DEBUG("vm: '%s', disk:'%s', state:'%d' errmsg:'%s'", @@ -1018,7 +1018,7 @@ qemuBackupNotifyBlockjobEnd(virDomainObjPtr vm, backup->errmsg = g_strdup(errmsg); for (i = 0; i < backup->ndisks; i++) { - virDomainBackupDiskDefPtr backupdisk = backup->disks + i; + virDomainBackupDiskDef *backupdisk = backup->disks + i; if (!backupdisk->store) continue; @@ -1094,15 +1094,15 @@ qemuBackupNotifyBlockjobEnd(virDomainObjPtr vm, static void -qemuBackupGetJobInfoStatsUpdateOne(virDomainObjPtr vm, +qemuBackupGetJobInfoStatsUpdateOne(virDomainObj *vm, bool push, const char *diskdst, qemuDomainBackupStats *stats, - qemuMonitorJobInfoPtr *blockjobs, + qemuMonitorJobInfo **blockjobs, size_t nblockjobs) { - virDomainDiskDefPtr domdisk; - qemuMonitorJobInfoPtr monblockjob = NULL; + virDomainDiskDef *domdisk; + qemuMonitorJobInfo *monblockjob = NULL; g_autoptr(qemuBlockJobData) diskblockjob = NULL; size_t i; @@ -1133,13 +1133,13 @@ qemuBackupGetJobInfoStatsUpdateOne(virDomainObjPtr vm, int -qemuBackupGetJobInfoStats(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuDomainJobInfoPtr jobInfo) +qemuBackupGetJobInfoStats(virQEMUDriver *driver, + virDomainObj *vm, + qemuDomainJobInfo *jobInfo) { qemuDomainBackupStats *stats = &jobInfo->stats.backup; - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuMonitorJobInfoPtr *blockjobs = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + qemuMonitorJobInfo **blockjobs = NULL; size_t nblockjobs = 0; size_t i; int rc; diff --git a/src/qemu/qemu_backup.h b/src/qemu/qemu_backup.h index 39e4bcec09..ebb3154516 100644 --- a/src/qemu/qemu_backup.h +++ b/src/qemu/qemu_backup.h @@ -19,24 +19,24 @@ #pragma once int -qemuBackupBegin(virDomainObjPtr vm, +qemuBackupBegin(virDomainObj *vm, const char *backupXML, const char *checkpointXML, unsigned int flags); char * -qemuBackupGetXMLDesc(virDomainObjPtr vm, +qemuBackupGetXMLDesc(virDomainObj *vm, unsigned int flags); void -qemuBackupJobCancelBlockjobs(virDomainObjPtr vm, - virDomainBackupDefPtr backup, +qemuBackupJobCancelBlockjobs(virDomainObj *vm, + virDomainBackupDef *backup, bool terminatebackup, int asyncJob); void -qemuBackupNotifyBlockjobEnd(virDomainObjPtr vm, - virDomainDiskDefPtr disk, +qemuBackupNotifyBlockjobEnd(virDomainObj *vm, + virDomainDiskDef *disk, qemuBlockjobState state, const char *errmsg, unsigned long long cur, @@ -44,19 +44,19 @@ qemuBackupNotifyBlockjobEnd(virDomainObjPtr vm, int asyncJob); void -qemuBackupJobTerminate(virDomainObjPtr vm, +qemuBackupJobTerminate(virDomainObj *vm, qemuDomainJobStatus jobstatus); int -qemuBackupGetJobInfoStats(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuDomainJobInfoPtr jobInfo); +qemuBackupGetJobInfoStats(virQEMUDriver *driver, + virDomainObj *vm, + qemuDomainJobInfo *jobInfo); /* exported for testing */ int -qemuBackupDiskPrepareOneBitmapsChain(virStorageSourcePtr backingChain, - virStorageSourcePtr targetsrc, +qemuBackupDiskPrepareOneBitmapsChain(virStorageSource *backingChain, + virStorageSource *targetsrc, const char *targetbitmap, const char *incremental, - virJSONValuePtr actions, + virJSONValue *actions, GHashTable *blockNamedNodeData); diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 0000ebbd07..6845e25176 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -55,7 +55,7 @@ qemuBlockNodeNameValidate(const char *nn) static int qemuBlockNamedNodesArrayToHash(size_t pos G_GNUC_UNUSED, - virJSONValuePtr item, + virJSONValue *item, void *opaque) { GHashTable *table = opaque; @@ -72,7 +72,7 @@ qemuBlockNamedNodesArrayToHash(size_t pos G_GNUC_UNUSED, static void -qemuBlockNodeNameBackingChainDataFree(qemuBlockNodeNameBackingChainDataPtr data) +qemuBlockNodeNameBackingChainDataFree(qemuBlockNodeNameBackingChainData *data) { if (!data) return; @@ -128,16 +128,16 @@ struct qemuBlockNodeNameGetBackingChainData { static int -qemuBlockNodeNameGetBackingChainBacking(virJSONValuePtr next, +qemuBlockNodeNameGetBackingChainBacking(virJSONValue *next, GHashTable *nodenamestable, - qemuBlockNodeNameBackingChainDataPtr *nodenamedata) + qemuBlockNodeNameBackingChainData **nodenamedata) { g_autoptr(qemuBlockNodeNameBackingChainData) data = NULL; - qemuBlockNodeNameBackingChainDataPtr backingdata = NULL; - virJSONValuePtr backing = virJSONValueObjectGetObject(next, "backing"); - virJSONValuePtr parent = virJSONValueObjectGetObject(next, "parent"); - virJSONValuePtr parentnodedata; - virJSONValuePtr nodedata; + qemuBlockNodeNameBackingChainData *backingdata = NULL; + virJSONValue *backing = virJSONValueObjectGetObject(next, "backing"); + virJSONValue *parent = virJSONValueObjectGetObject(next, "parent"); + virJSONValue *parentnodedata; + virJSONValue *nodedata; const char *nodename = virJSONValueObjectGetString(next, "node-name"); const char *drvname = NULL; const char *drvparent = NULL; @@ -193,7 +193,7 @@ qemuBlockNodeNameGetBackingChainBacking(virJSONValuePtr next, static int qemuBlockNodeNameGetBackingChainDisk(size_t pos G_GNUC_UNUSED, - virJSONValuePtr item, + virJSONValue *item, void *opaque) { struct qemuBlockNodeNameGetBackingChainData *data = opaque; @@ -221,14 +221,14 @@ qemuBlockNodeNameGetBackingChainDisk(size_t pos G_GNUC_UNUSED, * Tries to reconstruct the backing chain from @json to allow detection of * node names that were auto-assigned by qemu. This is a best-effort operation * and may not be successful. The returned hash table contains the entries as - * qemuBlockNodeNameBackingChainDataPtr accessible by the node name. The fields + * qemuBlockNodeNameBackingChainData *accessible by the node name. The fields * then can be used to recover the full backing chain. * * Returns a hash table on success and NULL on failure. */ GHashTable * -qemuBlockNodeNameGetBackingChain(virJSONValuePtr namednodes, - virJSONValuePtr blockstats) +qemuBlockNodeNameGetBackingChain(virJSONValue *namednodes, + virJSONValue *blockstats) { struct qemuBlockNodeNameGetBackingChainData data; g_autoptr(GHashTable) namednodestable = NULL; @@ -260,9 +260,9 @@ qemuBlockNodeNameGetBackingChain(virJSONValuePtr namednodes, static void -qemuBlockDiskClearDetectedNodes(virDomainDiskDefPtr disk) +qemuBlockDiskClearDetectedNodes(virDomainDiskDef *disk) { - virStorageSourcePtr next = disk->src; + virStorageSource *next = disk->src; while (virStorageSourceIsBacking(next)) { VIR_FREE(next->nodeformat); @@ -274,11 +274,11 @@ qemuBlockDiskClearDetectedNodes(virDomainDiskDefPtr disk) static int -qemuBlockDiskDetectNodes(virDomainDiskDefPtr disk, +qemuBlockDiskDetectNodes(virDomainDiskDef *disk, GHashTable *disktable) { - qemuBlockNodeNameBackingChainDataPtr entry = NULL; - virStorageSourcePtr src = disk->src; + qemuBlockNodeNameBackingChainData *entry = NULL; + virStorageSource *src = disk->src; g_autofree char *alias = NULL; /* don't attempt the detection if the top level already has node names */ @@ -316,15 +316,15 @@ qemuBlockDiskDetectNodes(virDomainDiskDefPtr disk, int -qemuBlockNodeNamesDetect(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuBlockNodeNamesDetect(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(GHashTable) disktable = NULL; g_autoptr(virJSONValue) data = NULL; g_autoptr(virJSONValue) blockstats = NULL; - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; size_t i; if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QUERY_NAMED_BLOCK_NODES)) @@ -363,7 +363,7 @@ qemuBlockNodeNamesDetect(virQEMUDriverPtr driver, * Returns a filled GHashTable *on success NULL on error. */ GHashTable * -qemuBlockGetNodeData(virJSONValuePtr data) +qemuBlockGetNodeData(virJSONValue *data) { g_autoptr(GHashTable) nodedata = NULL; @@ -386,7 +386,7 @@ qemuBlockGetNodeData(virJSONValuePtr data) * separate processes. */ bool -qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSourcePtr src) +qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSource *src) { /* no need to check in backing chain since only RAW storage supports this */ return src->format == VIR_STORAGE_FILE_RAW; @@ -399,8 +399,8 @@ qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSourcePtr src) * * Formats a URI from a virStorageSource. */ -virURIPtr -qemuBlockStorageSourceGetURI(virStorageSourcePtr src) +virURI * +qemuBlockStorageSourceGetURI(virStorageSource *src) { g_autoptr(virURI) uri = NULL; @@ -442,7 +442,7 @@ qemuBlockStorageSourceGetURI(virStorageSourcePtr src) /** * qemuBlockStorageSourceBuildJSONSocketAddress - * @host: the virStorageNetHostDefPtr definition to build + * @host: the virStorageNetHostDef * definition to build * @legacy: use old field names/values * * Formats @hosts into a json object conforming to the 'SocketAddress' type @@ -451,10 +451,10 @@ qemuBlockStorageSourceGetURI(virStorageSourcePtr src) * For compatibility with old approach used in the gluster driver of old qemus * use the old spelling for TCP transport and, the path field of the unix socket. * - * Returns a virJSONValuePtr for a single server. + * Returns a virJSONValue * for a single server. */ -static virJSONValuePtr -qemuBlockStorageSourceBuildJSONSocketAddress(virStorageNetHostDefPtr host, +static virJSONValue * +qemuBlockStorageSourceBuildJSONSocketAddress(virStorageNetHostDef *host, bool legacy) { g_autoptr(virJSONValue) server = NULL; @@ -512,13 +512,13 @@ qemuBlockStorageSourceBuildJSONSocketAddress(virStorageNetHostDefPtr host, * Formats src->hosts into a json object conforming to the 'SocketAddress' type * in qemu. */ -static virJSONValuePtr -qemuBlockStorageSourceBuildHostsJSONSocketAddress(virStorageSourcePtr src, +static virJSONValue * +qemuBlockStorageSourceBuildHostsJSONSocketAddress(virStorageSource *src, bool legacy) { g_autoptr(virJSONValue) servers = NULL; g_autoptr(virJSONValue) server = NULL; - virStorageNetHostDefPtr host; + virStorageNetHostDef *host; size_t i; servers = virJSONValueNewArray(); @@ -539,17 +539,17 @@ qemuBlockStorageSourceBuildHostsJSONSocketAddress(virStorageSourcePtr src, /** * qemuBlockStorageSourceBuildJSONInetSocketAddress - * @host: the virStorageNetHostDefPtr definition to build + * @host: the virStorageNetHostDef * definition to build * * Formats @hosts into a json object conforming to the 'InetSocketAddress' type * in qemu. * - * Returns a virJSONValuePtr for a single server. + * Returns a virJSONValue *for a single server. */ -static virJSONValuePtr -qemuBlockStorageSourceBuildJSONInetSocketAddress(virStorageNetHostDefPtr host) +static virJSONValue * +qemuBlockStorageSourceBuildJSONInetSocketAddress(virStorageNetHostDef *host) { - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; g_autofree char *port = NULL; if (host->transport != VIR_STORAGE_NET_HOST_TRANS_TCP) { @@ -570,18 +570,18 @@ qemuBlockStorageSourceBuildJSONInetSocketAddress(virStorageNetHostDefPtr host) /** - * qemuBlockStorageSourceBuildJSONNFSServer(virStorageNetHostDefPtr host) - * @host: the virStorageNetHostDefPtr definition to build + * qemuBlockStorageSourceBuildJSONNFSServer(virStorageNetHostDef *host) + * @host: the virStorageNetHostDef * definition to build * * Formats @hosts into a json object conforming to the 'NFSServer' type * in qemu. * - * Returns a virJSONValuePtr for a single server. + * Returns a virJSONValue *for a single server. */ -static virJSONValuePtr -qemuBlockStorageSourceBuildJSONNFSServer(virStorageNetHostDefPtr host) +static virJSONValue * +qemuBlockStorageSourceBuildJSONNFSServer(virStorageNetHostDef *host) { - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; ignore_value(virJSONValueObjectCreate(&ret, "s:host", host->name, @@ -599,12 +599,12 @@ qemuBlockStorageSourceBuildJSONNFSServer(virStorageNetHostDefPtr host) * Formats src->hosts into a json object conforming to the 'InetSocketAddress' * type in qemu. */ -static virJSONValuePtr -qemuBlockStorageSourceBuildHostsJSONInetSocketAddress(virStorageSourcePtr src) +static virJSONValue * +qemuBlockStorageSourceBuildHostsJSONInetSocketAddress(virStorageSource *src) { g_autoptr(virJSONValue) servers = NULL; g_autoptr(virJSONValue) server = NULL; - virStorageNetHostDefPtr host; + virStorageNetHostDef *host; size_t i; servers = virJSONValueNewArray(); @@ -623,8 +623,8 @@ qemuBlockStorageSourceBuildHostsJSONInetSocketAddress(virStorageSourcePtr src) } -static virJSONValuePtr -qemuBlockStorageSourceGetGlusterProps(virStorageSourcePtr src, +static virJSONValue * +qemuBlockStorageSourceGetGlusterProps(virStorageSource *src, bool legacy, bool onlytarget) { @@ -655,13 +655,13 @@ qemuBlockStorageSourceGetGlusterProps(virStorageSourcePtr src, } -static virJSONValuePtr -qemuBlockStorageSourceGetVxHSProps(virStorageSourcePtr src, +static virJSONValue * +qemuBlockStorageSourceGetVxHSProps(virStorageSource *src, bool onlytarget) { g_autoptr(virJSONValue) server = NULL; const char *tlsAlias = src->tlsAlias; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; if (src->nhosts != 1) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -690,11 +690,11 @@ qemuBlockStorageSourceGetVxHSProps(virStorageSourcePtr src, } -static virJSONValuePtr -qemuBlockStorageSourceGetNFSProps(virStorageSourcePtr src) +static virJSONValue * +qemuBlockStorageSourceGetNFSProps(virStorageSource *src) { g_autoptr(virJSONValue) server = NULL; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; if (!(server = qemuBlockStorageSourceBuildJSONNFSServer(&src->hosts[0]))) return NULL; @@ -723,15 +723,15 @@ qemuBlockStorageSourceGetNFSProps(virStorageSourcePtr src) } -static virJSONValuePtr -qemuBlockStorageSourceGetCURLProps(virStorageSourcePtr src, +static virJSONValue * +qemuBlockStorageSourceGetCURLProps(virStorageSource *src, bool onlytarget) { - qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); + qemuDomainStorageSourcePrivate *srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); const char *passwordalias = NULL; const char *cookiealias = NULL; const char *username = NULL; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; g_autoptr(virURI) uri = NULL; g_autofree char *uristr = NULL; g_autofree char *cookiestr = NULL; @@ -784,18 +784,18 @@ qemuBlockStorageSourceGetCURLProps(virStorageSourcePtr src, } -static virJSONValuePtr -qemuBlockStorageSourceGetISCSIProps(virStorageSourcePtr src, +static virJSONValue * +qemuBlockStorageSourceGetISCSIProps(virStorageSource *src, bool onlytarget) { - qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); + qemuDomainStorageSourcePrivate *srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); g_autofree char *target = NULL; char *lunStr = NULL; char *username = NULL; char *objalias = NULL; g_autofree char *portal = NULL; unsigned int lun = 0; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; /* { driver:"iscsi", * transport:"tcp", ("iser" also possible) @@ -847,13 +847,13 @@ qemuBlockStorageSourceGetISCSIProps(virStorageSourcePtr src, } -static virJSONValuePtr -qemuBlockStorageSourceGetNBDProps(virStorageSourcePtr src, +static virJSONValue * +qemuBlockStorageSourceGetNBDProps(virStorageSource *src, bool onlytarget) { g_autoptr(virJSONValue) serverprops = NULL; const char *tlsAlias = src->tlsAlias; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; if (src->nhosts != 1) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -880,13 +880,13 @@ qemuBlockStorageSourceGetNBDProps(virStorageSourcePtr src, } -static virJSONValuePtr -qemuBlockStorageSourceGetRBDProps(virStorageSourcePtr src, +static virJSONValue * +qemuBlockStorageSourceGetRBDProps(virStorageSource *src, bool onlytarget) { - qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); + qemuDomainStorageSourcePrivate *srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); g_autoptr(virJSONValue) servers = NULL; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; const char *username = NULL; g_autoptr(virJSONValue) authmodes = NULL; g_autoptr(virJSONValue) mode = NULL; @@ -927,11 +927,11 @@ qemuBlockStorageSourceGetRBDProps(virStorageSourcePtr src, } -static virJSONValuePtr -qemuBlockStorageSourceGetSheepdogProps(virStorageSourcePtr src) +static virJSONValue * +qemuBlockStorageSourceGetSheepdogProps(virStorageSource *src) { g_autoptr(virJSONValue) serverprops = NULL; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; if (src->nhosts != 1) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -955,11 +955,11 @@ qemuBlockStorageSourceGetSheepdogProps(virStorageSourcePtr src) } -static virJSONValuePtr -qemuBlockStorageSourceGetSshProps(virStorageSourcePtr src) +static virJSONValue * +qemuBlockStorageSourceGetSshProps(virStorageSource *src) { g_autoptr(virJSONValue) serverprops = NULL; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; const char *username = NULL; g_autoptr(virJSONValue) host_key_check = NULL; @@ -996,13 +996,13 @@ qemuBlockStorageSourceGetSshProps(virStorageSourcePtr src) } -static virJSONValuePtr -qemuBlockStorageSourceGetFileProps(virStorageSourcePtr src, +static virJSONValue * +qemuBlockStorageSourceGetFileProps(virStorageSource *src, bool onlytarget) { const char *iomode = NULL; const char *prManagerAlias = NULL; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; if (!onlytarget) { if (src->pr) @@ -1021,8 +1021,8 @@ qemuBlockStorageSourceGetFileProps(virStorageSourcePtr src, } -static virJSONValuePtr -qemuBlockStorageSourceGetVvfatProps(virStorageSourcePtr src, +static virJSONValue * +qemuBlockStorageSourceGetVvfatProps(virStorageSource *src, bool onlytarget) { g_autoptr(virJSONValue) ret = NULL; @@ -1045,12 +1045,12 @@ qemuBlockStorageSourceGetVvfatProps(virStorageSourcePtr src, } -static virJSONValuePtr -qemuBlockStorageSourceGetNVMeProps(virStorageSourcePtr src) +static virJSONValue * +qemuBlockStorageSourceGetNVMeProps(virStorageSource *src) { const virStorageSourceNVMeDef *nvme = src->nvme; g_autofree char *pciAddr = NULL; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; if (!(pciAddr = virPCIDeviceAddressAsString(&nvme->pciAddr))) return NULL; @@ -1065,8 +1065,8 @@ qemuBlockStorageSourceGetNVMeProps(virStorageSourcePtr src) static int -qemuBlockStorageSourceGetBlockdevGetCacheProps(virStorageSourcePtr src, - virJSONValuePtr props) +qemuBlockStorageSourceGetBlockdevGetCacheProps(virStorageSource *src, + virJSONValue *props) { g_autoptr(virJSONValue) cacheobj = NULL; bool direct = false; @@ -1110,8 +1110,8 @@ qemuBlockStorageSourceGetBlockdevGetCacheProps(virStorageSourcePtr src, * Creates a JSON object describing the underlying storage or protocol of a * storage source. Returns NULL on error and reports an appropriate error message. */ -virJSONValuePtr -qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src, +virJSONValue * +qemuBlockStorageSourceGetBackendProps(virStorageSource *src, unsigned int flags) { int actualType = virStorageSourceGetActualType(src); @@ -1274,10 +1274,10 @@ qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src, static int -qemuBlockStorageSourceGetFormatLUKSProps(virStorageSourcePtr src, - virJSONValuePtr props) +qemuBlockStorageSourceGetFormatLUKSProps(virStorageSource *src, + virJSONValue *props) { - qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); + qemuDomainStorageSourcePrivate *srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); if (!srcPriv || !srcPriv->encinfo || !srcPriv->encinfo->s.aes.alias) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -1296,8 +1296,8 @@ qemuBlockStorageSourceGetFormatLUKSProps(virStorageSourcePtr src, static int -qemuBlockStorageSourceGetFormatRawProps(virStorageSourcePtr src, - virJSONValuePtr props) +qemuBlockStorageSourceGetFormatRawProps(virStorageSource *src, + virJSONValue *props) { if (virJSONValueObjectAdd(props, "s:driver", "raw", NULL) < 0) return -1; @@ -1317,10 +1317,10 @@ qemuBlockStorageSourceGetFormatRawProps(virStorageSourcePtr src, static int -qemuBlockStorageSourceGetCryptoProps(virStorageSourcePtr src, - virJSONValuePtr *encprops) +qemuBlockStorageSourceGetCryptoProps(virStorageSource *src, + virJSONValue **encprops) { - qemuDomainStorageSourcePrivatePtr srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); + qemuDomainStorageSourcePrivate *srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); const char *encformat = NULL; *encprops = NULL; @@ -1360,9 +1360,9 @@ qemuBlockStorageSourceGetCryptoProps(virStorageSourcePtr src, static int -qemuBlockStorageSourceGetFormatQcowGenericProps(virStorageSourcePtr src, +qemuBlockStorageSourceGetFormatQcowGenericProps(virStorageSource *src, const char *format, - virJSONValuePtr props) + virJSONValue *props) { g_autoptr(virJSONValue) encprops = NULL; @@ -1379,8 +1379,8 @@ qemuBlockStorageSourceGetFormatQcowGenericProps(virStorageSourcePtr src, static int -qemuBlockStorageSourceGetFormatQcow2Props(virStorageSourcePtr src, - virJSONValuePtr props) +qemuBlockStorageSourceGetFormatQcow2Props(virStorageSource *src, + virJSONValue *props) { /* currently unhandled qcow2 props: * @@ -1413,8 +1413,8 @@ qemuBlockStorageSourceGetFormatQcow2Props(virStorageSourcePtr src, } -static virJSONValuePtr -qemuBlockStorageSourceGetBlockdevFormatCommonProps(virStorageSourcePtr src) +static virJSONValue * +qemuBlockStorageSourceGetBlockdevFormatCommonProps(virStorageSource *src) { const char *detectZeroes = NULL; const char *discard = NULL; @@ -1450,8 +1450,8 @@ qemuBlockStorageSourceGetBlockdevFormatCommonProps(virStorageSourcePtr src) } -static virJSONValuePtr -qemuBlockStorageSourceGetBlockdevFormatProps(virStorageSourcePtr src) +static virJSONValue * +qemuBlockStorageSourceGetBlockdevFormatProps(virStorageSource *src) { const char *driver = NULL; g_autoptr(virJSONValue) props = NULL; @@ -1538,9 +1538,9 @@ qemuBlockStorageSourceGetBlockdevFormatProps(virStorageSourcePtr src) * -blockdev. The formatted object contains both the storage and format layer * in nested form including link to the backing chain layer if necessary. */ -virJSONValuePtr -qemuBlockStorageSourceGetBlockdevProps(virStorageSourcePtr src, - virStorageSourcePtr backingStore) +virJSONValue * +qemuBlockStorageSourceGetBlockdevProps(virStorageSource *src, + virStorageSource *backingStore) { g_autoptr(virJSONValue) props = NULL; const char *storagenode = src->nodestorage; @@ -1580,8 +1580,8 @@ qemuBlockStorageSourceGetBlockdevProps(virStorageSourcePtr src, } -static virJSONValuePtr -qemuBlockStorageSourceGetBlockdevStorageSliceProps(virStorageSourcePtr src) +static virJSONValue * +qemuBlockStorageSourceGetBlockdevStorageSliceProps(virStorageSource *src) { g_autoptr(virJSONValue) props = NULL; @@ -1607,7 +1607,7 @@ qemuBlockStorageSourceGetBlockdevStorageSliceProps(virStorageSourcePtr src) void -qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachDataPtr data) +qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachData *data) { if (!data) return; @@ -1650,9 +1650,9 @@ qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachDataPtr data) * Returns the filled data structure on success or NULL on error and a libvirt * error is reported */ -qemuBlockStorageSourceAttachDataPtr -qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src, - virStorageSourcePtr backingStore, +qemuBlockStorageSourceAttachData * +qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSource *src, + virStorageSource *backingStore, bool autoreadonly) { g_autoptr(qemuBlockStorageSourceAttachData) data = NULL; @@ -1684,8 +1684,8 @@ qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src, static int -qemuBlockStorageSourceAttachApplyStorageDeps(qemuMonitorPtr mon, - qemuBlockStorageSourceAttachDataPtr data) +qemuBlockStorageSourceAttachApplyStorageDeps(qemuMonitor *mon, + qemuBlockStorageSourceAttachData *data) { if (data->prmgrProps && qemuMonitorAddObject(mon, &data->prmgrProps, &data->prmgrAlias) < 0) @@ -1715,8 +1715,8 @@ qemuBlockStorageSourceAttachApplyStorageDeps(qemuMonitorPtr mon, static int -qemuBlockStorageSourceAttachApplyStorage(qemuMonitorPtr mon, - qemuBlockStorageSourceAttachDataPtr data) +qemuBlockStorageSourceAttachApplyStorage(qemuMonitor *mon, + qemuBlockStorageSourceAttachData *data) { if (data->storageProps) { if (qemuMonitorBlockdevAdd(mon, &data->storageProps) < 0) @@ -1730,8 +1730,8 @@ qemuBlockStorageSourceAttachApplyStorage(qemuMonitorPtr mon, static int -qemuBlockStorageSourceAttachApplyFormatDeps(qemuMonitorPtr mon, - qemuBlockStorageSourceAttachDataPtr data) +qemuBlockStorageSourceAttachApplyFormatDeps(qemuMonitor *mon, + qemuBlockStorageSourceAttachData *data) { if (data->encryptsecretProps && qemuMonitorAddObject(mon, &data->encryptsecretProps, @@ -1743,8 +1743,8 @@ qemuBlockStorageSourceAttachApplyFormatDeps(qemuMonitorPtr mon, static int -qemuBlockStorageSourceAttachApplyFormat(qemuMonitorPtr mon, - qemuBlockStorageSourceAttachDataPtr data) +qemuBlockStorageSourceAttachApplyFormat(qemuMonitor *mon, + qemuBlockStorageSourceAttachData *data) { if (data->formatProps) { if (qemuMonitorBlockdevAdd(mon, &data->formatProps) < 0) @@ -1758,8 +1758,8 @@ qemuBlockStorageSourceAttachApplyFormat(qemuMonitorPtr mon, static int -qemuBlockStorageSourceAttachApplyStorageSlice(qemuMonitorPtr mon, - qemuBlockStorageSourceAttachDataPtr data) +qemuBlockStorageSourceAttachApplyStorageSlice(qemuMonitor *mon, + qemuBlockStorageSourceAttachData *data) { if (data->storageSliceProps) { if (qemuMonitorBlockdevAdd(mon, &data->storageSliceProps) < 0) @@ -1786,8 +1786,8 @@ qemuBlockStorageSourceAttachApplyStorageSlice(qemuMonitorPtr mon, * calling qemuBlockStorageSourceAttachRollback. */ int -qemuBlockStorageSourceAttachApply(qemuMonitorPtr mon, - qemuBlockStorageSourceAttachDataPtr data) +qemuBlockStorageSourceAttachApply(qemuMonitor *mon, + qemuBlockStorageSourceAttachData *data) { if (qemuBlockStorageSourceAttachApplyStorageDeps(mon, data) < 0 || qemuBlockStorageSourceAttachApplyStorage(mon, data) < 0 || @@ -1825,8 +1825,8 @@ qemuBlockStorageSourceAttachApply(qemuMonitorPtr mon, * This function expects being called after the monitor was entered. */ void -qemuBlockStorageSourceAttachRollback(qemuMonitorPtr mon, - qemuBlockStorageSourceAttachDataPtr data) +qemuBlockStorageSourceAttachRollback(qemuMonitor *mon, + qemuBlockStorageSourceAttachData *data) { virErrorPtr orig_err; @@ -1881,14 +1881,14 @@ qemuBlockStorageSourceAttachRollback(qemuMonitorPtr mon, * @src: disk source structure * @driveAlias: Alias of the -drive backend, the pointer is always consumed * - * Prepare qemuBlockStorageSourceAttachDataPtr for detaching a single source + * Prepare qemuBlockStorageSourceAttachData *for detaching a single source * from a VM. If @driveAlias is NULL -blockdev is assumed. */ -qemuBlockStorageSourceAttachDataPtr -qemuBlockStorageSourceDetachPrepare(virStorageSourcePtr src, +qemuBlockStorageSourceAttachData * +qemuBlockStorageSourceDetachPrepare(virStorageSource *src, char *driveAlias) { - qemuDomainStorageSourcePrivatePtr srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); + qemuDomainStorageSourcePrivate *srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); g_autoptr(qemuBlockStorageSourceAttachData) data = NULL; data = g_new0(qemuBlockStorageSourceAttachData, 1); @@ -1936,7 +1936,7 @@ qemuBlockStorageSourceDetachPrepare(virStorageSourcePtr src, void -qemuBlockStorageSourceChainDataFree(qemuBlockStorageSourceChainDataPtr data) +qemuBlockStorageSourceChainDataFree(qemuBlockStorageSourceChainData *data) { size_t i; @@ -1955,15 +1955,15 @@ qemuBlockStorageSourceChainDataFree(qemuBlockStorageSourceChainDataPtr data) * qemuBlockStorageSourceChainDetachPrepareBlockdev * @src: storage source chain to remove * - * Prepares qemuBlockStorageSourceChainDataPtr for detaching @src and its + * Prepares qemuBlockStorageSourceChainData *for detaching @src and its * backingStore if -blockdev was used. */ -qemuBlockStorageSourceChainDataPtr -qemuBlockStorageSourceChainDetachPrepareBlockdev(virStorageSourcePtr src) +qemuBlockStorageSourceChainData * +qemuBlockStorageSourceChainDetachPrepareBlockdev(virStorageSource *src) { g_autoptr(qemuBlockStorageSourceAttachData) backend = NULL; g_autoptr(qemuBlockStorageSourceChainData) data = NULL; - virStorageSourcePtr n; + virStorageSource *n; data = g_new0(qemuBlockStorageSourceChainData, 1); @@ -1984,11 +1984,11 @@ qemuBlockStorageSourceChainDetachPrepareBlockdev(virStorageSourcePtr src) * @src: storage source chain to remove * @driveAlias: Alias of the 'drive' backend (always consumed) * - * Prepares qemuBlockStorageSourceChainDataPtr for detaching @src and its + * Prepares qemuBlockStorageSourceChainData *for detaching @src and its * backingStore if -drive was used. */ -qemuBlockStorageSourceChainDataPtr -qemuBlockStorageSourceChainDetachPrepareDrive(virStorageSourcePtr src, +qemuBlockStorageSourceChainData * +qemuBlockStorageSourceChainDetachPrepareDrive(virStorageSource *src, char *driveAlias) { g_autoptr(qemuBlockStorageSourceAttachData) backend = NULL; @@ -2010,10 +2010,10 @@ qemuBlockStorageSourceChainDetachPrepareDrive(virStorageSourcePtr src, * qemuBlockStorageSourceChainDetachPrepareChardev * @src: storage source chain to remove * - * Prepares qemuBlockStorageSourceChainDataPtr for detaching @src and its + * Prepares qemuBlockStorageSourceChainData *for detaching @src and its * backingStore if -chardev was used. */ -qemuBlockStorageSourceChainDataPtr +qemuBlockStorageSourceChainData * qemuBlockStorageSourceChainDetachPrepareChardev(char *chardevAlias) { g_autoptr(qemuBlockStorageSourceAttachData) backend = NULL; @@ -2043,8 +2043,8 @@ qemuBlockStorageSourceChainDetachPrepareChardev(char *chardevAlias) * can be used to roll-back the changes. */ int -qemuBlockStorageSourceChainAttach(qemuMonitorPtr mon, - qemuBlockStorageSourceChainDataPtr data) +qemuBlockStorageSourceChainAttach(qemuMonitor *mon, + qemuBlockStorageSourceChainData *data) { size_t i; @@ -2066,8 +2066,8 @@ qemuBlockStorageSourceChainAttach(qemuMonitorPtr mon, * objects described by @data. */ void -qemuBlockStorageSourceChainDetach(qemuMonitorPtr mon, - qemuBlockStorageSourceChainDataPtr data) +qemuBlockStorageSourceChainDetach(qemuMonitor *mon, + qemuBlockStorageSourceChainData *data) { size_t i; @@ -2088,10 +2088,10 @@ qemuBlockStorageSourceChainDetach(qemuMonitorPtr mon, * monitor internally. */ int -qemuBlockStorageSourceDetachOneBlockdev(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuBlockStorageSourceDetachOneBlockdev(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - virStorageSourcePtr src) + virStorageSource *src) { int ret; @@ -2111,9 +2111,9 @@ qemuBlockStorageSourceDetachOneBlockdev(virQEMUDriverPtr driver, int -qemuBlockSnapshotAddLegacy(virJSONValuePtr actions, - virDomainDiskDefPtr disk, - virStorageSourcePtr newsrc, +qemuBlockSnapshotAddLegacy(virJSONValue *actions, + virDomainDiskDef *disk, + virStorageSource *newsrc, bool reuse) { const char *format = virStorageFileFormatTypeToString(newsrc->format); @@ -2131,9 +2131,9 @@ qemuBlockSnapshotAddLegacy(virJSONValuePtr actions, int -qemuBlockSnapshotAddBlockdev(virJSONValuePtr actions, - virDomainDiskDefPtr disk, - virStorageSourcePtr newsrc) +qemuBlockSnapshotAddBlockdev(virJSONValue *actions, + virDomainDiskDef *disk, + virStorageSource *newsrc) { return qemuMonitorTransactionSnapshotBlockdev(actions, disk->src->nodeformat, @@ -2147,11 +2147,11 @@ qemuBlockSnapshotAddBlockdev(virJSONValuePtr actions, * * Creates blockdev properties for a disk copy-on-read layer. */ -virJSONValuePtr -qemuBlockStorageGetCopyOnReadProps(virDomainDiskDefPtr disk) +virJSONValue * +qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef *disk) { - qemuDomainDiskPrivatePtr priv = QEMU_DOMAIN_DISK_PRIVATE(disk); - virJSONValuePtr ret = NULL; + qemuDomainDiskPrivate *priv = QEMU_DOMAIN_DISK_PRIVATE(disk); + virJSONValue *ret = NULL; ignore_value(virJSONValueObjectCreate(&ret, "s:driver", "copy-on-read", @@ -2173,13 +2173,13 @@ qemuBlockStorageGetCopyOnReadProps(virDomainDiskDefPtr disk) * pseudo protocol for any complex configuration. */ char * -qemuBlockGetBackingStoreString(virStorageSourcePtr src, +qemuBlockGetBackingStoreString(virStorageSource *src, bool pretty) { int actualType = virStorageSourceGetActualType(src); g_autoptr(virJSONValue) backingProps = NULL; g_autoptr(virJSONValue) sliceProps = NULL; - virJSONValuePtr props = NULL; + virJSONValue *props = NULL; g_autoptr(virURI) uri = NULL; g_autofree char *backingJSON = NULL; @@ -2255,8 +2255,8 @@ qemuBlockGetBackingStoreString(virStorageSourcePtr src, static int -qemuBlockStorageSourceCreateAddBacking(virStorageSourcePtr backing, - virJSONValuePtr props, +qemuBlockStorageSourceCreateAddBacking(virStorageSource *backing, + virJSONValue *props, bool format) { g_autofree char *backingFileStr = NULL; @@ -2287,10 +2287,10 @@ qemuBlockStorageSourceCreateAddBacking(virStorageSourcePtr backing, static int -qemuBlockStorageSourceCreateGetFormatPropsGeneric(virStorageSourcePtr src, +qemuBlockStorageSourceCreateGetFormatPropsGeneric(virStorageSource *src, const char *driver, - virJSONValuePtr *retprops, - virStorageSourcePtr backing) + virJSONValue **retprops, + virStorageSource *backing) { g_autoptr(virJSONValue) props = NULL; @@ -2311,10 +2311,10 @@ qemuBlockStorageSourceCreateGetFormatPropsGeneric(virStorageSourcePtr src, static int -qemuBlockStorageSourceCreateGetEncryptionLUKS(virStorageSourcePtr src, - virJSONValuePtr *luksProps) +qemuBlockStorageSourceCreateGetEncryptionLUKS(virStorageSource *src, + virJSONValue **luksProps) { - qemuDomainStorageSourcePrivatePtr srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); + qemuDomainStorageSourcePrivate *srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); g_autoptr(virJSONValue) props = NULL; g_autofree char *cipheralg = NULL; const char *keysecret = NULL; @@ -2352,8 +2352,8 @@ qemuBlockStorageSourceCreateGetEncryptionLUKS(virStorageSourcePtr src, static int -qemuBlockStorageSourceCreateGetFormatPropsLUKS(virStorageSourcePtr src, - virJSONValuePtr *props) +qemuBlockStorageSourceCreateGetFormatPropsLUKS(virStorageSource *src, + virJSONValue **props) { g_autoptr(virJSONValue) luksprops = NULL; @@ -2373,8 +2373,8 @@ qemuBlockStorageSourceCreateGetFormatPropsLUKS(virStorageSourcePtr src, static int -qemuBlockStorageSourceCreateAddEncryptionQcow(virStorageSourcePtr src, - virJSONValuePtr props) +qemuBlockStorageSourceCreateAddEncryptionQcow(virStorageSource *src, + virJSONValue *props) { g_autoptr(virJSONValue) encryptProps = NULL; @@ -2401,9 +2401,9 @@ qemuBlockStorageSourceCreateAddEncryptionQcow(virStorageSourcePtr src, static int -qemuBlockStorageSourceCreateGetFormatPropsQcow2(virStorageSourcePtr src, - virStorageSourcePtr backing, - virJSONValuePtr *props) +qemuBlockStorageSourceCreateGetFormatPropsQcow2(virStorageSource *src, + virStorageSource *backing, + virJSONValue **props) { g_autoptr(virJSONValue) qcow2props = NULL; const char *qcow2version = NULL; @@ -2432,9 +2432,9 @@ qemuBlockStorageSourceCreateGetFormatPropsQcow2(virStorageSourcePtr src, static int -qemuBlockStorageSourceCreateGetFormatPropsQcow(virStorageSourcePtr src, - virStorageSourcePtr backing, - virJSONValuePtr *props) +qemuBlockStorageSourceCreateGetFormatPropsQcow(virStorageSource *src, + virStorageSource *backing, + virJSONValue **props) { g_autoptr(virJSONValue) qcowprops = NULL; @@ -2455,9 +2455,9 @@ qemuBlockStorageSourceCreateGetFormatPropsQcow(virStorageSourcePtr src, static int -qemuBlockStorageSourceCreateGetFormatPropsQed(virStorageSourcePtr src, - virStorageSourcePtr backing, - virJSONValuePtr *props) +qemuBlockStorageSourceCreateGetFormatPropsQed(virStorageSource *src, + virStorageSource *backing, + virJSONValue **props) { g_autoptr(virJSONValue) qedprops = NULL; @@ -2488,9 +2488,9 @@ qemuBlockStorageSourceCreateGetFormatPropsQed(virStorageSourcePtr src, * of 'raw' storage is also returns NULL as there is nothing to do. */ int -qemuBlockStorageSourceCreateGetFormatProps(virStorageSourcePtr src, - virStorageSourcePtr backing, - virJSONValuePtr *props) +qemuBlockStorageSourceCreateGetFormatProps(virStorageSource *src, + virStorageSource *backing, + virJSONValue **props) { switch ((virStorageFileFormat) src->format) { case VIR_STORAGE_FILE_RAW: @@ -2567,8 +2567,8 @@ qemuBlockStorageSourceCreateGetFormatProps(virStorageSourcePtr src, * on given protocol. @src->physical is used as size for the storage. */ int -qemuBlockStorageSourceCreateGetStorageProps(virStorageSourcePtr src, - virJSONValuePtr *props) +qemuBlockStorageSourceCreateGetStorageProps(virStorageSource *src, + virJSONValue **props) { int actualType = virStorageSourceGetActualType(src); g_autoptr(virJSONValue) location = NULL; @@ -2654,16 +2654,16 @@ qemuBlockStorageSourceCreateGetStorageProps(virStorageSourcePtr src, static int -qemuBlockStorageSourceCreateGeneric(virDomainObjPtr vm, - virJSONValuePtr createProps, - virStorageSourcePtr src, - virStorageSourcePtr chain, +qemuBlockStorageSourceCreateGeneric(virDomainObj *vm, + virJSONValue *createProps, + virStorageSource *src, + virStorageSource *chain, bool storageCreate, qemuDomainAsyncJob asyncJob) { g_autoptr(virJSONValue) props = createProps; - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuBlockJobDataPtr job = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + qemuBlockJobData *job = NULL; int ret = -1; int rc; @@ -2711,9 +2711,9 @@ qemuBlockStorageSourceCreateGeneric(virDomainObjPtr vm, static int -qemuBlockStorageSourceCreateStorage(virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr chain, +qemuBlockStorageSourceCreateStorage(virDomainObj *vm, + virStorageSource *src, + virStorageSource *chain, qemuDomainAsyncJob asyncJob) { int actualType = virStorageSourceGetActualType(src); @@ -2747,10 +2747,10 @@ qemuBlockStorageSourceCreateStorage(virDomainObjPtr vm, static int -qemuBlockStorageSourceCreateFormat(virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr backingStore, - virStorageSourcePtr chain, +qemuBlockStorageSourceCreateFormat(virDomainObj *vm, + virStorageSource *src, + virStorageSource *backingStore, + virStorageSource *chain, qemuDomainAsyncJob asyncJob) { g_autoptr(virJSONValue) createformatprops = NULL; @@ -2796,14 +2796,14 @@ qemuBlockStorageSourceCreateFormat(virDomainObjPtr vm, * store. */ int -qemuBlockStorageSourceCreate(virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr backingStore, - virStorageSourcePtr chain, - qemuBlockStorageSourceAttachDataPtr data, +qemuBlockStorageSourceCreate(virDomainObj *vm, + virStorageSource *src, + virStorageSource *backingStore, + virStorageSource *chain, + qemuBlockStorageSourceAttachData *data, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret = -1; int rc; @@ -2887,10 +2887,10 @@ qemuBlockStorageSourceCreate(virDomainObjPtr vm, */ int qemuBlockStorageSourceCreateDetectSize(GHashTable *blockNamedNodeData, - virStorageSourcePtr src, - virStorageSourcePtr templ) + virStorageSource *src, + virStorageSource *templ) { - qemuBlockNamedNodeDataPtr entry; + qemuBlockNamedNodeData *entry; if (!(entry = virHashLookup(blockNamedNodeData, templ->nodeformat))) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -2918,12 +2918,12 @@ qemuBlockStorageSourceCreateDetectSize(GHashTable *blockNamedNodeData, int -qemuBlockRemoveImageMetadata(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuBlockRemoveImageMetadata(virQEMUDriver *driver, + virDomainObj *vm, const char *diskTarget, - virStorageSourcePtr src) + virStorageSource *src) { - virStorageSourcePtr n; + virStorageSource *n; int ret = 0; for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) { @@ -2949,19 +2949,19 @@ qemuBlockRemoveImageMetadata(virQEMUDriverPtr driver, * * Looks up a bitmap named @bitmap of the @src image. */ -qemuBlockNamedNodeDataBitmapPtr +qemuBlockNamedNodeDataBitmap * qemuBlockNamedNodeDataGetBitmapByName(GHashTable *blockNamedNodeData, - virStorageSourcePtr src, + virStorageSource *src, const char *bitmap) { - qemuBlockNamedNodeDataPtr nodedata; + qemuBlockNamedNodeData *nodedata; size_t i; if (!(nodedata = virHashLookup(blockNamedNodeData, src->nodeformat))) return NULL; for (i = 0; i < nodedata->nbitmaps; i++) { - qemuBlockNamedNodeDataBitmapPtr bitmapdata = nodedata->bitmaps[i]; + qemuBlockNamedNodeDataBitmap *bitmapdata = nodedata->bitmaps[i]; if (STRNEQ(bitmapdata->name, bitmap)) continue; @@ -2974,11 +2974,11 @@ qemuBlockNamedNodeDataGetBitmapByName(GHashTable *blockNamedNodeData, GHashTable * -qemuBlockGetNamedNodeData(virDomainObjPtr vm, +qemuBlockGetNamedNodeData(virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(GHashTable) blockNamedNodeData = NULL; bool supports_flat = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT); @@ -3006,12 +3006,12 @@ qemuBlockGetNamedNodeData(virDomainObjPtr vm, * from @blockNamedNodeData so they must not be freed. */ static GSList * -qemuBlockGetBitmapMergeActionsGetBitmaps(virStorageSourcePtr topsrc, +qemuBlockGetBitmapMergeActionsGetBitmaps(virStorageSource *topsrc, const char *bitmapname, GHashTable *blockNamedNodeData) { g_autoptr(GSList) ret = NULL; - qemuBlockNamedNodeDataPtr entry; + qemuBlockNamedNodeData *entry; size_t i; /* for now it doesn't make sense to consider bitmaps which are not present @@ -3021,7 +3021,7 @@ qemuBlockGetBitmapMergeActionsGetBitmaps(virStorageSourcePtr topsrc, return NULL; for (i = 0; i < entry->nbitmaps; i++) { - qemuBlockNamedNodeDataBitmapPtr bitmap = entry->bitmaps[i]; + qemuBlockNamedNodeDataBitmap *bitmap = entry->bitmaps[i]; if (bitmapname && STRNEQ(bitmapname, bitmap->name)) @@ -3081,17 +3081,17 @@ qemuBlockGetBitmapMergeActionsGetBitmaps(virStorageSourcePtr topsrc, * Note that @actions may be NULL if no merging is required. */ int -qemuBlockGetBitmapMergeActions(virStorageSourcePtr topsrc, - virStorageSourcePtr basesrc, - virStorageSourcePtr target, +qemuBlockGetBitmapMergeActions(virStorageSource *topsrc, + virStorageSource *basesrc, + virStorageSource *target, const char *bitmapname, const char *dstbitmapname, - virStorageSourcePtr writebitmapsrc, - virJSONValuePtr *actions, + virStorageSource *writebitmapsrc, + virJSONValue **actions, GHashTable *blockNamedNodeData) { g_autoptr(virJSONValue) act = virJSONValueNewArray(); - virStorageSourcePtr n; + virStorageSource *n; g_autoptr(GSList) bitmaps = NULL; GSList *next; @@ -3107,7 +3107,7 @@ qemuBlockGetBitmapMergeActions(virStorageSourcePtr topsrc, bool mergebitmapdisabled = true; g_autoptr(virJSONValue) merge = virJSONValueNewArray(); unsigned long long granularity = 0; - qemuBlockNamedNodeDataBitmapPtr bitmap; + qemuBlockNamedNodeDataBitmap *bitmap; /* explicitly named destinations mean that we want a temporary * disabled bitmap only, so undo the default for non-explicit cases */ @@ -3180,16 +3180,16 @@ qemuBlockGetBitmapMergeActions(virStorageSourcePtr topsrc, * 3) all must be active, persistent and not inconsistent */ bool -qemuBlockBitmapChainIsValid(virStorageSourcePtr src, +qemuBlockBitmapChainIsValid(virStorageSource *src, const char *bitmapname, GHashTable *blockNamedNodeData) { - virStorageSourcePtr n; + virStorageSource *n; bool found = false; bool chain_ended = false; for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) { - qemuBlockNamedNodeDataBitmapPtr bitmap; + qemuBlockNamedNodeDataBitmap *bitmap; if (!(bitmap = qemuBlockNamedNodeDataGetBitmapByName(blockNamedNodeData, n, bitmapname))) { @@ -3233,13 +3233,13 @@ qemuBlockBitmapChainIsValid(virStorageSourcePtr src, * there are no actions to perform for the given job. */ int -qemuBlockBitmapsHandleBlockcopy(virStorageSourcePtr src, - virStorageSourcePtr mirror, +qemuBlockBitmapsHandleBlockcopy(virStorageSource *src, + virStorageSource *mirror, GHashTable *blockNamedNodeData, bool shallow, - virJSONValuePtr *actions) + virJSONValue **actions) { - virStorageSourcePtr base = NULL; + virStorageSource *base = NULL; if (shallow) base = src->backingStore; @@ -3266,13 +3266,13 @@ qemuBlockBitmapsHandleBlockcopy(virStorageSourcePtr src, * 'actions' if there is anything to do. Otherwise NULL is returned. */ int -qemuBlockBitmapsHandleCommitFinish(virStorageSourcePtr topsrc, - virStorageSourcePtr basesrc, +qemuBlockBitmapsHandleCommitFinish(virStorageSource *topsrc, + virStorageSource *basesrc, bool active, GHashTable *blockNamedNodeData, - virJSONValuePtr *actions) + virJSONValue **actions) { - virStorageSourcePtr writebitmapsrc = NULL; + virStorageSource *writebitmapsrc = NULL; if (active) writebitmapsrc = basesrc; @@ -3297,12 +3297,12 @@ qemuBlockBitmapsHandleCommitFinish(virStorageSourcePtr topsrc, * nodenames of @src are used to identify the specific image in qemu. */ static int -qemuBlockReopenFormat(virDomainObjPtr vm, - virStorageSourcePtr src, +qemuBlockReopenFormat(virDomainObj *vm, + virStorageSource *src, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(virJSONValue) reopenprops = NULL; int rc; @@ -3341,8 +3341,8 @@ qemuBlockReopenFormat(virDomainObjPtr vm, * if @src is already read-write. */ int -qemuBlockReopenReadWrite(virDomainObjPtr vm, - virStorageSourcePtr src, +qemuBlockReopenReadWrite(virDomainObj *vm, + virStorageSource *src, qemuDomainAsyncJob asyncJob) { if (!src->readonly) @@ -3370,8 +3370,8 @@ qemuBlockReopenReadWrite(virDomainObjPtr vm, * if @src is already read-only. */ int -qemuBlockReopenReadOnly(virDomainObjPtr vm, - virStorageSourcePtr src, +qemuBlockReopenReadOnly(virDomainObj *vm, + virStorageSource *src, qemuDomainAsyncJob asyncJob) { if (src->readonly) @@ -3418,13 +3418,13 @@ qemuBlockStorageSourceNeedsStorageSliceLayer(const virStorageSource *src) * accepted by qemu. */ char * -qemuBlockStorageSourceGetCookieString(virStorageSourcePtr src) +qemuBlockStorageSourceGetCookieString(virStorageSource *src) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t i; for (i = 0; i < src->ncookies; i++) { - virStorageNetCookieDefPtr cookie = src->cookies[i]; + virStorageNetCookieDef *cookie = src->cookies[i]; virBufferAsprintf(&buf, "%s=%s; ", cookie->name, cookie->value); } @@ -3445,13 +3445,13 @@ qemuBlockStorageSourceGetCookieString(virStorageSourcePtr src) * relative. */ int -qemuBlockUpdateRelativeBacking(virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr topsrc) +qemuBlockUpdateRelativeBacking(virDomainObj *vm, + virStorageSource *src, + virStorageSource *topsrc) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; - virStorageSourcePtr n; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; + virStorageSource *n; for (n = src; virStorageSourceHasBacking(n); n = n->backingStore) { int rc; @@ -3477,7 +3477,7 @@ qemuBlockUpdateRelativeBacking(virDomainObjPtr vm, } -virJSONValuePtr +virJSONValue * qemuBlockExportGetNBDProps(const char *nodename, const char *exportname, bool writable, @@ -3485,7 +3485,7 @@ qemuBlockExportGetNBDProps(const char *nodename, { g_autofree char *exportid = NULL; g_autoptr(virJSONValue) bitmapsarr = NULL; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; exportid = g_strdup_printf("libvirt-nbd-%s", nodename); @@ -3528,14 +3528,14 @@ qemuBlockExportGetNBDProps(const char *nodename, * This function must be called while in the monitor context. */ int -qemuBlockExportAddNBD(virDomainObjPtr vm, +qemuBlockExportAddNBD(virDomainObj *vm, const char *drivealias, - virStorageSourcePtr src, + virStorageSource *src, const char *exportname, bool writable, const char *bitmap) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) { if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCK_EXPORT_ADD)) { diff --git a/src/qemu/qemu_block.h b/src/qemu/qemu_block.h index 7f97e913b3..28ccca97a8 100644 --- a/src/qemu/qemu_block.h +++ b/src/qemu/qemu_block.h @@ -28,13 +28,12 @@ #include "viruri.h" typedef struct qemuBlockNodeNameBackingChainData qemuBlockNodeNameBackingChainData; -typedef qemuBlockNodeNameBackingChainData *qemuBlockNodeNameBackingChainDataPtr; struct qemuBlockNodeNameBackingChainData { char *qemufilename; /* name of the image from qemu */ char *nodeformat; /* node name of the format layer */ char *nodestorage; /* node name of the storage backing the format node */ - qemuBlockNodeNameBackingChainDataPtr backing; + qemuBlockNodeNameBackingChainData *backing; /* for testing purposes */ char *drvformat; @@ -42,19 +41,19 @@ struct qemuBlockNodeNameBackingChainData { }; GHashTable * -qemuBlockNodeNameGetBackingChain(virJSONValuePtr namednodesdata, - virJSONValuePtr blockstats); +qemuBlockNodeNameGetBackingChain(virJSONValue *namednodesdata, + virJSONValue *blockstats); int -qemuBlockNodeNamesDetect(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuBlockNodeNamesDetect(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob); GHashTable * -qemuBlockGetNodeData(virJSONValuePtr data); +qemuBlockGetNodeData(virJSONValue *data); bool -qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSourcePtr src); +qemuBlockStorageSourceSupportsConcurrentAccess(virStorageSource *src); typedef enum { QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_LEGACY = 1 << 0, @@ -63,35 +62,34 @@ typedef enum { QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_SKIP_UNMAP = 1 << 3, } qemuBlockStorageSourceBackendPropsFlags; -virJSONValuePtr -qemuBlockStorageSourceGetBackendProps(virStorageSourcePtr src, +virJSONValue * +qemuBlockStorageSourceGetBackendProps(virStorageSource *src, unsigned int flags); -virURIPtr -qemuBlockStorageSourceGetURI(virStorageSourcePtr src); +virURI * +qemuBlockStorageSourceGetURI(virStorageSource *src); -virJSONValuePtr -qemuBlockStorageSourceGetBlockdevProps(virStorageSourcePtr src, - virStorageSourcePtr backingStore); +virJSONValue * +qemuBlockStorageSourceGetBlockdevProps(virStorageSource *src, + virStorageSource *backingStore); -virJSONValuePtr -qemuBlockStorageGetCopyOnReadProps(virDomainDiskDefPtr disk); +virJSONValue * +qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef *disk); typedef struct qemuBlockStorageSourceAttachData qemuBlockStorageSourceAttachData; -typedef qemuBlockStorageSourceAttachData *qemuBlockStorageSourceAttachDataPtr; struct qemuBlockStorageSourceAttachData { - virJSONValuePtr prmgrProps; + virJSONValue *prmgrProps; char *prmgrAlias; - virJSONValuePtr storageProps; + virJSONValue *storageProps; const char *storageNodeName; bool storageAttached; - virJSONValuePtr storageSliceProps; + virJSONValue *storageSliceProps; const char *storageSliceNodeName; bool storageSliceAttached; - virJSONValuePtr formatProps; + virJSONValue *formatProps; const char *formatNodeName; bool formatAttached; @@ -99,192 +97,191 @@ struct qemuBlockStorageSourceAttachData { char *driveAlias; bool driveAdded; - virDomainChrSourceDefPtr chardevDef; + virDomainChrSourceDef *chardevDef; char *chardevAlias; char *chardevCmd; bool chardevAdded; - virJSONValuePtr authsecretProps; + virJSONValue *authsecretProps; char *authsecretAlias; - virJSONValuePtr encryptsecretProps; + virJSONValue *encryptsecretProps; char *encryptsecretAlias; - virJSONValuePtr httpcookiesecretProps; + virJSONValue *httpcookiesecretProps; char *httpcookiesecretAlias; - virJSONValuePtr tlsProps; + virJSONValue *tlsProps; char *tlsAlias; - virJSONValuePtr tlsKeySecretProps; + virJSONValue *tlsKeySecretProps; char *tlsKeySecretAlias; }; void -qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachDataPtr data); +qemuBlockStorageSourceAttachDataFree(qemuBlockStorageSourceAttachData *data); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuBlockStorageSourceAttachData, qemuBlockStorageSourceAttachDataFree); -qemuBlockStorageSourceAttachDataPtr -qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSourcePtr src, - virStorageSourcePtr backingStore, +qemuBlockStorageSourceAttachData * +qemuBlockStorageSourceAttachPrepareBlockdev(virStorageSource *src, + virStorageSource *backingStore, bool autoreadonly); -qemuBlockStorageSourceAttachDataPtr -qemuBlockStorageSourceDetachPrepare(virStorageSourcePtr src, +qemuBlockStorageSourceAttachData * +qemuBlockStorageSourceDetachPrepare(virStorageSource *src, char *driveAlias); int -qemuBlockStorageSourceAttachApply(qemuMonitorPtr mon, - qemuBlockStorageSourceAttachDataPtr data); +qemuBlockStorageSourceAttachApply(qemuMonitor *mon, + qemuBlockStorageSourceAttachData *data); void -qemuBlockStorageSourceAttachRollback(qemuMonitorPtr mon, - qemuBlockStorageSourceAttachDataPtr data); +qemuBlockStorageSourceAttachRollback(qemuMonitor *mon, + qemuBlockStorageSourceAttachData *data); int -qemuBlockStorageSourceDetachOneBlockdev(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuBlockStorageSourceDetachOneBlockdev(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - virStorageSourcePtr src); + virStorageSource *src); struct _qemuBlockStorageSourceChainData { - qemuBlockStorageSourceAttachDataPtr *srcdata; + qemuBlockStorageSourceAttachData **srcdata; size_t nsrcdata; }; typedef struct _qemuBlockStorageSourceChainData qemuBlockStorageSourceChainData; -typedef qemuBlockStorageSourceChainData *qemuBlockStorageSourceChainDataPtr; void -qemuBlockStorageSourceChainDataFree(qemuBlockStorageSourceChainDataPtr data); +qemuBlockStorageSourceChainDataFree(qemuBlockStorageSourceChainData *data); -qemuBlockStorageSourceChainDataPtr -qemuBlockStorageSourceChainDetachPrepareBlockdev(virStorageSourcePtr src); -qemuBlockStorageSourceChainDataPtr -qemuBlockStorageSourceChainDetachPrepareDrive(virStorageSourcePtr src, +qemuBlockStorageSourceChainData * +qemuBlockStorageSourceChainDetachPrepareBlockdev(virStorageSource *src); +qemuBlockStorageSourceChainData * +qemuBlockStorageSourceChainDetachPrepareDrive(virStorageSource *src, char *driveAlias); -qemuBlockStorageSourceChainDataPtr +qemuBlockStorageSourceChainData * qemuBlockStorageSourceChainDetachPrepareChardev(char *chardevAlias); int -qemuBlockStorageSourceChainAttach(qemuMonitorPtr mon, - qemuBlockStorageSourceChainDataPtr data); +qemuBlockStorageSourceChainAttach(qemuMonitor *mon, + qemuBlockStorageSourceChainData *data); void -qemuBlockStorageSourceChainDetach(qemuMonitorPtr mon, - qemuBlockStorageSourceChainDataPtr data); +qemuBlockStorageSourceChainDetach(qemuMonitor *mon, + qemuBlockStorageSourceChainData *data); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuBlockStorageSourceChainData, qemuBlockStorageSourceChainDataFree); int -qemuBlockSnapshotAddLegacy(virJSONValuePtr actions, - virDomainDiskDefPtr disk, - virStorageSourcePtr newsrc, +qemuBlockSnapshotAddLegacy(virJSONValue *actions, + virDomainDiskDef *disk, + virStorageSource *newsrc, bool reuse); int -qemuBlockSnapshotAddBlockdev(virJSONValuePtr actions, - virDomainDiskDefPtr disk, - virStorageSourcePtr newsrc); +qemuBlockSnapshotAddBlockdev(virJSONValue *actions, + virDomainDiskDef *disk, + virStorageSource *newsrc); char * -qemuBlockGetBackingStoreString(virStorageSourcePtr src, +qemuBlockGetBackingStoreString(virStorageSource *src, bool pretty) ATTRIBUTE_NONNULL(1); int -qemuBlockStorageSourceCreateGetFormatProps(virStorageSourcePtr src, - virStorageSourcePtr backing, - virJSONValuePtr *props) +qemuBlockStorageSourceCreateGetFormatProps(virStorageSource *src, + virStorageSource *backing, + virJSONValue **props) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; int -qemuBlockStorageSourceCreateGetStorageProps(virStorageSourcePtr src, - virJSONValuePtr *props) +qemuBlockStorageSourceCreateGetStorageProps(virStorageSource *src, + virJSONValue **props) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int -qemuBlockStorageSourceCreate(virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr backingStore, - virStorageSourcePtr chain, - qemuBlockStorageSourceAttachDataPtr data, +qemuBlockStorageSourceCreate(virDomainObj *vm, + virStorageSource *src, + virStorageSource *backingStore, + virStorageSource *chain, + qemuBlockStorageSourceAttachData *data, qemuDomainAsyncJob asyncJob); int qemuBlockStorageSourceCreateDetectSize(GHashTable *blockNamedNodeData, - virStorageSourcePtr src, - virStorageSourcePtr templ); + virStorageSource *src, + virStorageSource *templ); int -qemuBlockRemoveImageMetadata(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuBlockRemoveImageMetadata(virQEMUDriver *driver, + virDomainObj *vm, const char *diskTarget, - virStorageSourcePtr src); + virStorageSource *src); -qemuBlockNamedNodeDataBitmapPtr +qemuBlockNamedNodeDataBitmap * qemuBlockNamedNodeDataGetBitmapByName(GHashTable *blockNamedNodeData, - virStorageSourcePtr src, + virStorageSource *src, const char *bitmap); GHashTable * -qemuBlockGetNamedNodeData(virDomainObjPtr vm, +qemuBlockGetNamedNodeData(virDomainObj *vm, qemuDomainAsyncJob asyncJob); int -qemuBlockGetBitmapMergeActions(virStorageSourcePtr topsrc, - virStorageSourcePtr basesrc, - virStorageSourcePtr target, +qemuBlockGetBitmapMergeActions(virStorageSource *topsrc, + virStorageSource *basesrc, + virStorageSource *target, const char *bitmapname, const char *dstbitmapname, - virStorageSourcePtr writebitmapsrc, - virJSONValuePtr *actions, + virStorageSource *writebitmapsrc, + virJSONValue **actions, GHashTable *blockNamedNodeData); bool -qemuBlockBitmapChainIsValid(virStorageSourcePtr src, +qemuBlockBitmapChainIsValid(virStorageSource *src, const char *bitmapname, GHashTable *blockNamedNodeData); int -qemuBlockBitmapsHandleBlockcopy(virStorageSourcePtr src, - virStorageSourcePtr mirror, +qemuBlockBitmapsHandleBlockcopy(virStorageSource *src, + virStorageSource *mirror, GHashTable *blockNamedNodeData, bool shallow, - virJSONValuePtr *actions); + virJSONValue **actions); int -qemuBlockBitmapsHandleCommitFinish(virStorageSourcePtr topsrc, - virStorageSourcePtr basesrc, +qemuBlockBitmapsHandleCommitFinish(virStorageSource *topsrc, + virStorageSource *basesrc, bool active, GHashTable *blockNamedNodeData, - virJSONValuePtr *actions); + virJSONValue **actions); int -qemuBlockReopenReadWrite(virDomainObjPtr vm, - virStorageSourcePtr src, +qemuBlockReopenReadWrite(virDomainObj *vm, + virStorageSource *src, qemuDomainAsyncJob asyncJob); int -qemuBlockReopenReadOnly(virDomainObjPtr vm, - virStorageSourcePtr src, +qemuBlockReopenReadOnly(virDomainObj *vm, + virStorageSource *src, qemuDomainAsyncJob asyncJob); bool qemuBlockStorageSourceNeedsStorageSliceLayer(const virStorageSource *src); char * -qemuBlockStorageSourceGetCookieString(virStorageSourcePtr src); +qemuBlockStorageSourceGetCookieString(virStorageSource *src); int -qemuBlockUpdateRelativeBacking(virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr topsrc); +qemuBlockUpdateRelativeBacking(virDomainObj *vm, + virStorageSource *src, + virStorageSource *topsrc); -virJSONValuePtr +virJSONValue * qemuBlockExportGetNBDProps(const char *nodename, const char *exportname, bool writable, @@ -292,9 +289,9 @@ qemuBlockExportGetNBDProps(const char *nodename, int -qemuBlockExportAddNBD(virDomainObjPtr vm, +qemuBlockExportAddNBD(virDomainObj *vm, const char *drivealias, - virStorageSourcePtr src, + virStorageSource *src, const char *exportname, bool writable, const char *bitmap); diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index d2a769136d..21fcc29ddb 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -71,11 +71,11 @@ VIR_ENUM_IMPL(qemuBlockjob, "create", "broken"); -static virClassPtr qemuBlockJobDataClass; +static virClass *qemuBlockJobDataClass; static void -qemuBlockJobDataDisposeJobdata(qemuBlockJobDataPtr job) +qemuBlockJobDataDisposeJobdata(qemuBlockJobData *job) { if (job->type == QEMU_BLOCKJOB_TYPE_CREATE) virObjectUnref(job->data.create.src); @@ -90,7 +90,7 @@ qemuBlockJobDataDisposeJobdata(qemuBlockJobDataPtr job) static void qemuBlockJobDataDispose(void *obj) { - qemuBlockJobDataPtr job = obj; + qemuBlockJobData *job = obj; virObjectUnref(job->chain); virObjectUnref(job->mirrorChain); @@ -114,7 +114,7 @@ qemuBlockJobDataOnceInit(void) VIR_ONCE_GLOBAL_INIT(qemuBlockJobData); -qemuBlockJobDataPtr +qemuBlockJobData * qemuBlockJobDataNew(qemuBlockJobType type, const char *name) { @@ -145,7 +145,7 @@ qemuBlockJobDataNew(qemuBlockJobType type, * it. This function marks the job as broken. */ static void -qemuBlockJobMarkBroken(qemuBlockJobDataPtr job) +qemuBlockJobMarkBroken(qemuBlockJobData *job) { qemuBlockJobDataDisposeJobdata(job); job->brokentype = job->type; @@ -167,12 +167,12 @@ qemuBlockJobMarkBroken(qemuBlockJobDataPtr job) * then job->mirrorchain needs to be set manually. */ int -qemuBlockJobRegister(qemuBlockJobDataPtr job, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, +qemuBlockJobRegister(qemuBlockJobData *job, + virDomainObj *vm, + virDomainDiskDef *disk, bool savestatus) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (disk && QEMU_DOMAIN_DISK_PRIVATE(disk)->blockjob) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -199,11 +199,11 @@ qemuBlockJobRegister(qemuBlockJobDataPtr job, static void -qemuBlockJobUnregister(qemuBlockJobDataPtr job, - virDomainObjPtr vm) +qemuBlockJobUnregister(qemuBlockJobData *job, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainDiskPrivatePtr diskPriv; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainDiskPrivate *diskPriv; if (job->disk) { diskPriv = QEMU_DOMAIN_DISK_PRIVATE(job->disk); @@ -231,9 +231,9 @@ qemuBlockJobUnregister(qemuBlockJobDataPtr job, * * Returns 0 on success and -1 on failure. */ -qemuBlockJobDataPtr -qemuBlockJobDiskNew(virDomainObjPtr vm, - virDomainDiskDefPtr disk, +qemuBlockJobData * +qemuBlockJobDiskNew(virDomainObj *vm, + virDomainDiskDef *disk, qemuBlockJobType type, const char *jobname) { @@ -249,13 +249,13 @@ qemuBlockJobDiskNew(virDomainObjPtr vm, } -qemuBlockJobDataPtr -qemuBlockJobDiskNewPull(virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr base, +qemuBlockJobData * +qemuBlockJobDiskNewPull(virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *base, unsigned int jobflags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(qemuBlockJobData) job = NULL; g_autofree char *jobname = NULL; @@ -279,16 +279,16 @@ qemuBlockJobDiskNewPull(virDomainObjPtr vm, } -qemuBlockJobDataPtr -qemuBlockJobDiskNewCommit(virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr topparent, - virStorageSourcePtr top, - virStorageSourcePtr base, +qemuBlockJobData * +qemuBlockJobDiskNewCommit(virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *topparent, + virStorageSource *top, + virStorageSource *base, bool delete_imgs, unsigned int jobflags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(qemuBlockJobData) job = NULL; g_autofree char *jobname = NULL; qemuBlockJobType jobtype = QEMU_BLOCKJOB_TYPE_COMMIT; @@ -319,10 +319,10 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm, } -qemuBlockJobDataPtr -qemuBlockJobNewCreate(virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr chain, +qemuBlockJobData * +qemuBlockJobNewCreate(virDomainObj *vm, + virStorageSource *src, + virStorageSource *chain, bool storage) { g_autoptr(qemuBlockJobData) job = NULL; @@ -349,15 +349,15 @@ qemuBlockJobNewCreate(virDomainObjPtr vm, } -qemuBlockJobDataPtr -qemuBlockJobDiskNewCopy(virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr mirror, +qemuBlockJobData * +qemuBlockJobDiskNewCopy(virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *mirror, bool shallow, bool reuse, unsigned int jobflags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(qemuBlockJobData) job = NULL; g_autofree char *jobname = NULL; @@ -385,10 +385,10 @@ qemuBlockJobDiskNewCopy(virDomainObjPtr vm, } -qemuBlockJobDataPtr -qemuBlockJobDiskNewBackup(virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr store, +qemuBlockJobData * +qemuBlockJobDiskNewBackup(virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *store, const char *bitmap) { g_autoptr(qemuBlockJobData) job = NULL; @@ -417,10 +417,10 @@ qemuBlockJobDiskNewBackup(virDomainObjPtr vm, * * Get a reference to the block job data object associated with @disk. */ -qemuBlockJobDataPtr -qemuBlockJobDiskGetJob(virDomainDiskDefPtr disk) +qemuBlockJobData * +qemuBlockJobDiskGetJob(virDomainDiskDef *disk) { - qemuBlockJobDataPtr job = QEMU_DOMAIN_DISK_PRIVATE(disk)->blockjob; + qemuBlockJobData *job = QEMU_DOMAIN_DISK_PRIVATE(disk)->blockjob; if (!job) return NULL; @@ -436,8 +436,8 @@ qemuBlockJobDiskGetJob(virDomainDiskDefPtr disk) * Mark @job as started in qemu. */ void -qemuBlockJobStarted(qemuBlockJobDataPtr job, - virDomainObjPtr vm) +qemuBlockJobStarted(qemuBlockJobData *job, + virDomainObj *vm) { if (job->state == QEMU_BLOCKJOB_STATE_NEW) job->state = QEMU_BLOCKJOB_STATE_RUNNING; @@ -455,8 +455,8 @@ qemuBlockJobStarted(qemuBlockJobDataPtr job, * to @job if it was started. */ void -qemuBlockJobStartupFinalize(virDomainObjPtr vm, - qemuBlockJobDataPtr job) +qemuBlockJobStartupFinalize(virDomainObj *vm, + qemuBlockJobData *job) { if (!job) return; @@ -469,7 +469,7 @@ qemuBlockJobStartupFinalize(virDomainObjPtr vm, bool -qemuBlockJobIsRunning(qemuBlockJobDataPtr job) +qemuBlockJobIsRunning(qemuBlockJobData *job) { return job->state == QEMU_BLOCKJOB_STATE_RUNNING || job->state == QEMU_BLOCKJOB_STATE_READY || @@ -491,13 +491,13 @@ qemuBlockJobRefreshJobsFindInactive(const void *payload, int -qemuBlockJobRefreshJobs(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuBlockJobRefreshJobs(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuMonitorJobInfoPtr *jobinfo = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + qemuMonitorJobInfo **jobinfo = NULL; size_t njobinfo = 0; - qemuBlockJobDataPtr job = NULL; + qemuBlockJobData *job = NULL; int newstate; size_t i; int ret = -1; @@ -597,14 +597,14 @@ qemuBlockJobRefreshJobs(virQEMUDriverPtr driver, * for a block job. The former event is emitted only for local disks. */ static void -qemuBlockJobEmitEvents(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, +qemuBlockJobEmitEvents(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk, virDomainBlockJobType type, virConnectDomainEventBlockJobStatus status) { - virObjectEventPtr event = NULL; - virObjectEventPtr event2 = NULL; + virObjectEvent *event = NULL; + virObjectEvent *event2 = NULL; /* don't emit events for jobs without disk */ if (!disk) @@ -633,7 +633,7 @@ qemuBlockJobEmitEvents(virQEMUDriverPtr driver, * Remove all runtime related data from the storage source. */ static void -qemuBlockJobCleanStorageSourceRuntime(virStorageSourcePtr src) +qemuBlockJobCleanStorageSourceRuntime(virStorageSource *src) { src->id = 0; src->detected = false; @@ -659,13 +659,13 @@ qemuBlockJobCleanStorageSourceRuntime(virStorageSourcePtr src) * @disk and updates its source to @newsrc. */ static void -qemuBlockJobRewriteConfigDiskSource(virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr newsrc) +qemuBlockJobRewriteConfigDiskSource(virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *newsrc) { - virDomainDiskDefPtr persistDisk = NULL; + virDomainDiskDef *persistDisk = NULL; g_autoptr(virStorageSource) copy = NULL; - virStorageSourcePtr n; + virStorageSource *n; if (!vm->newDef) return; @@ -701,12 +701,12 @@ qemuBlockJobRewriteConfigDiskSource(virDomainObjPtr vm, static void -qemuBlockJobEventProcessLegacyCompleted(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobEventProcessLegacyCompleted(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job, int asyncJob) { - virDomainDiskDefPtr disk = job->disk; + virDomainDiskDef *disk = job->disk; if (!disk) return; @@ -774,12 +774,12 @@ qemuBlockJobEventProcessLegacyCompleted(virQEMUDriverPtr driver, * restart, also update the domain's status XML. */ static void -qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobEventProcessLegacy(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job, int asyncJob) { - virDomainDiskDefPtr disk = job->disk; + virDomainDiskDef *disk = job->disk; VIR_DEBUG("disk=%s, mirrorState=%s, type=%d, state=%d, newstate=%d", disk->dst, @@ -833,10 +833,10 @@ qemuBlockJobEventProcessLegacy(virQEMUDriverPtr driver, static void -qemuBlockJobEventProcessConcludedRemoveChain(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuBlockJobEventProcessConcludedRemoveChain(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - virStorageSourcePtr chain) + virStorageSource *chain) { g_autoptr(qemuBlockStorageSourceChainData) data = NULL; @@ -866,14 +866,14 @@ qemuBlockJobEventProcessConcludedRemoveChain(virQEMUDriverPtr driver, * chains of both @disk and the persistent config definition equivalent must * be identical. */ -static virDomainDiskDefPtr -qemuBlockJobGetConfigDisk(virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr diskChainBottom) +static virDomainDiskDef * +qemuBlockJobGetConfigDisk(virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *diskChainBottom) { - virStorageSourcePtr disksrc = NULL; - virStorageSourcePtr cfgsrc = NULL; - virDomainDiskDefPtr ret = NULL; + virStorageSource *disksrc = NULL; + virStorageSource *cfgsrc = NULL; + virDomainDiskDef *ret = NULL; if (!vm->newDef || !disk) return NULL; @@ -917,10 +917,10 @@ qemuBlockJobGetConfigDisk(virDomainObjPtr vm, * data. */ static void -qemuBlockJobClearConfigChain(virDomainObjPtr vm, - virDomainDiskDefPtr disk) +qemuBlockJobClearConfigChain(virDomainObj *vm, + virDomainDiskDef *disk) { - virDomainDiskDefPtr cfgdisk = NULL; + virDomainDiskDef *cfgdisk = NULL; if (!vm->newDef || !disk) return; @@ -937,11 +937,11 @@ qemuBlockJobClearConfigChain(virDomainObjPtr vm, static int -qemuBlockJobProcessEventCompletedPullBitmaps(virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobProcessEventCompletedPullBitmaps(virDomainObj *vm, + qemuBlockJobData *job, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(GHashTable) blockNamedNodeData = NULL; g_autoptr(virJSONValue) actions = NULL; @@ -987,18 +987,18 @@ qemuBlockJobProcessEventCompletedPullBitmaps(virDomainObjPtr vm, * and base image are no longer required and can be unplugged. */ static void -qemuBlockJobProcessEventCompletedPull(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobProcessEventCompletedPull(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job, qemuDomainAsyncJob asyncJob) { virStorageSource *base = NULL; - virStorageSourcePtr baseparent = NULL; - virDomainDiskDefPtr cfgdisk = NULL; - virStorageSourcePtr cfgbase = NULL; - virStorageSourcePtr cfgbaseparent = NULL; - virStorageSourcePtr n; - virStorageSourcePtr tmp; + virStorageSource *baseparent = NULL; + virDomainDiskDef *cfgdisk = NULL; + virStorageSource *cfgbase = NULL; + virStorageSource *cfgbaseparent = NULL; + virStorageSource *n; + virStorageSource *tmp; VIR_DEBUG("pull job '%s' on VM '%s' completed", job->name, vm->def->name); @@ -1072,12 +1072,12 @@ qemuBlockJobProcessEventCompletedPull(virQEMUDriverPtr driver, * TODO look into removing backing store for non-local snapshots too */ static void -qemuBlockJobDeleteImages(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr top) +qemuBlockJobDeleteImages(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *top) { - virStorageSourcePtr p = top; + virStorageSource *p = top; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); uid_t uid; gid_t gid; @@ -1102,11 +1102,11 @@ qemuBlockJobDeleteImages(virQEMUDriverPtr driver, * Handles the bitmap changes after commit. This returns -1 on monitor failures. */ static int -qemuBlockJobProcessEventCompletedCommitBitmaps(virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobProcessEventCompletedCommitBitmaps(virDomainObj *vm, + qemuBlockJobData *job, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(GHashTable) blockNamedNodeData = NULL; g_autoptr(virJSONValue) actions = NULL; bool active = job->type == QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT; @@ -1164,19 +1164,19 @@ qemuBlockJobProcessEventCompletedCommitBitmaps(virDomainObjPtr vm, * removed/deleted. */ static void -qemuBlockJobProcessEventCompletedCommit(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobProcessEventCompletedCommit(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job, qemuDomainAsyncJob asyncJob) { - virStorageSourcePtr baseparent = NULL; - virDomainDiskDefPtr cfgdisk = NULL; - virStorageSourcePtr cfgnext = NULL; - virStorageSourcePtr cfgtopparent = NULL; - virStorageSourcePtr cfgtop = NULL; - virStorageSourcePtr cfgbase = NULL; - virStorageSourcePtr cfgbaseparent = NULL; - virStorageSourcePtr n; + virStorageSource *baseparent = NULL; + virDomainDiskDef *cfgdisk = NULL; + virStorageSource *cfgnext = NULL; + virStorageSource *cfgtopparent = NULL; + virStorageSource *cfgtop = NULL; + virStorageSource *cfgbase = NULL; + virStorageSource *cfgbaseparent = NULL; + virStorageSource *n; VIR_DEBUG("commit job '%s' on VM '%s' completed", job->name, vm->def->name); @@ -1255,18 +1255,18 @@ qemuBlockJobProcessEventCompletedCommit(virQEMUDriverPtr driver, * removed/deleted. */ static void -qemuBlockJobProcessEventCompletedActiveCommit(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobProcessEventCompletedActiveCommit(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job, qemuDomainAsyncJob asyncJob) { - virStorageSourcePtr baseparent = NULL; - virDomainDiskDefPtr cfgdisk = NULL; - virStorageSourcePtr cfgnext = NULL; - virStorageSourcePtr cfgtop = NULL; - virStorageSourcePtr cfgbase = NULL; - virStorageSourcePtr cfgbaseparent = NULL; - virStorageSourcePtr n; + virStorageSource *baseparent = NULL; + virDomainDiskDef *cfgdisk = NULL; + virStorageSource *cfgnext = NULL; + virStorageSource *cfgtop = NULL; + virStorageSource *cfgbase = NULL; + virStorageSource *cfgbaseparent = NULL; + virStorageSource *n; VIR_DEBUG("active commit job '%s' on VM '%s' completed", job->name, vm->def->name); @@ -1329,11 +1329,11 @@ qemuBlockJobProcessEventCompletedActiveCommit(virQEMUDriverPtr driver, static int -qemuBlockJobProcessEventCompletedCopyBitmaps(virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobProcessEventCompletedCopyBitmaps(virDomainObj *vm, + qemuBlockJobData *job, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(GHashTable) blockNamedNodeData = NULL; g_autoptr(virJSONValue) actions = NULL; bool shallow = job->jobflags & VIR_DOMAIN_BLOCK_COPY_SHALLOW; @@ -1366,12 +1366,12 @@ qemuBlockJobProcessEventCompletedCopyBitmaps(virDomainObjPtr vm, } static void -qemuBlockJobProcessEventConcludedCopyPivot(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobProcessEventConcludedCopyPivot(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; VIR_DEBUG("copy job '%s' on VM '%s' pivoted", job->name, vm->def->name); /* mirror may be NULL for copy job corresponding to migration */ @@ -1402,9 +1402,9 @@ qemuBlockJobProcessEventConcludedCopyPivot(virQEMUDriverPtr driver, static void -qemuBlockJobProcessEventConcludedCopyAbort(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobProcessEventConcludedCopyAbort(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job, qemuDomainAsyncJob asyncJob) { VIR_DEBUG("copy job '%s' on VM '%s' aborted", job->name, vm->def->name); @@ -1422,13 +1422,13 @@ qemuBlockJobProcessEventConcludedCopyAbort(virQEMUDriverPtr driver, static void -qemuBlockJobProcessEventFailedActiveCommit(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobProcessEventFailedActiveCommit(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainDiskDefPtr disk = job->disk; + qemuDomainObjPrivate *priv = vm->privateData; + virDomainDiskDef *disk = job->disk; VIR_DEBUG("active commit job '%s' on VM '%s' failed", job->name, vm->def->name); @@ -1456,9 +1456,9 @@ qemuBlockJobProcessEventFailedActiveCommit(virQEMUDriverPtr driver, static void -qemuBlockJobProcessEventConcludedCreate(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobProcessEventConcludedCreate(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job, qemuDomainAsyncJob asyncJob) { g_autoptr(qemuBlockStorageSourceAttachData) backend = NULL; @@ -1499,9 +1499,9 @@ qemuBlockJobProcessEventConcludedCreate(virQEMUDriverPtr driver, static void -qemuBlockJobProcessEventConcludedBackup(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobProcessEventConcludedBackup(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job, qemuDomainAsyncJob asyncJob, qemuBlockjobState newstate, unsigned long long progressCurrent, @@ -1536,9 +1536,9 @@ qemuBlockJobProcessEventConcludedBackup(virQEMUDriverPtr driver, static void -qemuBlockJobEventProcessConcludedTransition(qemuBlockJobDataPtr job, - virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuBlockJobEventProcessConcludedTransition(qemuBlockJobData *job, + virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, unsigned long long progressCurrent, unsigned long long progressTotal) @@ -1596,12 +1596,12 @@ qemuBlockJobEventProcessConcludedTransition(qemuBlockJobDataPtr job, static void -qemuBlockJobEventProcessConcluded(qemuBlockJobDataPtr job, - virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuBlockJobEventProcessConcluded(qemuBlockJobData *job, + virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuMonitorJobInfoPtr *jobinfo = NULL; + qemuMonitorJobInfo **jobinfo = NULL; size_t njobinfo = 0; size_t i; bool refreshed = false; @@ -1678,9 +1678,9 @@ qemuBlockJobEventProcessConcluded(qemuBlockJobDataPtr job, static void -qemuBlockJobEventProcess(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobEventProcess(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job, qemuDomainAsyncJob asyncJob) { @@ -1729,11 +1729,11 @@ qemuBlockJobEventProcess(virQEMUDriverPtr driver, * blockJobStatus by qemuProcessHandleBlockJob event handler. */ void -qemuBlockJobUpdate(virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobUpdate(virDomainObj *vm, + qemuBlockJobData *job, int asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (job->newstate == -1) return; @@ -1760,7 +1760,7 @@ qemuBlockJobUpdate(virDomainObjPtr vm, * is called. */ void -qemuBlockJobSyncBegin(qemuBlockJobDataPtr job) +qemuBlockJobSyncBegin(qemuBlockJobData *job) { const char *diskdst = NULL; @@ -1783,8 +1783,8 @@ qemuBlockJobSyncBegin(qemuBlockJobDataPtr job) * qemuBlockJobStartupFinalize will be called. */ void -qemuBlockJobSyncEnd(virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobSyncEnd(virDomainObj *vm, + qemuBlockJobData *job, int asyncJob) { const char *diskdst = NULL; @@ -1798,10 +1798,10 @@ qemuBlockJobSyncEnd(virDomainObjPtr vm, } -qemuBlockJobDataPtr -qemuBlockJobGetByDisk(virDomainDiskDefPtr disk) +qemuBlockJobData * +qemuBlockJobGetByDisk(virDomainDiskDef *disk) { - qemuBlockJobDataPtr job = QEMU_DOMAIN_DISK_PRIVATE(disk)->blockjob; + qemuBlockJobData *job = QEMU_DOMAIN_DISK_PRIVATE(disk)->blockjob; if (!job) return NULL; diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h index 9f73a3547c..5ad3bfba42 100644 --- a/src/qemu/qemu_blockjob.h +++ b/src/qemu/qemu_blockjob.h @@ -73,61 +73,49 @@ VIR_ENUM_DECL(qemuBlockjob); typedef struct _qemuBlockJobPullData qemuBlockJobPullData; -typedef qemuBlockJobPullData *qemuBlockJobDataPullPtr; - struct _qemuBlockJobPullData { - virStorageSourcePtr base; + virStorageSource *base; }; typedef struct _qemuBlockJobCommitData qemuBlockJobCommitData; -typedef qemuBlockJobCommitData *qemuBlockJobDataCommitPtr; - struct _qemuBlockJobCommitData { - virStorageSourcePtr topparent; - virStorageSourcePtr top; - virStorageSourcePtr base; + virStorageSource *topparent; + virStorageSource *top; + virStorageSource *base; bool deleteCommittedImages; }; typedef struct _qemuBlockJobCreateData qemuBlockJobCreateData; -typedef qemuBlockJobCreateData *qemuBlockJobDataCreatePtr; - struct _qemuBlockJobCreateData { bool storage; - virStorageSourcePtr src; + virStorageSource *src; }; typedef struct _qemuBlockJobCopyData qemuBlockJobCopyData; -typedef qemuBlockJobCopyData *qemuBlockJobDataCopyPtr; - struct _qemuBlockJobCopyData { bool shallownew; }; typedef struct _qemuBlockJobBackupData qemuBlockJobBackupData; -typedef qemuBlockJobBackupData *qemuBlockJobDataBackupPtr; - struct _qemuBlockJobBackupData { - virStorageSourcePtr store; + virStorageSource *store; char *bitmap; }; typedef struct _qemuBlockJobData qemuBlockJobData; -typedef qemuBlockJobData *qemuBlockJobDataPtr; - struct _qemuBlockJobData { virObject parent; char *name; - virDomainDiskDefPtr disk; /* may be NULL, if blockjob does not correspond to any disk */ - virStorageSourcePtr chain; /* Reference to the chain the job operates on. */ - virStorageSourcePtr mirrorChain; /* reference to 'mirror' part of the job */ + virDomainDiskDef *disk; /* may be NULL, if blockjob does not correspond to any disk */ + virStorageSource *chain; /* Reference to the chain the job operates on. */ + virStorageSource *mirrorChain; /* reference to 'mirror' part of the job */ unsigned int jobflags; /* per job flags */ bool jobflagsmissing; /* job flags were not stored */ @@ -155,92 +143,92 @@ struct _qemuBlockJobData { G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuBlockJobData, virObjectUnref); int -qemuBlockJobRegister(qemuBlockJobDataPtr job, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, +qemuBlockJobRegister(qemuBlockJobData *job, + virDomainObj *vm, + virDomainDiskDef *disk, bool savestatus) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -qemuBlockJobDataPtr +qemuBlockJobData * qemuBlockJobDataNew(qemuBlockJobType type, const char *name) ATTRIBUTE_NONNULL(2); -qemuBlockJobDataPtr -qemuBlockJobDiskNew(virDomainObjPtr vm, - virDomainDiskDefPtr disk, +qemuBlockJobData * +qemuBlockJobDiskNew(virDomainObj *vm, + virDomainDiskDef *disk, qemuBlockJobType type, const char *jobname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4); -qemuBlockJobDataPtr -qemuBlockJobDiskNewPull(virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr base, +qemuBlockJobData * +qemuBlockJobDiskNewPull(virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *base, unsigned int jobflags); -qemuBlockJobDataPtr -qemuBlockJobDiskNewCommit(virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr topparent, - virStorageSourcePtr top, - virStorageSourcePtr base, +qemuBlockJobData * +qemuBlockJobDiskNewCommit(virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *topparent, + virStorageSource *top, + virStorageSource *base, bool delete_imgs, unsigned int jobflags); -qemuBlockJobDataPtr -qemuBlockJobNewCreate(virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr chain, +qemuBlockJobData * +qemuBlockJobNewCreate(virDomainObj *vm, + virStorageSource *src, + virStorageSource *chain, bool storage); -qemuBlockJobDataPtr -qemuBlockJobDiskNewCopy(virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr mirror, +qemuBlockJobData * +qemuBlockJobDiskNewCopy(virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *mirror, bool shallow, bool reuse, unsigned int jobflags); -qemuBlockJobDataPtr -qemuBlockJobDiskNewBackup(virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr store, +qemuBlockJobData * +qemuBlockJobDiskNewBackup(virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *store, const char *bitmap); -qemuBlockJobDataPtr -qemuBlockJobDiskGetJob(virDomainDiskDefPtr disk) +qemuBlockJobData * +qemuBlockJobDiskGetJob(virDomainDiskDef *disk) ATTRIBUTE_NONNULL(1); void -qemuBlockJobStarted(qemuBlockJobDataPtr job, - virDomainObjPtr vm) +qemuBlockJobStarted(qemuBlockJobData *job, + virDomainObj *vm) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); bool -qemuBlockJobIsRunning(qemuBlockJobDataPtr job) +qemuBlockJobIsRunning(qemuBlockJobData *job) ATTRIBUTE_NONNULL(1); void -qemuBlockJobStartupFinalize(virDomainObjPtr vm, - qemuBlockJobDataPtr job); +qemuBlockJobStartupFinalize(virDomainObj *vm, + qemuBlockJobData *job); int -qemuBlockJobRefreshJobs(virQEMUDriverPtr driver, - virDomainObjPtr vm); +qemuBlockJobRefreshJobs(virQEMUDriver *driver, + virDomainObj *vm); void -qemuBlockJobUpdate(virDomainObjPtr vm, - qemuBlockJobDataPtr job, +qemuBlockJobUpdate(virDomainObj *vm, + qemuBlockJobData *job, int asyncJob); -void qemuBlockJobSyncBegin(qemuBlockJobDataPtr job); -void qemuBlockJobSyncEnd(virDomainObjPtr vm, - qemuBlockJobDataPtr job, +void qemuBlockJobSyncBegin(qemuBlockJobData *job); +void qemuBlockJobSyncEnd(virDomainObj *vm, + qemuBlockJobData *job, int asyncJob); -qemuBlockJobDataPtr -qemuBlockJobGetByDisk(virDomainDiskDefPtr disk) +qemuBlockJobData * +qemuBlockJobGetByDisk(virDomainDiskDef *disk) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; qemuBlockjobState diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index ba1432c7e3..f1a3c526ef 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -633,7 +633,6 @@ VIR_ENUM_IMPL(virQEMUCaps, typedef struct _virQEMUCapsMachineType virQEMUCapsMachineType; -typedef virQEMUCapsMachineType *virQEMUCapsMachineTypePtr; struct _virQEMUCapsMachineType { char *name; char *alias; @@ -647,30 +646,28 @@ struct _virQEMUCapsMachineType { }; typedef struct _virQEMUCapsHostCPUData virQEMUCapsHostCPUData; -typedef virQEMUCapsHostCPUData *virQEMUCapsHostCPUDataPtr; struct _virQEMUCapsHostCPUData { /* Only the "info" part is stored in the capabilities cache, the rest is * re-computed from other fields and external data sources every time we * probe QEMU or load the cache. */ - qemuMonitorCPUModelInfoPtr info; + qemuMonitorCPUModelInfo *info; /* Host CPU definition reported in domain capabilities. */ - virCPUDefPtr reported; + virCPUDef *reported; /* Migratable host CPU definition used for updating guest CPU. */ - virCPUDefPtr migratable; + virCPUDef *migratable; /* CPU definition with features detected by libvirt using virCPUGetHost * combined with features reported by QEMU. This is used for backward * compatible comparison between a guest CPU and a host CPU. */ - virCPUDefPtr full; + virCPUDef *full; }; typedef struct _virQEMUCapsAccel virQEMUCapsAccel; -typedef virQEMUCapsAccel *virQEMUCapsAccelPtr; struct _virQEMUCapsAccel { size_t nmachineTypes; - virQEMUCapsMachineTypePtr machineTypes; + virQEMUCapsMachineType *machineTypes; virQEMUCapsHostCPUData hostCPU; - qemuMonitorCPUDefsPtr cpuModels; + qemuMonitorCPUDefs *cpuModels; }; @@ -695,7 +692,7 @@ struct _virQEMUCaps { time_t modDirMtime; bool invalidation; - virBitmapPtr flags; + virBitmap *flags; unsigned int version; unsigned int kvmVersion; @@ -723,7 +720,7 @@ struct virQEMUCapsSearchData { }; -static virClassPtr virQEMUCapsClass; +static virClass *virQEMUCapsClass; static void virQEMUCapsDispose(void *obj); static int virQEMUCapsOnceInit(void) @@ -808,8 +805,8 @@ virQEMUCapsFindTarget(virArch hostarch, } -static virQEMUCapsAccelPtr -virQEMUCapsGetAccel(virQEMUCapsPtr qemuCaps, +static virQEMUCapsAccel * +virQEMUCapsGetAccel(virQEMUCaps *qemuCaps, virDomainVirtType type) { if (type == VIR_DOMAIN_VIRT_KVM) @@ -820,7 +817,7 @@ virQEMUCapsGetAccel(virQEMUCapsPtr qemuCaps, static void -virQEMUCapsSetDefaultMachine(virQEMUCapsAccelPtr caps, +virQEMUCapsSetDefaultMachine(virQEMUCapsAccel *caps, size_t defIdx) { virQEMUCapsMachineType tmp = caps->machineTypes[defIdx]; @@ -901,13 +898,13 @@ virQEMUCapsGetDefaultEmulator(virArch hostarch, static int -virQEMUCapsInitGuest(virCapsPtr caps, - virFileCachePtr cache, +virQEMUCapsInitGuest(virCaps *caps, + virFileCache *cache, virArch hostarch, virArch guestarch) { char *binary = NULL; - virQEMUCapsPtr qemuCaps = NULL; + virQEMUCaps *qemuCaps = NULL; int ret = -1; binary = virQEMUCapsGetDefaultEmulator(hostarch, guestarch); @@ -932,12 +929,12 @@ virQEMUCapsInitGuest(virCapsPtr caps, static int -virQEMUCapsGetMachineTypesCaps(virQEMUCapsPtr qemuCaps, +virQEMUCapsGetMachineTypesCaps(virQEMUCaps *qemuCaps, size_t *nmachines, - virCapsGuestMachinePtr **machines) + virCapsGuestMachine ***machines) { size_t i; - virQEMUCapsAccelPtr accel; + virQEMUCapsAccel *accel; /* Guest capabilities do not report TCG vs. KVM caps separately. We just * take the set of machine types we probed first. */ @@ -950,10 +947,10 @@ virQEMUCapsGetMachineTypesCaps(virQEMUCapsPtr qemuCaps, *nmachines = accel->nmachineTypes; if (*nmachines) - *machines = g_new0(virCapsGuestMachinePtr, accel->nmachineTypes); + *machines = g_new0(virCapsGuestMachine *, accel->nmachineTypes); for (i = 0; i < accel->nmachineTypes; i++) { - virCapsGuestMachinePtr mach; + virCapsGuestMachine *mach; mach = g_new0(virCapsGuestMachine, 1); (*machines)[i] = mach; if (accel->machineTypes[i].alias) { @@ -974,7 +971,7 @@ virQEMUCapsGetMachineTypesCaps(virQEMUCapsPtr qemuCaps, while (i < *nmachines) { size_t j; bool found = false; - virCapsGuestMachinePtr machine = (*machines)[i]; + virCapsGuestMachine *machine = (*machines)[i]; if (!machine->canonical) { i++; @@ -989,7 +986,7 @@ virQEMUCapsGetMachineTypesCaps(virQEMUCapsPtr qemuCaps, } if (!found) { - virCapsGuestMachinePtr mach; + virCapsGuestMachine *mach; mach = g_new0(virCapsGuestMachine, 1); if (VIR_INSERT_ELEMENT_COPY(*machines, i, *nmachines, mach) < 0) { VIR_FREE(mach); @@ -1014,13 +1011,13 @@ virQEMUCapsGetMachineTypesCaps(virQEMUCapsPtr qemuCaps, int -virQEMUCapsInitGuestFromBinary(virCapsPtr caps, +virQEMUCapsInitGuestFromBinary(virCaps *caps, const char *binary, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, virArch guestarch) { - virCapsGuestPtr guest; - virCapsGuestMachinePtr *machines = NULL; + virCapsGuest *guest; + virCapsGuestMachine **machines = NULL; size_t nmachines = 0; int ret = -1; @@ -1096,18 +1093,18 @@ virQEMUCapsInitGuestFromBinary(virCapsPtr caps, } -virCPUDefPtr +virCPUDef * virQEMUCapsProbeHostCPU(virArch hostArch, - virDomainCapsCPUModelsPtr models) + virDomainCapsCPUModels *models) { return virCPUGetHost(hostArch, VIR_CPU_TYPE_GUEST, NULL, models); } -virCapsPtr -virQEMUCapsInit(virFileCachePtr cache) +virCaps * +virQEMUCapsInit(virFileCache *cache) { - virCapsPtr caps; + virCaps *caps; size_t i; virArch hostarch = virArchFromHost(); @@ -1356,7 +1353,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { struct virQEMUCapsDevicePropsFlags { const char *value; int flag; - int (*cb)(virJSONValuePtr props, virQEMUCapsPtr caps); + int (*cb)(virJSONValue *props, virQEMUCaps *caps); }; @@ -1372,8 +1369,8 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVirtioBalloon[] static int -virQEMUCapsDevicePropsVirtioBlkSCSIDefault(virJSONValuePtr props, - virQEMUCapsPtr qemuCaps) +virQEMUCapsDevicePropsVirtioBlkSCSIDefault(virJSONValue *props, + virQEMUCaps *qemuCaps) { bool def = false; @@ -1763,7 +1760,7 @@ static virQEMUCapsObjectTypeProps virQEMUCapsMachineProps[] = { }; static void -virQEMUCapsProcessStringFlags(virQEMUCapsPtr qemuCaps, +virQEMUCapsProcessStringFlags(virQEMUCaps *qemuCaps, size_t nflags, struct virQEMUCapsStringFlags *flags, size_t nvalues, @@ -1784,13 +1781,13 @@ virQEMUCapsProcessStringFlags(virQEMUCapsPtr qemuCaps, } -int virQEMUCapsGetDefaultVersion(virCapsPtr caps, - virFileCachePtr capsCache, +int virQEMUCapsGetDefaultVersion(virCaps *caps, + virFileCache *capsCache, unsigned int *version) { - virQEMUCapsPtr qemucaps; + virQEMUCaps *qemucaps; virArch hostarch; - virCapsDomainDataPtr capsdata; + virCapsDomainData *capsdata; if (*version > 0) return 0; @@ -1816,10 +1813,10 @@ int virQEMUCapsGetDefaultVersion(virCapsPtr caps, } -virQEMUCapsPtr +virQEMUCaps * virQEMUCapsNew(void) { - virQEMUCapsPtr qemuCaps; + virQEMUCaps *qemuCaps; if (virQEMUCapsInitialize() < 0) return NULL; @@ -1834,10 +1831,10 @@ virQEMUCapsNew(void) } -virQEMUCapsPtr +virQEMUCaps * virQEMUCapsNewBinary(const char *binary) { - virQEMUCapsPtr qemuCaps = virQEMUCapsNew(); + virQEMUCaps *qemuCaps = virQEMUCapsNew(); if (qemuCaps) qemuCaps->binary = g_strdup(binary); @@ -1847,8 +1844,8 @@ virQEMUCapsNewBinary(const char *binary) static int -virQEMUCapsHostCPUDataCopy(virQEMUCapsHostCPUDataPtr dst, - virQEMUCapsHostCPUDataPtr src) +virQEMUCapsHostCPUDataCopy(virQEMUCapsHostCPUData *dst, + virQEMUCapsHostCPUData *src) { if (src->info && !(dst->info = qemuMonitorCPUModelInfoCopy(src->info))) @@ -1871,7 +1868,7 @@ virQEMUCapsHostCPUDataCopy(virQEMUCapsHostCPUDataPtr dst, static void -virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUDataPtr cpuData) +virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUData *cpuData) { qemuMonitorCPUModelInfoFree(cpuData->info); virCPUDefFree(cpuData->reported); @@ -1883,8 +1880,8 @@ virQEMUCapsHostCPUDataClear(virQEMUCapsHostCPUDataPtr cpuData) static int -virQEMUCapsSEVInfoCopy(virSEVCapabilityPtr *dst, - virSEVCapabilityPtr src) +virQEMUCapsSEVInfoCopy(virSEVCapability **dst, + virSEVCapability *src) { g_autoptr(virSEVCapability) tmp = NULL; @@ -1902,8 +1899,8 @@ virQEMUCapsSEVInfoCopy(virSEVCapabilityPtr *dst, static void -virQEMUCapsAccelCopyMachineTypes(virQEMUCapsAccelPtr dst, - virQEMUCapsAccelPtr src) +virQEMUCapsAccelCopyMachineTypes(virQEMUCapsAccel *dst, + virQEMUCapsAccel *src) { size_t i; @@ -1925,8 +1922,8 @@ virQEMUCapsAccelCopyMachineTypes(virQEMUCapsAccelPtr dst, static int -virQEMUCapsAccelCopy(virQEMUCapsAccelPtr dst, - virQEMUCapsAccelPtr src) +virQEMUCapsAccelCopy(virQEMUCapsAccel *dst, + virQEMUCapsAccel *src) { virQEMUCapsAccelCopyMachineTypes(dst, src); @@ -1939,9 +1936,9 @@ virQEMUCapsAccelCopy(virQEMUCapsAccelPtr dst, } -virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps) +virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps) { - virQEMUCapsPtr ret = virQEMUCapsNewBinary(qemuCaps->binary); + virQEMUCaps *ret = virQEMUCapsNewBinary(qemuCaps->binary); size_t i; if (!ret) @@ -1989,7 +1986,7 @@ virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps) static void -virQEMUCapsAccelClear(virQEMUCapsAccelPtr caps) +virQEMUCapsAccelClear(virQEMUCapsAccel *caps) { size_t i; @@ -2008,7 +2005,7 @@ virQEMUCapsAccelClear(virQEMUCapsAccelPtr caps) void virQEMUCapsDispose(void *obj) { - virQEMUCapsPtr qemuCaps = obj; + virQEMUCaps *qemuCaps = obj; virBitmapFree(qemuCaps->flags); @@ -2026,7 +2023,7 @@ void virQEMUCapsDispose(void *obj) } void -virQEMUCapsSet(virQEMUCapsPtr qemuCaps, +virQEMUCapsSet(virQEMUCaps *qemuCaps, virQEMUCapsFlags flag) { ignore_value(virBitmapSetBit(qemuCaps->flags, flag)); @@ -2034,7 +2031,7 @@ virQEMUCapsSet(virQEMUCapsPtr qemuCaps, void -virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...) +virQEMUCapsSetList(virQEMUCaps *qemuCaps, ...) { va_list list; int flag; @@ -2047,7 +2044,7 @@ virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...) void -virQEMUCapsClear(virQEMUCapsPtr qemuCaps, +virQEMUCapsClear(virQEMUCaps *qemuCaps, virQEMUCapsFlags flag) { ignore_value(virBitmapClearBit(qemuCaps->flags, flag)); @@ -2055,14 +2052,14 @@ virQEMUCapsClear(virQEMUCapsPtr qemuCaps, bool -virQEMUCapsGet(virQEMUCapsPtr qemuCaps, +virQEMUCapsGet(virQEMUCaps *qemuCaps, virQEMUCapsFlags flag) { return qemuCaps && virBitmapIsBitSet(qemuCaps->flags, flag); } -bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsHasPCIMultiBus(virQEMUCaps *qemuCaps, const virDomainDef *def) { /* x86_64 and i686 support PCI-multibus on all machine types @@ -2126,46 +2123,46 @@ bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCaps, } -const char *virQEMUCapsGetBinary(virQEMUCapsPtr qemuCaps) +const char *virQEMUCapsGetBinary(virQEMUCaps *qemuCaps) { return qemuCaps->binary; } void -virQEMUCapsSetArch(virQEMUCapsPtr qemuCaps, +virQEMUCapsSetArch(virQEMUCaps *qemuCaps, virArch arch) { qemuCaps->arch = arch; } -virArch virQEMUCapsGetArch(virQEMUCapsPtr qemuCaps) +virArch virQEMUCapsGetArch(virQEMUCaps *qemuCaps) { return qemuCaps->arch; } -unsigned int virQEMUCapsGetVersion(virQEMUCapsPtr qemuCaps) +unsigned int virQEMUCapsGetVersion(virQEMUCaps *qemuCaps) { return qemuCaps->version; } -unsigned int virQEMUCapsGetKVMVersion(virQEMUCapsPtr qemuCaps) +unsigned int virQEMUCapsGetKVMVersion(virQEMUCaps *qemuCaps) { return qemuCaps->kvmVersion; } -const char *virQEMUCapsGetPackage(virQEMUCapsPtr qemuCaps) +const char *virQEMUCapsGetPackage(virQEMUCaps *qemuCaps) { return qemuCaps->package; } int -virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, +virQEMUCapsAddCPUDefinitions(virQEMUCaps *qemuCaps, virDomainVirtType type, const char **name, size_t count, @@ -2173,8 +2170,8 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, { size_t i; size_t start; - virQEMUCapsAccelPtr accel = virQEMUCapsGetAccel(qemuCaps, type); - qemuMonitorCPUDefsPtr defs = accel->cpuModels; + virQEMUCapsAccel *accel = virQEMUCapsGetAccel(qemuCaps, type); + qemuMonitorCPUDefs *defs = accel->cpuModels; if (defs) { start = defs->ncpus; @@ -2190,7 +2187,7 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, } for (i = 0; i < count; i++) { - qemuMonitorCPUDefInfoPtr cpu = defs->cpus + start + i; + qemuMonitorCPUDefInfo *cpu = defs->cpus + start + i; cpu->usable = usable; cpu->name = g_strdup(name[i]); @@ -2200,8 +2197,8 @@ virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, } -static virDomainCapsCPUModelsPtr -virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs, +static virDomainCapsCPUModels * +virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefs *defs, const char **modelAllowed, const char **modelForbidden) { @@ -2212,7 +2209,7 @@ virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs, return NULL; for (i = 0; i < defs->ncpus; i++) { - qemuMonitorCPUDefInfoPtr cpu = defs->cpus + i; + qemuMonitorCPUDefInfo *cpu = defs->cpus + i; if (modelAllowed && !g_strv_contains(modelAllowed, cpu->name)) continue; @@ -2229,13 +2226,13 @@ virQEMUCapsCPUDefsToModels(qemuMonitorCPUDefsPtr defs, } -virDomainCapsCPUModelsPtr -virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps, +virDomainCapsCPUModels * +virQEMUCapsGetCPUModels(virQEMUCaps *qemuCaps, virDomainVirtType type, const char **modelAllowed, const char **modelForbidden) { - qemuMonitorCPUDefsPtr defs; + qemuMonitorCPUDefs *defs; if (!(defs = virQEMUCapsGetAccel(qemuCaps, type)->cpuModels)) return NULL; @@ -2244,12 +2241,12 @@ virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps, } -virCPUDefPtr -virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps, +virCPUDef * +virQEMUCapsGetHostModel(virQEMUCaps *qemuCaps, virDomainVirtType type, virQEMUCapsHostCPUType cpuType) { - virQEMUCapsHostCPUDataPtr cpuData; + virQEMUCapsHostCPUData *cpuData; cpuData = &virQEMUCapsGetAccel(qemuCaps, type)->hostCPU; switch (cpuType) { @@ -2270,13 +2267,13 @@ virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps, static void -virQEMUCapsSetHostModel(virQEMUCapsPtr qemuCaps, +virQEMUCapsSetHostModel(virQEMUCaps *qemuCaps, virDomainVirtType type, - virCPUDefPtr reported, - virCPUDefPtr migratable, - virCPUDefPtr full) + virCPUDef *reported, + virCPUDef *migratable, + virCPUDef *full) { - virQEMUCapsHostCPUDataPtr cpuData; + virQEMUCapsHostCPUData *cpuData; cpuData = &virQEMUCapsGetAccel(qemuCaps, type)->hostCPU; cpuData->reported = reported; @@ -2286,7 +2283,7 @@ virQEMUCapsSetHostModel(virQEMUCapsPtr qemuCaps, bool -virQEMUCapsIsArchSupported(virQEMUCapsPtr qemuCaps, +virQEMUCapsIsArchSupported(virQEMUCaps *qemuCaps, virArch arch) { if (arch == qemuCaps->arch) @@ -2309,7 +2306,7 @@ virQEMUCapsIsArchSupported(virQEMUCapsPtr qemuCaps, bool -virQEMUCapsIsVirtTypeSupported(virQEMUCapsPtr qemuCaps, +virQEMUCapsIsVirtTypeSupported(virQEMUCaps *qemuCaps, virDomainVirtType virtType) { if (virtType == VIR_DOMAIN_VIRT_QEMU && @@ -2332,13 +2329,13 @@ const char *s390HostPassthroughOnlyMachines[] = { }; bool -virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps, +virQEMUCapsIsCPUModeSupported(virQEMUCaps *qemuCaps, virArch hostarch, virDomainVirtType type, virCPUMode mode, const char *machineType) { - qemuMonitorCPUDefsPtr cpus; + qemuMonitorCPUDefs *cpus; /* CPU models (except for "host") are not supported by QEMU for on s390 * KVM domains with old machine types regardless on QEMU version. */ @@ -2383,11 +2380,11 @@ virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps, * present @name is returned. */ const char * -virQEMUCapsGetCanonicalMachine(virQEMUCapsPtr qemuCaps, +virQEMUCapsGetCanonicalMachine(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name) { - virQEMUCapsAccelPtr accel; + virQEMUCapsAccel *accel; size_t i; if (!name || !qemuCaps) @@ -2407,11 +2404,11 @@ virQEMUCapsGetCanonicalMachine(virQEMUCapsPtr qemuCaps, int -virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCaps, +virQEMUCapsGetMachineMaxCpus(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name) { - virQEMUCapsAccelPtr accel; + virQEMUCapsAccel *accel; size_t i; if (!name) @@ -2431,11 +2428,11 @@ virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCaps, bool -virQEMUCapsGetMachineHotplugCpus(virQEMUCapsPtr qemuCaps, +virQEMUCapsGetMachineHotplugCpus(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name) { - virQEMUCapsAccelPtr accel; + virQEMUCapsAccel *accel; size_t i; accel = virQEMUCapsGetAccel(qemuCaps, virtType); @@ -2450,12 +2447,12 @@ virQEMUCapsGetMachineHotplugCpus(virQEMUCapsPtr qemuCaps, const char * -virQEMUCapsGetMachineDefaultCPU(virQEMUCapsPtr qemuCaps, +virQEMUCapsGetMachineDefaultCPU(virQEMUCaps *qemuCaps, const char *name, virDomainVirtType type) { - virQEMUCapsAccelPtr accel = virQEMUCapsGetAccel(qemuCaps, type); - qemuMonitorCPUDefsPtr defs = accel->cpuModels; + virQEMUCapsAccel *accel = virQEMUCapsGetAccel(qemuCaps, type); + qemuMonitorCPUDefs *defs = accel->cpuModels; const char *cpuType = NULL; size_t i; @@ -2482,12 +2479,12 @@ virQEMUCapsGetMachineDefaultCPU(virQEMUCapsPtr qemuCaps, bool -virQEMUCapsIsCPUDeprecated(virQEMUCapsPtr qemuCaps, +virQEMUCapsIsCPUDeprecated(virQEMUCaps *qemuCaps, virDomainVirtType type, const char *model) { - virQEMUCapsAccelPtr accel = virQEMUCapsGetAccel(qemuCaps, type); - qemuMonitorCPUDefsPtr defs = accel->cpuModels; + virQEMUCapsAccel *accel = virQEMUCapsGetAccel(qemuCaps, type); + qemuMonitorCPUDefs *defs = accel->cpuModels; size_t i; for (i = 0; i < defs->ncpus; i++) { @@ -2499,11 +2496,11 @@ virQEMUCapsIsCPUDeprecated(virQEMUCapsPtr qemuCaps, bool -virQEMUCapsIsMachineDeprecated(virQEMUCapsPtr qemuCaps, +virQEMUCapsIsMachineDeprecated(virQEMUCaps *qemuCaps, virDomainVirtType type, const char *machine) { - virQEMUCapsAccelPtr accel = virQEMUCapsGetAccel(qemuCaps, type); + virQEMUCapsAccel *accel = virQEMUCapsGetAccel(qemuCaps, type); size_t i; for (i = 0; i < accel->nmachineTypes; i++) { @@ -2515,11 +2512,11 @@ virQEMUCapsIsMachineDeprecated(virQEMUCapsPtr qemuCaps, bool -virQEMUCapsGetMachineNumaMemSupported(virQEMUCapsPtr qemuCaps, +virQEMUCapsGetMachineNumaMemSupported(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name) { - virQEMUCapsAccelPtr accel; + virQEMUCapsAccel *accel; size_t i; accel = virQEMUCapsGetAccel(qemuCaps, virtType); @@ -2534,11 +2531,11 @@ virQEMUCapsGetMachineNumaMemSupported(virQEMUCapsPtr qemuCaps, const char * -virQEMUCapsGetMachineDefaultRAMid(virQEMUCapsPtr qemuCaps, +virQEMUCapsGetMachineDefaultRAMid(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name) { - virQEMUCapsAccelPtr accel; + virQEMUCapsAccel *accel; size_t i; accel = virQEMUCapsGetAccel(qemuCaps, virtType); @@ -2565,7 +2562,7 @@ virQEMUCapsGetMachineDefaultRAMid(virQEMUCapsPtr qemuCaps, * after it's been called is a bug. */ void -virQEMUCapsSetGICCapabilities(virQEMUCapsPtr qemuCaps, +virQEMUCapsSetGICCapabilities(virQEMUCaps *qemuCaps, virGICCapability *capabilities, size_t ncapabilities) { @@ -2576,16 +2573,16 @@ virQEMUCapsSetGICCapabilities(virQEMUCapsPtr qemuCaps, } -virSEVCapabilityPtr -virQEMUCapsGetSEVCapabilities(virQEMUCapsPtr qemuCaps) +virSEVCapability * +virQEMUCapsGetSEVCapabilities(virQEMUCaps *qemuCaps) { return qemuCaps->sevCapabilities; } static int -virQEMUCapsProbeQMPCommands(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPCommands(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { char **commands = NULL; int ncommands; @@ -2610,8 +2607,8 @@ virQEMUCapsProbeQMPCommands(virQEMUCapsPtr qemuCaps, static int -virQEMUCapsProbeQMPEvents(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPEvents(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { char **events = NULL; int nevents; @@ -2634,8 +2631,8 @@ virQEMUCapsProbeQMPEvents(virQEMUCapsPtr qemuCaps, static int -virQEMUCapsProbeQMPObjectTypes(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPObjectTypes(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { int nvalues; char **values; @@ -2653,8 +2650,8 @@ virQEMUCapsProbeQMPObjectTypes(virQEMUCapsPtr qemuCaps, static int -virQEMUCapsProbeQMPDeviceProperties(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPDeviceProperties(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { size_t i; @@ -2671,7 +2668,7 @@ virQEMUCapsProbeQMPDeviceProperties(virQEMUCapsPtr qemuCaps, return -1; for (j = 0; j < device->nprops; j++) { - virJSONValuePtr entry = virHashLookup(qemuprops, device->props[j].value); + virJSONValue *entry = virHashLookup(qemuprops, device->props[j].value); if (!entry) continue; @@ -2689,8 +2686,8 @@ virQEMUCapsProbeQMPDeviceProperties(virQEMUCapsPtr qemuCaps, static int -virQEMUCapsProbeQMPObjectProperties(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPObjectProperties(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { size_t i; @@ -2780,7 +2777,7 @@ G_STATIC_ASSERT(G_N_ELEMENTS(preferredMachines) == VIR_ARCH_LAST); void -virQEMUCapsAddMachine(virQEMUCapsPtr qemuCaps, +virQEMUCapsAddMachine(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name, const char *alias, @@ -2792,8 +2789,8 @@ virQEMUCapsAddMachine(virQEMUCapsPtr qemuCaps, const char *defaultRAMid, bool deprecated) { - virQEMUCapsAccelPtr accel = virQEMUCapsGetAccel(qemuCaps, virtType); - virQEMUCapsMachineTypePtr mach; + virQEMUCapsAccel *accel = virQEMUCapsGetAccel(qemuCaps, virtType); + virQEMUCapsMachineType *mach; accel->machineTypes = g_renew(virQEMUCapsMachineType, accel->machineTypes, @@ -2825,7 +2822,7 @@ virQEMUCapsAddMachine(virQEMUCapsPtr qemuCaps, * into the list. */ bool -virQEMUCapsHasMachines(virQEMUCapsPtr qemuCaps) +virQEMUCapsHasMachines(virQEMUCaps *qemuCaps) { return !!qemuCaps->kvm.nmachineTypes || !!qemuCaps->tcg.nmachineTypes; @@ -2833,17 +2830,17 @@ virQEMUCapsHasMachines(virQEMUCapsPtr qemuCaps) static int -virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCaps, +virQEMUCapsProbeQMPMachineTypes(virQEMUCaps *qemuCaps, virDomainVirtType virtType, - qemuMonitorPtr mon) + qemuMonitor *mon) { - qemuMonitorMachineInfoPtr *machines = NULL; + qemuMonitorMachineInfo **machines = NULL; int nmachines = 0; size_t i; ssize_t defIdx = -1; ssize_t preferredIdx = -1; const char *preferredMachine = preferredMachines[qemuCaps->arch]; - virQEMUCapsAccelPtr accel = virQEMUCapsGetAccel(qemuCaps, virtType); + virQEMUCapsAccel *accel = virQEMUCapsGetAccel(qemuCaps, virtType); if ((nmachines = qemuMonitorGetMachines(mon, &machines)) < 0) return -1; @@ -2896,11 +2893,11 @@ virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCaps, bool -virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps, +virQEMUCapsIsMachineSupported(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *canonical_machine) { - virQEMUCapsAccelPtr accel = virQEMUCapsGetAccel(qemuCaps, virtType); + virQEMUCapsAccel *accel = virQEMUCapsGetAccel(qemuCaps, virtType); size_t i; for (i = 0; i < accel->nmachineTypes; i++) { @@ -2912,9 +2909,9 @@ virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps, static int -virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemuCaps, +virQEMUCapsProbeQMPMachineProps(virQEMUCaps *qemuCaps, virDomainVirtType virtType, - qemuMonitorPtr mon) + qemuMonitor *mon) { char **values; int nvalues; @@ -2951,9 +2948,9 @@ virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemuCaps, static int -virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, +virQEMUCapsFetchCPUDefinitions(qemuMonitor *mon, virArch arch, - qemuMonitorCPUDefsPtr *cpuDefs) + qemuMonitorCPUDefs **cpuDefs) { g_autoptr(qemuMonitorCPUDefs) defs = NULL; size_t i; @@ -2992,9 +2989,9 @@ virQEMUCapsFetchCPUDefinitions(qemuMonitorPtr mon, int -virQEMUCapsFetchCPUModels(qemuMonitorPtr mon, +virQEMUCapsFetchCPUModels(qemuMonitor *mon, virArch arch, - virDomainCapsCPUModelsPtr *cpuModels) + virDomainCapsCPUModels **cpuModels) { g_autoptr(qemuMonitorCPUDefs) defs = NULL; @@ -3011,11 +3008,11 @@ virQEMUCapsFetchCPUModels(qemuMonitorPtr mon, static int -virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemuCaps, - virQEMUCapsAccelPtr accel, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPCPUDefinitions(virQEMUCaps *qemuCaps, + virQEMUCapsAccel *accel, + qemuMonitor *mon) { - qemuMonitorCPUDefsPtr defs; + qemuMonitorCPUDefs *defs; size_t i; if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_DEFINITIONS)) @@ -3037,24 +3034,24 @@ virQEMUCapsProbeQMPCPUDefinitions(virQEMUCapsPtr qemuCaps, int -virQEMUCapsProbeCPUDefinitionsTest(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeCPUDefinitionsTest(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { return virQEMUCapsProbeQMPCPUDefinitions(qemuCaps, &qemuCaps->kvm, mon); } static int -virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps, - virQEMUCapsAccelPtr accel, - qemuMonitorPtr mon, +virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps, + virQEMUCapsAccel *accel, + qemuMonitor *mon, virDomainVirtType virtType) { const char *model = virtType == VIR_DOMAIN_VIRT_KVM ? "host" : "max"; - qemuMonitorCPUModelInfoPtr modelInfo = NULL; - qemuMonitorCPUModelInfoPtr nonMigratable = NULL; + qemuMonitorCPUModelInfo *modelInfo = NULL; + qemuMonitorCPUModelInfo *nonMigratable = NULL; GHashTable *hash = NULL; - virCPUDefPtr cpu; + virCPUDef *cpu; qemuMonitorCPUModelExpansionType type; bool fail_no_props = true; int ret = -1; @@ -3098,8 +3095,8 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps, goto cleanup; if (nonMigratable) { - qemuMonitorCPUPropertyPtr prop; - qemuMonitorCPUPropertyPtr nmProp; + qemuMonitorCPUProperty *prop; + qemuMonitorCPUProperty *nmProp; size_t i; if (!(hash = virHashNew(NULL))) @@ -3150,12 +3147,12 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCapsPtr qemuCaps, * 1 when @features is filled in, but migratability info is not available. */ int -virQEMUCapsGetCPUFeatures(virQEMUCapsPtr qemuCaps, +virQEMUCapsGetCPUFeatures(virQEMUCaps *qemuCaps, virDomainVirtType virtType, bool migratable, char ***features) { - qemuMonitorCPUModelInfoPtr modelInfo; + qemuMonitorCPUModelInfo *modelInfo; char **list; size_t i; size_t n; @@ -3171,7 +3168,7 @@ virQEMUCapsGetCPUFeatures(virQEMUCapsPtr qemuCaps, n = 0; for (i = 0; i < modelInfo->nprops; i++) { - qemuMonitorCPUPropertyPtr prop = modelInfo->props + i; + qemuMonitorCPUProperty *prop = modelInfo->props + i; if (migratable && prop->migratable == VIR_TRISTATE_BOOL_NO) continue; @@ -3222,8 +3219,8 @@ const struct tpmTypeToCaps virQEMUCapsTPMModelsToCaps[] = { }; static int -virQEMUCapsProbeQMPTPM(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPTPM(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { int nentries; size_t i; @@ -3261,8 +3258,8 @@ virQEMUCapsProbeQMPTPM(virQEMUCapsPtr qemuCaps, static int -virQEMUCapsProbeQMPKVMState(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPKVMState(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { bool enabled = false; bool present = false; @@ -3323,8 +3320,8 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = { }; static int -virQEMUCapsProbeQMPCommandLine(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPCommandLine(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { g_autoptr(GHashTable) options = NULL; size_t i; @@ -3333,7 +3330,7 @@ virQEMUCapsProbeQMPCommandLine(virQEMUCapsPtr qemuCaps, return -1; for (i = 0; i < G_N_ELEMENTS(virQEMUCapsCommandLine); i++) { - virJSONValuePtr option = g_hash_table_lookup(options, virQEMUCapsCommandLine[i].option); + virJSONValue *option = g_hash_table_lookup(options, virQEMUCapsCommandLine[i].option); size_t j; if (!option) @@ -3346,7 +3343,7 @@ virQEMUCapsProbeQMPCommandLine(virQEMUCapsPtr qemuCaps, } for (j = 0; j < virJSONValueArraySize(option); j++) { - virJSONValuePtr param = virJSONValueArrayGet(option, j); + virJSONValue *param = virJSONValueArrayGet(option, j); const char *paramname = virJSONValueObjectGetString(param, "name"); if (STREQ_NULLABLE(virQEMUCapsCommandLine[i].param, paramname)) @@ -3358,8 +3355,8 @@ virQEMUCapsProbeQMPCommandLine(virQEMUCapsPtr qemuCaps, } static int -virQEMUCapsProbeQMPMigrationCapabilities(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPMigrationCapabilities(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { char **caps = NULL; int ncaps; @@ -3387,8 +3384,8 @@ virQEMUCapsProbeQMPMigrationCapabilities(virQEMUCapsPtr qemuCaps, * Returns: 0 on success, <0 on failure */ static int -virQEMUCapsProbeQMPGICCapabilities(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPGICCapabilities(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { virGICCapability *caps = NULL; int ncaps; @@ -3408,8 +3405,8 @@ virQEMUCapsProbeQMPGICCapabilities(virQEMUCapsPtr qemuCaps, static int -virQEMUCapsProbeQMPSEVCapabilities(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPSEVCapabilities(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { int rc = -1; virSEVCapability *caps = NULL; @@ -3459,7 +3456,6 @@ virQEMUCapsCPUFilterFeatures(const char *name, typedef struct _virQEMUCapsCPUFeatureTranslationTable virQEMUCapsCPUFeatureTranslationTable; -typedef virQEMUCapsCPUFeatureTranslationTable *virQEMUCapsCPUFeatureTranslationTablePtr; struct _virQEMUCapsCPUFeatureTranslationTable { const char *libvirt; const char *qemu; @@ -3482,12 +3478,12 @@ virQEMUCapsCPUFeatureTranslationTable virQEMUCapsCPUFeaturesX86[] = { static const char * -virQEMUCapsCPUFeatureTranslate(virQEMUCapsPtr qemuCaps, +virQEMUCapsCPUFeatureTranslate(virQEMUCaps *qemuCaps, const char *feature, bool reversed) { - virQEMUCapsCPUFeatureTranslationTablePtr table = NULL; - virQEMUCapsCPUFeatureTranslationTablePtr entry; + virQEMUCapsCPUFeatureTranslationTable *table = NULL; + virQEMUCapsCPUFeatureTranslationTable *entry; if (ARCH_IS_X86(qemuCaps->arch)) table = virQEMUCapsCPUFeaturesX86; @@ -3509,7 +3505,7 @@ virQEMUCapsCPUFeatureTranslate(virQEMUCapsPtr qemuCaps, const char * -virQEMUCapsCPUFeatureToQEMU(virQEMUCapsPtr qemuCaps, +virQEMUCapsCPUFeatureToQEMU(virQEMUCaps *qemuCaps, const char *feature) { return virQEMUCapsCPUFeatureTranslate(qemuCaps, feature, false); @@ -3517,7 +3513,7 @@ virQEMUCapsCPUFeatureToQEMU(virQEMUCapsPtr qemuCaps, const char * -virQEMUCapsCPUFeatureFromQEMU(virQEMUCapsPtr qemuCaps, +virQEMUCapsCPUFeatureFromQEMU(virQEMUCaps *qemuCaps, const char *feature) { return virQEMUCapsCPUFeatureTranslate(qemuCaps, feature, true); @@ -3526,15 +3522,15 @@ virQEMUCapsCPUFeatureFromQEMU(virQEMUCapsPtr qemuCaps, /** * Returns 0 when host CPU model provided by QEMU was filled in qemuCaps, - * 1 when the caller should fall back to using virCapsPtr->host.cpu, + * 1 when the caller should fall back to using virCaps *->host.cpu, * 2 when cpu model info is not supported for this configuration, * -1 on error. */ static int -virQEMUCapsInitCPUModelS390(virQEMUCapsPtr qemuCaps, +virQEMUCapsInitCPUModelS390(virQEMUCaps *qemuCaps, virDomainVirtType type, - qemuMonitorCPUModelInfoPtr modelInfo, - virCPUDefPtr cpu, + qemuMonitorCPUModelInfo *modelInfo, + virCPUDef *cpu, bool migratable) { size_t i; @@ -3557,8 +3553,8 @@ virQEMUCapsInitCPUModelS390(virQEMUCapsPtr qemuCaps, cpu->nfeatures = 0; for (i = 0; i < modelInfo->nprops; i++) { - virCPUFeatureDefPtr feature = cpu->features + cpu->nfeatures; - qemuMonitorCPUPropertyPtr prop = modelInfo->props + i; + virCPUFeatureDef *feature = cpu->features + cpu->nfeatures; + qemuMonitorCPUProperty *prop = modelInfo->props + i; const char *name = virQEMUCapsCPUFeatureFromQEMU(qemuCaps, prop->name); if (prop->type != QEMU_MONITOR_CPU_PROPERTY_BOOLEAN) @@ -3578,23 +3574,23 @@ virQEMUCapsInitCPUModelS390(virQEMUCapsPtr qemuCaps, } -virCPUDataPtr -virQEMUCapsGetCPUModelX86Data(virQEMUCapsPtr qemuCaps, - qemuMonitorCPUModelInfoPtr model, +virCPUData * +virQEMUCapsGetCPUModelX86Data(virQEMUCaps *qemuCaps, + qemuMonitorCPUModelInfo *model, bool migratable) { unsigned long long sigFamily = 0; unsigned long long sigModel = 0; unsigned long long sigStepping = 0; - virCPUDataPtr data = NULL; - virCPUDataPtr ret = NULL; + virCPUData *data = NULL; + virCPUData *ret = NULL; size_t i; if (!(data = virCPUDataNew(VIR_ARCH_X86_64))) goto cleanup; for (i = 0; i < model->nprops; i++) { - qemuMonitorCPUPropertyPtr prop = model->props + i; + qemuMonitorCPUProperty *prop = model->props + i; const char *name = virQEMUCapsCPUFeatureFromQEMU(qemuCaps, prop->name); switch (prop->type) { @@ -3641,18 +3637,18 @@ virQEMUCapsGetCPUModelX86Data(virQEMUCapsPtr qemuCaps, /** * Returns 0 when host CPU model provided by QEMU was filled in qemuCaps, - * 1 when the caller should fall back to using virCapsPtr->host.cpu, + * 1 when the caller should fall back to using virCaps *->host.cpu, * -1 on error. */ static int -virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, +virQEMUCapsInitCPUModelX86(virQEMUCaps *qemuCaps, virDomainVirtType type, - qemuMonitorCPUModelInfoPtr model, - virCPUDefPtr cpu, + qemuMonitorCPUModelInfo *model, + virCPUDef *cpu, bool migratable) { g_autoptr(virDomainCapsCPUModels) cpuModels = NULL; - virCPUDataPtr data = NULL; + virCPUData *data = NULL; int ret = -1; if (!model) @@ -3681,12 +3677,12 @@ virQEMUCapsInitCPUModelX86(virQEMUCapsPtr qemuCaps, * -1 on error. */ int -virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, +virQEMUCapsInitCPUModel(virQEMUCaps *qemuCaps, virDomainVirtType type, - virCPUDefPtr cpu, + virCPUDef *cpu, bool migratable) { - qemuMonitorCPUModelInfoPtr modelInfo = virQEMUCapsGetCPUModelInfo(qemuCaps, type); + qemuMonitorCPUModelInfo *modelInfo = virQEMUCapsGetCPUModelInfo(qemuCaps, type); int ret = 1; if (migratable && modelInfo && !modelInfo->migratability) @@ -3709,10 +3705,10 @@ virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, } -static virCPUDefPtr +static virCPUDef * virQEMUCapsNewHostCPUModel(void) { - virCPUDefPtr cpu = virCPUDefNew(); + virCPUDef *cpu = virCPUDefNew(); cpu->type = VIR_CPU_TYPE_GUEST; cpu->mode = VIR_CPU_MODE_CUSTOM; @@ -3724,15 +3720,15 @@ virQEMUCapsNewHostCPUModel(void) void -virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, +virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps, virArch hostArch, virDomainVirtType type) { - virCPUDefPtr cpu = NULL; - virCPUDefPtr cpuExpanded = NULL; - virCPUDefPtr migCPU = NULL; - virCPUDefPtr hostCPU = NULL; - virCPUDefPtr fullCPU = NULL; + virCPUDef *cpu = NULL; + virCPUDef *cpuExpanded = NULL; + virCPUDef *migCPU = NULL; + virCPUDef *hostCPU = NULL; + virCPUDef *fullCPU = NULL; size_t i; int rc; @@ -3823,8 +3819,8 @@ virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, } -qemuMonitorCPUModelInfoPtr -virQEMUCapsGetCPUModelInfo(virQEMUCapsPtr qemuCaps, +qemuMonitorCPUModelInfo * +virQEMUCapsGetCPUModelInfo(virQEMUCaps *qemuCaps, virDomainVirtType type) { return virQEMUCapsGetAccel(qemuCaps, type)->hostCPU.info; @@ -3832,16 +3828,16 @@ virQEMUCapsGetCPUModelInfo(virQEMUCapsPtr qemuCaps, void -virQEMUCapsSetCPUModelInfo(virQEMUCapsPtr qemuCaps, +virQEMUCapsSetCPUModelInfo(virQEMUCaps *qemuCaps, virDomainVirtType type, - qemuMonitorCPUModelInfoPtr modelInfo) + qemuMonitorCPUModelInfo *modelInfo) { virQEMUCapsGetAccel(qemuCaps, type)->hostCPU.info = modelInfo; } static int -virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccelPtr caps, +virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *caps, xmlXPathContextPtr ctxt, const char *typeStr) { @@ -3849,7 +3845,7 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccelPtr caps, xmlNodePtr hostCPUNode; xmlNodePtr *nodes = NULL; VIR_XPATH_NODE_AUTORESTORE(ctxt) - qemuMonitorCPUModelInfoPtr hostCPU = NULL; + qemuMonitorCPUModelInfo *hostCPU = NULL; g_autofree char *xpath = g_strdup_printf("./hostCPU[@type='%s']", typeStr); int ret = -1; size_t i; @@ -3886,7 +3882,7 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccelPtr caps, hostCPU->nprops = n; for (i = 0; i < n; i++) { - qemuMonitorCPUPropertyPtr prop = hostCPU->props + i; + qemuMonitorCPUProperty *prop = hostCPU->props + i; ctxt->node = nodes[i]; @@ -3966,7 +3962,7 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccelPtr caps, static int -virQEMUCapsLoadCPUModels(virQEMUCapsAccelPtr caps, +virQEMUCapsLoadCPUModels(virQEMUCapsAccel *caps, xmlXPathContextPtr ctxt, const char *typeStr) { @@ -3990,7 +3986,7 @@ virQEMUCapsLoadCPUModels(virQEMUCapsAccelPtr caps, return -1; for (i = 0; i < n; i++) { - qemuMonitorCPUDefInfoPtr cpu = defs->cpus + i; + qemuMonitorCPUDefInfo *cpu = defs->cpus + i; int usable = VIR_DOMCAPS_CPU_USABLE_UNKNOWN; g_autofree char * strUsable = NULL; g_autofree xmlNodePtr * blockerNodes = NULL; @@ -4052,7 +4048,7 @@ virQEMUCapsLoadCPUModels(virQEMUCapsAccelPtr caps, static int -virQEMUCapsLoadMachines(virQEMUCapsAccelPtr caps, +virQEMUCapsLoadMachines(virQEMUCapsAccel *caps, xmlXPathContextPtr ctxt, const char *typeStr) { @@ -4121,11 +4117,11 @@ virQEMUCapsLoadMachines(virQEMUCapsAccelPtr caps, static int -virQEMUCapsLoadAccel(virQEMUCapsPtr qemuCaps, +virQEMUCapsLoadAccel(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt, virDomainVirtType type) { - virQEMUCapsAccelPtr caps = virQEMUCapsGetAccel(qemuCaps, type); + virQEMUCapsAccel *caps = virQEMUCapsGetAccel(qemuCaps, type); const char *typeStr = type == VIR_DOMAIN_VIRT_KVM ? "kvm" : "tcg"; if (virQEMUCapsLoadHostCPUModelInfo(caps, ctxt, typeStr) < 0) @@ -4155,13 +4151,12 @@ struct _virQEMUCapsCachePriv { time_t kvmCtime; }; typedef struct _virQEMUCapsCachePriv virQEMUCapsCachePriv; -typedef virQEMUCapsCachePriv *virQEMUCapsCachePrivPtr; static void virQEMUCapsCachePrivFree(void *privData) { - virQEMUCapsCachePrivPtr priv = privData; + virQEMUCapsCachePriv *priv = privData; g_free(priv->libDir); g_free(priv->kernelVersion); @@ -4171,7 +4166,7 @@ virQEMUCapsCachePrivFree(void *privData) static int -virQEMUCapsParseSEVInfo(virQEMUCapsPtr qemuCaps, xmlXPathContextPtr ctxt) +virQEMUCapsParseSEVInfo(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt) { g_autoptr(virSEVCapability) sev = NULL; @@ -4243,7 +4238,7 @@ virQEMUCapsParseSEVInfo(virQEMUCapsPtr qemuCaps, xmlXPathContextPtr ctxt) */ int virQEMUCapsLoadCache(virArch hostArch, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, const char *filename, bool skipInvalidation) { @@ -4406,7 +4401,7 @@ virQEMUCapsLoadCache(virArch hostArch, qemuCaps->gicCapabilities = g_new0(virGICCapability, n); for (i = 0; i < n; i++) { - virGICCapabilityPtr cap = &qemuCaps->gicCapabilities[i]; + virGICCapability *cap = &qemuCaps->gicCapabilities[i]; if (!(str = virXMLPropString(nodes[i], "version"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -4484,11 +4479,11 @@ virQEMUCapsLoadCache(virArch hostArch, static void -virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsAccelPtr caps, - virBufferPtr buf, +virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsAccel *caps, + virBuffer *buf, const char *typeStr) { - qemuMonitorCPUModelInfoPtr model = caps->hostCPU.info; + qemuMonitorCPUModelInfo *model = caps->hostCPU.info; size_t i; if (!model) @@ -4501,7 +4496,7 @@ virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsAccelPtr caps, virBufferAdjustIndent(buf, 2); for (i = 0; i < model->nprops; i++) { - qemuMonitorCPUPropertyPtr prop = model->props + i; + qemuMonitorCPUProperty *prop = model->props + i; virBufferAsprintf(buf, "name, @@ -4538,18 +4533,18 @@ virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsAccelPtr caps, static void -virQEMUCapsFormatCPUModels(virQEMUCapsAccelPtr caps, - virBufferPtr buf, +virQEMUCapsFormatCPUModels(virQEMUCapsAccel *caps, + virBuffer *buf, const char *typeStr) { - qemuMonitorCPUDefsPtr defs = caps->cpuModels; + qemuMonitorCPUDefs *defs = caps->cpuModels; size_t i; if (!defs) return; for (i = 0; i < defs->ncpus; i++) { - qemuMonitorCPUDefInfoPtr cpu = defs->cpus + i; + qemuMonitorCPUDefInfo *cpu = defs->cpus + i; virBufferAsprintf(buf, "name); @@ -4580,8 +4575,8 @@ virQEMUCapsFormatCPUModels(virQEMUCapsAccelPtr caps, static void -virQEMUCapsFormatMachines(virQEMUCapsAccelPtr caps, - virBufferPtr buf, +virQEMUCapsFormatMachines(virQEMUCapsAccel *caps, + virBuffer *buf, const char *typeStr) { size_t i; @@ -4612,11 +4607,11 @@ virQEMUCapsFormatMachines(virQEMUCapsAccelPtr caps, static void -virQEMUCapsFormatAccel(virQEMUCapsPtr qemuCaps, - virBufferPtr buf, +virQEMUCapsFormatAccel(virQEMUCaps *qemuCaps, + virBuffer *buf, virDomainVirtType type) { - virQEMUCapsAccelPtr caps = virQEMUCapsGetAccel(qemuCaps, type); + virQEMUCapsAccel *caps = virQEMUCapsGetAccel(qemuCaps, type); const char *typeStr = type == VIR_DOMAIN_VIRT_KVM ? "kvm" : "tcg"; virQEMUCapsFormatHostCPUModelInfo(caps, buf, typeStr); @@ -4627,9 +4622,9 @@ virQEMUCapsFormatAccel(virQEMUCapsPtr qemuCaps, static void -virQEMUCapsFormatSEVInfo(virQEMUCapsPtr qemuCaps, virBufferPtr buf) +virQEMUCapsFormatSEVInfo(virQEMUCaps *qemuCaps, virBuffer *buf) { - virSEVCapabilityPtr sev = virQEMUCapsGetSEVCapabilities(qemuCaps); + virSEVCapability *sev = virQEMUCapsGetSEVCapabilities(qemuCaps); virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); @@ -4645,7 +4640,7 @@ virQEMUCapsFormatSEVInfo(virQEMUCapsPtr qemuCaps, virBufferPtr buf) char * -virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps) +virQEMUCapsFormatCache(virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t i; @@ -4699,7 +4694,7 @@ virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps) virQEMUCapsFormatAccel(qemuCaps, &buf, VIR_DOMAIN_VIRT_QEMU); for (i = 0; i < qemuCaps->ngicCapabilities; i++) { - virGICCapabilityPtr cap; + virGICCapability *cap; bool kernel; bool emulated; @@ -4735,7 +4730,7 @@ virQEMUCapsSaveFile(void *data, const char *filename, void *privData G_GNUC_UNUSED) { - virQEMUCapsPtr qemuCaps = data; + virQEMUCaps *qemuCaps = data; char *xml = NULL; int ret = -1; @@ -4865,7 +4860,7 @@ virQEMUCapsKVMSupportsNesting(void) /* Determine whether '/dev/kvm' is usable as QEMU user:QEMU group. */ static bool -virQEMUCapsKVMUsable(virQEMUCapsCachePrivPtr priv) +virQEMUCapsKVMUsable(virQEMUCapsCachePriv *priv) { struct stat sb; static const char *kvm_device = "/dev/kvm"; @@ -4915,8 +4910,8 @@ static bool virQEMUCapsIsValid(void *data, void *privData) { - virQEMUCapsPtr qemuCaps = data; - virQEMUCapsCachePrivPtr priv = privData; + virQEMUCaps *qemuCaps = data; + virQEMUCapsCachePriv *priv = privData; bool kvmUsable; struct stat sb; bool kvmSupportsNesting; @@ -5055,8 +5050,8 @@ virQEMUCapsIsValid(void *data, * Returns: 0 on success, <0 on failure */ static int -virQEMUCapsInitQMPArch(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsInitQMPArch(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { g_autofree char *archstr = NULL; @@ -5080,7 +5075,7 @@ virQEMUCapsInitQMPArch(virQEMUCapsPtr qemuCaps, * Initialize @qemuCaps with basic architecture-dependent capabilities. */ void -virQEMUCapsInitQMPBasicArch(virQEMUCapsPtr qemuCaps) +virQEMUCapsInitQMPBasicArch(virQEMUCaps *qemuCaps) { switch (qemuCaps->arch) { case VIR_ARCH_I686: @@ -5145,7 +5140,7 @@ virQEMUCapsInitQMPBasicArch(virQEMUCapsPtr qemuCaps) * Add all QEMU capabilities based on version of QEMU. */ static void -virQEMUCapsInitQMPVersionCaps(virQEMUCapsPtr qemuCaps) +virQEMUCapsInitQMPVersionCaps(virQEMUCaps *qemuCaps) { if (qemuCaps->version >= 1006000) virQEMUCapsSet(qemuCaps, QEMU_CAPS_DEVICE_VIDEO_PRIMARY); @@ -5224,7 +5219,7 @@ virQEMUCapsInitQMPVersionCaps(virQEMUCapsPtr qemuCaps) * for libvirt to be able to drive it properly should be processed here. */ void -virQEMUCapsInitProcessCapsInterlock(virQEMUCapsPtr qemuCaps) +virQEMUCapsInitProcessCapsInterlock(virQEMUCaps *qemuCaps) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV)) virQEMUCapsClear(qemuCaps, QEMU_CAPS_BLOCKDEV_BACKUP); @@ -5260,7 +5255,7 @@ virQEMUCapsInitProcessCapsInterlock(virQEMUCapsPtr qemuCaps) * are detected. */ static void -virQEMUCapsInitProcessCaps(virQEMUCapsPtr qemuCaps) +virQEMUCapsInitProcessCaps(virQEMUCaps *qemuCaps) { /* 'intel-iommu' shows up as a device since 2.2.0, but can * not be used with -device until 2.7.0. Before that it @@ -5324,11 +5319,11 @@ virQEMUCapsInitProcessCaps(virQEMUCapsPtr qemuCaps) static int -virQEMUCapsProbeQMPSchemaCapabilities(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsProbeQMPSchemaCapabilities(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { struct virQEMUCapsStringFlags *entry; - virJSONValuePtr schemareply; + virJSONValue *schemareply; GHashTable *schema = NULL; size_t i; @@ -5366,7 +5361,7 @@ virQEMUCapsProbeQMPSchemaCapabilities(virQEMUCapsPtr qemuCaps, #define QEMU_MIN_MICRO 0 virDomainVirtType -virQEMUCapsGetVirtType(virQEMUCapsPtr qemuCaps) +virQEMUCapsGetVirtType(virQEMUCaps *qemuCaps) { virDomainVirtType type; if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_KVM)) @@ -5380,12 +5375,12 @@ virQEMUCapsGetVirtType(virQEMUCapsPtr qemuCaps) } int -virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsInitQMPMonitor(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { int major, minor, micro; g_autofree char *package = NULL; - virQEMUCapsAccelPtr accel; + virQEMUCapsAccel *accel; virDomainVirtType type; /* @mon is supposed to be locked by callee */ @@ -5466,10 +5461,10 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, int -virQEMUCapsInitQMPMonitorTCG(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon) +virQEMUCapsInitQMPMonitorTCG(virQEMUCaps *qemuCaps, + qemuMonitor *mon) { - virQEMUCapsAccelPtr accel = virQEMUCapsGetAccel(qemuCaps, VIR_DOMAIN_VIRT_QEMU); + virQEMUCapsAccel *accel = virQEMUCapsGetAccel(qemuCaps, VIR_DOMAIN_VIRT_QEMU); if (virQEMUCapsProbeQMPCPUDefinitions(qemuCaps, accel, mon) < 0) return -1; @@ -5505,7 +5500,7 @@ virQEMUCapsLogProbeFailure(const char *binary) static int -virQEMUCapsInitQMPSingle(virQEMUCapsPtr qemuCaps, +virQEMUCapsInitQMPSingle(virQEMUCaps *qemuCaps, const char *libDir, uid_t runUid, gid_t runGid, @@ -5535,7 +5530,7 @@ virQEMUCapsInitQMPSingle(virQEMUCapsPtr qemuCaps, static int -virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps, +virQEMUCapsInitQMP(virQEMUCaps *qemuCaps, const char *libDir, uid_t runUid, gid_t runGid) @@ -5557,7 +5552,7 @@ virQEMUCapsInitQMP(virQEMUCapsPtr qemuCaps, } -virQEMUCapsPtr +virQEMUCaps * virQEMUCapsNewForBinaryInternal(virArch hostArch, const char *binary, const char *libDir, @@ -5567,7 +5562,7 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, unsigned int microcodeVersion, const char *kernelVersion) { - virQEMUCapsPtr qemuCaps; + virQEMUCaps *qemuCaps; struct stat sb; if (!(qemuCaps = virQEMUCapsNewBinary(binary))) @@ -5632,7 +5627,7 @@ static void * virQEMUCapsNewData(const char *binary, void *privData) { - virQEMUCapsCachePrivPtr priv = privData; + virQEMUCapsCachePriv *priv = privData; return virQEMUCapsNewForBinaryInternal(priv->hostArch, binary, @@ -5651,8 +5646,8 @@ virQEMUCapsLoadFile(const char *filename, void *privData, bool *outdated) { - virQEMUCapsPtr qemuCaps = virQEMUCapsNewBinary(binary); - virQEMUCapsCachePrivPtr priv = privData; + virQEMUCaps *qemuCaps = virQEMUCapsNewBinary(binary); + virQEMUCapsCachePriv *priv = privData; int ret; if (!qemuCaps) @@ -5688,7 +5683,7 @@ static const struct virQEMUCapsMachineTypeFilter virQEMUCapsMachineFilter[] = { void -virQEMUCapsFilterByMachineType(virQEMUCapsPtr qemuCaps, +virQEMUCapsFilterByMachineType(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *machineType) { @@ -5722,15 +5717,15 @@ virFileCacheHandlers qemuCapsCacheHandlers = { }; -virFileCachePtr +virFileCache * virQEMUCapsCacheNew(const char *libDir, const char *cacheDir, uid_t runUid, gid_t runGid) { char *capsCacheDir = NULL; - virFileCachePtr cache = NULL; - virQEMUCapsCachePrivPtr priv = NULL; + virFileCache *cache = NULL; + virQEMUCapsCachePriv *priv = NULL; struct utsname uts; capsCacheDir = g_strdup_printf("%s/capabilities", cacheDir); @@ -5766,12 +5761,12 @@ virQEMUCapsCacheNew(const char *libDir, } -virQEMUCapsPtr -virQEMUCapsCacheLookup(virFileCachePtr cache, +virQEMUCaps * +virQEMUCapsCacheLookup(virFileCache *cache, const char *binary) { - virQEMUCapsCachePrivPtr priv = virFileCacheGetPriv(cache); - virQEMUCapsPtr ret = NULL; + virQEMUCapsCachePriv *priv = virFileCacheGetPriv(cache); + virQEMUCaps *ret = NULL; priv->microcodeVersion = virHostCPUGetMicrocodeVersion(priv->hostArch); @@ -5782,14 +5777,14 @@ virQEMUCapsCacheLookup(virFileCachePtr cache, } -virQEMUCapsPtr -virQEMUCapsCacheLookupCopy(virFileCachePtr cache, +virQEMUCaps * +virQEMUCapsCacheLookupCopy(virFileCache *cache, virDomainVirtType virtType, const char *binary, const char *machineType) { - virQEMUCapsPtr qemuCaps = virQEMUCapsCacheLookup(cache, binary); - virQEMUCapsPtr ret; + virQEMUCaps *qemuCaps = virQEMUCapsCacheLookup(cache, binary); + virQEMUCaps *ret; if (!qemuCaps) return NULL; @@ -5823,8 +5818,8 @@ virQEMUCapsCacheLookupCopy(virFileCachePtr cache, * * Returns QEMU capabilities matching the requirements, NULL on error. */ -virQEMUCapsPtr -virQEMUCapsCacheLookupDefault(virFileCachePtr cache, +virQEMUCaps * +virQEMUCapsCacheLookupDefault(virFileCache *cache, const char *binary, const char *archStr, const char *virttypeStr, @@ -5921,7 +5916,7 @@ virQEMUCapsCacheLookupDefault(virFileCachePtr cache, } bool -virQEMUCapsSupportsVmport(virQEMUCapsPtr qemuCaps, +virQEMUCapsSupportsVmport(virQEMUCaps *qemuCaps, const virDomainDef *def) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_VMPORT_OPT)) @@ -5938,10 +5933,10 @@ virQEMUCapsSupportsVmport(virQEMUCapsPtr qemuCaps, * Note that this may differ from QEMU's own default machine */ const char * -virQEMUCapsGetPreferredMachine(virQEMUCapsPtr qemuCaps, +virQEMUCapsGetPreferredMachine(virQEMUCaps *qemuCaps, virDomainVirtType virtType) { - virQEMUCapsAccelPtr accel = virQEMUCapsGetAccel(qemuCaps, virtType); + virQEMUCapsAccel *accel = virQEMUCapsGetAccel(qemuCaps, virtType); if (!accel->nmachineTypes) return NULL; @@ -5950,9 +5945,9 @@ virQEMUCapsGetPreferredMachine(virQEMUCapsPtr qemuCaps, static int -virQEMUCapsFillDomainLoaderCaps(virDomainCapsLoaderPtr capsLoader, +virQEMUCapsFillDomainLoaderCaps(virDomainCapsLoader *capsLoader, bool secure, - virFirmwarePtr *firmwares, + virFirmware **firmwares, size_t nfirmwares) { size_t i; @@ -6009,17 +6004,17 @@ virQEMUCapsFillDomainLoaderCaps(virDomainCapsLoaderPtr capsLoader, static int -virQEMUCapsFillDomainOSCaps(virDomainCapsOSPtr os, +virQEMUCapsFillDomainOSCaps(virDomainCapsOS *os, const char *machine, virArch arch, bool privileged, - virFirmwarePtr *firmwares, + virFirmware **firmwares, size_t nfirmwares) { - virDomainCapsLoaderPtr capsLoader = &os->loader; + virDomainCapsLoader *capsLoader = &os->loader; uint64_t autoFirmwares = 0; bool secure = false; - virFirmwarePtr *firmwaresAlt = NULL; + virFirmware **firmwaresAlt = NULL; size_t nfirmwaresAlt = 0; int ret = -1; @@ -6049,9 +6044,9 @@ virQEMUCapsFillDomainOSCaps(virDomainCapsOSPtr os, static void -virQEMUCapsFillDomainCPUCaps(virQEMUCapsPtr qemuCaps, +virQEMUCapsFillDomainCPUCaps(virQEMUCaps *qemuCaps, virArch hostarch, - virDomainCapsPtr domCaps) + virDomainCaps *domCaps) { if (virQEMUCapsIsCPUModeSupported(qemuCaps, hostarch, domCaps->virttype, VIR_CPU_MODE_HOST_PASSTHROUGH, @@ -6082,7 +6077,7 @@ virQEMUCapsFillDomainCPUCaps(virQEMUCapsPtr qemuCaps, if (virQEMUCapsIsCPUModeSupported(qemuCaps, hostarch, domCaps->virttype, VIR_CPU_MODE_HOST_MODEL, domCaps->machine)) { - virCPUDefPtr cpu = virQEMUCapsGetHostModel(qemuCaps, domCaps->virttype, + virCPUDef *cpu = virQEMUCapsGetHostModel(qemuCaps, domCaps->virttype, VIR_QEMU_CAPS_HOST_CPU_REPORTED); domCaps->cpu.hostModel = virCPUDefCopy(cpu); } @@ -6124,8 +6119,8 @@ static const struct virQEMUCapsDomainFeatureCapabilityTuple domCapsTuples[] = { static void -virQEMUCapsFillDomainFeaturesFromQEMUCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsPtr domCaps) +virQEMUCapsFillDomainFeaturesFromQEMUCaps(virQEMUCaps *qemuCaps, + virDomainCaps *domCaps) { size_t i; @@ -6139,9 +6134,9 @@ virQEMUCapsFillDomainFeaturesFromQEMUCaps(virQEMUCapsPtr qemuCaps, static void -virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps, +virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCaps *qemuCaps, const char *machine, - virDomainCapsDeviceDiskPtr disk) + virDomainCapsDeviceDisk *disk) { disk->supported = VIR_TRISTATE_BOOL_YES; disk->diskDevice.report = true; @@ -6187,8 +6182,8 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCapsPtr qemuCaps, void -virQEMUCapsFillDomainDeviceGraphicsCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsDeviceGraphicsPtr dev) +virQEMUCapsFillDomainDeviceGraphicsCaps(virQEMUCaps *qemuCaps, + virDomainCapsDeviceGraphics *dev) { dev->supported = VIR_TRISTATE_BOOL_YES; dev->type.report = true; @@ -6204,8 +6199,8 @@ virQEMUCapsFillDomainDeviceGraphicsCaps(virQEMUCapsPtr qemuCaps, void -virQEMUCapsFillDomainDeviceVideoCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsDeviceVideoPtr dev) +virQEMUCapsFillDomainDeviceVideoCaps(virQEMUCaps *qemuCaps, + virDomainCapsDeviceVideo *dev) { dev->supported = VIR_TRISTATE_BOOL_YES; dev->modelType.report = true; @@ -6229,8 +6224,8 @@ virQEMUCapsFillDomainDeviceVideoCaps(virQEMUCapsPtr qemuCaps, static void -virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsDeviceHostdevPtr hostdev) +virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCaps *qemuCaps, + virDomainCapsDeviceHostdev *hostdev) { bool supportsPassthroughVFIO = qemuHostdevHostSupportsPassthroughVFIO(); @@ -6281,8 +6276,8 @@ virQEMUCapsFillDomainDeviceHostdevCaps(virQEMUCapsPtr qemuCaps, void -virQEMUCapsFillDomainDeviceRNGCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsDeviceRNGPtr rng) +virQEMUCapsFillDomainDeviceRNGCaps(virQEMUCaps *qemuCaps, + virDomainCapsDeviceRNG *rng) { rng->supported = VIR_TRISTATE_BOOL_YES; rng->model.report = true; @@ -6322,7 +6317,7 @@ virQEMUCapsFillDomainDeviceRNGCaps(virQEMUCapsPtr qemuCaps, * otherwise */ bool -virQEMUCapsSupportsGICVersion(virQEMUCapsPtr qemuCaps, +virQEMUCapsSupportsGICVersion(virQEMUCaps *qemuCaps, virDomainVirtType virtType, virGICVersion version) { @@ -6332,7 +6327,7 @@ virQEMUCapsSupportsGICVersion(virQEMUCapsPtr qemuCaps, return false; for (i = 0; i < qemuCaps->ngicCapabilities; i++) { - virGICCapabilityPtr cap = &(qemuCaps->gicCapabilities[i]); + virGICCapability *cap = &(qemuCaps->gicCapabilities[i]); if (cap->version != version) continue; @@ -6368,10 +6363,10 @@ virQEMUCapsSupportsGICVersion(virQEMUCapsPtr qemuCaps, * required. */ static void -virQEMUCapsFillDomainFeatureGICCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsPtr domCaps) +virQEMUCapsFillDomainFeatureGICCaps(virQEMUCaps *qemuCaps, + virDomainCaps *domCaps) { - virDomainCapsFeatureGICPtr gic = &domCaps->gic; + virDomainCapsFeatureGIC *gic = &domCaps->gic; virGICVersion version; gic->supported = VIR_TRISTATE_BOOL_NO; @@ -6405,8 +6400,8 @@ virQEMUCapsFillDomainFeatureGICCaps(virQEMUCapsPtr qemuCaps, * and convert it to a form suitable for @domCaps. */ static void -virQEMUCapsFillDomainFeatureSEVCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsPtr domCaps) +virQEMUCapsFillDomainFeatureSEVCaps(virQEMUCaps *qemuCaps, + virDomainCaps *domCaps) { virSEVCapability *cap = qemuCaps->sevCapabilities; @@ -6423,19 +6418,19 @@ virQEMUCapsFillDomainFeatureSEVCaps(virQEMUCapsPtr qemuCaps, int -virQEMUCapsFillDomainCaps(virQEMUCapsPtr qemuCaps, +virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps, virArch hostarch, - virDomainCapsPtr domCaps, + virDomainCaps *domCaps, bool privileged, - virFirmwarePtr *firmwares, + virFirmware **firmwares, size_t nfirmwares) { - virDomainCapsOSPtr os = &domCaps->os; - virDomainCapsDeviceDiskPtr disk = &domCaps->disk; - virDomainCapsDeviceHostdevPtr hostdev = &domCaps->hostdev; - virDomainCapsDeviceGraphicsPtr graphics = &domCaps->graphics; - virDomainCapsDeviceVideoPtr video = &domCaps->video; - virDomainCapsDeviceRNGPtr rng = &domCaps->rng; + virDomainCapsOS *os = &domCaps->os; + virDomainCapsDeviceDisk *disk = &domCaps->disk; + virDomainCapsDeviceHostdev *hostdev = &domCaps->hostdev; + virDomainCapsDeviceGraphics *graphics = &domCaps->graphics; + virDomainCapsDeviceVideo *video = &domCaps->video; + virDomainCapsDeviceRNG *rng = &domCaps->rng; virQEMUCapsFillDomainFeaturesFromQEMUCaps(qemuCaps, domCaps); @@ -6472,7 +6467,7 @@ virQEMUCapsFillDomainCaps(virQEMUCapsPtr qemuCaps, void -virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCaps, +virQEMUCapsSetMicrocodeVersion(virQEMUCaps *qemuCaps, unsigned int microcodeVersion) { qemuCaps->microcodeVersion = microcodeVersion; @@ -6480,14 +6475,14 @@ virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCaps, static void -virQEMUCapsStripMachineAliasesForVirtType(virQEMUCapsPtr qemuCaps, +virQEMUCapsStripMachineAliasesForVirtType(virQEMUCaps *qemuCaps, virDomainVirtType virtType) { - virQEMUCapsAccelPtr accel = virQEMUCapsGetAccel(qemuCaps, virtType); + virQEMUCapsAccel *accel = virQEMUCapsGetAccel(qemuCaps, virtType); size_t i; for (i = 0; i < accel->nmachineTypes; i++) { - virQEMUCapsMachineTypePtr mach = &accel->machineTypes[i]; + virQEMUCapsMachineType *mach = &accel->machineTypes[i]; g_autofree char *name = g_steal_pointer(&mach->alias); if (name) { @@ -6512,7 +6507,7 @@ virQEMUCapsStripMachineAliasesForVirtType(virQEMUCapsPtr qemuCaps, * file can be stable when new files are added. */ void -virQEMUCapsStripMachineAliases(virQEMUCapsPtr qemuCaps) +virQEMUCapsStripMachineAliases(virQEMUCaps *qemuCaps) { virQEMUCapsStripMachineAliasesForVirtType(qemuCaps, VIR_DOMAIN_VIRT_KVM); virQEMUCapsStripMachineAliasesForVirtType(qemuCaps, VIR_DOMAIN_VIRT_QEMU); diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 1ca9c1ea7b..f54aad5dfd 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -614,50 +614,49 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ } virQEMUCapsFlags; typedef struct _virQEMUCaps virQEMUCaps; -typedef virQEMUCaps *virQEMUCapsPtr; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virQEMUCaps, virObjectUnref); -virQEMUCapsPtr virQEMUCapsNew(void); -virQEMUCapsPtr virQEMUCapsNewBinary(const char *binary); +virQEMUCaps *virQEMUCapsNew(void); +virQEMUCaps *virQEMUCapsNewBinary(const char *binary); -void virQEMUCapsSet(virQEMUCapsPtr qemuCaps, +void virQEMUCapsSet(virQEMUCaps *qemuCaps, virQEMUCapsFlags flag) ATTRIBUTE_NONNULL(1); -void virQEMUCapsSetList(virQEMUCapsPtr qemuCaps, ...) ATTRIBUTE_NONNULL(1); +void virQEMUCapsSetList(virQEMUCaps *qemuCaps, ...) ATTRIBUTE_NONNULL(1); -void virQEMUCapsClear(virQEMUCapsPtr qemuCaps, +void virQEMUCapsClear(virQEMUCaps *qemuCaps, virQEMUCapsFlags flag) ATTRIBUTE_NONNULL(1); -bool virQEMUCapsGet(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsGet(virQEMUCaps *qemuCaps, virQEMUCapsFlags flag); -void virQEMUCapsInitProcessCapsInterlock(virQEMUCapsPtr qemuCaps); +void virQEMUCapsInitProcessCapsInterlock(virQEMUCaps *qemuCaps); -bool virQEMUCapsHasPCIMultiBus(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsHasPCIMultiBus(virQEMUCaps *qemuCaps, const virDomainDef *def); -bool virQEMUCapsSupportsVmport(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsSupportsVmport(virQEMUCaps *qemuCaps, const virDomainDef *def); -const char *virQEMUCapsGetBinary(virQEMUCapsPtr qemuCaps); -virArch virQEMUCapsGetArch(virQEMUCapsPtr qemuCaps); -unsigned int virQEMUCapsGetVersion(virQEMUCapsPtr qemuCaps); -const char *virQEMUCapsGetPackage(virQEMUCapsPtr qemuCaps); +const char *virQEMUCapsGetBinary(virQEMUCaps *qemuCaps); +virArch virQEMUCapsGetArch(virQEMUCaps *qemuCaps); +unsigned int virQEMUCapsGetVersion(virQEMUCaps *qemuCaps); +const char *virQEMUCapsGetPackage(virQEMUCaps *qemuCaps); -unsigned int virQEMUCapsGetKVMVersion(virQEMUCapsPtr qemuCaps); -int virQEMUCapsAddCPUDefinitions(virQEMUCapsPtr qemuCaps, +unsigned int virQEMUCapsGetKVMVersion(virQEMUCaps *qemuCaps); +int virQEMUCapsAddCPUDefinitions(virQEMUCaps *qemuCaps, virDomainVirtType type, const char **name, size_t count, virDomainCapsCPUUsable usable); -virDomainCapsCPUModelsPtr virQEMUCapsGetCPUModels(virQEMUCapsPtr qemuCaps, +virDomainCapsCPUModels *virQEMUCapsGetCPUModels(virQEMUCaps *qemuCaps, virDomainVirtType type, const char **modelAllowed, const char **modelForbidden); -int virQEMUCapsFetchCPUModels(qemuMonitorPtr mon, +int virQEMUCapsFetchCPUModels(qemuMonitor *mon, virArch arch, - virDomainCapsCPUModelsPtr *cpuModels); + virDomainCapsCPUModels **cpuModels); typedef enum { /* Host CPU definition reported in domain capabilities. */ @@ -670,71 +669,71 @@ typedef enum { VIR_QEMU_CAPS_HOST_CPU_FULL, } virQEMUCapsHostCPUType; -virCPUDefPtr virQEMUCapsGetHostModel(virQEMUCapsPtr qemuCaps, +virCPUDef *virQEMUCapsGetHostModel(virQEMUCaps *qemuCaps, virDomainVirtType type, virQEMUCapsHostCPUType cpuType); -int virQEMUCapsGetCPUFeatures(virQEMUCapsPtr qemuCaps, +int virQEMUCapsGetCPUFeatures(virQEMUCaps *qemuCaps, virDomainVirtType virtType, bool migratable, char ***features); -virDomainVirtType virQEMUCapsGetVirtType(virQEMUCapsPtr qemuCaps); +virDomainVirtType virQEMUCapsGetVirtType(virQEMUCaps *qemuCaps); -bool virQEMUCapsIsArchSupported(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsIsArchSupported(virQEMUCaps *qemuCaps, virArch arch); -bool virQEMUCapsIsVirtTypeSupported(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsIsVirtTypeSupported(virQEMUCaps *qemuCaps, virDomainVirtType virtType); -bool virQEMUCapsIsCPUModeSupported(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsIsCPUModeSupported(virQEMUCaps *qemuCaps, virArch hostarch, virDomainVirtType type, virCPUMode mode, const char *machineType); -const char *virQEMUCapsGetCanonicalMachine(virQEMUCapsPtr qemuCaps, +const char *virQEMUCapsGetCanonicalMachine(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name); -bool virQEMUCapsIsMachineSupported(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsIsMachineSupported(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *canonical_machine) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); -int virQEMUCapsGetMachineMaxCpus(virQEMUCapsPtr qemuCaps, +int virQEMUCapsGetMachineMaxCpus(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name); -bool virQEMUCapsGetMachineHotplugCpus(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsGetMachineHotplugCpus(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name); -const char *virQEMUCapsGetMachineDefaultCPU(virQEMUCapsPtr qemuCaps, +const char *virQEMUCapsGetMachineDefaultCPU(virQEMUCaps *qemuCaps, const char *name, virDomainVirtType type); -bool virQEMUCapsIsCPUDeprecated(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsIsCPUDeprecated(virQEMUCaps *qemuCaps, virDomainVirtType type, const char *model); -bool virQEMUCapsIsMachineDeprecated(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsIsMachineDeprecated(virQEMUCaps *qemuCaps, virDomainVirtType type, const char *machine); -bool virQEMUCapsGetMachineNumaMemSupported(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsGetMachineNumaMemSupported(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name); -const char *virQEMUCapsGetMachineDefaultRAMid(virQEMUCapsPtr qemuCaps, +const char *virQEMUCapsGetMachineDefaultRAMid(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name); -void virQEMUCapsFilterByMachineType(virQEMUCapsPtr qemuCaps, +void virQEMUCapsFilterByMachineType(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *machineType); char * virQEMUCapsGetDefaultEmulator(virArch hostarch, virArch guestarch); -virFileCachePtr virQEMUCapsCacheNew(const char *libDir, +virFileCache *virQEMUCapsCacheNew(const char *libDir, const char *cacheDir, uid_t uid, gid_t gid); -virQEMUCapsPtr virQEMUCapsCacheLookup(virFileCachePtr cache, +virQEMUCaps *virQEMUCapsCacheLookup(virFileCache *cache, const char *binary); -virQEMUCapsPtr virQEMUCapsCacheLookupCopy(virFileCachePtr cache, +virQEMUCaps *virQEMUCapsCacheLookupCopy(virFileCache *cache, virDomainVirtType virtType, const char *binary, const char *machineType); -virQEMUCapsPtr virQEMUCapsCacheLookupDefault(virFileCachePtr cache, +virQEMUCaps *virQEMUCapsCacheLookupDefault(virFileCache *cache, const char *binary, const char *archStr, const char *virttypeStr, @@ -743,41 +742,41 @@ virQEMUCapsPtr virQEMUCapsCacheLookupDefault(virFileCachePtr cache, virDomainVirtType *retVirttype, const char **retMachine); -virCapsPtr virQEMUCapsInit(virFileCachePtr cache); +virCaps *virQEMUCapsInit(virFileCache *cache); -int virQEMUCapsGetDefaultVersion(virCapsPtr caps, - virFileCachePtr capsCache, +int virQEMUCapsGetDefaultVersion(virCaps *caps, + virFileCache *capsCache, unsigned int *version); VIR_ENUM_DECL(virQEMUCaps); -bool virQEMUCapsSupportsGICVersion(virQEMUCapsPtr qemuCaps, +bool virQEMUCapsSupportsGICVersion(virQEMUCaps *qemuCaps, virDomainVirtType virtType, virGICVersion version); -const char *virQEMUCapsGetPreferredMachine(virQEMUCapsPtr qemuCaps, +const char *virQEMUCapsGetPreferredMachine(virQEMUCaps *qemuCaps, virDomainVirtType virtType); -int virQEMUCapsInitGuestFromBinary(virCapsPtr caps, +int virQEMUCapsInitGuestFromBinary(virCaps *caps, const char *binary, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, virArch guestarch); -int virQEMUCapsFillDomainCaps(virQEMUCapsPtr qemuCaps, +int virQEMUCapsFillDomainCaps(virQEMUCaps *qemuCaps, virArch hostarch, - virDomainCapsPtr domCaps, + virDomainCaps *domCaps, bool privileged, - virFirmwarePtr *firmwares, + virFirmware **firmwares, size_t nfirmwares); -void virQEMUCapsFillDomainDeviceGraphicsCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsDeviceGraphicsPtr dev); +void virQEMUCapsFillDomainDeviceGraphicsCaps(virQEMUCaps *qemuCaps, + virDomainCapsDeviceGraphics *dev); -void virQEMUCapsFillDomainDeviceVideoCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsDeviceVideoPtr dev); +void virQEMUCapsFillDomainDeviceVideoCaps(virQEMUCaps *qemuCaps, + virDomainCapsDeviceVideo *dev); -void virQEMUCapsFillDomainDeviceRNGCaps(virQEMUCapsPtr qemuCaps, - virDomainCapsDeviceRNGPtr rng); +void virQEMUCapsFillDomainDeviceRNGCaps(virQEMUCaps *qemuCaps, + virDomainCapsDeviceRNG *rng); bool virQEMUCapsGuestIsNative(virArch host, virArch guest); @@ -787,15 +786,15 @@ bool virQEMUCapsCPUFilterFeatures(const char *name, void *opaque); const char * -virQEMUCapsCPUFeatureToQEMU(virQEMUCapsPtr qemuCaps, +virQEMUCapsCPUFeatureToQEMU(virQEMUCaps *qemuCaps, const char *feature); const char * -virQEMUCapsCPUFeatureFromQEMU(virQEMUCapsPtr qemuCaps, +virQEMUCapsCPUFeatureFromQEMU(virQEMUCaps *qemuCaps, const char *feature); -virSEVCapabilityPtr -virQEMUCapsGetSEVCapabilities(virQEMUCapsPtr qemuCaps); +virSEVCapability * +virQEMUCapsGetSEVCapabilities(virQEMUCaps *qemuCaps); virArch virQEMUCapsArchFromString(const char *arch); const char *virQEMUCapsArchToString(virArch arch); diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index 90ce35fa5d..c50b15f193 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -25,9 +25,9 @@ #pragma once -virQEMUCapsPtr virQEMUCapsNewCopy(virQEMUCapsPtr qemuCaps); +virQEMUCaps *virQEMUCapsNewCopy(virQEMUCaps *qemuCaps); -virQEMUCapsPtr +virQEMUCaps * virQEMUCapsNewForBinaryInternal(virArch hostArch, const char *binary, const char *libDir, @@ -38,80 +38,80 @@ virQEMUCapsNewForBinaryInternal(virArch hostArch, const char *kernelVersion); int virQEMUCapsLoadCache(virArch hostArch, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, const char *filename, bool skipInvalidation); -char *virQEMUCapsFormatCache(virQEMUCapsPtr qemuCaps); +char *virQEMUCapsFormatCache(virQEMUCaps *qemuCaps); int -virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon); +virQEMUCapsInitQMPMonitor(virQEMUCaps *qemuCaps, + qemuMonitor *mon); int -virQEMUCapsInitQMPMonitorTCG(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon); +virQEMUCapsInitQMPMonitorTCG(virQEMUCaps *qemuCaps, + qemuMonitor *mon); void -virQEMUCapsSetArch(virQEMUCapsPtr qemuCaps, +virQEMUCapsSetArch(virQEMUCaps *qemuCaps, virArch arch); void -virQEMUCapsInitHostCPUModel(virQEMUCapsPtr qemuCaps, +virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps, virArch hostArch, virDomainVirtType type); int -virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, +virQEMUCapsInitCPUModel(virQEMUCaps *qemuCaps, virDomainVirtType type, - virCPUDefPtr cpu, + virCPUDef *cpu, bool migratable); void -virQEMUCapsInitQMPBasicArch(virQEMUCapsPtr qemuCaps); +virQEMUCapsInitQMPBasicArch(virQEMUCaps *qemuCaps); -qemuMonitorCPUModelInfoPtr -virQEMUCapsGetCPUModelInfo(virQEMUCapsPtr qemuCaps, +qemuMonitorCPUModelInfo * +virQEMUCapsGetCPUModelInfo(virQEMUCaps *qemuCaps, virDomainVirtType type); void -virQEMUCapsSetCPUModelInfo(virQEMUCapsPtr qemuCaps, +virQEMUCapsSetCPUModelInfo(virQEMUCaps *qemuCaps, virDomainVirtType type, - qemuMonitorCPUModelInfoPtr modelInfo); + qemuMonitorCPUModelInfo *modelInfo); -virCPUDataPtr -virQEMUCapsGetCPUModelX86Data(virQEMUCapsPtr qemuCaps, - qemuMonitorCPUModelInfoPtr model, +virCPUData * +virQEMUCapsGetCPUModelX86Data(virQEMUCaps *qemuCaps, + qemuMonitorCPUModelInfo *model, bool migratable); -virCPUDefPtr +virCPUDef * virQEMUCapsProbeHostCPU(virArch hostArch, - virDomainCapsCPUModelsPtr models) G_GNUC_NO_INLINE; + virDomainCapsCPUModels *models) G_GNUC_NO_INLINE; void -virQEMUCapsSetGICCapabilities(virQEMUCapsPtr qemuCaps, +virQEMUCapsSetGICCapabilities(virQEMUCaps *qemuCaps, virGICCapability *capabilities, size_t ncapabilities); void -virQEMUCapsSetSEVCapabilities(virQEMUCapsPtr qemuCaps, +virQEMUCapsSetSEVCapabilities(virQEMUCaps *qemuCaps, virSEVCapability *capabilities); int -virQEMUCapsProbeCPUDefinitionsTest(virQEMUCapsPtr qemuCaps, - qemuMonitorPtr mon); +virQEMUCapsProbeCPUDefinitionsTest(virQEMUCaps *qemuCaps, + qemuMonitor *mon); void -virQEMUCapsSetMicrocodeVersion(virQEMUCapsPtr qemuCaps, +virQEMUCapsSetMicrocodeVersion(virQEMUCaps *qemuCaps, unsigned int microcodeVersion); void -virQEMUCapsStripMachineAliases(virQEMUCapsPtr qemuCaps); +virQEMUCapsStripMachineAliases(virQEMUCaps *qemuCaps); bool -virQEMUCapsHasMachines(virQEMUCapsPtr qemuCaps); +virQEMUCapsHasMachines(virQEMUCaps *qemuCaps); void -virQEMUCapsAddMachine(virQEMUCapsPtr qemuCaps, +virQEMUCapsAddMachine(virQEMUCaps *qemuCaps, virDomainVirtType virtType, const char *name, const char *alias, diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c index 4d94b57e57..717ce32bf2 100644 --- a/src/qemu/qemu_cgroup.c +++ b/src/qemu/qemu_cgroup.c @@ -54,11 +54,11 @@ const char *const defaultDeviceACL[] = { static int -qemuSetupImagePathCgroup(virDomainObjPtr vm, +qemuSetupImagePathCgroup(virDomainObj *vm, const char *path, bool readonly) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int perms = VIR_CGROUP_DEVICE_READ; g_auto(GStrv) targetPaths = NULL; size_t i; @@ -109,8 +109,8 @@ qemuSetupImagePathCgroup(virDomainObjPtr vm, static int -qemuSetupImageCgroupInternal(virDomainObjPtr vm, - virStorageSourcePtr src, +qemuSetupImageCgroupInternal(virDomainObj *vm, + virStorageSource *src, bool forceReadonly) { g_autofree char *path = NULL; @@ -148,18 +148,18 @@ qemuSetupImageCgroupInternal(virDomainObjPtr vm, int -qemuSetupImageCgroup(virDomainObjPtr vm, - virStorageSourcePtr src) +qemuSetupImageCgroup(virDomainObj *vm, + virStorageSource *src) { return qemuSetupImageCgroupInternal(vm, src, false); } int -qemuTeardownImageCgroup(virDomainObjPtr vm, - virStorageSourcePtr src) +qemuTeardownImageCgroup(virDomainObj *vm, + virStorageSource *src) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *path = NULL; int perms = VIR_CGROUP_DEVICE_RWM; bool hasPR = false; @@ -172,7 +172,7 @@ qemuTeardownImageCgroup(virDomainObjPtr vm, return 0; for (i = 0; i < vm->def->ndisks; i++) { - virStorageSourcePtr diskSrc = vm->def->disks[i]->src; + virStorageSource *diskSrc = vm->def->disks[i]->src; if (src == diskSrc) continue; @@ -239,10 +239,10 @@ qemuTeardownImageCgroup(virDomainObjPtr vm, int -qemuSetupImageChainCgroup(virDomainObjPtr vm, - virStorageSourcePtr src) +qemuSetupImageChainCgroup(virDomainObj *vm, + virStorageSource *src) { - virStorageSourcePtr next; + virStorageSource *next; bool forceReadonly = false; for (next = src; virStorageSourceIsBacking(next); next = next->backingStore) { @@ -258,10 +258,10 @@ qemuSetupImageChainCgroup(virDomainObjPtr vm, int -qemuTeardownImageChainCgroup(virDomainObjPtr vm, - virStorageSourcePtr src) +qemuTeardownImageChainCgroup(virDomainObj *vm, + virStorageSource *src) { - virStorageSourcePtr next; + virStorageSource *next; for (next = src; virStorageSourceIsBacking(next); next = next->backingStore) { if (qemuTeardownImageCgroup(vm, next) < 0) @@ -273,10 +273,10 @@ qemuTeardownImageChainCgroup(virDomainObjPtr vm, static int -qemuSetupChrSourceCgroup(virDomainObjPtr vm, - virDomainChrSourceDefPtr source) +qemuSetupChrSourceCgroup(virDomainObj *vm, + virDomainChrSourceDef *source) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret; if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES)) @@ -297,10 +297,10 @@ qemuSetupChrSourceCgroup(virDomainObjPtr vm, static int -qemuTeardownChrSourceCgroup(virDomainObjPtr vm, - virDomainChrSourceDefPtr source) +qemuTeardownChrSourceCgroup(virDomainObj *vm, + virDomainChrSourceDef *source) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret; if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES)) @@ -321,19 +321,19 @@ qemuTeardownChrSourceCgroup(virDomainObjPtr vm, static int -qemuSetupChardevCgroupCB(virDomainDefPtr def G_GNUC_UNUSED, - virDomainChrDefPtr dev, +qemuSetupChardevCgroupCB(virDomainDef *def G_GNUC_UNUSED, + virDomainChrDef *dev, void *opaque) { - virDomainObjPtr vm = opaque; + virDomainObj *vm = opaque; return qemuSetupChrSourceCgroup(vm, dev->source); } static int -qemuSetupTPMCgroup(virDomainObjPtr vm, - virDomainTPMDefPtr dev) +qemuSetupTPMCgroup(virDomainObj *vm, + virDomainTPMDef *dev) { int ret = 0; @@ -351,10 +351,10 @@ qemuSetupTPMCgroup(virDomainObjPtr vm, int -qemuSetupInputCgroup(virDomainObjPtr vm, - virDomainInputDefPtr dev) +qemuSetupInputCgroup(virDomainObj *vm, + virDomainInputDef *dev) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret = 0; if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES)) @@ -374,10 +374,10 @@ qemuSetupInputCgroup(virDomainObjPtr vm, int -qemuTeardownInputCgroup(virDomainObjPtr vm, - virDomainInputDefPtr dev) +qemuTeardownInputCgroup(virDomainObj *vm, + virDomainInputDef *dev) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret = 0; if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES)) @@ -407,10 +407,10 @@ qemuTeardownInputCgroup(virDomainObjPtr vm, * -1 otherwise. */ int -qemuSetupHostdevCgroup(virDomainObjPtr vm, - virDomainHostdevDefPtr dev) +qemuSetupHostdevCgroup(virDomainObj *vm, + virDomainHostdevDef *dev) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *path = NULL; int perms; int rv; @@ -457,10 +457,10 @@ qemuSetupHostdevCgroup(virDomainObjPtr vm, * -1 otherwise. */ int -qemuTeardownHostdevCgroup(virDomainObjPtr vm, - virDomainHostdevDefPtr dev) +qemuTeardownHostdevCgroup(virDomainObj *vm, + virDomainHostdevDef *dev) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *path = NULL; int rv; @@ -506,10 +506,10 @@ qemuTeardownHostdevCgroup(virDomainObjPtr vm, int -qemuSetupMemoryDevicesCgroup(virDomainObjPtr vm, - virDomainMemoryDefPtr mem) +qemuSetupMemoryDevicesCgroup(virDomainObj *vm, + virDomainMemoryDef *mem) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int rv; if (mem->model != VIR_DOMAIN_MEMORY_MODEL_NVDIMM && @@ -530,10 +530,10 @@ qemuSetupMemoryDevicesCgroup(virDomainObjPtr vm, int -qemuTeardownMemoryDevicesCgroup(virDomainObjPtr vm, - virDomainMemoryDefPtr mem) +qemuTeardownMemoryDevicesCgroup(virDomainObj *vm, + virDomainMemoryDef *mem) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int rv; if (mem->model != VIR_DOMAIN_MEMORY_MODEL_NVDIMM && @@ -552,10 +552,10 @@ qemuTeardownMemoryDevicesCgroup(virDomainObjPtr vm, static int -qemuSetupGraphicsCgroup(virDomainObjPtr vm, - virDomainGraphicsDefPtr gfx) +qemuSetupGraphicsCgroup(virDomainObj *vm, + virDomainGraphicsDef *gfx) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; const char *rendernode = virDomainGraphicsGetRenderNode(gfx); int ret; @@ -572,11 +572,11 @@ qemuSetupGraphicsCgroup(virDomainObjPtr vm, static int -qemuSetupVideoCgroup(virDomainObjPtr vm, - virDomainVideoDefPtr def) +qemuSetupVideoCgroup(virDomainObj *vm, + virDomainVideoDef *def) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainVideoAccelDefPtr accel = def->accel; + qemuDomainObjPrivate *priv = vm->privateData; + virDomainVideoAccelDef *accel = def->accel; int ret; if (!accel) @@ -595,9 +595,9 @@ qemuSetupVideoCgroup(virDomainObjPtr vm, static int -qemuSetupBlkioCgroup(virDomainObjPtr vm) +qemuSetupBlkioCgroup(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_BLKIO)) { @@ -615,9 +615,9 @@ qemuSetupBlkioCgroup(virDomainObjPtr vm) static int -qemuSetupMemoryCgroup(virDomainObjPtr vm) +qemuSetupMemoryCgroup(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_MEMORY)) { if (virMemoryLimitIsSet(vm->def->mem.hard_limit) || @@ -636,7 +636,7 @@ qemuSetupMemoryCgroup(virDomainObjPtr vm) static int -qemuSetupFirmwareCgroup(virDomainObjPtr vm) +qemuSetupFirmwareCgroup(virDomainObj *vm) { if (!vm->def->os.loader) return 0; @@ -655,10 +655,10 @@ qemuSetupFirmwareCgroup(virDomainObjPtr vm) int -qemuSetupRNGCgroup(virDomainObjPtr vm, - virDomainRNGDefPtr rng) +qemuSetupRNGCgroup(virDomainObj *vm, + virDomainRNGDef *rng) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int rv; if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES)) @@ -682,10 +682,10 @@ qemuSetupRNGCgroup(virDomainObjPtr vm, int -qemuTeardownRNGCgroup(virDomainObjPtr vm, - virDomainRNGDefPtr rng) +qemuTeardownRNGCgroup(virDomainObj *vm, + virDomainRNGDef *rng) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int rv; if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES)) @@ -709,25 +709,25 @@ qemuTeardownRNGCgroup(virDomainObjPtr vm, int -qemuSetupChardevCgroup(virDomainObjPtr vm, - virDomainChrDefPtr dev) +qemuSetupChardevCgroup(virDomainObj *vm, + virDomainChrDef *dev) { return qemuSetupChrSourceCgroup(vm, dev->source); } int -qemuTeardownChardevCgroup(virDomainObjPtr vm, - virDomainChrDefPtr dev) +qemuTeardownChardevCgroup(virDomainObj *vm, + virDomainChrDef *dev) { return qemuTeardownChrSourceCgroup(vm, dev->source); } static int -qemuSetupSEVCgroup(virDomainObjPtr vm) +qemuSetupSEVCgroup(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret; if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_DEVICES)) @@ -741,9 +741,9 @@ qemuSetupSEVCgroup(virDomainObjPtr vm) } static int -qemuSetupDevicesCgroup(virDomainObjPtr vm) +qemuSetupDevicesCgroup(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(priv->driver); const char *const *deviceACL = NULL; int rv = -1; @@ -862,9 +862,9 @@ qemuSetupDevicesCgroup(virDomainObjPtr vm) static int -qemuSetupCpusetCgroup(virDomainObjPtr vm) +qemuSetupCpusetCgroup(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPUSET)) return 0; @@ -877,9 +877,9 @@ qemuSetupCpusetCgroup(virDomainObjPtr vm) static int -qemuSetupCpuCgroup(virDomainObjPtr vm) +qemuSetupCpuCgroup(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!virCgroupHasController(priv->cgroup, VIR_CGROUP_CONTROLLER_CPU)) { if (vm->def->cputune.sharesSpecified) { @@ -901,11 +901,11 @@ qemuSetupCpuCgroup(virDomainObjPtr vm) static int -qemuInitCgroup(virDomainObjPtr vm, +qemuInitCgroup(virDomainObj *vm, size_t nnicindexes, int *nicindexes) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(priv->driver); if (!priv->driver->privileged) @@ -918,7 +918,7 @@ qemuInitCgroup(virDomainObjPtr vm, priv->cgroup = NULL; if (!vm->def->resource) { - virDomainResourceDefPtr res; + virDomainResourceDef *res; res = g_new0(virDomainResourceDef, 1); @@ -955,7 +955,7 @@ qemuInitCgroup(virDomainObjPtr vm, } static int -qemuRestoreCgroupThread(virCgroupPtr cgroup, +qemuRestoreCgroupThread(virCgroup *cgroup, virCgroupThreadName thread, int id) { @@ -978,10 +978,10 @@ qemuRestoreCgroupThread(virCgroupPtr cgroup, } static void -qemuRestoreCgroupState(virDomainObjPtr vm) +qemuRestoreCgroupState(virDomainObj *vm) { g_autofree char *mem_mask = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; size_t i = 0; g_autoptr(virBitmap) all_nodes = NULL; @@ -1003,7 +1003,7 @@ qemuRestoreCgroupState(virDomainObjPtr vm) goto error; for (i = 0; i < virDomainDefGetVcpusMax(vm->def); i++) { - virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, i); + virDomainVcpuDef *vcpu = virDomainDefGetVcpu(vm->def, i); if (!vcpu->online) continue; @@ -1032,9 +1032,9 @@ qemuRestoreCgroupState(virDomainObjPtr vm) } int -qemuConnectCgroup(virDomainObjPtr vm) +qemuConnectCgroup(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(priv->driver); if (!priv->driver->privileged) @@ -1059,11 +1059,11 @@ qemuConnectCgroup(virDomainObjPtr vm) } int -qemuSetupCgroup(virDomainObjPtr vm, +qemuSetupCgroup(virDomainObj *vm, size_t nnicindexes, int *nicindexes) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!vm->pid) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -1096,7 +1096,7 @@ qemuSetupCgroup(virDomainObjPtr vm, } int -qemuSetupCgroupVcpuBW(virCgroupPtr cgroup, +qemuSetupCgroupVcpuBW(virCgroup *cgroup, unsigned long long period, long long quota) { @@ -1105,18 +1105,18 @@ qemuSetupCgroupVcpuBW(virCgroupPtr cgroup, int -qemuSetupCgroupCpusetCpus(virCgroupPtr cgroup, - virBitmapPtr cpumask) +qemuSetupCgroupCpusetCpus(virCgroup *cgroup, + virBitmap *cpumask) { return virCgroupSetupCpusetCpus(cgroup, cpumask); } int -qemuSetupCgroupForExtDevices(virDomainObjPtr vm, - virQEMUDriverPtr driver) +qemuSetupCgroupForExtDevices(virDomainObj *vm, + virQEMUDriver *driver) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virCgroup) cgroup_temp = NULL; if (!qemuExtDevicesHasDevice(vm->def) || @@ -1141,9 +1141,9 @@ qemuSetupCgroupForExtDevices(virDomainObjPtr vm, int -qemuSetupGlobalCpuCgroup(virDomainObjPtr vm) +qemuSetupGlobalCpuCgroup(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; unsigned long long period = vm->def->cputune.global_period; long long quota = vm->def->cputune.global_quota; g_autofree char *mem_mask = NULL; @@ -1183,9 +1183,9 @@ qemuSetupGlobalCpuCgroup(virDomainObjPtr vm) int -qemuRemoveCgroup(virDomainObjPtr vm) +qemuRemoveCgroup(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (priv->cgroup == NULL) return 0; /* Not supported, so claim success */ @@ -1200,7 +1200,7 @@ qemuRemoveCgroup(virDomainObjPtr vm) static void -qemuCgroupEmulatorAllNodesDataFree(qemuCgroupEmulatorAllNodesDataPtr data) +qemuCgroupEmulatorAllNodesDataFree(qemuCgroupEmulatorAllNodesData *data) { if (!data) return; @@ -1224,10 +1224,10 @@ qemuCgroupEmulatorAllNodesDataFree(qemuCgroupEmulatorAllNodesDataPtr data) * Returns 0 on success -1 on error */ int -qemuCgroupEmulatorAllNodesAllow(virCgroupPtr cgroup, - qemuCgroupEmulatorAllNodesDataPtr *retData) +qemuCgroupEmulatorAllNodesAllow(virCgroup *cgroup, + qemuCgroupEmulatorAllNodesData **retData) { - qemuCgroupEmulatorAllNodesDataPtr data = NULL; + qemuCgroupEmulatorAllNodesData *data = NULL; g_autofree char *all_nodes_str = NULL; g_autoptr(virBitmap) all_nodes = NULL; int ret = -1; @@ -1270,7 +1270,7 @@ qemuCgroupEmulatorAllNodesAllow(virCgroupPtr cgroup, * associated data. */ void -qemuCgroupEmulatorAllNodesRestore(qemuCgroupEmulatorAllNodesDataPtr data) +qemuCgroupEmulatorAllNodesRestore(qemuCgroupEmulatorAllNodesData *data) { virErrorPtr err; diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h index 54839b5bfb..cd537ebd82 100644 --- a/src/qemu/qemu_cgroup.h +++ b/src/qemu/qemu_cgroup.h @@ -26,58 +26,57 @@ #include "domain_conf.h" #include "qemu_conf.h" -int qemuSetupImageCgroup(virDomainObjPtr vm, - virStorageSourcePtr src); -int qemuTeardownImageCgroup(virDomainObjPtr vm, - virStorageSourcePtr src); -int qemuSetupImageChainCgroup(virDomainObjPtr vm, - virStorageSourcePtr src); -int qemuTeardownImageChainCgroup(virDomainObjPtr vm, - virStorageSourcePtr src); -int qemuSetupInputCgroup(virDomainObjPtr vm, - virDomainInputDefPtr dev); -int qemuTeardownInputCgroup(virDomainObjPtr vm, - virDomainInputDefPtr dev); -int qemuSetupHostdevCgroup(virDomainObjPtr vm, - virDomainHostdevDefPtr dev) +int qemuSetupImageCgroup(virDomainObj *vm, + virStorageSource *src); +int qemuTeardownImageCgroup(virDomainObj *vm, + virStorageSource *src); +int qemuSetupImageChainCgroup(virDomainObj *vm, + virStorageSource *src); +int qemuTeardownImageChainCgroup(virDomainObj *vm, + virStorageSource *src); +int qemuSetupInputCgroup(virDomainObj *vm, + virDomainInputDef *dev); +int qemuTeardownInputCgroup(virDomainObj *vm, + virDomainInputDef *dev); +int qemuSetupHostdevCgroup(virDomainObj *vm, + virDomainHostdevDef *dev) G_GNUC_WARN_UNUSED_RESULT; -int qemuTeardownHostdevCgroup(virDomainObjPtr vm, - virDomainHostdevDefPtr dev) +int qemuTeardownHostdevCgroup(virDomainObj *vm, + virDomainHostdevDef *dev) G_GNUC_WARN_UNUSED_RESULT; -int qemuSetupMemoryDevicesCgroup(virDomainObjPtr vm, - virDomainMemoryDefPtr mem); -int qemuTeardownMemoryDevicesCgroup(virDomainObjPtr vm, - virDomainMemoryDefPtr mem); -int qemuSetupRNGCgroup(virDomainObjPtr vm, - virDomainRNGDefPtr rng); -int qemuTeardownRNGCgroup(virDomainObjPtr vm, - virDomainRNGDefPtr rng); -int qemuSetupChardevCgroup(virDomainObjPtr vm, - virDomainChrDefPtr dev); -int qemuTeardownChardevCgroup(virDomainObjPtr vm, - virDomainChrDefPtr dev); -int qemuConnectCgroup(virDomainObjPtr vm); -int qemuSetupCgroup(virDomainObjPtr vm, +int qemuSetupMemoryDevicesCgroup(virDomainObj *vm, + virDomainMemoryDef *mem); +int qemuTeardownMemoryDevicesCgroup(virDomainObj *vm, + virDomainMemoryDef *mem); +int qemuSetupRNGCgroup(virDomainObj *vm, + virDomainRNGDef *rng); +int qemuTeardownRNGCgroup(virDomainObj *vm, + virDomainRNGDef *rng); +int qemuSetupChardevCgroup(virDomainObj *vm, + virDomainChrDef *dev); +int qemuTeardownChardevCgroup(virDomainObj *vm, + virDomainChrDef *dev); +int qemuConnectCgroup(virDomainObj *vm); +int qemuSetupCgroup(virDomainObj *vm, size_t nnicindexes, int *nicindexes); -int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup, +int qemuSetupCgroupVcpuBW(virCgroup *cgroup, unsigned long long period, long long quota); -int qemuSetupCgroupCpusetCpus(virCgroupPtr cgroup, virBitmapPtr cpumask); -int qemuSetupGlobalCpuCgroup(virDomainObjPtr vm); -int qemuSetupCgroupForExtDevices(virDomainObjPtr vm, - virQEMUDriverPtr driver); -int qemuRemoveCgroup(virDomainObjPtr vm); +int qemuSetupCgroupCpusetCpus(virCgroup *cgroup, virBitmap *cpumask); +int qemuSetupGlobalCpuCgroup(virDomainObj *vm); +int qemuSetupCgroupForExtDevices(virDomainObj *vm, + virQEMUDriver *driver); +int qemuRemoveCgroup(virDomainObj *vm); typedef struct _qemuCgroupEmulatorAllNodesData qemuCgroupEmulatorAllNodesData; -typedef qemuCgroupEmulatorAllNodesData *qemuCgroupEmulatorAllNodesDataPtr; struct _qemuCgroupEmulatorAllNodesData { - virCgroupPtr emulatorCgroup; + virCgroup *emulatorCgroup; char *emulatorMemMask; }; -int qemuCgroupEmulatorAllNodesAllow(virCgroupPtr cgroup, - qemuCgroupEmulatorAllNodesDataPtr *data); -void qemuCgroupEmulatorAllNodesRestore(qemuCgroupEmulatorAllNodesDataPtr data); +int qemuCgroupEmulatorAllNodesAllow(virCgroup *cgroup, + qemuCgroupEmulatorAllNodesData **data); +void qemuCgroupEmulatorAllNodesRestore(qemuCgroupEmulatorAllNodesData *data); extern const char *const defaultDeviceACL[]; diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c index d2a621a52b..4902585e5d 100644 --- a/src/qemu/qemu_checkpoint.c +++ b/src/qemu/qemu_checkpoint.c @@ -51,13 +51,13 @@ VIR_LOG_INIT("qemu.qemu_checkpoint"); * the checkpoint which was 'current' previously is updated. */ static void -qemuCheckpointSetCurrent(virDomainObjPtr vm, - virDomainMomentObjPtr newcurrent) +qemuCheckpointSetCurrent(virDomainObj *vm, + virDomainMomentObj *newcurrent) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - virDomainMomentObjPtr oldcurrent = virDomainCheckpointGetCurrent(vm->checkpoints); + virDomainMomentObj *oldcurrent = virDomainCheckpointGetCurrent(vm->checkpoints); virDomainCheckpointSetCurrent(vm->checkpoints, newcurrent); @@ -74,7 +74,7 @@ qemuCheckpointSetCurrent(virDomainObjPtr vm, /* Looks up the domain object from checkpoint and unlocks the * driver. The returned domain object is locked and ref'd and the * caller must call virDomainObjEndAPI() on it. */ -virDomainObjPtr +virDomainObj * qemuDomObjFromCheckpoint(virDomainCheckpointPtr checkpoint) { return qemuDomainObjFromDomain(checkpoint->domain); @@ -82,11 +82,11 @@ qemuDomObjFromCheckpoint(virDomainCheckpointPtr checkpoint) /* Looks up checkpoint object from VM and name */ -virDomainMomentObjPtr -qemuCheckpointObjFromName(virDomainObjPtr vm, +virDomainMomentObj * +qemuCheckpointObjFromName(virDomainObj *vm, const char *name) { - virDomainMomentObjPtr chk = NULL; + virDomainMomentObj *chk = NULL; chk = virDomainCheckpointFindByName(vm->checkpoints, name); if (!chk) virReportError(VIR_ERR_NO_DOMAIN_CHECKPOINT, @@ -98,8 +98,8 @@ qemuCheckpointObjFromName(virDomainObjPtr vm, /* Looks up checkpoint object from VM and checkpointPtr */ -virDomainMomentObjPtr -qemuCheckpointObjFromCheckpoint(virDomainObjPtr vm, +virDomainMomentObj * +qemuCheckpointObjFromCheckpoint(virDomainObj *vm, virDomainCheckpointPtr checkpoint) { return qemuCheckpointObjFromName(vm, checkpoint->name); @@ -107,13 +107,13 @@ qemuCheckpointObjFromCheckpoint(virDomainObjPtr vm, int -qemuCheckpointWriteMetadata(virDomainObjPtr vm, - virDomainMomentObjPtr checkpoint, - virDomainXMLOptionPtr xmlopt, +qemuCheckpointWriteMetadata(virDomainObj *vm, + virDomainMomentObj *checkpoint, + virDomainXMLOption *xmlopt, const char *checkpointDir) { unsigned int flags = VIR_DOMAIN_CHECKPOINT_FORMAT_SECURE; - virDomainCheckpointDefPtr def = virDomainCheckpointObjGetDef(checkpoint); + virDomainCheckpointDef *def = virDomainCheckpointObjGetDef(checkpoint); g_autofree char *newxml = NULL; g_autofree char *chkDir = NULL; g_autofree char *chkFile = NULL; @@ -136,19 +136,19 @@ qemuCheckpointWriteMetadata(virDomainObjPtr vm, int -qemuCheckpointDiscardDiskBitmaps(virStorageSourcePtr src, +qemuCheckpointDiscardDiskBitmaps(virStorageSource *src, GHashTable *blockNamedNodeData, const char *delbitmap, - virJSONValuePtr actions, + virJSONValue *actions, const char *diskdst, GSList **reopenimages) { - virStorageSourcePtr n; + virStorageSource *n; bool found = false; /* find the backing chain entry with bitmap named '@delbitmap' */ for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) { - qemuBlockNamedNodeDataBitmapPtr bitmapdata; + qemuBlockNamedNodeDataBitmap *bitmapdata; if (!(bitmapdata = qemuBlockNamedNodeDataGetBitmapByName(blockNamedNodeData, n, delbitmap))) @@ -177,11 +177,11 @@ qemuCheckpointDiscardDiskBitmaps(virStorageSourcePtr src, static int -qemuCheckpointDiscardBitmaps(virDomainObjPtr vm, - virDomainCheckpointDefPtr chkdef) +qemuCheckpointDiscardBitmaps(virDomainObj *vm, + virDomainCheckpointDef *chkdef) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(GHashTable) blockNamedNodeData = NULL; int rc = -1; g_autoptr(virJSONValue) actions = NULL; @@ -197,7 +197,7 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm, for (i = 0; i < chkdef->ndisks; i++) { virDomainCheckpointDiskDef *chkdisk = &chkdef->disks[i]; - virDomainDiskDefPtr domdisk = virDomainDiskByTarget(vm->def, chkdisk->name); + virDomainDiskDef *domdisk = virDomainDiskByTarget(vm->def, chkdisk->name); /* domdisk can be missing e.g. when it was unplugged */ if (!domdisk) @@ -222,7 +222,7 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm, /* label any non-top images for read-write access */ for (next = reopenimages; next; next = next->next) { - virStorageSourcePtr src = next->data; + virStorageSource *src = next->data; if (qemuDomainStorageSourceAccessAllow(driver, vm, src, false, false, false) < 0) @@ -242,7 +242,7 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm, relabel: for (next = relabelimages; next; next = next->next) { - virStorageSourcePtr src = next->data; + virStorageSource *src = next->data; if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN)) ignore_value(qemuBlockReopenReadOnly(vm, src, QEMU_ASYNC_JOB_NONE)); @@ -256,9 +256,9 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm, static int -qemuCheckpointDiscard(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMomentObjPtr chk, +qemuCheckpointDiscard(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMomentObj *chk, bool update_parent, bool metadata_only) { @@ -276,13 +276,13 @@ qemuCheckpointDiscard(virQEMUDriverPtr driver, chk->def->name); if (!metadata_only) { - virDomainCheckpointDefPtr chkdef = virDomainCheckpointObjGetDef(chk); + virDomainCheckpointDef *chkdef = virDomainCheckpointObjGetDef(chk); if (qemuCheckpointDiscardBitmaps(vm, chkdef) < 0) return -1; } if (chkcurrent) { - virDomainMomentObjPtr parent = NULL; + virDomainMomentObj *parent = NULL; virDomainCheckpointSetCurrent(vm->checkpoints, NULL); parent = virDomainCheckpointFindByName(vm->checkpoints, @@ -311,8 +311,8 @@ qemuCheckpointDiscard(virQEMUDriverPtr driver, int -qemuCheckpointDiscardAllMetadata(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuCheckpointDiscardAllMetadata(virQEMUDriver *driver, + virDomainObj *vm) { virQEMUMomentRemove rem = { .driver = driver, @@ -331,13 +331,13 @@ qemuCheckpointDiscardAllMetadata(virQEMUDriverPtr driver, /* Called inside job lock */ static int -qemuCheckpointPrepare(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainCheckpointDefPtr def) +qemuCheckpointPrepare(virQEMUDriver *driver, + virDomainObj *vm, + virDomainCheckpointDef *def) { size_t i; g_autofree char *xml = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; /* Easiest way to clone inactive portion of vm->def is via * conversion in and back out of xml. */ @@ -354,7 +354,7 @@ qemuCheckpointPrepare(virQEMUDriverPtr driver, return -1; for (i = 0; i < def->ndisks; i++) { - virDomainCheckpointDiskDefPtr disk = &def->disks[i]; + virDomainCheckpointDiskDef *disk = &def->disks[i]; if (disk->type != VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP) continue; @@ -384,15 +384,15 @@ qemuCheckpointPrepare(virQEMUDriverPtr driver, } static int -qemuCheckpointAddActions(virDomainObjPtr vm, - virJSONValuePtr actions, - virDomainCheckpointDefPtr def) +qemuCheckpointAddActions(virDomainObj *vm, + virJSONValue *actions, + virDomainCheckpointDef *def) { size_t i; for (i = 0; i < def->ndisks; i++) { virDomainCheckpointDiskDef *chkdisk = &def->disks[i]; - virDomainDiskDefPtr domdisk = virDomainDiskByTarget(vm->def, chkdisk->name); + virDomainDiskDef *domdisk = virDomainDiskByTarget(vm->def, chkdisk->name); /* checkpoint definition validator mandates that the corresponding * domdisk should exist */ @@ -409,8 +409,8 @@ qemuCheckpointAddActions(virDomainObjPtr vm, static int -qemuCheckpointRedefineValidateBitmaps(virDomainObjPtr vm, - virDomainCheckpointDefPtr chkdef) +qemuCheckpointRedefineValidateBitmaps(virDomainObj *vm, + virDomainCheckpointDef *chkdef) { g_autoptr(GHashTable) blockNamedNodeData = NULL; size_t i; @@ -422,8 +422,8 @@ qemuCheckpointRedefineValidateBitmaps(virDomainObjPtr vm, return -1; for (i = 0; i < chkdef->ndisks; i++) { - virDomainCheckpointDiskDefPtr chkdisk = chkdef->disks + i; - virDomainDiskDefPtr domdisk; + virDomainCheckpointDiskDef *chkdisk = chkdef->disks + i; + virDomainDiskDef *domdisk; if (chkdisk->type != VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP) continue; @@ -445,9 +445,9 @@ qemuCheckpointRedefineValidateBitmaps(virDomainObjPtr vm, } -static virDomainMomentObjPtr -qemuCheckpointRedefine(virDomainObjPtr vm, - virDomainCheckpointDefPtr *def, +static virDomainMomentObj * +qemuCheckpointRedefine(virDomainObj *vm, + virDomainCheckpointDef **def, bool *update_current, bool validate_bitmaps) { @@ -463,14 +463,14 @@ qemuCheckpointRedefine(virDomainObjPtr vm, int -qemuCheckpointCreateCommon(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainCheckpointDefPtr *def, - virJSONValuePtr *actions, - virDomainMomentObjPtr *chk) +qemuCheckpointCreateCommon(virQEMUDriver *driver, + virDomainObj *vm, + virDomainCheckpointDef **def, + virJSONValue **actions, + virDomainMomentObj **chk) { g_autoptr(virJSONValue) tmpactions = NULL; - virDomainMomentObjPtr parent; + virDomainMomentObj *parent; if (qemuCheckpointPrepare(driver, vm, *def) < 0) return -1; @@ -501,8 +501,8 @@ qemuCheckpointCreateCommon(virQEMUDriverPtr driver, * If @chk is not null remove the @chk object from the list of checkpoints of @vm. */ void -qemuCheckpointRollbackMetadata(virDomainObjPtr vm, - virDomainMomentObjPtr chk) +qemuCheckpointRollbackMetadata(virDomainObj *vm, + virDomainMomentObj *chk) { if (!chk) return; @@ -511,13 +511,13 @@ qemuCheckpointRollbackMetadata(virDomainObjPtr vm, } -static virDomainMomentObjPtr -qemuCheckpointCreate(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainCheckpointDefPtr *def) +static virDomainMomentObj * +qemuCheckpointCreate(virQEMUDriver *driver, + virDomainObj *vm, + virDomainCheckpointDef **def) { g_autoptr(virJSONValue) actions = NULL; - virDomainMomentObjPtr chk = NULL; + virDomainMomentObj *chk = NULL; int rc; if (qemuCheckpointCreateCommon(driver, vm, def, &actions, &chk) < 0) @@ -535,10 +535,10 @@ qemuCheckpointCreate(virQEMUDriverPtr driver, int -qemuCheckpointCreateFinalize(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virQEMUDriverConfigPtr cfg, - virDomainMomentObjPtr chk, +qemuCheckpointCreateFinalize(virQEMUDriver *driver, + virDomainObj *vm, + virQEMUDriverConfig *cfg, + virDomainMomentObj *chk, bool update_current) { if (update_current) @@ -564,13 +564,13 @@ qemuCheckpointCreateFinalize(virQEMUDriverPtr driver, virDomainCheckpointPtr qemuCheckpointCreateXML(virDomainPtr domain, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlDesc, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; - virDomainMomentObjPtr chk = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; + virDomainMomentObj *chk = NULL; virDomainCheckpointPtr checkpoint = NULL; bool update_current = true; bool redefine = flags & VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE; @@ -636,17 +636,17 @@ qemuCheckpointCreateXML(virDomainPtr domain, struct qemuCheckpointDiskMap { - virDomainCheckpointDiskDefPtr chkdisk; - virDomainDiskDefPtr domdisk; + virDomainCheckpointDiskDef *chkdisk; + virDomainDiskDef *domdisk; }; static int -qemuCheckpointGetXMLDescUpdateSize(virDomainObjPtr vm, - virDomainCheckpointDefPtr chkdef) +qemuCheckpointGetXMLDescUpdateSize(virDomainObj *vm, + virDomainCheckpointDef *chkdef) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(GHashTable) blockNamedNodeData = NULL; g_autofree struct qemuCheckpointDiskMap *diskmap = NULL; g_autoptr(virJSONValue) recoveractions = NULL; @@ -671,8 +671,8 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObjPtr vm, diskmap = g_new0(struct qemuCheckpointDiskMap, chkdef->ndisks); for (i = 0; i < chkdef->ndisks; i++) { - virDomainCheckpointDiskDefPtr chkdisk = chkdef->disks + i; - virDomainDiskDefPtr domdisk; + virDomainCheckpointDiskDef *chkdisk = chkdef->disks + i; + virDomainDiskDef *domdisk; chkdisk->size = 0; chkdisk->sizeValid = false; @@ -698,7 +698,7 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObjPtr vm, /* we need to calculate the merged bitmap to obtain accurate data */ for (i = 0; i < ndisks; i++) { - virDomainDiskDefPtr domdisk = diskmap[i].domdisk; + virDomainDiskDef *domdisk = diskmap[i].domdisk; g_autoptr(virJSONValue) actions = NULL; /* possibly delete leftovers from previous cases */ @@ -752,9 +752,9 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObjPtr vm, /* update disks */ for (i = 0; i < ndisks; i++) { - virDomainCheckpointDiskDefPtr chkdisk = diskmap[i].chkdisk; - virDomainDiskDefPtr domdisk = diskmap[i].domdisk; - qemuBlockNamedNodeDataBitmapPtr bitmap; + virDomainCheckpointDiskDef *chkdisk = diskmap[i].chkdisk; + virDomainDiskDef *domdisk = diskmap[i].domdisk; + qemuBlockNamedNodeDataBitmap *bitmap; if ((bitmap = qemuBlockNamedNodeDataGetBitmapByName(blockNamedNodeData, domdisk->src, "libvirt-tmp-size-xml"))) { @@ -772,14 +772,14 @@ qemuCheckpointGetXMLDescUpdateSize(virDomainObjPtr vm, char * -qemuCheckpointGetXMLDesc(virDomainObjPtr vm, +qemuCheckpointGetXMLDesc(virDomainObj *vm, virDomainCheckpointPtr checkpoint, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; - virDomainMomentObjPtr chk = NULL; - virDomainCheckpointDefPtr chkdef; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; + virDomainMomentObj *chk = NULL; + virDomainCheckpointDef *chkdef; unsigned int format_flags; virCheckFlags(VIR_DOMAIN_CHECKPOINT_XML_SECURE | @@ -803,9 +803,9 @@ qemuCheckpointGetXMLDesc(virDomainObjPtr vm, struct virQEMUCheckpointReparent { const char *dir; - virDomainMomentObjPtr parent; - virDomainObjPtr vm; - virDomainXMLOptionPtr xmlopt; + virDomainMomentObj *parent; + virDomainObj *vm; + virDomainXMLOption *xmlopt; int err; }; @@ -815,7 +815,7 @@ qemuCheckpointReparentChildren(void *payload, const char *name G_GNUC_UNUSED, void *data) { - virDomainMomentObjPtr moment = payload; + virDomainMomentObj *moment = payload; struct virQEMUCheckpointReparent *rep = data; if (rep->err < 0) @@ -833,15 +833,15 @@ qemuCheckpointReparentChildren(void *payload, int -qemuCheckpointDelete(virDomainObjPtr vm, +qemuCheckpointDelete(virDomainObj *vm, virDomainCheckpointPtr checkpoint, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); int ret = -1; - virDomainMomentObjPtr chk = NULL; + virDomainMomentObj *chk = NULL; virQEMUMomentRemove rem; struct virQEMUCheckpointReparent rep; bool metadata_only = !!(flags & VIR_DOMAIN_CHECKPOINT_DELETE_METADATA_ONLY); diff --git a/src/qemu/qemu_checkpoint.h b/src/qemu/qemu_checkpoint.h index 26264aee03..351995a31d 100644 --- a/src/qemu/qemu_checkpoint.h +++ b/src/qemu/qemu_checkpoint.h @@ -22,66 +22,66 @@ #include "datatypes.h" #include "qemu_conf.h" -virDomainObjPtr +virDomainObj * qemuDomObjFromCheckpoint(virDomainCheckpointPtr checkpoint); -virDomainMomentObjPtr -qemuCheckpointObjFromCheckpoint(virDomainObjPtr vm, +virDomainMomentObj * +qemuCheckpointObjFromCheckpoint(virDomainObj *vm, virDomainCheckpointPtr checkpoint); -virDomainMomentObjPtr -qemuCheckpointObjFromName(virDomainObjPtr vm, +virDomainMomentObj * +qemuCheckpointObjFromName(virDomainObj *vm, const char *name); int -qemuCheckpointDiscardAllMetadata(virQEMUDriverPtr driver, - virDomainObjPtr vm); +qemuCheckpointDiscardAllMetadata(virQEMUDriver *driver, + virDomainObj *vm); virDomainCheckpointPtr qemuCheckpointCreateXML(virDomainPtr domain, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlDesc, unsigned int flags); char * -qemuCheckpointGetXMLDesc(virDomainObjPtr vm, +qemuCheckpointGetXMLDesc(virDomainObj *vm, virDomainCheckpointPtr checkpoint, unsigned int flags); int -qemuCheckpointDelete(virDomainObjPtr vm, +qemuCheckpointDelete(virDomainObj *vm, virDomainCheckpointPtr checkpoint, unsigned int flags); int -qemuCheckpointCreateCommon(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainCheckpointDefPtr *def, - virJSONValuePtr *actions, - virDomainMomentObjPtr *chk); +qemuCheckpointCreateCommon(virQEMUDriver *driver, + virDomainObj *vm, + virDomainCheckpointDef **def, + virJSONValue **actions, + virDomainMomentObj **chk); int -qemuCheckpointCreateFinalize(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virQEMUDriverConfigPtr cfg, - virDomainMomentObjPtr chk, +qemuCheckpointCreateFinalize(virQEMUDriver *driver, + virDomainObj *vm, + virQEMUDriverConfig *cfg, + virDomainMomentObj *chk, bool update_current); void -qemuCheckpointRollbackMetadata(virDomainObjPtr vm, - virDomainMomentObjPtr chk); +qemuCheckpointRollbackMetadata(virDomainObj *vm, + virDomainMomentObj *chk); int -qemuCheckpointDiscardDiskBitmaps(virStorageSourcePtr src, +qemuCheckpointDiscardDiskBitmaps(virStorageSource *src, GHashTable *blockNamedNodeData, const char *delbitmap, - virJSONValuePtr actions, + virJSONValue *actions, const char *diskdst, GSList **reopenimages); int -qemuCheckpointWriteMetadata(virDomainObjPtr vm, - virDomainMomentObjPtr checkpoint, - virDomainXMLOptionPtr xmlopt, +qemuCheckpointWriteMetadata(virDomainObj *vm, + virDomainMomentObj *checkpoint, + virDomainXMLOption *xmlopt, const char *checkpointDir); diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 45eb0dc976..83bebdd2a8 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -229,8 +229,8 @@ qemuBuildObjectCommandlineFromJSON(virBuffer *buf, * Returns 0 on success, -1 w/ error message on failure */ static int -qemuBuildMasterKeyCommandLine(virCommandPtr cmd, - qemuDomainObjPrivatePtr priv) +qemuBuildMasterKeyCommandLine(virCommand *cmd, + qemuDomainObjPrivate *priv) { g_autofree char *alias = NULL; g_autofree char *path = NULL; @@ -301,7 +301,7 @@ qemuBuildFDSet(int fd, size_t idx) * This function for example returns "set=10,fd=20". */ static char * -qemuVirCommandGetFDSet(virCommandPtr cmd, int fd) +qemuVirCommandGetFDSet(virCommand *cmd, int fd) { int idx = virCommandPassFDGetFDIndex(cmd, fd); @@ -326,7 +326,7 @@ qemuVirCommandGetFDSet(virCommandPtr cmd, int fd) * 'transferred' in a virCommandPassFD() call. */ static char * -qemuVirCommandGetDevSet(virCommandPtr cmd, int fd) +qemuVirCommandGetDevSet(virCommand *cmd, int fd) { int idx = virCommandPassFDGetFDIndex(cmd, fd); @@ -341,10 +341,10 @@ qemuVirCommandGetDevSet(virCommandPtr cmd, int fd) static int -qemuBuildDeviceAddressStr(virBufferPtr buf, +qemuBuildDeviceAddressStr(virBuffer *buf, const virDomainDef *domainDef, - virDomainDeviceInfoPtr info, - virQEMUCapsPtr qemuCaps) + virDomainDeviceInfo *info, + virQEMUCaps *qemuCaps) { g_autofree char *devStr = NULL; const char *contAlias = NULL; @@ -358,7 +358,7 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, if (!(devStr = virPCIDeviceAddressAsString(&info->addr.pci))) return -1; for (i = 0; i < domainDef->ncontrollers; i++) { - virDomainControllerDefPtr cont = domainDef->controllers[i]; + virDomainControllerDef *cont = domainDef->controllers[i]; if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI && cont->idx == info->addr.pci.bus) { @@ -482,11 +482,11 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, /** * qemuBuildVirtioDevStr - * @buf: virBufferPtr to append the built string + * @buf: virBuffer * to append the built string * @baseName: qemu virtio device basename string. Ex: virtio-rng for * @qemuCaps: virQEMUCapPtr * @devtype: virDomainDeviceType of the device. Ex: VIR_DOMAIN_DEVICE_TYPE_RNG - * @devdata: *DefPtr of the device definition + * @devdata: *Def * of the device definition * * Build the qemu virtio -device name from the passed parameters. Currently * this is mostly about attaching the correct string prefix to @baseName for @@ -496,15 +496,15 @@ qemuBuildDeviceAddressStr(virBufferPtr buf, * Returns: -1 on failure, 0 on success */ static int -qemuBuildVirtioDevStr(virBufferPtr buf, +qemuBuildVirtioDevStr(virBuffer *buf, const char *baseName, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, virDomainDeviceType devtype, void *devdata) { const char *implName = NULL; virDomainDeviceDef device = { .type = devtype }; - virDomainDeviceInfoPtr info; + virDomainDeviceInfo *info; bool has_tmodel, has_ntmodel; virDomainDeviceSetData(&device, devdata); @@ -668,8 +668,8 @@ qemuBuildVirtioDevStr(virBufferPtr buf, } static void -qemuBuildVirtioOptionsStr(virBufferPtr buf, - virDomainVirtioOptionsPtr virtio) +qemuBuildVirtioOptionsStr(virBuffer *buf, + virDomainVirtioOptions *virtio) { if (!virtio) return; @@ -689,8 +689,8 @@ qemuBuildVirtioOptionsStr(virBufferPtr buf, } static int -qemuBuildRomStr(virBufferPtr buf, - virDomainDeviceInfoPtr info) +qemuBuildRomStr(virBuffer *buf, + virDomainDeviceInfo *info) { if (info->romenabled || info->rombar || info->romfile) { if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { @@ -726,9 +726,9 @@ qemuBuildRomStr(virBufferPtr buf, } static int -qemuBuildIoEventFdStr(virBufferPtr buf, +qemuBuildIoEventFdStr(virBuffer *buf, virTristateSwitch use, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (use && virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_IOEVENTFD)) virBufferAsprintf(buf, ",ioeventfd=%s", @@ -747,8 +747,8 @@ qemuBuildIoEventFdStr(virBufferPtr buf, * returns -1 on failure error message set. */ int -qemuBuildSecretInfoProps(qemuDomainSecretInfoPtr secinfo, - virJSONValuePtr *propsret) +qemuBuildSecretInfoProps(qemuDomainSecretInfo *secinfo, + virJSONValue **propsret) { g_autofree char *keyid = NULL; @@ -777,8 +777,8 @@ qemuBuildSecretInfoProps(qemuDomainSecretInfoPtr secinfo, * Returns 0 on success, -1 w/ error message on failure */ static int -qemuBuildObjectSecretCommandLine(virCommandPtr cmd, - qemuDomainSecretInfoPtr secinfo, +qemuBuildObjectSecretCommandLine(virCommand *cmd, + qemuDomainSecretInfo *secinfo, virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -809,8 +809,8 @@ qemuBuildObjectSecretCommandLine(virCommandPtr cmd, * -1 and error message if fail to add secret information */ static int -qemuBuildGeneralSecinfoURI(virURIPtr uri, - qemuDomainSecretInfoPtr secinfo) +qemuBuildGeneralSecinfoURI(virURI *uri, + qemuDomainSecretInfo *secinfo) { if (!secinfo) return 0; @@ -852,8 +852,8 @@ qemuBuildGeneralSecinfoURI(virURIPtr uri, * -1 and error message if fail to add secret information */ static int -qemuBuildRBDSecinfoURI(virBufferPtr buf, - qemuDomainSecretInfoPtr secinfo) +qemuBuildRBDSecinfoURI(virBuffer *buf, + qemuDomainSecretInfo *secinfo) { g_autofree char *base64secret = NULL; @@ -905,8 +905,8 @@ qemuBuildTLSx509BackendProps(const char *tlspath, bool verifypeer, const char *alias, const char *secalias, - virQEMUCapsPtr qemuCaps, - virJSONValuePtr *propsret) + virQEMUCaps *qemuCaps, + virJSONValue **propsret) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_OBJECT_TLS_CREDS_X509)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -941,13 +941,13 @@ qemuBuildTLSx509BackendProps(const char *tlspath, * Returns 0 on success, -1 on failure with error set. */ static int -qemuBuildTLSx509CommandLine(virCommandPtr cmd, +qemuBuildTLSx509CommandLine(virCommand *cmd, const char *tlspath, bool isListen, bool verifypeer, const char *certEncSecretAlias, const char *alias, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_autoptr(virJSONValue) props = NULL; @@ -967,8 +967,8 @@ qemuBuildTLSx509CommandLine(virCommandPtr cmd, static char * -qemuBuildNetworkDriveURI(virStorageSourcePtr src, - qemuDomainSecretInfoPtr secinfo) +qemuBuildNetworkDriveURI(virStorageSource *src, + qemuDomainSecretInfo *secinfo) { g_autoptr(virURI) uri = NULL; @@ -986,8 +986,8 @@ qemuBuildNetworkDriveURI(virStorageSourcePtr src, static char * -qemuBuildNetworkDriveStr(virStorageSourcePtr src, - qemuDomainSecretInfoPtr secinfo) +qemuBuildNetworkDriveStr(virStorageSource *src, + qemuDomainSecretInfo *secinfo) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t i; @@ -1138,8 +1138,8 @@ qemuBuildNetworkDriveStr(virStorageSourcePtr src, int -qemuGetDriveSourceString(virStorageSourcePtr src, - qemuDomainSecretInfoPtr secinfo, +qemuGetDriveSourceString(virStorageSource *src, + qemuDomainSecretInfo *secinfo, char **source) { int actualType = virStorageSourceGetActualType(src); @@ -1176,7 +1176,7 @@ qemuGetDriveSourceString(virStorageSourcePtr src, bool -qemuDiskConfigBlkdeviotuneEnabled(virDomainDiskDefPtr disk) +qemuDiskConfigBlkdeviotuneEnabled(virDomainDiskDef *disk) { return !!disk->blkdeviotune.group_name || virDomainBlockIoTuneInfoHasAny(&disk->blkdeviotune); @@ -1198,10 +1198,10 @@ qemuDiskConfigBlkdeviotuneEnabled(virDomainDiskDefPtr disk) * which automatically enforces FIPS compliance. */ bool -qemuCheckFips(virDomainObjPtr vm) +qemuCheckFips(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUCapsPtr qemuCaps = priv->qemuCaps; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUCaps *qemuCaps = priv->qemuCaps; if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_ENABLE_FIPS)) return false; @@ -1243,8 +1243,8 @@ qemuDiskBusIsSD(int bus) * the legacy representation. */ static bool -qemuDiskSourceNeedsProps(virStorageSourcePtr src, - virQEMUCapsPtr qemuCaps) +qemuDiskSourceNeedsProps(virStorageSource *src, + virQEMUCaps *qemuCaps) { int actualType = virStorageSourceGetActualType(src); @@ -1281,11 +1281,11 @@ qemuDiskSourceNeedsProps(virStorageSourcePtr src, * Returns the disk source struct wrapped so that it can be used as disk source * directly by converting it from json. */ -static virJSONValuePtr -qemuDiskSourceGetProps(virStorageSourcePtr src) +static virJSONValue * +qemuDiskSourceGetProps(virStorageSource *src) { g_autoptr(virJSONValue) props = NULL; - virJSONValuePtr ret; + virJSONValue *ret; if (!(props = qemuBlockStorageSourceGetBackendProps(src, QEMU_BLOCK_STORAGE_SOURCE_BACKEND_PROPS_LEGACY))) @@ -1299,8 +1299,8 @@ qemuDiskSourceGetProps(virStorageSourcePtr src) static int -qemuBuildDriveSourcePR(virBufferPtr buf, - virDomainDiskDefPtr disk) +qemuBuildDriveSourcePR(virBuffer *buf, + virDomainDiskDef *disk) { g_autofree char *alias = NULL; const char *defaultAlias = NULL; @@ -1320,14 +1320,14 @@ qemuBuildDriveSourcePR(virBufferPtr buf, static int -qemuBuildDriveSourceStr(virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps, - virBufferPtr buf) +qemuBuildDriveSourceStr(virDomainDiskDef *disk, + virQEMUCaps *qemuCaps, + virBuffer *buf) { int actualType = virStorageSourceGetActualType(disk->src); - qemuDomainStorageSourcePrivatePtr srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src); - qemuDomainSecretInfoPtr secinfo = NULL; - qemuDomainSecretInfoPtr encinfo = NULL; + qemuDomainStorageSourcePrivate *srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src); + qemuDomainSecretInfo *secinfo = NULL; + qemuDomainSecretInfo *encinfo = NULL; g_autoptr(virJSONValue) srcprops = NULL; g_autofree char *source = NULL; bool rawluks = false; @@ -1415,8 +1415,8 @@ qemuBuildDriveSourceStr(virDomainDiskDefPtr disk, static void -qemuBuildDiskThrottling(virDomainDiskDefPtr disk, - virBufferPtr buf) +qemuBuildDiskThrottling(virDomainDiskDef *disk, + virBuffer *buf) { #define IOTUNE_ADD(_field, _label) \ if (disk->blkdeviotune._field) { \ @@ -1455,8 +1455,8 @@ qemuBuildDiskThrottling(virDomainDiskDefPtr disk, static void -qemuBuildDiskFrontendAttributeErrorPolicy(virDomainDiskDefPtr disk, - virBufferPtr buf) +qemuBuildDiskFrontendAttributeErrorPolicy(virDomainDiskDef *disk, + virBuffer *buf) { const char *wpolicy = NULL; const char *rpolicy = NULL; @@ -1486,8 +1486,8 @@ qemuBuildDiskFrontendAttributeErrorPolicy(virDomainDiskDefPtr disk, static void -qemuBuildDiskFrontendAttributes(virDomainDiskDefPtr disk, - virBufferPtr buf) +qemuBuildDiskFrontendAttributes(virDomainDiskDef *disk, + virBuffer *buf) { /* generate geometry command string */ if (disk->geometry.cylinders > 0 && @@ -1511,8 +1511,8 @@ qemuBuildDiskFrontendAttributes(virDomainDiskDefPtr disk, static char * -qemuBuildDriveStr(virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps) +qemuBuildDriveStr(virDomainDiskDef *disk, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER; int detect_zeroes = virDomainDiskGetDetectZeroesMode(disk->discard, @@ -1584,7 +1584,7 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk, static bool qemuCheckIOThreads(const virDomainDef *def, - virDomainDiskDefPtr disk) + virDomainDiskDef *disk) { /* Right "type" of disk" */ switch ((virDomainDiskBus)disk->bus) { @@ -1626,9 +1626,9 @@ qemuCheckIOThreads(const virDomainDef *def, static int -qemuBuildDriveDevCacheStr(virDomainDiskDefPtr disk, - virBufferPtr buf, - virQEMUCapsPtr qemuCaps) +qemuBuildDriveDevCacheStr(virDomainDiskDef *disk, + virBuffer *buf, + virQEMUCaps *qemuCaps) { bool wb; @@ -1656,9 +1656,9 @@ qemuBuildDriveDevCacheStr(virDomainDiskDefPtr disk, char * qemuBuildDiskDeviceStr(const virDomainDef *def, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, unsigned int bootindex, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER; const char *contAlias; @@ -1925,7 +1925,7 @@ qemuBuildDiskDeviceStr(const virDomainDef *def, } char * -qemuBuildZPCIDevStr(virDomainDeviceInfoPtr dev) +qemuBuildZPCIDevStr(virDomainDeviceInfo *dev) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -1940,8 +1940,8 @@ qemuBuildZPCIDevStr(virDomainDeviceInfoPtr dev) } static int -qemuCommandAddZPCIDevice(virCommandPtr cmd, - virDomainDeviceInfoPtr dev) +qemuCommandAddZPCIDevice(virCommand *cmd, + virDomainDeviceInfo *dev) { g_autofree char *devstr = NULL; @@ -1956,8 +1956,8 @@ qemuCommandAddZPCIDevice(virCommandPtr cmd, } static int -qemuCommandAddExtDevice(virCommandPtr cmd, - virDomainDeviceInfoPtr dev) +qemuCommandAddExtDevice(virCommand *cmd, + virDomainDeviceInfo *dev) { if (dev->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI || dev->addr.pci.extFlags == VIR_PCI_ADDRESS_EXTENSION_NONE) { @@ -1971,9 +1971,9 @@ qemuCommandAddExtDevice(virCommandPtr cmd, } static int -qemuBuildFloppyCommandLineControllerOptions(virCommandPtr cmd, +qemuBuildFloppyCommandLineControllerOptions(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, unsigned int bootFloppy) { g_auto(virBuffer) fdc_opts = VIR_BUFFER_INITIALIZER; @@ -1989,7 +1989,7 @@ qemuBuildFloppyCommandLineControllerOptions(virCommandPtr cmd, g_autofree char *backendAlias = NULL; g_autofree char *backendStr = NULL; g_autofree char *bootindexStr = NULL; - virDomainDiskDefPtr disk = def->disks[i]; + virDomainDiskDef *disk = def->disks[i]; if (disk->bus != VIR_DOMAIN_DISK_BUS_FDC) continue; @@ -2048,8 +2048,8 @@ qemuBuildFloppyCommandLineControllerOptions(virCommandPtr cmd, static int -qemuBuildObjectCommandline(virCommandPtr cmd, - virJSONValuePtr objProps, +qemuBuildObjectCommandline(virCommand *cmd, + virJSONValue *objProps, virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -2068,8 +2068,8 @@ qemuBuildObjectCommandline(virCommandPtr cmd, static int -qemuBuildBlockStorageSourceAttachDataCommandline(virCommandPtr cmd, - qemuBlockStorageSourceAttachDataPtr data, +qemuBuildBlockStorageSourceAttachDataCommandline(virCommand *cmd, + qemuBlockStorageSourceAttachData *data, virQEMUCaps *qemuCaps) { char *tmp; @@ -2117,9 +2117,9 @@ qemuBuildBlockStorageSourceAttachDataCommandline(virCommandPtr cmd, static int -qemuBuildDiskSourceCommandLine(virCommandPtr cmd, - virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps) +qemuBuildDiskSourceCommandLine(virCommand *cmd, + virDomainDiskDef *disk, + virQEMUCaps *qemuCaps) { g_autoptr(qemuBlockStorageSourceChainData) data = NULL; g_autoptr(virJSONValue) copyOnReadProps = NULL; @@ -2165,10 +2165,10 @@ qemuBuildDiskSourceCommandLine(virCommandPtr cmd, static int -qemuBuildDiskCommandLine(virCommandPtr cmd, +qemuBuildDiskCommandLine(virCommand *cmd, const virDomainDef *def, - virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps, + virDomainDiskDef *disk, + virQEMUCaps *qemuCaps, unsigned int bootindex) { g_autofree char *optstr = NULL; @@ -2202,9 +2202,9 @@ qemuBuildDiskCommandLine(virCommandPtr cmd, static int -qemuBuildDisksCommandLine(virCommandPtr cmd, +qemuBuildDisksCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i; unsigned int bootCD = 0; @@ -2233,7 +2233,7 @@ qemuBuildDisksCommandLine(virCommandPtr cmd, return -1; for (i = 0; i < def->ndisks; i++) { - virDomainDiskDefPtr disk = def->disks[i]; + virDomainDiskDef *disk = def->disks[i]; unsigned int bootindex = 0; if (disk->info.bootIndex) { @@ -2270,10 +2270,10 @@ qemuBuildDisksCommandLine(virCommandPtr cmd, static int -qemuBuildVHostUserFsCommandLine(virCommandPtr cmd, +qemuBuildVHostUserFsCommandLine(virCommand *cmd, virDomainFSDef *fs, const virDomainDef *def, - qemuDomainObjPrivatePtr priv) + qemuDomainObjPrivate *priv) { g_autofree char *chardev_alias = NULL; g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER; @@ -2312,7 +2312,7 @@ qemuBuildVHostUserFsCommandLine(virCommandPtr cmd, static char * -qemuBuildFSStr(virDomainFSDefPtr fs) +qemuBuildFSStr(virDomainFSDef *fs) { g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER; const char *wrpolicy = virDomainFSWrpolicyTypeToString(fs->wrpolicy); @@ -2361,8 +2361,8 @@ qemuBuildFSStr(virDomainFSDefPtr fs) static char * qemuBuildFSDevStr(const virDomainDef *def, - virDomainFSDefPtr fs, - virQEMUCapsPtr qemuCaps) + virDomainFSDef *fs, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER; @@ -2386,10 +2386,10 @@ qemuBuildFSDevStr(const virDomainDef *def, static int -qemuBuildFSDevCommandLine(virCommandPtr cmd, - virDomainFSDefPtr fs, +qemuBuildFSDevCommandLine(virCommand *cmd, + virDomainFSDef *fs, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { g_autofree char *fsdevstr = NULL; g_autofree char *devicestr = NULL; @@ -2412,10 +2412,10 @@ qemuBuildFSDevCommandLine(virCommandPtr cmd, static int -qemuBuildFilesystemCommandLine(virCommandPtr cmd, +qemuBuildFilesystemCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, - qemuDomainObjPrivatePtr priv) + virQEMUCaps *qemuCaps, + qemuDomainObjPrivate *priv) { size_t i; @@ -2503,8 +2503,8 @@ qemuBuildUSBControllerFindMasterAlias(const virDomainDef *domainDef, static int qemuBuildUSBControllerDevStr(const virDomainDef *domainDef, - virDomainControllerDefPtr def, - virQEMUCapsPtr qemuCaps, + virDomainControllerDef *def, + virQEMUCaps *qemuCaps, virBuffer *buf) { const char *smodel; @@ -2583,8 +2583,8 @@ qemuBuildUSBControllerDevStr(const virDomainDef *domainDef, */ int qemuBuildControllerDevStr(const virDomainDef *domainDef, - virDomainControllerDefPtr def, - virQEMUCapsPtr qemuCaps, + virDomainControllerDef *def, + virQEMUCaps *qemuCaps, char **devstr) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -2793,7 +2793,7 @@ qemuBuildDomainForbidLegacyUSBController(const virDomainDef *def) static int -qemuBuildLegacyUSBControllerCommandLine(virCommandPtr cmd, +qemuBuildLegacyUSBControllerCommandLine(virCommand *cmd, const virDomainDef *def) { size_t i; @@ -2801,7 +2801,7 @@ qemuBuildLegacyUSBControllerCommandLine(virCommandPtr cmd, size_t nusb = 0; for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; if (cont->type != VIR_DOMAIN_CONTROLLER_TYPE_USB) continue; @@ -2883,15 +2883,15 @@ qemuBuildSkipController(const virDomainControllerDef *controller, static int -qemuBuildControllersByTypeCommandLine(virCommandPtr cmd, +qemuBuildControllersByTypeCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, virDomainControllerType type) { size_t i; for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; g_autofree char *devstr = NULL; if (cont->type != type) @@ -2942,9 +2942,9 @@ qemuBuildControllersByTypeCommandLine(virCommandPtr cmd, static int -qemuBuildControllersCommandLine(virCommandPtr cmd, +qemuBuildControllersCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i; int contOrder[] = { @@ -2987,7 +2987,7 @@ qemuBuildControllersCommandLine(virCommandPtr cmd, static int -qemuBuildMemoryBackendPropsShare(virJSONValuePtr props, +qemuBuildMemoryBackendPropsShare(virJSONValue *props, virDomainMemoryAccess memAccess) { switch (memAccess) { @@ -3007,10 +3007,10 @@ qemuBuildMemoryBackendPropsShare(virJSONValuePtr props, static int -qemuBuildMemoryGetDefaultPagesize(virQEMUDriverConfigPtr cfg, +qemuBuildMemoryGetDefaultPagesize(virQEMUDriverConfig *cfg, unsigned long long *pagesize) { - virHugeTLBFSPtr p; + virHugeTLBFS *p; if (!cfg->nhugetlbfs) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -3053,10 +3053,10 @@ qemuBuildMemoryGetDefaultPagesize(virQEMUDriverConfigPtr cfg, * -1 on error. */ int -qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, +qemuBuildMemoryBackendProps(virJSONValue **backendProps, const char *alias, - virQEMUDriverConfigPtr cfg, - qemuDomainObjPrivatePtr priv, + virQEMUDriverConfig *cfg, + qemuDomainObjPrivate *priv, const virDomainDef *def, const virDomainMemoryDef *mem, bool force, @@ -3069,7 +3069,7 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, size_t i; g_autofree char *memPath = NULL; bool prealloc = false; - virBitmapPtr nodemask = NULL; + virBitmap *nodemask = NULL; int rc; g_autoptr(virJSONValue) props = NULL; bool nodeSpecified = virDomainNumatuneNodeSpecified(def->numa, mem->targetNode); @@ -3121,8 +3121,8 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, mode = VIR_DOMAIN_NUMATUNE_MEM_STRICT; if (pagesize == 0) { - virDomainHugePagePtr master_hugepage = NULL; - virDomainHugePagePtr hugepage = NULL; + virDomainHugePage *master_hugepage = NULL; + virDomainHugePage *hugepage = NULL; bool thisHugepage = false; /* Find the huge page size we want to use */ @@ -3356,11 +3356,11 @@ qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, static int -qemuBuildMemoryCellBackendStr(virDomainDefPtr def, - virQEMUDriverConfigPtr cfg, +qemuBuildMemoryCellBackendStr(virDomainDef *def, + virQEMUDriverConfig *cfg, size_t cell, - qemuDomainObjPrivatePtr priv, - virBufferPtr buf) + qemuDomainObjPrivate *priv, + virBuffer *buf) { g_autoptr(virJSONValue) props = NULL; g_autofree char *alias = NULL; @@ -3387,11 +3387,11 @@ qemuBuildMemoryCellBackendStr(virDomainDefPtr def, static int -qemuBuildMemoryDimmBackendStr(virBufferPtr buf, - virDomainMemoryDefPtr mem, - virDomainDefPtr def, - virQEMUDriverConfigPtr cfg, - qemuDomainObjPrivatePtr priv) +qemuBuildMemoryDimmBackendStr(virBuffer *buf, + virDomainMemoryDef *mem, + virDomainDef *def, + virQEMUDriverConfig *cfg, + qemuDomainObjPrivate *priv) { g_autoptr(virJSONValue) props = NULL; g_autofree char *alias = NULL; @@ -3417,8 +3417,8 @@ qemuBuildMemoryDimmBackendStr(virBufferPtr buf, char * qemuBuildMemoryDeviceStr(const virDomainDef *def, - virDomainMemoryDefPtr mem, - virQEMUCapsPtr qemuCaps) + virDomainMemoryDef *mem, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char *device = NULL; @@ -3479,7 +3479,7 @@ qemuBuildMemoryDeviceStr(const virDomainDef *def, static char * -qemuBuildLegacyNicStr(virDomainNetDefPtr net) +qemuBuildLegacyNicStr(virDomainNetDef *net) { char *str; char macaddr[VIR_MAC_STRING_BUFLEN]; @@ -3497,11 +3497,11 @@ qemuBuildLegacyNicStr(virDomainNetDefPtr net) char * -qemuBuildNicDevStr(virDomainDefPtr def, - virDomainNetDefPtr net, +qemuBuildNicDevStr(virDomainDef *def, + virDomainNetDef *net, unsigned int bootindex, size_t vhostfdSize, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; bool usingVirtio = false; @@ -3644,8 +3644,8 @@ qemuBuildNicDevStr(virDomainDefPtr def, } -virJSONValuePtr -qemuBuildHostNetStr(virDomainNetDefPtr net, +virJSONValue * +qemuBuildHostNetStr(virDomainNetDef *net, char **tapfd, size_t tapfdSize, char **vhostfd, @@ -3839,8 +3839,8 @@ qemuBuildHostNetStr(virDomainNetDefPtr net, char * qemuBuildWatchdogDevStr(const virDomainDef *def, - virDomainWatchdogDefPtr dev, - virQEMUCapsPtr qemuCaps) + virDomainWatchdogDef *dev, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -3860,11 +3860,11 @@ qemuBuildWatchdogDevStr(const virDomainDef *def, static int -qemuBuildWatchdogCommandLine(virCommandPtr cmd, +qemuBuildWatchdogCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { - virDomainWatchdogDefPtr watchdog = def->watchdog; + virDomainWatchdogDef *watchdog = def->watchdog; g_autofree char *optstr = NULL; const char *action; int actualAction; @@ -3903,9 +3903,9 @@ qemuBuildWatchdogCommandLine(virCommandPtr cmd, static int -qemuBuildMemballoonCommandLine(virCommandPtr cmd, +qemuBuildMemballoonCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -3944,7 +3944,7 @@ qemuBuildMemballoonCommandLine(virCommandPtr cmd, static char * -qemuBuildNVRAMDevStr(virDomainNVRAMDefPtr dev) +qemuBuildNVRAMDevStr(virDomainNVRAMDef *dev) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -3956,7 +3956,7 @@ qemuBuildNVRAMDevStr(virDomainNVRAMDefPtr dev) static int -qemuBuildNVRAMCommandLine(virCommandPtr cmd, +qemuBuildNVRAMCommandLine(virCommand *cmd, const virDomainDef *def) { g_autofree char *optstr = NULL; @@ -3977,8 +3977,8 @@ qemuBuildNVRAMCommandLine(virCommandPtr cmd, static char * qemuBuildVirtioInputDevStr(const virDomainDef *def, - virDomainInputDefPtr dev, - virQEMUCapsPtr qemuCaps) + virDomainInputDef *dev, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -4030,8 +4030,8 @@ qemuBuildVirtioInputDevStr(const virDomainDef *def, static char * qemuBuildUSBInputDevStr(const virDomainDef *def, - virDomainInputDefPtr dev, - virQEMUCapsPtr qemuCaps) + virDomainInputDef *dev, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -4057,8 +4057,8 @@ qemuBuildUSBInputDevStr(const virDomainDef *def, int qemuBuildInputDevStr(char **devstr, const virDomainDef *def, - virDomainInputDefPtr input, - virQEMUCapsPtr qemuCaps) + virDomainInputDef *input, + virQEMUCaps *qemuCaps) { switch (input->bus) { case VIR_DOMAIN_INPUT_BUS_USB: @@ -4076,14 +4076,14 @@ qemuBuildInputDevStr(char **devstr, static int -qemuBuildInputCommandLine(virCommandPtr cmd, +qemuBuildInputCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i; for (i = 0; i < def->ninputs; i++) { - virDomainInputDefPtr input = def->inputs[i]; + virDomainInputDef *input = def->inputs[i]; g_autofree char *devstr = NULL; if (qemuCommandAddExtDevice(cmd, &input->info) < 0) @@ -4104,7 +4104,7 @@ qemuBuildInputCommandLine(virCommandPtr cmd, static char * qemuGetAudioIDString(const virDomainDef *def, int id) { - virDomainAudioDefPtr audio = virDomainDefFindAudioByID(def, id); + virDomainAudioDef *audio = virDomainDefFindAudioByID(def, id); if (!audio) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("unable to find audio backend for sound device")); @@ -4115,8 +4115,8 @@ qemuGetAudioIDString(const virDomainDef *def, int id) static char * qemuBuildSoundDevStr(const virDomainDef *def, - virDomainSoundDefPtr sound, - virQEMUCapsPtr qemuCaps) + virDomainSoundDef *sound, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char *model = NULL; @@ -4164,9 +4164,9 @@ qemuBuildSoundDevStr(const virDomainDef *def, static char * qemuBuildSoundCodecStr(const virDomainDef *def, - virDomainSoundDefPtr sound, - virDomainSoundCodecDefPtr codec, - virQEMUCapsPtr qemuCaps) + virDomainSoundDef *sound, + virDomainSoundCodecDef *codec, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char *stype; @@ -4190,14 +4190,14 @@ qemuBuildSoundCodecStr(const virDomainDef *def, static int -qemuBuildSoundCommandLine(virCommandPtr cmd, +qemuBuildSoundCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i, j; for (i = 0; i < def->nsounds; i++) { - virDomainSoundDefPtr sound = def->sounds[i]; + virDomainSoundDef *sound = def->sounds[i]; g_autofree char *str = NULL; /* Sadly pcspk device doesn't use -device syntax. Fortunately @@ -4251,8 +4251,8 @@ qemuBuildSoundCommandLine(virCommandPtr cmd, static char * qemuBuildDeviceVideoStr(const virDomainDef *def, - virDomainVideoDefPtr video, - virQEMUCapsPtr qemuCaps) + virDomainVideoDef *video, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char *model = NULL; @@ -4363,9 +4363,9 @@ qemuBuildDeviceVideoStr(const virDomainDef *def, static int -qemuBuildVgaVideoCommand(virCommandPtr cmd, - virDomainVideoDefPtr video, - virQEMUCapsPtr qemuCaps) +qemuBuildVgaVideoCommand(virCommand *cmd, + virDomainVideoDef *video, + virQEMUCaps *qemuCaps) { const char *dev; const char *vgastr = qemuVideoTypeToString(video->type); @@ -4449,7 +4449,7 @@ qemuBuildVgaVideoCommand(virCommandPtr cmd, static char * qemuBuildVhostUserChardevStr(const char *alias, int *fd, - virCommandPtr cmd) + virCommand *cmd) { g_autofree char *chardev_alias = qemuDomainGetVhostUserChrAlias(alias); char *chardev = NULL; @@ -4470,15 +4470,15 @@ qemuBuildVhostUserChardevStr(const char *alias, static int -qemuBuildVideoCommandLine(virCommandPtr cmd, +qemuBuildVideoCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i; for (i = 0; i < def->nvideos; i++) { g_autofree char *chardev = NULL; - virDomainVideoDefPtr video = def->videos[i]; + virDomainVideoDef *video = def->videos[i]; if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) { if (!(chardev = qemuBuildVhostUserChardevStr(video->info.alias, @@ -4492,7 +4492,7 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, for (i = 0; i < def->nvideos; i++) { g_autofree char *str = NULL; - virDomainVideoDefPtr video = def->videos[i]; + virDomainVideoDef *video = def->videos[i]; if (video->type == VIR_DOMAIN_VIDEO_TYPE_NONE) continue; @@ -4533,14 +4533,14 @@ qemuBuildVideoCommandLine(virCommandPtr cmd, char * qemuBuildPCIHostdevDevStr(const virDomainDef *def, - virDomainHostdevDefPtr dev, + virDomainHostdevDef *dev, unsigned int bootIndex, /* used iff dev->info->bootIndex == 0 */ - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virDomainHostdevSubsysPCIPtr pcisrc = &dev->source.subsys.u.pci; + virDomainHostdevSubsysPCI *pcisrc = &dev->source.subsys.u.pci; int backend = pcisrc->backend; - virDomainNetTeamingInfoPtr teaming; + virDomainNetTeamingInfo *teaming; /* caller has to assign proper passthrough backend type */ switch ((virDomainHostdevSubsysPCIBackendType)backend) { @@ -4592,11 +4592,11 @@ qemuBuildPCIHostdevDevStr(const virDomainDef *def, char * qemuBuildUSBHostdevDevStr(const virDomainDef *def, - virDomainHostdevDefPtr dev, - virQEMUCapsPtr qemuCaps) + virDomainHostdevDef *dev, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virDomainHostdevSubsysUSBPtr usbsrc = &dev->source.subsys.u.usb; + virDomainHostdevSubsysUSB *usbsrc = &dev->source.subsys.u.usb; virBufferAddLit(&buf, "usb-host"); if (!dev->missing) { @@ -4627,8 +4627,8 @@ qemuBuildUSBHostdevDevStr(const virDomainDef *def, static char * qemuBuildHubDevStr(const virDomainDef *def, - virDomainHubDefPtr dev, - virQEMUCapsPtr qemuCaps) + virDomainHubDef *dev, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -4642,14 +4642,14 @@ qemuBuildHubDevStr(const virDomainDef *def, static int -qemuBuildHubCommandLine(virCommandPtr cmd, +qemuBuildHubCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i; for (i = 0; i < def->nhubs; i++) { - virDomainHubDefPtr hub = def->hubs[i]; + virDomainHubDef *hub = def->hubs[i]; g_autofree char *optstr = NULL; virCommandAddArg(cmd, "-device"); @@ -4663,15 +4663,15 @@ qemuBuildHubCommandLine(virCommandPtr cmd, static char * -qemuBuildSCSIiSCSIHostdevDrvStr(virDomainHostdevDefPtr dev, - virQEMUCapsPtr qemuCaps) +qemuBuildSCSIiSCSIHostdevDrvStr(virDomainHostdevDef *dev, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_autofree char *netsource = NULL; g_autoptr(virJSONValue) srcprops = NULL; - virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &scsisrc->u.iscsi; - qemuDomainStorageSourcePrivatePtr srcPriv = + virDomainHostdevSubsysSCSI *scsisrc = &dev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIiSCSI *iscsisrc = &scsisrc->u.iscsi; + qemuDomainStorageSourcePrivate *srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(iscsisrc->src); if (qemuDiskSourceNeedsProps(iscsisrc->src, qemuCaps)) { @@ -4695,12 +4695,12 @@ qemuBuildSCSIiSCSIHostdevDrvStr(virDomainHostdevDefPtr dev, char * qemuBuildSCSIVHostHostdevDevStr(const virDomainDef *def, - virDomainHostdevDefPtr dev, - virQEMUCapsPtr qemuCaps, + virDomainHostdevDef *dev, + virQEMUCaps *qemuCaps, char *vhostfdName) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virDomainHostdevSubsysSCSIVHostPtr hostsrc = &dev->source.subsys.u.scsi_host; + virDomainHostdevSubsysSCSIVHost *hostsrc = &dev->source.subsys.u.scsi_host; if (qemuBuildVirtioDevStr(&buf, "vhost-scsi", qemuCaps, VIR_DOMAIN_DEVICE_HOSTDEV, dev) < 0) { @@ -4719,13 +4719,13 @@ qemuBuildSCSIVHostHostdevDevStr(const virDomainDef *def, } static char * -qemuBuildSCSIHostdevDrvStr(virDomainHostdevDefPtr dev, - virQEMUCapsPtr qemuCaps) +qemuBuildSCSIHostdevDrvStr(virDomainHostdevDef *dev, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_autofree char *source = NULL; g_autofree char *drivealias = NULL; - virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSI *scsisrc = &dev->source.subsys.u.scsi; if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) { if (!(source = qemuBuildSCSIiSCSIHostdevDrvStr(dev, qemuCaps))) @@ -4747,7 +4747,7 @@ qemuBuildSCSIHostdevDrvStr(virDomainHostdevDefPtr dev, char * qemuBuildSCSIHostdevDevStr(const virDomainDef *def, - virDomainHostdevDefPtr dev, + virDomainHostdevDef *dev, const char *backendAlias) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -4802,10 +4802,10 @@ qemuBuildSCSIHostdevDevStr(const virDomainDef *def, } static int -qemuBuildChrChardevFileStr(virLogManagerPtr logManager, - virCommandPtr cmd, +qemuBuildChrChardevFileStr(virLogManager *logManager, + virCommand *cmd, const virDomainDef *def, - virBufferPtr buf, + virBuffer *buf, const char *filearg, const char *fileval, const char *appendarg, int appendval) { @@ -4849,7 +4849,7 @@ qemuBuildChrChardevFileStr(virLogManagerPtr logManager, static void -qemuBuildChrChardevReconnectStr(virBufferPtr buf, +qemuBuildChrChardevReconnectStr(virBuffer *buf, const virDomainChrSourceReconnectDef *def) { if (def->enabled == VIR_TRISTATE_BOOL_YES) { @@ -4926,17 +4926,17 @@ enum { /* This function outputs a -chardev command line option which describes only the * host side of the character device */ static char * -qemuBuildChrChardevStr(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, +qemuBuildChrChardevStr(virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virQEMUDriverConfig *cfg, const virDomainDef *def, const virDomainChrSourceDef *dev, const char *alias, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, unsigned int cdevflags) { - qemuDomainChrSourcePrivatePtr chrSourcePriv = QEMU_DOMAIN_CHR_SOURCE_PRIVATE(dev); + qemuDomainChrSourcePrivate *chrSourcePriv = QEMU_DOMAIN_CHR_SOURCE_PRIVATE(dev); g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; bool telnet; g_autofree char *charAlias = NULL; @@ -5061,10 +5061,10 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager, virQEMUCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_FD_PASS)) { int fd; - if (qemuSecuritySetSocketLabel(secManager, (virDomainDefPtr)def) < 0) + if (qemuSecuritySetSocketLabel(secManager, (virDomainDef *)def) < 0) return NULL; fd = qemuOpenChrChardevUNIXSocket(dev); - if (qemuSecurityClearSocketLabel(secManager, (virDomainDefPtr)def) < 0) { + if (qemuSecurityClearSocketLabel(secManager, (virDomainDef *)def) < 0) { VIR_FORCE_CLOSE(fd); return NULL; } @@ -5116,7 +5116,7 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager, static const char * -qemuBuildHostdevMdevModelTypeString(virDomainHostdevSubsysMediatedDevPtr mdev) +qemuBuildHostdevMdevModelTypeString(virDomainHostdevSubsysMediatedDev *mdev) { /* when the 'ramfb' attribute is set, we must use the nohotplug variant * rather than 'vfio-pci' */ @@ -5130,11 +5130,11 @@ qemuBuildHostdevMdevModelTypeString(virDomainHostdevSubsysMediatedDevPtr mdev) char * qemuBuildHostdevMediatedDevStr(const virDomainDef *def, - virDomainHostdevDefPtr dev, - virQEMUCapsPtr qemuCaps) + virDomainHostdevDef *dev, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev; + virDomainHostdevSubsysMediatedDev *mdevsrc = &dev->source.subsys.u.mdev; g_autofree char *mdevPath = NULL; const char *dev_str = NULL; @@ -5168,15 +5168,15 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *def, qemuBlockStorageSourceAttachData * -qemuBuildHostdevSCSIDetachPrepare(virDomainHostdevDefPtr hostdev, - virQEMUCapsPtr qemuCaps) +qemuBuildHostdevSCSIDetachPrepare(virDomainHostdevDef *hostdev, + virQEMUCaps *qemuCaps) { - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; g_autoptr(qemuBlockStorageSourceAttachData) ret = g_new0(qemuBlockStorageSourceAttachData, 1); if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI)) { - virStorageSourcePtr src; - qemuDomainStorageSourcePrivatePtr srcpriv; + virStorageSource *src; + qemuDomainStorageSourcePrivate *srcpriv; switch ((virDomainHostdevSCSIProtocolType) scsisrc->protocol) { case VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_NONE: @@ -5211,13 +5211,13 @@ qemuBuildHostdevSCSIDetachPrepare(virDomainHostdevDefPtr hostdev, qemuBlockStorageSourceAttachData * -qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDefPtr hostdev, +qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDef *hostdev, const char **backendAlias, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; g_autoptr(qemuBlockStorageSourceAttachData) ret = g_new0(qemuBlockStorageSourceAttachData, 1); - virStorageSourcePtr src = NULL; + virStorageSource *src = NULL; if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BLOCKDEV_HOSTDEV_SCSI)) { switch ((virDomainHostdevSCSIProtocolType) scsisrc->protocol) { @@ -5259,10 +5259,10 @@ qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDefPtr hostdev, static int -qemuBuildHostdevSCSICommandLine(virCommandPtr cmd, +qemuBuildHostdevSCSICommandLine(virCommand *cmd, const virDomainDef *def, - virDomainHostdevDefPtr hostdev, - virQEMUCapsPtr qemuCaps) + virDomainHostdevDef *hostdev, + virQEMUCaps *qemuCaps) { g_autoptr(qemuBlockStorageSourceAttachData) data = NULL; g_autofree char *devstr = NULL; @@ -5284,17 +5284,17 @@ qemuBuildHostdevSCSICommandLine(virCommandPtr cmd, static int -qemuBuildHostdevCommandLine(virCommandPtr cmd, +qemuBuildHostdevCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, unsigned int *bootHostdevNet) { size_t i; for (i = 0; i < def->nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = def->hostdevs[i]; - virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &subsys->u.mdev; + virDomainHostdevDef *hostdev = def->hostdevs[i]; + virDomainHostdevSubsys *subsys = &hostdev->source.subsys; + virDomainHostdevSubsysMediatedDev *mdevsrc = &subsys->u.mdev; g_autofree char *devstr = NULL; g_autofree char *vhostfdName = NULL; unsigned int bootIndex = hostdev->info->bootIndex; @@ -5402,12 +5402,12 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd, static int -qemuBuildMonitorCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, - virDomainDefPtr def, - qemuDomainObjPrivatePtr priv) +qemuBuildMonitorCommandLine(virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virQEMUDriverConfig *cfg, + virDomainDef *def, + qemuDomainObjPrivate *priv) { g_autofree char *chrdev = NULL; unsigned int cdevflags = QEMU_BUILD_CHARDEV_TCP_NOWAIT | @@ -5435,7 +5435,7 @@ qemuBuildMonitorCommandLine(virLogManagerPtr logManager, static char * qemuBuildVirtioSerialPortDevStr(const virDomainDef *def, - virDomainChrDefPtr dev) + virDomainChrDef *dev) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char *contAlias; @@ -5496,7 +5496,7 @@ qemuBuildVirtioSerialPortDevStr(const virDomainDef *def, } static char * -qemuBuildSclpDevStr(virDomainChrDefPtr dev) +qemuBuildSclpDevStr(virDomainChrDef *dev) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; if (dev->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE) { @@ -5521,13 +5521,13 @@ qemuBuildSclpDevStr(virDomainChrDefPtr dev) static int -qemuBuildRNGBackendChrdevStr(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, +qemuBuildRNGBackendChrdevStr(virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virQEMUDriverConfig *cfg, const virDomainDef *def, - virDomainRNGDefPtr rng, - virQEMUCapsPtr qemuCaps, + virDomainRNGDef *rng, + virQEMUCaps *qemuCaps, char **chr, bool chardevStdioLogd) { @@ -5561,8 +5561,8 @@ qemuBuildRNGBackendChrdevStr(virLogManagerPtr logManager, int -qemuBuildRNGBackendProps(virDomainRNGDefPtr rng, - virJSONValuePtr *props) +qemuBuildRNGBackendProps(virDomainRNGDef *rng, + virJSONValue **props) { g_autofree char *objAlias = NULL; g_autofree char *charBackendAlias = NULL; @@ -5606,8 +5606,8 @@ qemuBuildRNGBackendProps(virDomainRNGDefPtr rng, char * qemuBuildRNGDevStr(const virDomainDef *def, - virDomainRNGDefPtr dev, - virQEMUCapsPtr qemuCaps) + virDomainRNGDef *dev, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -5641,12 +5641,12 @@ qemuBuildRNGDevStr(const virDomainDef *def, static int -qemuBuildRNGCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, +qemuBuildRNGCommandLine(virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virQEMUDriverConfig *cfg, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, bool chardevStdioLogd) { size_t i; @@ -5654,7 +5654,7 @@ qemuBuildRNGCommandLine(virLogManagerPtr logManager, for (i = 0; i < def->nrngs; i++) { g_autoptr(virJSONValue) props = NULL; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virDomainRNGDefPtr rng = def->rngs[i]; + virDomainRNGDef *rng = def->rngs[i]; g_autofree char *chardev = NULL; g_autofree char *devstr = NULL; int rc; @@ -5699,7 +5699,7 @@ qemuBuildRNGCommandLine(virLogManagerPtr logManager, static char * -qemuBuildSmbiosBiosStr(virSysinfoBIOSDefPtr def) +qemuBuildSmbiosBiosStr(virSysinfoBIOSDef *def) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -5734,7 +5734,7 @@ qemuBuildSmbiosBiosStr(virSysinfoBIOSDefPtr def) static char * -qemuBuildSmbiosSystemStr(virSysinfoSystemDefPtr def, +qemuBuildSmbiosSystemStr(virSysinfoSystemDef *def, bool skip_uuid) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -5788,7 +5788,7 @@ qemuBuildSmbiosSystemStr(virSysinfoSystemDefPtr def, static char * -qemuBuildSmbiosBaseBoardStr(virSysinfoBaseBoardDefPtr def) +qemuBuildSmbiosBaseBoardStr(virSysinfoBaseBoardDef *def) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -5831,7 +5831,7 @@ qemuBuildSmbiosBaseBoardStr(virSysinfoBaseBoardDefPtr def) static char * -qemuBuildSmbiosOEMStringsStr(virSysinfoOEMStringsDefPtr def) +qemuBuildSmbiosOEMStringsStr(virSysinfoOEMStringsDef *def) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t i; @@ -5851,7 +5851,7 @@ qemuBuildSmbiosOEMStringsStr(virSysinfoOEMStringsDefPtr def) static char * -qemuBuildSmbiosChassisStr(virSysinfoChassisDefPtr def) +qemuBuildSmbiosChassisStr(virSysinfoChassisDef *def) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -5889,12 +5889,12 @@ qemuBuildSmbiosChassisStr(virSysinfoChassisDefPtr def) static int -qemuBuildSmbiosCommandLine(virCommandPtr cmd, - virQEMUDriverPtr driver, +qemuBuildSmbiosCommandLine(virCommand *cmd, + virQEMUDriver *driver, const virDomainDef *def) { size_t i; - virSysinfoDefPtr source = NULL; + virSysinfoDef *source = NULL; bool skip_uuid = false; if (def->os.smbios_mode == VIR_DOMAIN_SMBIOS_NONE || @@ -5977,7 +5977,7 @@ qemuBuildSmbiosCommandLine(virCommandPtr cmd, static int -qemuBuildSysinfoCommandLine(virCommandPtr cmd, +qemuBuildSysinfoCommandLine(virCommand *cmd, const virDomainDef *def) { size_t i; @@ -6011,7 +6011,7 @@ qemuBuildSysinfoCommandLine(virCommandPtr cmd, static int -qemuBuildVMGenIDCommandLine(virCommandPtr cmd, +qemuBuildVMGenIDCommandLine(virCommand *cmd, const virDomainDef *def) { g_auto(virBuffer) opts = VIR_BUFFER_INITIALIZER; @@ -6031,7 +6031,7 @@ qemuBuildVMGenIDCommandLine(virCommandPtr cmd, static int -qemuBuildSgaCommandLine(virCommandPtr cmd, +qemuBuildSgaCommandLine(virCommand *cmd, const virDomainDef *def) { /* Serial graphics adapter */ @@ -6043,7 +6043,7 @@ qemuBuildSgaCommandLine(virCommandPtr cmd, static char * -qemuBuildClockArgStr(virDomainClockDefPtr def) +qemuBuildClockArgStr(virDomainClockDef *def) { size_t i; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -6151,9 +6151,9 @@ qemuBuildClockArgStr(virDomainClockDefPtr def) * virDomainDef is not const here. */ static int -qemuBuildClockCommandLine(virCommandPtr cmd, - virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuBuildClockCommandLine(virCommand *cmd, + virDomainDef *def, + virQEMUCaps *qemuCaps) { size_t i; g_autofree char *rtcopt = NULL; @@ -6233,11 +6233,11 @@ qemuBuildClockCommandLine(virCommandPtr cmd, static int -qemuBuildPMCommandLine(virCommandPtr cmd, +qemuBuildPMCommandLine(virCommand *cmd, const virDomainDef *def, - qemuDomainObjPrivatePtr priv) + qemuDomainObjPrivate *priv) { - virQEMUCapsPtr qemuCaps = priv->qemuCaps; + virQEMUCaps *qemuCaps = priv->qemuCaps; /* Only add -no-reboot option if each event destroys domain */ if (priv->allowReboot == VIR_TRISTATE_BOOL_NO) @@ -6284,9 +6284,9 @@ qemuBuildPMCommandLine(virCommandPtr cmd, static int -qemuBuildBootCommandLine(virCommandPtr cmd, +qemuBuildBootCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { g_auto(virBuffer) boot_buf = VIR_BUFFER_INITIALIZER; g_autofree char *boot_opts_str = NULL; @@ -6339,9 +6339,9 @@ qemuBuildBootCommandLine(virCommandPtr cmd, static int -qemuBuildIOMMUCommandLine(virCommandPtr cmd, +qemuBuildIOMMUCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { const virDomainIOMMUDef *iommu = def->iommu; @@ -6399,13 +6399,13 @@ qemuBuildIOMMUCommandLine(virCommandPtr cmd, static int -qemuBuildGlobalControllerCommandLine(virCommandPtr cmd, +qemuBuildGlobalControllerCommandLine(virCommand *cmd, const virDomainDef *def) { size_t i; for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI && cont->opts.pciopts.pcihole64) { const char *hoststr = NULL; @@ -6437,8 +6437,8 @@ qemuBuildGlobalControllerCommandLine(virCommandPtr cmd, static void -qemuBuildCpuFeature(virQEMUCapsPtr qemuCaps, - virBufferPtr buf, +qemuBuildCpuFeature(virQEMUCaps *qemuCaps, + virBuffer *buf, const char *name, bool state) { @@ -6452,13 +6452,13 @@ qemuBuildCpuFeature(virQEMUCapsPtr qemuCaps, static int -qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, +qemuBuildCpuModelArgStr(virQEMUDriver *driver, const virDomainDef *def, - virBufferPtr buf, - virQEMUCapsPtr qemuCaps) + virBuffer *buf, + virQEMUCaps *qemuCaps) { size_t i; - virCPUDefPtr cpu = def->cpu; + virCPUDef *cpu = def->cpu; switch ((virCPUMode) cpu->mode) { case VIR_CPU_MODE_HOST_PASSTHROUGH: @@ -6544,10 +6544,10 @@ qemuBuildCpuModelArgStr(virQEMUDriverPtr driver, } static int -qemuBuildCpuCommandLine(virCommandPtr cmd, - virQEMUDriverPtr driver, +qemuBuildCpuCommandLine(virCommand *cmd, + virQEMUDriver *driver, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { virArch hostarch = virArchFromHost(); g_autofree char *cpu = NULL; @@ -6583,7 +6583,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, /* Handle paravirtual timers */ for (i = 0; i < def->clock.ntimers; i++) { - virDomainTimerDefPtr timer = def->clock.timers[i]; + virDomainTimerDef *timer = def->clock.timers[i]; switch ((virDomainTimerNameType)timer->name) { case VIR_DOMAIN_TIMER_NAME_KVMCLOCK: @@ -6726,7 +6726,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, } if (def->cpu && def->cpu->cache) { - virCPUCacheDefPtr cache = def->cpu->cache; + virCPUCacheDef *cache = def->cpu->cache; bool hostOff = false; bool l3Off = false; @@ -6794,7 +6794,7 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, static bool -qemuAppendKeyWrapMachineParm(virBuffer *buf, virQEMUCapsPtr qemuCaps, +qemuAppendKeyWrapMachineParm(virBuffer *buf, virQEMUCaps *qemuCaps, int flag, const char *pname, int pstate) { if (pstate != VIR_TRISTATE_SWITCH_ABSENT) { @@ -6812,7 +6812,7 @@ qemuAppendKeyWrapMachineParm(virBuffer *buf, virQEMUCapsPtr qemuCaps, } static bool -qemuAppendKeyWrapMachineParms(virBuffer *buf, virQEMUCapsPtr qemuCaps, +qemuAppendKeyWrapMachineParms(virBuffer *buf, virQEMUCaps *qemuCaps, const virDomainKeyWrapDef *keywrap) { if (!qemuAppendKeyWrapMachineParm(buf, qemuCaps, QEMU_CAPS_AES_KEY_WRAP, @@ -6834,7 +6834,7 @@ qemuAppendLoadparmMachineParm(virBuffer *buf, size_t i = 0; for (i = 0; i < def->ndisks; i++) { - virDomainDiskDefPtr disk = def->disks[i]; + virDomainDiskDef *disk = def->disks[i]; if (disk->info.bootIndex == 1 && disk->info.loadparm) { virBufferAsprintf(buf, ",loadparm=%s", disk->info.loadparm); @@ -6844,7 +6844,7 @@ qemuAppendLoadparmMachineParm(virBuffer *buf, /* Network boot device */ for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; if (net->info.bootIndex == 1 && net->info.loadparm) { virBufferAsprintf(buf, ",loadparm=%s", net->info.loadparm); @@ -6855,10 +6855,10 @@ qemuAppendLoadparmMachineParm(virBuffer *buf, static int -qemuBuildNameCommandLine(virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, +qemuBuildNameCommandLine(virCommand *cmd, + virQEMUDriverConfig *cfg, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -6882,15 +6882,15 @@ qemuBuildNameCommandLine(virCommandPtr cmd, } static int -qemuBuildMachineCommandLine(virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, +qemuBuildMachineCommandLine(virCommand *cmd, + virQEMUDriverConfig *cfg, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, - qemuDomainObjPrivatePtr priv) + virQEMUCaps *qemuCaps, + qemuDomainObjPrivate *priv) { virTristateSwitch vmport = def->features[VIR_DOMAIN_FEATURE_VMPORT]; virTristateSwitch smm = def->features[VIR_DOMAIN_FEATURE_SMM]; - virCPUDefPtr cpu = def->cpu; + virCPUDef *cpu = def->cpu; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t i; @@ -7133,7 +7133,7 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, static void -qemuBuildTSEGCommandLine(virCommandPtr cmd, +qemuBuildTSEGCommandLine(virCommand *cmd, const virDomainDef *def) { if (!def->tseg_specified) @@ -7148,14 +7148,14 @@ qemuBuildTSEGCommandLine(virCommandPtr cmd, static int -qemuBuildSmpCommandLine(virCommandPtr cmd, - virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuBuildSmpCommandLine(virCommand *cmd, + virDomainDef *def, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; unsigned int maxvcpus = virDomainDefGetVcpusMax(def); unsigned int nvcpus = 0; - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; size_t i; /* count non-hotpluggable enabled vcpus. Hotpluggable ones will be added @@ -7198,8 +7198,8 @@ qemuBuildSmpCommandLine(virCommandPtr cmd, static int qemuBuildMemPathStr(const virDomainDef *def, - virCommandPtr cmd, - qemuDomainObjPrivatePtr priv) + virCommand *cmd, + qemuDomainObjPrivate *priv) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(priv->driver); const long system_page_size = virGetSystemPageSizeKB(); @@ -7236,9 +7236,9 @@ qemuBuildMemPathStr(const virDomainDef *def, static int -qemuBuildMemCommandLineMemoryDefaultBackend(virCommandPtr cmd, +qemuBuildMemCommandLineMemoryDefaultBackend(virCommand *cmd, const virDomainDef *def, - qemuDomainObjPrivatePtr priv, + qemuDomainObjPrivate *priv, const char *defaultRAMid) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(priv->driver); @@ -7264,10 +7264,10 @@ qemuBuildMemCommandLineMemoryDefaultBackend(virCommandPtr cmd, static int -qemuBuildMemCommandLine(virCommandPtr cmd, +qemuBuildMemCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, - qemuDomainObjPrivatePtr priv) + virQEMUCaps *qemuCaps, + qemuDomainObjPrivate *priv) { const char *defaultRAMid = NULL; @@ -7326,7 +7326,7 @@ qemuBuildMemCommandLine(virCommandPtr cmd, static int -qemuBuildIOThreadCommandLine(virCommandPtr cmd, +qemuBuildIOThreadCommandLine(virCommand *cmd, const virDomainDef *def, virQEMUCaps *qemuCaps) { @@ -7355,7 +7355,7 @@ qemuBuildIOThreadCommandLine(virCommandPtr cmd, static int -qemuBuilNumaCellCache(virCommandPtr cmd, +qemuBuilNumaCellCache(virCommand *cmd, const virDomainDef *def, size_t cell) { @@ -7433,7 +7433,7 @@ VIR_ENUM_IMPL(qemuDomainMemoryHierarchy, "third-level"); static int -qemuBuildNumaHMATCommandLine(virCommandPtr cmd, +qemuBuildNumaHMATCommandLine(virCommand *cmd, const virDomainDef *def) { size_t nlatencies; @@ -7483,16 +7483,16 @@ qemuBuildNumaHMATCommandLine(virCommandPtr cmd, static int -qemuBuildNumaCommandLine(virQEMUDriverConfigPtr cfg, - virDomainDefPtr def, - virCommandPtr cmd, - qemuDomainObjPrivatePtr priv) +qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg, + virDomainDef *def, + virCommand *cmd, + qemuDomainObjPrivate *priv) { size_t i, j; - virQEMUCapsPtr qemuCaps = priv->qemuCaps; + virQEMUCaps *qemuCaps = priv->qemuCaps; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; char *next = NULL; - virBufferPtr nodeBackends = NULL; + virBuffer *nodeBackends = NULL; bool needBackend = false; bool hmat = false; int rc; @@ -7549,7 +7549,7 @@ qemuBuildNumaCommandLine(virQEMUDriverConfigPtr cfg, } for (i = 0; i < ncells; i++) { - virBitmapPtr cpumask = virDomainNumaGetNodeCpumask(def->numa, i); + virBitmap *cpumask = virDomainNumaGetNodeCpumask(def->numa, i); ssize_t initiator = virDomainNumaGetNodeInitiator(def->numa, i); if (needBackend) { @@ -7634,10 +7634,10 @@ qemuBuildNumaCommandLine(virQEMUDriverConfigPtr cfg, static int -qemuBuildMemoryDeviceCommandLine(virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, - virDomainDefPtr def, - qemuDomainObjPrivatePtr priv) +qemuBuildMemoryDeviceCommandLine(virCommand *cmd, + virQEMUDriverConfig *cfg, + virDomainDef *def, + qemuDomainObjPrivate *priv) { size_t i; @@ -7665,9 +7665,9 @@ qemuBuildMemoryDeviceCommandLine(virCommandPtr cmd, } static void -qemuBuildAudioCommonArg(virBufferPtr buf, +qemuBuildAudioCommonArg(virBuffer *buf, const char *prefix, - virDomainAudioIOCommonPtr def) + virDomainAudioIOCommon *def) { if (def->mixingEngine) virBufferAsprintf(buf, ",%s.mixing-engine=%s", prefix, @@ -7693,27 +7693,27 @@ qemuBuildAudioCommonArg(virBufferPtr buf, } static void -qemuBuildAudioALSAArg(virBufferPtr buf, +qemuBuildAudioALSAArg(virBuffer *buf, const char *prefix, - virDomainAudioIOALSAPtr def) + virDomainAudioIOALSA *def) { if (def->dev) virBufferAsprintf(buf, ",%s.dev=%s", prefix, def->dev); } static void -qemuBuildAudioCoreAudioArg(virBufferPtr buf, +qemuBuildAudioCoreAudioArg(virBuffer *buf, const char *prefix, - virDomainAudioIOCoreAudioPtr def) + virDomainAudioIOCoreAudio *def) { if (def->bufferCount) virBufferAsprintf(buf, ",%s.buffer-count=%u", prefix, def->bufferCount); } static void -qemuBuildAudioJackArg(virBufferPtr buf, +qemuBuildAudioJackArg(virBuffer *buf, const char *prefix, - virDomainAudioIOJackPtr def) + virDomainAudioIOJack *def) { if (def->serverName) virBufferAsprintf(buf, ",%s.server-name=%s", prefix, def->serverName); @@ -7727,9 +7727,9 @@ qemuBuildAudioJackArg(virBufferPtr buf, } static void -qemuBuildAudioOSSArg(virBufferPtr buf, +qemuBuildAudioOSSArg(virBuffer *buf, const char *prefix, - virDomainAudioIOOSSPtr def) + virDomainAudioIOOSS *def) { if (def->dev) virBufferAsprintf(buf, ",%s.dev=%s", prefix, def->dev); @@ -7741,9 +7741,9 @@ qemuBuildAudioOSSArg(virBufferPtr buf, } static void -qemuBuildAudioPulseAudioArg(virBufferPtr buf, +qemuBuildAudioPulseAudioArg(virBuffer *buf, const char *prefix, - virDomainAudioIOPulseAudioPtr def) + virDomainAudioIOPulseAudio *def) { if (def->name) virBufferAsprintf(buf, ",%s.name=%s", prefix, def->name); @@ -7754,17 +7754,17 @@ qemuBuildAudioPulseAudioArg(virBufferPtr buf, } static void -qemuBuildAudioSDLArg(virBufferPtr buf, +qemuBuildAudioSDLArg(virBuffer *buf, const char *prefix, - virDomainAudioIOSDLPtr def) + virDomainAudioIOSDL *def) { if (def->bufferCount) virBufferAsprintf(buf, ",%s.buffer-count=%u", prefix, def->bufferCount); } static int -qemuBuildAudioCommandLineArg(virCommandPtr cmd, - virDomainAudioDefPtr def) +qemuBuildAudioCommandLineArg(virCommand *cmd, + virDomainAudioDef *def) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -7855,8 +7855,8 @@ qemuBuildAudioCommandLineArg(virCommandPtr cmd, } static int -qemuBuildAudioCommandLineArgs(virCommandPtr cmd, - virDomainDefPtr def) +qemuBuildAudioCommandLineArgs(virCommand *cmd, + virDomainDef *def) { size_t i; for (i = 0; i < def->naudios; i++) { @@ -7867,9 +7867,9 @@ qemuBuildAudioCommandLineArgs(virCommandPtr cmd, } static void -qemuBuildAudioCommonEnv(virCommandPtr cmd, +qemuBuildAudioCommonEnv(virCommand *cmd, const char *prefix, - virDomainAudioIOCommonPtr def) + virDomainAudioIOCommon *def) { if (def->fixedSettings) virCommandAddEnvFormat(cmd, "%sFIXED_SETTINGS=%s", @@ -7895,9 +7895,9 @@ qemuBuildAudioCommonEnv(virCommandPtr cmd, } static void -qemuBuildAudioALSAEnv(virCommandPtr cmd, +qemuBuildAudioALSAEnv(virCommand *cmd, const char *prefix, - virDomainAudioIOALSAPtr def) + virDomainAudioIOALSA *def) { if (def->dev) virCommandAddEnvFormat(cmd, "%sDEV=%s", @@ -7905,8 +7905,8 @@ qemuBuildAudioALSAEnv(virCommandPtr cmd, } static void -qemuBuildAudioCoreAudioEnv(virCommandPtr cmd, - virDomainAudioDefPtr def) +qemuBuildAudioCoreAudioEnv(virCommand *cmd, + virDomainAudioDef *def) { if (def->backend.coreaudio.output.bufferCount) virCommandAddEnvFormat(cmd, "QEMU_COREAUDIO_BUFFER_COUNT=%u", @@ -7917,10 +7917,10 @@ qemuBuildAudioCoreAudioEnv(virCommandPtr cmd, } static void -qemuBuildAudioOSSEnv(virCommandPtr cmd, +qemuBuildAudioOSSEnv(virCommand *cmd, const char *prefix, const char *prefix2, - virDomainAudioIOOSSPtr def) + virDomainAudioIOOSS *def) { if (def->dev) virCommandAddEnvFormat(cmd, "%sDEV=%s", @@ -7931,8 +7931,8 @@ qemuBuildAudioOSSEnv(virCommandPtr cmd, } static void -qemuBuildAudioPulseAudioEnv(virCommandPtr cmd, - virDomainAudioDefPtr def) +qemuBuildAudioPulseAudioEnv(virCommand *cmd, + virDomainAudioDef *def) { if (def->backend.pulseaudio.input.name) virCommandAddEnvPair(cmd, "QEMU_PA_SOURCE", @@ -7952,10 +7952,10 @@ qemuBuildAudioPulseAudioEnv(virCommandPtr cmd, static int -qemuBuildAudioCommandLineEnv(virCommandPtr cmd, - virDomainDefPtr def) +qemuBuildAudioCommandLineEnv(virCommand *cmd, + virDomainDef *def) { - virDomainAudioDefPtr audio; + virDomainAudioDef *audio; if (def->naudios != 1) return 0; @@ -8044,9 +8044,9 @@ qemuBuildAudioCommandLineEnv(virCommandPtr cmd, } static int -qemuBuildAudioCommandLine(virCommandPtr cmd, - virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuBuildAudioCommandLine(virCommand *cmd, + virDomainDef *def, + virQEMUCaps *qemuCaps) { if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_AUDIODEV)) return qemuBuildAudioCommandLineArgs(cmd, def); @@ -8056,10 +8056,10 @@ qemuBuildAudioCommandLine(virCommandPtr cmd, static int -qemuBuildGraphicsSDLCommandLine(virQEMUDriverConfigPtr cfg G_GNUC_UNUSED, - virCommandPtr cmd, - virQEMUCapsPtr qemuCaps G_GNUC_UNUSED, - virDomainGraphicsDefPtr graphics) +qemuBuildGraphicsSDLCommandLine(virQEMUDriverConfig *cfg G_GNUC_UNUSED, + virCommand *cmd, + virQEMUCaps *qemuCaps G_GNUC_UNUSED, + virDomainGraphicsDef *graphics) { g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER; @@ -8084,14 +8084,14 @@ qemuBuildGraphicsSDLCommandLine(virQEMUDriverConfigPtr cfg G_GNUC_UNUSED, static int -qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg, +qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfig *cfg, const virDomainDef *def, - virCommandPtr cmd, - virQEMUCapsPtr qemuCaps, - virDomainGraphicsDefPtr graphics) + virCommand *cmd, + virQEMUCaps *qemuCaps, + virDomainGraphicsDef *graphics) { g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER; - virDomainGraphicsListenDefPtr glisten = NULL; + virDomainGraphicsListenDef *glisten = NULL; bool escapeAddr; if (!(glisten = virDomainGraphicsGetListen(graphics, 0))) { @@ -8155,7 +8155,7 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg, } if (cfg->vncTLS) { - qemuDomainGraphicsPrivatePtr gfxPriv = QEMU_DOMAIN_GRAPHICS_PRIVATE(graphics); + qemuDomainGraphicsPrivate *gfxPriv = QEMU_DOMAIN_GRAPHICS_PRIVATE(graphics); if (gfxPriv->tlsAlias) { const char *secretAlias = NULL; @@ -8227,12 +8227,12 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg, static int -qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg, - virCommandPtr cmd, - virDomainGraphicsDefPtr graphics) +qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfig *cfg, + virCommand *cmd, + virDomainGraphicsDef *graphics) { g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER; - virDomainGraphicsListenDefPtr glisten = NULL; + virDomainGraphicsListenDef *glisten = NULL; int port = graphics->data.spice.port; int tlsPort = graphics->data.spice.tlsPort; size_t i; @@ -8432,9 +8432,9 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg, static int -qemuBuildGraphicsEGLHeadlessCommandLine(virQEMUDriverConfigPtr cfg G_GNUC_UNUSED, - virCommandPtr cmd, - virDomainGraphicsDefPtr graphics) +qemuBuildGraphicsEGLHeadlessCommandLine(virQEMUDriverConfig *cfg G_GNUC_UNUSED, + virCommand *cmd, + virDomainGraphicsDef *graphics) { g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER; @@ -8454,15 +8454,15 @@ qemuBuildGraphicsEGLHeadlessCommandLine(virQEMUDriverConfigPtr cfg G_GNUC_UNUSED static int -qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr cfg, - virCommandPtr cmd, - virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuBuildGraphicsCommandLine(virQEMUDriverConfig *cfg, + virCommand *cmd, + virDomainDef *def, + virQEMUCaps *qemuCaps) { size_t i; for (i = 0; i < def->ngraphics; i++) { - virDomainGraphicsDefPtr graphics = def->graphics[i]; + virDomainGraphicsDef *graphics = def->graphics[i]; switch (graphics->type) { case VIR_DOMAIN_GRAPHICS_TYPE_SDL: @@ -8503,13 +8503,13 @@ qemuBuildGraphicsCommandLine(virQEMUDriverConfigPtr cfg, } static int -qemuInterfaceVhostuserConnect(virQEMUDriverPtr driver, - virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virDomainDefPtr def, - virDomainNetDefPtr net, - virQEMUCapsPtr qemuCaps, +qemuInterfaceVhostuserConnect(virQEMUDriver *driver, + virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virDomainDef *def, + virDomainNetDef *net, + virQEMUCaps *qemuCaps, char **chardev) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); @@ -8546,13 +8546,13 @@ qemuInterfaceVhostuserConnect(virQEMUDriverPtr driver, } static int -qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virDomainNetDefPtr net, - virQEMUCapsPtr qemuCaps, +qemuBuildInterfaceCommandLine(virQEMUDriver *driver, + virDomainObj *vm, + virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virDomainNetDef *net, + virQEMUCaps *qemuCaps, unsigned int bootindex, virNetDevVPortProfileOp vmop, bool standalone, @@ -8560,7 +8560,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, int **nicindexes, unsigned int flags) { - virDomainDefPtr def = vm->def; + virDomainDef *def = vm->def; int ret = -1; g_autofree char *nic = NULL; g_autofree char *host = NULL; @@ -8577,7 +8577,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, virDomainNetType actualType = virDomainNetGetActualType(net); const virNetDevBandwidth *actualBandwidth; bool requireNicdev = false; - qemuSlirpPtr slirp; + qemuSlirp *slirp; size_t i; g_autoptr(virJSONValue) hostnetprops = NULL; @@ -8878,12 +8878,12 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver, * API domainSetSecurityTapFDLabel that doesn't use the const format. */ static int -qemuBuildNetCommandLine(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virQEMUCapsPtr qemuCaps, +qemuBuildNetCommandLine(virQEMUDriver *driver, + virDomainObj *vm, + virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virQEMUCaps *qemuCaps, virNetDevVPortProfileOp vmop, bool standalone, size_t *nnicindexes, @@ -8894,7 +8894,7 @@ qemuBuildNetCommandLine(virQEMUDriverPtr driver, size_t i; int last_good_net = -1; virErrorPtr originalError = NULL; - virDomainDefPtr def = vm->def; + virDomainDef *def = vm->def; if (def->nnets) { unsigned int bootNet = 0; @@ -8908,7 +8908,7 @@ qemuBuildNetCommandLine(virQEMUDriverPtr driver, } for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; if (qemuBuildInterfaceCommandLine(driver, vm, logManager, secManager, cmd, net, qemuCaps, bootNet, vmop, @@ -8970,16 +8970,16 @@ qemuBuildSmartcardFindCCIDController(const virDomainDef *def, static int -qemuBuildSmartcardCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, +qemuBuildSmartcardCommandLine(virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virQEMUDriverConfig *cfg, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, bool chardevStdioLogd) { size_t i; - virDomainSmartcardDefPtr smartcard; + virDomainSmartcardDef *smartcard; g_autofree char *devstr = NULL; g_auto(virBuffer) opt = VIR_BUFFER_INITIALIZER; const char *database; @@ -9063,9 +9063,9 @@ qemuBuildSmartcardCommandLine(virLogManagerPtr logManager, static char * -qemuBuildShmemDevLegacyStr(virDomainDefPtr def, - virDomainShmemDefPtr shmem, - virQEMUCapsPtr qemuCaps) +qemuBuildShmemDevLegacyStr(virDomainDef *def, + virDomainShmemDef *shmem, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -9096,9 +9096,9 @@ qemuBuildShmemDevLegacyStr(virDomainDefPtr def, } char * -qemuBuildShmemDevStr(virDomainDefPtr def, - virDomainShmemDefPtr shmem, - virQEMUCapsPtr qemuCaps) +qemuBuildShmemDevStr(virDomainDef *def, + virDomainShmemDef *shmem, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -9137,12 +9137,12 @@ qemuBuildShmemDevStr(virDomainDefPtr def, } -virJSONValuePtr -qemuBuildShmemBackendMemProps(virDomainShmemDefPtr shmem) +virJSONValue * +qemuBuildShmemBackendMemProps(virDomainShmemDef *shmem) { g_autofree char *mem_alias = NULL; g_autofree char *mem_path = NULL; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; mem_path = g_strdup_printf("/dev/shm/%s", shmem->name); @@ -9159,13 +9159,13 @@ qemuBuildShmemBackendMemProps(virDomainShmemDefPtr shmem) static int -qemuBuildShmemCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, - virDomainDefPtr def, - virDomainShmemDefPtr shmem, - virQEMUCapsPtr qemuCaps, +qemuBuildShmemCommandLine(virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virQEMUDriverConfig *cfg, + virDomainDef *def, + virDomainShmemDef *shmem, + virQEMUCaps *qemuCaps, bool chardevStdioLogd) { g_autoptr(virJSONValue) memProps = NULL; @@ -9283,10 +9283,10 @@ qemuChrSerialTargetModelToCaps(virDomainChrSerialTargetModel targetModel) static int -qemuBuildChrDeviceCommandLine(virCommandPtr cmd, +qemuBuildChrDeviceCommandLine(virCommand *cmd, const virDomainDef *def, - virDomainChrDefPtr chr, - virQEMUCapsPtr qemuCaps) + virDomainChrDef *chr, + virQEMUCaps *qemuCaps) { g_autofree char *devstr = NULL; @@ -9300,7 +9300,7 @@ qemuBuildChrDeviceCommandLine(virCommandPtr cmd, static bool qemuChrIsPlatformDevice(const virDomainDef *def, - virDomainChrDefPtr chr) + virDomainChrDef *chr) { if (def->os.arch == VIR_ARCH_ARMV6L || def->os.arch == VIR_ARCH_ARMV7L || @@ -9337,12 +9337,12 @@ qemuChrIsPlatformDevice(const virDomainDef *def, static int -qemuBuildSerialCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, +qemuBuildSerialCommandLine(virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virQEMUDriverConfig *cfg, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, bool chardevStdioLogd) { size_t i; @@ -9360,7 +9360,7 @@ qemuBuildSerialCommandLine(virLogManagerPtr logManager, } for (i = 0; i < def->nserials; i++) { - virDomainChrDefPtr serial = def->serials[i]; + virDomainChrDef *serial = def->serials[i]; g_autofree char *devstr = NULL; if (serial->source->type == VIR_DOMAIN_CHR_TYPE_SPICEPORT && !havespice) @@ -9401,12 +9401,12 @@ qemuBuildSerialCommandLine(virLogManagerPtr logManager, static int -qemuBuildParallelsCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, +qemuBuildParallelsCommandLine(virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virQEMUDriverConfig *cfg, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, bool chardevStdioLogd) { size_t i; @@ -9416,7 +9416,7 @@ qemuBuildParallelsCommandLine(virLogManagerPtr logManager, cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD; for (i = 0; i < def->nparallels; i++) { - virDomainChrDefPtr parallel = def->parallels[i]; + virDomainChrDef *parallel = def->parallels[i]; g_autofree char *devstr = NULL; if (!(devstr = qemuBuildChrChardevStr(logManager, secManager, @@ -9438,12 +9438,12 @@ qemuBuildParallelsCommandLine(virLogManagerPtr logManager, static int -qemuBuildChannelsCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, +qemuBuildChannelsCommandLine(virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virQEMUDriverConfig *cfg, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, bool chardevStdioLogd, unsigned int flags) { @@ -9454,7 +9454,7 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logManager, cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD; for (i = 0; i < def->nchannels; i++) { - virDomainChrDefPtr channel = def->channels[i]; + virDomainChrDef *channel = def->channels[i]; g_autofree char *chardevstr = NULL; g_autoptr(virJSONValue) netdevprops = NULL; g_autofree char *netdevstr = NULL; @@ -9498,12 +9498,12 @@ qemuBuildChannelsCommandLine(virLogManagerPtr logManager, static int -qemuBuildConsoleCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, +qemuBuildConsoleCommandLine(virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virQEMUDriverConfig *cfg, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, bool chardevStdioLogd) { size_t i; @@ -9514,7 +9514,7 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager, /* Explicit console devices */ for (i = 0; i < def->nconsoles; i++) { - virDomainChrDefPtr console = def->consoles[i]; + virDomainChrDef *console = def->consoles[i]; char *devstr; switch (console->targetType) { @@ -9577,12 +9577,12 @@ qemuBuildConsoleCommandLine(virLogManagerPtr logManager, char * qemuBuildRedirdevDevStr(const virDomainDef *def, - virDomainRedirdevDefPtr dev, - virQEMUCapsPtr qemuCaps) + virDomainRedirdevDef *dev, + virQEMUCaps *qemuCaps) { size_t i; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virDomainRedirFilterDefPtr redirfilter = def->redirfilter; + virDomainRedirFilterDef *redirfilter = def->redirfilter; virBufferAsprintf(&buf, "usb-redir,chardev=char%s,id=%s", dev->info.alias, dev->info.alias); @@ -9591,7 +9591,7 @@ qemuBuildRedirdevDevStr(const virDomainDef *def, virBufferAddLit(&buf, ",filter="); for (i = 0; i < redirfilter->nusbdevs; i++) { - virDomainRedirFilterUSBDevDefPtr usbdev = redirfilter->usbdevs[i]; + virDomainRedirFilterUSBDevDef *usbdev = redirfilter->usbdevs[i]; if (usbdev->usbClass >= 0) virBufferAsprintf(&buf, "0x%02X:", usbdev->usbClass); else @@ -9629,12 +9629,12 @@ qemuBuildRedirdevDevStr(const virDomainDef *def, static int -qemuBuildRedirdevCommandLine(virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, +qemuBuildRedirdevCommandLine(virLogManager *logManager, + virSecurityManager *secManager, + virCommand *cmd, + virQEMUDriverConfig *cfg, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, bool chardevStdioLogd) { size_t i; @@ -9644,7 +9644,7 @@ qemuBuildRedirdevCommandLine(virLogManagerPtr logManager, cdevflags |= QEMU_BUILD_CHARDEV_FILE_LOGD; for (i = 0; i < def->nredirdevs; i++) { - virDomainRedirdevDefPtr redirdev = def->redirdevs[i]; + virDomainRedirdevDef *redirdev = def->redirdevs[i]; char *devstr; if (!(devstr = qemuBuildChrChardevStr(logManager, secManager, @@ -9671,9 +9671,9 @@ qemuBuildRedirdevCommandLine(virLogManagerPtr logManager, static void -qemuBuldDomainLoaderPflashCommandLine(virCommandPtr cmd, - virDomainLoaderDefPtr loader, - virQEMUCapsPtr qemuCaps) +qemuBuldDomainLoaderPflashCommandLine(virCommand *cmd, + virDomainLoaderDef *loader, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; int unit = 0; @@ -9714,11 +9714,11 @@ qemuBuldDomainLoaderPflashCommandLine(virCommandPtr cmd, static void -qemuBuildDomainLoaderCommandLine(virCommandPtr cmd, - virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuBuildDomainLoaderCommandLine(virCommand *cmd, + virDomainDef *def, + virQEMUCaps *qemuCaps) { - virDomainLoaderDefPtr loader = def->os.loader; + virDomainLoaderDef *loader = def->os.loader; if (!loader) return; @@ -9743,8 +9743,8 @@ qemuBuildDomainLoaderCommandLine(virCommandPtr cmd, static char * qemuBuildTPMDevStr(const virDomainDef *def, - virDomainTPMDefPtr tpm, - virQEMUCapsPtr qemuCaps) + virDomainTPMDef *tpm, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char *model = virDomainTPMModelTypeToString(tpm->model); @@ -9788,8 +9788,8 @@ qemuBuildTPMOpenBackendFDs(const char *tpmdev, static char * -qemuBuildTPMBackendStr(virCommandPtr cmd, - virDomainTPMDefPtr tpm, +qemuBuildTPMBackendStr(virCommand *cmd, + virDomainTPMDef *tpm, int *tpmfd, int *cancelfd, char **chardev) @@ -9845,10 +9845,10 @@ qemuBuildTPMBackendStr(virCommandPtr cmd, static int -qemuBuildTPMCommandLine(virCommandPtr cmd, +qemuBuildTPMCommandLine(virCommand *cmd, const virDomainDef *def, - virDomainTPMDefPtr tpm, - virQEMUCapsPtr qemuCaps) + virDomainTPMDef *tpm, + virQEMUCaps *qemuCaps) { char *optstr; g_autofree char *chardev = NULL; @@ -9896,8 +9896,8 @@ qemuBuildTPMCommandLine(virCommandPtr cmd, static int -qemuBuildTPMProxyCommandLine(virCommandPtr cmd, - virDomainTPMDefPtr tpm) +qemuBuildTPMProxyCommandLine(virCommand *cmd, + virDomainTPMDef *tpm) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char *filePath = NULL; @@ -9916,9 +9916,9 @@ qemuBuildTPMProxyCommandLine(virCommandPtr cmd, static int -qemuBuildTPMsCommandLine(virCommandPtr cmd, +qemuBuildTPMsCommandLine(virCommand *cmd, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i; @@ -9937,12 +9937,12 @@ qemuBuildTPMsCommandLine(virCommandPtr cmd, static int -qemuBuildSEVCommandLine(virDomainObjPtr vm, virCommandPtr cmd, - virDomainSEVDefPtr sev) +qemuBuildSEVCommandLine(virDomainObj *vm, virCommand *cmd, + virDomainSEVDef *sev) { g_autoptr(virJSONValue) props = NULL; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *dhpath = NULL; g_autofree char *sessionpath = NULL; @@ -9976,7 +9976,7 @@ qemuBuildSEVCommandLine(virDomainObjPtr vm, virCommandPtr cmd, } static int -qemuBuildVMCoreInfoCommandLine(virCommandPtr cmd, +qemuBuildVMCoreInfoCommandLine(virCommand *cmd, const virDomainDef *def) { virTristateSwitch vmci = def->features[VIR_DOMAIN_FEATURE_VMCOREINFO]; @@ -9990,7 +9990,7 @@ qemuBuildVMCoreInfoCommandLine(virCommandPtr cmd, static int -qemuBuildPanicCommandLine(virCommandPtr cmd, +qemuBuildPanicCommandLine(virCommand *cmd, const virDomainDef *def) { size_t i; @@ -10024,11 +10024,11 @@ qemuBuildPanicCommandLine(virCommandPtr cmd, } -static virJSONValuePtr +static virJSONValue * qemuBuildPRManagerInfoPropsInternal(const char *alias, const char *path) { - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; if (qemuMonitorCreateObjectProps(&ret, "pr-manager-helper", alias, @@ -10045,8 +10045,8 @@ qemuBuildPRManagerInfoPropsInternal(const char *alias, * Build the JSON properties for the pr-manager object corresponding to the PR * daemon managed by libvirt. */ -virJSONValuePtr -qemuBuildPRManagedManagerInfoProps(qemuDomainObjPrivatePtr priv) +virJSONValue * +qemuBuildPRManagedManagerInfoProps(qemuDomainObjPrivate *priv) { g_autofree char *path = NULL; @@ -10064,17 +10064,17 @@ qemuBuildPRManagedManagerInfoProps(qemuDomainObjPrivatePtr priv) * * Build the JSON properties for the pr-manager object. */ -virJSONValuePtr -qemuBuildPRManagerInfoProps(virStorageSourcePtr src) +virJSONValue * +qemuBuildPRManagerInfoProps(virStorageSource *src) { return qemuBuildPRManagerInfoPropsInternal(src->pr->mgralias, src->pr->path); } static int -qemuBuildManagedPRCommandLine(virCommandPtr cmd, +qemuBuildManagedPRCommandLine(virCommand *cmd, const virDomainDef *def, - qemuDomainObjPrivatePtr priv) + qemuDomainObjPrivate *priv) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_autoptr(virJSONValue) props = NULL; @@ -10096,9 +10096,9 @@ qemuBuildManagedPRCommandLine(virCommandPtr cmd, static int -qemuBuildPflashBlockdevOne(virCommandPtr cmd, - virStorageSourcePtr src, - virQEMUCapsPtr qemuCaps) +qemuBuildPflashBlockdevOne(virCommand *cmd, + virStorageSource *src, + virQEMUCaps *qemuCaps) { g_autoptr(qemuBlockStorageSourceChainData) data = NULL; size_t i; @@ -10119,8 +10119,8 @@ qemuBuildPflashBlockdevOne(virCommandPtr cmd, static int -qemuBuildPflashBlockdevCommandLine(virCommandPtr cmd, - qemuDomainObjPrivatePtr priv) +qemuBuildPflashBlockdevCommandLine(virCommand *cmd, + qemuDomainObjPrivate *priv) { if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) return 0; @@ -10137,11 +10137,11 @@ qemuBuildPflashBlockdevCommandLine(virCommandPtr cmd, } -virJSONValuePtr -qemuBuildDBusVMStateInfoProps(virQEMUDriverPtr driver, - virDomainObjPtr vm) +virJSONValue * +qemuBuildDBusVMStateInfoProps(virQEMUDriver *driver, + virDomainObj *vm) { - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; const char *alias = qemuDomainGetDBusVMStateAlias(); g_autofree char *addr = qemuDBusGetAddress(driver, vm); @@ -10156,13 +10156,13 @@ qemuBuildDBusVMStateInfoProps(virQEMUDriverPtr driver, static int -qemuBuildDBusVMStateCommandLine(virCommandPtr cmd, - virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuBuildDBusVMStateCommandLine(virCommand *cmd, + virQEMUDriver *driver, + virDomainObj *vm) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_autoptr(virJSONValue) props = NULL; - qemuDomainObjPrivatePtr priv = QEMU_DOMAIN_PRIVATE(vm); + qemuDomainObjPrivate *priv = QEMU_DOMAIN_PRIVATE(vm); if (!priv->dbusVMStateIds) return 0; @@ -10197,7 +10197,7 @@ qemuBuildDBusVMStateCommandLine(virCommandPtr cmd, * Returns 0 on success, returns -1 and messages what the issue is. */ static int -qemuBuildCommandLineValidate(virQEMUDriverPtr driver, +qemuBuildCommandLineValidate(virQEMUDriver *driver, const virDomainDef *def) { size_t i; @@ -10277,9 +10277,9 @@ qemuBuildCommandLineValidate(virQEMUDriverPtr driver, static int -qemuBuildSeccompSandboxCommandLine(virCommandPtr cmd, - virQEMUDriverConfigPtr cfg, - virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) +qemuBuildSeccompSandboxCommandLine(virCommand *cmd, + virQEMUDriverConfig *cfg, + virQEMUCaps *qemuCaps G_GNUC_UNUSED) { if (cfg->seccompSandbox == 0) { if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SECCOMP_SANDBOX)) @@ -10306,12 +10306,12 @@ qemuBuildSeccompSandboxCommandLine(virCommandPtr cmd, char * -qemuBuildVsockDevStr(virDomainDefPtr def, - virDomainVsockDefPtr vsock, - virQEMUCapsPtr qemuCaps, +qemuBuildVsockDevStr(virDomainDef *def, + virDomainVsockDef *vsock, + virQEMUCaps *qemuCaps, const char *fdprefix) { - qemuDomainVsockPrivatePtr priv = (qemuDomainVsockPrivatePtr)vsock->privateData; + qemuDomainVsockPrivate *priv = (qemuDomainVsockPrivate *)vsock->privateData; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; if (qemuBuildVirtioDevStr(&buf, "vhost-vsock", qemuCaps, @@ -10333,12 +10333,12 @@ qemuBuildVsockDevStr(virDomainDefPtr def, static int -qemuBuildVsockCommandLine(virCommandPtr cmd, - virDomainDefPtr def, - virDomainVsockDefPtr vsock, - virQEMUCapsPtr qemuCaps) +qemuBuildVsockCommandLine(virCommand *cmd, + virDomainDef *def, + virDomainVsockDef *vsock, + virQEMUCaps *qemuCaps) { - qemuDomainVsockPrivatePtr priv = (qemuDomainVsockPrivatePtr)vsock->privateData; + qemuDomainVsockPrivate *priv = (qemuDomainVsockPrivate *)vsock->privateData; g_autofree char *devstr = NULL; if (!(devstr = qemuBuildVsockDevStr(def, vsock, qemuCaps, ""))) @@ -10381,7 +10381,7 @@ qemuBuildCompatDeprecatedCommandLine(virCommand *cmd, virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - qemuDomainXmlNsDefPtr nsdata = def->namespaceData; + qemuDomainXmlNsDef *nsdata = def->namespaceData; qemuCommnadDeprecationBehavior behavior = QEMU_COMMAND_DEPRECATION_BEHAVIOR_NONE; const char *behaviorStr = cfg->deprecationBehavior; int tmp; @@ -10438,13 +10438,13 @@ qemuBuildCompatDeprecatedCommandLine(virCommand *cmd, * Constructs a argv suitable for launching qemu with config defined * for a given virtual machine. */ -virCommandPtr -qemuBuildCommandLine(virQEMUDriverPtr driver, - virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virDomainObjPtr vm, +virCommand * +qemuBuildCommandLine(virQEMUDriver *driver, + virLogManager *logManager, + virSecurityManager *secManager, + virDomainObj *vm, const char *migrateURI, - virDomainMomentObjPtr snapshot, + virDomainMomentObj *snapshot, virNetDevVPortProfileOp vmop, bool standalone, bool enableFips, @@ -10457,9 +10457,9 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, g_autoptr(virCommand) cmd = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); unsigned int bootHostdevNet = 0; - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainDefPtr def = vm->def; - virQEMUCapsPtr qemuCaps = priv->qemuCaps; + qemuDomainObjPrivate *priv = vm->privateData; + virDomainDef *def = vm->def; + virQEMUCaps *qemuCaps = priv->qemuCaps; bool chardevStdioLogd = priv->chardevStdioLogd; VIR_DEBUG("driver=%p def=%p mon=%p " @@ -10681,7 +10681,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, virCommandAddArgList(cmd, "-loadvm", snapshot->def->name, NULL); if (def->namespaceData) { - qemuDomainXmlNsDefPtr qemuxmlns; + qemuDomainXmlNsDef *qemuxmlns; qemuxmlns = def->namespaceData; for (i = 0; i < qemuxmlns->num_args; i++) @@ -10722,8 +10722,8 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, static int qemuBuildSerialChrDeviceStr(char **deviceStr, const virDomainDef *def, - virDomainChrDefPtr serial, - virQEMUCapsPtr qemuCaps) + virDomainChrDef *serial, + virQEMUCaps *qemuCaps) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; virQEMUCapsFlags caps; @@ -10772,7 +10772,7 @@ qemuBuildSerialChrDeviceStr(char **deviceStr, static int qemuBuildParallelChrDeviceStr(char **deviceStr, - virDomainChrDefPtr chr) + virDomainChrDef *chr) { *deviceStr = g_strdup_printf("isa-parallel,chardev=char%s,id=%s", chr->info.alias, chr->info.alias); @@ -10780,13 +10780,13 @@ qemuBuildParallelChrDeviceStr(char **deviceStr, } -virJSONValuePtr -qemuBuildChannelGuestfwdNetdevProps(virDomainChrDefPtr chr) +virJSONValue * +qemuBuildChannelGuestfwdNetdevProps(virDomainChrDef *chr) { g_autoptr(virJSONValue) guestfwdarr = virJSONValueNewArray(); g_autoptr(virJSONValue) guestfwdstrobj = virJSONValueNewObject(); g_autofree char *addr = NULL; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; if (!(addr = virSocketAddrFormat(chr->target.addr))) return NULL; @@ -10818,7 +10818,7 @@ qemuBuildChannelGuestfwdNetdevProps(virDomainChrDefPtr chr) static int qemuBuildChannelChrDeviceStr(char **deviceStr, const virDomainDef *def, - virDomainChrDefPtr chr) + virDomainChrDef *chr) { switch ((virDomainChrChannelTargetType)chr->targetType) { case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO: @@ -10840,7 +10840,7 @@ qemuBuildChannelChrDeviceStr(char **deviceStr, static int qemuBuildConsoleChrDeviceStr(char **deviceStr, const virDomainDef *def, - virDomainChrDefPtr chr) + virDomainChrDef *chr) { switch ((virDomainChrConsoleTargetType)chr->targetType) { case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP: @@ -10875,8 +10875,8 @@ qemuBuildConsoleChrDeviceStr(char **deviceStr, int qemuBuildChrDeviceStr(char **deviceStr, const virDomainDef *vmdef, - virDomainChrDefPtr chr, - virQEMUCapsPtr qemuCaps) + virDomainChrDef *chr, + virQEMUCaps *qemuCaps) { int ret = -1; @@ -10905,10 +10905,10 @@ qemuBuildChrDeviceStr(char **deviceStr, } -virJSONValuePtr +virJSONValue * qemuBuildHotpluggableCPUProps(const virDomainVcpuDef *vcpu) { - qemuDomainVcpuPrivatePtr vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpu); + qemuDomainVcpuPrivate *vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpu); g_autoptr(virJSONValue) ret = NULL; if (!(ret = virJSONValueCopy(vcpupriv->props))) @@ -10928,12 +10928,12 @@ qemuBuildHotpluggableCPUProps(const virDomainVcpuDef *vcpu) * @qemuCaps: qemu capabilities object * @driveBoot: bootable flag for disks which don't have -device part * - * Prepare qemuBlockStorageSourceAttachDataPtr for use with the old approach + * Prepare qemuBlockStorageSourceAttachData *for use with the old approach * using -drive/drive_add. See qemuBlockStorageSourceAttachPrepareBlockdev. */ -qemuBlockStorageSourceAttachDataPtr -qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps) +qemuBlockStorageSourceAttachData * +qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDef *disk, + virQEMUCaps *qemuCaps) { g_autoptr(qemuBlockStorageSourceAttachData) data = NULL; @@ -10951,11 +10951,11 @@ qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDefPtr disk, * qemuBuildStorageSourceAttachPrepareChardev: * @src: disk source to prepare * - * Prepare qemuBlockStorageSourceAttachDataPtr for vhost-user disk + * Prepare qemuBlockStorageSourceAttachData *for vhost-user disk * to be used with -chardev. */ -qemuBlockStorageSourceAttachDataPtr -qemuBuildStorageSourceAttachPrepareChardev(virDomainDiskDefPtr disk) +qemuBlockStorageSourceAttachData * +qemuBuildStorageSourceAttachPrepareChardev(virDomainDiskDef *disk) { g_autoptr(qemuBlockStorageSourceAttachData) data = NULL; g_auto(virBuffer) chardev = VIR_BUFFER_INITIALIZER; @@ -10990,11 +10990,11 @@ qemuBuildStorageSourceAttachPrepareChardev(virDomainDiskDefPtr disk) * secrets/TLS/pr objects etc ... */ int -qemuBuildStorageSourceAttachPrepareCommon(virStorageSourcePtr src, - qemuBlockStorageSourceAttachDataPtr data, - virQEMUCapsPtr qemuCaps) +qemuBuildStorageSourceAttachPrepareCommon(virStorageSource *src, + qemuBlockStorageSourceAttachData *data, + virQEMUCaps *qemuCaps) { - qemuDomainStorageSourcePrivatePtr srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); + qemuDomainStorageSourcePrivate *srcpriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); const char *tlsKeySecretAlias = NULL; if (src->pr && @@ -11038,11 +11038,11 @@ qemuBuildStorageSourceAttachPrepareCommon(virStorageSourcePtr src, * @disk: disk definition * @qemuCaps: qemu capabilities object * - * Prepares qemuBlockStorageSourceChainDataPtr for attaching @disk via -drive. + * Prepares qemuBlockStorageSourceChainData *for attaching @disk via -drive. */ -qemuBlockStorageSourceChainDataPtr -qemuBuildStorageSourceChainAttachPrepareDrive(virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps) +qemuBlockStorageSourceChainData * +qemuBuildStorageSourceChainAttachPrepareDrive(virDomainDiskDef *disk, + virQEMUCaps *qemuCaps) { g_autoptr(qemuBlockStorageSourceAttachData) elem = NULL; g_autoptr(qemuBlockStorageSourceChainData) data = NULL; @@ -11066,11 +11066,11 @@ qemuBuildStorageSourceChainAttachPrepareDrive(virDomainDiskDefPtr disk, * qemuBuildStorageSourceChainAttachPrepareChardev: * @src: disk definition * - * Prepares qemuBlockStorageSourceChainDataPtr for attaching a vhost-user + * Prepares qemuBlockStorageSourceChainData *for attaching a vhost-user * disk's backend via -chardev. */ -qemuBlockStorageSourceChainDataPtr -qemuBuildStorageSourceChainAttachPrepareChardev(virDomainDiskDefPtr disk) +qemuBlockStorageSourceChainData * +qemuBuildStorageSourceChainAttachPrepareChardev(virDomainDiskDef *disk) { g_autoptr(qemuBlockStorageSourceAttachData) elem = NULL; g_autoptr(qemuBlockStorageSourceChainData) data = NULL; @@ -11089,9 +11089,9 @@ qemuBuildStorageSourceChainAttachPrepareChardev(virDomainDiskDefPtr disk) static int qemuBuildStorageSourceChainAttachPrepareBlockdevOne(qemuBlockStorageSourceChainData *data, - virStorageSourcePtr src, - virStorageSourcePtr backingStore, - virQEMUCapsPtr qemuCaps) + virStorageSource *src, + virStorageSource *backingStore, + virQEMUCaps *qemuCaps) { g_autoptr(qemuBlockStorageSourceAttachData) elem = NULL; @@ -11113,15 +11113,15 @@ qemuBuildStorageSourceChainAttachPrepareBlockdevOne(qemuBlockStorageSourceChainD * @top: storage source chain * @qemuCaps: qemu capabilities object * - * Prepares qemuBlockStorageSourceChainDataPtr for attaching the chain of images + * Prepares qemuBlockStorageSourceChainData *for attaching the chain of images * starting at @top via -blockdev. */ -qemuBlockStorageSourceChainDataPtr -qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top, - virQEMUCapsPtr qemuCaps) +qemuBlockStorageSourceChainData * +qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSource *top, + virQEMUCaps *qemuCaps) { g_autoptr(qemuBlockStorageSourceChainData) data = NULL; - virStorageSourcePtr n; + virStorageSource *n; data = g_new0(qemuBlockStorageSourceChainData, 1); @@ -11142,13 +11142,13 @@ qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top, * @backingStore: a storage source to use as backing of @top * @qemuCaps: qemu capabilities object * - * Prepares qemuBlockStorageSourceChainDataPtr for attaching of @top image only + * Prepares qemuBlockStorageSourceChainData *for attaching of @top image only * via -blockdev. */ -qemuBlockStorageSourceChainDataPtr -qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSourcePtr top, - virStorageSourcePtr backingStore, - virQEMUCapsPtr qemuCaps) +qemuBlockStorageSourceChainData * +qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSource *top, + virStorageSource *backingStore, + virQEMUCaps *qemuCaps) { g_autoptr(qemuBlockStorageSourceChainData) data = NULL; diff --git a/src/qemu/qemu_command.h b/src/qemu/qemu_command.h index bdae117e02..4f1d2bf755 100644 --- a/src/qemu/qemu_command.h +++ b/src/qemu/qemu_command.h @@ -47,12 +47,12 @@ typedef enum { QEMU_BUILD_COMMANDLINE_VALIDATE_KEEP_JSON = 1 << 0, } qemuBuildCommandLineFlags; -virCommandPtr qemuBuildCommandLine(virQEMUDriverPtr driver, - virLogManagerPtr logManager, - virSecurityManagerPtr secManager, - virDomainObjPtr vm, +virCommand *qemuBuildCommandLine(virQEMUDriver *driver, + virLogManager *logManager, + virSecurityManager *secManager, + virDomainObj *vm, const char *migrateURI, - virDomainMomentObjPtr snapshot, + virDomainMomentObj *snapshot, virNetDevVPortProfileOp vmop, bool standalone, bool enableFips, @@ -61,15 +61,15 @@ virCommandPtr qemuBuildCommandLine(virQEMUDriverPtr driver, unsigned int flags); /* Generate the object properties for pr-manager */ -virJSONValuePtr qemuBuildPRManagerInfoProps(virStorageSourcePtr src); -virJSONValuePtr qemuBuildPRManagedManagerInfoProps(qemuDomainObjPrivatePtr priv); +virJSONValue *qemuBuildPRManagerInfoProps(virStorageSource *src); +virJSONValue *qemuBuildPRManagedManagerInfoProps(qemuDomainObjPrivate *priv); -virJSONValuePtr qemuBuildDBusVMStateInfoProps(virQEMUDriverPtr driver, - virDomainObjPtr vm); +virJSONValue *qemuBuildDBusVMStateInfoProps(virQEMUDriver *driver, + virDomainObj *vm); /* Generate the object properties for a secret */ -int qemuBuildSecretInfoProps(qemuDomainSecretInfoPtr secinfo, - virJSONValuePtr *propsret); +int qemuBuildSecretInfoProps(qemuDomainSecretInfo *secinfo, + virJSONValue **propsret); /* Generate the object properties for a tls-creds-x509 */ int qemuBuildTLSx509BackendProps(const char *tlspath, @@ -77,8 +77,8 @@ int qemuBuildTLSx509BackendProps(const char *tlspath, bool verifypeer, const char *alias, const char *secalias, - virQEMUCapsPtr qemuCaps, - virJSONValuePtr *propsret); + virQEMUCaps *qemuCaps, + virJSONValue **propsret); /* Open a UNIX socket for chardev FD passing */ int @@ -88,13 +88,13 @@ qemuOpenChrChardevUNIXSocket(const virDomainChrSourceDef *dev) G_GNUC_NO_INLINE; int qemuBuildChrDeviceStr(char **deviceStr, const virDomainDef *vmdef, - virDomainChrDefPtr chr, - virQEMUCapsPtr qemuCaps); + virDomainChrDef *chr, + virQEMUCaps *qemuCaps); -virJSONValuePtr -qemuBuildChannelGuestfwdNetdevProps(virDomainChrDefPtr chr); +virJSONValue * +qemuBuildChannelGuestfwdNetdevProps(virDomainChrDef *chr); -virJSONValuePtr qemuBuildHostNetStr(virDomainNetDefPtr net, +virJSONValue *qemuBuildHostNetStr(virDomainNetDef *net, char **tapfd, size_t tapfdSize, char **vhostfd, @@ -103,62 +103,62 @@ virJSONValuePtr qemuBuildHostNetStr(virDomainNetDefPtr net, const char *vdpadev); /* Current, best practice */ -char *qemuBuildNicDevStr(virDomainDefPtr def, - virDomainNetDefPtr net, +char *qemuBuildNicDevStr(virDomainDef *def, + virDomainNetDef *net, unsigned int bootindex, size_t vhostfdSize, - virQEMUCapsPtr qemuCaps); + virQEMUCaps *qemuCaps); -char *qemuDeviceDriveHostAlias(virDomainDiskDefPtr disk); +char *qemuDeviceDriveHostAlias(virDomainDiskDef *disk); bool qemuDiskBusIsSD(int bus); -qemuBlockStorageSourceAttachDataPtr -qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps); +qemuBlockStorageSourceAttachData * +qemuBuildStorageSourceAttachPrepareDrive(virDomainDiskDef *disk, + virQEMUCaps *qemuCaps); -qemuBlockStorageSourceAttachDataPtr -qemuBuildStorageSourceAttachPrepareChardev(virDomainDiskDefPtr disk); +qemuBlockStorageSourceAttachData * +qemuBuildStorageSourceAttachPrepareChardev(virDomainDiskDef *disk); int -qemuBuildStorageSourceAttachPrepareCommon(virStorageSourcePtr src, - qemuBlockStorageSourceAttachDataPtr data, - virQEMUCapsPtr qemuCaps); +qemuBuildStorageSourceAttachPrepareCommon(virStorageSource *src, + qemuBlockStorageSourceAttachData *data, + virQEMUCaps *qemuCaps); -qemuBlockStorageSourceChainDataPtr -qemuBuildStorageSourceChainAttachPrepareDrive(virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps); +qemuBlockStorageSourceChainData * +qemuBuildStorageSourceChainAttachPrepareDrive(virDomainDiskDef *disk, + virQEMUCaps *qemuCaps); -qemuBlockStorageSourceChainDataPtr -qemuBuildStorageSourceChainAttachPrepareChardev(virDomainDiskDefPtr disk); +qemuBlockStorageSourceChainData * +qemuBuildStorageSourceChainAttachPrepareChardev(virDomainDiskDef *disk); -qemuBlockStorageSourceChainDataPtr -qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSourcePtr top, - virQEMUCapsPtr qemuCaps); +qemuBlockStorageSourceChainData * +qemuBuildStorageSourceChainAttachPrepareBlockdev(virStorageSource *top, + virQEMUCaps *qemuCaps); -qemuBlockStorageSourceChainDataPtr -qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSourcePtr top, - virStorageSourcePtr backingStore, - virQEMUCapsPtr qemuCaps); +qemuBlockStorageSourceChainData * +qemuBuildStorageSourceChainAttachPrepareBlockdevTop(virStorageSource *top, + virStorageSource *backingStore, + virQEMUCaps *qemuCaps); char *qemuBuildDiskDeviceStr(const virDomainDef *def, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, unsigned int bootindex, - virQEMUCapsPtr qemuCaps); + virQEMUCaps *qemuCaps); /* Current, best practice */ int qemuBuildControllerDevStr(const virDomainDef *domainDef, - virDomainControllerDefPtr def, - virQEMUCapsPtr qemuCaps, + virDomainControllerDef *def, + virQEMUCaps *qemuCaps, char **devstr); -int qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, +int qemuBuildMemoryBackendProps(virJSONValue **backendProps, const char *alias, - virQEMUDriverConfigPtr cfg, - qemuDomainObjPrivatePtr priv, + virQEMUDriverConfig *cfg, + qemuDomainObjPrivate *priv, const virDomainDef *def, const virDomainMemoryDef *mem, bool force, @@ -166,94 +166,94 @@ int qemuBuildMemoryBackendProps(virJSONValuePtr *backendProps, char * qemuBuildMemoryDeviceStr(const virDomainDef *def, - virDomainMemoryDefPtr mem, - virQEMUCapsPtr qemuCaps); + virDomainMemoryDef *mem, + virQEMUCaps *qemuCaps); /* Current, best practice */ char *qemuBuildPCIHostdevDevStr(const virDomainDef *def, - virDomainHostdevDefPtr dev, + virDomainHostdevDef *dev, unsigned int bootIndex, - virQEMUCapsPtr qemuCaps); + virQEMUCaps *qemuCaps); char *qemuBuildRNGDevStr(const virDomainDef *def, - virDomainRNGDefPtr dev, - virQEMUCapsPtr qemuCaps); -int qemuBuildRNGBackendProps(virDomainRNGDefPtr rng, - virJSONValuePtr *props); + virDomainRNGDef *dev, + virQEMUCaps *qemuCaps); +int qemuBuildRNGBackendProps(virDomainRNGDef *rng, + virJSONValue **props); /* Current, best practice */ char *qemuBuildUSBHostdevDevStr(const virDomainDef *def, - virDomainHostdevDefPtr dev, - virQEMUCapsPtr qemuCaps); + virDomainHostdevDef *dev, + virQEMUCaps *qemuCaps); char *qemuBuildSCSIHostdevDevStr(const virDomainDef *def, - virDomainHostdevDefPtr dev, + virDomainHostdevDef *dev, const char *backendAlias); qemuBlockStorageSourceAttachData * -qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDefPtr hostdev, +qemuBuildHostdevSCSIAttachPrepare(virDomainHostdevDef *hostdev, const char **backendAlias, - virQEMUCapsPtr qemuCaps); + virQEMUCaps *qemuCaps); qemuBlockStorageSourceAttachData * -qemuBuildHostdevSCSIDetachPrepare(virDomainHostdevDefPtr hostdev, - virQEMUCapsPtr qemuCaps); +qemuBuildHostdevSCSIDetachPrepare(virDomainHostdevDef *hostdev, + virQEMUCaps *qemuCaps); char * qemuBuildSCSIVHostHostdevDevStr(const virDomainDef *def, - virDomainHostdevDefPtr dev, - virQEMUCapsPtr qemuCaps, + virDomainHostdevDef *dev, + virQEMUCaps *qemuCaps, char *vhostfdName); char * qemuBuildHostdevMediatedDevStr(const virDomainDef *def, - virDomainHostdevDefPtr dev, - virQEMUCapsPtr qemuCaps); + virDomainHostdevDef *dev, + virQEMUCaps *qemuCaps); char *qemuBuildRedirdevDevStr(const virDomainDef *def, - virDomainRedirdevDefPtr dev, - virQEMUCapsPtr qemuCaps); + virDomainRedirdevDef *dev, + virQEMUCaps *qemuCaps); -char *qemuBuildZPCIDevStr(virDomainDeviceInfoPtr dev); +char *qemuBuildZPCIDevStr(virDomainDeviceInfo *dev); -int qemuNetworkPrepareDevices(virDomainDefPtr def); +int qemuNetworkPrepareDevices(virDomainDef *def); -int qemuGetDriveSourceString(virStorageSourcePtr src, - qemuDomainSecretInfoPtr secinfo, +int qemuGetDriveSourceString(virStorageSource *src, + qemuDomainSecretInfo *secinfo, char **source); bool -qemuDiskConfigBlkdeviotuneEnabled(virDomainDiskDefPtr disk); +qemuDiskConfigBlkdeviotuneEnabled(virDomainDiskDef *disk); bool -qemuCheckFips(virDomainObjPtr vm); +qemuCheckFips(virDomainObj *vm); -virJSONValuePtr qemuBuildHotpluggableCPUProps(const virDomainVcpuDef *vcpu) +virJSONValue *qemuBuildHotpluggableCPUProps(const virDomainVcpuDef *vcpu) ATTRIBUTE_NONNULL(1); -virJSONValuePtr qemuBuildShmemBackendMemProps(virDomainShmemDefPtr shmem) +virJSONValue *qemuBuildShmemBackendMemProps(virDomainShmemDef *shmem) ATTRIBUTE_NONNULL(1); -char *qemuBuildShmemDevStr(virDomainDefPtr def, - virDomainShmemDefPtr shmem, - virQEMUCapsPtr qemuCaps) +char *qemuBuildShmemDevStr(virDomainDef *def, + virDomainShmemDef *shmem, + virQEMUCaps *qemuCaps) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); char *qemuBuildWatchdogDevStr(const virDomainDef *def, - virDomainWatchdogDefPtr dev, - virQEMUCapsPtr qemuCaps); + virDomainWatchdogDef *dev, + virQEMUCaps *qemuCaps); int qemuBuildInputDevStr(char **devstr, const virDomainDef *def, - virDomainInputDefPtr input, - virQEMUCapsPtr qemuCaps) + virDomainInputDef *input, + virQEMUCaps *qemuCaps) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); char * -qemuBuildVsockDevStr(virDomainDefPtr def, - virDomainVsockDefPtr vsock, - virQEMUCapsPtr qemuCaps, +qemuBuildVsockDevStr(virDomainDef *def, + virDomainVsockDef *vsock, + virQEMUCaps *qemuCaps, const char *fdprefix) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 68b086be54..916a3d36ee 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -71,7 +71,7 @@ VIR_LOG_INIT("qemu.qemu_conf"); #define QEMU_MIGRATION_PORT_MIN 49152 #define QEMU_MIGRATION_PORT_MAX 49215 -static virClassPtr virQEMUDriverConfigClass; +static virClass *virQEMUDriverConfigClass; static void virQEMUDriverConfigDispose(void *obj); static int virQEMUConfigOnceInit(void) @@ -86,12 +86,12 @@ VIR_ONCE_GLOBAL_INIT(virQEMUConfig); static void -qemuDriverLock(virQEMUDriverPtr driver) +qemuDriverLock(virQEMUDriver *driver) { virMutexLock(&driver->lock); } static void -qemuDriverUnlock(virQEMUDriverPtr driver) +qemuDriverUnlock(virQEMUDriver *driver) { virMutexUnlock(&driver->lock); } @@ -105,7 +105,7 @@ qemuDriverUnlock(virQEMUDriverPtr driver) #endif -virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged, +virQEMUDriverConfig *virQEMUDriverConfigNew(bool privileged, const char *root) { g_autoptr(virQEMUDriverConfig) cfg = NULL; @@ -303,7 +303,7 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged, static void virQEMUDriverConfigDispose(void *obj) { - virQEMUDriverConfigPtr cfg = obj; + virQEMUDriverConfig *cfg = obj; virBitmapFree(cfg->namespaces); @@ -388,7 +388,7 @@ static void virQEMUDriverConfigDispose(void *obj) static int -virQEMUDriverConfigHugeTLBFSInit(virHugeTLBFSPtr hugetlbfs, +virQEMUDriverConfigHugeTLBFSInit(virHugeTLBFS *hugetlbfs, const char *path, bool deflt) { @@ -402,8 +402,8 @@ virQEMUDriverConfigHugeTLBFSInit(virHugeTLBFSPtr hugetlbfs, static int -virQEMUDriverConfigLoadDefaultTLSEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadDefaultTLSEntry(virQEMUDriverConfig *cfg, + virConf *conf) { int rv; @@ -423,8 +423,8 @@ virQEMUDriverConfigLoadDefaultTLSEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadVNCEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadVNCEntry(virQEMUDriverConfig *cfg, + virConf *conf) { int rv; @@ -456,16 +456,16 @@ virQEMUDriverConfigLoadVNCEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadNographicsEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadNographicsEntry(virQEMUDriverConfig *cfg, + virConf *conf) { return virConfGetValueBool(conf, "nographics_allow_host_audio", &cfg->nogfxAllowHostAudio); } static int -virQEMUDriverConfigLoadSPICEEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadSPICEEntry(virQEMUDriverConfig *cfg, + virConf *conf) { if (virConfGetValueBool(conf, "spice_tls", &cfg->spiceTLS) < 0) return -1; @@ -487,8 +487,8 @@ virQEMUDriverConfigLoadSPICEEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadSpecificTLSEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadSpecificTLSEntry(virQEMUDriverConfig *cfg, + virConf *conf) { int rv; @@ -541,8 +541,8 @@ virQEMUDriverConfigLoadSpecificTLSEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadRemoteDisplayEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf, +virQEMUDriverConfigLoadRemoteDisplayEntry(virQEMUDriverConfig *cfg, + virConf *conf, const char *filename) { if (virConfGetValueUInt(conf, "remote_websocket_port_min", &cfg->webSocketPortMin) < 0) @@ -612,8 +612,8 @@ virQEMUDriverConfigLoadRemoteDisplayEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadSaveEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadSaveEntry(virQEMUDriverConfig *cfg, + virConf *conf) { if (virConfGetValueString(conf, "save_image_format", &cfg->saveImageFormat) < 0) return -1; @@ -633,8 +633,8 @@ virQEMUDriverConfigLoadSaveEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadProcessEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadProcessEntry(virQEMUDriverConfig *cfg, + virConf *conf) { g_auto(GStrv) hugetlbfs = NULL; g_autofree char *stdioHandler = NULL; @@ -721,8 +721,8 @@ virQEMUDriverConfigLoadProcessEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadDeviceEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadDeviceEntry(virQEMUDriverConfig *cfg, + virConf *conf) { bool tmp; int rv; @@ -747,8 +747,8 @@ virQEMUDriverConfigLoadDeviceEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadRPCEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadRPCEntry(virQEMUDriverConfig *cfg, + virConf *conf) { if (virConfGetValueUInt(conf, "max_queued", &cfg->maxQueuedJobs) < 0) return -1; @@ -762,8 +762,8 @@ virQEMUDriverConfigLoadRPCEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadNetworkEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf, +virQEMUDriverConfigLoadNetworkEntry(virQEMUDriverConfig *cfg, + virConf *conf, const char *filename) { if (virConfGetValueUInt(conf, "migration_port_min", &cfg->migrationPortMin) < 0) @@ -817,16 +817,16 @@ virQEMUDriverConfigLoadNetworkEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadLogEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadLogEntry(virQEMUDriverConfig *cfg, + virConf *conf) { return virConfGetValueBool(conf, "log_timestamp", &cfg->logTimestamp); } static int -virQEMUDriverConfigLoadNVRAMEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf, +virQEMUDriverConfigLoadNVRAMEntry(virQEMUDriverConfig *cfg, + virConf *conf, bool privileged) { g_auto(GStrv) nvram = NULL; @@ -852,7 +852,7 @@ virQEMUDriverConfigLoadNVRAMEntry(virQEMUDriverConfigPtr cfg, } cfg->nfirmwares = g_strv_length(nvram); - cfg->firmwares = g_new0(virFirmwarePtr, cfg->nfirmwares); + cfg->firmwares = g_new0(virFirmware *, cfg->nfirmwares); for (i = 0; nvram[i] != NULL; i++) { cfg->firmwares[i] = g_new0(virFirmware, 1); @@ -866,8 +866,8 @@ virQEMUDriverConfigLoadNVRAMEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadDebugEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadDebugEntry(virQEMUDriverConfig *cfg, + virConf *conf) { if (virConfGetValueUInt(conf, "gluster_debug_level", &cfg->glusterDebugLevel) < 0) return -1; @@ -881,8 +881,8 @@ virQEMUDriverConfigLoadDebugEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadSecurityEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf, +virQEMUDriverConfigLoadSecurityEntry(virQEMUDriverConfig *cfg, + virConf *conf, bool privileged) { g_auto(GStrv) controllers = NULL; @@ -995,8 +995,8 @@ virQEMUDriverConfigLoadSecurityEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadMemoryEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadMemoryEntry(virQEMUDriverConfig *cfg, + virConf *conf) { g_autofree char *dir = NULL; int rc; @@ -1014,8 +1014,8 @@ virQEMUDriverConfigLoadMemoryEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadSWTPMEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadSWTPMEntry(virQEMUDriverConfig *cfg, + virConf *conf) { g_autofree char *swtpm_user = NULL; g_autofree char *swtpm_group = NULL; @@ -1035,8 +1035,8 @@ virQEMUDriverConfigLoadSWTPMEntry(virQEMUDriverConfigPtr cfg, static int -virQEMUDriverConfigLoadCapsFiltersEntry(virQEMUDriverConfigPtr cfg, - virConfPtr conf) +virQEMUDriverConfigLoadCapsFiltersEntry(virQEMUDriverConfig *cfg, + virConf *conf) { if (virConfGetValueStringList(conf, "capability_filters", false, &cfg->capabilityfilters) < 0) @@ -1046,7 +1046,7 @@ virQEMUDriverConfigLoadCapsFiltersEntry(virQEMUDriverConfigPtr cfg, } -int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg, +int virQEMUDriverConfigLoadFile(virQEMUDriverConfig *cfg, const char *filename, bool privileged) { @@ -1129,7 +1129,7 @@ int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg, * Returns 0 on success, -1 on failure */ int -virQEMUDriverConfigValidate(virQEMUDriverConfigPtr cfg) +virQEMUDriverConfigValidate(virQEMUDriverConfig *cfg) { if (cfg->defaultTLSx509certdirPresent) { if (!virFileExists(cfg->defaultTLSx509certdir)) { @@ -1202,7 +1202,7 @@ virQEMUDriverConfigValidate(virQEMUDriverConfigPtr cfg) int -virQEMUDriverConfigSetDefaults(virQEMUDriverConfigPtr cfg) +virQEMUDriverConfigSetDefaults(virQEMUDriverConfig *cfg) { #define SET_TLS_SECRET_UUID_DEFAULT(val) \ do { \ @@ -1271,17 +1271,17 @@ virQEMUDriverConfigSetDefaults(virQEMUDriverConfigPtr cfg) } -virQEMUDriverConfigPtr virQEMUDriverGetConfig(virQEMUDriverPtr driver) +virQEMUDriverConfig *virQEMUDriverGetConfig(virQEMUDriver *driver) { - virQEMUDriverConfigPtr conf; + virQEMUDriverConfig *conf; qemuDriverLock(driver); conf = virObjectRef(driver->config); qemuDriverUnlock(driver); return conf; } -virDomainXMLOptionPtr -virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver, +virDomainXMLOption * +virQEMUDriverCreateXMLConf(virQEMUDriver *driver, const char *defsecmodel) { virQEMUDriverDomainDefParserConfig.priv = driver; @@ -1294,10 +1294,10 @@ virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver, } -virCPUDefPtr -virQEMUDriverGetHostCPU(virQEMUDriverPtr driver) +virCPUDef * +virQEMUDriverGetHostCPU(virQEMUDriver *driver) { - virCPUDefPtr hostcpu; + virCPUDef *hostcpu; qemuDriverLock(driver); @@ -1315,11 +1315,11 @@ virQEMUDriverGetHostCPU(virQEMUDriverPtr driver) } -virCapsPtr virQEMUDriverCreateCapabilities(virQEMUDriverPtr driver) +virCaps *virQEMUDriverCreateCapabilities(virQEMUDriver *driver) { size_t i, j; g_autoptr(virCaps) caps = NULL; - g_autofree virSecurityManagerPtr *sec_managers = NULL; + g_autofree virSecurityManager **sec_managers = NULL; /* Security driver data */ const char *doi, *model, *lbl, *type; const int virtTypes[] = {VIR_DOMAIN_VIRT_KVM, @@ -1347,7 +1347,7 @@ virCapsPtr virQEMUDriverCreateCapabilities(virQEMUDriverPtr driver) caps->host.secModels = g_new0(virCapsHostSecModel, caps->host.nsecModels); for (i = 0; sec_managers[i]; i++) { - virCapsHostSecModelPtr sm = &caps->host.secModels[i]; + virCapsHostSecModel *sm = &caps->host.secModels[i]; doi = qemuSecurityGetDOI(sec_managers[i]); model = qemuSecurityGetModel(sec_managers[i]); sm->model = g_strdup(model); @@ -1374,20 +1374,20 @@ virCapsPtr virQEMUDriverCreateCapabilities(virQEMUDriverPtr driver) /** * virQEMUDriverGetCapabilities: * - * Get a reference to the virCapsPtr instance for the + * Get a reference to the virCaps *instance for the * driver. If @refresh is true, the capabilities will be * rebuilt first * * The caller must release the reference with virObjectUnref * - * Returns: a reference to a virCapsPtr instance or NULL + * Returns: a reference to a virCaps *instance or NULL */ -virCapsPtr virQEMUDriverGetCapabilities(virQEMUDriverPtr driver, +virCaps *virQEMUDriverGetCapabilities(virQEMUDriver *driver, bool refresh) { - virCapsPtr ret = NULL; + virCaps *ret = NULL; if (refresh) { - virCapsPtr caps = NULL; + virCaps *caps = NULL; if ((caps = virQEMUDriverCreateCapabilities(driver)) == NULL) return NULL; @@ -1415,14 +1415,14 @@ virCapsPtr virQEMUDriverGetCapabilities(virQEMUDriverPtr driver, /** * virQEMUDriverGetDomainCapabilities: * - * Get a reference to the virDomainCapsPtr instance. The caller + * Get a reference to the virDomainCaps *instance. The caller * must release the reference with virObjetUnref(). * - * Returns: a reference to a virDomainCapsPtr instance or NULL + * Returns: a reference to a virDomainCaps *instance or NULL */ -virDomainCapsPtr -virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, +virDomainCaps * +virQEMUDriverGetDomainCapabilities(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, const char *machine, virArch arch, virDomainVirtType virttype) @@ -1527,7 +1527,7 @@ qemuCheckUnprivSGIO(GHashTable *sharedDevices, */ static int qemuCheckSharedDisk(GHashTable *sharedDevices, - virDomainDiskDefPtr disk) + virDomainDiskDef *disk) { int ret; @@ -1558,7 +1558,7 @@ qemuCheckSharedDisk(GHashTable *sharedDevices, bool -qemuSharedDeviceEntryDomainExists(qemuSharedDeviceEntryPtr entry, +qemuSharedDeviceEntryDomainExists(qemuSharedDeviceEntry *entry, const char *name, int *idx) { @@ -1578,7 +1578,7 @@ qemuSharedDeviceEntryDomainExists(qemuSharedDeviceEntryPtr entry, void qemuSharedDeviceEntryFree(void *payload) { - qemuSharedDeviceEntryPtr entry = payload; + qemuSharedDeviceEntry *entry = payload; size_t i; if (!entry) @@ -1592,7 +1592,7 @@ qemuSharedDeviceEntryFree(void *payload) static int -qemuSharedDeviceEntryInsert(virQEMUDriverPtr driver, +qemuSharedDeviceEntryInsert(virQEMUDriver *driver, const char *key, const char *name) { @@ -1627,11 +1627,11 @@ qemuSharedDeviceEntryInsert(virQEMUDriverPtr driver, static int -qemuSharedDeviceEntryRemove(virQEMUDriverPtr driver, +qemuSharedDeviceEntryRemove(virQEMUDriver *driver, const char *key, const char *name) { - qemuSharedDeviceEntryPtr entry = NULL; + qemuSharedDeviceEntry *entry = NULL; int idx; if (!(entry = virHashLookup(driver->sharedDevices, key))) @@ -1653,8 +1653,8 @@ qemuSharedDeviceEntryRemove(virQEMUDriverPtr driver, static int -qemuSharedDiskAddRemoveInternal(virQEMUDriverPtr driver, - virDomainDiskDefPtr disk, +qemuSharedDiskAddRemoveInternal(virQEMUDriver *driver, + virDomainDiskDef *disk, const char *name, bool addDisk) { @@ -1699,8 +1699,8 @@ qemuSharedDiskAddRemoveInternal(virQEMUDriverPtr driver, * already exists, otherwise add a new entry. */ int -qemuAddSharedDisk(virQEMUDriverPtr driver, - virDomainDiskDefPtr disk, +qemuAddSharedDisk(virQEMUDriver *driver, + virDomainDiskDef *disk, const char *name) { return qemuSharedDiskAddRemoveInternal(driver, disk, name, true); @@ -1708,7 +1708,7 @@ qemuAddSharedDisk(virQEMUDriverPtr driver, static bool -qemuIsSharedHostdev(virDomainHostdevDefPtr hostdev) +qemuIsSharedHostdev(virDomainHostdevDef *hostdev) { return (hostdev->shareable && (virHostdevIsSCSIDevice(hostdev) && @@ -1718,10 +1718,10 @@ qemuIsSharedHostdev(virDomainHostdevDefPtr hostdev) static char * -qemuGetHostdevPath(virDomainHostdevDefPtr hostdev) +qemuGetHostdevPath(virDomainHostdevDef *hostdev) { - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; g_autofree char *dev_name = NULL; if (!(dev_name = virSCSIDeviceGetDevName(NULL, @@ -1736,8 +1736,8 @@ qemuGetHostdevPath(virDomainHostdevDefPtr hostdev) static int -qemuSharedHostdevAddRemoveInternal(virQEMUDriverPtr driver, - virDomainHostdevDefPtr hostdev, +qemuSharedHostdevAddRemoveInternal(virQEMUDriver *driver, + virDomainHostdevDef *hostdev, const char *name, bool addDevice) { @@ -1765,8 +1765,8 @@ qemuSharedHostdevAddRemoveInternal(virQEMUDriverPtr driver, } static int -qemuSharedDeviceAddRemoveInternal(virQEMUDriverPtr driver, - virDomainDeviceDefPtr dev, +qemuSharedDeviceAddRemoveInternal(virQEMUDriver *driver, + virDomainDeviceDef *dev, const char *name, bool addDevice) { @@ -1795,8 +1795,8 @@ qemuSharedDeviceAddRemoveInternal(virQEMUDriverPtr driver, * already exists, otherwise add a new entry. */ int -qemuAddSharedDevice(virQEMUDriverPtr driver, - virDomainDeviceDefPtr dev, +qemuAddSharedDevice(virQEMUDriver *driver, + virDomainDeviceDef *dev, const char *name) { return qemuSharedDeviceAddRemoveInternal(driver, dev, name, true); @@ -1804,8 +1804,8 @@ qemuAddSharedDevice(virQEMUDriverPtr driver, int -qemuRemoveSharedDisk(virQEMUDriverPtr driver, - virDomainDiskDefPtr disk, +qemuRemoveSharedDisk(virQEMUDriver *driver, + virDomainDiskDef *disk, const char *name) { return qemuSharedDiskAddRemoveInternal(driver, disk, name, false); @@ -1822,8 +1822,8 @@ qemuRemoveSharedDisk(virQEMUDriverPtr driver, * 1, otherwise remove the entry. */ int -qemuRemoveSharedDevice(virQEMUDriverPtr driver, - virDomainDeviceDefPtr dev, +qemuRemoveSharedDevice(virQEMUDriver *driver, + virDomainDeviceDef *dev, const char *name) { return qemuSharedDeviceAddRemoveInternal(driver, dev, name, false); @@ -1831,10 +1831,10 @@ qemuRemoveSharedDevice(virQEMUDriverPtr driver, int -qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) +qemuSetUnprivSGIO(virDomainDeviceDef *dev) { - virDomainDiskDefPtr disk = NULL; - virDomainHostdevDefPtr hostdev = NULL; + virDomainDiskDef *disk = NULL; + virDomainHostdevDef *hostdev = NULL; g_autofree char *sysfs_path = NULL; const char *path = NULL; int val = -1; @@ -1885,14 +1885,14 @@ qemuSetUnprivSGIO(virDomainDeviceDefPtr dev) return 0; } -int qemuDriverAllocateID(virQEMUDriverPtr driver) +int qemuDriverAllocateID(virQEMUDriver *driver) { return g_atomic_int_add(&driver->lastvmid, 1) + 1; } int -qemuTranslateSnapshotDiskSourcePool(virDomainSnapshotDiskDefPtr def) +qemuTranslateSnapshotDiskSourcePool(virDomainSnapshotDiskDef *def) { if (def->src->type != VIR_STORAGE_TYPE_VOLUME) return 0; @@ -1903,8 +1903,8 @@ qemuTranslateSnapshotDiskSourcePool(virDomainSnapshotDiskDefPtr def) } char * -qemuGetBaseHugepagePath(virQEMUDriverPtr driver, - virHugeTLBFSPtr hugepage) +qemuGetBaseHugepagePath(virQEMUDriver *driver, + virHugeTLBFS *hugepage) { const char *root = driver->embeddedRoot; char *ret; @@ -1921,9 +1921,9 @@ qemuGetBaseHugepagePath(virQEMUDriverPtr driver, char * -qemuGetDomainHugepagePath(virQEMUDriverPtr driver, +qemuGetDomainHugepagePath(virQEMUDriver *driver, const virDomainDef *def, - virHugeTLBFSPtr hugepage) + virHugeTLBFS *hugepage) { g_autofree char *base = qemuGetBaseHugepagePath(driver, hugepage); g_autofree char *domPath = virDomainDefGetShortName(def); @@ -1944,7 +1944,7 @@ qemuGetDomainHugepagePath(virQEMUDriverPtr driver, * -1 otherwise. */ int -qemuGetDomainHupageMemPath(virQEMUDriverPtr driver, +qemuGetDomainHupageMemPath(virQEMUDriver *driver, const virDomainDef *def, unsigned long long pagesize, char **memPath) @@ -1980,7 +1980,7 @@ qemuGetDomainHupageMemPath(virQEMUDriverPtr driver, int -qemuGetMemoryBackingDomainPath(virQEMUDriverPtr driver, +qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, const virDomainDef *def, char **path) { @@ -2015,7 +2015,7 @@ qemuGetMemoryBackingDomainPath(virQEMUDriverPtr driver, * -1 otherwise (with error reported). */ int -qemuGetMemoryBackingPath(virQEMUDriverPtr driver, +qemuGetMemoryBackingPath(virQEMUDriver *driver, const virDomainDef *def, const char *alias, char **memPath) diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index e62cd88950..2f64e39a18 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -52,10 +52,8 @@ #define QEMU_DRIVER_NAME "QEMU" typedef struct _virQEMUDriver virQEMUDriver; -typedef virQEMUDriver *virQEMUDriverPtr; typedef struct _virQEMUDriverConfig virQEMUDriverConfig; -typedef virQEMUDriverConfig *virQEMUDriverConfigPtr; /* Main driver config. The data in these object * instances is immutable, so can be accessed @@ -77,7 +75,7 @@ struct _virQEMUDriverConfig { gid_t group; bool dynamicOwnership; - virBitmapPtr namespaces; + virBitmap *namespaces; bool rememberOwner; int cgroupControllers; @@ -161,7 +159,7 @@ struct _virQEMUDriverConfig { unsigned int webSocketPortMin; unsigned int webSocketPortMax; - virHugeTLBFSPtr hugetlbfs; + virHugeTLBFS *hugetlbfs; size_t nhugetlbfs; char *bridgeHelperName; @@ -212,7 +210,7 @@ struct _virQEMUDriverConfig { bool logTimestamp; bool stdioLogD; - virFirmwarePtr *firmwares; + virFirmware **firmwares; size_t nfirmwares; unsigned int glusterDebugLevel; bool virtiofsdDebug; @@ -236,13 +234,13 @@ struct _virQEMUDriver { /* Require lock to get reference on 'config', * then lockless thereafter */ - virQEMUDriverConfigPtr config; + virQEMUDriverConfig *config; /* pid file FD, ensures two copies of the driver can't use the same root */ int lockFD; /* Immutable pointer, self-locking APIs */ - virThreadPoolPtr workerPool; + virThreadPool *workerPool; /* Atomic increment only */ int lastvmid; @@ -259,7 +257,7 @@ struct _virQEMUDriver { void *inhibitOpaque; /* Immutable pointer, self-locking APIs */ - virDomainObjListPtr domains; + virDomainObjList *domains; /* Immutable pointer */ char *qemuImgBinary; @@ -270,86 +268,85 @@ struct _virQEMUDriver { /* Require lock to get a reference on the object, * lockless access thereafter */ - virCapsPtr caps; + virCaps *caps; /* Lazy initialized on first use, immutable thereafter. * Require lock to get the pointer & do optional initialization */ - virCPUDefPtr hostcpu; + virCPUDef *hostcpu; /* Immutable value */ virArch hostarch; /* Immutable pointer, Immutable object */ - virDomainXMLOptionPtr xmlopt; + virDomainXMLOption *xmlopt; /* Immutable pointer, self-locking APIs */ - virFileCachePtr qemuCapsCache; + virFileCache *qemuCapsCache; /* Immutable pointer, self-locking APIs */ - virObjectEventStatePtr domainEventState; + virObjectEventState *domainEventState; /* Immutable pointer. self-locking APIs */ - virSecurityManagerPtr securityManager; + virSecurityManager *securityManager; - virHostdevManagerPtr hostdevMgr; + virHostdevManager *hostdevMgr; /* Immutable pointer. Unsafe APIs. XXX */ GHashTable *sharedDevices; /* Immutable pointer, immutable object */ - virPortAllocatorRangePtr remotePorts; + virPortAllocatorRange *remotePorts; /* Immutable pointer, immutable object */ - virPortAllocatorRangePtr webSocketPorts; + virPortAllocatorRange *webSocketPorts; /* Immutable pointer, immutable object */ - virPortAllocatorRangePtr migrationPorts; + virPortAllocatorRange *migrationPorts; /* Immutable pointer, lockless APIs */ - virSysinfoDefPtr hostsysinfo; + virSysinfoDef *hostsysinfo; /* Immutable pointer. lockless access */ - virLockManagerPluginPtr lockManager; + virLockManagerPlugin *lockManager; /* Immutable pointer, self-clocking APIs */ - virCloseCallbacksPtr closeCallbacks; + virCloseCallbacks *closeCallbacks; /* Immutable pointer, self-locking APIs */ - virHashAtomicPtr migrationErrors; + virHashAtomic *migrationErrors; }; -virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged, +virQEMUDriverConfig *virQEMUDriverConfigNew(bool privileged, const char *root); -int virQEMUDriverConfigLoadFile(virQEMUDriverConfigPtr cfg, +int virQEMUDriverConfigLoadFile(virQEMUDriverConfig *cfg, const char *filename, bool privileged); int -virQEMUDriverConfigValidate(virQEMUDriverConfigPtr cfg); +virQEMUDriverConfigValidate(virQEMUDriverConfig *cfg); int -virQEMUDriverConfigSetDefaults(virQEMUDriverConfigPtr cfg); +virQEMUDriverConfigSetDefaults(virQEMUDriverConfig *cfg); -virQEMUDriverConfigPtr virQEMUDriverGetConfig(virQEMUDriverPtr driver); +virQEMUDriverConfig *virQEMUDriverGetConfig(virQEMUDriver *driver); -virCPUDefPtr virQEMUDriverGetHostCPU(virQEMUDriverPtr driver); -virCapsPtr virQEMUDriverCreateCapabilities(virQEMUDriverPtr driver); -virCapsPtr virQEMUDriverGetCapabilities(virQEMUDriverPtr driver, +virCPUDef *virQEMUDriverGetHostCPU(virQEMUDriver *driver); +virCaps *virQEMUDriverCreateCapabilities(virQEMUDriver *driver); +virCaps *virQEMUDriverGetCapabilities(virQEMUDriver *driver, bool refresh); -virDomainCapsPtr -virQEMUDriverGetDomainCapabilities(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, +virDomainCaps * +virQEMUDriverGetDomainCapabilities(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, const char *machine, virArch arch, virDomainVirtType virttype); typedef struct _qemuSharedDeviceEntry qemuSharedDeviceEntry; -typedef qemuSharedDeviceEntry *qemuSharedDeviceEntryPtr; -bool qemuSharedDeviceEntryDomainExists(qemuSharedDeviceEntryPtr entry, +bool qemuSharedDeviceEntryDomainExists(qemuSharedDeviceEntry *entry, const char *name, int *idx) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); @@ -359,49 +356,49 @@ char *qemuGetSharedDeviceKey(const char *disk_path) void qemuSharedDeviceEntryFree(void *payload); -int qemuAddSharedDisk(virQEMUDriverPtr driver, - virDomainDiskDefPtr disk, +int qemuAddSharedDisk(virQEMUDriver *driver, + virDomainDiskDef *disk, const char *name) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuAddSharedDevice(virQEMUDriverPtr driver, - virDomainDeviceDefPtr dev, +int qemuAddSharedDevice(virQEMUDriver *driver, + virDomainDeviceDef *dev, const char *name) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuRemoveSharedDevice(virQEMUDriverPtr driver, - virDomainDeviceDefPtr dev, +int qemuRemoveSharedDevice(virQEMUDriver *driver, + virDomainDeviceDef *dev, const char *name) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuRemoveSharedDisk(virQEMUDriverPtr driver, - virDomainDiskDefPtr disk, +int qemuRemoveSharedDisk(virQEMUDriver *driver, + virDomainDiskDef *disk, const char *name) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuSetUnprivSGIO(virDomainDeviceDefPtr dev); +int qemuSetUnprivSGIO(virDomainDeviceDef *dev); -int qemuDriverAllocateID(virQEMUDriverPtr driver); -virDomainXMLOptionPtr virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver, +int qemuDriverAllocateID(virQEMUDriver *driver); +virDomainXMLOption *virQEMUDriverCreateXMLConf(virQEMUDriver *driver, const char *defsecmodel); -int qemuTranslateSnapshotDiskSourcePool(virDomainSnapshotDiskDefPtr def); +int qemuTranslateSnapshotDiskSourcePool(virDomainSnapshotDiskDef *def); -char * qemuGetBaseHugepagePath(virQEMUDriverPtr driver, - virHugeTLBFSPtr hugepage); -char * qemuGetDomainHugepagePath(virQEMUDriverPtr driver, +char * qemuGetBaseHugepagePath(virQEMUDriver *driver, + virHugeTLBFS *hugepage); +char * qemuGetDomainHugepagePath(virQEMUDriver *driver, const virDomainDef *def, - virHugeTLBFSPtr hugepage); + virHugeTLBFS *hugepage); -int qemuGetDomainHupageMemPath(virQEMUDriverPtr driver, +int qemuGetDomainHupageMemPath(virQEMUDriver *driver, const virDomainDef *def, unsigned long long pagesize, char **memPath); -int qemuGetMemoryBackingDomainPath(virQEMUDriverPtr driver, +int qemuGetMemoryBackingDomainPath(virQEMUDriver *driver, const virDomainDef *def, char **path); -int qemuGetMemoryBackingPath(virQEMUDriverPtr driver, +int qemuGetMemoryBackingPath(virQEMUDriver *driver, const virDomainDef *def, const char *alias, char **memPath); diff --git a/src/qemu/qemu_dbus.c b/src/qemu/qemu_dbus.c index 31ede2646f..2ed8f8640d 100644 --- a/src/qemu/qemu_dbus.c +++ b/src/qemu/qemu_dbus.c @@ -34,7 +34,7 @@ VIR_LOG_INIT("qemu.dbus"); static char * -qemuDBusCreatePidFilename(virQEMUDriverConfigPtr cfg, +qemuDBusCreatePidFilename(virQEMUDriverConfig *cfg, const char *shortName) { g_autofree char *name = g_strdup_printf("%s-dbus", shortName); @@ -55,7 +55,7 @@ qemuDBusCreateFilename(const char *stateDir, static char * -qemuDBusCreateSocketPath(virQEMUDriverConfigPtr cfg, +qemuDBusCreateSocketPath(virQEMUDriverConfig *cfg, const char *shortName) { return qemuDBusCreateFilename(cfg->dbusStateDir, shortName, ".sock"); @@ -63,7 +63,7 @@ qemuDBusCreateSocketPath(virQEMUDriverConfigPtr cfg, static char * -qemuDBusCreateConfPath(virQEMUDriverConfigPtr cfg, +qemuDBusCreateConfPath(virQEMUDriverConfig *cfg, const char *shortName) { return qemuDBusCreateFilename(cfg->dbusStateDir, shortName, ".conf"); @@ -71,8 +71,8 @@ qemuDBusCreateConfPath(virQEMUDriverConfigPtr cfg, char * -qemuDBusGetAddress(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDBusGetAddress(virQEMUDriver *driver, + virDomainObj *vm) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autofree char *shortName = virDomainDefGetShortName(vm->def); @@ -125,11 +125,11 @@ qemuDBusWriteConfig(const char *filename, const char *path) void -qemuDBusStop(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDBusStop(virQEMUDriver *driver, + virDomainObj *vm) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *shortName = NULL; g_autofree char *pidfile = NULL; @@ -147,12 +147,12 @@ qemuDBusStop(virQEMUDriverPtr driver, int -qemuDBusSetupCgroup(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCgroupPtr cgroup) +qemuDBusSetupCgroup(virQEMUDriver *driver, + virDomainObj *vm, + virCgroup *cgroup) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *shortName = NULL; g_autofree char *pidfile = NULL; pid_t cpid = -1; @@ -172,11 +172,11 @@ qemuDBusSetupCgroup(virQEMUDriverPtr driver, } int -qemuDBusStart(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDBusStart(virQEMUDriver *driver, + virDomainObj *vm) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virCommand) cmd = NULL; g_autofree char *shortName = NULL; g_autofree char *pidfile = NULL; @@ -288,18 +288,18 @@ qemuDBusStart(virQEMUDriverPtr driver, void -qemuDBusVMStateAdd(virDomainObjPtr vm, const char *id) +qemuDBusVMStateAdd(virDomainObj *vm, const char *id) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; priv->dbusVMStateIds = g_slist_append(priv->dbusVMStateIds, g_strdup(id)); } void -qemuDBusVMStateRemove(virDomainObjPtr vm, const char *id) +qemuDBusVMStateRemove(virDomainObj *vm, const char *id) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; GSList *next; for (next = priv->dbusVMStateIds; next; next = next->next) { diff --git a/src/qemu/qemu_dbus.h b/src/qemu/qemu_dbus.h index 5900b99144..b27f38a591 100644 --- a/src/qemu/qemu_dbus.h +++ b/src/qemu/qemu_dbus.h @@ -21,19 +21,19 @@ #include "qemu_conf.h" #include "qemu_domain.h" -char *qemuDBusGetAddress(virQEMUDriverPtr driver, - virDomainObjPtr vm); +char *qemuDBusGetAddress(virQEMUDriver *driver, + virDomainObj *vm); -int qemuDBusStart(virQEMUDriverPtr driver, - virDomainObjPtr vm); +int qemuDBusStart(virQEMUDriver *driver, + virDomainObj *vm); -void qemuDBusStop(virQEMUDriverPtr driver, - virDomainObjPtr vm); +void qemuDBusStop(virQEMUDriver *driver, + virDomainObj *vm); -void qemuDBusVMStateAdd(virDomainObjPtr vm, const char *id); +void qemuDBusVMStateAdd(virDomainObj *vm, const char *id); -void qemuDBusVMStateRemove(virDomainObjPtr vm, const char *id); +void qemuDBusVMStateRemove(virDomainObj *vm, const char *id); -int qemuDBusSetupCgroup(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCgroupPtr cgroup); +int qemuDBusSetupCgroup(virQEMUDriver *driver, + virDomainObj *vm, + virCgroup *cgroup); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c3d85209bb..ee6a37b70e 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -87,7 +87,7 @@ qemuJobAllocPrivate(void) void -qemuDomainJobPrivateMigrateTempBitmapFree(qemuDomainJobPrivateMigrateTempBitmapPtr bmp) +qemuDomainJobPrivateMigrateTempBitmapFree(qemuDomainJobPrivateMigrateTempBitmap *bmp) { if (!bmp) return; @@ -101,7 +101,7 @@ qemuDomainJobPrivateMigrateTempBitmapFree(qemuDomainJobPrivateMigrateTempBitmapP static void qemuJobFreePrivate(void *opaque) { - qemuDomainJobPrivatePtr priv = opaque; + qemuDomainJobPrivate *priv = opaque; if (!priv) return; @@ -117,7 +117,7 @@ qemuJobFreePrivate(void *opaque) static void qemuJobResetPrivate(void *opaque) { - qemuDomainJobPrivatePtr priv = opaque; + qemuDomainJobPrivate *priv = opaque; priv->spiceMigration = false; priv->spiceMigrated = false; @@ -128,9 +128,9 @@ qemuJobResetPrivate(void *opaque) static int -qemuDomainObjPrivateXMLFormatNBDMigrationSource(virBufferPtr buf, - virStorageSourcePtr src, - virDomainXMLOptionPtr xmlopt) +qemuDomainObjPrivateXMLFormatNBDMigrationSource(virBuffer *buf, + virStorageSource *src, + virDomainXMLOption *xmlopt) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -151,13 +151,13 @@ qemuDomainObjPrivateXMLFormatNBDMigrationSource(virBufferPtr buf, static int -qemuDomainObjPrivateXMLFormatNBDMigration(virBufferPtr buf, - virDomainObjPtr vm) +qemuDomainObjPrivateXMLFormatNBDMigration(virBuffer *buf, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; size_t i; - virDomainDiskDefPtr disk; - qemuDomainDiskPrivatePtr diskPriv; + virDomainDiskDef *disk; + qemuDomainDiskPrivate *diskPriv; for (i = 0; i < vm->def->ndisks; i++) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; @@ -182,14 +182,14 @@ qemuDomainObjPrivateXMLFormatNBDMigration(virBufferPtr buf, static void -qemuDomainObjPrivateXMLFormatMigrateTempBitmap(virBufferPtr buf, +qemuDomainObjPrivateXMLFormatMigrateTempBitmap(virBuffer *buf, GSList *bitmaps) { g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); GSList *next; for (next = bitmaps; next; next = next->next) { - qemuDomainJobPrivateMigrateTempBitmapPtr t = next->data; + qemuDomainJobPrivateMigrateTempBitmap *t = next->data; g_auto(virBuffer) bitmapBuf = VIR_BUFFER_INITIALIZER; virBufferAsprintf(&bitmapBuf, " name='%s'", t->bitmapname); @@ -203,11 +203,11 @@ qemuDomainObjPrivateXMLFormatMigrateTempBitmap(virBufferPtr buf, static int -qemuDomainFormatJobPrivate(virBufferPtr buf, - qemuDomainJobObjPtr job, - virDomainObjPtr vm) +qemuDomainFormatJobPrivate(virBuffer *buf, + qemuDomainJobObj *job, + virDomainObj *vm) { - qemuDomainJobPrivatePtr priv = job->privateData; + qemuDomainJobPrivate *priv = job->privateData; if (job->asyncJob == QEMU_ASYNC_JOB_MIGRATION_OUT) { if (qemuDomainObjPrivateXMLFormatNBDMigration(buf, vm) < 0) @@ -226,11 +226,11 @@ qemuDomainFormatJobPrivate(virBufferPtr buf, static int qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node, xmlXPathContextPtr ctxt, - virDomainDiskDefPtr disk, - virDomainXMLOptionPtr xmlopt) + virDomainDiskDef *disk, + virDomainXMLOption *xmlopt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); g_autofree char *format = NULL; g_autofree char *type = NULL; g_autoptr(virStorageSource) migrSource = NULL; @@ -271,10 +271,10 @@ qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node, static int -qemuDomainObjPrivateXMLParseJobNBD(virDomainObjPtr vm, +qemuDomainObjPrivateXMLParseJobNBD(virDomainObj *vm, xmlXPathContextPtr ctxt) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree xmlNodePtr *nodes = NULL; size_t i; int n; @@ -289,7 +289,7 @@ qemuDomainObjPrivateXMLParseJobNBD(virDomainObjPtr vm, n = 0; } for (i = 0; i < n; i++) { - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; g_autofree char *dst = NULL; if ((dst = virXMLPropString(nodes[i], "dev")) && @@ -309,7 +309,7 @@ qemuDomainObjPrivateXMLParseJobNBD(virDomainObjPtr vm, static int -qemuDomainObjPrivateXMLParseMigrateTempBitmap(qemuDomainJobPrivatePtr jobPriv, +qemuDomainObjPrivateXMLParseMigrateTempBitmap(qemuDomainJobPrivate *jobPriv, xmlXPathContextPtr ctxt) { g_autoslist(qemuDomainJobPrivateMigrateTempBitmap) bitmaps = NULL; @@ -324,7 +324,7 @@ qemuDomainObjPrivateXMLParseMigrateTempBitmap(qemuDomainJobPrivatePtr jobPriv, return 0; for (i = 0; i < n; i++) { - qemuDomainJobPrivateMigrateTempBitmapPtr bmp; + qemuDomainJobPrivateMigrateTempBitmap *bmp; bmp = g_new0(qemuDomainJobPrivateMigrateTempBitmap, 1); bmp->nodename = virXMLPropString(nodes[i], "nodename"); @@ -347,10 +347,10 @@ qemuDomainObjPrivateXMLParseMigrateTempBitmap(qemuDomainJobPrivatePtr jobPriv, static int qemuDomainParseJobPrivate(xmlXPathContextPtr ctxt, - qemuDomainJobObjPtr job, - virDomainObjPtr vm) + qemuDomainJobObj *job, + virDomainObj *vm) { - qemuDomainJobPrivatePtr priv = job->privateData; + qemuDomainJobPrivate *priv = job->privateData; if (qemuDomainObjPrivateXMLParseJobNBD(vm, ctxt) < 0) return -1; @@ -377,17 +377,17 @@ static qemuDomainObjPrivateJobCallbacks qemuPrivateJobCallbacks = { * qemuDomainObjFromDomain: * @domain: Domain pointer that has to be looked up * - * This function looks up @domain and returns the appropriate virDomainObjPtr + * This function looks up @domain and returns the appropriate virDomainObj * * that has to be released by calling virDomainObjEndAPI(). * * Returns the domain object with incremented reference counter which is locked * on success, NULL otherwise. */ -virDomainObjPtr +virDomainObj * qemuDomainObjFromDomain(virDomainPtr domain) { - virDomainObjPtr vm; - virQEMUDriverPtr driver = domain->conn->privateData; + virDomainObj *vm; + virQEMUDriver *driver = domain->conn->privateData; char uuidstr[VIR_UUID_STRING_BUFLEN]; vm = virDomainObjListFindByUUID(driver->domains, domain->uuid); @@ -411,11 +411,11 @@ struct _qemuDomainLogContext { off_t pos; ino_t inode; /* Only used if manager != NULL */ char *path; - virLogManagerPtr manager; + virLogManager *manager; }; G_DEFINE_TYPE(qemuDomainLogContext, qemu_domain_log_context, G_TYPE_OBJECT); -static virClassPtr qemuDomainSaveCookieClass; +static virClass *qemuDomainSaveCookieClass; static void qemuDomainLogContextFinalize(GObject *obj); static void qemuDomainSaveCookieDispose(void *obj); @@ -446,7 +446,7 @@ VIR_ONCE_GLOBAL_INIT(qemuDomain); static void qemuDomainLogContextFinalize(GObject *object) { - qemuDomainLogContextPtr ctxt = QEMU_DOMAIN_LOG_CONTEXT(object); + qemuDomainLogContext *ctxt = QEMU_DOMAIN_LOG_CONTEXT(object); VIR_DEBUG("ctxt=%p", ctxt); virLogManagerFree(ctxt->manager); @@ -486,12 +486,12 @@ qemuDomainGetMasterKeyFilePath(const char *libDir) * Returns 0 on success, -1 on failure with error message indicating failure */ int -qemuDomainWriteMasterKeyFile(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDomainWriteMasterKeyFile(virQEMUDriver *driver, + virDomainObj *vm) { g_autofree char *path = NULL; VIR_AUTOCLOSE fd = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; /* Only gets filled in if we have the capability */ if (!priv->masterKey) @@ -520,7 +520,7 @@ qemuDomainWriteMasterKeyFile(virQEMUDriverPtr driver, static void -qemuDomainMasterKeyFree(qemuDomainObjPrivatePtr priv) +qemuDomainMasterKeyFree(qemuDomainObjPrivate *priv) { if (!priv->masterKey) return; @@ -548,7 +548,7 @@ qemuDomainMasterKeyFree(qemuDomainObjPrivatePtr priv) * -1 on failure with error message indicating failure */ int -qemuDomainMasterKeyReadFile(qemuDomainObjPrivatePtr priv) +qemuDomainMasterKeyReadFile(qemuDomainObjPrivate *priv) { g_autofree char *path = NULL; int fd = -1; @@ -616,7 +616,7 @@ qemuDomainMasterKeyReadFile(qemuDomainObjPrivatePtr priv) * delete the file. */ void -qemuDomainMasterKeyRemove(qemuDomainObjPrivatePtr priv) +qemuDomainMasterKeyRemove(qemuDomainObjPrivate *priv) { g_autofree char *path = NULL; @@ -642,9 +642,9 @@ qemuDomainMasterKeyRemove(qemuDomainObjPrivatePtr priv) * Returns: 0 on success, -1 w/ error message on failure */ int -qemuDomainMasterKeyCreate(virDomainObjPtr vm) +qemuDomainMasterKeyCreate(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree uint8_t *key = NULL; /* If we don't have the capability, then do nothing. */ @@ -664,7 +664,7 @@ qemuDomainMasterKeyCreate(virDomainObjPtr vm) static void -qemuDomainSecretPlainClear(qemuDomainSecretPlainPtr secret) +qemuDomainSecretPlainClear(struct _qemuDomainSecretPlain *secret) { VIR_FREE(secret->username); virSecureErase(secret->secret, secret->secretlen); @@ -673,7 +673,7 @@ qemuDomainSecretPlainClear(qemuDomainSecretPlainPtr secret) static void -qemuDomainSecretAESClear(qemuDomainSecretAESPtr secret, +qemuDomainSecretAESClear(struct _qemuDomainSecretAES *secret, bool keepAlias) { if (!keepAlias) @@ -686,7 +686,7 @@ qemuDomainSecretAESClear(qemuDomainSecretAESPtr secret, static void -qemuDomainSecretInfoClear(qemuDomainSecretInfoPtr secinfo, +qemuDomainSecretInfoClear(qemuDomainSecretInfo *secinfo, bool keepAlias) { if (!secinfo) @@ -708,7 +708,7 @@ qemuDomainSecretInfoClear(qemuDomainSecretInfoPtr secinfo, void -qemuDomainSecretInfoFree(qemuDomainSecretInfoPtr secinfo) +qemuDomainSecretInfoFree(qemuDomainSecretInfo *secinfo) { qemuDomainSecretInfoClear(secinfo, false); g_free(secinfo); @@ -722,13 +722,13 @@ qemuDomainSecretInfoFree(qemuDomainSecretInfoPtr secinfo) * Removes any data unnecessary for further use, but keeps alias allocated. */ void -qemuDomainSecretInfoDestroy(qemuDomainSecretInfoPtr secinfo) +qemuDomainSecretInfoDestroy(qemuDomainSecretInfo *secinfo) { qemuDomainSecretInfoClear(secinfo, true); } -static virClassPtr qemuDomainDiskPrivateClass; +static virClass *qemuDomainDiskPrivateClass; static void qemuDomainDiskPrivateDispose(void *obj); static int @@ -742,10 +742,10 @@ qemuDomainDiskPrivateOnceInit(void) VIR_ONCE_GLOBAL_INIT(qemuDomainDiskPrivate); -static virObjectPtr +static virObject * qemuDomainDiskPrivateNew(void) { - qemuDomainDiskPrivatePtr priv; + qemuDomainDiskPrivate *priv; if (qemuDomainDiskPrivateInitialize() < 0) return NULL; @@ -753,13 +753,13 @@ qemuDomainDiskPrivateNew(void) if (!(priv = virObjectNew(qemuDomainDiskPrivateClass))) return NULL; - return (virObjectPtr) priv; + return (virObject *) priv; } static void qemuDomainDiskPrivateDispose(void *obj) { - qemuDomainDiskPrivatePtr priv = obj; + qemuDomainDiskPrivate *priv = obj; virObjectUnref(priv->migrSource); g_free(priv->qomName); @@ -767,7 +767,7 @@ qemuDomainDiskPrivateDispose(void *obj) virObjectUnref(priv->blockjob); } -static virClassPtr qemuDomainStorageSourcePrivateClass; +static virClass *qemuDomainStorageSourcePrivateClass; static void qemuDomainStorageSourcePrivateDispose(void *obj); static int @@ -781,10 +781,10 @@ qemuDomainStorageSourcePrivateOnceInit(void) VIR_ONCE_GLOBAL_INIT(qemuDomainStorageSourcePrivate); -virObjectPtr +virObject * qemuDomainStorageSourcePrivateNew(void) { - qemuDomainStorageSourcePrivatePtr priv; + qemuDomainStorageSourcePrivate *priv; if (qemuDomainStorageSourcePrivateInitialize() < 0) return NULL; @@ -792,14 +792,14 @@ qemuDomainStorageSourcePrivateNew(void) if (!(priv = virObjectNew(qemuDomainStorageSourcePrivateClass))) return NULL; - return (virObjectPtr) priv; + return (virObject *) priv; } static void qemuDomainStorageSourcePrivateDispose(void *obj) { - qemuDomainStorageSourcePrivatePtr priv = obj; + qemuDomainStorageSourcePrivate *priv = obj; g_clear_pointer(&priv->secinfo, qemuDomainSecretInfoFree); g_clear_pointer(&priv->encinfo, qemuDomainSecretInfoFree); @@ -808,8 +808,8 @@ qemuDomainStorageSourcePrivateDispose(void *obj) } -qemuDomainStorageSourcePrivatePtr -qemuDomainStorageSourcePrivateFetch(virStorageSourcePtr src) +qemuDomainStorageSourcePrivate * +qemuDomainStorageSourcePrivateFetch(virStorageSource *src) { if (!src->privateData) src->privateData = qemuDomainStorageSourcePrivateNew(); @@ -818,7 +818,7 @@ qemuDomainStorageSourcePrivateFetch(virStorageSourcePtr src) } -static virClassPtr qemuDomainVcpuPrivateClass; +static virClass *qemuDomainVcpuPrivateClass; static void qemuDomainVcpuPrivateDispose(void *obj); static int @@ -832,10 +832,10 @@ qemuDomainVcpuPrivateOnceInit(void) VIR_ONCE_GLOBAL_INIT(qemuDomainVcpuPrivate); -static virObjectPtr +static virObject * qemuDomainVcpuPrivateNew(void) { - qemuDomainVcpuPrivatePtr priv; + qemuDomainVcpuPrivate *priv; if (qemuDomainVcpuPrivateInitialize() < 0) return NULL; @@ -843,14 +843,14 @@ qemuDomainVcpuPrivateNew(void) if (!(priv = virObjectNew(qemuDomainVcpuPrivateClass))) return NULL; - return (virObjectPtr) priv; + return (virObject *) priv; } static void qemuDomainVcpuPrivateDispose(void *obj) { - qemuDomainVcpuPrivatePtr priv = obj; + qemuDomainVcpuPrivate *priv = obj; g_free(priv->type); g_free(priv->alias); @@ -859,7 +859,7 @@ qemuDomainVcpuPrivateDispose(void *obj) } -static virClassPtr qemuDomainChrSourcePrivateClass; +static virClass *qemuDomainChrSourcePrivateClass; static void qemuDomainChrSourcePrivateDispose(void *obj); static int @@ -873,10 +873,10 @@ qemuDomainChrSourcePrivateOnceInit(void) VIR_ONCE_GLOBAL_INIT(qemuDomainChrSourcePrivate); -static virObjectPtr +static virObject * qemuDomainChrSourcePrivateNew(void) { - qemuDomainChrSourcePrivatePtr priv; + qemuDomainChrSourcePrivate *priv; if (qemuDomainChrSourcePrivateInitialize() < 0) return NULL; @@ -884,20 +884,20 @@ qemuDomainChrSourcePrivateNew(void) if (!(priv = virObjectNew(qemuDomainChrSourcePrivateClass))) return NULL; - return (virObjectPtr) priv; + return (virObject *) priv; } static void qemuDomainChrSourcePrivateDispose(void *obj) { - qemuDomainChrSourcePrivatePtr priv = obj; + qemuDomainChrSourcePrivate *priv = obj; g_clear_pointer(&priv->secinfo, qemuDomainSecretInfoFree); } -static virClassPtr qemuDomainVsockPrivateClass; +static virClass *qemuDomainVsockPrivateClass; static void qemuDomainVsockPrivateDispose(void *obj); static int @@ -911,10 +911,10 @@ qemuDomainVsockPrivateOnceInit(void) VIR_ONCE_GLOBAL_INIT(qemuDomainVsockPrivate); -static virObjectPtr +static virObject * qemuDomainVsockPrivateNew(void) { - qemuDomainVsockPrivatePtr priv; + qemuDomainVsockPrivate *priv; if (qemuDomainVsockPrivateInitialize() < 0) return NULL; @@ -924,20 +924,20 @@ qemuDomainVsockPrivateNew(void) priv->vhostfd = -1; - return (virObjectPtr) priv; + return (virObject *) priv; } static void qemuDomainVsockPrivateDispose(void *obj G_GNUC_UNUSED) { - qemuDomainVsockPrivatePtr priv = obj; + qemuDomainVsockPrivate *priv = obj; VIR_FORCE_CLOSE(priv->vhostfd); } -static virClassPtr qemuDomainGraphicsPrivateClass; +static virClass *qemuDomainGraphicsPrivateClass; static void qemuDomainGraphicsPrivateDispose(void *obj); static int @@ -951,10 +951,10 @@ qemuDomainGraphicsPrivateOnceInit(void) VIR_ONCE_GLOBAL_INIT(qemuDomainGraphicsPrivate); -static virObjectPtr +static virObject * qemuDomainGraphicsPrivateNew(void) { - qemuDomainGraphicsPrivatePtr priv; + qemuDomainGraphicsPrivate *priv; if (qemuDomainGraphicsPrivateInitialize() < 0) return NULL; @@ -962,21 +962,21 @@ qemuDomainGraphicsPrivateNew(void) if (!(priv = virObjectNew(qemuDomainGraphicsPrivateClass))) return NULL; - return (virObjectPtr) priv; + return (virObject *) priv; } static void qemuDomainGraphicsPrivateDispose(void *obj) { - qemuDomainGraphicsPrivatePtr priv = obj; + qemuDomainGraphicsPrivate *priv = obj; g_free(priv->tlsAlias); g_clear_pointer(&priv->secinfo, qemuDomainSecretInfoFree); } -static virClassPtr qemuDomainNetworkPrivateClass; +static virClass *qemuDomainNetworkPrivateClass; static void qemuDomainNetworkPrivateDispose(void *obj); @@ -993,10 +993,10 @@ qemuDomainNetworkPrivateOnceInit(void) VIR_ONCE_GLOBAL_INIT(qemuDomainNetworkPrivate); -static virObjectPtr +static virObject * qemuDomainNetworkPrivateNew(void) { - qemuDomainNetworkPrivatePtr priv; + qemuDomainNetworkPrivate *priv; if (qemuDomainNetworkPrivateInitialize() < 0) return NULL; @@ -1004,20 +1004,20 @@ qemuDomainNetworkPrivateNew(void) if (!(priv = virObjectNew(qemuDomainNetworkPrivateClass))) return NULL; - return (virObjectPtr) priv; + return (virObject *) priv; } static void qemuDomainNetworkPrivateDispose(void *obj G_GNUC_UNUSED) { - qemuDomainNetworkPrivatePtr priv = obj; + qemuDomainNetworkPrivate *priv = obj; qemuSlirpFree(priv->slirp); } -static virClassPtr qemuDomainFSPrivateClass; +static virClass *qemuDomainFSPrivateClass; static void qemuDomainFSPrivateDispose(void *obj); @@ -1034,10 +1034,10 @@ qemuDomainFSPrivateOnceInit(void) VIR_ONCE_GLOBAL_INIT(qemuDomainFSPrivate); -static virObjectPtr +static virObject * qemuDomainFSPrivateNew(void) { - qemuDomainFSPrivatePtr priv; + qemuDomainFSPrivate *priv; if (qemuDomainFSPrivateInitialize() < 0) return NULL; @@ -1045,19 +1045,19 @@ qemuDomainFSPrivateNew(void) if (!(priv = virObjectNew(qemuDomainFSPrivateClass))) return NULL; - return (virObjectPtr) priv; + return (virObject *) priv; } static void qemuDomainFSPrivateDispose(void *obj) { - qemuDomainFSPrivatePtr priv = obj; + qemuDomainFSPrivate *priv = obj; g_free(priv->vhostuser_fs_sock); } -static virClassPtr qemuDomainVideoPrivateClass; +static virClass *qemuDomainVideoPrivateClass; static void qemuDomainVideoPrivateDispose(void *obj); @@ -1073,10 +1073,10 @@ qemuDomainVideoPrivateOnceInit(void) VIR_ONCE_GLOBAL_INIT(qemuDomainVideoPrivate); -static virObjectPtr +static virObject * qemuDomainVideoPrivateNew(void) { - qemuDomainVideoPrivatePtr priv; + qemuDomainVideoPrivate *priv; if (qemuDomainVideoPrivateInitialize() < 0) return NULL; @@ -1086,14 +1086,14 @@ qemuDomainVideoPrivateNew(void) priv->vhost_user_fd = -1; - return (virObjectPtr) priv; + return (virObject *) priv; } static void qemuDomainVideoPrivateDispose(void *obj) { - qemuDomainVideoPrivatePtr priv = obj; + qemuDomainVideoPrivate *priv = obj; VIR_FORCE_CLOSE(priv->vhost_user_fd); } @@ -1110,10 +1110,10 @@ qemuDomainVideoPrivateDispose(void *obj) * Returns 0 on success, -1 on failure with error message */ static int -qemuDomainSecretPlainSetup(qemuDomainSecretInfoPtr secinfo, +qemuDomainSecretPlainSetup(qemuDomainSecretInfo *secinfo, virSecretUsageType usageType, const char *username, - virSecretLookupTypeDefPtr seclookupdef) + virSecretLookupTypeDef *seclookupdef) { g_autoptr(virConnect) conn = virGetConnectSecret(); int ret = -1; @@ -1141,10 +1141,10 @@ qemuDomainSecretPlainSetup(qemuDomainSecretInfoPtr secinfo, * * Encrypts @secret for use with qemu. * - * Returns qemuDomainSecretInfoPtr filled with the necessary information. + * Returns qemuDomainSecretInfo *filled with the necessary information. */ -static qemuDomainSecretInfoPtr -qemuDomainSecretAESSetup(qemuDomainObjPrivatePtr priv, +static qemuDomainSecretInfo * +qemuDomainSecretAESSetup(qemuDomainObjPrivate *priv, const char *alias, const char *username, uint8_t *secret, @@ -1201,19 +1201,19 @@ qemuDomainSecretAESSetup(qemuDomainObjPrivatePtr priv, * @seclookupdef: Pointer to seclookupdef data * * Looks up a secret in the secret driver based on @usageType and @seclookupdef - * and builds qemuDomainSecretInfoPtr from it. @use describes the usage of the + * and builds qemuDomainSecretInfo *from it. @use describes the usage of the * secret in case if @srcalias requires more secrets for various usage cases. */ -static qemuDomainSecretInfoPtr -qemuDomainSecretAESSetupFromSecret(qemuDomainObjPrivatePtr priv, +static qemuDomainSecretInfo * +qemuDomainSecretAESSetupFromSecret(qemuDomainObjPrivate *priv, const char *srcalias, const char *secretuse, virSecretUsageType usageType, const char *username, - virSecretLookupTypeDefPtr seclookupdef) + virSecretLookupTypeDef *seclookupdef) { g_autoptr(virConnect) conn = virGetConnectSecret(); - qemuDomainSecretInfoPtr secinfo; + qemuDomainSecretInfo *secinfo; g_autofree char *alias = qemuAliasForSecret(srcalias, secretuse); g_autofree uint8_t *secret = NULL; size_t secretlen = 0; @@ -1241,7 +1241,7 @@ qemuDomainSecretAESSetupFromSecret(qemuDomainObjPrivatePtr priv, * @priv belongs to. */ bool -qemuDomainSupportsEncryptedSecret(qemuDomainObjPrivatePtr priv) +qemuDomainSupportsEncryptedSecret(qemuDomainObjPrivate *priv) { return virCryptoHaveCipher(VIR_CRYPTO_CIPHER_AES256CBC) && virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_OBJECT_SECRET) && @@ -1260,12 +1260,12 @@ qemuDomainSupportsEncryptedSecret(qemuDomainObjPrivatePtr priv) * Returns @secinfo on success, NULL on failure. Caller is responsible * to eventually free @secinfo. */ -static qemuDomainSecretInfoPtr +static qemuDomainSecretInfo * qemuDomainSecretInfoNewPlain(virSecretUsageType usageType, const char *username, - virSecretLookupTypeDefPtr lookupDef) + virSecretLookupTypeDef *lookupDef) { - qemuDomainSecretInfoPtr secinfo = NULL; + qemuDomainSecretInfo *secinfo = NULL; secinfo = g_new0(qemuDomainSecretInfo, 1); @@ -1285,12 +1285,12 @@ qemuDomainSecretInfoNewPlain(virSecretUsageType usageType, * @secretUUID: Provide a secretUUID value to look up/create the secretInfo * * Using the passed @secretUUID, generate a seclookupdef that can be used - * to generate the returned qemuDomainSecretInfoPtr for a TLS based secret. + * to generate the returned qemuDomainSecretInfo *for a TLS based secret. * - * Returns qemuDomainSecretInfoPtr or NULL on error. + * Returns qemuDomainSecretInfo *or NULL on error. */ -qemuDomainSecretInfoPtr -qemuDomainSecretInfoTLSNew(qemuDomainObjPrivatePtr priv, +qemuDomainSecretInfo * +qemuDomainSecretInfoTLSNew(qemuDomainObjPrivate *priv, const char *srcAlias, const char *secretUUID) { @@ -1311,10 +1311,10 @@ qemuDomainSecretInfoTLSNew(qemuDomainObjPrivatePtr priv, void -qemuDomainSecretDiskDestroy(virDomainDiskDefPtr disk) +qemuDomainSecretDiskDestroy(virDomainDiskDef *disk) { - qemuDomainStorageSourcePrivatePtr srcPriv; - virStorageSourcePtr n; + qemuDomainStorageSourcePrivate *srcPriv; + virStorageSource *n; for (n = disk->src; virStorageSourceIsBacking(n); n = n->backingStore) { if ((srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(n))) { @@ -1327,7 +1327,7 @@ qemuDomainSecretDiskDestroy(virDomainDiskDefPtr disk) bool -qemuDomainStorageSourceHasAuth(virStorageSourcePtr src) +qemuDomainStorageSourceHasAuth(virStorageSource *src) { if (!virStorageSourceIsEmpty(src) && virStorageSourceGetActualType(src) == VIR_STORAGE_TYPE_NETWORK && @@ -1341,7 +1341,7 @@ qemuDomainStorageSourceHasAuth(virStorageSourcePtr src) static bool -qemuDomainDiskHasEncryptionSecret(virStorageSourcePtr src) +qemuDomainDiskHasEncryptionSecret(virStorageSource *src) { if (!virStorageSourceIsEmpty(src) && src->encryption && src->encryption->format == VIR_STORAGE_ENCRYPTION_FORMAT_LUKS && @@ -1352,9 +1352,9 @@ qemuDomainDiskHasEncryptionSecret(virStorageSourcePtr src) } -static qemuDomainSecretInfoPtr -qemuDomainSecretStorageSourcePrepareCookies(qemuDomainObjPrivatePtr priv, - virStorageSourcePtr src, +static qemuDomainSecretInfo * +qemuDomainSecretStorageSourcePrepareCookies(qemuDomainObjPrivate *priv, + virStorageSource *src, const char *aliasprotocol) { g_autofree char *secretalias = qemuAliasForSecret(aliasprotocol, "httpcookie"); @@ -1380,12 +1380,12 @@ qemuDomainSecretStorageSourcePrepareCookies(qemuDomainObjPrivatePtr priv, * Returns 0 on success; -1 on error while reporting an libvirt error. */ static int -qemuDomainSecretStorageSourcePrepare(qemuDomainObjPrivatePtr priv, - virStorageSourcePtr src, +qemuDomainSecretStorageSourcePrepare(qemuDomainObjPrivate *priv, + virStorageSource *src, const char *aliasprotocol, const char *aliasformat) { - qemuDomainStorageSourcePrivatePtr srcPriv; + qemuDomainStorageSourcePrivate *srcPriv; bool iscsiHasPS = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_ISCSI_PASSWORD_SECRET); bool hasAuth = qemuDomainStorageSourceHasAuth(src); bool hasEnc = qemuDomainDiskHasEncryptionSecret(src); @@ -1442,13 +1442,13 @@ qemuDomainSecretStorageSourcePrepare(qemuDomainObjPrivatePtr priv, void -qemuDomainSecretHostdevDestroy(virDomainHostdevDefPtr hostdev) +qemuDomainSecretHostdevDestroy(virDomainHostdevDef *hostdev) { - qemuDomainStorageSourcePrivatePtr srcPriv; + qemuDomainStorageSourcePrivate *srcPriv; if (virHostdevIsSCSIDevice(hostdev)) { - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &scsisrc->u.iscsi; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIiSCSI *iscsisrc = &scsisrc->u.iscsi; if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) { srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(iscsisrc->src); @@ -1460,9 +1460,9 @@ qemuDomainSecretHostdevDestroy(virDomainHostdevDefPtr hostdev) void -qemuDomainSecretChardevDestroy(virDomainChrSourceDefPtr dev) +qemuDomainSecretChardevDestroy(virDomainChrSourceDef *dev) { - qemuDomainChrSourcePrivatePtr chrSourcePriv = + qemuDomainChrSourcePrivate *chrSourcePriv = QEMU_DOMAIN_CHR_SOURCE_PRIVATE(dev); if (!chrSourcePriv || !chrSourcePriv->secinfo) @@ -1484,10 +1484,10 @@ qemuDomainSecretChardevDestroy(virDomainChrSourceDefPtr dev) * Returns 0 on success, -1 on failure */ int -qemuDomainSecretChardevPrepare(virQEMUDriverConfigPtr cfg, - qemuDomainObjPrivatePtr priv, +qemuDomainSecretChardevPrepare(virQEMUDriverConfig *cfg, + qemuDomainObjPrivate *priv, const char *chrAlias, - virDomainChrSourceDefPtr dev) + virDomainChrSourceDef *dev) { g_autofree char *charAlias = NULL; @@ -1496,7 +1496,7 @@ qemuDomainSecretChardevPrepare(virQEMUDriverConfigPtr cfg, if (dev->data.tcp.haveTLS == VIR_TRISTATE_BOOL_YES && cfg->chardevTLSx509secretUUID) { - qemuDomainChrSourcePrivatePtr chrSourcePriv = + qemuDomainChrSourcePrivate *chrSourcePriv = QEMU_DOMAIN_CHR_SOURCE_PRIVATE(dev); if (!(charAlias = qemuAliasChardevFromDevAlias(chrAlias))) @@ -1515,9 +1515,9 @@ qemuDomainSecretChardevPrepare(virQEMUDriverConfigPtr cfg, static void -qemuDomainSecretGraphicsDestroy(virDomainGraphicsDefPtr graphics) +qemuDomainSecretGraphicsDestroy(virDomainGraphicsDef *graphics) { - qemuDomainGraphicsPrivatePtr gfxPriv = QEMU_DOMAIN_GRAPHICS_PRIVATE(graphics); + qemuDomainGraphicsPrivate *gfxPriv = QEMU_DOMAIN_GRAPHICS_PRIVATE(graphics); if (!gfxPriv) return; @@ -1528,12 +1528,12 @@ qemuDomainSecretGraphicsDestroy(virDomainGraphicsDefPtr graphics) static int -qemuDomainSecretGraphicsPrepare(virQEMUDriverConfigPtr cfg, - qemuDomainObjPrivatePtr priv, - virDomainGraphicsDefPtr graphics) +qemuDomainSecretGraphicsPrepare(virQEMUDriverConfig *cfg, + qemuDomainObjPrivate *priv, + virDomainGraphicsDef *graphics) { - virQEMUCapsPtr qemuCaps = priv->qemuCaps; - qemuDomainGraphicsPrivatePtr gfxPriv = QEMU_DOMAIN_GRAPHICS_PRIVATE(graphics); + virQEMUCaps *qemuCaps = priv->qemuCaps; + qemuDomainGraphicsPrivate *gfxPriv = QEMU_DOMAIN_GRAPHICS_PRIVATE(graphics); if (graphics->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) return 0; @@ -1563,7 +1563,7 @@ qemuDomainSecretGraphicsPrepare(virQEMUDriverConfigPtr cfg, * Removes all unnecessary data which was needed to generate 'secret' objects. */ void -qemuDomainSecretDestroy(virDomainObjPtr vm) +qemuDomainSecretDestroy(virDomainObj *vm) { size_t i; @@ -1617,10 +1617,10 @@ qemuDomainSecretDestroy(virDomainObjPtr vm) * Returns 0 on success, -1 on failure with error message set */ int -qemuDomainSecretPrepare(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDomainSecretPrepare(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); size_t i; @@ -1688,10 +1688,10 @@ qemuDomainSecretPrepare(virQEMUDriverPtr driver, /* This is the old way of setting up per-domain directories */ static void -qemuDomainSetPrivatePathsOld(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDomainSetPrivatePathsOld(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); if (!priv->libDir) @@ -1704,11 +1704,11 @@ qemuDomainSetPrivatePathsOld(virQEMUDriverPtr driver, int -qemuDomainSetPrivatePaths(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDomainSetPrivatePaths(virQEMUDriver *driver, + virDomainObj *vm) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *domname = virDomainDefGetShortName(vm->def); if (!domname) @@ -1726,9 +1726,9 @@ qemuDomainSetPrivatePaths(virQEMUDriverPtr driver, int -qemuDomainObjStartWorker(virDomainObjPtr dom) +qemuDomainObjStartWorker(virDomainObj *dom) { - qemuDomainObjPrivatePtr priv = dom->privateData; + qemuDomainObjPrivate *priv = dom->privateData; if (!priv->eventThread) { g_autofree char *threadName = g_strdup_printf("vm-%s", dom->def->name); @@ -1741,9 +1741,9 @@ qemuDomainObjStartWorker(virDomainObjPtr dom) void -qemuDomainObjStopWorker(virDomainObjPtr dom) +qemuDomainObjStopWorker(virDomainObj *dom) { - qemuDomainObjPrivatePtr priv = dom->privateData; + qemuDomainObjPrivate *priv = dom->privateData; virEventThread *eventThread; if (!priv->eventThread) @@ -1765,7 +1765,7 @@ qemuDomainObjStopWorker(virDomainObjPtr dom) static void * qemuDomainObjPrivateAlloc(void *opaque) { - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; priv = g_new0(qemuDomainObjPrivate, 1); @@ -1801,7 +1801,7 @@ qemuDomainObjPrivateAlloc(void *opaque) * not running. */ void -qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr priv) +qemuDomainObjPrivateDataClear(qemuDomainObjPrivate *priv) { g_strfreev(priv->qemuDevices); priv->qemuDevices = NULL; @@ -1878,7 +1878,7 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr priv) static void qemuDomainObjPrivateFree(void *data) { - qemuDomainObjPrivatePtr priv = data; + qemuDomainObjPrivate *priv = data; qemuDomainObjPrivateDataClear(priv); @@ -1916,7 +1916,7 @@ qemuDomainObjPrivateFree(void *data) static int -qemuStorageSourcePrivateDataAssignSecinfo(qemuDomainSecretInfoPtr *secinfo, +qemuStorageSourcePrivateDataAssignSecinfo(qemuDomainSecretInfo **secinfo, char **alias) { if (!*alias) @@ -1936,9 +1936,9 @@ qemuStorageSourcePrivateDataAssignSecinfo(qemuDomainSecretInfoPtr *secinfo, static int qemuStorageSourcePrivateDataParse(xmlXPathContextPtr ctxt, - virStorageSourcePtr src) + virStorageSource *src) { - qemuDomainStorageSourcePrivatePtr priv; + qemuDomainStorageSourcePrivate *priv; g_autofree char *authalias = NULL; g_autofree char *encalias = NULL; g_autofree char *httpcookiealias = NULL; @@ -1987,8 +1987,8 @@ qemuStorageSourcePrivateDataParse(xmlXPathContextPtr ctxt, static void -qemuStorageSourcePrivateDataFormatSecinfo(virBufferPtr buf, - qemuDomainSecretInfoPtr secinfo, +qemuStorageSourcePrivateDataFormatSecinfo(virBuffer *buf, + qemuDomainSecretInfo *secinfo, const char *type) { if (!secinfo || @@ -2002,11 +2002,11 @@ qemuStorageSourcePrivateDataFormatSecinfo(virBufferPtr buf, static int -qemuStorageSourcePrivateDataFormat(virStorageSourcePtr src, - virBufferPtr buf) +qemuStorageSourcePrivateDataFormat(virStorageSource *src, + virBuffer *buf) { g_auto(virBuffer) tmp = VIR_BUFFER_INIT_CHILD(buf); - qemuDomainStorageSourcePrivatePtr srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); + qemuDomainStorageSourcePrivate *srcPriv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src); g_auto(virBuffer) nodenamesChildBuf = VIR_BUFFER_INIT_CHILD(buf); virBufferEscapeString(&nodenamesChildBuf, "\n", src->nodestorage); @@ -2042,9 +2042,9 @@ qemuStorageSourcePrivateDataFormat(virStorageSourcePtr src, static int qemuDomainDiskPrivateParse(xmlXPathContextPtr ctxt, - virDomainDiskDefPtr disk) + virDomainDiskDef *disk) { - qemuDomainDiskPrivatePtr priv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainDiskPrivate *priv = QEMU_DOMAIN_DISK_PRIVATE(disk); priv->qomName = virXPathString("string(./qom/@name)", ctxt); priv->nodeCopyOnRead = virXPathString("string(./nodenames/nodename[@type='copyOnRead']/@name)", ctxt); @@ -2054,10 +2054,10 @@ qemuDomainDiskPrivateParse(xmlXPathContextPtr ctxt, static int -qemuDomainDiskPrivateFormat(virDomainDiskDefPtr disk, - virBufferPtr buf) +qemuDomainDiskPrivateFormat(virDomainDiskDef *disk, + virBuffer *buf) { - qemuDomainDiskPrivatePtr priv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainDiskPrivate *priv = QEMU_DOMAIN_DISK_PRIVATE(disk); virBufferEscapeString(buf, "\n", priv->qomName); @@ -2075,12 +2075,12 @@ qemuDomainDiskPrivateFormat(virDomainDiskDefPtr disk, static void -qemuDomainObjPrivateXMLFormatVcpus(virBufferPtr buf, - virDomainDefPtr def) +qemuDomainObjPrivateXMLFormatVcpus(virBuffer *buf, + virDomainDef *def) { size_t i; size_t maxvcpus = virDomainDefGetVcpusMax(def); - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; pid_t tid; virBufferAddLit(buf, "\n"); @@ -2102,8 +2102,8 @@ qemuDomainObjPrivateXMLFormatVcpus(virBufferPtr buf, static int -qemuDomainObjPrivateXMLFormatAutomaticPlacement(virBufferPtr buf, - qemuDomainObjPrivatePtr priv) +qemuDomainObjPrivateXMLFormatAutomaticPlacement(virBuffer *buf, + qemuDomainObjPrivate *priv) { g_autofree char *nodeset = NULL; g_autofree char *cpuset = NULL; @@ -2129,16 +2129,16 @@ qemuDomainObjPrivateXMLFormatAutomaticPlacement(virBufferPtr buf, typedef struct qemuDomainPrivateBlockJobFormatData { - virDomainXMLOptionPtr xmlopt; - virBufferPtr buf; + virDomainXMLOption *xmlopt; + virBuffer *buf; } qemuDomainPrivateBlockJobFormatData; static int -qemuDomainObjPrivateXMLFormatBlockjobFormatSource(virBufferPtr buf, +qemuDomainObjPrivateXMLFormatBlockjobFormatSource(virBuffer *buf, const char *element, - virStorageSourcePtr src, - virDomainXMLOptionPtr xmlopt, + virStorageSource *src, + virDomainXMLOption *xmlopt, bool chain) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; @@ -2164,8 +2164,8 @@ qemuDomainObjPrivateXMLFormatBlockjobFormatSource(virBufferPtr buf, static void -qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobDataPtr job, - virBufferPtr buf) +qemuDomainPrivateBlockJobFormatCommit(qemuBlockJobData *job, + virBuffer *buf) { g_auto(virBuffer) disabledBitmapsBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -2194,7 +2194,7 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *payload, g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(data->buf); g_auto(virBuffer) chainsBuf = VIR_BUFFER_INIT_CHILD(&childBuf); - qemuBlockJobDataPtr job = payload; + qemuBlockJobData *job = payload; const char *state = qemuBlockjobStateTypeToString(job->state); const char *newstate = NULL; @@ -2290,10 +2290,10 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *payload, static int -qemuDomainObjPrivateXMLFormatBlockjobs(virBufferPtr buf, - virDomainObjPtr vm) +qemuDomainObjPrivateXMLFormatBlockjobs(virBuffer *buf, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); bool bj = qemuDomainHasBlockjob(vm, false); @@ -2315,10 +2315,10 @@ qemuDomainObjPrivateXMLFormatBlockjobs(virBufferPtr buf, static int -qemuDomainObjPrivateXMLFormatBackups(virBufferPtr buf, - virDomainObjPtr vm) +qemuDomainObjPrivateXMLFormatBackups(virBuffer *buf, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -2332,7 +2332,7 @@ qemuDomainObjPrivateXMLFormatBackups(virBufferPtr buf, void -qemuDomainObjPrivateXMLFormatAllowReboot(virBufferPtr buf, +qemuDomainObjPrivateXMLFormatAllowReboot(virBuffer *buf, virTristateBool allowReboot) { virBufferAsprintf(buf, "\n", @@ -2342,8 +2342,8 @@ qemuDomainObjPrivateXMLFormatAllowReboot(virBufferPtr buf, static void -qemuDomainObjPrivateXMLFormatPR(virBufferPtr buf, - qemuDomainObjPrivatePtr priv) +qemuDomainObjPrivateXMLFormatPR(virBuffer *buf, + qemuDomainObjPrivate *priv) { if (priv->prDaemonRunning) virBufferAddLit(buf, "\n"); @@ -2351,12 +2351,12 @@ qemuDomainObjPrivateXMLFormatPR(virBufferPtr buf, static bool -qemuDomainHasSlirp(virDomainObjPtr vm) +qemuDomainHasSlirp(virDomainObj *vm) { size_t i; for (i = 0; i < vm->def->nnets; i++) { - virDomainNetDefPtr net = vm->def->nets[i]; + virDomainNetDef *net = vm->def->nets[i]; if (QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp) return true; @@ -2367,12 +2367,12 @@ qemuDomainHasSlirp(virDomainObjPtr vm) static bool -qemuDomainGetSlirpHelperOk(virDomainObjPtr vm) +qemuDomainGetSlirpHelperOk(virDomainObj *vm) { size_t i; for (i = 0; i < vm->def->nnets; i++) { - virDomainNetDefPtr net = vm->def->nets[i]; + virDomainNetDef *net = vm->def->nets[i]; /* if there is a builtin slirp, prevent slirp-helper */ if (net->type == VIR_DOMAIN_NET_TYPE_USER && @@ -2385,8 +2385,8 @@ qemuDomainGetSlirpHelperOk(virDomainObjPtr vm) static int -qemuDomainObjPrivateXMLFormatSlirp(virBufferPtr buf, - virDomainObjPtr vm) +qemuDomainObjPrivateXMLFormatSlirp(virBuffer *buf, + virDomainObj *vm) { size_t i; @@ -2397,8 +2397,8 @@ qemuDomainObjPrivateXMLFormatSlirp(virBufferPtr buf, virBufferAdjustIndent(buf, 2); for (i = 0; i < vm->def->nnets; i++) { - virDomainNetDefPtr net = vm->def->nets[i]; - qemuSlirpPtr slirp = QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp; + virDomainNetDef *net = vm->def->nets[i]; + qemuSlirp *slirp = QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp; size_t j; if (!slirp) @@ -2426,10 +2426,10 @@ qemuDomainObjPrivateXMLFormatSlirp(virBufferPtr buf, } static int -qemuDomainObjPrivateXMLFormat(virBufferPtr buf, - virDomainObjPtr vm) +qemuDomainObjPrivateXMLFormat(virBuffer *buf, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; const char *monitorpath; /* priv->monitor_chr is set only for qemu */ @@ -2547,9 +2547,9 @@ qemuDomainObjPrivateXMLFormat(virBufferPtr buf, static int qemuDomainObjPrivateXMLParseVcpu(xmlNodePtr node, unsigned int idx, - virDomainDefPtr def) + virDomainDef *def) { - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; g_autofree char *idstr = NULL; g_autofree char *pidstr = NULL; unsigned int tmp; @@ -2582,7 +2582,7 @@ qemuDomainObjPrivateXMLParseVcpu(xmlNodePtr node, static int qemuDomainObjPrivateXMLParseAutomaticPlacement(xmlXPathContextPtr ctxt, - qemuDomainObjPrivatePtr priv) + qemuDomainObjPrivate *priv) { g_autoptr(virCapsHostNUMA) caps = NULL; g_autofree char *nodeset = NULL; @@ -2603,7 +2603,7 @@ qemuDomainObjPrivateXMLParseAutomaticPlacement(xmlXPathContextPtr ctxt, * This is necessary because NUMA node IDs are not guaranteed to * start from 0 or be densely allocated */ for (i = 0; i < caps->cells->len; i++) { - virCapsHostNUMACellPtr cell = + virCapsHostNUMACell *cell = g_ptr_array_index(caps->cells, i); nodesetSize = MAX(nodesetSize, cell->num + 1); } @@ -2627,10 +2627,10 @@ qemuDomainObjPrivateXMLParseAutomaticPlacement(xmlXPathContextPtr ctxt, } -static virStorageSourcePtr +static virStorageSource * qemuDomainObjPrivateXMLParseBlockjobChain(xmlNodePtr node, xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -2674,11 +2674,11 @@ qemuDomainObjPrivateXMLParseBlockjobChain(xmlNodePtr node, * pointer to it. * On failure NULL is returned and no error is reported. */ -static virStorageSourcePtr -qemuDomainVirStorageSourceFindByNodeName(virStorageSourcePtr top, +static virStorageSource * +qemuDomainVirStorageSourceFindByNodeName(virStorageSource *top, const char *nodeName) { - virStorageSourcePtr tmp; + virStorageSource *tmp; for (tmp = top; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) { if ((tmp->nodeformat && STREQ(tmp->nodeformat, nodeName)) || @@ -2692,9 +2692,9 @@ qemuDomainVirStorageSourceFindByNodeName(virStorageSourcePtr top, static void -qemuDomainObjPrivateXMLParseBlockjobNodename(qemuBlockJobDataPtr job, +qemuDomainObjPrivateXMLParseBlockjobNodename(qemuBlockJobData *job, const char *xpath, - virStorageSourcePtr *src, + virStorageSource **src, xmlXPathContextPtr ctxt) { g_autofree char *nodename = NULL; @@ -2724,7 +2724,7 @@ qemuDomainObjPrivateXMLParseBlockjobNodename(qemuBlockJobDataPtr job, static int -qemuDomainObjPrivateXMLParseBlockjobDataCommit(qemuBlockJobDataPtr job, +qemuDomainObjPrivateXMLParseBlockjobDataCommit(qemuBlockJobData *job, xmlXPathContextPtr ctxt) { if (job->type == QEMU_BLOCKJOB_TYPE_COMMIT) { @@ -2758,9 +2758,9 @@ qemuDomainObjPrivateXMLParseBlockjobDataCommit(qemuBlockJobDataPtr job, static void -qemuDomainObjPrivateXMLParseBlockjobDataSpecific(qemuBlockJobDataPtr job, +qemuDomainObjPrivateXMLParseBlockjobDataSpecific(qemuBlockJobData *job, xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { g_autofree char *createmode = NULL; g_autofree char *shallownew = NULL; @@ -2828,13 +2828,13 @@ qemuDomainObjPrivateXMLParseBlockjobDataSpecific(qemuBlockJobDataPtr job, static int -qemuDomainObjPrivateXMLParseBlockjobData(virDomainObjPtr vm, +qemuDomainObjPrivateXMLParseBlockjobData(virDomainObj *vm, xmlNodePtr node, xmlXPathContextPtr ctxt, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { VIR_XPATH_NODE_AUTORESTORE(ctxt) - virDomainDiskDefPtr disk = NULL; + virDomainDiskDef *disk = NULL; g_autoptr(qemuBlockJobData) job = NULL; g_autofree char *name = NULL; g_autofree char *typestr = NULL; @@ -2925,8 +2925,8 @@ qemuDomainObjPrivateXMLParseBlockjobData(virDomainObjPtr vm, static int -qemuDomainObjPrivateXMLParseBlockjobs(virDomainObjPtr vm, - qemuDomainObjPrivatePtr priv, +qemuDomainObjPrivateXMLParseBlockjobs(virDomainObj *vm, + qemuDomainObjPrivate *priv, xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodes = NULL; @@ -2955,7 +2955,7 @@ qemuDomainObjPrivateXMLParseBlockjobs(virDomainObjPtr vm, static int -qemuDomainObjPrivateXMLParseBackups(qemuDomainObjPrivatePtr priv, +qemuDomainObjPrivateXMLParseBackups(qemuDomainObjPrivate *priv, xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodes = NULL; @@ -3013,7 +3013,7 @@ qemuDomainObjPrivateXMLParsePR(xmlXPathContextPtr ctxt, static int qemuDomainObjPrivateXMLParseSlirpFeatures(xmlNodePtr featuresNode, xmlXPathContextPtr ctxt, - qemuSlirpPtr slirp) + qemuSlirp *slirp) { VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree xmlNodePtr *nodes = NULL; @@ -3051,11 +3051,11 @@ qemuDomainObjPrivateXMLParseSlirpFeatures(xmlNodePtr featuresNode, static int qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, - virDomainObjPtr vm, - virDomainDefParserConfigPtr config) + virDomainObj *vm, + virDomainDefParserConfig *config) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = config->priv; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = config->priv; char *monitorpath; g_autofree char *tmp = NULL; int n; @@ -3275,9 +3275,9 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt, static void * -qemuDomainObjPrivateXMLGetParseOpaque(virDomainObjPtr vm) +qemuDomainObjPrivateXMLGetParseOpaque(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; return priv->qemuCaps; } @@ -3305,7 +3305,7 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = { static void -qemuDomainXmlNsDefFree(qemuDomainXmlNsDefPtr def) +qemuDomainXmlNsDefFree(qemuDomainXmlNsDef *def) { if (!def) return; @@ -3325,14 +3325,14 @@ qemuDomainXmlNsDefFree(qemuDomainXmlNsDefPtr def) static void qemuDomainDefNamespaceFree(void *nsdata) { - qemuDomainXmlNsDefPtr cmd = nsdata; + qemuDomainXmlNsDef *cmd = nsdata; qemuDomainXmlNsDefFree(cmd); } static int -qemuDomainDefNamespaceParseCommandlineArgs(qemuDomainXmlNsDefPtr nsdef, +qemuDomainDefNamespaceParseCommandlineArgs(qemuDomainXmlNsDef *nsdef, xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodes = NULL; @@ -3379,7 +3379,7 @@ qemuDomainDefNamespaceParseCommandlineEnvNameValidate(const char *envname) static int -qemuDomainDefNamespaceParseCommandlineEnv(qemuDomainXmlNsDefPtr nsdef, +qemuDomainDefNamespaceParseCommandlineEnv(qemuDomainXmlNsDef *nsdef, xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodes = NULL; @@ -3415,7 +3415,7 @@ qemuDomainDefNamespaceParseCommandlineEnv(qemuDomainXmlNsDefPtr nsdef, static int -qemuDomainDefNamespaceParseCaps(qemuDomainXmlNsDefPtr nsdef, +qemuDomainDefNamespaceParseCaps(qemuDomainXmlNsDef *nsdef, xmlXPathContextPtr ctxt) { g_autofree xmlNodePtr *nodesadd = NULL; @@ -3460,7 +3460,7 @@ static int qemuDomainDefNamespaceParse(xmlXPathContextPtr ctxt, void **data) { - qemuDomainXmlNsDefPtr nsdata = NULL; + qemuDomainXmlNsDef *nsdata = NULL; int ret = -1; nsdata = g_new0(qemuDomainXmlNsDef, 1); @@ -3486,8 +3486,8 @@ qemuDomainDefNamespaceParse(xmlXPathContextPtr ctxt, static void -qemuDomainDefNamespaceFormatXMLCommandline(virBufferPtr buf, - qemuDomainXmlNsDefPtr cmd) +qemuDomainDefNamespaceFormatXMLCommandline(virBuffer *buf, + qemuDomainXmlNsDef *cmd) { size_t i; @@ -3513,8 +3513,8 @@ qemuDomainDefNamespaceFormatXMLCommandline(virBufferPtr buf, static void -qemuDomainDefNamespaceFormatXMLCaps(virBufferPtr buf, - qemuDomainXmlNsDefPtr xmlns) +qemuDomainDefNamespaceFormatXMLCaps(virBuffer *buf, + qemuDomainXmlNsDef *xmlns) { size_t i; @@ -3536,10 +3536,10 @@ qemuDomainDefNamespaceFormatXMLCaps(virBufferPtr buf, static int -qemuDomainDefNamespaceFormatXML(virBufferPtr buf, +qemuDomainDefNamespaceFormatXML(virBuffer *buf, void *nsdata) { - qemuDomainXmlNsDefPtr cmd = nsdata; + qemuDomainXmlNsDef *cmd = nsdata; qemuDomainDefNamespaceFormatXMLCommandline(buf, cmd); qemuDomainDefNamespaceFormatXMLCaps(buf, cmd); @@ -3579,8 +3579,8 @@ qemuDomainDefAddImplicitInputDevice(virDomainDef *def) } static int -qemuDomainDefAddDefaultAudioBackend(virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuDomainDefAddDefaultAudioBackend(virQEMUDriver *driver, + virDomainDef *def) { size_t i; bool addAudio = false; @@ -3593,7 +3593,7 @@ qemuDomainDefAddDefaultAudioBackend(virQEMUDriverPtr driver, } for (i = 0; i < def->ngraphics; i++) { - virDomainGraphicsDefPtr graph = def->graphics[i]; + virDomainGraphicsDef *graph = def->graphics[i]; switch ((virDomainGraphicsType)graph->type) { case VIR_DOMAIN_GRAPHICS_TYPE_VNC: @@ -3657,13 +3657,13 @@ qemuDomainDefAddDefaultAudioBackend(virQEMUDriverPtr driver, } } if (addAudio) { - virDomainAudioDefPtr audio = g_new0(virDomainAudioDef, 1); + virDomainAudioDef *audio = g_new0(virDomainAudioDef, 1); audio->type = audioBackend; audio->id = 1; def->naudios = 1; - def->audios = g_new0(virDomainAudioDefPtr, def->naudios); + def->audios = g_new0(virDomainAudioDef *, def->naudios); def->audios[0] = audio; if (audioBackend == VIR_DOMAIN_AUDIO_TYPE_SDL) { @@ -3682,9 +3682,9 @@ qemuDomainDefAddDefaultAudioBackend(virQEMUDriverPtr driver, } static int -qemuDomainDefAddDefaultDevices(virQEMUDriverPtr driver, - virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuDomainDefAddDefaultDevices(virQEMUDriver *driver, + virDomainDef *def, + virQEMUCaps *qemuCaps) { bool addDefaultUSB = true; int usbModel = -1; /* "default for machinetype" */ @@ -3868,7 +3868,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriverPtr driver, } if (addDefaultMemballoon && !def->memballoon) { - virDomainMemballoonDefPtr memballoon; + virDomainMemballoonDef *memballoon; memballoon = g_new0(virDomainMemballoonDef, 1); memballoon->model = VIR_DOMAIN_MEMBALLOON_MODEL_VIRTIO; @@ -3925,7 +3925,7 @@ qemuDomainDefAddDefaultDevices(virQEMUDriverPtr driver, } if (j == def->npanics) { - virDomainPanicDefPtr panic = g_new0(virDomainPanicDef, 1); + virDomainPanicDef *panic = g_new0(virDomainPanicDef, 1); if (VIR_APPEND_ELEMENT_COPY(def->panics, def->npanics, panic) < 0) { @@ -3951,8 +3951,8 @@ qemuDomainDefAddDefaultDevices(virQEMUDriverPtr driver, * enabled and configure default values related to those features. */ static void -qemuDomainDefEnableDefaultFeatures(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuDomainDefEnableDefaultFeatures(virDomainDef *def, + virQEMUCaps *qemuCaps) { /* The virt machine type always uses GIC: if the relevant information * was not included in the domain XML, we need to choose a suitable @@ -4007,7 +4007,7 @@ qemuDomainDefEnableDefaultFeatures(virDomainDefPtr def, static int -qemuCanonicalizeMachine(virDomainDefPtr def, virQEMUCapsPtr qemuCaps) +qemuCanonicalizeMachine(virDomainDef *def, virQEMUCaps *qemuCaps) { const char *canon; @@ -4027,18 +4027,18 @@ qemuCanonicalizeMachine(virDomainDefPtr def, virQEMUCapsPtr qemuCaps) static int -qemuDomainRecheckInternalPaths(virDomainDefPtr def, - virQEMUDriverConfigPtr cfg, +qemuDomainRecheckInternalPaths(virDomainDef *def, + virQEMUDriverConfig *cfg, unsigned int flags) { size_t i = 0; size_t j = 0; for (i = 0; i < def->ngraphics; ++i) { - virDomainGraphicsDefPtr graphics = def->graphics[i]; + virDomainGraphicsDef *graphics = def->graphics[i]; for (j = 0; j < graphics->nListens; ++j) { - virDomainGraphicsListenDefPtr glisten = &graphics->listens[j]; + virDomainGraphicsListenDef *glisten = &graphics->listens[j]; /* This will happen only if we parse XML from old libvirts where * unix socket was available only for VNC graphics. In this @@ -4065,11 +4065,11 @@ qemuDomainRecheckInternalPaths(virDomainDefPtr def, static int -qemuDomainDefVcpusPostParse(virDomainDefPtr def) +qemuDomainDefVcpusPostParse(virDomainDef *def) { unsigned int maxvcpus = virDomainDefGetVcpusMax(def); - virDomainVcpuDefPtr vcpu; - virDomainVcpuDefPtr prevvcpu; + virDomainVcpuDef *vcpu; + virDomainVcpuDef *prevvcpu; size_t i; bool has_order = false; @@ -4135,9 +4135,9 @@ qemuDomainDefVcpusPostParse(virDomainDefPtr def) static int -qemuDomainDefSetDefaultCPU(virDomainDefPtr def, +qemuDomainDefSetDefaultCPU(virDomainDef *def, virArch hostarch, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { const char *model; @@ -4208,10 +4208,10 @@ qemuDomainDefSetDefaultCPU(virDomainDefPtr def, static int -qemuDomainDefCPUPostParse(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuDomainDefCPUPostParse(virDomainDef *def, + virQEMUCaps *qemuCaps) { - virCPUFeatureDefPtr sveFeature = NULL; + virCPUFeatureDef *sveFeature = NULL; bool sveVectorLengthsProvided = false; size_t i; @@ -4219,7 +4219,7 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def, return 0; if (def->cpu->cache) { - virCPUCacheDefPtr cache = def->cpu->cache; + virCPUCacheDef *cache = def->cpu->cache; if (!ARCH_IS_X86(def->os.arch)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -4275,7 +4275,7 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def, } for (i = 0; i < def->cpu->nfeatures; i++) { - virCPUFeatureDefPtr feature = &def->cpu->features[i]; + virCPUFeatureDef *feature = &def->cpu->features[i]; if (STREQ(feature->name, "sve")) { sveFeature = feature; @@ -4353,8 +4353,8 @@ qemuDomainDefCPUPostParse(virDomainDefPtr def, static int -qemuDomainDefTsegPostParse(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuDomainDefTsegPostParse(virDomainDef *def, + virQEMUCaps *qemuCaps) { if (def->features[VIR_DOMAIN_FEATURE_SMM] != VIR_TRISTATE_SWITCH_ON) return 0; @@ -4396,7 +4396,7 @@ qemuDomainDefTsegPostParse(virDomainDefPtr def, * Returns: 0 on success, -1 on error */ int -qemuDomainDefNumaCPUsRectify(virDomainDefPtr def, virQEMUCapsPtr qemuCaps) +qemuDomainDefNumaCPUsRectify(virDomainDef *def, virQEMUCaps *qemuCaps) { unsigned int vcpusMax, numacpus; @@ -4421,22 +4421,22 @@ qemuDomainDefNumaCPUsRectify(virDomainDefPtr def, virQEMUCapsPtr qemuCaps) static int -qemuDomainDefNumaCPUsPostParse(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuDomainDefNumaCPUsPostParse(virDomainDef *def, + virQEMUCaps *qemuCaps) { return qemuDomainDefNumaCPUsRectify(def, qemuCaps); } static int -qemuDomainDefTPMsPostParse(virDomainDefPtr def) +qemuDomainDefTPMsPostParse(virDomainDef *def) { - virDomainTPMDefPtr proxyTPM = NULL; - virDomainTPMDefPtr regularTPM = NULL; + virDomainTPMDef *proxyTPM = NULL; + virDomainTPMDef *regularTPM = NULL; size_t i; for (i = 0; i < def->ntpms; i++) { - virDomainTPMDefPtr tpm = def->tpms[i]; + virDomainTPMDef *tpm = def->tpms[i]; /* TPM 1.2 and 2 are not compatible, so we choose a specific version here */ if (tpm->version == VIR_DOMAIN_TPM_VERSION_DEFAULT) { @@ -4469,10 +4469,10 @@ qemuDomainDefTPMsPostParse(virDomainDefPtr def) static int -qemuDomainDefPostParseBasic(virDomainDefPtr def, +qemuDomainDefPostParseBasic(virDomainDef *def, void *opaque G_GNUC_UNUSED) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; /* check for emulator and create a default one if needed */ if (!def->emulator) { @@ -4490,14 +4490,14 @@ qemuDomainDefPostParseBasic(virDomainDefPtr def, static int -qemuDomainDefPostParse(virDomainDefPtr def, +qemuDomainDefPostParse(virDomainDef *def, unsigned int parseFlags, void *opaque, void *parseOpaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - virQEMUCapsPtr qemuCaps = parseOpaque; + virQEMUCaps *qemuCaps = parseOpaque; /* Note that qemuCaps may be NULL when this function is called. This * function shall not fail in that case. It will be re-run on VM startup @@ -4566,7 +4566,7 @@ qemuDomainDefPostParse(virDomainDefPtr def, int qemuDomainValidateActualNetDef(const virDomainNetDef *net, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { /* * Validations that can only be properly checked at runtime (after @@ -4660,8 +4660,8 @@ qemuDomainValidateActualNetDef(const virDomainNetDef *net, int -qemuDomainValidateStorageSource(virStorageSourcePtr src, - virQEMUCapsPtr qemuCaps, +qemuDomainValidateStorageSource(virStorageSource *src, + virQEMUCaps *qemuCaps, bool maskBlockdev) { int actualType = virStorageSourceGetActualType(src); @@ -4911,7 +4911,7 @@ qemuDomainValidateStorageSource(virStorageSourcePtr src, */ static int qemuDomainDefaultNetModel(const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (ARCH_IS_S390(def->os.arch)) return VIR_DOMAIN_NET_MODEL_VIRTIO; @@ -4974,8 +4974,8 @@ qemuDomainDefaultNetModel(const virDomainDef *def, * the path even if we are not storing it in the XML. */ static void -qemuDomainChrDefDropDefaultPath(virDomainChrDefPtr chr, - virQEMUDriverPtr driver) +qemuDomainChrDefDropDefaultPath(virDomainChrDef *chr, + virQEMUDriver *driver) { g_autoptr(virQEMUDriverConfig) cfg = NULL; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -5002,7 +5002,7 @@ qemuDomainChrDefDropDefaultPath(virDomainChrDefPtr chr, static int -qemuDomainShmemDefPostParse(virDomainShmemDefPtr shm) +qemuDomainShmemDefPostParse(virDomainShmemDef *shm) { /* This was the default since the introduction of this device. */ if (shm->model != VIR_DOMAIN_SHMEM_MODEL_IVSHMEM_DOORBELL && !shm->size) @@ -5055,9 +5055,9 @@ qemuDomainShmemDefPostParse(virDomainShmemDefPtr shm) static int -qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, +qemuDomainControllerDefPostParse(virDomainControllerDef *cont, const virDomainDef *def, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, unsigned int parseFlags) { switch ((virDomainControllerType)cont->type) { @@ -5198,9 +5198,9 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont, } static int -qemuDomainChrDefPostParse(virDomainChrDefPtr chr, +qemuDomainChrDefPostParse(virDomainChrDef *chr, const virDomainDef *def, - virQEMUDriverPtr driver, + virQEMUDriver *driver, unsigned int parseFlags) { /* Historically, isa-serial and the default matched, so in order to @@ -5284,11 +5284,11 @@ qemuDomainChrDefPostParse(virDomainChrDefPtr chr, * Note that qemuCaps should be always present for a status XML. */ static int -qemuDomainDeviceDiskDefPostParseRestoreSecAlias(virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps, +qemuDomainDeviceDiskDefPostParseRestoreSecAlias(virDomainDiskDef *disk, + virQEMUCaps *qemuCaps, unsigned int parseFlags) { - qemuDomainStorageSourcePrivatePtr priv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src); + qemuDomainStorageSourcePrivate *priv = QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(disk->src); bool restoreAuthSecret = false; bool restoreEncSecret = false; g_autofree char *authalias = NULL; @@ -5348,8 +5348,8 @@ qemuDomainDeviceDiskDefPostParseRestoreSecAlias(virDomainDiskDefPtr disk, static int -qemuDomainDeviceDiskDefPostParse(virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps, +qemuDomainDeviceDiskDefPostParse(virDomainDiskDef *disk, + virQEMUCaps *qemuCaps, unsigned int parseFlags) { /* set default disk types and drivers */ @@ -5382,9 +5382,9 @@ qemuDomainDeviceDiskDefPostParse(virDomainDiskDefPtr disk, static int -qemuDomainDeviceNetDefPostParse(virDomainNetDefPtr net, +qemuDomainDeviceNetDefPostParse(virDomainNetDef *net, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (net->type == VIR_DOMAIN_NET_TYPE_VDPA && !virDomainNetGetModelString(net)) @@ -5400,7 +5400,7 @@ qemuDomainDeviceNetDefPostParse(virDomainNetDefPtr net, static int qemuDomainDefaultVideoDevice(const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (ARCH_IS_PPC64(def->os.arch)) return VIR_DOMAIN_VIDEO_TYPE_VGA; @@ -5418,9 +5418,9 @@ qemuDomainDefaultVideoDevice(const virDomainDef *def, static int -qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video, +qemuDomainDeviceVideoDefPostParse(virDomainVideoDef *video, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (video->type == VIR_DOMAIN_VIDEO_TYPE_DEFAULT) video->type = qemuDomainDefaultVideoDevice(def, qemuCaps); @@ -5435,7 +5435,7 @@ qemuDomainDeviceVideoDefPostParse(virDomainVideoDefPtr video, static int -qemuDomainDevicePanicDefPostParse(virDomainPanicDefPtr panic, +qemuDomainDevicePanicDefPostParse(virDomainPanicDef *panic, const virDomainDef *def) { if (panic->model == VIR_DOMAIN_PANIC_MODEL_DEFAULT) { @@ -5452,7 +5452,7 @@ qemuDomainDevicePanicDefPostParse(virDomainPanicDefPtr panic, static int -qemuDomainVsockDefPostParse(virDomainVsockDefPtr vsock) +qemuDomainVsockDefPostParse(virDomainVsockDef *vsock) { if (vsock->model == VIR_DOMAIN_VSOCK_MODEL_DEFAULT) vsock->model = VIR_DOMAIN_VSOCK_MODEL_VIRTIO; @@ -5470,13 +5470,13 @@ qemuDomainVsockDefPostParse(virDomainVsockDefPtr vsock) * Note that qemuCaps should be always present for a status XML. */ static int -qemuDomainDeviceHostdevDefPostParseRestoreSecAlias(virDomainHostdevDefPtr hostdev, - virQEMUCapsPtr qemuCaps, +qemuDomainDeviceHostdevDefPostParseRestoreSecAlias(virDomainHostdevDef *hostdev, + virQEMUCaps *qemuCaps, unsigned int parseFlags) { - qemuDomainStorageSourcePrivatePtr priv; - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &scsisrc->u.iscsi; + qemuDomainStorageSourcePrivate *priv; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIiSCSI *iscsisrc = &scsisrc->u.iscsi; g_autofree char *authalias = NULL; if (!(parseFlags & VIR_DOMAIN_DEF_PARSE_STATUS) || @@ -5514,12 +5514,12 @@ qemuDomainDeviceHostdevDefPostParseRestoreSecAlias(virDomainHostdevDefPtr hostde * Note that qemuCaps should be always present for a status XML. */ static int -qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(virDomainHostdevDefPtr hostdev, - virQEMUCapsPtr qemuCaps, +qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(virDomainHostdevDef *hostdev, + virQEMUCaps *qemuCaps, unsigned int parseFlags) { - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; - virStorageSourcePtr src; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; + virStorageSource *src; if (!(parseFlags & VIR_DOMAIN_DEF_PARSE_STATUS)) return 0; @@ -5555,8 +5555,8 @@ qemuDomainDeviceHostdevDefPostParseRestoreBackendAlias(virDomainHostdevDefPtr ho static int -qemuDomainHostdevDefMdevPostParse(virDomainHostdevSubsysMediatedDevPtr mdevsrc, - virQEMUCapsPtr qemuCaps) +qemuDomainHostdevDefMdevPostParse(virDomainHostdevSubsysMediatedDev *mdevsrc, + virQEMUCaps *qemuCaps) { /* QEMU 2.12 added support for vfio-pci display type, we default to * 'display=off' to stay safe from future changes */ @@ -5570,11 +5570,11 @@ qemuDomainHostdevDefMdevPostParse(virDomainHostdevSubsysMediatedDevPtr mdevsrc, static int -qemuDomainHostdevDefPostParse(virDomainHostdevDefPtr hostdev, - virQEMUCapsPtr qemuCaps, +qemuDomainHostdevDefPostParse(virDomainHostdevDef *hostdev, + virQEMUCaps *qemuCaps, unsigned int parseFlags) { - virDomainHostdevSubsysPtr subsys = &hostdev->source.subsys; + virDomainHostdevSubsys *subsys = &hostdev->source.subsys; if (qemuDomainDeviceHostdevDefPostParseRestoreSecAlias(hostdev, qemuCaps, parseFlags) < 0) @@ -5594,7 +5594,7 @@ qemuDomainHostdevDefPostParse(virDomainHostdevDefPtr hostdev, static int -qemuDomainTPMDefPostParse(virDomainTPMDefPtr tpm, +qemuDomainTPMDefPostParse(virDomainTPMDef *tpm, virArch arch) { if (tpm->model == VIR_DOMAIN_TPM_MODEL_DEFAULT) { @@ -5609,7 +5609,7 @@ qemuDomainTPMDefPostParse(virDomainTPMDefPtr tpm, static int -qemuDomainNVDimmAlignSizePseries(virDomainMemoryDefPtr mem) +qemuDomainNVDimmAlignSizePseries(virDomainMemoryDef *mem) { /* For NVDIMMs in ppc64 in we want to align down the guest * visible space, instead of align up, to avoid writing @@ -5645,7 +5645,7 @@ qemuDomainNVDimmAlignSizePseries(virDomainMemoryDefPtr mem) static int -qemuDomainMemoryDefPostParse(virDomainMemoryDefPtr mem, virArch arch, +qemuDomainMemoryDefPostParse(virDomainMemoryDef *mem, virArch arch, unsigned int parseFlags) { /* Memory alignment can't be done for migration or snapshot @@ -5678,17 +5678,17 @@ qemuDomainMemoryDefPostParse(virDomainMemoryDefPtr mem, virArch arch, static int -qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, +qemuDomainDeviceDefPostParse(virDomainDeviceDef *dev, const virDomainDef *def, unsigned int parseFlags, void *opaque, void *parseOpaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; /* Note that qemuCaps may be NULL when this function is called. This * function shall not fail in that case. It will be re-run on VM startup * with the capabilities populated. */ - virQEMUCapsPtr qemuCaps = parseOpaque; + virQEMUCaps *qemuCaps = parseOpaque; int ret = -1; switch ((virDomainDeviceType) dev->type) { @@ -5777,11 +5777,11 @@ qemuDomainDefAssignAddresses(virDomainDef *def, void *opaque, void *parseOpaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; /* Note that qemuCaps may be NULL when this function is called. This * function shall not fail in that case. It will be re-run on VM startup * with the capabilities populated. */ - virQEMUCapsPtr qemuCaps = parseOpaque; + virQEMUCaps *qemuCaps = parseOpaque; bool newDomain = parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE; /* Skip address assignment if @qemuCaps is not present. In such case devices @@ -5801,7 +5801,7 @@ qemuDomainPostParseDataAlloc(const virDomainDef *def, void *opaque, void **parseOpaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; if (!(*parseOpaque = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator))) @@ -5814,7 +5814,7 @@ qemuDomainPostParseDataAlloc(const virDomainDef *def, static void qemuDomainPostParseDataFree(void *parseOpaque) { - virQEMUCapsPtr qemuCaps = parseOpaque; + virQEMUCaps *qemuCaps = parseOpaque; virObjectUnref(qemuCaps); } @@ -5840,8 +5840,8 @@ virDomainDefParserConfig virQEMUDriverDomainDefParserConfig = { void -qemuDomainObjSaveStatus(virQEMUDriverPtr driver, - virDomainObjPtr obj) +qemuDomainObjSaveStatus(virQEMUDriver *driver, + virDomainObj *obj) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); @@ -5853,18 +5853,18 @@ qemuDomainObjSaveStatus(virQEMUDriverPtr driver, void -qemuDomainSaveStatus(virDomainObjPtr obj) +qemuDomainSaveStatus(virDomainObj *obj) { qemuDomainObjSaveStatus(QEMU_DOMAIN_PRIVATE(obj)->driver, obj); } void -qemuDomainSaveConfig(virDomainObjPtr obj) +qemuDomainSaveConfig(virDomainObj *obj) { - virQEMUDriverPtr driver = QEMU_DOMAIN_PRIVATE(obj)->driver; + virQEMUDriver *driver = QEMU_DOMAIN_PRIVATE(obj)->driver; g_autoptr(virQEMUDriverConfig) cfg = NULL; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; if (virDomainObjIsActive(obj)) def = obj->newDef; @@ -5892,11 +5892,11 @@ qemuDomainSaveConfig(virDomainObjPtr obj) * To be followed with qemuDomainObjExitMonitor() once complete */ static int -qemuDomainObjEnterMonitorInternal(virQEMUDriverPtr driver, - virDomainObjPtr obj, +qemuDomainObjEnterMonitorInternal(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; if (asyncJob != QEMU_ASYNC_JOB_NONE) { int ret; @@ -5929,10 +5929,10 @@ qemuDomainObjEnterMonitorInternal(virQEMUDriverPtr driver, } static void ATTRIBUTE_NONNULL(1) -qemuDomainObjExitMonitorInternal(virQEMUDriverPtr driver, - virDomainObjPtr obj) +qemuDomainObjExitMonitorInternal(virQEMUDriver *driver, + virDomainObj *obj) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; bool hasRefs; qemuMonitorWatchDispose(); @@ -5954,8 +5954,8 @@ qemuDomainObjExitMonitorInternal(virQEMUDriverPtr driver, qemuDomainObjEndJob(driver, obj); } -void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver, - virDomainObjPtr obj) +void qemuDomainObjEnterMonitor(virQEMUDriver *driver, + virDomainObj *obj) { ignore_value(qemuDomainObjEnterMonitorInternal(driver, obj, QEMU_ASYNC_JOB_NONE)); @@ -5971,8 +5971,8 @@ void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver, * and replaced by the persistent definition, so pointers stolen * from the live definition could no longer be valid. */ -int qemuDomainObjExitMonitor(virQEMUDriverPtr driver, - virDomainObjPtr obj) +int qemuDomainObjExitMonitor(virQEMUDriver *driver, + virDomainObj *obj) { qemuDomainObjExitMonitorInternal(driver, obj); if (!virDomainObjIsActive(obj)) { @@ -5999,8 +5999,8 @@ int qemuDomainObjExitMonitor(virQEMUDriverPtr driver, * in the meantime). */ int -qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver, - virDomainObjPtr obj, +qemuDomainObjEnterMonitorAsync(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainAsyncJob asyncJob) { return qemuDomainObjEnterMonitorInternal(driver, obj, asyncJob); @@ -6016,11 +6016,11 @@ qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver, * * To be followed with qemuDomainObjExitAgent() once complete */ -qemuAgentPtr -qemuDomainObjEnterAgent(virDomainObjPtr obj) +qemuAgent * +qemuDomainObjEnterAgent(virDomainObj *obj) { - qemuDomainObjPrivatePtr priv = obj->privateData; - qemuAgentPtr agent = priv->agent; + qemuDomainObjPrivate *priv = obj->privateData; + qemuAgent *agent = priv->agent; VIR_DEBUG("Entering agent (agent=%p vm=%p name=%s)", priv->agent, obj, obj->def->name); @@ -6038,7 +6038,7 @@ qemuDomainObjEnterAgent(virDomainObjPtr obj) * Should be paired with an earlier qemuDomainObjEnterAgent() call */ void -qemuDomainObjExitAgent(virDomainObjPtr obj, qemuAgentPtr agent) +qemuDomainObjExitAgent(virDomainObj *obj, qemuAgent *agent) { virObjectUnlock(agent); virObjectUnref(agent); @@ -6048,7 +6048,7 @@ qemuDomainObjExitAgent(virDomainObjPtr obj, qemuAgentPtr agent) agent, obj, obj->def->name); } -void qemuDomainObjEnterRemote(virDomainObjPtr obj) +void qemuDomainObjEnterRemote(virDomainObj *obj) { VIR_DEBUG("Entering remote (vm=%p name=%s)", obj, obj->def->name); @@ -6057,7 +6057,7 @@ void qemuDomainObjEnterRemote(virDomainObjPtr obj) int -qemuDomainObjExitRemote(virDomainObjPtr obj, +qemuDomainObjExitRemote(virDomainObj *obj, bool checkActive) { virObjectLock(obj); @@ -6075,12 +6075,12 @@ qemuDomainObjExitRemote(virDomainObjPtr obj, } -static virDomainDefPtr -qemuDomainDefFromXML(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, +static virDomainDef * +qemuDomainDefFromXML(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, const char *xml) { - virDomainDefPtr def; + virDomainDef *def; def = virDomainDefParseString(xml, driver->xmlopt, qemuCaps, VIR_DOMAIN_DEF_PARSE_INACTIVE | @@ -6090,10 +6090,10 @@ qemuDomainDefFromXML(virQEMUDriverPtr driver, } -virDomainDefPtr -qemuDomainDefCopy(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virDomainDefPtr src, +virDomainDef * +qemuDomainDefCopy(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virDomainDef *src, unsigned int flags) { g_autofree char *xml = NULL; @@ -6106,7 +6106,7 @@ qemuDomainDefCopy(virQEMUDriverPtr driver, int -qemuDomainMakeCPUMigratable(virCPUDefPtr cpu) +qemuDomainMakeCPUMigratable(virCPUDef *cpu) { if (cpu->mode == VIR_CPU_MODE_CUSTOM && STREQ_NULLABLE(cpu->model, "Icelake-Server")) { @@ -6126,10 +6126,10 @@ qemuDomainMakeCPUMigratable(virCPUDefPtr cpu) static int -qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virDomainDefPtr def, - virCPUDefPtr origCPU, +qemuDomainDefFormatBufInternal(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virDomainDef *def, + virCPUDef *origCPU, unsigned int flags, virBuffer *buf) { @@ -6172,8 +6172,8 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, if ((flags & VIR_DOMAIN_XML_MIGRATABLE)) { size_t i; int toremove = 0; - virDomainControllerDefPtr usb = NULL; - virDomainControllerDefPtr pci = NULL; + virDomainControllerDef *usb = NULL; + virDomainControllerDef *pci = NULL; /* If only the default USB controller is present, we can remove it * and make the XML compatible with older versions of libvirt which @@ -6235,10 +6235,10 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, } if (toremove) { - virDomainControllerDefPtr *controllers = def->controllers; + virDomainControllerDef **controllers = def->controllers; int ncontrollers = def->ncontrollers; - def->controllers = g_new0(virDomainControllerDefPtr, ncontrollers - toremove); + def->controllers = g_new0(virDomainControllerDef *, ncontrollers - toremove); def->ncontrollers = 0; for (i = 0; i < ncontrollers; i++) { @@ -6264,7 +6264,7 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, qemuDomainChrDefDropDefaultPath(def->channels[i], driver); for (i = 0; i < def->nserials; i++) { - virDomainChrDefPtr serial = def->serials[i]; + virDomainChrDef *serial = def->serials[i]; /* Historically, the native console type for some machine types * was not set at all, which means it defaulted to ISA even @@ -6311,21 +6311,21 @@ qemuDomainDefFormatBufInternal(virQEMUDriverPtr driver, int -qemuDomainDefFormatBuf(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virDomainDefPtr def, +qemuDomainDefFormatBuf(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virDomainDef *def, unsigned int flags, - virBufferPtr buf) + virBuffer *buf) { return qemuDomainDefFormatBufInternal(driver, qemuCaps, def, NULL, flags, buf); } static char * -qemuDomainDefFormatXMLInternal(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virDomainDefPtr def, - virCPUDefPtr origCPU, +qemuDomainDefFormatXMLInternal(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virDomainDef *def, + virCPUDef *origCPU, unsigned int flags) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -6338,22 +6338,22 @@ qemuDomainDefFormatXMLInternal(virQEMUDriverPtr driver, char * -qemuDomainDefFormatXML(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virDomainDefPtr def, +qemuDomainDefFormatXML(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virDomainDef *def, unsigned int flags) { return qemuDomainDefFormatXMLInternal(driver, qemuCaps, def, NULL, flags); } -char *qemuDomainFormatXML(virQEMUDriverPtr driver, - virDomainObjPtr vm, +char *qemuDomainFormatXML(virQEMUDriver *driver, + virDomainObj *vm, unsigned int flags) { - virDomainDefPtr def; - qemuDomainObjPrivatePtr priv = vm->privateData; - virCPUDefPtr origCPU = NULL; + virDomainDef *def; + qemuDomainObjPrivate *priv = vm->privateData; + virCPUDef *origCPU = NULL; if ((flags & VIR_DOMAIN_XML_INACTIVE) && vm->newDef) { def = vm->newDef; @@ -6366,10 +6366,10 @@ char *qemuDomainFormatXML(virQEMUDriverPtr driver, } char * -qemuDomainDefFormatLive(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virDomainDefPtr def, - virCPUDefPtr origCPU, +qemuDomainDefFormatLive(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virDomainDef *def, + virCPUDef *origCPU, bool inactive, bool compatible) { @@ -6384,18 +6384,18 @@ qemuDomainDefFormatLive(virQEMUDriverPtr driver, } -void qemuDomainObjTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, +void qemuDomainObjTaint(virQEMUDriver *driver, + virDomainObj *obj, virDomainTaintFlags taint, - qemuDomainLogContextPtr logCtxt) + qemuDomainLogContext *logCtxt) { qemuDomainObjTaintMsg(driver, obj, taint, logCtxt, NULL); } -void qemuDomainObjTaintMsg(virQEMUDriverPtr driver, - virDomainObjPtr obj, +void qemuDomainObjTaintMsg(virQEMUDriver *driver, + virDomainObj *obj, virDomainTaintFlags taint, - qemuDomainLogContextPtr logCtxt, + qemuDomainLogContext *logCtxt, const char *fmt, ...) { virErrorPtr orig_err = NULL; @@ -6471,12 +6471,12 @@ void qemuDomainObjTaintMsg(virQEMUDriverPtr driver, } static void -qemuDomainObjCheckMachineTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - qemuDomainLogContextPtr logCtxt) +qemuDomainObjCheckMachineTaint(virQEMUDriver *driver, + virDomainObj *obj, + qemuDomainLogContext *logCtxt) { - qemuDomainObjPrivatePtr priv = obj->privateData; - virQEMUCapsPtr qemuCaps = priv->qemuCaps; + qemuDomainObjPrivate *priv = obj->privateData; + virQEMUCaps *qemuCaps = priv->qemuCaps; if (virQEMUCapsIsMachineDeprecated(qemuCaps, obj->def->virtType, @@ -6489,13 +6489,13 @@ qemuDomainObjCheckMachineTaint(virQEMUDriverPtr driver, static void -qemuDomainObjCheckCPUTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - qemuDomainLogContextPtr logCtxt, +qemuDomainObjCheckCPUTaint(virQEMUDriver *driver, + virDomainObj *obj, + qemuDomainLogContext *logCtxt, bool incomingMigration) { - qemuDomainObjPrivatePtr priv = obj->privateData; - virQEMUCapsPtr qemuCaps = priv->qemuCaps; + qemuDomainObjPrivate *priv = obj->privateData; + virQEMUCaps *qemuCaps = priv->qemuCaps; switch (obj->def->cpu->mode) { case VIR_CPU_MODE_HOST_PASSTHROUGH: @@ -6521,14 +6521,14 @@ qemuDomainObjCheckCPUTaint(virQEMUDriverPtr driver, } -void qemuDomainObjCheckTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - qemuDomainLogContextPtr logCtxt, +void qemuDomainObjCheckTaint(virQEMUDriver *driver, + virDomainObj *obj, + qemuDomainLogContext *logCtxt, bool incomingMigration) { size_t i; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; bool custom_hypervisor_feat = false; if (driver->privileged && @@ -6540,7 +6540,7 @@ void qemuDomainObjCheckTaint(virQEMUDriverPtr driver, qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_HOOK, logCtxt); if (obj->def->namespaceData) { - qemuDomainXmlNsDefPtr qemuxmlns = obj->def->namespaceData; + qemuDomainXmlNsDef *qemuxmlns = obj->def->namespaceData; if (qemuxmlns->num_args || qemuxmlns->num_env) qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_CUSTOM_ARGV, logCtxt); if (qemuxmlns->ncapsadd > 0 || qemuxmlns->ncapsdel > 0) @@ -6573,10 +6573,10 @@ void qemuDomainObjCheckTaint(virQEMUDriverPtr driver, } -void qemuDomainObjCheckDiskTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - virDomainDiskDefPtr disk, - qemuDomainLogContextPtr logCtxt) +void qemuDomainObjCheckDiskTaint(virQEMUDriver *driver, + virDomainObj *obj, + virDomainDiskDef *disk, + qemuDomainLogContext *logCtxt) { if (disk->rawio == VIR_TRISTATE_BOOL_YES) qemuDomainObjTaint(driver, obj, VIR_DOMAIN_TAINT_HIGH_PRIVILEGES, @@ -6590,10 +6590,10 @@ void qemuDomainObjCheckDiskTaint(virQEMUDriverPtr driver, } -void qemuDomainObjCheckHostdevTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - virDomainHostdevDefPtr hostdev, - qemuDomainLogContextPtr logCtxt) +void qemuDomainObjCheckHostdevTaint(virQEMUDriver *driver, + virDomainObj *obj, + virDomainHostdevDef *hostdev, + qemuDomainLogContext *logCtxt) { if (!virHostdevIsSCSIDevice(hostdev)) return; @@ -6603,10 +6603,10 @@ void qemuDomainObjCheckHostdevTaint(virQEMUDriverPtr driver, } -void qemuDomainObjCheckNetTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - virDomainNetDefPtr net, - qemuDomainLogContextPtr logCtxt) +void qemuDomainObjCheckNetTaint(virQEMUDriver *driver, + virDomainObj *obj, + virDomainNetDef *net, + qemuDomainLogContext *logCtxt) { /* script is only useful for NET_TYPE_ETHERNET (qemu) and * NET_TYPE_BRIDGE (xen), but could be (incorrectly) specified for @@ -6618,12 +6618,12 @@ void qemuDomainObjCheckNetTaint(virQEMUDriverPtr driver, } -qemuDomainLogContextPtr qemuDomainLogContextNew(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainLogContext *qemuDomainLogContextNew(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainLogContextMode mode) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainLogContextPtr ctxt = QEMU_DOMAIN_LOG_CONTEXT(g_object_new(QEMU_TYPE_DOMAIN_LOG_CONTEXT, NULL)); + qemuDomainLogContext *ctxt = QEMU_DOMAIN_LOG_CONTEXT(g_object_new(QEMU_TYPE_DOMAIN_LOG_CONTEXT, NULL)); VIR_DEBUG("Context new %p stdioLogD=%d", ctxt, cfg->stdioLogD); ctxt->writefd = -1; @@ -6697,7 +6697,7 @@ qemuDomainLogContextPtr qemuDomainLogContextNew(virQEMUDriverPtr driver, } -int qemuDomainLogContextWrite(qemuDomainLogContextPtr ctxt, +int qemuDomainLogContextWrite(qemuDomainLogContext *ctxt, const char *fmt, ...) { va_list argptr; @@ -6727,7 +6727,7 @@ int qemuDomainLogContextWrite(qemuDomainLogContextPtr ctxt, } -ssize_t qemuDomainLogContextRead(qemuDomainLogContextPtr ctxt, +ssize_t qemuDomainLogContextRead(qemuDomainLogContext *ctxt, char **msg) { char *buf; @@ -6784,13 +6784,13 @@ ssize_t qemuDomainLogContextRead(qemuDomainLogContextPtr ctxt, * This is a best-effort attempt to add a log message to the qemu log file * either by using virtlogd or the legacy approach */ int -qemuDomainLogAppendMessage(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainLogAppendMessage(virQEMUDriver *driver, + virDomainObj *vm, const char *fmt, ...) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - virLogManagerPtr manager = NULL; + virLogManager *manager = NULL; va_list ap; g_autofree char *path = NULL; int writefd = -1; @@ -6835,13 +6835,13 @@ qemuDomainLogAppendMessage(virQEMUDriverPtr driver, } -int qemuDomainLogContextGetWriteFD(qemuDomainLogContextPtr ctxt) +int qemuDomainLogContextGetWriteFD(qemuDomainLogContext *ctxt) { return ctxt->writefd; } -void qemuDomainLogContextMarkPosition(qemuDomainLogContextPtr ctxt) +void qemuDomainLogContextMarkPosition(qemuDomainLogContext *ctxt) { if (ctxt->manager) virLogManagerDomainGetLogFilePosition(ctxt->manager, @@ -6854,7 +6854,7 @@ void qemuDomainLogContextMarkPosition(qemuDomainLogContextPtr ctxt) } -virLogManagerPtr qemuDomainLogContextGetManager(qemuDomainLogContextPtr ctxt) +virLogManager *qemuDomainLogContextGetManager(qemuDomainLogContext *ctxt) { return ctxt->manager; } @@ -6862,7 +6862,7 @@ virLogManagerPtr qemuDomainLogContextGetManager(qemuDomainLogContextPtr ctxt) /* Locate an appropriate 'qemu-img' binary. */ const char * -qemuFindQemuImgBinary(virQEMUDriverPtr driver) +qemuFindQemuImgBinary(virQEMUDriver *driver) { if (!driver->qemuImgBinary) virReportError(VIR_ERR_INTERNAL_ERROR, @@ -6872,9 +6872,9 @@ qemuFindQemuImgBinary(virQEMUDriverPtr driver) } int -qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm, - virDomainMomentObjPtr snapshot, - virDomainXMLOptionPtr xmlopt, +qemuDomainSnapshotWriteMetadata(virDomainObj *vm, + virDomainMomentObj *snapshot, + virDomainXMLOption *xmlopt, const char *snapshotDir) { g_autofree char *newxml = NULL; @@ -6883,7 +6883,7 @@ qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm, char uuidstr[VIR_UUID_STRING_BUFLEN]; unsigned int flags = VIR_DOMAIN_SNAPSHOT_FORMAT_SECURE | VIR_DOMAIN_SNAPSHOT_FORMAT_INTERNAL; - virDomainSnapshotDefPtr def = virDomainSnapshotObjGetDef(snapshot); + virDomainSnapshotDef *def = virDomainSnapshotObjGetDef(snapshot); if (virDomainSnapshotGetCurrent(vm->snapshots) == snapshot) flags |= VIR_DOMAIN_SNAPSHOT_FORMAT_CURRENT; @@ -6908,8 +6908,8 @@ qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm, /* The domain is expected to be locked and inactive. Return -1 on normal * failure, 1 if we skipped a disk due to try_all. */ static int -qemuDomainSnapshotForEachQcow2Raw(virQEMUDriverPtr driver, - virDomainDefPtr def, +qemuDomainSnapshotForEachQcow2Raw(virQEMUDriver *driver, + virDomainDef *def, const char *name, const char *op, bool try_all, @@ -6986,9 +6986,9 @@ qemuDomainSnapshotForEachQcow2Raw(virQEMUDriverPtr driver, /* The domain is expected to be locked and inactive. Return -1 on normal * failure, 1 if we skipped a disk due to try_all. */ int -qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver, - virDomainDefPtr def, - virDomainMomentObjPtr snap, +qemuDomainSnapshotForEachQcow2(virQEMUDriver *driver, + virDomainDef *def, + virDomainMomentObj *snap, const char *op, bool try_all) { @@ -6998,15 +6998,15 @@ qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver, /* Discard one snapshot (or its metadata), without reparenting any children. */ int -qemuDomainSnapshotDiscard(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMomentObjPtr snap, +qemuDomainSnapshotDiscard(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMomentObj *snap, bool update_parent, bool metadata_only) { g_autofree char *snapFile = NULL; - qemuDomainObjPrivatePtr priv; - virDomainMomentObjPtr parentsnap = NULL; + qemuDomainObjPrivate *priv; + virDomainMomentObj *parentsnap = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); if (!metadata_only) { @@ -7016,7 +7016,7 @@ qemuDomainSnapshotDiscard(virQEMUDriverPtr driver, /* Prefer action on the disks in use at the time the snapshot was * created; but fall back to current definition if dealing with a * snapshot created prior to libvirt 0.9.5. */ - virDomainDefPtr def = snap->def->dom; + virDomainDef *def = snap->def->dom; if (!def) def = vm->def; @@ -7070,8 +7070,8 @@ int qemuDomainMomentDiscardAll(void *payload, const char *name G_GNUC_UNUSED, void *data) { - virDomainMomentObjPtr moment = payload; - virQEMUMomentRemovePtr curr = data; + virDomainMomentObj *moment = payload; + virQEMUMomentRemove *curr = data; int err; if (!curr->found && curr->current == moment) @@ -7084,8 +7084,8 @@ int qemuDomainMomentDiscardAll(void *payload, } int -qemuDomainSnapshotDiscardAllMetadata(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDomainSnapshotDiscardAllMetadata(virQEMUDriver *driver, + virDomainObj *vm) { virQEMUMomentRemove rem = { .driver = driver, @@ -7102,8 +7102,8 @@ qemuDomainSnapshotDiscardAllMetadata(virQEMUDriverPtr driver, static void -qemuDomainRemoveInactiveCommon(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDomainRemoveInactiveCommon(virQEMUDriver *driver, + virDomainObj *vm) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autofree char *snapDir = NULL; @@ -7139,8 +7139,8 @@ qemuDomainRemoveInactiveCommon(virQEMUDriverPtr driver, * The caller must hold a lock to the vm. */ void -qemuDomainRemoveInactive(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDomainRemoveInactive(virQEMUDriver *driver, + virDomainObj *vm) { if (vm->persistent) { /* Short-circuit, we don't want to remove a persistent domain */ @@ -7161,8 +7161,8 @@ qemuDomainRemoveInactive(virQEMUDriverPtr driver, * from locked list method. */ static void -qemuDomainRemoveInactiveLocked(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDomainRemoveInactiveLocked(virQEMUDriver *driver, + virDomainObj *vm) { if (vm->persistent) { /* Short-circuit, we don't want to remove a persistent domain */ @@ -7183,8 +7183,8 @@ qemuDomainRemoveInactiveLocked(virQEMUDriverPtr driver, * qemuDomainRemoveInactive call. */ void -qemuDomainRemoveInactiveJob(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDomainRemoveInactiveJob(virQEMUDriver *driver, + virDomainObj *vm) { bool haveJob; @@ -7204,8 +7204,8 @@ qemuDomainRemoveInactiveJob(virQEMUDriverPtr driver, * also hold the lock @driver->domains */ void -qemuDomainRemoveInactiveJobLocked(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDomainRemoveInactiveJobLocked(virQEMUDriver *driver, + virDomainObj *vm) { bool haveJob; @@ -7219,11 +7219,11 @@ qemuDomainRemoveInactiveJobLocked(virQEMUDriverPtr driver, void -qemuDomainSetFakeReboot(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainSetFakeReboot(virQEMUDriver *driver, + virDomainObj *vm, bool value) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); if (priv->fakeReboot == value) @@ -7236,13 +7236,13 @@ qemuDomainSetFakeReboot(virQEMUDriverPtr driver, } static void -qemuDomainCheckRemoveOptionalDisk(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainCheckRemoveOptionalDisk(virQEMUDriver *driver, + virDomainObj *vm, size_t diskIndex) { char uuid[VIR_UUID_STRING_BUFLEN]; - virObjectEventPtr event = NULL; - virDomainDiskDefPtr disk = vm->def->disks[diskIndex]; + virObjectEvent *event = NULL; + virDomainDiskDef *disk = vm->def->disks[diskIndex]; const char *src = virDomainDiskGetSource(disk); virUUIDFormat(vm->def->uuid, uuid); @@ -7288,8 +7288,8 @@ qemuDomainCheckRemoveOptionalDisk(virQEMUDriverPtr driver, * clears any reported error if 0 is returned. */ int -qemuDomainCheckDiskStartupPolicy(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainCheckDiskStartupPolicy(virQEMUDriver *driver, + virDomainObj *vm, size_t diskIndex, bool cold_boot) { @@ -7333,10 +7333,10 @@ qemuDomainCheckDiskStartupPolicy(virQEMUDriverPtr driver, * called. */ int -qemuDomainCleanupAdd(virDomainObjPtr vm, +qemuDomainCleanupAdd(virDomainObj *vm, qemuDomainCleanupCallback cb) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; size_t i; VIR_DEBUG("vm=%s, cb=%p", vm->def->name, cb); @@ -7355,10 +7355,10 @@ qemuDomainCleanupAdd(virDomainObjPtr vm, } void -qemuDomainCleanupRemove(virDomainObjPtr vm, +qemuDomainCleanupRemove(virDomainObj *vm, qemuDomainCleanupCallback cb) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; size_t i; VIR_DEBUG("vm=%s, cb=%p", vm->def->name, cb); @@ -7375,10 +7375,10 @@ qemuDomainCleanupRemove(virDomainObjPtr vm, } void -qemuDomainCleanupRun(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDomainCleanupRun(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; VIR_DEBUG("driver=%p, vm=%s", driver, vm->def->name); @@ -7391,14 +7391,14 @@ qemuDomainCleanupRun(virQEMUDriverPtr driver, } void -qemuDomainGetImageIds(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr parentSrc, +qemuDomainGetImageIds(virQEMUDriverConfig *cfg, + virDomainObj *vm, + virStorageSource *src, + virStorageSource *parentSrc, uid_t *uid, gid_t *gid) { - virSecurityLabelDefPtr vmlabel; - virSecurityDeviceLabelDefPtr disklabel; + virSecurityLabelDef *vmlabel; + virSecurityDeviceLabelDef *disklabel; if (uid) *uid = -1; @@ -7429,10 +7429,10 @@ qemuDomainGetImageIds(virQEMUDriverConfigPtr cfg, int -qemuDomainStorageFileInit(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr parent) +qemuDomainStorageFileInit(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src, + virStorageSource *parent) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); uid_t uid; @@ -7483,11 +7483,11 @@ qemuDomainStorageAlias(const char *device, int depth) * Returns 0 on success and -1 if the chain is too deep. Error is reported. */ int -qemuDomainStorageSourceValidateDepth(virStorageSourcePtr src, +qemuDomainStorageSourceValidateDepth(virStorageSource *src, int add, const char *diskdst) { - virStorageSourcePtr n; + virStorageSource *n; size_t nlayers = 0; for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) @@ -7522,9 +7522,9 @@ qemuDomainStorageSourceValidateDepth(virStorageSourcePtr src, * */ static void -qemuDomainPrepareStorageSourceConfig(virStorageSourcePtr src, - virQEMUDriverConfigPtr cfg, - virQEMUCapsPtr qemuCaps) +qemuDomainPrepareStorageSourceConfig(virStorageSource *src, + virQEMUDriverConfig *cfg, + virQEMUCaps *qemuCaps) { if (!cfg) return; @@ -7552,16 +7552,16 @@ qemuDomainPrepareStorageSourceConfig(virStorageSourcePtr src, * in the backing chain are reported. */ int -qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr disksrc, +qemuDomainDetermineDiskChain(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *disksrc, bool report_broken) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - virStorageSourcePtr src; /* iterator for the backing chain declared in XML */ - virStorageSourcePtr n; /* iterator for the backing chain detected from disk */ - qemuDomainObjPrivatePtr priv = vm->privateData; + virStorageSource *src; /* iterator for the backing chain declared in XML */ + virStorageSource *n; /* iterator for the backing chain detected from disk */ + qemuDomainObjPrivate *priv = vm->privateData; bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); bool isSD = qemuDiskBusIsSD(disk->bus); uid_t uid; @@ -7677,9 +7677,9 @@ qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, * This must be used only when VIR_QEMU_CAPS_BLOCKDEV is enabled. */ const char * -qemuDomainDiskGetTopNodename(virDomainDiskDefPtr disk) +qemuDomainDiskGetTopNodename(virDomainDiskDef *disk) { - qemuDomainDiskPrivatePtr priv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainDiskPrivate *priv = QEMU_DOMAIN_DISK_PRIVATE(disk); if (virStorageSourceIsEmpty(disk->src)) return NULL; @@ -7706,8 +7706,8 @@ qemuDomainDiskGetTopNodename(virDomainDiskDefPtr disk) * Returns 0 on success, -1 on error with libvirt error reported. */ int -qemuDomainDiskGetBackendAlias(virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps, +qemuDomainDiskGetBackendAlias(virDomainDiskDef *disk, + virQEMUCaps *qemuCaps, char **backendAlias) { *backendAlias = NULL; @@ -7744,9 +7744,9 @@ typedef enum { static int -qemuDomainStorageSourceAccessModifyNVMe(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src, +qemuDomainStorageSourceAccessModifyNVMe(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src, bool revoke) { bool revoke_maxmemlock = false; @@ -7804,9 +7804,9 @@ qemuDomainStorageSourceAccessModifyNVMe(virQEMUDriverPtr driver, * Returns 0 on success and -1 on error. Reports libvirt error. */ static int -qemuDomainStorageSourceAccessModify(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src, +qemuDomainStorageSourceAccessModify(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src, qemuDomainStorageSourceAccessFlags flags) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); @@ -7923,9 +7923,9 @@ qemuDomainStorageSourceAccessModify(virQEMUDriverPtr driver, int -qemuDomainStorageSourceChainAccessAllow(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src) +qemuDomainStorageSourceChainAccessAllow(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src) { qemuDomainStorageSourceAccessFlags flags = QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_CHAIN | QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_CHAIN_TOP; @@ -7935,9 +7935,9 @@ qemuDomainStorageSourceChainAccessAllow(virQEMUDriverPtr driver, int -qemuDomainStorageSourceChainAccessRevoke(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src) +qemuDomainStorageSourceChainAccessRevoke(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src) { qemuDomainStorageSourceAccessFlags flags = QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_REVOKE | QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_CHAIN | @@ -7954,9 +7954,9 @@ qemuDomainStorageSourceChainAccessRevoke(virQEMUDriverPtr driver, * removes cgroup ACLs for devices and removes locks. */ void -qemuDomainStorageSourceAccessRevoke(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr elem) +qemuDomainStorageSourceAccessRevoke(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *elem) { qemuDomainStorageSourceAccessFlags flags = QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_REVOKE; @@ -7987,9 +7987,9 @@ qemuDomainStorageSourceAccessRevoke(virQEMUDriverPtr driver, * (the base) becomes the top of the chain). */ int -qemuDomainStorageSourceAccessAllow(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr elem, +qemuDomainStorageSourceAccessAllow(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *elem, bool readonly, bool newSource, bool chainTop) @@ -8018,8 +8018,8 @@ qemuDomainStorageSourceAccessAllow(virQEMUDriverPtr driver, * taken from the virDomainDiskDefFormat() code. */ bool -qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk, - virDomainDiskDefPtr orig_disk) +qemuDomainDiskChangeSupported(virDomainDiskDef *disk, + virDomainDiskDef *orig_disk) { #define CHECK_EQ(field, field_name, nullable) \ do { \ @@ -8177,9 +8177,9 @@ qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk, bool -qemuDomainDiskBlockJobIsActive(virDomainDiskDefPtr disk) +qemuDomainDiskBlockJobIsActive(virDomainDiskDef *disk) { - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); if (disk->mirror) { virReportError(VIR_ERR_BLOCK_COPY_ACTIVE, @@ -8211,13 +8211,13 @@ qemuDomainDiskBlockJobIsActive(virDomainDiskDefPtr disk) * disk is involved in a block copy. * */ bool -qemuDomainHasBlockjob(virDomainObjPtr vm, +qemuDomainHasBlockjob(virDomainObj *vm, bool copy_only) { size_t i; for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + virDomainDiskDef *disk = vm->def->disks[i]; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); if (!copy_only && diskPriv->blockjob && qemuBlockJobIsRunning(diskPriv->blockjob)) @@ -8232,11 +8232,11 @@ qemuDomainHasBlockjob(virDomainObjPtr vm, int -qemuDomainUpdateDeviceList(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainUpdateDeviceList(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; char **aliases; int rc; @@ -8255,11 +8255,11 @@ qemuDomainUpdateDeviceList(virQEMUDriverPtr driver, int -qemuDomainUpdateMemoryDeviceInfo(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainUpdateMemoryDeviceInfo(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; GHashTable *meminfo = NULL; int rc; size_t i; @@ -8285,8 +8285,8 @@ qemuDomainUpdateMemoryDeviceInfo(virQEMUDriverPtr driver, return -1; for (i = 0; i < vm->def->nmems; i++) { - virDomainMemoryDefPtr mem = vm->def->mems[i]; - qemuMonitorMemoryDeviceInfoPtr dimm; + virDomainMemoryDef *mem = vm->def->mems[i]; + qemuMonitorMemoryDeviceInfo *dimm; if (!mem->info.alias) continue; @@ -8342,11 +8342,11 @@ virDomainABIStability virQEMUDriverDomainABIStability = { static bool -qemuDomainMigratableDefCheckABIStability(virQEMUDriverPtr driver, - virDomainDefPtr src, - virDomainDefPtr migratableSrc, - virDomainDefPtr dst, - virDomainDefPtr migratableDst) +qemuDomainMigratableDefCheckABIStability(virQEMUDriver *driver, + virDomainDef *src, + virDomainDef *migratableSrc, + virDomainDef *dst, + virDomainDef *migratableDst) { if (!virDomainDefCheckABIStabilityFlags(migratableSrc, migratableDst, @@ -8365,10 +8365,10 @@ qemuDomainMigratableDefCheckABIStability(virQEMUDriverPtr driver, VIR_DOMAIN_XML_MIGRATABLE) bool -qemuDomainDefCheckABIStability(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virDomainDefPtr src, - virDomainDefPtr dst) +qemuDomainDefCheckABIStability(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virDomainDef *src, + virDomainDef *dst) { g_autoptr(virDomainDef) migratableDefSrc = NULL; g_autoptr(virDomainDef) migratableDefDst = NULL; @@ -8384,11 +8384,11 @@ qemuDomainDefCheckABIStability(virQEMUDriverPtr driver, bool -qemuDomainCheckABIStability(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDefPtr dst) +qemuDomainCheckABIStability(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDef *dst) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virDomainDef) migratableSrc = NULL; g_autoptr(virDomainDef) migratableDst = NULL; g_autofree char *xml = NULL; @@ -8407,10 +8407,10 @@ qemuDomainCheckABIStability(virQEMUDriverPtr driver, bool -qemuDomainAgentAvailable(virDomainObjPtr vm, +qemuDomainAgentAvailable(virDomainObj *vm, bool reportError) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (virDomainObjGetState(vm, NULL) != VIR_DOMAIN_RUNNING) { if (reportError) { @@ -8477,7 +8477,7 @@ qemuDomainGetMemoryModuleSizeAlignment(const virDomainDef *def, int -qemuDomainAlignMemorySizes(virDomainDefPtr def) +qemuDomainAlignMemorySizes(virDomainDef *def) { unsigned long long maxmemkb = virMemoryMaxValue(false) >> 10; unsigned long long maxmemcapped = virMemoryMaxValue(true) >> 10; @@ -8556,8 +8556,8 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def) * size so this should be safe). */ int -qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def, - virDomainMemoryDefPtr mem) +qemuDomainMemoryDeviceAlignSize(virDomainDef *def, + virDomainMemoryDef *mem) { if (mem->model == VIR_DOMAIN_MEMORY_MODEL_NVDIMM && ARCH_IS_PPC64(def->os.arch)) { @@ -8577,10 +8577,10 @@ qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def, * * Returns the monitor pointer corresponding to the domain object @vm. */ -qemuMonitorPtr -qemuDomainGetMonitor(virDomainObjPtr vm) +qemuMonitor * +qemuDomainGetMonitor(virDomainObj *vm) { - return ((qemuDomainObjPrivatePtr) vm->privateData)->mon; + return ((qemuDomainObjPrivate *) vm->privateData)->mon; } @@ -8591,13 +8591,13 @@ qemuDomainGetMonitor(virDomainObjPtr vm) * Returns the pointer to the channel definition that is used to access the * guest agent if the agent is configured or NULL otherwise. */ -virDomainChrDefPtr -qemuFindAgentConfig(virDomainDefPtr def) +virDomainChrDef * +qemuFindAgentConfig(virDomainDef *def) { size_t i; for (i = 0; i < def->nchannels; i++) { - virDomainChrDefPtr channel = def->channels[i]; + virDomainChrDef *channel = def->channels[i]; if (channel->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO) continue; @@ -8855,8 +8855,8 @@ qemuDomainNeedsFDC(const virDomainDef *def) bool -qemuDomainSupportsPCI(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuDomainSupportsPCI(virDomainDef *def, + virQEMUCaps *qemuCaps) { if (def->os.arch != VIR_ARCH_ARMV6L && def->os.arch != VIR_ARCH_ARMV7L && @@ -8885,7 +8885,7 @@ qemuCheckMemoryDimmConflict(const virDomainDef *def, size_t i; for (i = 0; i < def->nmems; i++) { - virDomainMemoryDefPtr tmp = def->mems[i]; + virDomainMemoryDef *tmp = def->mems[i]; if (tmp == mem || tmp->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM) @@ -9074,7 +9074,7 @@ qemuDomainDefValidateMemoryHotplug(const virDomainDef *def, * recalculates the maximum size to reflect possible changes. */ void -qemuDomainUpdateCurrentMemorySize(virDomainObjPtr vm) +qemuDomainUpdateCurrentMemorySize(virDomainObj *vm) { /* inactive domain doesn't need size update */ if (!virDomainObjIsActive(vm)) @@ -9125,7 +9125,7 @@ ppc64VFIODeviceIsNV2Bridge(const char *device) * the guest to operate properly. */ static unsigned long long -getPPC64MemLockLimitBytes(virDomainDefPtr def, +getPPC64MemLockLimitBytes(virDomainDef *def, bool forceVFIO) { unsigned long long memKB = 0; @@ -9134,11 +9134,11 @@ getPPC64MemLockLimitBytes(virDomainDefPtr def, unsigned long long maxMemory = 0; unsigned long long passthroughLimit = 0; size_t i, nPCIHostBridges = 0; - virPCIDeviceAddressPtr pciAddr; + virPCIDeviceAddress *pciAddr; bool nvlink2Capable = false; for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; if (!virDomainControllerIsPSeriesPHB(cont)) continue; @@ -9147,7 +9147,7 @@ getPPC64MemLockLimitBytes(virDomainDefPtr def, } for (i = 0; i < def->nhostdevs; i++) { - virDomainHostdevDefPtr dev = def->hostdevs[i]; + virDomainHostdevDef *dev = def->hostdevs[i]; if (virHostdevIsVFIODevice(dev)) { @@ -9262,7 +9262,7 @@ getPPC64MemLockLimitBytes(virDomainDefPtr def, * Returns: the memory locking limit, or 0 if setting the limit is not needed */ unsigned long long -qemuDomainGetMemLockLimitBytes(virDomainDefPtr def, +qemuDomainGetMemLockLimitBytes(virDomainDef *def, bool forceVFIO) { unsigned long long memKB = 0; @@ -9327,7 +9327,7 @@ qemuDomainGetMemLockLimitBytes(virDomainDefPtr def, * Returns: 0 on success, <0 on failure */ int -qemuDomainAdjustMaxMemLock(virDomainObjPtr vm, +qemuDomainAdjustMaxMemLock(virDomainObj *vm, bool forceVFIO) { unsigned long long currentMemLock = 0; @@ -9383,8 +9383,8 @@ qemuDomainAdjustMaxMemLock(virDomainObjPtr vm, * Returns: 0 on success, <0 on failure */ int -qemuDomainAdjustMaxMemLockHostdev(virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainAdjustMaxMemLockHostdev(virDomainObj *vm, + virDomainHostdevDef *hostdev) { int ret = 0; @@ -9405,11 +9405,11 @@ qemuDomainAdjustMaxMemLockHostdev(virDomainObjPtr vm, * Returns true if we were able to successfully detect vCPU pids for the VM. */ bool -qemuDomainHasVcpuPids(virDomainObjPtr vm) +qemuDomainHasVcpuPids(virDomainObj *vm) { size_t i; size_t maxvcpus = virDomainDefGetVcpusMax(vm->def); - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; for (i = 0; i < maxvcpus; i++) { vcpu = virDomainDefGetVcpu(vm->def, i); @@ -9430,10 +9430,10 @@ qemuDomainHasVcpuPids(virDomainObjPtr vm) * Returns the vCPU pid. If @vcpu is offline or out of range 0 is returned. */ pid_t -qemuDomainGetVcpuPid(virDomainObjPtr vm, +qemuDomainGetVcpuPid(virDomainObj *vm, unsigned int vcpuid) { - virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, vcpuid); + virDomainVcpuDef *vcpu = virDomainDefGetVcpu(vm->def, vcpuid); return QEMU_DOMAIN_VCPU_PRIVATE(vcpu)->tid; } @@ -9448,11 +9448,11 @@ qemuDomainGetVcpuPid(virDomainObjPtr vm, * Returns 0 on success -1 on error. */ int -qemuDomainValidateVcpuInfo(virDomainObjPtr vm) +qemuDomainValidateVcpuInfo(virDomainObj *vm) { size_t maxvcpus = virDomainDefGetVcpusMax(vm->def); - virDomainVcpuDefPtr vcpu; - qemuDomainVcpuPrivatePtr vcpupriv; + virDomainVcpuDef *vcpu; + qemuDomainVcpuPrivate *vcpupriv; size_t i; if (!qemuDomainHasVcpuPids(vm)) @@ -9481,9 +9481,9 @@ qemuDomainValidateVcpuInfo(virDomainObjPtr vm) bool -qemuDomainSupportsNewVcpuHotplug(virDomainObjPtr vm) +qemuDomainSupportsNewVcpuHotplug(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; return virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS); } @@ -9504,14 +9504,14 @@ qemuDomainSupportsNewVcpuHotplug(virDomainObjPtr vm) * Returns 0 on success and -1 on fatal error. */ int -qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainRefreshVcpuInfo(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob, bool state) { - virDomainVcpuDefPtr vcpu; - qemuDomainVcpuPrivatePtr vcpupriv; - qemuMonitorCPUInfoPtr info = NULL; + virDomainVcpuDef *vcpu; + qemuDomainVcpuPrivate *vcpupriv; + qemuMonitorCPUInfo *info = NULL; size_t maxvcpus = virDomainDefGetVcpusMax(vm->def); size_t i, j; bool hotplug; @@ -9635,10 +9635,10 @@ qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver, * Returns the vCPU halted state. */ bool -qemuDomainGetVcpuHalted(virDomainObjPtr vm, +qemuDomainGetVcpuHalted(virDomainObj *vm, unsigned int vcpuid) { - virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, vcpuid); + virDomainVcpuDef *vcpu = virDomainDefGetVcpu(vm->def, vcpuid); return QEMU_DOMAIN_VCPU_PRIVATE(vcpu)->halted; } @@ -9653,12 +9653,12 @@ qemuDomainGetVcpuHalted(virDomainObjPtr vm, * Returns 0 on success and -1 on error */ int -qemuDomainRefreshVcpuHalted(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainRefreshVcpuHalted(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob) { - virDomainVcpuDefPtr vcpu; - qemuDomainVcpuPrivatePtr vcpupriv; + virDomainVcpuDef *vcpu; + qemuDomainVcpuPrivate *vcpupriv; size_t maxvcpus = virDomainDefGetVcpusMax(vm->def); g_autoptr(virBitmap) haltedmap = NULL; size_t i; @@ -9699,8 +9699,8 @@ qemuDomainRefreshVcpuHalted(virQEMUDriverPtr driver, } bool -qemuDomainSupportsNicdev(virDomainDefPtr def, - virDomainNetDefPtr net) +qemuDomainSupportsNicdev(virDomainDef *def, + virDomainNetDef *net) { /* non-virtio ARM nics require legacy -net nic */ if (((def->os.arch == VIR_ARCH_ARMV6L) || @@ -9738,11 +9738,11 @@ qemuDomainNetSupportsMTU(virDomainNetType type) } -virDomainDiskDefPtr -qemuDomainDiskByName(virDomainDefPtr def, +virDomainDiskDef * +qemuDomainDiskByName(virDomainDef *def, const char *name) { - virDomainDiskDefPtr ret; + virDomainDiskDef *ret; if (!(ret = virDomainDiskByName(def, name, true))) { virReportError(VIR_ERR_INVALID_ARG, @@ -9805,7 +9805,7 @@ qemuDomainDefValidateDiskLunSource(const virStorageSource *src) int -qemuDomainPrepareChannel(virDomainChrDefPtr channel, +qemuDomainPrepareChannel(virDomainChrDef *channel, const char *domainChannelTargetDir) { if (channel->targetType != VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO || @@ -9839,8 +9839,8 @@ qemuDomainPrepareChannel(virDomainChrDefPtr channel, * live XML of a guest. */ void -qemuDomainPrepareChardevSourceTLS(virDomainChrSourceDefPtr source, - virQEMUDriverConfigPtr cfg) +qemuDomainPrepareChardevSourceTLS(virDomainChrSourceDef *source, + virQEMUDriverConfig *cfg) { if (source->type == VIR_DOMAIN_CHR_TYPE_TCP) { if (source->data.tcp.haveTLS == VIR_TRISTATE_BOOL_ABSENT) { @@ -9858,12 +9858,12 @@ qemuDomainPrepareChardevSourceTLS(virDomainChrSourceDefPtr source, * @def: live domain definition * @cfg: driver configuration * - * Iterate through all devices that use virDomainChrSourceDefPtr as host + * Iterate through all devices that use virDomainChrSourceDef *as host * interface part. */ void -qemuDomainPrepareChardevSource(virDomainDefPtr def, - virQEMUDriverConfigPtr cfg) +qemuDomainPrepareChardevSource(virDomainDef *def, + virQEMUDriverConfig *cfg) { size_t i; @@ -9894,9 +9894,9 @@ qemuDomainPrepareChardevSource(virDomainDefPtr def, static int -qemuProcessPrepareStorageSourceTLSVxhs(virStorageSourcePtr src, - virQEMUDriverConfigPtr cfg, - qemuDomainObjPrivatePtr priv, +qemuProcessPrepareStorageSourceTLSVxhs(virStorageSource *src, + virQEMUDriverConfig *cfg, + qemuDomainObjPrivate *priv, const char *parentAlias) { /* VxHS uses only client certificates and thus has no need for @@ -9915,7 +9915,7 @@ qemuProcessPrepareStorageSourceTLSVxhs(virStorageSourcePtr src, src->tlsCertdir = g_strdup(cfg->vxhsTLSx509certdir); if (cfg->vxhsTLSx509secretUUID) { - qemuDomainStorageSourcePrivatePtr srcpriv = qemuDomainStorageSourcePrivateFetch(src); + qemuDomainStorageSourcePrivate *srcpriv = qemuDomainStorageSourcePrivateFetch(src); if (!(srcpriv->tlsKeySecret = qemuDomainSecretInfoTLSNew(priv, src->tlsAlias, cfg->vxhsTLSx509secretUUID))) @@ -9928,9 +9928,9 @@ qemuProcessPrepareStorageSourceTLSVxhs(virStorageSourcePtr src, static int -qemuProcessPrepareStorageSourceTLSNBD(virStorageSourcePtr src, - virQEMUDriverConfigPtr cfg, - qemuDomainObjPrivatePtr priv, +qemuProcessPrepareStorageSourceTLSNBD(virStorageSource *src, + virQEMUDriverConfig *cfg, + qemuDomainObjPrivate *priv, const char *parentAlias) { if (src->haveTLS == VIR_TRISTATE_BOOL_ABSENT) { @@ -9952,7 +9952,7 @@ qemuProcessPrepareStorageSourceTLSNBD(virStorageSourcePtr src, src->tlsCertdir = g_strdup(cfg->nbdTLSx509certdir); if (cfg->nbdTLSx509secretUUID) { - qemuDomainStorageSourcePrivatePtr srcpriv = qemuDomainStorageSourcePrivateFetch(src); + qemuDomainStorageSourcePrivate *srcpriv = qemuDomainStorageSourcePrivateFetch(src); if (!(srcpriv->tlsKeySecret = qemuDomainSecretInfoTLSNew(priv, src->tlsAlias, cfg->nbdTLSx509secretUUID))) @@ -9972,7 +9972,7 @@ qemuProcessPrepareStorageSourceTLSNBD(virStorageSourcePtr src, * then provide the hypervisor default uid and gid. */ static int -qemuDomainPrepareStorageSourceNFS(virStorageSourcePtr src) +qemuDomainPrepareStorageSourceNFS(virStorageSource *src) { if (virStorageSourceGetActualType(src) != VIR_STORAGE_TYPE_NETWORK) return 0; @@ -10012,10 +10012,10 @@ qemuDomainPrepareStorageSourceNFS(virStorageSourcePtr src) * Returns 0 on success, -1 on bad config/failure */ static int -qemuDomainPrepareStorageSourceTLS(virStorageSourcePtr src, - virQEMUDriverConfigPtr cfg, +qemuDomainPrepareStorageSourceTLS(virStorageSource *src, + virQEMUDriverConfig *cfg, const char *parentAlias, - qemuDomainObjPrivatePtr priv) + qemuDomainObjPrivate *priv) { if (virStorageSourceGetActualType(src) != VIR_STORAGE_TYPE_NETWORK) return 0; @@ -10063,7 +10063,7 @@ qemuDomainPrepareStorageSourceTLS(virStorageSourcePtr src, void -qemuDomainPrepareShmemChardev(virDomainShmemDefPtr shmem) +qemuDomainPrepareShmemChardev(virDomainShmemDef *shmem) { if (!shmem->server.enabled || shmem->server.chr.data.nix.path) @@ -10082,10 +10082,10 @@ qemuDomainPrepareShmemChardev(virDomainShmemDefPtr shmem) * with increasing order). */ bool -qemuDomainVcpuHotplugIsInOrder(virDomainDefPtr def) +qemuDomainVcpuHotplugIsInOrder(virDomainDef *def) { size_t maxvcpus = virDomainDefGetVcpusMax(def); - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; unsigned int prevorder = 0; size_t seenonlinevcpus = 0; size_t i; @@ -10119,11 +10119,11 @@ qemuDomainVcpuHotplugIsInOrder(virDomainDefPtr def) * of all sub entities. */ void -qemuDomainVcpuPersistOrder(virDomainDefPtr def) +qemuDomainVcpuPersistOrder(virDomainDef *def) { size_t maxvcpus = virDomainDefGetVcpusMax(def); - virDomainVcpuDefPtr vcpu; - qemuDomainVcpuPrivatePtr vcpupriv; + virDomainVcpuDef *vcpu; + qemuDomainVcpuPrivate *vcpupriv; unsigned int prevorder = 0; size_t i; @@ -10144,11 +10144,11 @@ qemuDomainVcpuPersistOrder(virDomainDefPtr def) int -qemuDomainCheckMonitor(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainCheckMonitor(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret; if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) @@ -10164,8 +10164,8 @@ qemuDomainCheckMonitor(virQEMUDriverPtr driver, bool -qemuDomainSupportsVideoVga(virDomainVideoDefPtr video, - virQEMUCapsPtr qemuCaps) +qemuDomainSupportsVideoVga(virDomainVideoDef *video, + virQEMUCaps *qemuCaps) { if (video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) { if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) { @@ -10206,15 +10206,15 @@ qemuDomainNeedsVFIO(const virDomainDef *def) * Returns 0 on success, -1 otherwise. */ int -qemuDomainGetHostdevPath(virDomainHostdevDefPtr dev, +qemuDomainGetHostdevPath(virDomainHostdevDef *dev, char **path, int *perms) { - virDomainHostdevSubsysUSBPtr usbsrc = &dev->source.subsys.u.usb; - virDomainHostdevSubsysPCIPtr pcisrc = &dev->source.subsys.u.pci; - virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIVHostPtr hostsrc = &dev->source.subsys.u.scsi_host; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev; + virDomainHostdevSubsysUSB *usbsrc = &dev->source.subsys.u.usb; + virDomainHostdevSubsysPCI *pcisrc = &dev->source.subsys.u.pci; + virDomainHostdevSubsysSCSI *scsisrc = &dev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIVHost *hostsrc = &dev->source.subsys.u.scsi_host; + virDomainHostdevSubsysMediatedDev *mdevsrc = &dev->source.subsys.u.mdev; g_autoptr(virUSBDevice) usb = NULL; g_autoptr(virSCSIDevice) scsi = NULL; g_autoptr(virSCSIVHostDevice) host = NULL; @@ -10248,10 +10248,10 @@ qemuDomainGetHostdevPath(virDomainHostdevDefPtr dev, case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) { - virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &scsisrc->u.iscsi; + virDomainHostdevSubsysSCSIiSCSI *iscsisrc = &scsisrc->u.iscsi; VIR_DEBUG("Not updating /dev for hostdev iSCSI path '%s'", iscsisrc->src->path); } else { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; scsi = virSCSIDeviceNew(NULL, scsihostsrc->adapter, scsihostsrc->bus, @@ -10316,20 +10316,20 @@ qemuDomainGetHostdevPath(virDomainHostdevDefPtr dev, * Optionally fills @src and @idx if provided with the specific backing chain * element which corresponds to the node name. */ -virDomainDiskDefPtr -qemuDomainDiskLookupByNodename(virDomainDefPtr def, - virDomainBackupDefPtr backupdef, +virDomainDiskDef * +qemuDomainDiskLookupByNodename(virDomainDef *def, + virDomainBackupDef *backupdef, const char *nodename, - virStorageSourcePtr *src) + virStorageSource **src) { size_t i; - virStorageSourcePtr tmp = NULL; + virStorageSource *tmp = NULL; if (!src) src = &tmp; for (i = 0; i < def->ndisks; i++) { - virDomainDiskDefPtr domdisk = def->disks[i]; + virDomainDiskDef *domdisk = def->disks[i]; if ((*src = qemuDomainVirStorageSourceFindByNodeName(domdisk->src, nodename))) return domdisk; @@ -10341,7 +10341,7 @@ qemuDomainDiskLookupByNodename(virDomainDefPtr def, if (backupdef) { for (i = 0; i < backupdef->ndisks; i++) { - virDomainBackupDiskDefPtr backupdisk = backupdef->disks + i; + virDomainBackupDiskDef *backupdisk = backupdef->disks + i; if (backupdisk->store && (*src = qemuDomainVirStorageSourceFindByNodeName(backupdisk->store, nodename))) @@ -10360,7 +10360,7 @@ qemuDomainDiskLookupByNodename(virDomainDefPtr def, * entry for a disk. */ char * -qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk, +qemuDomainDiskBackingStoreGetName(virDomainDiskDef *disk, unsigned int idx) { if (idx) @@ -10370,13 +10370,13 @@ qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk, } -virStorageSourcePtr +virStorageSource * qemuDomainGetStorageSourceByDevstr(const char *devstr, - virDomainDefPtr def, - virDomainBackupDefPtr backupdef) + virDomainDef *def, + virDomainBackupDef *backupdef) { - virDomainDiskDefPtr disk = NULL; - virStorageSourcePtr n; + virDomainDiskDef *disk = NULL; + virStorageSource *n; g_autofree char *target = NULL; unsigned int idx; @@ -10411,7 +10411,7 @@ qemuDomainGetStorageSourceByDevstr(const char *devstr, size_t i; for (i = 0; i < backupdef->ndisks; i++) { - virDomainBackupDiskDefPtr backupdisk = backupdef->disks + i; + virDomainBackupDiskDef *backupdisk = backupdef->disks + i; if (STRNEQ(target, backupdisk->name)) continue; @@ -10432,7 +10432,7 @@ qemuDomainGetStorageSourceByDevstr(const char *devstr, static void qemuDomainSaveCookieDispose(void *obj) { - qemuDomainSaveCookiePtr cookie = obj; + qemuDomainSaveCookie *cookie = obj; VIR_DEBUG("cookie=%p", cookie); @@ -10440,10 +10440,10 @@ qemuDomainSaveCookieDispose(void *obj) } -qemuDomainSaveCookiePtr -qemuDomainSaveCookieNew(virDomainObjPtr vm) +qemuDomainSaveCookie * +qemuDomainSaveCookieNew(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(qemuDomainSaveCookie) cookie = NULL; if (qemuDomainInitialize() < 0) @@ -10466,7 +10466,7 @@ qemuDomainSaveCookieNew(virDomainObjPtr vm) static int qemuDomainSaveCookieParse(xmlXPathContextPtr ctxt G_GNUC_UNUSED, - virObjectPtr *obj) + virObject **obj) { g_autoptr(qemuDomainSaveCookie) cookie = NULL; @@ -10482,16 +10482,16 @@ qemuDomainSaveCookieParse(xmlXPathContextPtr ctxt G_GNUC_UNUSED, cookie->slirpHelper = virXPathBoolean("boolean(./slirpHelper)", ctxt) > 0; - *obj = (virObjectPtr) g_steal_pointer(&cookie); + *obj = (virObject *) g_steal_pointer(&cookie); return 0; } static int -qemuDomainSaveCookieFormat(virBufferPtr buf, - virObjectPtr obj) +qemuDomainSaveCookieFormat(virBuffer *buf, + virObject *obj) { - qemuDomainSaveCookiePtr cookie = (qemuDomainSaveCookiePtr) obj; + qemuDomainSaveCookie *cookie = (qemuDomainSaveCookie *) obj; if (cookie->cpu && virCPUDefFormatBufFull(buf, cookie->cpu, NULL) < 0) @@ -10525,11 +10525,11 @@ virSaveCookieCallbacks virQEMUDriverDomainSaveCookie = { * Returns 0 on success, -1 on error. */ int -qemuDomainUpdateCPU(virDomainObjPtr vm, - virCPUDefPtr cpu, - virCPUDefPtr *origCPU) +qemuDomainUpdateCPU(virDomainObj *vm, + virCPUDef *cpu, + virCPUDef **origCPU) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; *origCPU = NULL; @@ -10571,8 +10571,8 @@ qemuDomainUpdateCPU(virDomainObjPtr vm, * Returns 0 on success, -1 on error. */ int -qemuDomainFixupCPUs(virDomainObjPtr vm, - virCPUDefPtr *origCPU) +qemuDomainFixupCPUs(virDomainObj *vm, + virCPUDef **origCPU) { g_autoptr(virCPUDef) fixedCPU = NULL; g_autoptr(virCPUDef) fixedOrig = NULL; @@ -10620,10 +10620,10 @@ qemuDomainFixupCPUs(virDomainObjPtr vm, char * -qemuDomainGetMachineName(virDomainObjPtr vm) +qemuDomainGetMachineName(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; char *ret = NULL; if (vm->pid > 0) { @@ -10654,7 +10654,7 @@ qemuDomainGetMachineName(virDomainObjPtr vm) bool qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def, const virDomainDeviceInfo *info, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, const char *devicename) { if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW) { @@ -10693,8 +10693,8 @@ qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def, * for detected backing chain members. */ void -qemuDomainPrepareDiskSourceData(virDomainDiskDefPtr disk, - virStorageSourcePtr src) +qemuDomainPrepareDiskSourceData(virDomainDiskDef *disk, + virStorageSource *src) { if (!disk) return; @@ -10714,7 +10714,7 @@ qemuDomainPrepareDiskSourceData(virDomainDiskDefPtr disk, static void -qemuDomainPrepareDiskCachemode(virDomainDiskDefPtr disk) +qemuDomainPrepareDiskCachemode(virDomainDiskDef *disk) { if (disk->cachemode == VIR_DOMAIN_DISK_CACHE_DEFAULT && disk->src->shared && !disk->src->readonly) @@ -10723,8 +10723,8 @@ qemuDomainPrepareDiskCachemode(virDomainDiskDefPtr disk) static int -qemuDomainPrepareStorageSourcePR(virStorageSourcePtr src, - qemuDomainObjPrivatePtr priv, +qemuDomainPrepareStorageSourcePR(virStorageSource *src, + qemuDomainObjPrivate *priv, const char *parentalias) { if (!src->pr) @@ -10753,9 +10753,9 @@ qemuDomainPrepareStorageSourcePR(virStorageSourcePtr src, * Prepare any disk source relevant data for use with the -drive command line. */ static int -qemuDomainPrepareDiskSourceLegacy(virDomainDiskDefPtr disk, - qemuDomainObjPrivatePtr priv, - virQEMUDriverConfigPtr cfg) +qemuDomainPrepareDiskSourceLegacy(virDomainDiskDef *disk, + qemuDomainObjPrivate *priv, + virQEMUDriverConfig *cfg) { if (qemuDomainValidateStorageSource(disk->src, priv->qemuCaps, true) < 0) return -1; @@ -10780,10 +10780,10 @@ qemuDomainPrepareDiskSourceLegacy(virDomainDiskDefPtr disk, int -qemuDomainPrepareStorageSourceBlockdev(virDomainDiskDefPtr disk, - virStorageSourcePtr src, - qemuDomainObjPrivatePtr priv, - virQEMUDriverConfigPtr cfg) +qemuDomainPrepareStorageSourceBlockdev(virDomainDiskDef *disk, + virStorageSource *src, + qemuDomainObjPrivate *priv, + virQEMUDriverConfig *cfg) { src->id = qemuDomainStorageIdNew(priv); @@ -10819,12 +10819,12 @@ qemuDomainPrepareStorageSourceBlockdev(virDomainDiskDefPtr disk, static int -qemuDomainPrepareDiskSourceBlockdev(virDomainDiskDefPtr disk, - qemuDomainObjPrivatePtr priv, - virQEMUDriverConfigPtr cfg) +qemuDomainPrepareDiskSourceBlockdev(virDomainDiskDef *disk, + qemuDomainObjPrivate *priv, + virQEMUDriverConfig *cfg) { - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); - virStorageSourcePtr n; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + virStorageSource *n; if (disk->copy_on_read == VIR_TRISTATE_SWITCH_ON && !diskPriv->nodeCopyOnRead) @@ -10840,9 +10840,9 @@ qemuDomainPrepareDiskSourceBlockdev(virDomainDiskDefPtr disk, int -qemuDomainPrepareDiskSource(virDomainDiskDefPtr disk, - qemuDomainObjPrivatePtr priv, - virQEMUDriverConfigPtr cfg) +qemuDomainPrepareDiskSource(virDomainDiskDef *disk, + qemuDomainObjPrivate *priv, + virQEMUDriverConfig *cfg) { /* Nothing to prepare as it will use -chardev instead * of -blockdev/-drive option. */ @@ -10876,12 +10876,12 @@ qemuDomainPrepareDiskSource(virDomainDiskDefPtr disk, int -qemuDomainPrepareHostdev(virDomainHostdevDefPtr hostdev, - qemuDomainObjPrivatePtr priv) +qemuDomainPrepareHostdev(virDomainHostdevDef *hostdev, + qemuDomainObjPrivate *priv) { if (virHostdevIsSCSIDevice(hostdev)) { - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; - virStorageSourcePtr src = NULL; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; + virStorageSource *src = NULL; switch ((virDomainHostdevSCSIProtocolType) scsisrc->protocol) { case VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_NONE: @@ -10917,7 +10917,7 @@ qemuDomainPrepareHostdev(virDomainHostdevDefPtr hostdev, if (src->auth) { bool iscsiHasPS = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_ISCSI_PASSWORD_SECRET); virSecretUsageType usageType = VIR_SECRET_USAGE_TYPE_ISCSI; - qemuDomainStorageSourcePrivatePtr srcPriv = qemuDomainStorageSourcePrivateFetch(src); + qemuDomainStorageSourcePrivate *srcPriv = qemuDomainStorageSourcePrivateFetch(src); if (!qemuDomainSupportsEncryptedSecret(priv) || !iscsiHasPS) { srcPriv->secinfo = qemuDomainSecretInfoNewPlain(usageType, @@ -11051,7 +11051,7 @@ qemuProcessEventFree(struct qemuProcessEvent *event) char * -qemuDomainGetManagedPRSocketPath(qemuDomainObjPrivatePtr priv) +qemuDomainGetManagedPRSocketPath(qemuDomainObjPrivate *priv) { return g_strdup_printf("%s/%s.sock", priv->libDir, qemuDomainGetManagedPRAlias()); @@ -11065,7 +11065,7 @@ qemuDomainGetManagedPRSocketPath(qemuDomainObjPrivatePtr priv) * Generate a new unique id for a storage object. Useful for node name generation. */ unsigned int -qemuDomainStorageIdNew(qemuDomainObjPrivatePtr priv) +qemuDomainStorageIdNew(qemuDomainObjPrivate *priv) { return ++priv->nodenameindex; } @@ -11079,7 +11079,7 @@ qemuDomainStorageIdNew(qemuDomainObjPrivatePtr priv) * for a single instance, so can be reset on VM shutdown. */ void -qemuDomainStorageIdReset(qemuDomainObjPrivatePtr priv) +qemuDomainStorageIdReset(qemuDomainObjPrivate *priv) { priv->nodenameindex = 0; } @@ -11124,14 +11124,14 @@ qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason) * command line. */ bool -qemuDomainIsUsingNoShutdown(qemuDomainObjPrivatePtr priv) +qemuDomainIsUsingNoShutdown(qemuDomainObjPrivate *priv) { return priv->allowReboot == VIR_TRISTATE_BOOL_YES; } bool -qemuDomainDiskIsMissingLocalOptional(virDomainDiskDefPtr disk) +qemuDomainDiskIsMissingLocalOptional(virDomainDiskDef *disk) { return disk->startupPolicy == VIR_DOMAIN_STARTUP_POLICY_OPTIONAL && virStorageSourceIsLocalStorage(disk->src) && disk->src->path && @@ -11140,8 +11140,8 @@ qemuDomainDiskIsMissingLocalOptional(virDomainDiskDefPtr disk) void -qemuDomainNVRAMPathFormat(virQEMUDriverConfigPtr cfg, - virDomainDefPtr def, +qemuDomainNVRAMPathFormat(virQEMUDriverConfig *cfg, + virDomainDef *def, char **path) { *path = g_strdup_printf("%s/%s_VARS.fd", cfg->nvramDir, def->name); @@ -11149,8 +11149,8 @@ qemuDomainNVRAMPathFormat(virQEMUDriverConfigPtr cfg, void -qemuDomainNVRAMPathGenerate(virQEMUDriverConfigPtr cfg, - virDomainDefPtr def) +qemuDomainNVRAMPathGenerate(virQEMUDriverConfig *cfg, + virDomainDef *def) { if (virDomainDefHasOldStyleROUEFI(def) && !def->os.loader->nvram) @@ -11197,7 +11197,7 @@ qemuDomainDefHasManagedPRBlockjobIterator(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - qemuBlockJobDataPtr job = payload; + qemuBlockJobData *job = payload; bool *hasPR = opaque; if (job->disk) @@ -11219,9 +11219,9 @@ qemuDomainDefHasManagedPRBlockjobIterator(void *payload, * managed persistent reservations. */ bool -qemuDomainDefHasManagedPR(virDomainObjPtr vm) +qemuDomainDefHasManagedPR(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool jobPR = false; if (virDomainDefHasManagedPR(vm->def)) @@ -11242,9 +11242,9 @@ qemuDomainDefHasManagedPR(virDomainObjPtr vm) * 0 in case everything is supported. */ int -qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm) +qemuDomainSupportsCheckpointsBlockjobs(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_INCREMENTAL_BACKUP) && virDomainListCheckpoints(vm->checkpoints, NULL, NULL, NULL, 0) > 0) { @@ -11271,10 +11271,10 @@ qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm) * 'libvirt-pflash1-format' for pflash1. */ int -qemuDomainInitializePflashStorageSource(virDomainObjPtr vm) +qemuDomainInitializePflashStorageSource(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainDefPtr def = vm->def; + qemuDomainObjPrivate *priv = vm->privateData; + virDomainDef *def = vm->def; g_autoptr(virStorageSource) pflash0 = NULL; g_autoptr(virStorageSource) pflash1 = NULL; @@ -11319,10 +11319,10 @@ qemuDomainInitializePflashStorageSource(virDomainObjPtr vm) * Note that this does not verify whether other block jobs are running etc. */ bool -qemuDomainDiskBlockJobIsSupported(virDomainObjPtr vm, - virDomainDiskDefPtr disk) +qemuDomainDiskBlockJobIsSupported(virDomainObj *vm, + virDomainDiskDef *disk) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV) && qemuDiskBusIsSD(disk->bus)) { @@ -11491,8 +11491,8 @@ virQEMUFileOpenAs(uid_t fallback_uid, * qemuDomainStorageFileInit and storage driver APIs if possible. **/ int -qemuDomainOpenFile(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainOpenFile(virQEMUDriver *driver, + virDomainObj *vm, const char *path, int oflags, bool *needUnlink) @@ -11501,7 +11501,7 @@ qemuDomainOpenFile(virQEMUDriverPtr driver, uid_t user = cfg->user; gid_t group = cfg->group; bool dynamicOwnership = cfg->dynamicOwnership; - virSecurityLabelDefPtr seclabel; + virSecurityLabelDef *seclabel; /* TODO: Take imagelabel into account? */ if (vm && @@ -11516,8 +11516,8 @@ qemuDomainOpenFile(virQEMUDriverPtr driver, int -qemuDomainFileWrapperFDClose(virDomainObjPtr vm, - virFileWrapperFdPtr fd) +qemuDomainFileWrapperFDClose(virDomainObj *vm, + virFileWrapperFd *fd) { int ret; @@ -11557,8 +11557,8 @@ qemuDomainFileWrapperFDClose(virDomainObjPtr vm, * -1 otherwise. */ int -qemuDomainInterfaceSetDefaultQDisc(virQEMUDriverPtr driver, - virDomainNetDefPtr net) +qemuDomainInterfaceSetDefaultQDisc(virQEMUDriver *driver, + virDomainNetDef *net) { virDomainNetType actualType = virDomainNetGetActualType(net); @@ -11580,7 +11580,7 @@ qemuDomainInterfaceSetDefaultQDisc(virQEMUDriverPtr driver, int -qemuDomainNamePathsCleanup(virQEMUDriverConfigPtr cfg, +qemuDomainNamePathsCleanup(virQEMUDriverConfig *cfg, const char *name, bool bestEffort) { diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 1c80b8cfaa..632e77dc74 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -55,17 +55,17 @@ # define QEMU_DOMAIN_MIG_BANDWIDTH_MAX (INT64_MAX / (1024 * 1024)) #endif -typedef void (*qemuDomainCleanupCallback)(virQEMUDriverPtr driver, - virDomainObjPtr vm); +typedef void (*qemuDomainCleanupCallback)(virQEMUDriver *driver, + virDomainObj *vm); #define QEMU_DOMAIN_MASTER_KEY_LEN 32 /* 32 bytes for 256 bit random key */ void -qemuDomainObjSaveStatus(virQEMUDriverPtr driver, - virDomainObjPtr obj); +qemuDomainObjSaveStatus(virQEMUDriver *driver, + virDomainObj *obj); -void qemuDomainSaveStatus(virDomainObjPtr obj); -void qemuDomainSaveConfig(virDomainObjPtr obj); +void qemuDomainSaveStatus(virDomainObj *obj); +void qemuDomainSaveConfig(virDomainObj *obj); /* helper data types for async device unplug */ @@ -76,7 +76,6 @@ typedef enum { } qemuDomainUnpluggingDeviceStatus; typedef struct _qemuDomainUnpluggingDevice qemuDomainUnpluggingDevice; -typedef qemuDomainUnpluggingDevice *qemuDomainUnpluggingDevicePtr; struct _qemuDomainUnpluggingDevice { const char *alias; qemuDomainUnpluggingDeviceStatus status; @@ -100,7 +99,6 @@ typedef enum { } qemuDomainSecretInfoType; typedef struct _qemuDomainSecretPlain qemuDomainSecretPlain; -typedef struct _qemuDomainSecretPlain *qemuDomainSecretPlainPtr; struct _qemuDomainSecretPlain { char *username; uint8_t *secret; @@ -110,7 +108,6 @@ struct _qemuDomainSecretPlain { #define QEMU_DOMAIN_AES_IV_LEN 16 /* 16 bytes for 128 bit random */ /* initialization vector */ typedef struct _qemuDomainSecretAES qemuDomainSecretAES; -typedef struct _qemuDomainSecretAES *qemuDomainSecretAESPtr; struct _qemuDomainSecretAES { char *username; char *alias; /* generated alias for secret */ @@ -119,7 +116,6 @@ struct _qemuDomainSecretAES { }; typedef struct _qemuDomainSecretInfo qemuDomainSecretInfo; -typedef qemuDomainSecretInfo *qemuDomainSecretInfoPtr; struct _qemuDomainSecretInfo { qemuDomainSecretInfoType type; union { @@ -129,32 +125,31 @@ struct _qemuDomainSecretInfo { }; typedef struct _qemuDomainObjPrivate qemuDomainObjPrivate; -typedef qemuDomainObjPrivate *qemuDomainObjPrivatePtr; struct _qemuDomainObjPrivate { - virQEMUDriverPtr driver; + virQEMUDriver *driver; qemuDomainJobObj job; - virBitmapPtr namespaces; + virBitmap *namespaces; virEventThread *eventThread; - qemuMonitorPtr mon; - virDomainChrSourceDefPtr monConfig; + qemuMonitor *mon; + virDomainChrSourceDef *monConfig; bool monError; unsigned long long monStart; int agentTimeout; - qemuAgentPtr agent; + qemuAgent *agent; bool agentError; bool beingDestroyed; char *pidfile; - virDomainPCIAddressSetPtr pciaddrs; - virDomainUSBAddressSetPtr usbaddrs; + virDomainPCIAddressSet *pciaddrs; + virDomainUSBAddressSet *usbaddrs; - virQEMUCapsPtr qemuCaps; + virQEMUCaps *qemuCaps; char *lockState; bool fakeReboot; @@ -169,15 +164,15 @@ struct _qemuDomainObjPrivate { unsigned short migrationPort; int preMigrationState; - virChrdevsPtr devs; + virChrdevs *devs; qemuDomainCleanupCallback *cleanupCallbacks; size_t ncleanupCallbacks; size_t ncleanupCallbacks_max; - virCgroupPtr cgroup; + virCgroup *cgroup; - virPerfPtr perf; + virPerf *perf; qemuDomainUnpluggingDevice unplug; @@ -186,8 +181,8 @@ struct _qemuDomainObjPrivate { bool hookRun; /* true if there was a hook run over this domain */ /* Bitmaps below hold data from the auto NUMA feature */ - virBitmapPtr autoNodeset; - virBitmapPtr autoCpuset; + virBitmap *autoNodeset; + virBitmap *autoCpuset; bool signalIOError; /* true if the domain condition should be signalled on I/O error */ @@ -207,11 +202,11 @@ struct _qemuDomainObjPrivate { /* for migrations using TLS with a secret (not to be saved in our */ /* private XML). */ - qemuDomainSecretInfoPtr migSecinfo; + qemuDomainSecretInfo *migSecinfo; /* CPU def used to start the domain when it differs from the one actually * provided by QEMU. */ - virCPUDefPtr origCPU; + virCPUDef *origCPU; /* If true virtlogd is used as stdio handler for character devices. */ bool chardevStdioLogd; @@ -221,7 +216,7 @@ struct _qemuDomainObjPrivate { /* Migration capabilities. Rechecked on reconnect, not to be saved in * private XML. */ - virBitmapPtr migrationCaps; + virBitmap *migrationCaps; /* true if qemu-pr-helper process is running for the domain */ bool prDaemonRunning; @@ -251,11 +246,11 @@ struct _qemuDomainObjPrivate { /* Until we add full support for backing chains for pflash drives, these * pointers hold the temporary virStorageSources for creating the -blockdev * commandline for pflash drives. */ - virStorageSourcePtr pflash0; - virStorageSourcePtr pflash1; + virStorageSource *pflash0; + virStorageSource *pflash1; /* running backup job */ - virDomainBackupDefPtr backup; + virDomainBackupDef *backup; bool dbusDaemonRunning; @@ -270,23 +265,22 @@ struct _qemuDomainObjPrivate { }; #define QEMU_DOMAIN_PRIVATE(vm) \ - ((qemuDomainObjPrivatePtr) (vm)->privateData) + ((qemuDomainObjPrivate *) (vm)->privateData) #define QEMU_DOMAIN_DISK_PRIVATE(disk) \ - ((qemuDomainDiskPrivatePtr) (disk)->privateData) + ((qemuDomainDiskPrivate *) (disk)->privateData) typedef struct _qemuDomainDiskPrivate qemuDomainDiskPrivate; -typedef qemuDomainDiskPrivate *qemuDomainDiskPrivatePtr; struct _qemuDomainDiskPrivate { virObject parent; /* ideally we want a smarter way to interlock block jobs on single qemu disk * in the future, but for now we just disallow any concurrent job on a * single disk */ - qemuBlockJobDataPtr blockjob; + qemuBlockJobData *blockjob; bool migrating; /* the disk is being migrated */ - virStorageSourcePtr migrSource; /* disk source object used for NBD migration */ + virStorageSource *migrSource; /* disk source object used for NBD migration */ /* information about the device */ bool tray; /* device has tray */ @@ -297,32 +291,30 @@ struct _qemuDomainDiskPrivate { }; #define QEMU_DOMAIN_STORAGE_SOURCE_PRIVATE(src) \ - ((qemuDomainStorageSourcePrivatePtr) (src)->privateData) + ((qemuDomainStorageSourcePrivate *) (src)->privateData) typedef struct _qemuDomainStorageSourcePrivate qemuDomainStorageSourcePrivate; -typedef qemuDomainStorageSourcePrivate *qemuDomainStorageSourcePrivatePtr; struct _qemuDomainStorageSourcePrivate { virObject parent; /* data required for authentication to the storage source */ - qemuDomainSecretInfoPtr secinfo; + qemuDomainSecretInfo *secinfo; /* data required for decryption of encrypted storage source */ - qemuDomainSecretInfoPtr encinfo; + qemuDomainSecretInfo *encinfo; /* secure passthrough of the http cookie */ - qemuDomainSecretInfoPtr httpcookie; + qemuDomainSecretInfo *httpcookie; /* key for decrypting TLS certificate */ - qemuDomainSecretInfoPtr tlsKeySecret; + qemuDomainSecretInfo *tlsKeySecret; }; -virObjectPtr qemuDomainStorageSourcePrivateNew(void); -qemuDomainStorageSourcePrivatePtr -qemuDomainStorageSourcePrivateFetch(virStorageSourcePtr src); +virObject *qemuDomainStorageSourcePrivateNew(void); +qemuDomainStorageSourcePrivate * +qemuDomainStorageSourcePrivateFetch(virStorageSource *src); typedef struct _qemuDomainVcpuPrivate qemuDomainVcpuPrivate; -typedef qemuDomainVcpuPrivate *qemuDomainVcpuPrivatePtr; struct _qemuDomainVcpuPrivate { virObject parent; @@ -333,7 +325,7 @@ struct _qemuDomainVcpuPrivate { virTristateBool halted; /* copy of the data that qemu returned */ - virJSONValuePtr props; + virJSONValue *props; /* information for hotpluggable cpus */ char *type; @@ -345,7 +337,7 @@ struct _qemuDomainVcpuPrivate { }; #define QEMU_DOMAIN_VCPU_PRIVATE(vcpu) \ - ((qemuDomainVcpuPrivatePtr) (vcpu)->privateData) + ((qemuDomainVcpuPrivate *) (vcpu)->privateData) struct qemuDomainDiskInfo { @@ -358,21 +350,19 @@ struct qemuDomainDiskInfo { }; #define QEMU_DOMAIN_CHR_SOURCE_PRIVATE(dev) \ - ((qemuDomainChrSourcePrivatePtr) (dev)->privateData) + ((qemuDomainChrSourcePrivate *) (dev)->privateData) typedef struct _qemuDomainChrSourcePrivate qemuDomainChrSourcePrivate; -typedef qemuDomainChrSourcePrivate *qemuDomainChrSourcePrivatePtr; struct _qemuDomainChrSourcePrivate { virObject parent; /* for char devices using secret * NB: *not* to be written to qemu domain object XML */ - qemuDomainSecretInfoPtr secinfo; + qemuDomainSecretInfo *secinfo; }; typedef struct _qemuDomainVsockPrivate qemuDomainVsockPrivate; -typedef qemuDomainVsockPrivate *qemuDomainVsockPrivatePtr; struct _qemuDomainVsockPrivate { virObject parent; @@ -381,10 +371,9 @@ struct _qemuDomainVsockPrivate { #define QEMU_DOMAIN_VIDEO_PRIVATE(dev) \ - ((qemuDomainVideoPrivatePtr) (dev)->privateData) + ((qemuDomainVideoPrivate *) (dev)->privateData) typedef struct _qemuDomainVideoPrivate qemuDomainVideoPrivate; -typedef qemuDomainVideoPrivate *qemuDomainVideoPrivatePtr; struct _qemuDomainVideoPrivate { virObject parent; @@ -393,35 +382,32 @@ struct _qemuDomainVideoPrivate { #define QEMU_DOMAIN_GRAPHICS_PRIVATE(dev) \ - ((qemuDomainGraphicsPrivatePtr) (dev)->privateData) + ((qemuDomainGraphicsPrivate *) (dev)->privateData) typedef struct _qemuDomainGraphicsPrivate qemuDomainGraphicsPrivate; -typedef qemuDomainGraphicsPrivate *qemuDomainGraphicsPrivatePtr; struct _qemuDomainGraphicsPrivate { virObject parent; char *tlsAlias; - qemuDomainSecretInfoPtr secinfo; + qemuDomainSecretInfo *secinfo; }; #define QEMU_DOMAIN_NETWORK_PRIVATE(dev) \ - ((qemuDomainNetworkPrivatePtr) (dev)->privateData) + ((qemuDomainNetworkPrivate *) (dev)->privateData) typedef struct _qemuDomainNetworkPrivate qemuDomainNetworkPrivate; -typedef qemuDomainNetworkPrivate *qemuDomainNetworkPrivatePtr; struct _qemuDomainNetworkPrivate { virObject parent; - qemuSlirpPtr slirp; + qemuSlirp *slirp; }; #define QEMU_DOMAIN_FS_PRIVATE(dev) \ - ((qemuDomainFSPrivatePtr) (dev)->privateData) + ((qemuDomainFSPrivate *) (dev)->privateData) typedef struct _qemuDomainFSPrivate qemuDomainFSPrivate; -typedef qemuDomainFSPrivate *qemuDomainFSPrivatePtr; struct _qemuDomainFSPrivate { virObject parent; @@ -446,7 +432,7 @@ typedef enum { } qemuProcessEventType; struct qemuProcessEvent { - virDomainObjPtr vm; + virDomainObj *vm; qemuProcessEventType eventType; int action; int status; @@ -457,21 +443,18 @@ void qemuProcessEventFree(struct qemuProcessEvent *event); #define QEMU_TYPE_DOMAIN_LOG_CONTEXT qemu_domain_log_context_get_type() G_DECLARE_FINAL_TYPE(qemuDomainLogContext, qemu_domain_log_context, QEMU, DOMAIN_LOG_CONTEXT, GObject); -typedef qemuDomainLogContext *qemuDomainLogContextPtr; typedef struct _qemuDomainSaveCookie qemuDomainSaveCookie; -typedef qemuDomainSaveCookie *qemuDomainSaveCookiePtr; struct _qemuDomainSaveCookie { virObject parent; - virCPUDefPtr cpu; + virCPUDef *cpu; bool slirpHelper; }; G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuDomainSaveCookie, virObjectUnref); typedef struct _qemuDomainXmlNsDef qemuDomainXmlNsDef; -typedef qemuDomainXmlNsDef *qemuDomainXmlNsDefPtr; struct _qemuDomainXmlNsDef { size_t num_args; char **args; @@ -494,123 +477,120 @@ struct _qemuDomainXmlNsDef { typedef struct _qemuDomainJobPrivateMigrateTempBitmap qemuDomainJobPrivateMigrateTempBitmap; -typedef qemuDomainJobPrivateMigrateTempBitmap *qemuDomainJobPrivateMigrateTempBitmapPtr; - struct _qemuDomainJobPrivateMigrateTempBitmap { char *nodename; char *bitmapname; }; void -qemuDomainJobPrivateMigrateTempBitmapFree(qemuDomainJobPrivateMigrateTempBitmapPtr bmp); +qemuDomainJobPrivateMigrateTempBitmapFree(qemuDomainJobPrivateMigrateTempBitmap *bmp); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuDomainJobPrivateMigrateTempBitmap, qemuDomainJobPrivateMigrateTempBitmapFree); typedef struct _qemuDomainJobPrivate qemuDomainJobPrivate; -typedef qemuDomainJobPrivate *qemuDomainJobPrivatePtr; struct _qemuDomainJobPrivate { bool spiceMigration; /* we asked for spice migration and we * should wait for it to finish */ bool spiceMigrated; /* spice migration completed */ bool dumpCompleted; /* dump completed */ - qemuMigrationParamsPtr migParams; + qemuMigrationParams *migParams; GSList *migTempBitmaps; /* temporary block dirty bitmaps - qemuDomainJobPrivateMigrateTempBitmap */ }; -int qemuDomainObjStartWorker(virDomainObjPtr dom); -void qemuDomainObjStopWorker(virDomainObjPtr dom); +int qemuDomainObjStartWorker(virDomainObj *dom); +void qemuDomainObjStopWorker(virDomainObj *dom); -virDomainObjPtr qemuDomainObjFromDomain(virDomainPtr domain); +virDomainObj *qemuDomainObjFromDomain(virDomainPtr domain); -qemuDomainSaveCookiePtr qemuDomainSaveCookieNew(virDomainObjPtr vm); +qemuDomainSaveCookie *qemuDomainSaveCookieNew(virDomainObj *vm); void qemuDomainEventFlush(int timer, void *opaque); -qemuMonitorPtr qemuDomainGetMonitor(virDomainObjPtr vm) +qemuMonitor *qemuDomainGetMonitor(virDomainObj *vm) ATTRIBUTE_NONNULL(1); -void qemuDomainObjEnterMonitor(virQEMUDriverPtr driver, - virDomainObjPtr obj) +void qemuDomainObjEnterMonitor(virQEMUDriver *driver, + virDomainObj *obj) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuDomainObjExitMonitor(virQEMUDriverPtr driver, - virDomainObjPtr obj) +int qemuDomainObjExitMonitor(virQEMUDriver *driver, + virDomainObj *obj) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int qemuDomainObjEnterMonitorAsync(virQEMUDriverPtr driver, - virDomainObjPtr obj, +int qemuDomainObjEnterMonitorAsync(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainAsyncJob asyncJob) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -qemuAgentPtr qemuDomainObjEnterAgent(virDomainObjPtr obj) +qemuAgent *qemuDomainObjEnterAgent(virDomainObj *obj) ATTRIBUTE_NONNULL(1); -void qemuDomainObjExitAgent(virDomainObjPtr obj, qemuAgentPtr agent) +void qemuDomainObjExitAgent(virDomainObj *obj, qemuAgent *agent) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void qemuDomainObjEnterRemote(virDomainObjPtr obj) +void qemuDomainObjEnterRemote(virDomainObj *obj) ATTRIBUTE_NONNULL(1); -int qemuDomainObjExitRemote(virDomainObjPtr obj, +int qemuDomainObjExitRemote(virDomainObj *obj, bool checkActive) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -virDomainDefPtr qemuDomainDefCopy(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virDomainDefPtr src, +virDomainDef *qemuDomainDefCopy(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virDomainDef *src, unsigned int flags); -int qemuDomainDefFormatBuf(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virDomainDefPtr vm, +int qemuDomainDefFormatBuf(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virDomainDef *vm, unsigned int flags, virBuffer *buf); -char *qemuDomainDefFormatXML(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virDomainDefPtr vm, +char *qemuDomainDefFormatXML(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virDomainDef *vm, unsigned int flags); -char *qemuDomainFormatXML(virQEMUDriverPtr driver, - virDomainObjPtr vm, +char *qemuDomainFormatXML(virQEMUDriver *driver, + virDomainObj *vm, unsigned int flags); -char *qemuDomainDefFormatLive(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virDomainDefPtr def, - virCPUDefPtr origCPU, +char *qemuDomainDefFormatLive(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virDomainDef *def, + virCPUDef *origCPU, bool inactive, bool compatible); -void qemuDomainObjTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, +void qemuDomainObjTaint(virQEMUDriver *driver, + virDomainObj *obj, virDomainTaintFlags taint, - qemuDomainLogContextPtr logCtxt); + qemuDomainLogContext *logCtxt); -void qemuDomainObjTaintMsg(virQEMUDriverPtr driver, - virDomainObjPtr obj, +void qemuDomainObjTaintMsg(virQEMUDriver *driver, + virDomainObj *obj, virDomainTaintFlags taint, - qemuDomainLogContextPtr logCtxt, + qemuDomainLogContext *logCtxt, const char *msg, ...) G_GNUC_PRINTF(5, 6); -char **qemuDomainObjGetTainting(virQEMUDriverPtr driver, - virDomainObjPtr obj); +char **qemuDomainObjGetTainting(virQEMUDriver *driver, + virDomainObj *obj); -void qemuDomainObjCheckTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - qemuDomainLogContextPtr logCtxt, +void qemuDomainObjCheckTaint(virQEMUDriver *driver, + virDomainObj *obj, + qemuDomainLogContext *logCtxt, bool incomingMigration); -void qemuDomainObjCheckDiskTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - virDomainDiskDefPtr disk, - qemuDomainLogContextPtr logCtxt); -void qemuDomainObjCheckHostdevTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - virDomainHostdevDefPtr disk, - qemuDomainLogContextPtr logCtxt); -void qemuDomainObjCheckNetTaint(virQEMUDriverPtr driver, - virDomainObjPtr obj, - virDomainNetDefPtr net, - qemuDomainLogContextPtr logCtxt); +void qemuDomainObjCheckDiskTaint(virQEMUDriver *driver, + virDomainObj *obj, + virDomainDiskDef *disk, + qemuDomainLogContext *logCtxt); +void qemuDomainObjCheckHostdevTaint(virQEMUDriver *driver, + virDomainObj *obj, + virDomainHostdevDef *disk, + qemuDomainLogContext *logCtxt); +void qemuDomainObjCheckNetTaint(virQEMUDriver *driver, + virDomainObj *obj, + virDomainNetDef *net, + qemuDomainLogContext *logCtxt); typedef enum { QEMU_DOMAIN_LOG_CONTEXT_MODE_START, @@ -618,144 +598,143 @@ typedef enum { QEMU_DOMAIN_LOG_CONTEXT_MODE_STOP, } qemuDomainLogContextMode; -qemuDomainLogContextPtr qemuDomainLogContextNew(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainLogContext *qemuDomainLogContextNew(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainLogContextMode mode); -int qemuDomainLogContextWrite(qemuDomainLogContextPtr ctxt, +int qemuDomainLogContextWrite(qemuDomainLogContext *ctxt, const char *fmt, ...) G_GNUC_PRINTF(2, 3); -ssize_t qemuDomainLogContextRead(qemuDomainLogContextPtr ctxt, +ssize_t qemuDomainLogContextRead(qemuDomainLogContext *ctxt, char **msg); -int qemuDomainLogContextGetWriteFD(qemuDomainLogContextPtr ctxt); -void qemuDomainLogContextMarkPosition(qemuDomainLogContextPtr ctxt); +int qemuDomainLogContextGetWriteFD(qemuDomainLogContext *ctxt); +void qemuDomainLogContextMarkPosition(qemuDomainLogContext *ctxt); -virLogManagerPtr qemuDomainLogContextGetManager(qemuDomainLogContextPtr ctxt); +virLogManager *qemuDomainLogContextGetManager(qemuDomainLogContext *ctxt); -int qemuDomainLogAppendMessage(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuDomainLogAppendMessage(virQEMUDriver *driver, + virDomainObj *vm, const char *fmt, ...) G_GNUC_PRINTF(3, 4); -const char *qemuFindQemuImgBinary(virQEMUDriverPtr driver); +const char *qemuFindQemuImgBinary(virQEMUDriver *driver); -int qemuDomainSnapshotWriteMetadata(virDomainObjPtr vm, - virDomainMomentObjPtr snapshot, - virDomainXMLOptionPtr xmlopt, +int qemuDomainSnapshotWriteMetadata(virDomainObj *vm, + virDomainMomentObj *snapshot, + virDomainXMLOption *xmlopt, const char *snapshotDir); -int qemuDomainSnapshotForEachQcow2(virQEMUDriverPtr driver, - virDomainDefPtr def, - virDomainMomentObjPtr snap, +int qemuDomainSnapshotForEachQcow2(virQEMUDriver *driver, + virDomainDef *def, + virDomainMomentObj *snap, const char *op, bool try_all); -int qemuDomainSnapshotDiscard(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMomentObjPtr snap, +int qemuDomainSnapshotDiscard(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMomentObj *snap, bool update_current, bool metadata_only); typedef struct _virQEMUMomentRemove virQEMUMomentRemove; -typedef virQEMUMomentRemove *virQEMUMomentRemovePtr; struct _virQEMUMomentRemove { - virQEMUDriverPtr driver; - virDomainObjPtr vm; + virQEMUDriver *driver; + virDomainObj *vm; int err; bool metadata_only; - virDomainMomentObjPtr current; + virDomainMomentObj *current; bool found; - int (*momentDiscard)(virQEMUDriverPtr, virDomainObjPtr, - virDomainMomentObjPtr, bool, bool); + int (*momentDiscard)(virQEMUDriver *, virDomainObj *, + virDomainMomentObj *, bool, bool); }; int qemuDomainMomentDiscardAll(void *payload, const char *name, void *data); -int qemuDomainSnapshotDiscardAllMetadata(virQEMUDriverPtr driver, - virDomainObjPtr vm); +int qemuDomainSnapshotDiscardAllMetadata(virQEMUDriver *driver, + virDomainObj *vm); -void qemuDomainRemoveInactive(virQEMUDriverPtr driver, - virDomainObjPtr vm); +void qemuDomainRemoveInactive(virQEMUDriver *driver, + virDomainObj *vm); -void qemuDomainSetFakeReboot(virQEMUDriverPtr driver, - virDomainObjPtr vm, +void qemuDomainSetFakeReboot(virQEMUDriver *driver, + virDomainObj *vm, bool value); -int qemuDomainCheckDiskStartupPolicy(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuDomainCheckDiskStartupPolicy(virQEMUDriver *driver, + virDomainObj *vm, size_t diskIndex, bool cold_boot); -int qemuDomainCheckDiskPresence(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuDomainCheckDiskPresence(virQEMUDriver *driver, + virDomainObj *vm, unsigned int flags); -int qemuDomainStorageSourceValidateDepth(virStorageSourcePtr src, +int qemuDomainStorageSourceValidateDepth(virStorageSource *src, int add, const char *diskdst); -int qemuDomainDetermineDiskChain(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr disksrc, +int qemuDomainDetermineDiskChain(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *disksrc, bool report_broken); -bool qemuDomainDiskChangeSupported(virDomainDiskDefPtr disk, - virDomainDiskDefPtr orig_disk); +bool qemuDomainDiskChangeSupported(virDomainDiskDef *disk, + virDomainDiskDef *orig_disk); -void qemuDomainGetImageIds(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr parentSrc, +void qemuDomainGetImageIds(virQEMUDriverConfig *cfg, + virDomainObj *vm, + virStorageSource *src, + virStorageSource *parentSrc, uid_t *uid, gid_t *gid); -int qemuDomainStorageFileInit(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr parent); +int qemuDomainStorageFileInit(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src, + virStorageSource *parent); char *qemuDomainStorageAlias(const char *device, int depth); const char * -qemuDomainDiskGetTopNodename(virDomainDiskDefPtr disk) +qemuDomainDiskGetTopNodename(virDomainDiskDef *disk) ATTRIBUTE_NONNULL(1); -int qemuDomainDiskGetBackendAlias(virDomainDiskDefPtr disk, - virQEMUCapsPtr qemuCaps, +int qemuDomainDiskGetBackendAlias(virDomainDiskDef *disk, + virQEMUCaps *qemuCaps, char **backendAlias) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; -int qemuDomainStorageSourceChainAccessAllow(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src); -int qemuDomainStorageSourceChainAccessRevoke(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src); +int qemuDomainStorageSourceChainAccessAllow(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src); +int qemuDomainStorageSourceChainAccessRevoke(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src); -void qemuDomainStorageSourceAccessRevoke(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr elem); -int qemuDomainStorageSourceAccessAllow(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr elem, +void qemuDomainStorageSourceAccessRevoke(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *elem); +int qemuDomainStorageSourceAccessAllow(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *elem, bool readonly, bool newSource, bool chainTop); -int qemuDomainPrepareStorageSourceBlockdev(virDomainDiskDefPtr disk, - virStorageSourcePtr src, - qemuDomainObjPrivatePtr priv, - virQEMUDriverConfigPtr cfg); +int qemuDomainPrepareStorageSourceBlockdev(virDomainDiskDef *disk, + virStorageSource *src, + qemuDomainObjPrivate *priv, + virQEMUDriverConfig *cfg); -int qemuDomainCleanupAdd(virDomainObjPtr vm, +int qemuDomainCleanupAdd(virDomainObj *vm, qemuDomainCleanupCallback cb); -void qemuDomainCleanupRemove(virDomainObjPtr vm, +void qemuDomainCleanupRemove(virDomainObj *vm, qemuDomainCleanupCallback cb); -void qemuDomainCleanupRun(virQEMUDriverPtr driver, - virDomainObjPtr vm); +void qemuDomainCleanupRun(virQEMUDriver *driver, + virDomainObj *vm); -void qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr priv); +void qemuDomainObjPrivateDataClear(qemuDomainObjPrivate *priv); extern virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks; extern virXMLNamespace virQEMUDriverDomainXMLNamespace; @@ -763,34 +742,34 @@ extern virDomainDefParserConfig virQEMUDriverDomainDefParserConfig; extern virDomainABIStability virQEMUDriverDomainABIStability; extern virSaveCookieCallbacks virQEMUDriverDomainSaveCookie; -int qemuDomainUpdateDeviceList(virQEMUDriverPtr driver, - virDomainObjPtr vm, int asyncJob); +int qemuDomainUpdateDeviceList(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob); -int qemuDomainUpdateMemoryDeviceInfo(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuDomainUpdateMemoryDeviceInfo(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob); -bool qemuDomainDefCheckABIStability(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virDomainDefPtr src, - virDomainDefPtr dst); +bool qemuDomainDefCheckABIStability(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virDomainDef *src, + virDomainDef *dst); -bool qemuDomainCheckABIStability(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDefPtr dst); +bool qemuDomainCheckABIStability(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDef *dst); -bool qemuDomainAgentAvailable(virDomainObjPtr vm, +bool qemuDomainAgentAvailable(virDomainObj *vm, bool reportError); -bool qemuDomainDiskBlockJobIsActive(virDomainDiskDefPtr disk); -bool qemuDomainHasBlockjob(virDomainObjPtr vm, bool copy_only) +bool qemuDomainDiskBlockJobIsActive(virDomainDiskDef *disk); +bool qemuDomainHasBlockjob(virDomainObj *vm, bool copy_only) ATTRIBUTE_NONNULL(1); -int qemuDomainAlignMemorySizes(virDomainDefPtr def); -int qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def, - virDomainMemoryDefPtr mem); +int qemuDomainAlignMemorySizes(virDomainDef *def); +int qemuDomainMemoryDeviceAlignSize(virDomainDef *def, + virDomainMemoryDef *mem); -virDomainChrDefPtr qemuFindAgentConfig(virDomainDefPtr def); +virDomainChrDef *qemuFindAgentConfig(virDomainDef *def); /* You should normally avoid these functions and use the variant that * doesn't have "Machine" in the name instead. */ @@ -812,161 +791,161 @@ bool qemuDomainHasPCIeRoot(const virDomainDef *def); bool qemuDomainHasBuiltinIDE(const virDomainDef *def); bool qemuDomainHasBuiltinESP(const virDomainDef *def); bool qemuDomainNeedsFDC(const virDomainDef *def); -bool qemuDomainSupportsPCI(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps); +bool qemuDomainSupportsPCI(virDomainDef *def, + virQEMUCaps *qemuCaps); -void qemuDomainUpdateCurrentMemorySize(virDomainObjPtr vm); +void qemuDomainUpdateCurrentMemorySize(virDomainObj *vm); -unsigned long long qemuDomainGetMemLockLimitBytes(virDomainDefPtr def, +unsigned long long qemuDomainGetMemLockLimitBytes(virDomainDef *def, bool forceVFIO); -int qemuDomainAdjustMaxMemLock(virDomainObjPtr vm, +int qemuDomainAdjustMaxMemLock(virDomainObj *vm, bool forceVFIO); -int qemuDomainAdjustMaxMemLockHostdev(virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev); +int qemuDomainAdjustMaxMemLockHostdev(virDomainObj *vm, + virDomainHostdevDef *hostdev); int qemuDomainDefValidateMemoryHotplug(const virDomainDef *def, const virDomainMemoryDef *mem); -bool qemuDomainSupportsNewVcpuHotplug(virDomainObjPtr vm); -bool qemuDomainHasVcpuPids(virDomainObjPtr vm); -pid_t qemuDomainGetVcpuPid(virDomainObjPtr vm, unsigned int vcpuid); -int qemuDomainValidateVcpuInfo(virDomainObjPtr vm); -int qemuDomainRefreshVcpuInfo(virQEMUDriverPtr driver, - virDomainObjPtr vm, +bool qemuDomainSupportsNewVcpuHotplug(virDomainObj *vm); +bool qemuDomainHasVcpuPids(virDomainObj *vm); +pid_t qemuDomainGetVcpuPid(virDomainObj *vm, unsigned int vcpuid); +int qemuDomainValidateVcpuInfo(virDomainObj *vm); +int qemuDomainRefreshVcpuInfo(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob, bool state); -bool qemuDomainGetVcpuHalted(virDomainObjPtr vm, unsigned int vcpu); -int qemuDomainRefreshVcpuHalted(virQEMUDriverPtr driver, - virDomainObjPtr vm, +bool qemuDomainGetVcpuHalted(virDomainObj *vm, unsigned int vcpu); +int qemuDomainRefreshVcpuHalted(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob); -bool qemuDomainSupportsNicdev(virDomainDefPtr def, - virDomainNetDefPtr net); +bool qemuDomainSupportsNicdev(virDomainDef *def, + virDomainNetDef *net); bool qemuDomainNetSupportsMTU(virDomainNetType type); -int qemuDomainSetPrivatePaths(virQEMUDriverPtr driver, - virDomainObjPtr vm); +int qemuDomainSetPrivatePaths(virQEMUDriver *driver, + virDomainObj *vm); -virDomainDiskDefPtr qemuDomainDiskByName(virDomainDefPtr def, const char *name); +virDomainDiskDef *qemuDomainDiskByName(virDomainDef *def, const char *name); char *qemuDomainGetMasterKeyFilePath(const char *libDir); -int qemuDomainMasterKeyReadFile(qemuDomainObjPrivatePtr priv); +int qemuDomainMasterKeyReadFile(qemuDomainObjPrivate *priv); -int qemuDomainWriteMasterKeyFile(virQEMUDriverPtr driver, - virDomainObjPtr vm); +int qemuDomainWriteMasterKeyFile(virQEMUDriver *driver, + virDomainObj *vm); -int qemuDomainMasterKeyCreate(virDomainObjPtr vm); +int qemuDomainMasterKeyCreate(virDomainObj *vm); -void qemuDomainMasterKeyRemove(qemuDomainObjPrivatePtr priv); +void qemuDomainMasterKeyRemove(qemuDomainObjPrivate *priv); -bool qemuDomainSupportsEncryptedSecret(qemuDomainObjPrivatePtr priv); +bool qemuDomainSupportsEncryptedSecret(qemuDomainObjPrivate *priv); -void qemuDomainSecretInfoFree(qemuDomainSecretInfoPtr secinfo) +void qemuDomainSecretInfoFree(qemuDomainSecretInfo *secinfo) ATTRIBUTE_NONNULL(1); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuDomainSecretInfo, qemuDomainSecretInfoFree); -void qemuDomainSecretInfoDestroy(qemuDomainSecretInfoPtr secinfo); +void qemuDomainSecretInfoDestroy(qemuDomainSecretInfo *secinfo); -void qemuDomainSecretDiskDestroy(virDomainDiskDefPtr disk) +void qemuDomainSecretDiskDestroy(virDomainDiskDef *disk) ATTRIBUTE_NONNULL(1); -bool qemuDomainStorageSourceHasAuth(virStorageSourcePtr src) +bool qemuDomainStorageSourceHasAuth(virStorageSource *src) ATTRIBUTE_NONNULL(1); -qemuDomainSecretInfoPtr -qemuDomainSecretInfoTLSNew(qemuDomainObjPrivatePtr priv, +qemuDomainSecretInfo * +qemuDomainSecretInfoTLSNew(qemuDomainObjPrivate *priv, const char *srcAlias, const char *secretUUID); -void qemuDomainSecretHostdevDestroy(virDomainHostdevDefPtr disk) +void qemuDomainSecretHostdevDestroy(virDomainHostdevDef *disk) ATTRIBUTE_NONNULL(1); -void qemuDomainSecretChardevDestroy(virDomainChrSourceDefPtr dev) +void qemuDomainSecretChardevDestroy(virDomainChrSourceDef *dev) ATTRIBUTE_NONNULL(1); -int qemuDomainSecretChardevPrepare(virQEMUDriverConfigPtr cfg, - qemuDomainObjPrivatePtr priv, +int qemuDomainSecretChardevPrepare(virQEMUDriverConfig *cfg, + qemuDomainObjPrivate *priv, const char *chrAlias, - virDomainChrSourceDefPtr dev) + virDomainChrSourceDef *dev) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -void qemuDomainSecretDestroy(virDomainObjPtr vm) +void qemuDomainSecretDestroy(virDomainObj *vm) ATTRIBUTE_NONNULL(1); -int qemuDomainSecretPrepare(virQEMUDriverPtr driver, - virDomainObjPtr vm) +int qemuDomainSecretPrepare(virQEMUDriver *driver, + virDomainObj *vm) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int qemuDomainDefValidateDiskLunSource(const virStorageSource *src) ATTRIBUTE_NONNULL(1); int qemuDomainDeviceDefValidateDisk(const virDomainDiskDef *disk, - virQEMUCapsPtr qemuCaps); + virQEMUCaps *qemuCaps); -int qemuDomainPrepareChannel(virDomainChrDefPtr chr, +int qemuDomainPrepareChannel(virDomainChrDef *chr, const char *domainChannelTargetDir) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void qemuDomainPrepareChardevSourceTLS(virDomainChrSourceDefPtr source, - virQEMUDriverConfigPtr cfg) +void qemuDomainPrepareChardevSourceTLS(virDomainChrSourceDef *source, + virQEMUDriverConfig *cfg) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void qemuDomainPrepareChardevSource(virDomainDefPtr def, - virQEMUDriverConfigPtr cfg) +void qemuDomainPrepareChardevSource(virDomainDef *def, + virQEMUDriverConfig *cfg) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void qemuDomainPrepareShmemChardev(virDomainShmemDefPtr shmem) +void qemuDomainPrepareShmemChardev(virDomainShmemDef *shmem) ATTRIBUTE_NONNULL(1); -bool qemuDomainVcpuHotplugIsInOrder(virDomainDefPtr def) +bool qemuDomainVcpuHotplugIsInOrder(virDomainDef *def) ATTRIBUTE_NONNULL(1); -void qemuDomainVcpuPersistOrder(virDomainDefPtr def) +void qemuDomainVcpuPersistOrder(virDomainDef *def) ATTRIBUTE_NONNULL(1); -int qemuDomainCheckMonitor(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuDomainCheckMonitor(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob); -bool qemuDomainSupportsVideoVga(virDomainVideoDefPtr video, - virQEMUCapsPtr qemuCaps); +bool qemuDomainSupportsVideoVga(virDomainVideoDef *video, + virQEMUCaps *qemuCaps); bool qemuDomainNeedsVFIO(const virDomainDef *def); -int qemuDomainGetHostdevPath(virDomainHostdevDefPtr dev, +int qemuDomainGetHostdevPath(virDomainHostdevDef *dev, char **path, int *perms); -virDomainDiskDefPtr qemuDomainDiskLookupByNodename(virDomainDefPtr def, - virDomainBackupDefPtr backupdef, +virDomainDiskDef *qemuDomainDiskLookupByNodename(virDomainDef *def, + virDomainBackupDef *backupdef, const char *nodename, - virStorageSourcePtr *src); + virStorageSource **src); -char *qemuDomainDiskBackingStoreGetName(virDomainDiskDefPtr disk, +char *qemuDomainDiskBackingStoreGetName(virDomainDiskDef *disk, unsigned int idx); -virStorageSourcePtr qemuDomainGetStorageSourceByDevstr(const char *devstr, - virDomainDefPtr def, - virDomainBackupDefPtr backupdef); +virStorageSource *qemuDomainGetStorageSourceByDevstr(const char *devstr, + virDomainDef *def, + virDomainBackupDef *backupdef); int -qemuDomainUpdateCPU(virDomainObjPtr vm, - virCPUDefPtr cpu, - virCPUDefPtr *origCPU); +qemuDomainUpdateCPU(virDomainObj *vm, + virCPUDef *cpu, + virCPUDef **origCPU); int -qemuDomainFixupCPUs(virDomainObjPtr vm, - virCPUDefPtr *origCPU); +qemuDomainFixupCPUs(virDomainObj *vm, + virCPUDef **origCPU); char * -qemuDomainGetMachineName(virDomainObjPtr vm); +qemuDomainGetMachineName(virDomainObj *vm); void -qemuDomainObjPrivateXMLFormatAllowReboot(virBufferPtr buf, +qemuDomainObjPrivateXMLFormatAllowReboot(virBuffer *buf, virTristateBool allowReboot); int @@ -976,24 +955,24 @@ qemuDomainObjPrivateXMLParseAllowReboot(xmlXPathContextPtr ctxt, bool qemuDomainCheckCCWS390AddressSupport(const virDomainDef *def, const virDomainDeviceInfo *info, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, const char *devicename); void -qemuDomainPrepareDiskSourceData(virDomainDiskDefPtr disk, - virStorageSourcePtr src); +qemuDomainPrepareDiskSourceData(virDomainDiskDef *disk, + virStorageSource *src); int -qemuDomainValidateStorageSource(virStorageSourcePtr src, - virQEMUCapsPtr qemuCaps, +qemuDomainValidateStorageSource(virStorageSource *src, + virQEMUCaps *qemuCaps, bool maskBlockdev); int -qemuDomainPrepareDiskSource(virDomainDiskDefPtr disk, - qemuDomainObjPrivatePtr priv, - virQEMUDriverConfigPtr cfg); +qemuDomainPrepareDiskSource(virDomainDiskDef *disk, + qemuDomainObjPrivate *priv, + virQEMUDriverConfig *cfg); int qemuDomainDiskCachemodeFlags(int cachemode, @@ -1002,64 +981,64 @@ qemuDomainDiskCachemodeFlags(int cachemode, bool *noflush); int -qemuDomainPrepareHostdev(virDomainHostdevDefPtr hostdev, - qemuDomainObjPrivatePtr priv); +qemuDomainPrepareHostdev(virDomainHostdevDef *hostdev, + qemuDomainObjPrivate *priv); -char * qemuDomainGetManagedPRSocketPath(qemuDomainObjPrivatePtr priv); +char * qemuDomainGetManagedPRSocketPath(qemuDomainObjPrivate *priv); -bool qemuDomainDefHasManagedPR(virDomainObjPtr vm); +bool qemuDomainDefHasManagedPR(virDomainObj *vm); -unsigned int qemuDomainStorageIdNew(qemuDomainObjPrivatePtr priv); -void qemuDomainStorageIdReset(qemuDomainObjPrivatePtr priv); +unsigned int qemuDomainStorageIdNew(qemuDomainObjPrivate *priv); +void qemuDomainStorageIdReset(qemuDomainObjPrivate *priv); virDomainEventResumedDetailType qemuDomainRunningReasonToResumeEvent(virDomainRunningReason reason); bool -qemuDomainIsUsingNoShutdown(qemuDomainObjPrivatePtr priv); +qemuDomainIsUsingNoShutdown(qemuDomainObjPrivate *priv); bool -qemuDomainDiskIsMissingLocalOptional(virDomainDiskDefPtr disk); +qemuDomainDiskIsMissingLocalOptional(virDomainDiskDef *disk); void -qemuDomainNVRAMPathFormat(virQEMUDriverConfigPtr cfg, - virDomainDefPtr def, +qemuDomainNVRAMPathFormat(virQEMUDriverConfig *cfg, + virDomainDef *def, char **path); void -qemuDomainNVRAMPathGenerate(virQEMUDriverConfigPtr cfg, - virDomainDefPtr def); +qemuDomainNVRAMPathGenerate(virQEMUDriverConfig *cfg, + virDomainDef *def); virDomainEventSuspendedDetailType qemuDomainPausedReasonToSuspendedEvent(virDomainPausedReason reason); int qemuDomainValidateActualNetDef(const virDomainNetDef *net, - virQEMUCapsPtr qemuCaps); + virQEMUCaps *qemuCaps); int -qemuDomainSupportsCheckpointsBlockjobs(virDomainObjPtr vm) +qemuDomainSupportsCheckpointsBlockjobs(virDomainObj *vm) G_GNUC_WARN_UNUSED_RESULT; int -qemuDomainMakeCPUMigratable(virCPUDefPtr cpu); +qemuDomainMakeCPUMigratable(virCPUDef *cpu); int -qemuDomainInitializePflashStorageSource(virDomainObjPtr vm); +qemuDomainInitializePflashStorageSource(virDomainObj *vm); bool -qemuDomainDiskBlockJobIsSupported(virDomainObjPtr vm, - virDomainDiskDefPtr disk); +qemuDomainDiskBlockJobIsSupported(virDomainObj *vm, + virDomainDiskDef *disk); int -qemuDomainDefNumaCPUsRectify(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps); +qemuDomainDefNumaCPUsRectify(virDomainDef *def, + virQEMUCaps *qemuCaps); -void qemuDomainRemoveInactiveJob(virQEMUDriverPtr driver, - virDomainObjPtr vm); +void qemuDomainRemoveInactiveJob(virQEMUDriver *driver, + virDomainObj *vm); -void qemuDomainRemoveInactiveJobLocked(virQEMUDriverPtr driver, - virDomainObjPtr vm); +void qemuDomainRemoveInactiveJobLocked(virQEMUDriver *driver, + virDomainObj *vm); int virQEMUFileOpenAs(uid_t fallback_uid, gid_t fallback_gid, @@ -1069,21 +1048,21 @@ int virQEMUFileOpenAs(uid_t fallback_uid, bool *needUnlink); int -qemuDomainOpenFile(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainOpenFile(virQEMUDriver *driver, + virDomainObj *vm, const char *path, int oflags, bool *needUnlink); int -qemuDomainFileWrapperFDClose(virDomainObjPtr vm, - virFileWrapperFdPtr fd); +qemuDomainFileWrapperFDClose(virDomainObj *vm, + virFileWrapperFd *fd); int -qemuDomainInterfaceSetDefaultQDisc(virQEMUDriverPtr driver, - virDomainNetDefPtr net); +qemuDomainInterfaceSetDefaultQDisc(virQEMUDriver *driver, + virDomainNetDef *net); int -qemuDomainNamePathsCleanup(virQEMUDriverConfigPtr cfg, +qemuDomainNamePathsCleanup(virQEMUDriverConfig *cfg, const char *name, bool bestEffort); diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c index 0dbf203cd0..8adef60675 100644 --- a/src/qemu/qemu_domain_address.c +++ b/src/qemu/qemu_domain_address.c @@ -51,7 +51,7 @@ VIR_LOG_INIT("qemu.qemu_domain_address"); int qemuDomainGetSCSIControllerModel(const virDomainDef *def, const virDomainControllerDef *cont, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (cont->model > 0) return cont->model; @@ -86,8 +86,8 @@ qemuDomainGetSCSIControllerModel(const virDomainDef *def, */ int qemuDomainSetSCSIControllerModel(const virDomainDef *def, - virDomainControllerDefPtr cont, - virQEMUCapsPtr qemuCaps) + virDomainControllerDef *cont, + virQEMUCaps *qemuCaps) { int model = qemuDomainGetSCSIControllerModel(def, cont, qemuCaps); @@ -110,9 +110,9 @@ qemuDomainSetSCSIControllerModel(const virDomainDef *def, */ int qemuDomainFindSCSIControllerModel(const virDomainDef *def, - virDomainDeviceInfoPtr info) + virDomainDeviceInfo *info) { - virDomainControllerDefPtr cont; + virDomainControllerDef *cont; if (!(cont = virDomainDeviceFindSCSIController(def, &info->addr.drive))) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -126,11 +126,11 @@ qemuDomainFindSCSIControllerModel(const virDomainDef *def, static int -qemuDomainAssignVirtioSerialAddresses(virDomainDefPtr def) +qemuDomainAssignVirtioSerialAddresses(virDomainDef *def) { int ret = -1; size_t i; - virDomainVirtioSerialAddrSetPtr addrs = NULL; + virDomainVirtioSerialAddrSet *addrs = NULL; if (!(addrs = virDomainVirtioSerialAddrSetCreateFromDomain(def))) goto cleanup; @@ -138,7 +138,7 @@ qemuDomainAssignVirtioSerialAddresses(virDomainDefPtr def) VIR_DEBUG("Finished reserving existing ports"); for (i = 0; i < def->nconsoles; i++) { - virDomainChrDefPtr chr = def->consoles[i]; + virDomainChrDef *chr = def->consoles[i]; if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_VIRTIO && !virDomainVirtioSerialAddrIsComplete(&chr->info) && @@ -148,7 +148,7 @@ qemuDomainAssignVirtioSerialAddresses(virDomainDefPtr def) } for (i = 0; i < def->nchannels; i++) { - virDomainChrDefPtr chr = def->channels[i]; + virDomainChrDef *chr = def->channels[i]; if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL && chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO && !virDomainVirtioSerialAddrIsComplete(&chr->info) && @@ -166,11 +166,11 @@ qemuDomainAssignVirtioSerialAddresses(virDomainDefPtr def) static int -qemuDomainSpaprVIOFindByReg(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr device G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, void *opaque) +qemuDomainSpaprVIOFindByReg(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *device G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *opaque) { - virDomainDeviceInfoPtr target = opaque; + virDomainDeviceInfo *target = opaque; if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO) return 0; @@ -186,8 +186,8 @@ qemuDomainSpaprVIOFindByReg(virDomainDefPtr def G_GNUC_UNUSED, static int -qemuDomainAssignSpaprVIOAddress(virDomainDefPtr def, - virDomainDeviceInfoPtr info, +qemuDomainAssignSpaprVIOAddress(virDomainDef *def, + virDomainDeviceInfo *info, unsigned long long default_reg) { bool user_reg; @@ -223,14 +223,14 @@ qemuDomainAssignSpaprVIOAddress(virDomainDefPtr def, static int -qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def) +qemuDomainAssignSpaprVIOAddresses(virDomainDef *def) { size_t i; /* Default values match QEMU. See spapr_(llan|vscsi|vty).c */ for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; if (net->model == VIR_DOMAIN_NET_MODEL_SPAPR_VLAN) net->info.type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO; @@ -240,7 +240,7 @@ qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def) } for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; if (cont->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_IBMVSCSI && cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) { @@ -271,7 +271,7 @@ qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def) } for (i = 0; i < def->ntpms; i++) { - virDomainTPMDefPtr tpm = def->tpms[i]; + virDomainTPMDef *tpm = def->tpms[i]; if (tpm->model != VIR_DOMAIN_TPM_MODEL_SPAPR_PROXY && qemuDomainIsPSeries(def)) @@ -288,13 +288,13 @@ qemuDomainAssignSpaprVIOAddresses(virDomainDefPtr def) static void -qemuDomainPrimeVfioDeviceAddresses(virDomainDefPtr def, +qemuDomainPrimeVfioDeviceAddresses(virDomainDef *def, virDomainDeviceAddressType type) { size_t i; for (i = 0; i < def->nhostdevs; i++) { - virDomainHostdevSubsysPtr subsys = &def->hostdevs[i]->source.subsys; + virDomainHostdevSubsys *subsys = &def->hostdevs[i]->source.subsys; if (virHostdevIsMdevDevice(def->hostdevs[i]) && subsys->u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_CCW && @@ -309,7 +309,7 @@ qemuDomainPrimeVfioDeviceAddresses(virDomainDefPtr def, static void -qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def, +qemuDomainPrimeVirtioDeviceAddresses(virDomainDef *def, virDomainDeviceAddressType type) { /* @@ -328,7 +328,7 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def, } for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; if (virDomainNetIsVirtioModel(net) && net->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE) { @@ -337,7 +337,7 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def, } for (i = 0; i < def->nvideos; i++) { - virDomainVideoDefPtr video = def->videos[i]; + virDomainVideoDef *video = def->videos[i]; if (video->info.type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE && video->type == VIR_DOMAIN_VIDEO_TYPE_VIRTIO) @@ -351,7 +351,7 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def, } for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; if ((cont->type == VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL || cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI) && @@ -405,11 +405,11 @@ qemuDomainPrimeVirtioDeviceAddresses(virDomainDefPtr def, * 3. Assign defaults to the rest */ static int -qemuDomainAssignS390Addresses(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuDomainAssignS390Addresses(virDomainDef *def, + virQEMUCaps *qemuCaps) { int ret = -1; - virDomainCCWAddressSetPtr addrs = NULL; + virDomainCCWAddressSet *addrs = NULL; if (qemuDomainIsS390CCW(def) && virQEMUCapsGet(qemuCaps, QEMU_CAPS_CCW)) { @@ -436,9 +436,9 @@ qemuDomainAssignS390Addresses(virDomainDefPtr def, static int -qemuDomainHasVirtioMMIODevicesCallback(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr dev G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +qemuDomainHasVirtioMMIODevicesCallback(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *dev G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *opaque) { if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO) { @@ -461,7 +461,7 @@ qemuDomainHasVirtioMMIODevicesCallback(virDomainDefPtr def G_GNUC_UNUSED, * Returns: true if there are any, false otherwise */ static bool -qemuDomainHasVirtioMMIODevices(virDomainDefPtr def) +qemuDomainHasVirtioMMIODevices(virDomainDef *def) { bool result = false; @@ -474,8 +474,8 @@ qemuDomainHasVirtioMMIODevices(virDomainDefPtr def) static void -qemuDomainAssignVirtioMMIOAddresses(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuDomainAssignVirtioMMIOAddresses(virDomainDef *def, + virQEMUCaps *qemuCaps) { if (def->os.arch != VIR_ARCH_ARMV6L && def->os.arch != VIR_ARCH_ARMV7L && @@ -508,7 +508,7 @@ qemuDomainAssignVirtioMMIOAddresses(virDomainDefPtr def, static bool -qemuDomainDeviceSupportZPCI(virDomainDeviceDefPtr device) +qemuDomainDeviceSupportZPCI(virDomainDeviceDef *device) { switch ((virDomainDeviceType)device->type) { case VIR_DOMAIN_DEVICE_CHR: @@ -552,8 +552,8 @@ qemuDomainDeviceSupportZPCI(virDomainDeviceDefPtr device) static virPCIDeviceAddressExtensionFlags -qemuDomainDeviceCalculatePCIAddressExtensionFlags(virQEMUCapsPtr qemuCaps, - virDomainDeviceDefPtr dev) +qemuDomainDeviceCalculatePCIAddressExtensionFlags(virQEMUCaps *qemuCaps, + virDomainDeviceDef *dev) { virPCIDeviceAddressExtensionFlags extFlags = 0; @@ -584,7 +584,7 @@ qemuDomainDeviceCalculatePCIAddressExtensionFlags(virQEMUCapsPtr qemuCaps, * is no failure. */ static virDomainPCIConnectFlags -qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, +qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDef *dev, virDomainPCIConnectFlags pcieFlags, virDomainPCIConnectFlags virtioFlags) { @@ -593,7 +593,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, switch ((virDomainDeviceType)dev->type) { case VIR_DOMAIN_DEVICE_CONTROLLER: { - virDomainControllerDefPtr cont = dev->data.controller; + virDomainControllerDef *cont = dev->data.controller; switch ((virDomainControllerType)cont->type) { case VIR_DOMAIN_CONTROLLER_TYPE_PCI: @@ -726,7 +726,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, return 0; case VIR_DOMAIN_DEVICE_NET: { - virDomainNetDefPtr net = dev->data.net; + virDomainNetDef *net = dev->data.net; /* NB: a type='hostdev' will use PCI, but its * address is assigned when we're assigning the @@ -806,9 +806,9 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, break; case VIR_DOMAIN_DEVICE_HOSTDEV: { - virDomainHostdevDefPtr hostdev = dev->data.hostdev; + virDomainHostdevDef *hostdev = dev->data.hostdev; g_autoptr(virPCIDevice) pciDev = NULL; - virPCIDeviceAddressPtr hostAddr = &hostdev->source.subsys.u.pci.addr; + virPCIDeviceAddress *hostAddr = &hostdev->source.subsys.u.pci.addr; if (!virHostdevIsMdevDevice(hostdev) && (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS || @@ -1050,7 +1050,7 @@ qemuDomainDeviceCalculatePCIConnectFlags(virDomainDeviceDefPtr dev, typedef struct { virDomainPCIConnectFlags virtioFlags; virDomainPCIConnectFlags pcieFlags; - virQEMUDriverPtr driver; + virQEMUDriver *driver; } qemuDomainFillDevicePCIConnectFlagsIterData; @@ -1061,9 +1061,9 @@ typedef struct { * qemuDomainCalculateDevicePCIConnectFlags(). */ static void -qemuDomainFillDevicePCIConnectFlagsIterInit(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, - virQEMUDriverPtr driver, +qemuDomainFillDevicePCIConnectFlagsIterInit(virDomainDef *def, + virQEMUCaps *qemuCaps, + virQEMUDriver *driver, qemuDomainFillDevicePCIConnectFlagsIterData *data) { data->driver = driver; @@ -1099,9 +1099,9 @@ qemuDomainFillDevicePCIConnectFlagsIterInit(virDomainDefPtr def, * Always returns 0 - there is no failure. */ static int -qemuDomainFillDevicePCIConnectFlagsIter(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr dev, - virDomainDeviceInfoPtr info, +qemuDomainFillDevicePCIConnectFlagsIter(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *dev, + virDomainDeviceInfo *info, void *opaque) { qemuDomainFillDevicePCIConnectFlagsIterData *data = opaque; @@ -1127,9 +1127,9 @@ qemuDomainFillDevicePCIConnectFlagsIter(virDomainDefPtr def G_GNUC_UNUSED, * virDomainDeviceInfoIterate()) */ static int -qemuDomainFillAllPCIConnectFlags(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, - virQEMUDriverPtr driver) +qemuDomainFillAllPCIConnectFlags(virDomainDef *def, + virQEMUCaps *qemuCaps, + virQEMUDriver *driver) { qemuDomainFillDevicePCIConnectFlagsIterData data; @@ -1155,12 +1155,12 @@ qemuDomainFillAllPCIConnectFlags(virDomainDefPtr def, * Always returns 0 - there is no failure. */ static int -qemuDomainFillDevicePCIExtensionFlagsIter(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr dev, - virDomainDeviceInfoPtr info, +qemuDomainFillDevicePCIExtensionFlagsIter(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *dev, + virDomainDeviceInfo *info, void *opaque) { - virQEMUCapsPtr qemuCaps = opaque; + virQEMUCaps *qemuCaps = opaque; info->pciAddrExtFlags = qemuDomainDeviceCalculatePCIAddressExtensionFlags(qemuCaps, dev); @@ -1182,8 +1182,8 @@ qemuDomainFillDevicePCIExtensionFlagsIter(virDomainDefPtr def G_GNUC_UNUSED, * virDomainDeviceInfoIterate()) */ static int -qemuDomainFillAllPCIExtensionFlags(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuDomainFillAllPCIExtensionFlags(virDomainDef *def, + virQEMUCaps *qemuCaps) { return virDomainDeviceInfoIterate(def, qemuDomainFillDevicePCIExtensionFlagsIter, @@ -1204,9 +1204,9 @@ qemuDomainFillAllPCIExtensionFlags(virDomainDefPtr def, * Return: 0 if the isolation group is not used by the device, <1 otherwise. */ static int -qemuDomainFindUnusedIsolationGroupIter(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr dev G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +qemuDomainFindUnusedIsolationGroupIter(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *dev G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *opaque) { unsigned int *isolationGroup = opaque; @@ -1235,7 +1235,7 @@ qemuDomainFindUnusedIsolationGroupIter(virDomainDefPtr def G_GNUC_UNUSED, * Return: unused isolation group */ static unsigned int -qemuDomainFindUnusedIsolationGroup(virDomainDefPtr def) +qemuDomainFindUnusedIsolationGroup(virDomainDef *def) { unsigned int isolationGroup = UINT_MAX; @@ -1262,8 +1262,8 @@ qemuDomainFindUnusedIsolationGroup(virDomainDefPtr def) * Fill isolation group information for a single device. */ void -qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, - virDomainDeviceDefPtr dev) +qemuDomainFillDeviceIsolationGroup(virDomainDef *def, + virDomainDeviceDef *dev) { /* Only host devices need their isolation group to be different from * the default. Interfaces of type hostdev are just host devices in @@ -1271,9 +1271,9 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, * each such interface a corresponding hostdev is also added to the * guest configuration */ if (dev->type == VIR_DOMAIN_DEVICE_HOSTDEV) { - virDomainHostdevDefPtr hostdev = dev->data.hostdev; - virDomainDeviceInfoPtr info = hostdev->info; - virPCIDeviceAddressPtr hostAddr; + virDomainHostdevDef *hostdev = dev->data.hostdev; + virDomainDeviceInfo *info = hostdev->info; + virPCIDeviceAddress *hostAddr; int tmp; /* Only PCI host devices are subject to isolation */ @@ -1313,8 +1313,8 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, info->isolationGroup); } else if (dev->type == VIR_DOMAIN_DEVICE_NET) { - virDomainNetDefPtr iface = dev->data.net; - virDomainDeviceInfoPtr info = &iface->info; + virDomainNetDef *iface = dev->data.net; + virDomainDeviceInfo *info = &iface->info; unsigned int tmp; /* Network interfaces can ultimately result in the guest being @@ -1366,9 +1366,9 @@ qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, * Return: 0 on success, <0 on failure */ static int -qemuDomainFillDeviceIsolationGroupIter(virDomainDefPtr def, - virDomainDeviceDefPtr dev, - virDomainDeviceInfoPtr info G_GNUC_UNUSED, +qemuDomainFillDeviceIsolationGroupIter(virDomainDef *def, + virDomainDeviceDef *dev, + virDomainDeviceInfo *info G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { qemuDomainFillDeviceIsolationGroup(def, dev); @@ -1390,7 +1390,7 @@ qemuDomainFillDeviceIsolationGroupIter(virDomainDefPtr def, * Return: 0 on success, <0 on failure */ static int -qemuDomainSetupIsolationGroups(virDomainDefPtr def) +qemuDomainSetupIsolationGroups(virDomainDef *def) { int idx; @@ -1429,12 +1429,12 @@ qemuDomainSetupIsolationGroups(virDomainDefPtr def) * No return value. */ static void -qemuDomainFillDevicePCIConnectFlags(virDomainDefPtr def, - virDomainDeviceDefPtr dev, - virQEMUCapsPtr qemuCaps, - virQEMUDriverPtr driver) +qemuDomainFillDevicePCIConnectFlags(virDomainDef *def, + virDomainDeviceDef *dev, + virQEMUCaps *qemuCaps, + virQEMUDriver *driver) { - virDomainDeviceInfoPtr info = virDomainDeviceGetInfo(dev); + virDomainDeviceInfo *info = virDomainDeviceGetInfo(dev); if (info) { /* qemuDomainDeviceCalculatePCIConnectFlags() is called with @@ -1470,9 +1470,9 @@ qemuDomainFillDevicePCIConnectFlags(virDomainDefPtr def, * No return value. */ static void -qemuDomainFillDevicePCIExtensionFlags(virDomainDeviceDefPtr dev, - virDomainDeviceInfoPtr info, - virQEMUCapsPtr qemuCaps) +qemuDomainFillDevicePCIExtensionFlags(virDomainDeviceDef *dev, + virDomainDeviceInfo *info, + virQEMUCaps *qemuCaps) { info->pciAddrExtFlags = qemuDomainDeviceCalculatePCIAddressExtensionFlags(qemuCaps, dev); @@ -1480,8 +1480,8 @@ qemuDomainFillDevicePCIExtensionFlags(virDomainDeviceDefPtr dev, static int -qemuDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, - virDomainDeviceInfoPtr dev) +qemuDomainPCIAddressReserveNextAddr(virDomainPCIAddressSet *addrs, + virDomainDeviceInfo *dev) { return virDomainPCIAddressReserveNextAddr(addrs, dev, dev->pciConnectFlags, -1); @@ -1489,13 +1489,13 @@ qemuDomainPCIAddressReserveNextAddr(virDomainPCIAddressSetPtr addrs, static int -qemuDomainAssignPCIAddressExtension(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr device G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +qemuDomainAssignPCIAddressExtension(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *device G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *opaque) { - virDomainPCIAddressSetPtr addrs = opaque; - virPCIDeviceAddressPtr addr = &info->addr.pci; + virDomainPCIAddressSet *addrs = opaque; + virPCIDeviceAddress *addr = &info->addr.pci; if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) addr->extFlags = info->pciAddrExtFlags; @@ -1507,13 +1507,13 @@ qemuDomainAssignPCIAddressExtension(virDomainDefPtr def G_GNUC_UNUSED, } static int -qemuDomainCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr device, - virDomainDeviceInfoPtr info, +qemuDomainCollectPCIAddress(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *device, + virDomainDeviceInfo *info, void *opaque) { - virDomainPCIAddressSetPtr addrs = opaque; - virPCIDeviceAddressPtr addr = &info->addr.pci; + virDomainPCIAddressSet *addrs = opaque; + virPCIDeviceAddress *addr = &info->addr.pci; if (!virDeviceInfoPCIAddressIsPresent(info) || ((device->type == VIR_DOMAIN_DEVICE_HOSTDEV) && @@ -1560,7 +1560,7 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, */ if (device->type == VIR_DOMAIN_DEVICE_CONTROLLER && addr->domain == 0 && addr->bus == 0 && addr->slot == 1) { - virDomainControllerDefPtr cont = device->data.controller; + virDomainControllerDef *cont = device->data.controller; if ((cont->type == VIR_DOMAIN_CONTROLLER_TYPE_IDE && cont->idx == 0 && addr->function == 1) || @@ -1596,13 +1596,13 @@ qemuDomainCollectPCIAddress(virDomainDefPtr def G_GNUC_UNUSED, } static int -qemuDomainCollectPCIAddressExtension(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr device, - virDomainDeviceInfoPtr info, +qemuDomainCollectPCIAddressExtension(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *device, + virDomainDeviceInfo *info, void *opaque) { - virDomainPCIAddressSetPtr addrs = opaque; - virPCIDeviceAddressPtr addr = &info->addr.pci; + virDomainPCIAddressSet *addrs = opaque; + virPCIDeviceAddress *addr = &info->addr.pci; if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) addr->extFlags = info->pciAddrExtFlags; @@ -1620,13 +1620,13 @@ qemuDomainCollectPCIAddressExtension(virDomainDefPtr def G_GNUC_UNUSED, return virDomainPCIAddressExtensionReserveAddr(addrs, addr); } -static virDomainPCIAddressSetPtr -qemuDomainPCIAddressSetCreate(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, +static virDomainPCIAddressSet * +qemuDomainPCIAddressSetCreate(virDomainDef *def, + virQEMUCaps *qemuCaps, unsigned int nbuses, bool dryRun) { - virDomainPCIAddressSetPtr addrs; + virDomainPCIAddressSet *addrs; size_t i; bool hasPCIeRoot = false; virDomainControllerModelPCI defaultModel; @@ -1648,7 +1648,7 @@ qemuDomainPCIAddressSetCreate(virDomainDefPtr def, addrs->isPCIeToPCIBridgeSupported = true; for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; size_t idx = cont->idx; bool allowHotplug = false; @@ -1730,9 +1730,9 @@ qemuDomainPCIAddressSetCreate(virDomainDefPtr def, static int -qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, - virDomainPCIAddressSetPtr addrs) +qemuDomainValidateDevicePCISlotsPIIX3(virDomainDef *def, + virQEMUCaps *qemuCaps, + virDomainPCIAddressSet *addrs) { size_t i; virPCIDeviceAddress tmp_addr; @@ -1743,7 +1743,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, /* Verify that first IDE and USB controllers (if any) is on the PIIX3, fn 1 */ for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; virPCIDeviceAddress primaryIDEAddr = {.domain = 0, .bus = 0, .slot = 1, .function = 1}; virPCIDeviceAddress piix3USBAddr = {.domain = 0, .bus = 0, @@ -1812,7 +1812,7 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, * device added after integrated devices), it *always* ends up * at slot 2. */ - virDomainVideoDefPtr primaryVideo = def->videos[0]; + virDomainVideoDef *primaryVideo = def->videos[0]; virPCIDeviceAddress primaryCardAddr = {.domain = 0, .bus = 0, .slot = 2, .function = 0}; @@ -1871,9 +1871,9 @@ qemuDomainValidateDevicePCISlotsPIIX3(virDomainDefPtr def, static int -qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, - virDomainPCIAddressSetPtr addrs) +qemuDomainValidateDevicePCISlotsQ35(virDomainDef *def, + virQEMUCaps *qemuCaps, + virDomainPCIAddressSet *addrs) { size_t i; virPCIDeviceAddress tmp_addr; @@ -1882,7 +1882,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, virDomainPCIConnectFlags flags = VIR_PCI_CONNECT_TYPE_PCIE_DEVICE; for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; virPCIDeviceAddress primarySATAAddr = {.domain = 0, .bus = 0, .slot = 0x1F, .function = 2}; @@ -1998,7 +1998,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, * slot 1 (which was used up by the integrated PIIX3 devices * on pc machinetypes). */ - virDomainVideoDefPtr primaryVideo = def->videos[0]; + virDomainVideoDef *primaryVideo = def->videos[0]; if (virDeviceInfoPCIAddressIsWanted(&primaryVideo->info)) { memset(&tmp_addr, 0, sizeof(tmp_addr)); tmp_addr.slot = 1; @@ -2062,7 +2062,7 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, * normal device addressing assign something later. */ for (i = 0; i < def->nsounds; i++) { - virDomainSoundDefPtr sound = def->sounds[i]; + virDomainSoundDef *sound = def->sounds[i]; if (sound->model != VIR_DOMAIN_SOUND_MODEL_ICH9 || !virDeviceInfoPCIAddressIsWanted(&sound->info)) { @@ -2082,9 +2082,9 @@ qemuDomainValidateDevicePCISlotsQ35(virDomainDefPtr def, static int -qemuDomainValidateDevicePCISlotsChipsets(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, - virDomainPCIAddressSetPtr addrs) +qemuDomainValidateDevicePCISlotsChipsets(virDomainDef *def, + virQEMUCaps *qemuCaps, + virDomainPCIAddressSet *addrs) { if (qemuDomainIsI440FX(def) && qemuDomainValidateDevicePCISlotsPIIX3(def, qemuCaps, addrs) < 0) { @@ -2137,15 +2137,15 @@ qemuDomainValidateDevicePCISlotsChipsets(virDomainDefPtr def, * skip over info.type == PCI */ static int -qemuDomainAssignDevicePCISlots(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, - virDomainPCIAddressSetPtr addrs) +qemuDomainAssignDevicePCISlots(virDomainDef *def, + virQEMUCaps *qemuCaps, + virDomainPCIAddressSet *addrs) { size_t i, j; /* PCI controllers */ for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) { virDomainControllerModelPCI model = cont->model; @@ -2172,7 +2172,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, /* Network interfaces */ for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; /* type='hostdev' network devices might be USB, and are also * in hostdevs list anyway, so handle them with other hostdevs @@ -2189,7 +2189,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, /* Sound cards */ for (i = 0; i < def->nsounds; i++) { - virDomainSoundDefPtr sound = def->sounds[i]; + virDomainSoundDef *sound = def->sounds[i]; if (!virDeviceInfoPCIAddressIsWanted(&sound->info)) continue; @@ -2207,7 +2207,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, /* Device controllers (SCSI, USB, but not IDE, FDC or CCID) */ for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; /* PCI controllers have been dealt with earlier */ if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) @@ -2331,7 +2331,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, /* Host PCI devices */ for (i = 0; i < def->nhostdevs; i++) { - virDomainHostdevSubsysPtr subsys = &def->hostdevs[i]->source.subsys; + virDomainHostdevSubsys *subsys = &def->hostdevs[i]->source.subsys; if (!virDeviceInfoPCIAddressIsWanted(def->hostdevs[i]->info)) continue; if (def->hostdevs[i]->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) @@ -2411,7 +2411,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, /* Nada - none are PCI based (yet) */ } for (i = 0; i < def->nserials; i++) { - virDomainChrDefPtr chr = def->serials[i]; + virDomainChrDef *chr = def->serials[i]; if (chr->targetType != VIR_DOMAIN_CHR_SERIAL_TARGET_TYPE_PCI || !virDeviceInfoPCIAddressIsWanted(&chr->info)) @@ -2436,7 +2436,7 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, } for (i = 0; i < def->nmems; i++) { - virDomainMemoryDefPtr mem = def->mems[i]; + virDomainMemoryDef *mem = def->mems[i]; if (mem->model != VIR_DOMAIN_MEMORY_MODEL_VIRTIO_PMEM || !virDeviceInfoPCIAddressIsWanted(&mem->info)) @@ -2451,9 +2451,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def, static void -qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont, - virDomainDefPtr def, - virQEMUCapsPtr qemuCaps) +qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDef *cont, + virDomainDef *def, + virQEMUCaps *qemuCaps) { int *modelName = &cont->opts.pciopts.modelName; @@ -2513,7 +2513,7 @@ qemuDomainPCIControllerSetDefaultModelName(virDomainControllerDefPtr cont, * indexes are already taken. */ static int -qemuDomainAddressFindNewTargetIndex(virDomainDefPtr def) +qemuDomainAddressFindNewTargetIndex(virDomainDef *def) { int targetIndex; int ret = -1; @@ -2525,7 +2525,7 @@ qemuDomainAddressFindNewTargetIndex(virDomainDefPtr def) size_t i; for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; /* Skip everything but PHBs */ if (!virDomainControllerIsPSeriesPHB(cont)) @@ -2552,7 +2552,7 @@ qemuDomainAddressFindNewTargetIndex(virDomainDefPtr def) static int -qemuDomainAddressFindNewBusNr(virDomainDefPtr def) +qemuDomainAddressFindNewBusNr(virDomainDef *def) { /* Try to find a nice default for busNr for a new pci-expander-bus. * This is a bit tricky, since you need to satisfy the following: @@ -2601,7 +2601,7 @@ qemuDomainAddressFindNewBusNr(virDomainDefPtr def) int lowestBusNr = 256; for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) { int thisBusNr = cont->opts.pciopts.busNr; @@ -2623,21 +2623,21 @@ qemuDomainAddressFindNewBusNr(virDomainDefPtr def) static int -qemuDomainAssignPCIAddresses(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, - virQEMUDriverPtr driver, - virDomainObjPtr obj) +qemuDomainAssignPCIAddresses(virDomainDef *def, + virQEMUCaps *qemuCaps, + virQEMUDriver *driver, + virDomainObj *obj) { int ret = -1; - virDomainPCIAddressSetPtr addrs = NULL; - qemuDomainObjPrivatePtr priv = NULL; + virDomainPCIAddressSet *addrs = NULL; + qemuDomainObjPrivate *priv = NULL; int max_idx = -1; int nbuses = 0; size_t i; int rv; for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI) { if ((int)cont->idx > max_idx) @@ -2750,7 +2750,7 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, for (i = 1; i < addrs->nbuses; i++) { virDomainDeviceDef dev; int contIndex; - virDomainPCIAddressBusPtr bus = &addrs->buses[i]; + virDomainPCIAddressBus *bus = &addrs->buses[i]; if ((rv = virDomainDefMaybeAddController( def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, @@ -2817,10 +2817,10 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, virDomainPCIAddressSetAllMulti(def); for (i = 0; i < def->ncontrollers; i++) { - virDomainControllerDefPtr cont = def->controllers[i]; + virDomainControllerDef *cont = def->controllers[i]; int idx = cont->idx; - virPCIDeviceAddressPtr addr; - virDomainPCIControllerOptsPtr options; + virPCIDeviceAddress *addr; + virDomainPCIControllerOpts *options; if (cont->type != VIR_DOMAIN_CONTROLLER_TYPE_PCI) continue; @@ -2933,13 +2933,13 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def, struct qemuAssignUSBIteratorInfo { - virDomainUSBAddressSetPtr addrs; + virDomainUSBAddressSet *addrs; size_t count; }; static int -qemuDomainAssignUSBPortsIterator(virDomainDeviceInfoPtr info, +qemuDomainAssignUSBPortsIterator(virDomainDeviceInfo *info, void *opaque) { struct qemuAssignUSBIteratorInfo *data = opaque; @@ -2957,13 +2957,13 @@ qemuDomainAssignUSBPortsIterator(virDomainDeviceInfoPtr info, static int -qemuDomainAssignUSBHubs(virDomainUSBAddressSetPtr addrs, - virDomainDefPtr def) +qemuDomainAssignUSBHubs(virDomainUSBAddressSet *addrs, + virDomainDef *def) { size_t i; for (i = 0; i < def->nhubs; i++) { - virDomainHubDefPtr hub = def->hubs[i]; + virDomainHubDef *hub = def->hubs[i]; if (hub->type != VIR_DOMAIN_HUB_TYPE_USB) continue; @@ -2982,8 +2982,8 @@ qemuDomainAssignUSBHubs(virDomainUSBAddressSetPtr addrs, static int -qemuDomainAssignUSBPorts(virDomainUSBAddressSetPtr addrs, - virDomainDefPtr def) +qemuDomainAssignUSBPorts(virDomainUSBAddressSet *addrs, + virDomainDef *def) { struct qemuAssignUSBIteratorInfo data = { .addrs = addrs }; @@ -2995,7 +2995,7 @@ qemuDomainAssignUSBPorts(virDomainUSBAddressSetPtr addrs, static int -qemuDomainAssignUSBPortsCounter(virDomainDeviceInfoPtr info G_GNUC_UNUSED, +qemuDomainAssignUSBPortsCounter(virDomainDeviceInfo *info G_GNUC_UNUSED, void *opaque) { struct qemuAssignUSBIteratorInfo *data = opaque; @@ -3006,10 +3006,10 @@ qemuDomainAssignUSBPortsCounter(virDomainDeviceInfoPtr info G_GNUC_UNUSED, static int -qemuDomainUSBAddressAddHubs(virDomainDefPtr def) +qemuDomainUSBAddressAddHubs(virDomainDef *def) { struct qemuAssignUSBIteratorInfo data = { .count = 0 }; - virDomainHubDefPtr hub = NULL; + virDomainHubDef *hub = NULL; size_t available_ports; size_t hubs_needed = 0; int ret = -1; @@ -3050,11 +3050,11 @@ qemuDomainUSBAddressAddHubs(virDomainDefPtr def) } -static virBitmapPtr +static virBitmap * qemuDomainGetMemorySlotMap(const virDomainDef *def) { - virBitmapPtr ret = virBitmapNew(def->mem.memory_slots); - virDomainMemoryDefPtr mem; + virBitmap *ret = virBitmapNew(def->mem.memory_slots); + virDomainMemoryDef *mem; size_t i; for (i = 0; i < def->nmems; i++) { @@ -3069,8 +3069,8 @@ qemuDomainGetMemorySlotMap(const virDomainDef *def) static int -qemuAssignMemoryDeviceSlot(virDomainMemoryDefPtr mem, - virBitmapPtr slotmap) +qemuAssignMemoryDeviceSlot(virDomainMemoryDef *mem, + virBitmap *slotmap) { ssize_t nextslot = -1; @@ -3092,9 +3092,9 @@ qemuAssignMemoryDeviceSlot(virDomainMemoryDefPtr mem, int -qemuDomainAssignMemoryDeviceSlot(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem) +qemuDomainAssignMemoryDeviceSlot(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem) { g_autoptr(virBitmap) slotmap = NULL; virDomainDeviceDef dev = {.type = VIR_DOMAIN_DEVICE_MEMORY, .data.memory = mem}; @@ -3122,8 +3122,8 @@ qemuDomainAssignMemoryDeviceSlot(virQEMUDriverPtr driver, void -qemuDomainReleaseMemoryDeviceSlot(virDomainObjPtr vm, - virDomainMemoryDefPtr mem) +qemuDomainReleaseMemoryDeviceSlot(virDomainObj *vm, + virDomainMemoryDef *mem) { switch (mem->model) { case VIR_DOMAIN_MEMORY_MODEL_DIMM: @@ -3145,9 +3145,9 @@ qemuDomainReleaseMemoryDeviceSlot(virDomainObjPtr vm, static int -qemuDomainAssignMemorySlots(virDomainDefPtr def) +qemuDomainAssignMemorySlots(virDomainDef *def) { - virBitmapPtr slotmap = NULL; + virBitmap *slotmap = NULL; int ret = -1; size_t i; @@ -3158,7 +3158,7 @@ qemuDomainAssignMemorySlots(virDomainDefPtr def) return -1; for (i = 0; i < def->nmems; i++) { - virDomainMemoryDefPtr mem = def->mems[i]; + virDomainMemoryDef *mem = def->mems[i]; switch (mem->model) { case VIR_DOMAIN_MEMORY_MODEL_DIMM: @@ -3186,13 +3186,13 @@ qemuDomainAssignMemorySlots(virDomainDefPtr def) static int -qemuDomainAssignUSBAddresses(virDomainDefPtr def, - virDomainObjPtr obj, +qemuDomainAssignUSBAddresses(virDomainDef *def, + virDomainObj *obj, bool newDomain) { int ret = -1; - virDomainUSBAddressSetPtr addrs = NULL; - qemuDomainObjPrivatePtr priv = NULL; + virDomainUSBAddressSet *addrs = NULL; + qemuDomainObjPrivate *priv = NULL; if (!newDomain) { /* only create the address cache for: @@ -3241,10 +3241,10 @@ qemuDomainAssignUSBAddresses(virDomainDefPtr def, int -qemuDomainAssignAddresses(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, - virQEMUDriverPtr driver, - virDomainObjPtr obj, +qemuDomainAssignAddresses(virDomainDef *def, + virQEMUCaps *qemuCaps, + virQEMUDriver *driver, + virDomainObj *obj, bool newDomain) { if (qemuDomainAssignVirtioSerialAddresses(def) < 0) @@ -3273,7 +3273,7 @@ qemuDomainAssignAddresses(virDomainDefPtr def, /** * qemuDomainEnsurePCIAddress: * - * @obj: the virDomainObjPtr for the domain. This will include + * @obj: the virDomainObj *f or the domain. This will include * qemuCaps and address cache (if there is one) * * @dev: the device that we need to ensure has a PCI address @@ -3286,12 +3286,12 @@ qemuDomainAssignAddresses(virDomainDefPtr def, * returns 0 on success -1 on failure. */ int -qemuDomainEnsurePCIAddress(virDomainObjPtr obj, - virDomainDeviceDefPtr dev, - virQEMUDriverPtr driver) +qemuDomainEnsurePCIAddress(virDomainObj *obj, + virDomainDeviceDef *dev, + virQEMUDriver *driver) { - qemuDomainObjPrivatePtr priv = obj->privateData; - virDomainDeviceInfoPtr info = virDomainDeviceGetInfo(dev); + qemuDomainObjPrivate *priv = obj->privateData; + virDomainDeviceInfo *info = virDomainDeviceGetInfo(dev); if (!info) return 0; @@ -3305,10 +3305,10 @@ qemuDomainEnsurePCIAddress(virDomainObjPtr obj, } void -qemuDomainReleaseDeviceAddress(virDomainObjPtr vm, - virDomainDeviceInfoPtr info) +qemuDomainReleaseDeviceAddress(virDomainObj *vm, + virDomainDeviceInfo *info) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (virDeviceInfoPCIAddressIsPresent(info)) { virDomainPCIAddressReleaseAddr(priv->pciaddrs, &info->addr.pci); @@ -3321,14 +3321,14 @@ qemuDomainReleaseDeviceAddress(virDomainObjPtr vm, int qemuDomainEnsureVirtioAddress(bool *releaseAddr, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev, + virDomainObj *vm, + virDomainDeviceDef *dev, const char *devicename) { - virDomainDeviceInfoPtr info = virDomainDeviceGetInfo(dev); - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainCCWAddressSetPtr ccwaddrs = NULL; - virQEMUDriverPtr driver = priv->driver; + virDomainDeviceInfo *info = virDomainDeviceGetInfo(dev); + qemuDomainObjPrivate *priv = vm->privateData; + virDomainCCWAddressSet *ccwaddrs = NULL; + virQEMUDriver *driver = priv->driver; int ret = -1; if (!info->type) { diff --git a/src/qemu/qemu_domain_address.h b/src/qemu/qemu_domain_address.h index bfd56e163e..85c71bfda5 100644 --- a/src/qemu/qemu_domain_address.h +++ b/src/qemu/qemu_domain_address.h @@ -28,42 +28,42 @@ int qemuDomainGetSCSIControllerModel(const virDomainDef *def, const virDomainControllerDef *cont, - virQEMUCapsPtr qemuCaps); + virQEMUCaps *qemuCaps); int qemuDomainSetSCSIControllerModel(const virDomainDef *def, - virDomainControllerDefPtr cont, - virQEMUCapsPtr qemuCaps); + virDomainControllerDef *cont, + virQEMUCaps *qemuCaps); int qemuDomainFindSCSIControllerModel(const virDomainDef *def, - virDomainDeviceInfoPtr info); + virDomainDeviceInfo *info); -int qemuDomainAssignAddresses(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, - virQEMUDriverPtr driver, - virDomainObjPtr obj, +int qemuDomainAssignAddresses(virDomainDef *def, + virQEMUCaps *qemuCaps, + virQEMUDriver *driver, + virDomainObj *obj, bool newDomain) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuDomainEnsurePCIAddress(virDomainObjPtr obj, - virDomainDeviceDefPtr dev, - virQEMUDriverPtr driver) +int qemuDomainEnsurePCIAddress(virDomainObj *obj, + virDomainDeviceDef *dev, + virQEMUDriver *driver) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -void qemuDomainFillDeviceIsolationGroup(virDomainDefPtr def, - virDomainDeviceDefPtr dev) +void qemuDomainFillDeviceIsolationGroup(virDomainDef *def, + virDomainDeviceDef *dev) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void qemuDomainReleaseDeviceAddress(virDomainObjPtr vm, - virDomainDeviceInfoPtr info); +void qemuDomainReleaseDeviceAddress(virDomainObj *vm, + virDomainDeviceInfo *info); -int qemuDomainAssignMemoryDeviceSlot(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem); +int qemuDomainAssignMemoryDeviceSlot(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem); -void qemuDomainReleaseMemoryDeviceSlot(virDomainObjPtr vm, - virDomainMemoryDefPtr mem); +void qemuDomainReleaseMemoryDeviceSlot(virDomainObj *vm, + virDomainMemoryDef *mem); int qemuDomainEnsureVirtioAddress(bool *releaseAddr, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev, + virDomainObj *vm, + virDomainDeviceDef *dev, const char *devicename); diff --git a/src/qemu/qemu_domainjob.c b/src/qemu/qemu_domainjob.c index 50cfc45f5b..03a8d9ba5f 100644 --- a/src/qemu/qemu_domainjob.c +++ b/src/qemu/qemu_domainjob.c @@ -117,17 +117,17 @@ qemuDomainAsyncJobPhaseFromString(qemuDomainAsyncJob job, void -qemuDomainJobInfoFree(qemuDomainJobInfoPtr info) +qemuDomainJobInfoFree(qemuDomainJobInfo *info) { g_free(info->errmsg); g_free(info); } -qemuDomainJobInfoPtr -qemuDomainJobInfoCopy(qemuDomainJobInfoPtr info) +qemuDomainJobInfo * +qemuDomainJobInfoCopy(qemuDomainJobInfo *info) { - qemuDomainJobInfoPtr ret = g_new0(qemuDomainJobInfo, 1); + qemuDomainJobInfo *ret = g_new0(qemuDomainJobInfo, 1); memcpy(ret, info, sizeof(*info)); @@ -137,11 +137,11 @@ qemuDomainJobInfoCopy(qemuDomainJobInfoPtr info) } void -qemuDomainEventEmitJobCompleted(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuDomainEventEmitJobCompleted(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virObjectEventPtr event; + qemuDomainObjPrivate *priv = vm->privateData; + virObjectEvent *event; virTypedParameterPtr params = NULL; int nparams = 0; int type; @@ -161,8 +161,8 @@ qemuDomainEventEmitJobCompleted(virQEMUDriverPtr driver, int -qemuDomainObjInitJob(qemuDomainJobObjPtr job, - qemuDomainObjPrivateJobCallbacksPtr cb) +qemuDomainObjInitJob(qemuDomainJobObj *job, + qemuDomainObjPrivateJobCallbacks *cb) { memset(job, 0, sizeof(*job)); job->cb = cb; @@ -186,7 +186,7 @@ qemuDomainObjInitJob(qemuDomainJobObjPtr job, static void -qemuDomainObjResetJob(qemuDomainJobObjPtr job) +qemuDomainObjResetJob(qemuDomainJobObj *job) { job->active = QEMU_JOB_NONE; job->owner = 0; @@ -196,7 +196,7 @@ qemuDomainObjResetJob(qemuDomainJobObjPtr job) static void -qemuDomainObjResetAgentJob(qemuDomainJobObjPtr job) +qemuDomainObjResetAgentJob(qemuDomainJobObj *job) { job->agentActive = QEMU_AGENT_JOB_NONE; job->agentOwner = 0; @@ -206,7 +206,7 @@ qemuDomainObjResetAgentJob(qemuDomainJobObjPtr job) static void -qemuDomainObjResetAsyncJob(qemuDomainJobObjPtr job) +qemuDomainObjResetAsyncJob(qemuDomainJobObj *job) { job->asyncJob = QEMU_ASYNC_JOB_NONE; job->asyncOwner = 0; @@ -222,10 +222,10 @@ qemuDomainObjResetAsyncJob(qemuDomainJobObjPtr job) } int -qemuDomainObjRestoreJob(virDomainObjPtr obj, - qemuDomainJobObjPtr job) +qemuDomainObjRestoreJob(virDomainObj *obj, + qemuDomainJobObj *job) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; memset(job, 0, sizeof(*job)); job->active = priv->job.active; @@ -246,7 +246,7 @@ qemuDomainObjRestoreJob(virDomainObjPtr obj, } void -qemuDomainObjClearJob(qemuDomainJobObjPtr job) +qemuDomainObjClearJob(qemuDomainJobObj *job) { if (!job->cb) return; @@ -268,7 +268,7 @@ qemuDomainTrackJob(qemuDomainJob job) int -qemuDomainJobInfoUpdateTime(qemuDomainJobInfoPtr jobInfo) +qemuDomainJobInfoUpdateTime(qemuDomainJobInfo *jobInfo) { unsigned long long now; @@ -289,7 +289,7 @@ qemuDomainJobInfoUpdateTime(qemuDomainJobInfoPtr jobInfo) } int -qemuDomainJobInfoUpdateDowntime(qemuDomainJobInfoPtr jobInfo) +qemuDomainJobInfoUpdateDowntime(qemuDomainJobInfo *jobInfo) { unsigned long long now; @@ -338,7 +338,7 @@ qemuDomainJobStatusToType(qemuDomainJobStatus status) } int -qemuDomainJobInfoToInfo(qemuDomainJobInfoPtr jobInfo, +qemuDomainJobInfoToInfo(qemuDomainJobInfo *jobInfo, virDomainJobInfoPtr info) { info->type = qemuDomainJobStatusToType(jobInfo->status); @@ -389,13 +389,13 @@ qemuDomainJobInfoToInfo(qemuDomainJobInfoPtr jobInfo, static int -qemuDomainMigrationJobInfoToParams(qemuDomainJobInfoPtr jobInfo, +qemuDomainMigrationJobInfoToParams(qemuDomainJobInfo *jobInfo, int *type, virTypedParameterPtr *params, int *nparams) { qemuMonitorMigrationStats *stats = &jobInfo->stats.mig; - qemuDomainMirrorStatsPtr mirrorStats = &jobInfo->mirrorStats; + qemuDomainMirrorStats *mirrorStats = &jobInfo->mirrorStats; virTypedParameterPtr par = NULL; int maxpar = 0; int npar = 0; @@ -566,7 +566,7 @@ qemuDomainMigrationJobInfoToParams(qemuDomainJobInfoPtr jobInfo, static int -qemuDomainDumpJobInfoToParams(qemuDomainJobInfoPtr jobInfo, +qemuDomainDumpJobInfoToParams(qemuDomainJobInfo *jobInfo, int *type, virTypedParameterPtr *params, int *nparams) @@ -609,7 +609,7 @@ qemuDomainDumpJobInfoToParams(qemuDomainJobInfoPtr jobInfo, static int -qemuDomainBackupJobInfoToParams(qemuDomainJobInfoPtr jobInfo, +qemuDomainBackupJobInfoToParams(qemuDomainJobInfo *jobInfo, int *type, virTypedParameterPtr *params, int *nparams) @@ -666,7 +666,7 @@ qemuDomainBackupJobInfoToParams(qemuDomainJobInfoPtr jobInfo, int -qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo, +qemuDomainJobInfoToParams(qemuDomainJobInfo *jobInfo, int *type, virTypedParameterPtr *params, int *nparams) @@ -697,11 +697,11 @@ qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo, void -qemuDomainObjSetJobPhase(virQEMUDriverPtr driver, - virDomainObjPtr obj, +qemuDomainObjSetJobPhase(virQEMUDriver *driver, + virDomainObj *obj, int phase) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; unsigned long long me = virThreadSelfID(); if (!priv->job.asyncJob) @@ -725,10 +725,10 @@ qemuDomainObjSetJobPhase(virQEMUDriverPtr driver, } void -qemuDomainObjSetAsyncJobMask(virDomainObjPtr obj, +qemuDomainObjSetAsyncJobMask(virDomainObj *obj, unsigned long long allowedJobs) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; if (!priv->job.asyncJob) return; @@ -737,9 +737,9 @@ qemuDomainObjSetAsyncJobMask(virDomainObjPtr obj, } void -qemuDomainObjDiscardAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj) +qemuDomainObjDiscardAsyncJob(virQEMUDriver *driver, virDomainObj *obj) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; if (priv->job.active == QEMU_JOB_ASYNC_NESTED) qemuDomainObjResetJob(&priv->job); @@ -748,9 +748,9 @@ qemuDomainObjDiscardAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj) } void -qemuDomainObjReleaseAsyncJob(virDomainObjPtr obj) +qemuDomainObjReleaseAsyncJob(virDomainObj *obj) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; VIR_DEBUG("Releasing ownership of '%s' async job", qemuDomainAsyncJobTypeToString(priv->job.asyncJob)); @@ -764,7 +764,7 @@ qemuDomainObjReleaseAsyncJob(virDomainObjPtr obj) } static bool -qemuDomainNestedJobAllowed(qemuDomainJobObjPtr jobs, qemuDomainJob newJob) +qemuDomainNestedJobAllowed(qemuDomainJobObj *jobs, qemuDomainJob newJob) { return !jobs->asyncJob || newJob == QEMU_JOB_NONE || @@ -772,13 +772,13 @@ qemuDomainNestedJobAllowed(qemuDomainJobObjPtr jobs, qemuDomainJob newJob) } bool -qemuDomainJobAllowed(qemuDomainJobObjPtr jobs, qemuDomainJob newJob) +qemuDomainJobAllowed(qemuDomainJobObj *jobs, qemuDomainJob newJob) { return !jobs->active && qemuDomainNestedJobAllowed(jobs, newJob); } static bool -qemuDomainObjCanSetJob(qemuDomainJobObjPtr job, +qemuDomainObjCanSetJob(qemuDomainJobObj *job, qemuDomainJob newJob, qemuDomainAgentJob newAgentJob) { @@ -814,14 +814,14 @@ qemuDomainObjCanSetJob(qemuDomainJobObjPtr job, * -1 otherwise. */ static int ATTRIBUTE_NONNULL(1) -qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, - virDomainObjPtr obj, +qemuDomainObjBeginJobInternal(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainJob job, qemuDomainAgentJob agentJob, qemuDomainAsyncJob asyncJob, bool nowait) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; unsigned long long now; unsigned long long then; bool nested = job == QEMU_JOB_ASYNC_NESTED; @@ -1028,8 +1028,8 @@ qemuDomainObjBeginJobInternal(virQEMUDriverPtr driver, * * Successful calls must be followed by EndJob eventually */ -int qemuDomainObjBeginJob(virQEMUDriverPtr driver, - virDomainObjPtr obj, +int qemuDomainObjBeginJob(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainJob job) { if (qemuDomainObjBeginJobInternal(driver, obj, job, @@ -1048,8 +1048,8 @@ int qemuDomainObjBeginJob(virQEMUDriverPtr driver, * To end job call qemuDomainObjEndAgentJob. */ int -qemuDomainObjBeginAgentJob(virQEMUDriverPtr driver, - virDomainObjPtr obj, +qemuDomainObjBeginAgentJob(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainAgentJob agentJob) { return qemuDomainObjBeginJobInternal(driver, obj, QEMU_JOB_NONE, @@ -1057,13 +1057,13 @@ qemuDomainObjBeginAgentJob(virQEMUDriverPtr driver, QEMU_ASYNC_JOB_NONE, false); } -int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver, - virDomainObjPtr obj, +int qemuDomainObjBeginAsyncJob(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainAsyncJob asyncJob, virDomainJobOperation operation, unsigned long apiFlags) { - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; if (qemuDomainObjBeginJobInternal(driver, obj, QEMU_JOB_ASYNC, QEMU_AGENT_JOB_NONE, @@ -1077,11 +1077,11 @@ int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver, } int -qemuDomainObjBeginNestedJob(virQEMUDriverPtr driver, - virDomainObjPtr obj, +qemuDomainObjBeginNestedJob(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; if (asyncJob != priv->job.asyncJob) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -1116,8 +1116,8 @@ qemuDomainObjBeginNestedJob(virQEMUDriverPtr driver, * Returns: see qemuDomainObjBeginJobInternal */ int -qemuDomainObjBeginJobNowait(virQEMUDriverPtr driver, - virDomainObjPtr obj, +qemuDomainObjBeginJobNowait(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainJob job) { return qemuDomainObjBeginJobInternal(driver, obj, job, @@ -1132,9 +1132,9 @@ qemuDomainObjBeginJobNowait(virQEMUDriverPtr driver, * earlier qemuDomainBeginJob() call */ void -qemuDomainObjEndJob(virQEMUDriverPtr driver, virDomainObjPtr obj) +qemuDomainObjEndJob(virQEMUDriver *driver, virDomainObj *obj) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; qemuDomainJob job = priv->job.active; priv->jobs_queued--; @@ -1153,9 +1153,9 @@ qemuDomainObjEndJob(virQEMUDriverPtr driver, virDomainObjPtr obj) } void -qemuDomainObjEndAgentJob(virDomainObjPtr obj) +qemuDomainObjEndAgentJob(virDomainObj *obj) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; qemuDomainAgentJob agentJob = priv->job.agentActive; priv->jobs_queued--; @@ -1172,9 +1172,9 @@ qemuDomainObjEndAgentJob(virDomainObjPtr obj) } void -qemuDomainObjEndAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj) +qemuDomainObjEndAsyncJob(virQEMUDriver *driver, virDomainObj *obj) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; priv->jobs_queued--; @@ -1188,9 +1188,9 @@ qemuDomainObjEndAsyncJob(virQEMUDriverPtr driver, virDomainObjPtr obj) } void -qemuDomainObjAbortAsyncJob(virDomainObjPtr obj) +qemuDomainObjAbortAsyncJob(virDomainObj *obj) { - qemuDomainObjPrivatePtr priv = obj->privateData; + qemuDomainObjPrivate *priv = obj->privateData; VIR_DEBUG("Requesting abort of async job: %s (vm=%p name=%s)", qemuDomainAsyncJobTypeToString(priv->job.asyncJob), @@ -1201,10 +1201,10 @@ qemuDomainObjAbortAsyncJob(virDomainObjPtr obj) } int -qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf, - virDomainObjPtr vm) +qemuDomainObjPrivateXMLFormatJob(virBuffer *buf, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); qemuDomainJob job = priv->job.active; @@ -1239,11 +1239,11 @@ qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf, int -qemuDomainObjPrivateXMLParseJob(virDomainObjPtr vm, +qemuDomainObjPrivateXMLParseJob(virDomainObj *vm, xmlXPathContextPtr ctxt) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobObjPtr job = &priv->job; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobObj *job = &priv->job; VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autofree char *tmp = NULL; diff --git a/src/qemu/qemu_domainjob.h b/src/qemu/qemu_domainjob.h index 79f0127252..75cf1deb6a 100644 --- a/src/qemu/qemu_domainjob.h +++ b/src/qemu/qemu_domainjob.h @@ -101,7 +101,6 @@ typedef enum { typedef struct _qemuDomainMirrorStats qemuDomainMirrorStats; -typedef qemuDomainMirrorStats *qemuDomainMirrorStatsPtr; struct _qemuDomainMirrorStats { unsigned long long transferred; unsigned long long total; @@ -116,7 +115,6 @@ struct _qemuDomainBackupStats { }; typedef struct _qemuDomainJobInfo qemuDomainJobInfo; -typedef qemuDomainJobInfo *qemuDomainJobInfoPtr; struct _qemuDomainJobInfo { qemuDomainJobStatus status; virDomainJobOperation operation; @@ -147,28 +145,26 @@ struct _qemuDomainJobInfo { }; void -qemuDomainJobInfoFree(qemuDomainJobInfoPtr info); +qemuDomainJobInfoFree(qemuDomainJobInfo *info); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuDomainJobInfo, qemuDomainJobInfoFree); -qemuDomainJobInfoPtr -qemuDomainJobInfoCopy(qemuDomainJobInfoPtr info); +qemuDomainJobInfo * +qemuDomainJobInfoCopy(qemuDomainJobInfo *info); typedef struct _qemuDomainJobObj qemuDomainJobObj; -typedef qemuDomainJobObj *qemuDomainJobObjPtr; typedef void *(*qemuDomainObjPrivateJobAlloc)(void); typedef void (*qemuDomainObjPrivateJobFree)(void *); typedef void (*qemuDomainObjPrivateJobReset)(void *); -typedef int (*qemuDomainObjPrivateJobFormat)(virBufferPtr, - qemuDomainJobObjPtr, - virDomainObjPtr); +typedef int (*qemuDomainObjPrivateJobFormat)(virBuffer *, + qemuDomainJobObj *, + virDomainObj *); typedef int (*qemuDomainObjPrivateJobParse)(xmlXPathContextPtr, - qemuDomainJobObjPtr, - virDomainObjPtr); + qemuDomainJobObj *, + virDomainObj *); typedef struct _qemuDomainObjPrivateJobCallbacks qemuDomainObjPrivateJobCallbacks; -typedef qemuDomainObjPrivateJobCallbacks *qemuDomainObjPrivateJobCallbacksPtr; struct _qemuDomainObjPrivateJobCallbacks { qemuDomainObjPrivateJobAlloc allocJobPrivate; qemuDomainObjPrivateJobFree freeJobPrivate; @@ -200,14 +196,14 @@ struct _qemuDomainJobObj { unsigned long long asyncStarted; /* When the current async job started */ int phase; /* Job phase (mainly for migrations) */ unsigned long long mask; /* Jobs allowed during async job */ - qemuDomainJobInfoPtr current; /* async job progress data */ - qemuDomainJobInfoPtr completed; /* statistics data of a recently completed job */ + qemuDomainJobInfo *current; /* async job progress data */ + qemuDomainJobInfo *completed; /* statistics data of a recently completed job */ bool abortJob; /* abort of the job requested */ char *error; /* job event completion error */ unsigned long apiFlags; /* flags passed to the API which started the async job */ void *privateData; /* job specific collection of data */ - qemuDomainObjPrivateJobCallbacksPtr cb; + qemuDomainObjPrivateJobCallbacks *cb; }; const char *qemuDomainAsyncJobPhaseToString(qemuDomainAsyncJob job, @@ -215,57 +211,57 @@ const char *qemuDomainAsyncJobPhaseToString(qemuDomainAsyncJob job, int qemuDomainAsyncJobPhaseFromString(qemuDomainAsyncJob job, const char *phase); -void qemuDomainEventEmitJobCompleted(virQEMUDriverPtr driver, - virDomainObjPtr vm); +void qemuDomainEventEmitJobCompleted(virQEMUDriver *driver, + virDomainObj *vm); -int qemuDomainObjBeginJob(virQEMUDriverPtr driver, - virDomainObjPtr obj, +int qemuDomainObjBeginJob(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainJob job) G_GNUC_WARN_UNUSED_RESULT; -int qemuDomainObjBeginAgentJob(virQEMUDriverPtr driver, - virDomainObjPtr obj, +int qemuDomainObjBeginAgentJob(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainAgentJob agentJob) G_GNUC_WARN_UNUSED_RESULT; -int qemuDomainObjBeginAsyncJob(virQEMUDriverPtr driver, - virDomainObjPtr obj, +int qemuDomainObjBeginAsyncJob(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainAsyncJob asyncJob, virDomainJobOperation operation, unsigned long apiFlags) G_GNUC_WARN_UNUSED_RESULT; -int qemuDomainObjBeginNestedJob(virQEMUDriverPtr driver, - virDomainObjPtr obj, +int qemuDomainObjBeginNestedJob(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainAsyncJob asyncJob) G_GNUC_WARN_UNUSED_RESULT; -int qemuDomainObjBeginJobNowait(virQEMUDriverPtr driver, - virDomainObjPtr obj, +int qemuDomainObjBeginJobNowait(virQEMUDriver *driver, + virDomainObj *obj, qemuDomainJob job) G_GNUC_WARN_UNUSED_RESULT; -void qemuDomainObjEndJob(virQEMUDriverPtr driver, - virDomainObjPtr obj); -void qemuDomainObjEndAgentJob(virDomainObjPtr obj); -void qemuDomainObjEndAsyncJob(virQEMUDriverPtr driver, - virDomainObjPtr obj); -void qemuDomainObjAbortAsyncJob(virDomainObjPtr obj); -void qemuDomainObjSetJobPhase(virQEMUDriverPtr driver, - virDomainObjPtr obj, +void qemuDomainObjEndJob(virQEMUDriver *driver, + virDomainObj *obj); +void qemuDomainObjEndAgentJob(virDomainObj *obj); +void qemuDomainObjEndAsyncJob(virQEMUDriver *driver, + virDomainObj *obj); +void qemuDomainObjAbortAsyncJob(virDomainObj *obj); +void qemuDomainObjSetJobPhase(virQEMUDriver *driver, + virDomainObj *obj, int phase); -void qemuDomainObjSetAsyncJobMask(virDomainObjPtr obj, +void qemuDomainObjSetAsyncJobMask(virDomainObj *obj, unsigned long long allowedJobs); -int qemuDomainObjRestoreJob(virDomainObjPtr obj, - qemuDomainJobObjPtr job); -void qemuDomainObjDiscardAsyncJob(virQEMUDriverPtr driver, - virDomainObjPtr obj); -void qemuDomainObjReleaseAsyncJob(virDomainObjPtr obj); +int qemuDomainObjRestoreJob(virDomainObj *obj, + qemuDomainJobObj *job); +void qemuDomainObjDiscardAsyncJob(virQEMUDriver *driver, + virDomainObj *obj); +void qemuDomainObjReleaseAsyncJob(virDomainObj *obj); -int qemuDomainJobInfoUpdateTime(qemuDomainJobInfoPtr jobInfo) +int qemuDomainJobInfoUpdateTime(qemuDomainJobInfo *jobInfo) ATTRIBUTE_NONNULL(1); -int qemuDomainJobInfoUpdateDowntime(qemuDomainJobInfoPtr jobInfo) +int qemuDomainJobInfoUpdateDowntime(qemuDomainJobInfo *jobInfo) ATTRIBUTE_NONNULL(1); -int qemuDomainJobInfoToInfo(qemuDomainJobInfoPtr jobInfo, +int qemuDomainJobInfoToInfo(qemuDomainJobInfo *jobInfo, virDomainJobInfoPtr info) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo, +int qemuDomainJobInfoToParams(qemuDomainJobInfo *jobInfo, int *type, virTypedParameterPtr *params, int *nparams) @@ -274,19 +270,19 @@ int qemuDomainJobInfoToParams(qemuDomainJobInfoPtr jobInfo, bool qemuDomainTrackJob(qemuDomainJob job); -void qemuDomainObjClearJob(qemuDomainJobObjPtr job); +void qemuDomainObjClearJob(qemuDomainJobObj *job); G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(qemuDomainJobObj, qemuDomainObjClearJob); int -qemuDomainObjInitJob(qemuDomainJobObjPtr job, - qemuDomainObjPrivateJobCallbacksPtr cb); +qemuDomainObjInitJob(qemuDomainJobObj *job, + qemuDomainObjPrivateJobCallbacks *cb); -bool qemuDomainJobAllowed(qemuDomainJobObjPtr jobs, qemuDomainJob newJob); +bool qemuDomainJobAllowed(qemuDomainJobObj *jobs, qemuDomainJob newJob); int -qemuDomainObjPrivateXMLFormatJob(virBufferPtr buf, - virDomainObjPtr vm); +qemuDomainObjPrivateXMLFormatJob(virBuffer *buf, + virDomainObj *vm); int -qemuDomainObjPrivateXMLParseJob(virDomainObjPtr vm, +qemuDomainObjPrivateXMLParseJob(virDomainObj *vm, xmlXPathContextPtr ctxt); diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index af015f0625..90b5477f00 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -151,20 +151,20 @@ static void qemuProcessEventHandler(void *data, void *opaque); static int qemuStateCleanup(void); static int qemuDomainObjStart(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, + virQEMUDriver *driver, + virDomainObj *vm, unsigned int flags, qemuDomainAsyncJob asyncJob); -static int qemuDomainManagedSaveLoad(virDomainObjPtr vm, +static int qemuDomainManagedSaveLoad(virDomainObj *vm, void *opaque); -static virQEMUDriverPtr qemu_driver; +static virQEMUDriver *qemu_driver; /* Looks up the domain object from snapshot and unlocks the * driver. The returned domain object is locked and ref'd and the * caller must call virDomainObjEndAPI() on it. */ -static virDomainObjPtr +static virDomainObj * qemuDomObjFromSnapshot(virDomainSnapshotPtr snapshot) { return qemuDomainObjFromDomain(snapshot->domain); @@ -174,10 +174,10 @@ qemuDomObjFromSnapshot(virDomainSnapshotPtr snapshot) static int -qemuAutostartDomain(virDomainObjPtr vm, +qemuAutostartDomain(virDomainObj *vm, void *opaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; int flags = 0; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); int ret = -1; @@ -216,7 +216,7 @@ qemuAutostartDomain(virDomainObjPtr vm, static void -qemuAutostartDomains(virQEMUDriverPtr driver) +qemuAutostartDomains(virQEMUDriver *driver) { virDomainObjListForEach(driver->domains, false, qemuAutostartDomain, driver); } @@ -274,11 +274,11 @@ qemuSecurityChownCallback(const virStorageSource *src, static int -qemuSecurityInit(virQEMUDriverPtr driver) +qemuSecurityInit(virQEMUDriver *driver) { char **names; - virSecurityManagerPtr mgr = NULL; - virSecurityManagerPtr stack = NULL; + virSecurityManager *mgr = NULL; + virSecurityManager *stack = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); unsigned int flags = 0; @@ -351,23 +351,23 @@ qemuSecurityInit(virQEMUDriverPtr driver) static int -qemuDomainSnapshotLoad(virDomainObjPtr vm, +qemuDomainSnapshotLoad(virDomainObj *vm, void *data) { char *baseDir = (char *)data; g_autofree char *snapDir = NULL; g_autoptr(DIR) dir = NULL; struct dirent *entry; - virDomainSnapshotDefPtr def = NULL; - virDomainMomentObjPtr snap = NULL; - virDomainMomentObjPtr current = NULL; + virDomainSnapshotDef *def = NULL; + virDomainMomentObj *snap = NULL; + virDomainMomentObj *current = NULL; bool cur; unsigned int flags = (VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE | VIR_DOMAIN_SNAPSHOT_PARSE_DISKS | VIR_DOMAIN_SNAPSHOT_PARSE_INTERNAL); int ret = -1; int direrr; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; virObjectLock(vm); @@ -462,20 +462,20 @@ qemuDomainSnapshotLoad(virDomainObjPtr vm, static int -qemuDomainCheckpointLoad(virDomainObjPtr vm, +qemuDomainCheckpointLoad(virDomainObj *vm, void *data) { char *baseDir = (char *)data; g_autofree char *chkDir = NULL; g_autoptr(DIR) dir = NULL; struct dirent *entry; - virDomainCheckpointDefPtr def = NULL; - virDomainMomentObjPtr chk = NULL; - virDomainMomentObjPtr current = NULL; + virDomainCheckpointDef *def = NULL; + virDomainMomentObj *chk = NULL; + virDomainMomentObj *current = NULL; unsigned int flags = VIR_DOMAIN_CHECKPOINT_PARSE_REDEFINE; int ret = -1; int direrr; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; virObjectLock(vm); priv = vm->privateData; @@ -547,16 +547,16 @@ qemuDomainCheckpointLoad(virDomainObjPtr vm, static int -qemuDomainNetsRestart(virDomainObjPtr vm, +qemuDomainNetsRestart(virDomainObj *vm, void *data G_GNUC_UNUSED) { size_t i; - virDomainDefPtr def = vm->def; + virDomainDef *def = vm->def; virObjectLock(vm); for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_DIRECT && virDomainNetGetActualDirectMode(net) == VIR_NETDEV_MACVLAN_MODE_VEPA) { VIR_DEBUG("VEPA mode device %s active in domain %s. Reassociating.", @@ -576,7 +576,7 @@ qemuDomainNetsRestart(virDomainObjPtr vm, static int -qemuDomainFindMaxID(virDomainObjPtr vm, +qemuDomainFindMaxID(virDomainObj *vm, void *data) { int *driver_maxid = data; @@ -600,13 +600,13 @@ qemuStateInitialize(bool privileged, void *opaque) { g_autofree char *driverConf = NULL; - virQEMUDriverConfigPtr cfg; + virQEMUDriverConfig *cfg; uid_t run_uid = -1; gid_t run_gid = -1; bool autostart = true; size_t i; const char *defsecmodel = NULL; - g_autofree virSecurityManagerPtr *sec_managers = NULL; + g_autofree virSecurityManager **sec_managers = NULL; qemu_driver = g_new0(virQEMUDriver, 1); @@ -978,12 +978,12 @@ qemuStateInitialize(bool privileged, return VIR_DRV_STATE_INIT_ERROR; } -static void qemuNotifyLoadDomain(virDomainObjPtr vm, int newVM, void *opaque) +static void qemuNotifyLoadDomain(virDomainObj *vm, int newVM, void *opaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; if (newVM) { - virObjectEventPtr event = + virObjectEvent *event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_DEFINED, VIR_DOMAIN_EVENT_DEFINED_ADDED); @@ -1084,7 +1084,7 @@ qemuStateShutdownPrepare(void) static int -qemuDomainObjStopWorkerIter(virDomainObjPtr vm, +qemuDomainObjStopWorkerIter(virDomainObj *vm, void *opaque G_GNUC_UNUSED) { virObjectLock(vm); @@ -1165,7 +1165,7 @@ qemuConnectURIProbe(char **uri) static virDrvOpenStatus qemuConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -1211,7 +1211,7 @@ static virDrvOpenStatus qemuConnectOpen(virConnectPtr conn, static int qemuConnectClose(virConnectPtr conn) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; /* Get rid of callbacks registered for this conn */ virCloseCallbacksRun(driver->closeCallbacks, conn, driver->domains, driver); @@ -1280,7 +1280,7 @@ static int qemuConnectIsAlive(virConnectPtr conn G_GNUC_UNUSED) static char * qemuConnectGetSysinfo(virConnectPtr conn, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; virCheckFlags(0, NULL); @@ -1321,7 +1321,7 @@ qemuConnectGetMaxVcpus(virConnectPtr conn G_GNUC_UNUSED, const char *type) static char *qemuConnectGetCapabilities(virConnectPtr conn) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; g_autoptr(virCaps) caps = NULL; if (virConnectGetCapabilitiesEnsureACL(conn) < 0) @@ -1499,7 +1499,7 @@ qemuGetProcessInfo(unsigned long long *cpuTime, int *lastCpu, long *vm_rss, static int -qemuDomainHelperGetVcpus(virDomainObjPtr vm, +qemuDomainHelperGetVcpus(virDomainObj *vm, virVcpuInfoPtr info, unsigned long long *cpuwait, unsigned long long *cpudelay, @@ -1526,7 +1526,7 @@ qemuDomainHelperGetVcpus(virDomainObjPtr vm, memset(cpumaps, 0, sizeof(*cpumaps) * maxinfo); for (i = 0; i < virDomainDefGetVcpusMax(vm->def) && ncpuinfo < maxinfo; i++) { - virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, i); + virDomainVcpuDef *vcpu = virDomainDefGetVcpu(vm->def, i); pid_t vcpupid = qemuDomainGetVcpuPid(vm, i); virVcpuInfoPtr vcpuinfo = info + ncpuinfo; @@ -1548,7 +1548,7 @@ qemuDomainHelperGetVcpus(virDomainObjPtr vm, if (cpumaps) { unsigned char *cpumap = VIR_GET_CPUMAP(cpumaps, maplen, ncpuinfo); - virBitmapPtr map = NULL; + virBitmap *map = NULL; if (!(map = virProcessGetAffinity(vcpupid))) return -1; @@ -1577,8 +1577,8 @@ qemuDomainHelperGetVcpus(virDomainObjPtr vm, static virDomainPtr qemuDomainLookupByID(virConnectPtr conn, int id) { - virQEMUDriverPtr driver = conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = conn->privateData; + virDomainObj *vm; virDomainPtr dom = NULL; vm = virDomainObjListFindByID(driver->domains, id); @@ -1602,8 +1602,8 @@ static virDomainPtr qemuDomainLookupByID(virConnectPtr conn, static virDomainPtr qemuDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - virQEMUDriverPtr driver = conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = conn->privateData; + virDomainObj *vm; virDomainPtr dom = NULL; vm = virDomainObjListFindByUUID(driver->domains, uuid); @@ -1629,8 +1629,8 @@ static virDomainPtr qemuDomainLookupByUUID(virConnectPtr conn, static virDomainPtr qemuDomainLookupByName(virConnectPtr conn, const char *name) { - virQEMUDriverPtr driver = conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = conn->privateData; + virDomainObj *vm; virDomainPtr dom = NULL; vm = virDomainObjListFindByName(driver->domains, name); @@ -1654,7 +1654,7 @@ static virDomainPtr qemuDomainLookupByName(virConnectPtr conn, static int qemuDomainIsActive(virDomainPtr dom) { - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = qemuDomainObjFromDomain(dom))) @@ -1672,7 +1672,7 @@ static int qemuDomainIsActive(virDomainPtr dom) static int qemuDomainIsPersistent(virDomainPtr dom) { - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = qemuDomainObjFromDomain(dom))) @@ -1690,7 +1690,7 @@ static int qemuDomainIsPersistent(virDomainPtr dom) static int qemuDomainIsUpdated(virDomainPtr dom) { - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = qemuDomainObjFromDomain(dom))) @@ -1708,7 +1708,7 @@ static int qemuDomainIsUpdated(virDomainPtr dom) static int qemuConnectGetVersion(virConnectPtr conn, unsigned long *version) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; unsigned int qemuVersion = 0; g_autoptr(virCaps) caps = NULL; @@ -1739,7 +1739,7 @@ static char *qemuConnectGetHostname(virConnectPtr conn) static int qemuConnectListDomains(virConnectPtr conn, int *ids, int nids) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; if (virConnectListDomainsEnsureACL(conn) < 0) return -1; @@ -1750,7 +1750,7 @@ static int qemuConnectListDomains(virConnectPtr conn, int *ids, int nids) static int qemuConnectNumOfDomains(virConnectPtr conn) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; if (virConnectNumOfDomainsEnsureACL(conn) < 0) return -1; @@ -1764,12 +1764,12 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn, const char *xml, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; g_autoptr(virDomainDef) def = NULL; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; virDomainPtr dom = NULL; - virObjectEventPtr event = NULL; - virObjectEventPtr event2 = NULL; + virObjectEvent *event = NULL; + virObjectEvent *event2 = NULL; unsigned int start_flags = VIR_QEMU_PROCESS_START_COLD; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE | VIR_DOMAIN_DEF_PARSE_ABI_UPDATE; @@ -1848,10 +1848,10 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn, static int qemuDomainSuspend(virDomainPtr dom) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; virDomainPausedReason reason; int state; g_autoptr(virQEMUDriverConfig) cfg = NULL; @@ -1903,8 +1903,8 @@ static int qemuDomainSuspend(virDomainPtr dom) static int qemuDomainResume(virDomainPtr dom) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; int state; int reason; @@ -1959,13 +1959,13 @@ static int qemuDomainResume(virDomainPtr dom) static int -qemuDomainShutdownFlagsAgent(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainShutdownFlagsAgent(virQEMUDriver *driver, + virDomainObj *vm, bool isReboot, bool reportError) { int ret = -1; - qemuAgentPtr agent; + qemuAgent *agent; int agentFlag = isReboot ? QEMU_AGENT_SHUTDOWN_REBOOT : QEMU_AGENT_SHUTDOWN_POWERDOWN; @@ -1994,12 +1994,12 @@ qemuDomainShutdownFlagsAgent(virQEMUDriverPtr driver, static int -qemuDomainShutdownFlagsMonitor(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainShutdownFlagsMonitor(virQEMUDriver *driver, + virDomainObj *vm, bool isReboot) { int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; priv = vm->privateData; @@ -2026,10 +2026,10 @@ qemuDomainShutdownFlagsMonitor(virQEMUDriverPtr driver, static int qemuDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; bool useAgent = false, agentRequested, acpiRequested; bool isReboot = false; bool agentForced; @@ -2090,12 +2090,12 @@ static int qemuDomainShutdown(virDomainPtr dom) static int -qemuDomainRebootAgent(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainRebootAgent(virQEMUDriver *driver, + virDomainObj *vm, bool isReboot, bool agentForced) { - qemuAgentPtr agent; + qemuAgent *agent; int ret = -1; int agentFlag = QEMU_AGENT_SHUTDOWN_REBOOT; @@ -2124,11 +2124,11 @@ qemuDomainRebootAgent(virQEMUDriverPtr driver, static int -qemuDomainRebootMonitor(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainRebootMonitor(virQEMUDriver *driver, + virDomainObj *vm, bool isReboot) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret = -1; if (qemuDomainObjBeginJob(driver, vm, @@ -2153,10 +2153,10 @@ qemuDomainRebootMonitor(virQEMUDriverPtr driver, static int qemuDomainReboot(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; bool useAgent = false, agentRequested, acpiRequested; bool isReboot = true; bool agentForced; @@ -2208,10 +2208,10 @@ qemuDomainReboot(virDomainPtr dom, unsigned int flags) static int qemuDomainReset(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; virDomainState state; virCheckFlags(0, -1); @@ -2253,11 +2253,11 @@ static int qemuDomainDestroyFlags(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; - virObjectEventPtr event = NULL; - qemuDomainObjPrivatePtr priv; + virObjectEvent *event = NULL; + qemuDomainObjPrivate *priv; unsigned int stopFlags = 0; int state; int reason; @@ -2327,7 +2327,7 @@ qemuDomainDestroy(virDomainPtr dom) } static char *qemuDomainGetOSType(virDomainPtr dom) { - virDomainObjPtr vm; + virDomainObj *vm; char *type = NULL; if (!(vm = qemuDomainObjFromDomain(dom))) @@ -2347,7 +2347,7 @@ static char *qemuDomainGetOSType(virDomainPtr dom) { static unsigned long long qemuDomainGetMaxMemory(virDomainPtr dom) { - virDomainObjPtr vm; + virDomainObj *vm; unsigned long long ret = 0; if (!(vm = qemuDomainObjFromDomain(dom))) @@ -2366,11 +2366,11 @@ qemuDomainGetMaxMemory(virDomainPtr dom) static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - qemuDomainObjPrivatePtr priv; - virDomainObjPtr vm; - virDomainDefPtr def; - virDomainDefPtr persistentDef; + virQEMUDriver *driver = dom->conn->privateData; + qemuDomainObjPrivate *priv; + virDomainObj *vm; + virDomainDef *def; + virDomainDef *persistentDef; int ret = -1, r; g_autoptr(virQEMUDriverConfig) cfg = NULL; @@ -2493,11 +2493,11 @@ static int qemuDomainSetMaxMemory(virDomainPtr dom, unsigned long memory) static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - qemuDomainObjPrivatePtr priv; - virDomainObjPtr vm; - virDomainDefPtr def; - virDomainDefPtr persistentDef; + virQEMUDriver *driver = dom->conn->privateData; + qemuDomainObjPrivate *priv; + virDomainObj *vm; + virDomainDef *def; + virDomainDef *persistentDef; int ret = -1, r; g_autoptr(virQEMUDriverConfig) cfg = NULL; @@ -2567,10 +2567,10 @@ static int qemuDomainSetMemoryStatsPeriod(virDomainPtr dom, int period, static int qemuDomainInjectNMI(virDomainPtr domain, unsigned int flags) { - virQEMUDriverPtr driver = domain->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = domain->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; virCheckFlags(0, -1); @@ -2608,10 +2608,10 @@ static int qemuDomainSendKey(virDomainPtr domain, int nkeycodes, unsigned int flags) { - virQEMUDriverPtr driver = domain->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = domain->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; virCheckFlags(0, -1); @@ -2667,7 +2667,7 @@ qemuDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) { unsigned long long maxmem; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (!(vm = qemuDomainObjFromDomain(dom))) @@ -2721,7 +2721,7 @@ qemuDomainGetState(virDomainPtr dom, int *reason, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -2745,8 +2745,8 @@ qemuDomainGetControlInfo(virDomainPtr dom, virDomainControlInfoPtr info, unsigned int flags) { - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; + virDomainObj *vm; + qemuDomainObjPrivate *priv; int ret = -1; virCheckFlags(0, -1); @@ -2805,17 +2805,17 @@ qemuDomainGetControlInfo(virDomainPtr dom, * this returns (whether returning success or failure). */ static int -qemuDomainSaveInternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, const char *path, - int compressed, virCommandPtr compressor, +qemuDomainSaveInternal(virQEMUDriver *driver, + virDomainObj *vm, const char *path, + int compressed, virCommand *compressor, const char *xmlin, unsigned int flags) { g_autofree char *xml = NULL; bool was_running = false; int ret = -1; - virObjectEventPtr event = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUSaveDataPtr data = NULL; + virObjectEvent *event = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUSaveData *data = NULL; g_autoptr(qemuDomainSaveCookie) cookie = NULL; if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0)) @@ -2930,11 +2930,11 @@ static int qemuDomainSaveFlags(virDomainPtr dom, const char *path, const char *dxml, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriver *driver = dom->conn->privateData; int compressed; g_autoptr(virCommand) compressor = NULL; int ret = -1; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; g_autoptr(virQEMUDriverConfig) cfg = NULL; virCheckFlags(VIR_DOMAIN_SAVE_BYPASS_CACHE | @@ -2971,7 +2971,7 @@ qemuDomainSave(virDomainPtr dom, const char *path) } static char * -qemuDomainManagedSavePath(virQEMUDriverPtr driver, virDomainObjPtr vm) +qemuDomainManagedSavePath(virQEMUDriver *driver, virDomainObj *vm) { char *ret; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); @@ -2985,11 +2985,11 @@ qemuDomainManagedSavePath(virQEMUDriverPtr driver, virDomainObjPtr vm) static int qemuDomainManagedSave(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriver *driver = dom->conn->privateData; g_autoptr(virQEMUDriverConfig) cfg = NULL; int compressed; g_autoptr(virCommand) compressor = NULL; - virDomainObjPtr vm; + virDomainObj *vm; g_autofree char *name = NULL; int ret = -1; @@ -3035,10 +3035,10 @@ qemuDomainManagedSave(virDomainPtr dom, unsigned int flags) } static int -qemuDomainManagedSaveLoad(virDomainObjPtr vm, +qemuDomainManagedSaveLoad(virDomainObj *vm, void *opaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; g_autofree char *name = NULL; int ret = -1; @@ -3059,7 +3059,7 @@ qemuDomainManagedSaveLoad(virDomainObjPtr vm, static int qemuDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; virCheckFlags(0, -1); @@ -3080,8 +3080,8 @@ qemuDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) static int qemuDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; g_autofree char *name = NULL; @@ -3124,10 +3124,10 @@ qemuDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags) * Returns 0 on success, -1 on failure */ static int -qemuDumpWaitForCompletion(virDomainObjPtr vm) +qemuDumpWaitForCompletion(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; VIR_DEBUG("Waiting for dump completion"); while (!jobPriv->dumpCompleted && !priv->job.abortJob) { @@ -3153,13 +3153,13 @@ qemuDumpWaitForCompletion(virDomainObjPtr vm) static int -qemuDumpToFd(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDumpToFd(virQEMUDriver *driver, + virDomainObj *vm, int fd, qemuDomainAsyncJob asyncJob, const char *dumpformat) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool detach = false; int ret = -1; @@ -3208,8 +3208,8 @@ qemuDumpToFd(virQEMUDriverPtr driver, static int -doCoreDump(virQEMUDriverPtr driver, - virDomainObjPtr vm, +doCoreDump(virQEMUDriver *driver, + virDomainObj *vm, const char *path, unsigned int dump_flags, unsigned int dumpformat) @@ -3217,7 +3217,7 @@ doCoreDump(virQEMUDriverPtr driver, int fd = -1; int ret = -1; int rc = -1; - virFileWrapperFdPtr wrapperFd = NULL; + virFileWrapperFd *wrapperFd = NULL; int directFlag = 0; unsigned int flags = VIR_FILE_WRAPPER_NON_BLOCKING; const char *memory_dump_format = NULL; @@ -3312,12 +3312,12 @@ qemuDomainCoreDumpWithFormat(virDomainPtr dom, unsigned int dumpformat, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuDomainObjPrivate *priv = NULL; bool resume = false, paused = false; int ret = -1; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; virCheckFlags(VIR_DUMP_LIVE | VIR_DUMP_CRASH | VIR_DUMP_BYPASS_CACHE | VIR_DUMP_RESET | @@ -3424,9 +3424,9 @@ qemuDomainScreenshot(virDomainPtr dom, unsigned int screen, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuDomainObjPrivate *priv; g_autofree char *tmp = NULL; int tmp_fd = -1; size_t i; @@ -3528,8 +3528,8 @@ qemuDomainScreenshot(virDomainPtr dom, } static char * -getAutoDumpPath(virQEMUDriverPtr driver, - virDomainObjPtr vm) +getAutoDumpPath(virQEMUDriver *driver, + virDomainObj *vm) { const char *root = driver->embeddedRoot; g_autofree char *domname = virDomainDefGetShortName(vm->def); @@ -3553,8 +3553,8 @@ getAutoDumpPath(virQEMUDriverPtr driver, } static void -processWatchdogEvent(virQEMUDriverPtr driver, - virDomainObjPtr vm, +processWatchdogEvent(virQEMUDriver *driver, + virDomainObj *vm, int action) { int ret; @@ -3600,8 +3600,8 @@ processWatchdogEvent(virQEMUDriverPtr driver, } static int -doCoreDumpToAutoDumpPath(virQEMUDriverPtr driver, - virDomainObjPtr vm, +doCoreDumpToAutoDumpPath(virQEMUDriver *driver, + virDomainObj *vm, unsigned int flags) { int ret = -1; @@ -3621,9 +3621,9 @@ doCoreDumpToAutoDumpPath(virQEMUDriverPtr driver, static void -qemuProcessGuestPanicEventInfo(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuMonitorEventPanicInfoPtr info) +qemuProcessGuestPanicEventInfo(virQEMUDriver *driver, + virDomainObj *vm, + qemuMonitorEventPanicInfo *info) { g_autofree char *msg = qemuMonitorGuestPanicEventInfoFormatMsg(info); g_autofree char *timestamp = virTimeStringNow(); @@ -3634,13 +3634,13 @@ qemuProcessGuestPanicEventInfo(virQEMUDriverPtr driver, static void -processGuestPanicEvent(virQEMUDriverPtr driver, - virDomainObjPtr vm, +processGuestPanicEvent(virQEMUDriver *driver, + virDomainObj *vm, int action, - qemuMonitorEventPanicInfoPtr info) + qemuMonitorEventPanicInfo *info) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virObjectEventPtr event = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + virObjectEvent *event = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); bool removeInactive = false; unsigned long flags = VIR_DUMP_MEMORY_ONLY; @@ -3718,8 +3718,8 @@ processGuestPanicEvent(virQEMUDriverPtr driver, static void -processDeviceDeletedEvent(virQEMUDriverPtr driver, - virDomainObjPtr vm, +processDeviceDeletedEvent(virQEMUDriver *driver, + virDomainObj *vm, const char *devAlias) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); @@ -3756,8 +3756,8 @@ processDeviceDeletedEvent(virQEMUDriverPtr driver, static void -syncNicRxFilterMacAddr(char *ifname, virNetDevRxFilterPtr guestFilter, - virNetDevRxFilterPtr hostFilter) +syncNicRxFilterMacAddr(char *ifname, virNetDevRxFilter *guestFilter, + virNetDevRxFilter *hostFilter) { char newMacStr[VIR_MAC_STRING_BUFLEN]; @@ -3777,8 +3777,8 @@ syncNicRxFilterMacAddr(char *ifname, virNetDevRxFilterPtr guestFilter, static void -syncNicRxFilterGuestMulticast(char *ifname, virNetDevRxFilterPtr guestFilter, - virNetDevRxFilterPtr hostFilter) +syncNicRxFilterGuestMulticast(char *ifname, virNetDevRxFilter *guestFilter, + virNetDevRxFilter *hostFilter) { size_t i, j; bool found; @@ -3812,8 +3812,8 @@ syncNicRxFilterGuestMulticast(char *ifname, virNetDevRxFilterPtr guestFilter, static void -syncNicRxFilterHostMulticast(char *ifname, virNetDevRxFilterPtr guestFilter, - virNetDevRxFilterPtr hostFilter) +syncNicRxFilterHostMulticast(char *ifname, virNetDevRxFilter *guestFilter, + virNetDevRxFilter *hostFilter) { size_t i, j; bool found; @@ -3848,8 +3848,8 @@ syncNicRxFilterHostMulticast(char *ifname, virNetDevRxFilterPtr guestFilter, static void syncNicRxFilterPromiscMode(char *ifname, - virNetDevRxFilterPtr guestFilter, - virNetDevRxFilterPtr hostFilter) + virNetDevRxFilter *guestFilter, + virNetDevRxFilter *hostFilter) { bool promisc; bool setpromisc = false; @@ -3877,8 +3877,8 @@ syncNicRxFilterPromiscMode(char *ifname, static void -syncNicRxFilterMultiMode(char *ifname, virNetDevRxFilterPtr guestFilter, - virNetDevRxFilterPtr hostFilter) +syncNicRxFilterMultiMode(char *ifname, virNetDevRxFilter *guestFilter, + virNetDevRxFilter *hostFilter) { if (hostFilter->multicast.mode != guestFilter->multicast.mode || (guestFilter->multicast.overflow && @@ -3934,8 +3934,8 @@ syncNicRxFilterMultiMode(char *ifname, virNetDevRxFilterPtr guestFilter, static void -syncNicRxFilterDeviceOptions(char *ifname, virNetDevRxFilterPtr guestFilter, - virNetDevRxFilterPtr hostFilter) +syncNicRxFilterDeviceOptions(char *ifname, virNetDevRxFilter *guestFilter, + virNetDevRxFilter *hostFilter) { syncNicRxFilterPromiscMode(ifname, guestFilter, hostFilter); syncNicRxFilterMultiMode(ifname, guestFilter, hostFilter); @@ -3944,23 +3944,23 @@ syncNicRxFilterDeviceOptions(char *ifname, virNetDevRxFilterPtr guestFilter, static void syncNicRxFilterMulticast(char *ifname, - virNetDevRxFilterPtr guestFilter, - virNetDevRxFilterPtr hostFilter) + virNetDevRxFilter *guestFilter, + virNetDevRxFilter *hostFilter) { syncNicRxFilterGuestMulticast(ifname, guestFilter, hostFilter); syncNicRxFilterHostMulticast(ifname, guestFilter, hostFilter); } static void -processNicRxFilterChangedEvent(virQEMUDriverPtr driver, - virDomainObjPtr vm, +processNicRxFilterChangedEvent(virQEMUDriver *driver, + virDomainObj *vm, const char *devAlias) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev; - virDomainNetDefPtr def; - virNetDevRxFilterPtr guestFilter = NULL; - virNetDevRxFilterPtr hostFilter = NULL; + virDomainNetDef *def; + virNetDevRxFilter *guestFilter = NULL; + virNetDevRxFilter *hostFilter = NULL; int ret; VIR_DEBUG("Received NIC_RX_FILTER_CHANGED event for device %s " @@ -4058,16 +4058,16 @@ processNicRxFilterChangedEvent(virQEMUDriverPtr driver, static void -processSerialChangedEvent(virQEMUDriverPtr driver, - virDomainObjPtr vm, +processSerialChangedEvent(virQEMUDriver *driver, + virDomainObj *vm, const char *devAlias, bool connected) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); virDomainChrDeviceState newstate; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; virDomainDeviceDef dev; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (connected) newstate = VIR_DOMAIN_CHR_DEVICE_STATE_CONNECTED; @@ -4141,13 +4141,13 @@ processSerialChangedEvent(virQEMUDriverPtr driver, static void -processBlockJobEvent(virQEMUDriverPtr driver, - virDomainObjPtr vm, +processBlockJobEvent(virQEMUDriver *driver, + virDomainObj *vm, const char *diskAlias, int type, int status) { - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; g_autoptr(qemuBlockJobData) job = NULL; if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) @@ -4180,9 +4180,9 @@ processBlockJobEvent(virQEMUDriverPtr driver, static void -processJobStatusChangeEvent(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job) +processJobStatusChangeEvent(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job) { if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0) return; @@ -4200,15 +4200,15 @@ processJobStatusChangeEvent(virQEMUDriverPtr driver, static void -processMonitorEOFEvent(virQEMUDriverPtr driver, - virDomainObjPtr vm) +processMonitorEOFEvent(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int eventReason = VIR_DOMAIN_EVENT_STOPPED_SHUTDOWN; int stopReason = VIR_DOMAIN_SHUTOFF_SHUTDOWN; const char *auditReason = "shutdown"; unsigned int stopFlags = 0; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (qemuProcessBeginStopJob(driver, vm, QEMU_JOB_DESTROY, true) < 0) return; @@ -4246,9 +4246,9 @@ processMonitorEOFEvent(virQEMUDriverPtr driver, static void -processPRDisconnectEvent(virDomainObjPtr vm) +processPRDisconnectEvent(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!virDomainObjIsActive(vm)) return; @@ -4260,8 +4260,8 @@ processPRDisconnectEvent(virDomainObjPtr vm) static void -processRdmaGidStatusChangedEvent(virDomainObjPtr vm, - qemuMonitorRdmaGidStatusPtr info) +processRdmaGidStatusChangedEvent(virDomainObj *vm, + qemuMonitorRdmaGidStatus *info) { unsigned int prefix_len; virSocketAddr addr; @@ -4304,10 +4304,10 @@ processRdmaGidStatusChangedEvent(virDomainObjPtr vm, static void -processGuestCrashloadedEvent(virQEMUDriverPtr driver, - virDomainObjPtr vm) +processGuestCrashloadedEvent(virQEMUDriver *driver, + virDomainObj *vm) { - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_CRASHED, @@ -4320,8 +4320,8 @@ processGuestCrashloadedEvent(virQEMUDriverPtr driver, static void qemuProcessEventHandler(void *data, void *opaque) { struct qemuProcessEvent *processEvent = data; - virDomainObjPtr vm = processEvent->vm; - virQEMUDriverPtr driver = opaque; + virDomainObj *vm = processEvent->vm; + virQEMUDriver *driver = opaque; VIR_DEBUG("vm=%p, event=%d", vm, processEvent->eventType); @@ -4376,11 +4376,11 @@ static void qemuProcessEventHandler(void *data, void *opaque) static int -qemuDomainSetVcpusAgent(virDomainObjPtr vm, +qemuDomainSetVcpusAgent(virDomainObj *vm, unsigned int nvcpus) { - qemuAgentCPUInfoPtr cpuinfo = NULL; - qemuAgentPtr agent; + qemuAgentCPUInfo *cpuinfo = NULL; + qemuAgent *agent; int ncpuinfo; int ret = -1; @@ -4421,14 +4421,14 @@ qemuDomainSetVcpusAgent(virDomainObjPtr vm, static int -qemuDomainSetVcpusMax(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDefPtr def, - virDomainDefPtr persistentDef, +qemuDomainSetVcpusMax(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDef *def, + virDomainDef *persistentDef, unsigned int nvcpus) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; unsigned int topologycpus; if (def) { @@ -4474,10 +4474,10 @@ qemuDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - virDomainDefPtr def; - virDomainDefPtr persistentDef; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + virDomainDef *def; + virDomainDef *persistentDef; bool hotpluggable = !!(flags & VIR_DOMAIN_VCPU_HOTPLUGGABLE); bool useAgent = !!(flags & VIR_DOMAIN_VCPU_GUEST); int ret = -1; @@ -4534,19 +4534,19 @@ qemuDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) static int -qemuDomainPinVcpuLive(virDomainObjPtr vm, - virDomainDefPtr def, +qemuDomainPinVcpuLive(virDomainObj *vm, + virDomainDef *def, int vcpu, - virQEMUDriverPtr driver, - virQEMUDriverConfigPtr cfg, - virBitmapPtr cpumap) + virQEMUDriver *driver, + virQEMUDriverConfig *cfg, + virBitmap *cpumap) { - virBitmapPtr tmpmap = NULL; - virDomainVcpuDefPtr vcpuinfo; - qemuDomainObjPrivatePtr priv = vm->privateData; + virBitmap *tmpmap = NULL; + virDomainVcpuDef *vcpuinfo; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virCgroup) cgroup_vcpu = NULL; g_autofree char *str = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; char paramField[VIR_TYPED_PARAM_FIELD_LENGTH] = ""; virTypedParameterPtr eventParams = NULL; int eventNparams = 0; @@ -4620,13 +4620,13 @@ qemuDomainPinVcpuFlags(virDomainPtr dom, int maplen, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virDomainDefPtr def; - virDomainDefPtr persistentDef; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + virDomainDef *def; + virDomainDef *persistentDef; int ret = -1; - virBitmapPtr pcpumap = NULL; - virDomainVcpuDefPtr vcpuinfo = NULL; + virBitmap *pcpumap = NULL; + virDomainVcpuDef *vcpuinfo = NULL; g_autoptr(virQEMUDriverConfig) cfg = NULL; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -4704,12 +4704,12 @@ qemuDomainGetVcpuPinInfo(virDomainPtr dom, int maplen, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def; + virDomainObj *vm = NULL; + virDomainDef *def; bool live; int ret = -1; g_autoptr(virBitmap) hostcpus = NULL; - virBitmapPtr autoCpuset = NULL; + virBitmap *autoCpuset = NULL; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -4742,16 +4742,16 @@ qemuDomainPinEmulator(virDomainPtr dom, int maplen, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; g_autoptr(virCgroup) cgroup_emulator = NULL; - virDomainDefPtr def; - virDomainDefPtr persistentDef; + virDomainDef *def; + virDomainDef *persistentDef; int ret = -1; - qemuDomainObjPrivatePtr priv; - virBitmapPtr pcpumap = NULL; + qemuDomainObjPrivate *priv; + virBitmap *pcpumap = NULL; g_autoptr(virQEMUDriverConfig) cfg = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; g_autofree char *str = NULL; virTypedParameterPtr eventParams = NULL; int eventNparams = 0; @@ -4844,13 +4844,13 @@ qemuDomainGetEmulatorPinInfo(virDomainPtr dom, int maplen, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def; + virDomainObj *vm = NULL; + virDomainDef *def; bool live; int ret = -1; - virBitmapPtr cpumask = NULL; + virBitmap *cpumask = NULL; g_autoptr(virBitmap) bitmap = NULL; - virBitmapPtr autoCpuset = NULL; + virBitmap *autoCpuset = NULL; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -4896,7 +4896,7 @@ qemuDomainGetVcpus(virDomainPtr dom, unsigned char *cpumaps, int maplen) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (!(vm = qemuDomainObjFromDomain(dom))) @@ -4922,12 +4922,12 @@ qemuDomainGetVcpus(virDomainPtr dom, static int qemuDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virDomainDefPtr def; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + virDomainDef *def; int ret = -1; - qemuAgentCPUInfoPtr cpuinfo = NULL; - qemuAgentPtr agent; + qemuAgentCPUInfo *cpuinfo = NULL; + qemuAgent *agent; int ncpuinfo = -1; size_t i; @@ -5003,12 +5003,12 @@ qemuDomainGetMaxVcpus(virDomainPtr dom) static int -qemuDomainGetIOThreadsMon(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuMonitorIOThreadInfoPtr **iothreads, +qemuDomainGetIOThreadsMon(virQEMUDriver *driver, + virDomainObj *vm, + qemuMonitorIOThreadInfo ***iothreads, int *niothreads) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret = -1; qemuDomainObjEnterMonitor(driver, vm); @@ -5021,12 +5021,12 @@ qemuDomainGetIOThreadsMon(virQEMUDriverPtr driver, static int -qemuDomainGetIOThreadsLive(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainGetIOThreadsLive(virQEMUDriver *driver, + virDomainObj *vm, virDomainIOThreadInfoPtr **info) { - qemuDomainObjPrivatePtr priv; - qemuMonitorIOThreadInfoPtr *iothreads = NULL; + qemuDomainObjPrivate *priv; + qemuMonitorIOThreadInfo **iothreads = NULL; virDomainIOThreadInfoPtr *info_ret = NULL; int niothreads = 0; size_t i; @@ -5060,7 +5060,7 @@ qemuDomainGetIOThreadsLive(virQEMUDriverPtr driver, info_ret = g_new0(virDomainIOThreadInfoPtr, niothreads); for (i = 0; i < niothreads; i++) { - virBitmapPtr map = NULL; + virBitmap *map = NULL; info_ret[i] = g_new0(virDomainIOThreadInfo, 1); info_ret[i]->iothread_id = iothreads[i]->iothread_id; @@ -5098,12 +5098,12 @@ qemuDomainGetIOThreadsLive(virQEMUDriverPtr driver, } static int -qemuDomainGetIOThreadsConfig(virDomainDefPtr targetDef, +qemuDomainGetIOThreadsConfig(virDomainDef *targetDef, virDomainIOThreadInfoPtr **info) { virDomainIOThreadInfoPtr *info_ret = NULL; - virBitmapPtr bitmap = NULL; - virBitmapPtr cpumask = NULL; + virBitmap *bitmap = NULL; + virBitmap *cpumask = NULL; size_t i; int ret = -1; @@ -5154,9 +5154,9 @@ qemuDomainGetIOThreadInfo(virDomainPtr dom, virDomainIOThreadInfoPtr **info, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virDomainDefPtr targetDef = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + virDomainDef *targetDef = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -5189,15 +5189,15 @@ qemuDomainPinIOThread(virDomainPtr dom, unsigned int flags) { int ret = -1; - virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriver *driver = dom->conn->privateData; g_autoptr(virQEMUDriverConfig) cfg = NULL; - virDomainObjPtr vm; - virDomainDefPtr def; - virDomainDefPtr persistentDef; - virBitmapPtr pcpumap = NULL; - qemuDomainObjPrivatePtr priv; + virDomainObj *vm; + virDomainDef *def; + virDomainDef *persistentDef; + virBitmap *pcpumap = NULL; + qemuDomainObjPrivate *priv; g_autoptr(virCgroup) cgroup_iothread = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; char paramField[VIR_TYPED_PARAM_FIELD_LENGTH] = ""; g_autofree char *str = NULL; virTypedParameterPtr eventParams = NULL; @@ -5232,8 +5232,8 @@ qemuDomainPinIOThread(virDomainPtr dom, } if (def) { - virDomainIOThreadIDDefPtr iothrid; - virBitmapPtr cpumask; + virDomainIOThreadIDDef *iothrid; + virBitmap *cpumask; if (!(iothrid = virDomainIOThreadIDFind(def, iothread_id))) { virReportError(VIR_ERR_INVALID_ARG, @@ -5282,8 +5282,8 @@ qemuDomainPinIOThread(virDomainPtr dom, } if (persistentDef) { - virDomainIOThreadIDDefPtr iothrid; - virBitmapPtr cpumask; + virDomainIOThreadIDDef *iothrid; + virBitmap *cpumask; if (!(iothrid = virDomainIOThreadIDFind(persistentDef, iothread_id))) { virReportError(VIR_ERR_INVALID_ARG, @@ -5315,20 +5315,20 @@ qemuDomainPinIOThread(virDomainPtr dom, } static int -qemuDomainHotplugAddIOThread(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainHotplugAddIOThread(virQEMUDriver *driver, + virDomainObj *vm, unsigned int iothread_id) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *alias = NULL; size_t idx; int ret = -1; unsigned int orig_niothreads = vm->def->niothreadids; unsigned int exp_niothreads = vm->def->niothreadids; int new_niothreads = 0; - qemuMonitorIOThreadInfoPtr *new_iothreads = NULL; - virDomainIOThreadIDDefPtr iothrid; - virJSONValuePtr props = NULL; + qemuMonitorIOThreadInfo **new_iothreads = NULL; + virDomainIOThreadIDDef *iothrid; + virJSONValue *props = NULL; if (!(alias = g_strdup_printf("iothread%u", iothread_id))) return -1; @@ -5405,11 +5405,11 @@ qemuDomainHotplugAddIOThread(virQEMUDriverPtr driver, static int -qemuDomainHotplugModIOThread(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainHotplugModIOThread(virQEMUDriver *driver, + virDomainObj *vm, qemuMonitorIOThreadInfo iothread) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int rc; if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_IOTHREAD_POLLING)) { @@ -5433,11 +5433,11 @@ qemuDomainHotplugModIOThread(virQEMUDriverPtr driver, static int -qemuDomainHotplugDelIOThread(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainHotplugDelIOThread(virQEMUDriver *driver, + virDomainObj *vm, unsigned int iothread_id) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; size_t idx; g_autofree char *alias = NULL; int rc = -1; @@ -5445,7 +5445,7 @@ qemuDomainHotplugDelIOThread(virQEMUDriverPtr driver, unsigned int orig_niothreads = vm->def->niothreadids; unsigned int exp_niothreads = vm->def->niothreadids; int new_niothreads = 0; - qemuMonitorIOThreadInfoPtr *new_iothreads = NULL; + qemuMonitorIOThreadInfo **new_iothreads = NULL; if (!(alias = g_strdup_printf("iothread%u", iothread_id))) return -1; @@ -5496,7 +5496,7 @@ qemuDomainHotplugDelIOThread(virQEMUDriverPtr driver, static int -qemuDomainAddIOThreadCheck(virDomainDefPtr def, +qemuDomainAddIOThreadCheck(virDomainDef *def, unsigned int iothread_id) { if (virDomainIOThreadIDFind(def, iothread_id)) { @@ -5511,7 +5511,7 @@ qemuDomainAddIOThreadCheck(virDomainDefPtr def, static int -qemuDomainDelIOThreadCheck(virDomainDefPtr def, +qemuDomainDelIOThreadCheck(virDomainDef *def, unsigned int iothread_id) { size_t i; @@ -5582,7 +5582,7 @@ qemuDomainDelIOThreadCheck(virDomainDefPtr def, static int qemuDomainIOThreadParseParams(virTypedParameterPtr params, int nparams, - qemuMonitorIOThreadInfoPtr iothread) + qemuMonitorIOThreadInfo *iothread) { int rc; @@ -5649,16 +5649,16 @@ typedef enum { } virDomainIOThreadAction; static int -qemuDomainChgIOThread(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainChgIOThread(virQEMUDriver *driver, + virDomainObj *vm, qemuMonitorIOThreadInfo iothread, virDomainIOThreadAction action, unsigned int flags) { g_autoptr(virQEMUDriverConfig) cfg = NULL; - qemuDomainObjPrivatePtr priv; - virDomainDefPtr def; - virDomainDefPtr persistentDef; + qemuDomainObjPrivate *priv; + virDomainDef *def; + virDomainDef *persistentDef; int ret = -1; cfg = virQEMUDriverGetConfig(driver); @@ -5762,8 +5762,8 @@ qemuDomainAddIOThread(virDomainPtr dom, unsigned int iothread_id, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; qemuMonitorIOThreadInfo iothread = {0}; int ret = -1; @@ -5797,8 +5797,8 @@ qemuDomainDelIOThread(virDomainPtr dom, unsigned int iothread_id, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; qemuMonitorIOThreadInfo iothread = {0}; int ret = -1; @@ -5845,8 +5845,8 @@ qemuDomainSetIOThreadParams(virDomainPtr dom, int nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; qemuMonitorIOThreadInfo iothread = {0}; int ret = -1; @@ -5880,8 +5880,8 @@ qemuDomainSetIOThreadParams(virDomainPtr dom, static int qemuDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr seclabel) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; memset(seclabel, 0, sizeof(*seclabel)); @@ -5899,7 +5899,7 @@ static int qemuDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secl * * Comment from Dan Berrange: * - * Well the PID as stored in the virDomainObjPtr can't be changed + * Well the PID as stored in the virDomainObj *can't be changed * because you've got a locked object. The OS level PID could have * exited, though and in extreme circumstances have cycled through all * PIDs back to ours. We could sanity check that our PID still exists @@ -5922,8 +5922,8 @@ static int qemuDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr secl static int qemuDomainGetSecurityLabelList(virDomainPtr dom, virSecurityLabelPtr* seclabels) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; size_t i; int ret = -1; @@ -5942,7 +5942,7 @@ static int qemuDomainGetSecurityLabelList(virDomainPtr dom, ret = 0; } else { int len = 0; - virSecurityManagerPtr* mgrs = qemuSecurityGetNested(driver->securityManager); + virSecurityManager ** mgrs = qemuSecurityGetNested(driver->securityManager); if (!mgrs) goto cleanup; @@ -5975,7 +5975,7 @@ static int qemuDomainGetSecurityLabelList(virDomainPtr dom, static int qemuNodeGetSecurityModel(virConnectPtr conn, virSecurityModelPtr secmodel) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; g_autoptr(virCaps) caps = NULL; memset(secmodel, 0, sizeof(*secmodel)); @@ -6015,16 +6015,16 @@ qemuDomainRestoreFlags(virConnectPtr conn, const char *dxml, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; - qemuDomainObjPrivatePtr priv = NULL; + virQEMUDriver *driver = conn->privateData; + qemuDomainObjPrivate *priv = NULL; g_autoptr(virDomainDef) def = NULL; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; g_autofree char *xmlout = NULL; const char *newxml = dxml; int fd = -1; int ret = -1; - virQEMUSaveDataPtr data = NULL; - virFileWrapperFdPtr wrapperFd = NULL; + virQEMUSaveData *data = NULL; + virFileWrapperFd *wrapperFd = NULL; bool hook_taint = false; virCheckFlags(VIR_DOMAIN_SAVE_BYPASS_CACHE | @@ -6062,7 +6062,7 @@ qemuDomainRestoreFlags(virConnectPtr conn, } if (newxml) { - virDomainDefPtr tmp; + virDomainDef *tmp; if (!(tmp = qemuSaveImageUpdateDef(driver, def, newxml))) goto cleanup; @@ -6121,11 +6121,11 @@ static char * qemuDomainSaveImageGetXMLDesc(virConnectPtr conn, const char *path, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; char *ret = NULL; g_autoptr(virDomainDef) def = NULL; int fd = -1; - virQEMUSaveDataPtr data = NULL; + virQEMUSaveData *data = NULL; virCheckFlags(VIR_DOMAIN_SAVE_IMAGE_XML_SECURE, NULL); @@ -6150,12 +6150,12 @@ static int qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, const char *dxml, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; int ret = -1; g_autoptr(virDomainDef) def = NULL; g_autoptr(virDomainDef) newdef = NULL; int fd = -1; - virQEMUSaveDataPtr data = NULL; + virQEMUSaveData *data = NULL; int state = -1; virCheckFlags(VIR_DOMAIN_SAVE_RUNNING | @@ -6220,14 +6220,14 @@ qemuDomainSaveImageDefineXML(virConnectPtr conn, const char *path, static char * qemuDomainManagedSaveGetXMLDesc(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; g_autofree char *path = NULL; char *ret = NULL; g_autoptr(virDomainDef) def = NULL; int fd = -1; - virQEMUSaveDataPtr data = NULL; - qemuDomainObjPrivatePtr priv; + virQEMUSaveData *data = NULL; + qemuDomainObjPrivate *priv; virCheckFlags(VIR_DOMAIN_SAVE_IMAGE_XML_SECURE, NULL); @@ -6265,9 +6265,9 @@ static int qemuDomainManagedSaveDefineXML(virDomainPtr dom, const char *dxml, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriver *driver = dom->conn->privateData; virConnectPtr conn = dom->conn; - virDomainObjPtr vm; + virDomainObj *vm; g_autofree char *path = NULL; int ret = -1; @@ -6297,20 +6297,20 @@ qemuDomainManagedSaveDefineXML(virDomainPtr dom, const char *dxml, * and -1 on failure with error raised. */ static int qemuDomainObjRestore(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, + virQEMUDriver *driver, + virDomainObj *vm, const char *path, bool start_paused, bool bypass_cache, qemuDomainAsyncJob asyncJob) { g_autoptr(virDomainDef) def = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int fd = -1; int ret = -1; g_autofree char *xmlout = NULL; - virQEMUSaveDataPtr data = NULL; - virFileWrapperFdPtr wrapperFd = NULL; + virQEMUSaveData *data = NULL; + virFileWrapperFd *wrapperFd = NULL; fd = qemuSaveImageOpen(driver, NULL, path, &def, &data, bypass_cache, &wrapperFd, false, true); @@ -6330,7 +6330,7 @@ qemuDomainObjRestore(virConnectPtr conn, goto cleanup; if (hookret == 0 && !virStringIsEmpty(xmlout)) { - virDomainDefPtr tmp; + virDomainDef *tmp; VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout); @@ -6377,8 +6377,8 @@ static char *qemuDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; char *ret = NULL; virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS | VIR_DOMAIN_XML_UPDATE_CPU, @@ -6411,15 +6411,15 @@ static char static int -qemuConnectDomainXMLToNativePrepareHostHostdev(virDomainHostdevDefPtr hostdev) +qemuConnectDomainXMLToNativePrepareHostHostdev(virDomainHostdevDef *hostdev) { if (virHostdevIsSCSIDevice(hostdev)) { - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; switch ((virDomainHostdevSCSIProtocolType) scsisrc->protocol) { case VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_NONE: { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; - virStorageSourcePtr src = scsisrc->u.host.src; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; + virStorageSource *src = scsisrc->u.host.src; g_autofree char *devstr = NULL; if (!(devstr = virSCSIDeviceGetSgName(NULL, @@ -6448,12 +6448,12 @@ qemuConnectDomainXMLToNativePrepareHostHostdev(virDomainHostdevDefPtr hostdev) static int -qemuConnectDomainXMLToNativePrepareHost(virDomainObjPtr vm) +qemuConnectDomainXMLToNativePrepareHost(virDomainObj *vm) { size_t i; for (i = 0; i < vm->def->nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = vm->def->hostdevs[i]; + virDomainHostdevDef *hostdev = vm->def->hostdevs[i]; if (qemuConnectDomainXMLToNativePrepareHostHostdev(hostdev) < 0) return -1; @@ -6468,9 +6468,9 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn, const char *xmlData, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; - virDomainObjPtr vm = NULL; - virCommandPtr cmd = NULL; + virQEMUDriver *driver = conn->privateData; + virDomainObj *vm = NULL; + virCommand *cmd = NULL; char *ret = NULL; size_t i; @@ -6499,8 +6499,8 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn, * config and assume the user has suitable 'ifup-qemu' scripts */ for (i = 0; i < vm->def->nnets; i++) { - virDomainNetDefPtr net = vm->def->nets[i]; - virDomainNetDefPtr newNet = virDomainNetDefNew(driver->xmlopt); + virDomainNetDef *net = vm->def->nets[i]; + virDomainNetDef *newNet = virDomainNetDefNew(driver->xmlopt); if (!newNet) goto cleanup; @@ -6538,7 +6538,7 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn, static int qemuConnectListDefinedDomains(virConnectPtr conn, char **const names, int nnames) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; if (virConnectListDefinedDomainsEnsureACL(conn) < 0) return -1; @@ -6550,7 +6550,7 @@ static int qemuConnectListDefinedDomains(virConnectPtr conn, static int qemuConnectNumOfDefinedDomains(virConnectPtr conn) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; if (virConnectNumOfDefinedDomainsEnsureACL(conn) < 0) return -1; @@ -6563,8 +6563,8 @@ static int qemuConnectNumOfDefinedDomains(virConnectPtr conn) static int qemuDomainObjStart(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, + virQEMUDriver *driver, + virDomainObj *vm, unsigned int flags, qemuDomainAsyncJob asyncJob) { @@ -6575,7 +6575,7 @@ qemuDomainObjStart(virConnectPtr conn, bool bypass_cache = (flags & VIR_DOMAIN_START_BYPASS_CACHE) != 0; bool force_boot = (flags & VIR_DOMAIN_START_FORCE_BOOT) != 0; unsigned int start_flags = VIR_QEMU_PROCESS_START_COLD; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; start_flags |= start_paused ? VIR_QEMU_PROCESS_START_PAUSED : 0; start_flags |= autodestroy ? VIR_QEMU_PROCESS_START_AUTODESTROY : 0; @@ -6629,7 +6629,7 @@ qemuDomainObjStart(virConnectPtr conn, VIR_NETDEV_VPORT_PROFILE_OP_CREATE, start_flags); virDomainAuditStart(vm, "booted", ret >= 0); if (ret >= 0) { - virObjectEventPtr event = + virObjectEvent *event = virDomainEventLifecycleNewFromObj(vm, VIR_DOMAIN_EVENT_STARTED, VIR_DOMAIN_EVENT_STARTED_BOOTED); @@ -6648,8 +6648,8 @@ qemuDomainObjStart(virConnectPtr conn, static int qemuDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; virCheckFlags(VIR_DOMAIN_START_PAUSED | @@ -6702,12 +6702,12 @@ qemuDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; g_autoptr(virDomainDef) def = NULL; g_autoptr(virDomainDef) oldDef = NULL; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; virDomainPtr dom = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE | VIR_DOMAIN_DEF_PARSE_ABI_UPDATE; @@ -6784,9 +6784,9 @@ static int qemuDomainUndefineFlags(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virObjectEventPtr event = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + virObjectEvent *event = NULL; g_autofree char *name = NULL; int ret = -1; int nsnapshots; @@ -6926,9 +6926,9 @@ qemuDomainUndefine(virDomainPtr dom) } static int -qemuDomainAttachDeviceLive(virDomainObjPtr vm, - virDomainDeviceDefPtr dev, - virQEMUDriverPtr driver) +qemuDomainAttachDeviceLive(virDomainObj *vm, + virDomainDeviceDef *dev, + virQEMUDriver *driver) { int ret = -1; const char *alias = NULL; @@ -7070,7 +7070,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm, /* queue the event before the alias has a chance to get freed * if the domain disappears while qemuDomainUpdateDeviceList * is in monitor */ - virObjectEventPtr event; + virObjectEvent *event; event = virDomainEventDeviceAddedNewFromObj(vm, alias); virObjectEventStateQueue(driver->domainEventState, event); } @@ -7083,13 +7083,13 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm, static int -qemuDomainChangeDiskLive(virDomainObjPtr vm, - virDomainDeviceDefPtr dev, - virQEMUDriverPtr driver, +qemuDomainChangeDiskLive(virDomainObj *vm, + virDomainDeviceDef *dev, + virQEMUDriver *driver, bool force) { - virDomainDiskDefPtr disk = dev->data.disk; - virDomainDiskDefPtr orig_disk = NULL; + virDomainDiskDef *disk = dev->data.disk; + virDomainDiskDef *orig_disk = NULL; virDomainDeviceDef oldDev = { .type = dev->type }; if (!(orig_disk = virDomainDiskByTarget(vm->def, disk->dst))) { @@ -7131,12 +7131,12 @@ qemuDomainChangeDiskLive(virDomainObjPtr vm, } static int -qemuDomainUpdateDeviceLive(virDomainObjPtr vm, - virDomainDeviceDefPtr dev, +qemuDomainUpdateDeviceLive(virDomainObj *vm, + virDomainDeviceDef *dev, virDomainPtr dom, bool force) { - virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriver *driver = dom->conn->privateData; virDomainDeviceDef oldDev = { .type = dev->type }; int ret = -1; int idx; @@ -7221,21 +7221,21 @@ qemuCheckDiskConfigAgainstDomain(const virDomainDef *def, static int -qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef, - virDomainDeviceDefPtr dev, - virQEMUCapsPtr qemuCaps, +qemuDomainAttachDeviceConfig(virDomainDef *vmdef, + virDomainDeviceDef *dev, + virQEMUCaps *qemuCaps, unsigned int parse_flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { - virDomainDiskDefPtr disk; - virDomainNetDefPtr net; - virDomainSoundDefPtr sound; - virDomainHostdevDefPtr hostdev; - virDomainLeaseDefPtr lease; - virDomainControllerDefPtr controller; - virDomainFSDefPtr fs; - virDomainRedirdevDefPtr redirdev; - virDomainShmemDefPtr shmem; + virDomainDiskDef *disk; + virDomainNetDef *net; + virDomainSoundDef *sound; + virDomainHostdevDef *hostdev; + virDomainLeaseDef *lease; + virDomainControllerDef *controller; + virDomainFSDef *fs; + virDomainRedirdevDef *redirdev; + virDomainShmemDef *shmem; switch ((virDomainDeviceType)dev->type) { case VIR_DOMAIN_DEVICE_DISK: @@ -7426,25 +7426,25 @@ qemuDomainAttachDeviceConfig(virDomainDefPtr vmdef, static int -qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, - virDomainDeviceDefPtr dev, - virQEMUCapsPtr qemuCaps, +qemuDomainDetachDeviceConfig(virDomainDef *vmdef, + virDomainDeviceDef *dev, + virQEMUCaps *qemuCaps, unsigned int parse_flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { - virDomainDiskDefPtr disk; - virDomainDiskDefPtr det_disk; - virDomainNetDefPtr net; - virDomainSoundDefPtr sound; - virDomainHostdevDefPtr hostdev; - virDomainHostdevDefPtr det_hostdev; - virDomainLeaseDefPtr lease; - virDomainLeaseDefPtr det_lease; - virDomainControllerDefPtr cont; - virDomainControllerDefPtr det_cont; - virDomainChrDefPtr chr; - virDomainFSDefPtr fs; - virDomainMemoryDefPtr mem; + virDomainDiskDef *disk; + virDomainDiskDef *det_disk; + virDomainNetDef *net; + virDomainSoundDef *sound; + virDomainHostdevDef *hostdev; + virDomainHostdevDef *det_hostdev; + virDomainLeaseDef *lease; + virDomainLeaseDef *det_lease; + virDomainControllerDef *cont; + virDomainControllerDef *det_cont; + virDomainChrDef *chr; + virDomainFSDef *fs; + virDomainMemoryDef *mem; int idx; switch ((virDomainDeviceType)dev->type) { @@ -7632,15 +7632,15 @@ qemuDomainDetachDeviceConfig(virDomainDefPtr vmdef, } static int -qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef, - virDomainDeviceDefPtr dev, - virQEMUCapsPtr qemuCaps, +qemuDomainUpdateDeviceConfig(virDomainDef *vmdef, + virDomainDeviceDef *dev, + virQEMUCaps *qemuCaps, unsigned int parse_flags, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { - virDomainDiskDefPtr newDisk; - virDomainGraphicsDefPtr newGraphics; - virDomainNetDefPtr net; + virDomainDiskDef *newDisk; + virDomainGraphicsDef *newGraphics; + virDomainNetDef *net; virDomainDeviceDef oldDev = { .type = dev->type }; int pos; @@ -7742,7 +7742,7 @@ qemuDomainUpdateDeviceConfig(virDomainDefPtr vmdef, static void qemuDomainAttachDeviceLiveAndConfigHomogenize(const virDomainDeviceDef *devConf, - virDomainDeviceDefPtr devLive) + virDomainDeviceDef *devLive) { /* * Fixup anything that needs to be identical in the live and @@ -7769,12 +7769,12 @@ qemuDomainAttachDeviceLiveAndConfigHomogenize(const virDomainDeviceDef *devConf, static int -qemuDomainAttachDeviceLiveAndConfig(virDomainObjPtr vm, - virQEMUDriverPtr driver, +qemuDomainAttachDeviceLiveAndConfig(virDomainObj *vm, + virQEMUDriver *driver, const char *xml, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virDomainDef) vmdef = NULL; g_autoptr(virQEMUDriverConfig) cfg = NULL; g_autoptr(virDomainDeviceDef) devConf = NULL; @@ -7870,8 +7870,8 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom, const char *xml, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; virNWFilterReadLockFilterUpdates(); @@ -7913,12 +7913,12 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuDomainObjPrivate *priv; g_autoptr(virDomainDef) vmdef = NULL; g_autoptr(virDomainDeviceDef) dev = NULL; - virDomainDeviceDefPtr dev_copy = NULL; + virDomainDeviceDef *dev_copy = NULL; bool force = (flags & VIR_DOMAIN_DEVICE_MODIFY_FORCE) != 0; int ret = -1; g_autoptr(virQEMUDriverConfig) cfg = NULL; @@ -8020,15 +8020,15 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom, } static int -qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainDetachDeviceLiveAndConfig(virQEMUDriver *driver, + virDomainObj *vm, const char *xml, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = NULL; g_autoptr(virDomainDeviceDef) dev = NULL; - virDomainDeviceDefPtr dev_copy = NULL; + virDomainDeviceDef *dev_copy = NULL; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; g_autoptr(virDomainDef) vmdef = NULL; int ret = -1; @@ -8109,15 +8109,15 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver, static int -qemuDomainDetachDeviceAliasLiveAndConfig(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainDetachDeviceAliasLiveAndConfig(virQEMUDriver *driver, + virDomainObj *vm, const char *alias, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = NULL; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; g_autoptr(virDomainDef) vmdef = NULL; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE; @@ -8178,8 +8178,8 @@ qemuDomainDetachDeviceFlags(virDomainPtr dom, const char *xml, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; if (!(vm = qemuDomainObjFromDomain(dom))) @@ -8213,8 +8213,8 @@ qemuDomainDetachDeviceAlias(virDomainPtr dom, const char *alias, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; if (!(vm = qemuDomainObjFromDomain(dom))) @@ -8252,7 +8252,7 @@ static int qemuDomainDetachDevice(virDomainPtr dom, const char *xml) static int qemuDomainGetAutostart(virDomainPtr dom, int *autostart) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (!(vm = qemuDomainObjFromDomain(dom))) @@ -8272,8 +8272,8 @@ static int qemuDomainGetAutostart(virDomainPtr dom, static int qemuDomainSetAutostart(virDomainPtr dom, int autostart) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; g_autofree char *configFile = NULL; g_autofree char *autostartLink = NULL; int ret = -1; @@ -8348,9 +8348,9 @@ static char *qemuDomainGetSchedulerType(virDomainPtr dom, int *nparams) { char *ret = NULL; - virDomainObjPtr vm = NULL; - qemuDomainObjPrivatePtr priv; - virQEMUDriverPtr driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuDomainObjPrivate *priv; + virQEMUDriver *driver = dom->conn->privateData; if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; @@ -8401,13 +8401,13 @@ qemuDomainSetBlkioParameters(virDomainPtr dom, int nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - virDomainDefPtr def; - virDomainDefPtr persistentDef; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + virDomainDef *def; + virDomainDef *persistentDef; int ret = -1; g_autoptr(virQEMUDriverConfig) cfg = NULL; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -8490,14 +8490,14 @@ qemuDomainGetBlkioParameters(virDomainPtr dom, int *nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; int maxparams = QEMU_NB_BLKIO_PARAM; unsigned int val; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG | @@ -8581,13 +8581,13 @@ qemuDomainSetMemoryParameters(virDomainPtr dom, int nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; + virDomainObj *vm = NULL; g_autoptr(virQEMUDriverConfig) cfg = NULL; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG, -1); @@ -8669,11 +8669,11 @@ qemuDomainGetMemoryParameters(virDomainPtr dom, int *nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - virDomainDefPtr persistentDef = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + virDomainDef *persistentDef = NULL; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; unsigned long long swap_hard_limit, mem_hard_limit, mem_soft_limit; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -8744,11 +8744,11 @@ qemuDomainGetMemoryParameters(virDomainPtr dom, #undef QEMU_ASSIGN_MEM_PARAM static int -qemuDomainSetNumaParamsLive(virDomainObjPtr vm, - virBitmapPtr nodeset) +qemuDomainSetNumaParamsLive(virDomainObj *vm, + virBitmap *nodeset) { g_autoptr(virCgroup) cgroup_thread = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *nodeset_str = NULL; virDomainNumatuneMemMode mode; size_t i = 0; @@ -8775,7 +8775,7 @@ qemuDomainSetNumaParamsLive(virDomainObjPtr vm, for (i = 0; i < virDomainDefGetVcpusMax(vm->def); i++) { g_autoptr(virCgroup) cgroup_vcpu = NULL; - virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, i); + virDomainVcpuDef *vcpu = virDomainDefGetVcpu(vm->def, i); if (!vcpu->online) continue; @@ -8809,15 +8809,15 @@ qemuDomainSetNumaParameters(virDomainPtr dom, int nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriver *driver = dom->conn->privateData; size_t i; - virDomainDefPtr def; - virDomainDefPtr persistentDef; - virDomainObjPtr vm = NULL; + virDomainDef *def; + virDomainDef *persistentDef; + virDomainObj *vm = NULL; int ret = -1; g_autoptr(virQEMUDriverConfig) cfg = NULL; - qemuDomainObjPrivatePtr priv; - virBitmapPtr nodeset = NULL; + qemuDomainObjPrivate *priv; + virBitmap *nodeset = NULL; virDomainNumatuneMemMode config_mode; int mode = -1; @@ -8937,14 +8937,14 @@ qemuDomainGetNumaParameters(virDomainPtr dom, unsigned int flags) { size_t i; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; virDomainNumatuneMemMode tmpmode = VIR_DOMAIN_NUMATUNE_MEM_STRICT; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; g_autofree char *nodeset = NULL; int ret = -1; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; bool live = false; - virBitmapPtr autoNodeset = NULL; + virBitmap *autoNodeset = NULL; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG | @@ -9009,7 +9009,7 @@ qemuDomainGetNumaParameters(virDomainPtr dom, } static int -qemuSetGlobalBWLive(virCgroupPtr cgroup, unsigned long long period, +qemuSetGlobalBWLive(virCgroup *cgroup, unsigned long long period, long long quota) { if (period == 0 && quota == 0) @@ -9027,13 +9027,13 @@ qemuDomainSetPerfEvents(virDomainPtr dom, int nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriver *driver = dom->conn->privateData; size_t i; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; g_autoptr(virQEMUDriverConfig) cfg = NULL; - qemuDomainObjPrivatePtr priv; - virDomainDefPtr def; - virDomainDefPtr persistentDef; + qemuDomainObjPrivate *priv; + virDomainDef *def; + virDomainDef *persistentDef; int ret = -1; virPerfEventType type; bool enabled; @@ -9131,10 +9131,10 @@ qemuDomainGetPerfEvents(virDomainPtr dom, int *nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - qemuDomainObjPrivatePtr priv; - virDomainDefPtr def; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuDomainObjPrivate *priv; + virDomainDef *def; virTypedParameterPtr par = NULL; int maxpar = 0; int npar = 0; @@ -9189,7 +9189,7 @@ qemuDomainGetPerfEvents(virDomainPtr dom, } static int -qemuSetVcpusBWLive(virDomainObjPtr vm, virCgroupPtr cgroup, +qemuSetVcpusBWLive(virDomainObj *vm, virCgroup *cgroup, unsigned long long period, long long quota) { size_t i; @@ -9202,7 +9202,7 @@ qemuSetVcpusBWLive(virDomainObjPtr vm, virCgroupPtr cgroup, for (i = 0; i < virDomainDefGetVcpusMax(vm->def); i++) { g_autoptr(virCgroup) cgroup_vcpu = NULL; - virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, i); + virDomainVcpuDef *vcpu = virDomainDefGetVcpu(vm->def, i); if (!vcpu->online) continue; @@ -9219,7 +9219,7 @@ qemuSetVcpusBWLive(virDomainObjPtr vm, virCgroupPtr cgroup, } static int -qemuSetEmulatorBandwidthLive(virCgroupPtr cgroup, +qemuSetEmulatorBandwidthLive(virCgroup *cgroup, unsigned long long period, long long quota) { @@ -9240,7 +9240,7 @@ qemuSetEmulatorBandwidthLive(virCgroupPtr cgroup, static int -qemuSetIOThreadsBWLive(virDomainObjPtr vm, virCgroupPtr cgroup, +qemuSetIOThreadsBWLive(virDomainObj *vm, virCgroup *cgroup, unsigned long long period, long long quota) { size_t i; @@ -9282,19 +9282,19 @@ qemuDomainSetSchedulerParametersFlags(virDomainPtr dom, int nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriver *driver = dom->conn->privateData; size_t i; - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; g_autoptr(virDomainDef) persistentDefCopy = NULL; unsigned long long value_ul; long long value_l; int ret = -1; int rc; g_autoptr(virQEMUDriverConfig) cfg = NULL; - qemuDomainObjPrivatePtr priv; - virObjectEventPtr event = NULL; + qemuDomainObjPrivate *priv; + virObjectEvent *event = NULL; virTypedParameterPtr eventParams = NULL; int eventNparams = 0; int eventMaxNparams = 0; @@ -9593,18 +9593,18 @@ qemuDomainSetSchedulerParameters(virDomainPtr dom, } static int -qemuGetVcpuBWLive(virCgroupPtr cgroup, unsigned long long *period, +qemuGetVcpuBWLive(virCgroup *cgroup, unsigned long long *period, long long *quota) { return virCgroupGetCpuPeriodQuota(cgroup, period, quota); } static int -qemuGetVcpusBWLive(virDomainObjPtr vm, +qemuGetVcpusBWLive(virDomainObj *vm, unsigned long long *period, long long *quota) { g_autoptr(virCgroup) cgroup_vcpu = NULL; - qemuDomainObjPrivatePtr priv = NULL; + qemuDomainObjPrivate *priv = NULL; int rc; priv = vm->privateData; @@ -9632,7 +9632,7 @@ qemuGetVcpusBWLive(virDomainObjPtr vm, } static int -qemuGetEmulatorBandwidthLive(virCgroupPtr cgroup, +qemuGetEmulatorBandwidthLive(virCgroup *cgroup, unsigned long long *period, long long *quota) { @@ -9650,11 +9650,11 @@ qemuGetEmulatorBandwidthLive(virCgroupPtr cgroup, } static int -qemuGetIOThreadsBWLive(virDomainObjPtr vm, +qemuGetIOThreadsBWLive(virDomainObj *vm, unsigned long long *period, long long *quota) { g_autoptr(virCgroup) cgroup_iothread = NULL; - qemuDomainObjPrivatePtr priv = NULL; + qemuDomainObjPrivate *priv = NULL; int rc; priv = vm->privateData; @@ -9681,7 +9681,7 @@ qemuGetIOThreadsBWLive(virDomainObjPtr vm, static int -qemuGetGlobalBWLive(virCgroupPtr cgroup, unsigned long long *period, +qemuGetGlobalBWLive(virCgroup *cgroup, unsigned long long *period, long long *quota) { if (qemuGetVcpuBWLive(cgroup, period, quota) < 0) @@ -9696,14 +9696,14 @@ qemuDomainGetSchedulerParametersFlags(virDomainPtr dom, int *nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; virDomainCputune data = {0}; int ret = -1; bool cpu_bw_status = true; - virDomainDefPtr persistentDef; - virDomainDefPtr def; - qemuDomainObjPrivatePtr priv; + virDomainDef *persistentDef; + virDomainDef *def; + qemuDomainObjPrivate *priv; int maxparams = *nparams; *nparams = 0; @@ -9819,13 +9819,13 @@ qemuDomainBlockResize(virDomainPtr dom, unsigned long long size, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuDomainObjPrivate *priv; int ret = -1; g_autofree char *device = NULL; const char *nodename = NULL; - virDomainDiskDefPtr disk = NULL; + virDomainDiskDef *disk = NULL; virCheckFlags(VIR_DOMAIN_BLOCK_RESIZE_BYTES, -1); @@ -9908,8 +9908,8 @@ qemuDomainBlockResize(virDomainPtr dom, static void -qemuDomainBlockStatsGatherTotals(qemuBlockStatsPtr data, - qemuBlockStatsPtr total) +qemuDomainBlockStatsGatherTotals(qemuBlockStats *data, + qemuBlockStats *total) { total->wr_bytes += data->wr_bytes; total->wr_req += data->wr_req; @@ -9935,17 +9935,17 @@ qemuDomainBlockStatsGatherTotals(qemuBlockStatsPtr data, * Returns -1 on error; number of filled block statistics on success. */ static int -qemuDomainBlocksStatsGather(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainBlocksStatsGather(virQEMUDriver *driver, + virDomainObj *vm, const char *path, bool capacity, - qemuBlockStatsPtr *retstats) + qemuBlockStats **retstats) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); - virDomainDiskDefPtr disk = NULL; + virDomainDiskDef *disk = NULL; GHashTable *blockstats = NULL; - qemuBlockStatsPtr stats; + qemuBlockStats *stats; size_t i; int nstats; int rc = 0; @@ -10003,7 +10003,7 @@ qemuDomainBlocksStatsGather(virQEMUDriverPtr driver, if (blockdev) { /* capacity are reported only per node-name so we need to transfer them */ - qemuBlockStatsPtr capstats; + qemuBlockStats *capstats; if (disk && disk->src && (capstats = virHashLookup(blockstats, disk->src->nodeformat))) { @@ -10052,10 +10052,10 @@ qemuDomainBlockStats(virDomainPtr dom, const char *path, virDomainBlockStatsPtr stats) { - virQEMUDriverPtr driver = dom->conn->privateData; - qemuBlockStatsPtr blockstats = NULL; + virQEMUDriver *driver = dom->conn->privateData; + qemuBlockStats *blockstats = NULL; int ret = -1; - virDomainObjPtr vm; + virDomainObj *vm; if (!(vm = qemuDomainObjFromDomain(dom))) goto cleanup; @@ -10102,9 +10102,9 @@ qemuDomainBlockStatsFlags(virDomainPtr dom, int *nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuBlockStatsPtr blockstats = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuBlockStats *blockstats = NULL; int nstats; int ret = -1; @@ -10187,8 +10187,8 @@ qemuDomainInterfaceStats(virDomainPtr dom, const char *device, virDomainInterfaceStatsPtr stats) { - virDomainObjPtr vm; - virDomainNetDefPtr net = NULL; + virDomainObj *vm; + virDomainNetDef *net = NULL; int ret = -1; if (!(vm = qemuDomainObjFromDomain(dom))) @@ -10207,8 +10207,8 @@ qemuDomainInterfaceStats(virDomainPtr dom, if (virNetDevOpenvswitchInterfaceStats(net->ifname, stats) < 0) goto cleanup; } else if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_HOSTDEV) { - virDomainHostdevDefPtr hostdev = virDomainNetGetActualHostdev(net); - virPCIDeviceAddressPtr vfAddr; + virDomainHostdevDef *hostdev = virDomainNetGetActualHostdev(net); + virPCIDeviceAddress *vfAddr; if (!hostdev) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -10239,14 +10239,14 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom, int nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriver *driver = dom->conn->privateData; size_t i; - virDomainObjPtr vm = NULL; - virDomainDefPtr def; - virDomainDefPtr persistentDef; + virDomainObj *vm = NULL; + virDomainDef *def; + virDomainDef *persistentDef; int ret = -1; - virDomainNetDefPtr net = NULL; - virDomainNetDefPtr persistentNet = NULL; + virDomainNetDef *net = NULL; + virDomainNetDef *persistentNet = NULL; g_autoptr(virNetDevBandwidth) bandwidth = NULL; g_autoptr(virNetDevBandwidth) newBandwidth = NULL; g_autoptr(virQEMUDriverConfig) cfg = NULL; @@ -10474,9 +10474,9 @@ qemuDomainGetInterfaceParameters(virDomainPtr dom, unsigned int flags) { size_t i; - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virDomainNetDefPtr net = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virDomainNetDef *net = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -10577,8 +10577,8 @@ qemuDomainGetInterfaceParameters(virDomainPtr dom, /* This functions assumes that job QEMU_JOB_QUERY is started by a caller */ static int -qemuDomainMemoryStatsInternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainMemoryStatsInternal(virQEMUDriver *driver, + virDomainObj *vm, virDomainMemoryStatPtr stats, unsigned int nr_stats) @@ -10620,8 +10620,8 @@ qemuDomainMemoryStats(virDomainPtr dom, unsigned int nr_stats, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -10651,9 +10651,9 @@ qemuDomainBlockPeek(virDomainPtr dom, void *buffer, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainDiskDefPtr disk = NULL; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainDiskDef *disk = NULL; + virDomainObj *vm; g_autofree char *tmpbuf = NULL; ssize_t nread; int ret = -1; @@ -10720,11 +10720,11 @@ qemuDomainMemoryPeek(virDomainPtr dom, void *buffer, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; g_autofree char *tmp = NULL; int fd = -1, ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; g_autoptr(virQEMUDriverConfig) cfg = NULL; virCheckFlags(VIR_MEMORY_VIRTUAL | VIR_MEMORY_PHYSICAL, -1); @@ -10819,10 +10819,10 @@ qemuDomainMemoryPeek(virDomainPtr dom, * reported) or -1 otherwise (errors are reported). */ static int -qemuDomainStorageOpenStat(virQEMUDriverPtr driver, - virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, - virStorageSourcePtr src, +qemuDomainStorageOpenStat(virQEMUDriver *driver, + virQEMUDriverConfig *cfg, + virDomainObj *vm, + virStorageSource *src, int *ret_fd, struct stat *ret_sb, bool skipInaccessible) @@ -10867,7 +10867,7 @@ qemuDomainStorageOpenStat(virQEMUDriverPtr driver, * else remote, then tear down the storage driver backend connection. */ static void -qemuDomainStorageCloseStat(virStorageSourcePtr src, +qemuDomainStorageCloseStat(virStorageSource *src, int *fd) { if (virStorageSourceIsLocalStorage(src)) @@ -10891,10 +10891,10 @@ qemuDomainStorageCloseStat(virStorageSourcePtr src, * reported but are reset (thus only logged)). */ static int -qemuDomainStorageUpdatePhysical(virQEMUDriverPtr driver, - virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, - virStorageSourcePtr src) +qemuDomainStorageUpdatePhysical(virQEMUDriver *driver, + virQEMUDriverConfig *cfg, + virDomainObj *vm, + virStorageSource *src) { int ret; int fd = -1; @@ -10949,10 +10949,10 @@ qemuDomainStorageUpdatePhysical(virQEMUDriverPtr driver, * are reported). */ static int -qemuStorageLimitsRefresh(virQEMUDriverPtr driver, - virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, - virStorageSourcePtr src, +qemuStorageLimitsRefresh(virQEMUDriver *driver, + virQEMUDriverConfig *cfg, + virDomainObj *vm, + virStorageSource *src, bool skipInaccessible) { int rc; @@ -11006,12 +11006,12 @@ qemuDomainGetBlockInfo(virDomainPtr dom, virDomainBlockInfoPtr info, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; g_autoptr(virQEMUDriverConfig) cfg = NULL; - qemuBlockStatsPtr entry = NULL; + qemuBlockStats *entry = NULL; virCheckFlags(0, -1); @@ -11115,7 +11115,7 @@ qemuConnectDomainEventRegister(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; if (virConnectDomainEventRegisterEnsureACL(conn) < 0) return -1; @@ -11133,7 +11133,7 @@ static int qemuConnectDomainEventDeregister(virConnectPtr conn, virConnectDomainEventCallback callback) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; if (virConnectDomainEventDeregisterEnsureACL(conn) < 0) return -1; @@ -11155,7 +11155,7 @@ qemuConnectDomainEventRegisterAny(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; int ret = -1; if (virConnectDomainEventRegisterAnyEnsureACL(conn) < 0) @@ -11175,7 +11175,7 @@ static int qemuConnectDomainEventDeregisterAny(virConnectPtr conn, int callbackID) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; if (virConnectDomainEventDeregisterAnyEnsureACL(conn) < 0) return -1; @@ -11206,7 +11206,7 @@ qemuDomainMigratePrepareTunnel(virConnectPtr dconn, unsigned long resource G_GNUC_UNUSED, const char *dom_xml) { - virQEMUDriverPtr driver = dconn->privateData; + virQEMUDriver *driver = dconn->privateData; g_autoptr(virDomainDef) def = NULL; g_autofree char *origname = NULL; g_autoptr(qemuMigrationParams) migParams = NULL; @@ -11256,7 +11256,7 @@ qemuDomainMigratePrepare2(virConnectPtr dconn, unsigned long resource G_GNUC_UNUSED, const char *dom_xml) { - virQEMUDriverPtr driver = dconn->privateData; + virQEMUDriver *driver = dconn->privateData; g_autoptr(virDomainDef) def = NULL; g_autofree char *origname = NULL; g_autoptr(qemuMigrationParams) migParams = NULL; @@ -11312,8 +11312,8 @@ qemuDomainMigratePerform(virDomainPtr dom, const char *dname, unsigned long resource) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; const char *dconnuri = NULL; g_autoptr(qemuMigrationParams) migParams = NULL; @@ -11369,8 +11369,8 @@ qemuDomainMigrateFinish2(virConnectPtr dconn, unsigned long flags, int retcode) { - virQEMUDriverPtr driver = dconn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dconn->privateData; + virDomainObj *vm; virCheckFlags(QEMU_MIGRATION_FLAGS, NULL); @@ -11410,7 +11410,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain, const char *dname, unsigned long resource G_GNUC_UNUSED) { - virDomainObjPtr vm; + virDomainObj *vm; virCheckFlags(QEMU_MIGRATION_FLAGS, NULL); @@ -11438,7 +11438,7 @@ qemuDomainMigrateBegin3Params(virDomainPtr domain, const char *dname = NULL; g_autofree const char **migrate_disks = NULL; int nmigrate_disks; - virDomainObjPtr vm; + virDomainObj *vm; virCheckFlags(QEMU_MIGRATION_FLAGS, NULL); if (virTypedParamsValidate(params, nparams, QEMU_MIGRATION_PARAMETERS) < 0) @@ -11486,7 +11486,7 @@ qemuDomainMigratePrepare3(virConnectPtr dconn, unsigned long resource G_GNUC_UNUSED, const char *dom_xml) { - virQEMUDriverPtr driver = dconn->privateData; + virQEMUDriver *driver = dconn->privateData; g_autoptr(virDomainDef) def = NULL; g_autofree char *origname = NULL; g_autoptr(qemuMigrationParams) migParams = NULL; @@ -11532,7 +11532,7 @@ qemuDomainMigratePrepare3Params(virConnectPtr dconn, char **uri_out, unsigned int flags) { - virQEMUDriverPtr driver = dconn->privateData; + virQEMUDriver *driver = dconn->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autoptr(virDomainDef) def = NULL; const char *dom_xml = NULL; @@ -11647,7 +11647,7 @@ qemuDomainMigratePrepareTunnel3(virConnectPtr dconn, unsigned long resource G_GNUC_UNUSED, const char *dom_xml) { - virQEMUDriverPtr driver = dconn->privateData; + virQEMUDriver *driver = dconn->privateData; g_autoptr(virDomainDef) def = NULL; g_autofree char *origname = NULL; g_autoptr(qemuMigrationParams) migParams = NULL; @@ -11687,7 +11687,7 @@ qemuDomainMigratePrepareTunnel3Params(virConnectPtr dconn, int *cookieoutlen, unsigned int flags) { - virQEMUDriverPtr driver = dconn->privateData; + virQEMUDriver *driver = dconn->privateData; g_autoptr(virDomainDef) def = NULL; const char *dom_xml = NULL; const char *dname = NULL; @@ -11742,8 +11742,8 @@ qemuDomainMigratePerform3(virDomainPtr dom, const char *dname, unsigned long resource) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; g_autoptr(qemuMigrationParams) migParams = NULL; int ret = -1; @@ -11782,8 +11782,8 @@ qemuDomainMigratePerform3Params(virDomainPtr dom, int *cookieoutlen, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; const char *dom_xml = NULL; const char *persist_xml = NULL; const char *dname = NULL; @@ -11899,8 +11899,8 @@ qemuDomainMigrateFinish3(virConnectPtr dconn, unsigned long flags, int cancelled) { - virQEMUDriverPtr driver = dconn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dconn->privateData; + virDomainObj *vm; virCheckFlags(QEMU_MIGRATION_FLAGS, NULL); @@ -11939,8 +11939,8 @@ qemuDomainMigrateFinish3Params(virConnectPtr dconn, unsigned int flags, int cancelled) { - virQEMUDriverPtr driver = dconn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dconn->privateData; + virDomainObj *vm; const char *dname = NULL; virCheckFlags(QEMU_MIGRATION_FLAGS, NULL); @@ -11984,7 +11984,7 @@ qemuDomainMigrateConfirm3(virDomainPtr domain, unsigned long flags, int cancelled) { - virDomainObjPtr vm; + virDomainObj *vm; virCheckFlags(QEMU_MIGRATION_FLAGS, -1); @@ -12009,7 +12009,7 @@ qemuDomainMigrateConfirm3Params(virDomainPtr domain, unsigned int flags, int cancelled) { - virDomainObjPtr vm; + virDomainObj *vm; virCheckFlags(QEMU_MIGRATION_FLAGS, -1); @@ -12034,8 +12034,8 @@ qemuNodeDeviceDetachFlags(virNodeDevicePtr dev, const char *driverName, unsigned int flags) { - virQEMUDriverPtr driver = dev->conn->privateData; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virQEMUDriver *driver = dev->conn->privateData; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; virCheckFlags(0, -1); @@ -12078,8 +12078,8 @@ qemuNodeDeviceDettach(virNodeDevicePtr dev) static int qemuNodeDeviceReAttach(virNodeDevicePtr dev) { - virQEMUDriverPtr driver = dev->conn->privateData; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virQEMUDriver *driver = dev->conn->privateData; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; /* virNodeDeviceReAttachEnsureACL() is being called by * virDomainDriverNodeDeviceReAttach() */ @@ -12089,8 +12089,8 @@ qemuNodeDeviceReAttach(virNodeDevicePtr dev) static int qemuNodeDeviceReset(virNodeDevicePtr dev) { - virQEMUDriverPtr driver = dev->conn->privateData; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virQEMUDriver *driver = dev->conn->privateData; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; /* virNodeDeviceResetEnsureACL() is being called by * virDomainDriverNodeDeviceReset() */ @@ -12102,7 +12102,7 @@ qemuConnectCompareCPU(virConnectPtr conn, const char *xmlDesc, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; g_autoptr(virCPUDef) cpu = NULL; bool failIncompatible; bool validateXML; @@ -12126,12 +12126,12 @@ qemuConnectCompareCPU(virConnectPtr conn, static virCPUCompareResult -qemuConnectCPUModelComparison(virQEMUCapsPtr qemuCaps, +qemuConnectCPUModelComparison(virQEMUCaps *qemuCaps, const char *libDir, uid_t runUid, gid_t runGid, - virCPUDefPtr cpu_a, - virCPUDefPtr cpu_b, + virCPUDef *cpu_a, + virCPUDef *cpu_b, bool failIncompatible) { g_autoptr(qemuProcessQMP) proc = NULL; @@ -12172,13 +12172,13 @@ qemuConnectCompareHypervisorCPU(virConnectPtr conn, unsigned int flags) { int ret = VIR_CPU_COMPARE_ERROR; - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autoptr(virQEMUCaps) qemuCaps = NULL; bool failIncompatible; bool validateXML; - virCPUDefPtr hvCPU; - virCPUDefPtr cpu = NULL; + virCPUDef *hvCPU; + virCPUDef *cpu = NULL; virArch arch; virDomainVirtType virttype; @@ -12254,9 +12254,9 @@ qemuConnectBaselineCPU(virConnectPtr conn G_GNUC_UNUSED, unsigned int ncpus, unsigned int flags) { - virCPUDefPtr *cpus = NULL; - virCPUDefPtr baseline = NULL; - virCPUDefPtr cpu = NULL; + virCPUDef **cpus = NULL; + virCPUDef *baseline = NULL; + virCPUDef *cpu = NULL; char *cpustr = NULL; virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES | @@ -12303,10 +12303,10 @@ qemuConnectBaselineCPU(virConnectPtr conn G_GNUC_UNUSED, * failure), @src is freed. */ static int -qemuConnectStealCPUModelFromInfo(virCPUDefPtr dst, - qemuMonitorCPUModelInfoPtr *src) +qemuConnectStealCPUModelFromInfo(virCPUDef *dst, + qemuMonitorCPUModelInfo **src) { - qemuMonitorCPUModelInfoPtr info; + qemuMonitorCPUModelInfo *info; size_t i; int ret = -1; @@ -12334,19 +12334,19 @@ qemuConnectStealCPUModelFromInfo(virCPUDefPtr dst, } -static virCPUDefPtr -qemuConnectCPUModelBaseline(virQEMUCapsPtr qemuCaps, +static virCPUDef * +qemuConnectCPUModelBaseline(virQEMUCaps *qemuCaps, const char *libDir, uid_t runUid, gid_t runGid, bool expand_features, - virCPUDefPtr *cpus, + virCPUDef **cpus, int ncpus, - virDomainCapsCPUModelsPtr cpuModels) + virDomainCapsCPUModels *cpuModels) { g_autoptr(qemuProcessQMP) proc = NULL; g_autoptr(virCPUDef) baseline = NULL; - qemuMonitorCPUModelInfoPtr result = NULL; + qemuMonitorCPUModelInfo *result = NULL; qemuMonitorCPUModelExpansionType expansion_type; size_t i; @@ -12417,15 +12417,15 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn, unsigned int ncpus, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - virCPUDefPtr *cpus = NULL; + virCPUDef **cpus = NULL; g_autoptr(virQEMUCaps) qemuCaps = NULL; virArch arch; virDomainVirtType virttype; g_autoptr(virDomainCapsCPUModels) cpuModels = NULL; bool migratable; - virCPUDefPtr cpu = NULL; + virCPUDef *cpu = NULL; char *cpustr = NULL; char **features = NULL; @@ -12508,11 +12508,11 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn, static int -qemuDomainGetJobInfoMigrationStats(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuDomainJobInfoPtr jobInfo) +qemuDomainGetJobInfoMigrationStats(virQEMUDriver *driver, + virDomainObj *vm, + qemuDomainJobInfo *jobInfo) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool events = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT); if (jobInfo->status == QEMU_DOMAIN_JOB_STATUS_ACTIVE || @@ -12540,11 +12540,11 @@ qemuDomainGetJobInfoMigrationStats(virQEMUDriverPtr driver, static int -qemuDomainGetJobInfoDumpStats(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuDomainJobInfoPtr jobInfo) +qemuDomainGetJobInfoDumpStats(virQEMUDriver *driver, + virDomainObj *vm, + qemuDomainJobInfo *jobInfo) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; qemuMonitorDumpStats stats = { 0 }; int rc; @@ -12591,12 +12591,12 @@ qemuDomainGetJobInfoDumpStats(virQEMUDriverPtr driver, static int -qemuDomainGetJobStatsInternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainGetJobStatsInternal(virQEMUDriver *driver, + virDomainObj *vm, bool completed, - qemuDomainJobInfoPtr *jobInfo) + qemuDomainJobInfo **jobInfo) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret = -1; *jobInfo = NULL; @@ -12660,9 +12660,9 @@ static int qemuDomainGetJobInfo(virDomainPtr dom, virDomainJobInfoPtr info) { - virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriver *driver = dom->conn->privateData; g_autoptr(qemuDomainJobInfo) jobInfo = NULL; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; memset(info, 0, sizeof(*info)); @@ -12697,9 +12697,9 @@ qemuDomainGetJobStats(virDomainPtr dom, int *nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuDomainObjPrivate *priv; g_autoptr(qemuDomainJobInfo) jobInfo = NULL; bool completed = !!(flags & VIR_DOMAIN_JOB_STATS_COMPLETED); int ret = -1; @@ -12738,9 +12738,9 @@ qemuDomainGetJobStats(virDomainPtr dom, static int -qemuDomainAbortJobMigration(virDomainObjPtr vm) +qemuDomainAbortJobMigration(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret; VIR_DEBUG("Cancelling migration job at client request"); @@ -12757,10 +12757,10 @@ qemuDomainAbortJobMigration(virDomainObjPtr vm) static int qemuDomainAbortJob(virDomainPtr dom) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; int reason; if (!(vm = qemuDomainObjFromDomain(dom))) @@ -12850,9 +12850,9 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom, unsigned long long downtime, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuDomainObjPrivate *priv; g_autoptr(qemuMigrationParams) migParams = NULL; int ret = -1; int rc; @@ -12910,8 +12910,8 @@ qemuDomainMigrateGetMaxDowntime(virDomainPtr dom, unsigned long long *downtime, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; g_autoptr(qemuMigrationParams) migParams = NULL; int ret = -1; int rc; @@ -12963,9 +12963,9 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom, unsigned long long *cacheSize, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuDomainObjPrivate *priv; g_autoptr(qemuMigrationParams) migParams = NULL; int ret = -1; int rc; @@ -13024,9 +13024,9 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom, unsigned long long cacheSize, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuDomainObjPrivate *priv; g_autoptr(qemuMigrationParams) migParams = NULL; int ret = -1; int rc; @@ -13089,9 +13089,9 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom, unsigned long bandwidth, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuDomainObjPrivate *priv; bool postcopy = !!(flags & VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY); g_autoptr(qemuMigrationParams) migParams = NULL; bool bwParam; @@ -13177,8 +13177,8 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom, static int -qemuDomainMigrationGetPostcopyBandwidth(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainMigrationGetPostcopyBandwidth(virQEMUDriver *driver, + virDomainObj *vm, unsigned long *bandwidth) { g_autoptr(qemuMigrationParams) migParams = NULL; @@ -13233,9 +13233,9 @@ qemuDomainMigrateGetMaxSpeed(virDomainPtr dom, unsigned long *bandwidth, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuDomainObjPrivate *priv; bool postcopy = !!(flags & VIR_DOMAIN_MIGRATE_MAX_SPEED_POSTCOPY); int ret = -1; @@ -13268,9 +13268,9 @@ static int qemuDomainMigrateStartPostCopy(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuDomainObjPrivate *priv; int ret = -1; virCheckFlags(0, -1); @@ -13323,7 +13323,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain, const char *xmlDesc, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; virDomainSnapshotPtr snapshot = NULL; if (!(vm = qemuDomainObjFromDomain(domain))) @@ -13346,7 +13346,7 @@ qemuDomainSnapshotListNames(virDomainPtr domain, int nameslen, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS | @@ -13372,7 +13372,7 @@ static int qemuDomainSnapshotNum(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS | @@ -13398,7 +13398,7 @@ qemuDomainListAllSnapshots(virDomainPtr domain, virDomainSnapshotPtr **snaps, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS | @@ -13425,8 +13425,8 @@ qemuDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot, int nameslen, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainMomentObjPtr snap = NULL; + virDomainObj *vm = NULL; + virDomainMomentObj *snap = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | @@ -13455,8 +13455,8 @@ static int qemuDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainMomentObjPtr snap = NULL; + virDomainObj *vm = NULL; + virDomainMomentObj *snap = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | @@ -13485,8 +13485,8 @@ qemuDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot, virDomainSnapshotPtr **snaps, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainMomentObjPtr snap = NULL; + virDomainObj *vm = NULL; + virDomainMomentObj *snap = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | @@ -13516,8 +13516,8 @@ qemuDomainSnapshotLookupByName(virDomainPtr domain, const char *name, unsigned int flags) { - virDomainObjPtr vm; - virDomainMomentObjPtr snap = NULL; + virDomainObj *vm; + virDomainMomentObj *snap = NULL; virDomainSnapshotPtr snapshot = NULL; virCheckFlags(0, NULL); @@ -13543,7 +13543,7 @@ static int qemuDomainHasCurrentSnapshot(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -13566,8 +13566,8 @@ static virDomainSnapshotPtr qemuDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr vm; - virDomainMomentObjPtr snap = NULL; + virDomainObj *vm; + virDomainMomentObj *snap = NULL; virDomainSnapshotPtr parent = NULL; virCheckFlags(0, NULL); @@ -13600,7 +13600,7 @@ static virDomainSnapshotPtr qemuDomainSnapshotCurrent(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; virDomainSnapshotPtr snapshot = NULL; const char *name; @@ -13631,10 +13631,10 @@ static char * qemuDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, unsigned int flags) { - virQEMUDriverPtr driver = snapshot->domain->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = snapshot->domain->conn->privateData; + virDomainObj *vm = NULL; char *xml = NULL; - virDomainMomentObjPtr snap = NULL; + virDomainMomentObj *snap = NULL; char uuidstr[VIR_UUID_STRING_BUFLEN]; virCheckFlags(VIR_DOMAIN_SNAPSHOT_XML_SECURE, NULL); @@ -13664,9 +13664,9 @@ static int qemuDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; - virDomainMomentObjPtr snap = NULL; + virDomainMomentObj *snap = NULL; virCheckFlags(0, -1); @@ -13691,9 +13691,9 @@ static int qemuDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; - virDomainMomentObjPtr snap = NULL; + virDomainMomentObj *snap = NULL; virCheckFlags(0, -1); @@ -13721,7 +13721,7 @@ static int qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; virNWFilterReadLockFilterUpdates(); @@ -13745,7 +13745,7 @@ static int qemuDomainSnapshotDelete(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; if (!(vm = qemuDomObjFromSnapshot(snapshot))) @@ -13767,7 +13767,7 @@ qemuDomainCheckpointCreateXML(virDomainPtr domain, const char *xmlDesc, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; virDomainCheckpointPtr checkpoint = NULL; if (!(vm = qemuDomainObjFromDomain(domain))) @@ -13789,7 +13789,7 @@ qemuDomainListAllCheckpoints(virDomainPtr domain, virDomainCheckpointPtr **chks, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_CHECKPOINT_LIST_ROOTS | @@ -13815,8 +13815,8 @@ qemuDomainCheckpointListAllChildren(virDomainCheckpointPtr checkpoint, virDomainCheckpointPtr **chks, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainMomentObjPtr chk = NULL; + virDomainObj *vm = NULL; + virDomainMomentObj *chk = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_CHECKPOINT_LIST_DESCENDANTS | @@ -13847,8 +13847,8 @@ qemuDomainCheckpointLookupByName(virDomainPtr domain, const char *name, unsigned int flags) { - virDomainObjPtr vm; - virDomainMomentObjPtr chk = NULL; + virDomainObj *vm; + virDomainMomentObj *chk = NULL; virDomainCheckpointPtr checkpoint = NULL; virCheckFlags(0, NULL); @@ -13874,8 +13874,8 @@ static virDomainCheckpointPtr qemuDomainCheckpointGetParent(virDomainCheckpointPtr checkpoint, unsigned int flags) { - virDomainObjPtr vm; - virDomainMomentObjPtr chk = NULL; + virDomainObj *vm; + virDomainMomentObj *chk = NULL; virDomainCheckpointPtr parent = NULL; virCheckFlags(0, NULL); @@ -13908,7 +13908,7 @@ static char * qemuDomainCheckpointGetXMLDesc(virDomainCheckpointPtr checkpoint, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; char *xml = NULL; if (!(vm = qemuDomObjFromCheckpoint(checkpoint))) @@ -13929,7 +13929,7 @@ static int qemuDomainCheckpointDelete(virDomainCheckpointPtr checkpoint, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; if (!(vm = qemuDomObjFromCheckpoint(checkpoint))) @@ -13952,7 +13952,7 @@ qemuDomainBackupBegin(virDomainPtr domain, const char *checkpointXML, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; if (!(vm = qemuDomainObjFromDomain(domain))) @@ -13973,7 +13973,7 @@ static char * qemuDomainBackupGetXMLDesc(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; char *ret = NULL; if (!(vm = qemuDomainObjFromDomain(domain))) @@ -13993,10 +13993,10 @@ qemuDomainBackupGetXMLDesc(virDomainPtr domain, static int qemuDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd, char **result, unsigned int flags) { - virQEMUDriverPtr driver = domain->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = domain->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; bool hmp; virCheckFlags(VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP, -1); @@ -14039,11 +14039,11 @@ qemuDomainOpenConsole(virDomainPtr dom, virStreamPtr st, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; size_t i; - virDomainChrDefPtr chr = NULL; - qemuDomainObjPrivatePtr priv; + virDomainChrDef *chr = NULL; + qemuDomainObjPrivate *priv; virCheckFlags(VIR_DOMAIN_CONSOLE_SAFE | VIR_DOMAIN_CONSOLE_FORCE, -1); @@ -14117,11 +14117,11 @@ qemuDomainOpenChannel(virDomainPtr dom, virStreamPtr st, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; size_t i; - virDomainChrDefPtr chr = NULL; - qemuDomainObjPrivatePtr priv; + virDomainChrDef *chr = NULL; + qemuDomainObjPrivate *priv; virCheckFlags(VIR_DOMAIN_CHANNEL_FORCE, -1); @@ -14187,14 +14187,14 @@ qemuDomainOpenChannel(virDomainPtr dom, * abort with pivot; this updates the VM definition as appropriate, on * either success or failure. */ static int -qemuDomainBlockPivot(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuBlockJobDataPtr job, - virDomainDiskDefPtr disk) +qemuDomainBlockPivot(virQEMUDriver *driver, + virDomainObj *vm, + qemuBlockJobData *job, + virDomainDiskDef *disk) { g_autoptr(qemuBlockStorageSourceChainData) chainattachdata = NULL; int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); g_autoptr(virJSONValue) bitmapactions = NULL; g_autoptr(virJSONValue) reopenactions = NULL; @@ -14316,22 +14316,22 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver, /* bandwidth in MiB/s per public API. Caller must lock vm beforehand, * and not access it afterwards. */ static int -qemuDomainBlockPullCommon(virDomainObjPtr vm, +qemuDomainBlockPullCommon(virDomainObj *vm, const char *path, const char *base, unsigned long bandwidth, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; const char *device = NULL; const char *jobname = NULL; - virDomainDiskDefPtr disk; - virStorageSourcePtr baseSource = NULL; + virDomainDiskDef *disk; + virStorageSource *baseSource = NULL; g_autofree char *basePath = NULL; g_autofree char *backingPath = NULL; unsigned long long speed = bandwidth; - qemuBlockJobDataPtr job = NULL; + qemuBlockJobData *job = NULL; bool persistjob = false; const char *nodebase = NULL; bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); @@ -14453,14 +14453,14 @@ qemuDomainBlockJobAbort(virDomainPtr dom, const char *path, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainDiskDefPtr disk = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainDiskDef *disk = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); bool pivot = !!(flags & VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT); bool async = !!(flags & VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC); g_autoptr(qemuBlockJobData) job = NULL; - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv = NULL; + virDomainObj *vm; + qemuDomainObjPrivate *priv = NULL; bool blockdev = false; int ret = -1; @@ -14565,9 +14565,9 @@ qemuDomainBlockJobAbort(virDomainPtr dom, static int -qemuBlockJobInfoTranslate(qemuMonitorBlockJobInfoPtr rawInfo, +qemuBlockJobInfoTranslate(qemuMonitorBlockJobInfo *rawInfo, virDomainBlockJobInfoPtr info, - qemuBlockJobDataPtr job, + qemuBlockJobData *job, bool reportBytes) { info->type = job->type; @@ -14625,11 +14625,11 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom, virDomainBlockJobInfoPtr info, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - virDomainDiskDefPtr disk; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + virDomainDiskDef *disk; int ret = -1; - qemuMonitorBlockJobInfoPtr rawInfo; + qemuMonitorBlockJobInfo *rawInfo; g_autoptr(qemuBlockJobData) job = NULL; g_autoptr(GHashTable) blockjobstats = NULL; @@ -14684,10 +14684,10 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom, unsigned long bandwidth, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainDiskDefPtr disk; + virQEMUDriver *driver = dom->conn->privateData; + virDomainDiskDef *disk; int ret = -1; - virDomainObjPtr vm; + virDomainObj *vm; unsigned long long speed = bandwidth; g_autoptr(qemuBlockJobData) job = NULL; @@ -14743,7 +14743,7 @@ qemuDomainBlockJobSetSpeed(virDomainPtr dom, static int -qemuDomainBlockCopyValidateMirror(virStorageSourcePtr mirror, +qemuDomainBlockCopyValidateMirror(virStorageSource *mirror, const char *dst, bool *reuse) { @@ -14816,7 +14816,7 @@ qemuDomainBlockCopyValidateMirror(virStorageSourcePtr mirror, * 4) if deep copy is requested, there's no chain */ static int -qemuDomainBlockCopyCommonValidateUserMirrorBackingStore(virStorageSourcePtr mirror, +qemuDomainBlockCopyCommonValidateUserMirrorBackingStore(virStorageSource *mirror, bool shallow, bool blockdev) { @@ -14857,19 +14857,19 @@ qemuDomainBlockCopyCommonValidateUserMirrorBackingStore(virStorageSourcePtr mirr /* bandwidth in bytes/s. Caller must lock vm beforehand, and not * access mirror afterwards. */ static int -qemuDomainBlockCopyCommon(virDomainObjPtr vm, +qemuDomainBlockCopyCommon(virDomainObj *vm, virConnectPtr conn, const char *path, - virStorageSourcePtr mirrorsrc, + virStorageSource *mirrorsrc, unsigned long long bandwidth, unsigned int granularity, unsigned long long buf_size, unsigned int flags, bool keepParentLabel) { - virQEMUDriverPtr driver = conn->privateData; - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainDiskDefPtr disk = NULL; + virQEMUDriver *driver = conn->privateData; + qemuDomainObjPrivate *priv = vm->privateData; + virDomainDiskDef *disk = NULL; int ret = -1; bool need_unlink = false; bool need_revoke = false; @@ -14878,7 +14878,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, bool mirror_reuse = !!(flags & VIR_DOMAIN_BLOCK_COPY_REUSE_EXT); bool mirror_shallow = !!(flags & VIR_DOMAIN_BLOCK_COPY_SHALLOW); bool existing = mirror_reuse; - qemuBlockJobDataPtr job = NULL; + qemuBlockJobData *job = NULL; g_autoptr(virStorageSource) mirror = mirrorsrc; bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); bool supports_create = false; @@ -14886,8 +14886,8 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, bool supports_detect = false; g_autoptr(qemuBlockStorageSourceChainData) data = NULL; g_autoptr(qemuBlockStorageSourceChainData) crdata = NULL; - virStorageSourcePtr n; - virStorageSourcePtr mirrorBacking = NULL; + virStorageSource *n; + virStorageSource *mirrorBacking = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL; int rc = 0; @@ -15193,7 +15193,7 @@ static int qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base, unsigned long bandwidth, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; unsigned long long speed = bandwidth; g_autoptr(virStorageSource) dest = NULL; @@ -15267,14 +15267,14 @@ qemuDomainBlockCopy(virDomainPtr dom, const char *disk, const char *destxml, virTypedParameterPtr params, int nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; unsigned long long bandwidth = 0; unsigned int granularity = 0; unsigned long long buf_size = 0; - virDomainDiskDefPtr diskdef = NULL; - virStorageSourcePtr dest = NULL; + virDomainDiskDef *diskdef = NULL; + virStorageSource *dest = NULL; size_t i; virCheckFlags(VIR_DOMAIN_BLOCK_COPY_SHALLOW | @@ -15347,7 +15347,7 @@ static int qemuDomainBlockPull(virDomainPtr dom, const char *path, unsigned long bandwidth, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; virCheckFlags(VIR_DOMAIN_BLOCK_PULL_BANDWIDTH_BYTES, -1); if (!(vm = qemuDomainObjFromDomain(dom))) @@ -15371,22 +15371,22 @@ qemuDomainBlockCommit(virDomainPtr dom, unsigned long bandwidth, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - qemuDomainObjPrivatePtr priv; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + qemuDomainObjPrivate *priv; + virDomainObj *vm = NULL; const char *device = NULL; const char *jobname = NULL; int ret = -1; - virDomainDiskDefPtr disk = NULL; - virStorageSourcePtr topSource; - virStorageSourcePtr baseSource = NULL; - virStorageSourcePtr top_parent = NULL; + virDomainDiskDef *disk = NULL; + virStorageSource *topSource; + virStorageSource *baseSource = NULL; + virStorageSource *top_parent = NULL; bool clean_access = false; g_autofree char *topPath = NULL; g_autofree char *basePath = NULL; g_autofree char *backingPath = NULL; unsigned long long speed = bandwidth; - qemuBlockJobDataPtr job = NULL; + qemuBlockJobData *job = NULL; g_autoptr(virStorageSource) mirror = NULL; const char *nodetop = NULL; const char *nodebase = NULL; @@ -15632,10 +15632,10 @@ qemuDomainOpenGraphics(virDomainPtr dom, int fd, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; const char *protocol; virCheckFlags(VIR_DOMAIN_OPEN_GRAPHICS_SKIPAUTH, -1); @@ -15703,10 +15703,10 @@ qemuDomainOpenGraphicsFD(virDomainPtr dom, unsigned int idx, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; const char *protocol; int pair[2] = {-1, -1}; @@ -15793,7 +15793,7 @@ typedef enum { static bool -qemuDomainDiskBlockIoTuneIsSupported(virStorageSourcePtr src) +qemuDomainDiskBlockIoTuneIsSupported(virStorageSource *src) { if (virStorageSourceGetActualType(src) == VIR_STORAGE_TYPE_VHOST_USER) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -15808,8 +15808,8 @@ qemuDomainDiskBlockIoTuneIsSupported(virStorageSourcePtr src) /* If the user didn't specify bytes limits, inherit previous values; * likewise if the user didn't specify iops limits. */ static int -qemuDomainSetBlockIoTuneDefaults(virDomainBlockIoTuneInfoPtr newinfo, - virDomainBlockIoTuneInfoPtr oldinfo, +qemuDomainSetBlockIoTuneDefaults(virDomainBlockIoTuneInfo *newinfo, + virDomainBlockIoTuneInfo *oldinfo, qemuBlockIoTuneSetFlags set_fields) { #define SET_IOTUNE_DEFAULTS(BOOL, FIELD) \ @@ -15865,8 +15865,8 @@ qemuDomainSetBlockIoTuneDefaults(virDomainBlockIoTuneInfoPtr newinfo, static void -qemuDomainSetGroupBlockIoTune(virDomainDefPtr def, - virDomainBlockIoTuneInfoPtr iotune) +qemuDomainSetGroupBlockIoTune(virDomainDef *def, + virDomainBlockIoTuneInfo *iotune) { size_t i; @@ -15874,7 +15874,7 @@ qemuDomainSetGroupBlockIoTune(virDomainDefPtr def, return; for (i = 0; i < def->ndisks; i++) { - virDomainDiskDefPtr d = def->disks[i]; + virDomainDiskDef *d = def->disks[i]; if (STREQ_NULLABLE(d->blkdeviotune.group_name, iotune->group_name)) { VIR_FREE(d->blkdeviotune.group_name); @@ -15884,10 +15884,10 @@ qemuDomainSetGroupBlockIoTune(virDomainDefPtr def, } -static virDomainBlockIoTuneInfoPtr -qemuDomainFindGroupBlockIoTune(virDomainDefPtr def, - virDomainDiskDefPtr disk, - virDomainBlockIoTuneInfoPtr newiotune) +static virDomainBlockIoTuneInfo * +qemuDomainFindGroupBlockIoTune(virDomainDef *def, + virDomainDiskDef *disk, + virDomainBlockIoTuneInfo *newiotune) { size_t i; @@ -15896,7 +15896,7 @@ qemuDomainFindGroupBlockIoTune(virDomainDefPtr def, return &disk->blkdeviotune; for (i = 0; i < def->ndisks; i++) { - virDomainDiskDefPtr d = def->disks[i]; + virDomainDiskDef *d = def->disks[i]; if (STREQ_NULLABLE(newiotune->group_name, d->blkdeviotune.group_name)) return &d->blkdeviotune; @@ -15907,8 +15907,8 @@ qemuDomainFindGroupBlockIoTune(virDomainDefPtr def, static int -qemuDomainCheckBlockIoTuneReset(virDomainDiskDefPtr disk, - virDomainBlockIoTuneInfoPtr newiotune) +qemuDomainCheckBlockIoTuneReset(virDomainDiskDef *disk, + virDomainBlockIoTuneInfo *newiotune) { if (virDomainBlockIoTuneInfoHasAny(newiotune)) return 0; @@ -15935,30 +15935,30 @@ qemuDomainSetBlockIoTune(virDomainPtr dom, int nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - qemuDomainObjPrivatePtr priv; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuDomainObjPrivate *priv; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; virDomainBlockIoTuneInfo info; virDomainBlockIoTuneInfo conf_info; g_autofree char *drivealias = NULL; const char *qdevid = NULL; int ret = -1; size_t i; - virDomainDiskDefPtr conf_disk = NULL; - virDomainDiskDefPtr disk; + virDomainDiskDef *conf_disk = NULL; + virDomainDiskDef *disk; qemuBlockIoTuneSetFlags set_fields = 0; bool supportMaxOptions = true; bool supportGroupNameOption = true; bool supportMaxLengthOptions = true; g_autoptr(virQEMUDriverConfig) cfg = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; virTypedParameterPtr eventParams = NULL; int eventNparams = 0; int eventMaxparams = 0; - virDomainBlockIoTuneInfoPtr cur_info; - virDomainBlockIoTuneInfoPtr conf_cur_info; + virDomainBlockIoTuneInfo *cur_info; + virDomainBlockIoTuneInfo *conf_cur_info; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -16310,12 +16310,12 @@ qemuDomainGetBlockIoTune(virDomainPtr dom, int *nparams, unsigned int flags) { - virDomainDiskDefPtr disk; - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - qemuDomainObjPrivatePtr priv = NULL; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; + virDomainDiskDef *disk; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuDomainObjPrivate *priv = NULL; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; virDomainBlockIoTuneInfo reply = {0}; g_autofree char *drivealias = NULL; const char *qdevid = NULL; @@ -16471,9 +16471,9 @@ qemuDomainGetDiskErrors(virDomainPtr dom, unsigned int nerrors, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuDomainObjPrivate *priv; GHashTable *table = NULL; bool blockdev = false; int ret = -1; @@ -16511,8 +16511,8 @@ qemuDomainGetDiskErrors(virDomainPtr dom, for (i = n = 0; i < vm->def->ndisks; i++) { struct qemuDomainDiskInfo *info; - virDomainDiskDefPtr disk = vm->def->disks[i]; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + virDomainDiskDef *disk = vm->def->disks[i]; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); const char *entryname = disk->info.alias; if (blockdev && diskPriv->qomName) @@ -16552,8 +16552,8 @@ qemuDomainSetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; g_autoptr(virQEMUDriverConfig) cfg = NULL; int ret = -1; @@ -16576,7 +16576,7 @@ qemuDomainSetMetadata(virDomainPtr dom, cfg->configDir, flags); if (ret == 0) { - virObjectEventPtr ev = NULL; + virObjectEvent *ev = NULL; ev = virDomainEventMetadataChangeNewFromObj(vm, type, uri); virObjectEventStateQueue(driver->domainEventState, ev); } @@ -16594,7 +16594,7 @@ qemuDomainGetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; char *ret = NULL; if (!(vm = qemuDomainObjFromDomain(dom))) @@ -16619,10 +16619,10 @@ qemuDomainGetCPUStats(virDomainPtr domain, unsigned int ncpus, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; - qemuDomainObjPrivatePtr priv; - virBitmapPtr guestvcpus = NULL; + qemuDomainObjPrivate *priv; + virBitmap *guestvcpus = NULL; virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); @@ -16661,11 +16661,11 @@ qemuDomainGetCPUStats(virDomainPtr domain, static int -qemuDomainProbeQMPCurrentMachine(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainProbeQMPCurrentMachine(virQEMUDriver *driver, + virDomainObj *vm, bool *wakeupSupported) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; qemuMonitorCurrentMachineInfo info = { 0 }; int rv; @@ -16682,11 +16682,11 @@ qemuDomainProbeQMPCurrentMachine(virQEMUDriverPtr driver, /* returns -1 on error, or if query is not supported, 0 if query was successful */ static int -qemuDomainQueryWakeupSuspendSupport(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainQueryWakeupSuspendSupport(virQEMUDriver *driver, + virDomainObj *vm, bool *wakeupSupported) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret = -1; if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_QUERY_CURRENT_MACHINE)) @@ -16707,11 +16707,11 @@ qemuDomainQueryWakeupSuspendSupport(virQEMUDriverPtr driver, static int -qemuDomainPMSuspendAgent(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainPMSuspendAgent(virQEMUDriver *driver, + virDomainObj *vm, unsigned int target) { - qemuAgentPtr agent; + qemuAgent *agent; int ret = -1; if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0) @@ -16739,8 +16739,8 @@ qemuDomainPMSuspendForDuration(virDomainPtr dom, unsigned long long duration, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; bool wakeupSupported; @@ -16813,10 +16813,10 @@ static int qemuDomainPMWakeup(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; virCheckFlags(0, -1); @@ -16852,7 +16852,7 @@ qemuConnectListAllDomains(virConnectPtr conn, virDomainPtr **domains, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1); @@ -16869,11 +16869,11 @@ qemuDomainQemuAgentCommand(virDomainPtr domain, int timeout, unsigned int flags) { - virQEMUDriverPtr driver = domain->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = domain->conn->privateData; + virDomainObj *vm; int ret = -1; char *result = NULL; - qemuAgentPtr agent; + qemuAgent *agent; virCheckFlags(0, NULL); @@ -16918,7 +16918,7 @@ qemuConnectDomainQemuMonitorEventRegister(virConnectPtr conn, virFreeCallback freecb, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; int ret = -1; if (virConnectDomainQemuMonitorEventRegisterEnsureACL(conn) < 0) @@ -16939,7 +16939,7 @@ static int qemuConnectDomainQemuMonitorEventDeregister(virConnectPtr conn, int callbackID) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; if (virConnectDomainQemuMonitorEventDeregisterEnsureACL(conn) < 0) return -1; @@ -16958,9 +16958,9 @@ qemuDomainFSTrim(virDomainPtr dom, unsigned long long minimum, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuAgentPtr agent; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuAgent *agent; int ret = -1; virCheckFlags(0, -1); @@ -17142,11 +17142,11 @@ qemuConnectGetCPUModelNames(virConnectPtr conn, static int -qemuDomainGetHostnameAgent(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainGetHostnameAgent(virQEMUDriver *driver, + virDomainObj *vm, char **hostname) { - qemuAgentPtr agent; + qemuAgent *agent; int ret = -1; if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_QUERY) < 0) @@ -17170,8 +17170,8 @@ qemuDomainGetHostnameAgent(virQEMUDriverPtr driver, static int -qemuDomainGetHostnameLease(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainGetHostnameLease(virQEMUDriver *driver, + virDomainObj *vm, char **hostname) { char macaddr[VIR_MAC_STRING_BUFLEN]; @@ -17192,7 +17192,7 @@ qemuDomainGetHostnameLease(virQEMUDriverPtr driver, for (i = 0; i < vm->def->nnets; i++) { g_autoptr(virNetwork) network = NULL; - virDomainNetDefPtr net = vm->def->nets[i]; + virDomainNetDef *net = vm->def->nets[i]; if (net->type != VIR_DOMAIN_NET_TYPE_NETWORK) continue; @@ -17232,8 +17232,8 @@ static char * qemuDomainGetHostname(virDomainPtr dom, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; char *hostname = NULL; virCheckFlags(VIR_DOMAIN_GET_HOSTNAME_LEASE | @@ -17279,9 +17279,9 @@ qemuDomainGetTime(virDomainPtr dom, unsigned int *nseconds, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - qemuAgentPtr agent; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuAgent *agent; int ret = -1; int rv; @@ -17321,13 +17321,13 @@ qemuDomainGetTime(virDomainPtr dom, static int -qemuDomainSetTimeAgent(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainSetTimeAgent(virQEMUDriver *driver, + virDomainObj *vm, long long seconds, unsigned int nseconds, bool rtcSync) { - qemuAgentPtr agent; + qemuAgent *agent; int ret = -1; if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_MODIFY) < 0) @@ -17355,9 +17355,9 @@ qemuDomainSetTime(virDomainPtr dom, unsigned int nseconds, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - qemuDomainObjPrivatePtr priv; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + qemuDomainObjPrivate *priv; + virDomainObj *vm; bool rtcSync = flags & VIR_DOMAIN_TIME_SYNC; int ret = -1; int rv; @@ -17421,8 +17421,8 @@ qemuDomainFSFreeze(virDomainPtr dom, unsigned int nmountpoints, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -17456,8 +17456,8 @@ qemuDomainFSThaw(virDomainPtr dom, unsigned int nmountpoints, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -17517,7 +17517,7 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, const char *virttype_str, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; g_autoptr(virQEMUCaps) qemuCaps = NULL; virArch arch; virDomainVirtType virttype; @@ -17547,9 +17547,9 @@ qemuConnectGetDomainCapabilities(virConnectPtr conn, static int -qemuDomainGetStatsState(virQEMUDriverPtr driver G_GNUC_UNUSED, - virDomainObjPtr dom, - virTypedParamListPtr params, +qemuDomainGetStatsState(virQEMUDriver *driver G_GNUC_UNUSED, + virDomainObj *dom, + virTypedParamList *params, unsigned int privflags G_GNUC_UNUSED) { if (virTypedParamListAddInt(params, dom->state.state, "state.state") < 0) @@ -17574,17 +17574,16 @@ typedef enum { typedef struct _virQEMUResctrlMonData virQEMUResctrlMonData; -typedef virQEMUResctrlMonData *virQEMUResctrlMonDataPtr; struct _virQEMUResctrlMonData { char *name; char *vcpus; - virResctrlMonitorStatsPtr *stats; + virResctrlMonitorStats **stats; size_t nstats; }; static void -qemuDomainFreeResctrlMonData(virQEMUResctrlMonDataPtr resdata) +qemuDomainFreeResctrlMonData(virQEMUResctrlMonData *resdata) { size_t i = 0; @@ -17601,10 +17600,10 @@ qemuDomainFreeResctrlMonData(virQEMUResctrlMonDataPtr resdata) * qemuDomainGetResctrlMonData: * @dom: Pointer for the domain that the resctrl monitors reside in * @driver: Pointer to qemu driver - * @resdata: Pointer of virQEMUResctrlMonDataPtr pointer for receiving the - * virQEMUResctrlMonDataPtr array. Caller is responsible for - * freeing the array. - * @nresdata: Pointer of size_t to report the size virQEMUResctrlMonDataPtr + * @resdata: Pointer of virQEMUResctrlMonData * pointer for receiving the + * virQEMUResctrlMonData *array. Caller is responsible for + * freeing the array. + * @nresdata: Pointer of size_t to report the size virQEMUResctrlMonData * * array to caller. If *@nresdata is not 0, even if function * returns an error, the caller is also required to call * qemuDomainFreeResctrlMonData to free each element in the @@ -17618,14 +17617,14 @@ qemuDomainFreeResctrlMonData(virQEMUResctrlMonDataPtr resdata) * Returns -1 on failure, or 0 on success. */ static int -qemuDomainGetResctrlMonData(virQEMUDriverPtr driver, - virDomainObjPtr dom, - virQEMUResctrlMonDataPtr **resdata, +qemuDomainGetResctrlMonData(virQEMUDriver *driver, + virDomainObj *dom, + virQEMUResctrlMonData ***resdata, size_t *nresdata, virResctrlMonitorType tag) { - virDomainResctrlDefPtr resctrl = NULL; - virQEMUResctrlMonDataPtr res = NULL; + virDomainResctrlDef *resctrl = NULL; + virQEMUResctrlMonData *res = NULL; char **features = NULL; g_autoptr(virCaps) caps = NULL; size_t i = 0; @@ -17657,8 +17656,8 @@ qemuDomainGetResctrlMonData(virQEMUDriverPtr driver, resctrl = dom->def->resctrls[i]; for (j = 0; j < resctrl->nmonitors; j++) { - virDomainResctrlMonDefPtr domresmon = NULL; - virResctrlMonitorPtr monitor = NULL; + virDomainResctrlMonDef *domresmon = NULL; + virResctrlMonitor *monitor = NULL; domresmon = resctrl->monitors[j]; monitor = domresmon->instance; @@ -17695,11 +17694,11 @@ qemuDomainGetResctrlMonData(virQEMUDriverPtr driver, static int -qemuDomainGetStatsMemoryBandwidth(virQEMUDriverPtr driver, - virDomainObjPtr dom, - virTypedParamListPtr params) +qemuDomainGetStatsMemoryBandwidth(virQEMUDriver *driver, + virDomainObj *dom, + virTypedParamList *params) { - virQEMUResctrlMonDataPtr *resdata = NULL; + virQEMUResctrlMonData **resdata = NULL; char **features = NULL; size_t nresdata = 0; size_t i = 0; @@ -17783,11 +17782,11 @@ qemuDomainGetStatsMemoryBandwidth(virQEMUDriverPtr driver, static int -qemuDomainGetStatsCpuCache(virQEMUDriverPtr driver, - virDomainObjPtr dom, - virTypedParamListPtr params) +qemuDomainGetStatsCpuCache(virQEMUDriver *driver, + virDomainObj *dom, + virTypedParamList *params) { - virQEMUResctrlMonDataPtr *resdata = NULL; + virQEMUResctrlMonData **resdata = NULL; size_t nresdata = 0; size_t i = 0; size_t j = 0; @@ -17848,10 +17847,10 @@ qemuDomainGetStatsCpuCache(virQEMUDriverPtr driver, static int -qemuDomainGetStatsCpuCgroup(virDomainObjPtr dom, - virTypedParamListPtr params) +qemuDomainGetStatsCpuCgroup(virDomainObj *dom, + virTypedParamList *params) { - qemuDomainObjPrivatePtr priv = dom->privateData; + qemuDomainObjPrivate *priv = dom->privateData; unsigned long long cpu_time = 0; unsigned long long user_time = 0; unsigned long long sys_time = 0; @@ -17875,9 +17874,9 @@ qemuDomainGetStatsCpuCgroup(virDomainObjPtr dom, static int -qemuDomainGetStatsCpu(virQEMUDriverPtr driver, - virDomainObjPtr dom, - virTypedParamListPtr params, +qemuDomainGetStatsCpu(virQEMUDriver *driver, + virDomainObj *dom, + virTypedParamList *params, unsigned int privflags G_GNUC_UNUSED) { if (qemuDomainGetStatsCpuCgroup(dom, params) < 0) @@ -17891,9 +17890,9 @@ qemuDomainGetStatsCpu(virQEMUDriverPtr driver, static int -qemuDomainGetStatsMemory(virQEMUDriverPtr driver, - virDomainObjPtr dom, - virTypedParamListPtr params, +qemuDomainGetStatsMemory(virQEMUDriver *driver, + virDomainObj *dom, + virTypedParamList *params, unsigned int privflags G_GNUC_UNUSED) { @@ -17902,9 +17901,9 @@ qemuDomainGetStatsMemory(virQEMUDriverPtr driver, static int -qemuDomainGetStatsBalloon(virQEMUDriverPtr driver, - virDomainObjPtr dom, - virTypedParamListPtr params, +qemuDomainGetStatsBalloon(virQEMUDriver *driver, + virDomainObj *dom, + virTypedParamList *params, unsigned int privflags) { virDomainMemoryStatStruct stats[VIR_DOMAIN_MEMORY_STAT_NR]; @@ -17960,13 +17959,13 @@ qemuDomainGetStatsBalloon(virQEMUDriverPtr driver, static int -qemuDomainGetStatsVcpu(virQEMUDriverPtr driver, - virDomainObjPtr dom, - virTypedParamListPtr params, +qemuDomainGetStatsVcpu(virQEMUDriver *driver, + virDomainObj *dom, + virTypedParamList *params, unsigned int privflags) { - virDomainVcpuDefPtr vcpu; - qemuDomainVcpuPrivatePtr vcpupriv; + virDomainVcpuDef *vcpu; + qemuDomainVcpuPrivate *vcpupriv; size_t i; int ret = -1; virVcpuInfoPtr cpuinfo = NULL; @@ -18049,9 +18048,9 @@ qemuDomainGetStatsVcpu(virQEMUDriverPtr driver, return -1; static int -qemuDomainGetStatsInterface(virQEMUDriverPtr driver G_GNUC_UNUSED, - virDomainObjPtr dom, - virTypedParamListPtr params, +qemuDomainGetStatsInterface(virQEMUDriver *driver G_GNUC_UNUSED, + virDomainObj *dom, + virTypedParamList *params, unsigned int privflags G_GNUC_UNUSED) { size_t i; @@ -18065,7 +18064,7 @@ qemuDomainGetStatsInterface(virQEMUDriverPtr driver G_GNUC_UNUSED, /* Check the path is one of the domain's network interfaces. */ for (i = 0; i < dom->def->nnets; i++) { - virDomainNetDefPtr net = dom->def->nets[i]; + virDomainNetDef *net = dom->def->nets[i]; virDomainNetType actualType; if (!net->ifname) @@ -18116,11 +18115,11 @@ qemuDomainGetStatsInterface(virQEMUDriverPtr driver G_GNUC_UNUSED, /* refresh information by opening images on the disk */ static int -qemuDomainGetStatsOneBlockFallback(virQEMUDriverPtr driver, - virQEMUDriverConfigPtr cfg, - virDomainObjPtr dom, - virTypedParamListPtr params, - virStorageSourcePtr src, +qemuDomainGetStatsOneBlockFallback(virQEMUDriver *driver, + virQEMUDriverConfig *cfg, + virDomainObj *dom, + virTypedParamList *params, + virStorageSource *src, size_t block_idx) { if (virStorageSourceIsEmpty(src)) @@ -18157,19 +18156,19 @@ qemuDomainGetStatsOneBlockFallback(virQEMUDriverPtr driver, * @stats: hash table containing stats for all disks * @nodedata: reply containing 'query-named-block-nodes' data * - * Refresh disk block stats data (qemuBlockStatsPtr) which are present only + * Refresh disk block stats data (qemuBlockStats *) which are present only * in the reply of 'query-named-block-nodes' in cases when the data was gathered * by using query-block originally. */ static void -qemuDomainGetStatsOneBlockRefreshNamed(virStorageSourcePtr src, +qemuDomainGetStatsOneBlockRefreshNamed(virStorageSource *src, const char *alias, GHashTable *stats, GHashTable *nodedata) { - qemuBlockStatsPtr entry; + qemuBlockStats *entry; - virJSONValuePtr data; + virJSONValue *data; unsigned long long tmp; if (!nodedata || !src->nodestorage) @@ -18187,12 +18186,12 @@ qemuDomainGetStatsOneBlockRefreshNamed(virStorageSourcePtr src, static int -qemuDomainGetStatsOneBlock(virQEMUDriverPtr driver, - virQEMUDriverConfigPtr cfg, - virDomainObjPtr dom, - virTypedParamListPtr params, +qemuDomainGetStatsOneBlock(virQEMUDriver *driver, + virQEMUDriverConfig *cfg, + virDomainObj *dom, + virTypedParamList *params, const char *entryname, - virStorageSourcePtr src, + virStorageSource *src, size_t block_idx, GHashTable *stats) { @@ -18240,7 +18239,7 @@ static int qemuDomainGetStatsBlockExportBackendStorage(const char *entryname, GHashTable *stats, size_t recordnr, - virTypedParamListPtr params) + virTypedParamList *params) { qemuBlockStats *entry; @@ -18260,7 +18259,7 @@ static int qemuDomainGetStatsBlockExportFrontend(const char *frontendname, GHashTable *stats, size_t idx, - virTypedParamListPtr par) + virTypedParamList *par) { qemuBlockStats *en; @@ -18285,10 +18284,10 @@ qemuDomainGetStatsBlockExportFrontend(const char *frontendname, static int -qemuDomainGetStatsBlockExportHeader(virDomainDiskDefPtr disk, - virStorageSourcePtr src, +qemuDomainGetStatsBlockExportHeader(virDomainDiskDef *disk, + virStorageSource *src, size_t recordnr, - virTypedParamListPtr params) + virTypedParamList *params) { if (virTypedParamListAddString(params, disk->dst, "block.%zu.name", recordnr) < 0) return -1; @@ -18306,19 +18305,19 @@ qemuDomainGetStatsBlockExportHeader(virDomainDiskDefPtr disk, static int -qemuDomainGetStatsBlockExportDisk(virDomainDiskDefPtr disk, +qemuDomainGetStatsBlockExportDisk(virDomainDiskDef *disk, GHashTable *stats, GHashTable *nodestats, - virTypedParamListPtr params, + virTypedParamList *params, size_t *recordnr, bool visitBacking, - virQEMUDriverPtr driver, - virQEMUDriverConfigPtr cfg, - virDomainObjPtr dom, + virQEMUDriver *driver, + virQEMUDriverConfig *cfg, + virDomainObj *dom, bool blockdev) { - virStorageSourcePtr n; + virStorageSource *n; const char *frontendalias; const char *backendalias; const char *backendstoragealias; @@ -18408,9 +18407,9 @@ qemuDomainGetStatsBlockExportDisk(virDomainDiskDefPtr disk, static int -qemuDomainGetStatsBlock(virQEMUDriverPtr driver, - virDomainObjPtr dom, - virTypedParamListPtr params, +qemuDomainGetStatsBlock(virQEMUDriver *driver, + virDomainObj *dom, + virTypedParamList *params, unsigned int privflags) { size_t i; @@ -18418,8 +18417,8 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, int rc; GHashTable *stats = NULL; GHashTable *nodestats = NULL; - virJSONValuePtr nodedata = NULL; - qemuDomainObjPrivatePtr priv = dom->privateData; + virJSONValue *nodedata = NULL; + qemuDomainObjPrivate *priv = dom->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); bool fetchnodedata = virQEMUCapsGet(priv->qemuCaps, @@ -18483,14 +18482,14 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver, static int -qemuDomainGetStatsIOThread(virQEMUDriverPtr driver, - virDomainObjPtr dom, - virTypedParamListPtr params, +qemuDomainGetStatsIOThread(virQEMUDriver *driver, + virDomainObj *dom, + virTypedParamList *params, unsigned int privflags) { - qemuDomainObjPrivatePtr priv = dom->privateData; + qemuDomainObjPrivate *priv = dom->privateData; size_t i; - qemuMonitorIOThreadInfoPtr *iothreads = NULL; + qemuMonitorIOThreadInfo **iothreads = NULL; int niothreads = 0; int ret = -1; @@ -18542,9 +18541,9 @@ qemuDomainGetStatsIOThread(virQEMUDriverPtr driver, static int -qemuDomainGetStatsPerfOneEvent(virPerfPtr perf, +qemuDomainGetStatsPerfOneEvent(virPerf *perf, virPerfEventType type, - virTypedParamListPtr params) + virTypedParamList *params) { uint64_t value = 0; @@ -18559,13 +18558,13 @@ qemuDomainGetStatsPerfOneEvent(virPerfPtr perf, } static int -qemuDomainGetStatsPerf(virQEMUDriverPtr driver G_GNUC_UNUSED, - virDomainObjPtr dom, - virTypedParamListPtr params, +qemuDomainGetStatsPerf(virQEMUDriver *driver G_GNUC_UNUSED, + virDomainObj *dom, + virTypedParamList *params, unsigned int privflags G_GNUC_UNUSED) { size_t i; - qemuDomainObjPrivatePtr priv = dom->privateData; + qemuDomainObjPrivate *priv = dom->privateData; for (i = 0; i < VIR_PERF_EVENT_LAST; i++) { if (!virPerfEventIsEnabled(priv->perf, i)) @@ -18579,11 +18578,11 @@ qemuDomainGetStatsPerf(virQEMUDriverPtr driver G_GNUC_UNUSED, } static int -qemuDomainGetStatsDirtyRateMon(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuMonitorDirtyRateInfoPtr info) +qemuDomainGetStatsDirtyRateMon(virQEMUDriver *driver, + virDomainObj *vm, + qemuMonitorDirtyRateInfo *info) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret; qemuDomainObjEnterMonitor(driver, vm); @@ -18595,10 +18594,10 @@ qemuDomainGetStatsDirtyRateMon(virQEMUDriverPtr driver, } static int -qemuDomainGetStatsDirtyRate(virQEMUDriverPtr driver, - virDomainObjPtr dom, - virTypedParamListPtr params, - unsigned int privflags) +qemuDomainGetStatsDirtyRate(virQEMUDriver *driver, + virDomainObj *dom, + virTypedParamList *params, + unsigned int privflags) { qemuMonitorDirtyRateInfo info; @@ -18629,9 +18628,9 @@ qemuDomainGetStatsDirtyRate(virQEMUDriverPtr driver, } typedef int -(*qemuDomainGetStatsFunc)(virQEMUDriverPtr driver, - virDomainObjPtr dom, - virTypedParamListPtr list, +(*qemuDomainGetStatsFunc)(virQEMUDriver *driver, + virDomainObj *dom, + virTypedParamList *list, unsigned int flags); struct qemuDomainGetStatsWorker { @@ -18699,7 +18698,7 @@ qemuDomainGetStatsNeedMonitor(unsigned int stats) static int qemuDomainGetStats(virConnectPtr conn, - virDomainObjPtr dom, + virDomainObj *dom, unsigned int stats, virDomainStatsRecordPtr *record, unsigned int flags) @@ -18738,10 +18737,10 @@ qemuConnectGetAllDomainStats(virConnectPtr conn, virDomainStatsRecordPtr **retStats, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; virErrorPtr orig_err = NULL; - virDomainObjPtr *vms = NULL; - virDomainObjPtr vm; + virDomainObj **vms = NULL; + virDomainObj *vm; size_t nvms; virDomainStatsRecordPtr *tmpstats = NULL; bool enforce = !!(flags & VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS); @@ -18858,12 +18857,12 @@ qemuNodeAllocPages(virConnectPtr conn, } static int -qemuDomainGetFSInfoAgent(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuAgentFSInfoPtr **info) +qemuDomainGetFSInfoAgent(virQEMUDriver *driver, + virDomainObj *vm, + qemuAgentFSInfo ***info) { int ret = -1; - qemuAgentPtr agent; + qemuAgent *agent; if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_QUERY) < 0) @@ -18885,8 +18884,8 @@ qemuDomainGetFSInfoAgent(virQEMUDriverPtr driver, } static virDomainFSInfoPtr -qemuAgentFSInfoToPublic(qemuAgentFSInfoPtr agent, - virDomainDefPtr vmdef) +qemuAgentFSInfoToPublic(qemuAgentFSInfo *agent, + virDomainDef *vmdef) { virDomainFSInfoPtr ret = NULL; size_t i; @@ -18901,8 +18900,8 @@ qemuAgentFSInfoToPublic(qemuAgentFSInfoPtr agent, ret->devAlias = g_new0(char *, agent->ndisks); for (i = 0; i < agent->ndisks; i++) { - qemuAgentDiskAddressPtr agentdisk = agent->disks[i]; - virDomainDiskDefPtr diskDef; + qemuAgentDiskAddress *agentdisk = agent->disks[i]; + virDomainDiskDef *diskDef; diskDef = virDomainDiskByAddress(vmdef, &agentdisk->pci_controller, @@ -18923,9 +18922,9 @@ qemuAgentFSInfoToPublic(qemuAgentFSInfoPtr agent, * -1 otherwise */ static int -virDomainFSInfoFormat(qemuAgentFSInfoPtr *agentinfo, +virDomainFSInfoFormat(qemuAgentFSInfo **agentinfo, int nagentinfo, - virDomainDefPtr vmdef, + virDomainDef *vmdef, virDomainFSInfoPtr **info) { int ret = -1; @@ -18959,9 +18958,9 @@ qemuDomainGetFSInfo(virDomainPtr dom, virDomainFSInfoPtr **info, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuAgentFSInfoPtr *agentinfo = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuAgentFSInfo **agentinfo = NULL; int ret = -1; int nfs = 0; @@ -19005,9 +19004,9 @@ qemuDomainInterfaceAddresses(virDomainPtr dom, unsigned int source, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - qemuAgentPtr agent; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuAgent *agent; int ret = -1; virCheckFlags(0, -1); @@ -19065,9 +19064,9 @@ qemuDomainSetUserPassword(virDomainPtr dom, const char *password, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuAgentPtr agent; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm; + qemuAgent *agent; int ret = -1; int rv; @@ -19108,8 +19107,8 @@ qemuDomainSetUserPassword(virDomainPtr dom, struct qemuDomainMomentWriteMetadataData { - virQEMUDriverPtr driver; - virDomainObjPtr vm; + virQEMUDriver *driver; + virDomainObj *vm; }; @@ -19119,7 +19118,7 @@ qemuDomainSnapshotWriteMetadataIter(void *payload, void *opaque) { struct qemuDomainMomentWriteMetadataData *data = opaque; - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(data->driver); + virQEMUDriverConfig *cfg = virQEMUDriverGetConfig(data->driver); int ret; ret = qemuDomainSnapshotWriteMetadata(data->vm, payload, @@ -19137,7 +19136,7 @@ qemuDomainCheckpointWriteMetadataIter(void *payload, void *opaque) { struct qemuDomainMomentWriteMetadataData *data = opaque; - virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(data->driver); + virQEMUDriverConfig *cfg = virQEMUDriverGetConfig(data->driver); int ret; ret = qemuCheckpointWriteMetadata(data->vm, payload, @@ -19150,15 +19149,15 @@ qemuDomainCheckpointWriteMetadataIter(void *payload, static int -qemuDomainRenameCallback(virDomainObjPtr vm, +qemuDomainRenameCallback(virDomainObj *vm, const char *new_name, unsigned int flags, void *opaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; g_autoptr(virQEMUDriverConfig) cfg = NULL; - virObjectEventPtr event_new = NULL; - virObjectEventPtr event_old = NULL; + virObjectEvent *event_new = NULL; + virObjectEvent *event_old = NULL; int ret = -1; virErrorPtr err = NULL; g_autofree char *new_dom_name = NULL; @@ -19254,8 +19253,8 @@ static int qemuDomainRename(virDomainPtr dom, const char *new_name, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; int ret = -1; virCheckFlags(0, ret); @@ -19312,15 +19311,15 @@ static int qemuDomainRename(virDomainPtr dom, static int qemuDomainGetGuestVcpusParams(virTypedParameterPtr *params, unsigned int *nparams, - qemuAgentCPUInfoPtr info, + qemuAgentCPUInfo *info, int ninfo) { virTypedParameterPtr par = NULL; int npar = 0; int maxpar = 0; - virBitmapPtr vcpus = virBitmapNew(QEMU_GUEST_VCPU_MAX_ID); - virBitmapPtr online = virBitmapNew(QEMU_GUEST_VCPU_MAX_ID); - virBitmapPtr offlinable = virBitmapNew(QEMU_GUEST_VCPU_MAX_ID); + virBitmap *vcpus = virBitmapNew(QEMU_GUEST_VCPU_MAX_ID); + virBitmap *online = virBitmapNew(QEMU_GUEST_VCPU_MAX_ID); + virBitmap *offlinable = virBitmapNew(QEMU_GUEST_VCPU_MAX_ID); g_autofree char *tmp = NULL; size_t i; int ret = -1; @@ -19371,10 +19370,10 @@ qemuDomainGetGuestVcpus(virDomainPtr dom, unsigned int *nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - qemuAgentPtr agent; - qemuAgentCPUInfoPtr info = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuAgent *agent; + qemuAgentCPUInfo *info = NULL; int ninfo = 0; int ret = -1; @@ -19420,11 +19419,11 @@ qemuDomainSetGuestVcpus(virDomainPtr dom, int state, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - virBitmapPtr map = NULL; - qemuAgentCPUInfoPtr info = NULL; - qemuAgentPtr agent; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + virBitmap *map = NULL; + qemuAgentCPUInfo *info = NULL; + qemuAgent *agent; int ninfo = 0; size_t i; int ret = -1; @@ -19507,11 +19506,11 @@ qemuDomainSetVcpu(virDomainPtr dom, int state, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; - virBitmapPtr map = NULL; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; + virBitmap *map = NULL; ssize_t lastvcpu; int ret = -1; @@ -19580,10 +19579,10 @@ qemuDomainSetBlockThreshold(virDomainPtr dom, unsigned long long threshold, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - qemuDomainObjPrivatePtr priv; - virDomainObjPtr vm = NULL; - virStorageSourcePtr src; + virQEMUDriver *driver = dom->conn->privateData; + qemuDomainObjPrivate *priv; + virDomainObj *vm = NULL; + virStorageSource *src; g_autofree char *nodename = NULL; int rc; int ret = -1; @@ -19650,7 +19649,7 @@ qemuDomainSetBlockThreshold(virDomainPtr dom, static void -qemuDomainModifyLifecycleAction(virDomainDefPtr def, +qemuDomainModifyLifecycleAction(virDomainDef *def, virDomainLifecycle type, virDomainLifecycleAction action) { @@ -19677,12 +19676,12 @@ qemuDomainSetLifecycleAction(virDomainPtr dom, unsigned int action, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriver *driver = dom->conn->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv; - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; + qemuDomainObjPrivate *priv; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -19739,14 +19738,14 @@ qemuDomainSetLifecycleAction(virDomainPtr dom, static int -qemuGetSEVInfoToParams(virQEMUCapsPtr qemuCaps, +qemuGetSEVInfoToParams(virQEMUCaps *qemuCaps, virTypedParameterPtr *params, int *nparams, unsigned int flags) { int maxpar = 0; int n = 0; - virSEVCapabilityPtr sev = virQEMUCapsGetSEVCapabilities(qemuCaps); + virSEVCapability *sev = virQEMUCapsGetSEVCapabilities(qemuCaps); virTypedParameterPtr sevParams = NULL; virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); @@ -19784,7 +19783,7 @@ qemuNodeGetSEVInfo(virConnectPtr conn, int *nparams, unsigned int flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; g_autoptr(virQEMUCaps) qemucaps = NULL; if (virNodeGetSevInfoEnsureACL(conn) < 0) @@ -19811,8 +19810,8 @@ qemuNodeGetSEVInfo(virConnectPtr conn, static int -qemuDomainGetSEVMeasurement(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainGetSEVMeasurement(virQEMUDriver *driver, + virDomainObj *vm, virTypedParameterPtr *params, int *nparams, unsigned int flags) @@ -19854,8 +19853,8 @@ qemuDomainGetLaunchSecurityInfo(virDomainPtr domain, int *nparams, unsigned int flags) { - virQEMUDriverPtr driver = domain->conn->privateData; - virDomainObjPtr vm; + virQEMUDriver *driver = domain->conn->privateData; + virDomainObj *vm; int ret = -1; if (!(vm = qemuDomainObjFromDomain(domain))) @@ -19907,9 +19906,9 @@ qemuDomainGetGuestInfoCheckSupport(unsigned int types, static void -qemuAgentDiskInfoFormatParams(qemuAgentDiskInfoPtr *info, +qemuAgentDiskInfoFormatParams(qemuAgentDiskInfo **info, int ndisks, - virDomainDefPtr vmdef, + virDomainDef *vmdef, virTypedParameterPtr *params, int *nparams, int *maxparams) { @@ -19952,7 +19951,7 @@ qemuAgentDiskInfoFormatParams(qemuAgentDiskInfoPtr *info, } if (info[i]->address) { - virDomainDiskDefPtr diskdef = NULL; + virDomainDiskDef *diskdef = NULL; /* match the disk to the target in the vm definition */ diskdef = virDomainDiskByAddress(vmdef, @@ -19983,9 +19982,9 @@ qemuAgentDiskInfoFormatParams(qemuAgentDiskInfoPtr *info, static void -qemuAgentFSInfoFormatParams(qemuAgentFSInfoPtr *fsinfo, +qemuAgentFSInfoFormatParams(qemuAgentFSInfo **fsinfo, int nfs, - virDomainDefPtr vmdef, + virDomainDef *vmdef, virTypedParameterPtr *params, int *nparams, int *maxparams) { @@ -20037,8 +20036,8 @@ qemuAgentFSInfoFormatParams(qemuAgentFSInfoPtr *fsinfo, param_name, fsinfo[i]->ndisks) < 0) return; for (j = 0; j < fsinfo[i]->ndisks; j++) { - virDomainDiskDefPtr diskdef = NULL; - qemuAgentDiskAddressPtr d = fsinfo[i]->disks[j]; + virDomainDiskDef *diskdef = NULL; + qemuAgentDiskAddress *d = fsinfo[i]->disks[j]; /* match the disk to the target in the vm definition */ diskdef = virDomainDiskByAddress(vmdef, &d->pci_controller, @@ -20080,9 +20079,9 @@ qemuDomainGetGuestInfo(virDomainPtr dom, int *nparams, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - qemuAgentPtr agent; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuAgent *agent; int ret = -1; int maxparams = 0; g_autofree char *hostname = NULL; @@ -20090,9 +20089,9 @@ qemuDomainGetGuestInfo(virDomainPtr dom, bool report_unsupported = types != 0; int rc; size_t nfs = 0; - qemuAgentFSInfoPtr *agentfsinfo = NULL; + qemuAgentFSInfo **agentfsinfo = NULL; size_t ndisks = 0; - qemuAgentDiskInfoPtr *agentdiskinfo = NULL; + qemuAgentDiskInfo **agentdiskinfo = NULL; size_t i; virCheckFlags(0, -1); @@ -20207,9 +20206,9 @@ qemuDomainAgentSetResponseTimeout(virDomainPtr dom, int timeout, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; + virQEMUDriver *driver = dom->conn->privateData; g_autoptr(virQEMUDriverConfig) cfg = NULL; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; virCheckFlags(0, -1); @@ -20262,9 +20261,9 @@ qemuDomainAuthorizedSSHKeysGet(virDomainPtr dom, char ***keys, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - qemuAgentPtr agent; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuAgent *agent; int rv = -1; virCheckFlags(0, -1); @@ -20300,9 +20299,9 @@ qemuDomainAuthorizedSSHKeysSet(virDomainPtr dom, unsigned int nkeys, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - qemuAgentPtr agent; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuAgent *agent; const bool append = flags & VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_APPEND; const bool remove = flags & VIR_DOMAIN_AUTHORIZED_SSH_KEYS_SET_REMOVE; int rv = -1; @@ -20342,7 +20341,7 @@ qemuDomainGetMessages(virDomainPtr dom, char ***msgs, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int rv = -1; size_t i, n; int nmsgs; @@ -20402,9 +20401,9 @@ qemuDomainStartDirtyRateCalc(virDomainPtr dom, int seconds, unsigned int flags) { - virQEMUDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + qemuDomainObjPrivate *priv; int ret = -1; virCheckFlags(0, -1); diff --git a/src/qemu/qemu_extdevice.c b/src/qemu/qemu_extdevice.c index fdba22616c..ecf097feb9 100644 --- a/src/qemu/qemu_extdevice.c +++ b/src/qemu/qemu_extdevice.c @@ -41,9 +41,9 @@ VIR_LOG_INIT("qemu.qemu_extdevice"); int -qemuExtDeviceLogCommand(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCommandPtr cmd, +qemuExtDeviceLogCommand(virQEMUDriver *driver, + virDomainObj *vm, + virCommand *cmd, const char *info) { g_autofree char *timestamp = virTimeStringNow(); @@ -70,8 +70,8 @@ qemuExtDeviceLogCommand(virQEMUDriverPtr driver, * changes. */ static int -qemuExtDevicesInitPaths(virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuExtDevicesInitPaths(virQEMUDriver *driver, + virDomainDef *def) { if (def->ntpms > 0) return qemuExtTPMInitPaths(driver, def); @@ -89,14 +89,14 @@ qemuExtDevicesInitPaths(virQEMUDriverPtr driver, * Code that modifies live XML of a domain which is about to start. */ int -qemuExtDevicesPrepareDomain(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuExtDevicesPrepareDomain(virQEMUDriver *driver, + virDomainObj *vm) { int ret = 0; size_t i; for (i = 0; i < vm->def->nvideos; i++) { - virDomainVideoDefPtr video = vm->def->videos[i]; + virDomainVideoDef *video = vm->def->videos[i]; if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) { if ((ret = qemuExtVhostUserGPUPrepareDomain(driver, video)) < 0) @@ -105,7 +105,7 @@ qemuExtDevicesPrepareDomain(virQEMUDriverPtr driver, } for (i = 0; i < vm->def->nfss; i++) { - virDomainFSDefPtr fs = vm->def->fss[i]; + virDomainFSDef *fs = vm->def->fss[i]; if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS) { if (qemuVirtioFSPrepareDomain(driver, fs) < 0) @@ -126,10 +126,10 @@ qemuExtDevicesPrepareDomain(virQEMUDriverPtr driver, * Prepare host storage paths for external devices. */ int -qemuExtDevicesPrepareHost(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuExtDevicesPrepareHost(virQEMUDriver *driver, + virDomainObj *vm) { - virDomainDefPtr def = vm->def; + virDomainDef *def = vm->def; size_t i; if (qemuExtDevicesInitPaths(driver, def) < 0) @@ -140,8 +140,8 @@ qemuExtDevicesPrepareHost(virQEMUDriverPtr driver, return -1; for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; - qemuSlirpPtr slirp = QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp; + virDomainNetDef *net = def->nets[i]; + qemuSlirp *slirp = QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp; if (slirp && qemuSlirpOpen(slirp, driver, def) < 0) return -1; @@ -152,8 +152,8 @@ qemuExtDevicesPrepareHost(virQEMUDriverPtr driver, void -qemuExtDevicesCleanupHost(virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuExtDevicesCleanupHost(virQEMUDriver *driver, + virDomainDef *def) { if (qemuExtDevicesInitPaths(driver, def) < 0) return; @@ -164,16 +164,16 @@ qemuExtDevicesCleanupHost(virQEMUDriverPtr driver, int -qemuExtDevicesStart(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virLogManagerPtr logManager, +qemuExtDevicesStart(virQEMUDriver *driver, + virDomainObj *vm, + virLogManager *logManager, bool incomingMigration) { - virDomainDefPtr def = vm->def; + virDomainDef *def = vm->def; size_t i; for (i = 0; i < def->nvideos; i++) { - virDomainVideoDefPtr video = def->videos[i]; + virDomainVideoDef *video = def->videos[i]; if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) { if (qemuExtVhostUserGPUStart(driver, vm, video) < 0) @@ -185,8 +185,8 @@ qemuExtDevicesStart(virQEMUDriverPtr driver, return -1; for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; - qemuSlirpPtr slirp = QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp; + virDomainNetDef *net = def->nets[i]; + qemuSlirp *slirp = QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp; if (slirp && qemuSlirpStart(slirp, vm, driver, net, incomingMigration) < 0) @@ -194,7 +194,7 @@ qemuExtDevicesStart(virQEMUDriverPtr driver, } for (i = 0; i < def->nfss; i++) { - virDomainFSDefPtr fs = def->fss[i]; + virDomainFSDef *fs = def->fss[i]; if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS) { if (qemuVirtioFSStart(logManager, driver, vm, fs) < 0) @@ -207,17 +207,17 @@ qemuExtDevicesStart(virQEMUDriverPtr driver, void -qemuExtDevicesStop(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuExtDevicesStop(virQEMUDriver *driver, + virDomainObj *vm) { - virDomainDefPtr def = vm->def; + virDomainDef *def = vm->def; size_t i; if (qemuExtDevicesInitPaths(driver, def) < 0) return; for (i = 0; i < def->nvideos; i++) { - virDomainVideoDefPtr video = def->videos[i]; + virDomainVideoDef *video = def->videos[i]; if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) qemuExtVhostUserGPUStop(driver, vm, video); @@ -227,9 +227,9 @@ qemuExtDevicesStop(virQEMUDriverPtr driver, qemuExtTPMStop(driver, vm); for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; virDomainNetType actualType = virDomainNetGetActualType(net); - qemuSlirpPtr slirp = QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp; + qemuSlirp *slirp = QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp; if (slirp) qemuSlirpStop(slirp, vm, driver, net); @@ -238,7 +238,7 @@ qemuExtDevicesStop(virQEMUDriverPtr driver, } for (i = 0; i < def->nfss; i++) { - virDomainFSDefPtr fs = def->fss[i]; + virDomainFSDef *fs = def->fss[i]; if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS) qemuVirtioFSStop(driver, vm, fs); @@ -247,7 +247,7 @@ qemuExtDevicesStop(virQEMUDriverPtr driver, bool -qemuExtDevicesHasDevice(virDomainDefPtr def) +qemuExtDevicesHasDevice(virDomainDef *def) { size_t i; @@ -262,7 +262,7 @@ qemuExtDevicesHasDevice(virDomainDefPtr def) } for (i = 0; i < def->nfss; i++) { - virDomainFSDefPtr fs = def->fss[i]; + virDomainFSDef *fs = def->fss[i]; if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS) return true; @@ -273,18 +273,18 @@ qemuExtDevicesHasDevice(virDomainDefPtr def) int -qemuExtDevicesSetupCgroup(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCgroupPtr cgroup) +qemuExtDevicesSetupCgroup(virQEMUDriver *driver, + virDomainObj *vm, + virCgroup *cgroup) { - virDomainDefPtr def = vm->def; + virDomainDef *def = vm->def; size_t i; if (qemuDBusSetupCgroup(driver, vm, cgroup) < 0) return -1; for (i = 0; i < def->nvideos; i++) { - virDomainVideoDefPtr video = def->videos[i]; + virDomainVideoDef *video = def->videos[i]; if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER && qemuExtVhostUserGPUSetupCgroup(driver, def, video, cgroup) < 0) @@ -292,8 +292,8 @@ qemuExtDevicesSetupCgroup(virQEMUDriverPtr driver, } for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; - qemuSlirpPtr slirp = QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp; + virDomainNetDef *net = def->nets[i]; + qemuSlirp *slirp = QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp; if (slirp && qemuSlirpSetupCgroup(slirp, cgroup) < 0) return -1; @@ -304,7 +304,7 @@ qemuExtDevicesSetupCgroup(virQEMUDriverPtr driver, return -1; for (i = 0; i < def->nfss; i++) { - virDomainFSDefPtr fs = def->fss[i]; + virDomainFSDef *fs = def->fss[i]; if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS && qemuVirtioFSSetupCgroup(vm, fs, cgroup) < 0) diff --git a/src/qemu/qemu_extdevice.h b/src/qemu/qemu_extdevice.h index 49373a15a1..5f638438a8 100644 --- a/src/qemu/qemu_extdevice.h +++ b/src/qemu/qemu_extdevice.h @@ -23,40 +23,40 @@ #include "qemu_conf.h" #include "qemu_domain.h" -int qemuExtDeviceLogCommand(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCommandPtr cmd, +int qemuExtDeviceLogCommand(virQEMUDriver *driver, + virDomainObj *vm, + virCommand *cmd, const char *info) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; -int qemuExtDevicesPrepareDomain(virQEMUDriverPtr driver, - virDomainObjPtr vm) +int qemuExtDevicesPrepareDomain(virQEMUDriver *driver, + virDomainObj *vm) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int qemuExtDevicesPrepareHost(virQEMUDriverPtr driver, - virDomainObjPtr vm) +int qemuExtDevicesPrepareHost(virQEMUDriver *driver, + virDomainObj *vm) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -void qemuExtDevicesCleanupHost(virQEMUDriverPtr driver, - virDomainDefPtr def) +void qemuExtDevicesCleanupHost(virQEMUDriver *driver, + virDomainDef *def) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuExtDevicesStart(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virLogManagerPtr logManager, +int qemuExtDevicesStart(virQEMUDriver *driver, + virDomainObj *vm, + virLogManager *logManager, bool incomingMigration) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -void qemuExtDevicesStop(virQEMUDriverPtr driver, - virDomainObjPtr vm) +void qemuExtDevicesStop(virQEMUDriver *driver, + virDomainObj *vm) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -bool qemuExtDevicesHasDevice(virDomainDefPtr def); +bool qemuExtDevicesHasDevice(virDomainDef *def); -int qemuExtDevicesSetupCgroup(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCgroupPtr cgroup); +int qemuExtDevicesSetupCgroup(virQEMUDriver *driver, + virDomainObj *vm, + virCgroup *cgroup); diff --git a/src/qemu/qemu_firmware.c b/src/qemu/qemu_firmware.c index a211d2fb36..94e88ebe4b 100644 --- a/src/qemu/qemu_firmware.c +++ b/src/qemu/qemu_firmware.c @@ -60,7 +60,6 @@ VIR_ENUM_IMPL(qemuFirmwareOSInterface, typedef struct _qemuFirmwareFlashFile qemuFirmwareFlashFile; -typedef qemuFirmwareFlashFile *qemuFirmwareFlashFilePtr; struct _qemuFirmwareFlashFile { char *filename; char *format; @@ -68,7 +67,6 @@ struct _qemuFirmwareFlashFile { typedef struct _qemuFirmwareMappingFlash qemuFirmwareMappingFlash; -typedef qemuFirmwareMappingFlash *qemuFirmwareMappingFlashPtr; struct _qemuFirmwareMappingFlash { qemuFirmwareFlashFile executable; qemuFirmwareFlashFile nvram_template; @@ -76,14 +74,12 @@ struct _qemuFirmwareMappingFlash { typedef struct _qemuFirmwareMappingKernel qemuFirmwareMappingKernel; -typedef qemuFirmwareMappingKernel *qemuFirmwareMappingKernelPtr; struct _qemuFirmwareMappingKernel { char *filename; }; typedef struct _qemuFirmwareMappingMemory qemuFirmwareMappingMemory; -typedef qemuFirmwareMappingMemory *qemuFirmwareMappingMemoryPtr; struct _qemuFirmwareMappingMemory { char *filename; }; @@ -109,7 +105,6 @@ VIR_ENUM_IMPL(qemuFirmwareDevice, typedef struct _qemuFirmwareMapping qemuFirmwareMapping; -typedef qemuFirmwareMapping *qemuFirmwareMappingPtr; struct _qemuFirmwareMapping { qemuFirmwareDevice device; @@ -122,7 +117,6 @@ struct _qemuFirmwareMapping { typedef struct _qemuFirmwareTarget qemuFirmwareTarget; -typedef qemuFirmwareTarget *qemuFirmwareTargetPtr; struct _qemuFirmwareTarget { virArch architecture; size_t nmachines; @@ -168,7 +162,7 @@ struct _qemuFirmware { qemuFirmwareMapping mapping; size_t ntargets; - qemuFirmwareTargetPtr *targets; + qemuFirmwareTarget **targets; size_t nfeatures; qemuFirmwareFeature *features; @@ -188,7 +182,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmwareOSInterface, qemuFirmwareOSInterfaceFr static void -qemuFirmwareFlashFileFreeContent(qemuFirmwareFlashFilePtr flash) +qemuFirmwareFlashFileFreeContent(qemuFirmwareFlashFile *flash) { g_free(flash->filename); g_free(flash->format); @@ -196,7 +190,7 @@ qemuFirmwareFlashFileFreeContent(qemuFirmwareFlashFilePtr flash) static void -qemuFirmwareMappingFlashFreeContent(qemuFirmwareMappingFlashPtr flash) +qemuFirmwareMappingFlashFreeContent(qemuFirmwareMappingFlash *flash) { qemuFirmwareFlashFileFreeContent(&flash->executable); qemuFirmwareFlashFileFreeContent(&flash->nvram_template); @@ -204,21 +198,21 @@ qemuFirmwareMappingFlashFreeContent(qemuFirmwareMappingFlashPtr flash) static void -qemuFirmwareMappingKernelFreeContent(qemuFirmwareMappingKernelPtr kernel) +qemuFirmwareMappingKernelFreeContent(qemuFirmwareMappingKernel *kernel) { g_free(kernel->filename); } static void -qemuFirmwareMappingMemoryFreeContent(qemuFirmwareMappingMemoryPtr memory) +qemuFirmwareMappingMemoryFreeContent(qemuFirmwareMappingMemory *memory) { g_free(memory->filename); } static void -qemuFirmwareMappingFreeContent(qemuFirmwareMappingPtr mapping) +qemuFirmwareMappingFreeContent(qemuFirmwareMapping *mapping) { switch (mapping->device) { case QEMU_FIRMWARE_DEVICE_FLASH: @@ -238,7 +232,7 @@ qemuFirmwareMappingFreeContent(qemuFirmwareMappingPtr mapping) static void -qemuFirmwareTargetFree(qemuFirmwareTargetPtr target) +qemuFirmwareTargetFree(qemuFirmwareTarget *target) { if (!target) return; @@ -263,7 +257,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmwareFeature, qemuFirmwareFeatureFree); void -qemuFirmwareFree(qemuFirmwarePtr fw) +qemuFirmwareFree(qemuFirmware *fw) { size_t i; @@ -283,10 +277,10 @@ qemuFirmwareFree(qemuFirmwarePtr fw) static int qemuFirmwareInterfaceParse(const char *path, - virJSONValuePtr doc, - qemuFirmwarePtr fw) + virJSONValue *doc, + qemuFirmware *fw) { - virJSONValuePtr interfacesJSON; + virJSONValue *interfacesJSON; g_autoptr(qemuFirmwareOSInterface) interfaces = NULL; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t ninterfaces; @@ -304,7 +298,7 @@ qemuFirmwareInterfaceParse(const char *path, interfaces = g_new0(qemuFirmwareOSInterface, ninterfaces); for (i = 0; i < ninterfaces; i++) { - virJSONValuePtr item = virJSONValueArrayGet(interfacesJSON, i); + virJSONValue *item = virJSONValueArrayGet(interfacesJSON, i); const char *tmpStr = virJSONValueGetString(item); int tmp; @@ -330,8 +324,8 @@ qemuFirmwareInterfaceParse(const char *path, static int qemuFirmwareFlashFileParse(const char *path, - virJSONValuePtr doc, - qemuFirmwareFlashFilePtr flash) + virJSONValue *doc, + qemuFirmwareFlashFile *flash) { const char *filename; const char *format; @@ -360,11 +354,11 @@ qemuFirmwareFlashFileParse(const char *path, static int qemuFirmwareMappingFlashParse(const char *path, - virJSONValuePtr doc, - qemuFirmwareMappingFlashPtr flash) + virJSONValue *doc, + qemuFirmwareMappingFlash *flash) { - virJSONValuePtr executable; - virJSONValuePtr nvram_template; + virJSONValue *executable; + virJSONValue *nvram_template; if (!(executable = virJSONValueObjectGet(doc, "executable"))) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -392,8 +386,8 @@ qemuFirmwareMappingFlashParse(const char *path, static int qemuFirmwareMappingKernelParse(const char *path, - virJSONValuePtr doc, - qemuFirmwareMappingKernelPtr kernel) + virJSONValue *doc, + qemuFirmwareMappingKernel *kernel) { const char *filename; @@ -411,8 +405,8 @@ qemuFirmwareMappingKernelParse(const char *path, static int qemuFirmwareMappingMemoryParse(const char *path, - virJSONValuePtr doc, - qemuFirmwareMappingMemoryPtr memory) + virJSONValue *doc, + qemuFirmwareMappingMemory *memory) { const char *filename; @@ -430,10 +424,10 @@ qemuFirmwareMappingMemoryParse(const char *path, static int qemuFirmwareMappingParse(const char *path, - virJSONValuePtr doc, - qemuFirmwarePtr fw) + virJSONValue *doc, + qemuFirmware *fw) { - virJSONValuePtr mapping; + virJSONValue *mapping; const char *deviceStr; int tmp; @@ -485,11 +479,11 @@ qemuFirmwareMappingParse(const char *path, static int qemuFirmwareTargetParse(const char *path, - virJSONValuePtr doc, - qemuFirmwarePtr fw) + virJSONValue *doc, + qemuFirmware *fw) { - virJSONValuePtr targetsJSON; - qemuFirmwareTargetPtr *targets = NULL; + virJSONValue *targetsJSON; + qemuFirmwareTarget **targets = NULL; size_t ntargets; size_t i; int ret = -1; @@ -503,11 +497,11 @@ qemuFirmwareTargetParse(const char *path, ntargets = virJSONValueArraySize(targetsJSON); - targets = g_new0(qemuFirmwareTargetPtr, ntargets); + targets = g_new0(qemuFirmwareTarget *, ntargets); for (i = 0; i < ntargets; i++) { - virJSONValuePtr item = virJSONValueArrayGet(targetsJSON, i); - virJSONValuePtr machines; + virJSONValue *item = virJSONValueArrayGet(targetsJSON, i); + virJSONValue *machines; g_autoptr(qemuFirmwareTarget) t = NULL; const char *architectureStr = NULL; size_t nmachines; @@ -541,7 +535,7 @@ qemuFirmwareTargetParse(const char *path, t->machines = g_new0(char *, nmachines); for (j = 0; j < nmachines; j++) { - virJSONValuePtr machine = virJSONValueArrayGet(machines, j); + virJSONValue *machine = virJSONValueArrayGet(machines, j); g_autofree char *machineStr = NULL; machineStr = g_strdup(virJSONValueGetString(machine)); @@ -567,10 +561,10 @@ qemuFirmwareTargetParse(const char *path, static int qemuFirmwareFeatureParse(const char *path, - virJSONValuePtr doc, - qemuFirmwarePtr fw) + virJSONValue *doc, + qemuFirmware *fw) { - virJSONValuePtr featuresJSON; + virJSONValue *featuresJSON; g_autoptr(qemuFirmwareFeature) features = NULL; size_t nfeatures; size_t i; @@ -587,7 +581,7 @@ qemuFirmwareFeatureParse(const char *path, features = g_new0(qemuFirmwareFeature, nfeatures); for (i = 0; i < nfeatures; i++) { - virJSONValuePtr item = virJSONValueArrayGet(featuresJSON, i); + virJSONValue *item = virJSONValueArrayGet(featuresJSON, i); const char *tmpStr = virJSONValueGetString(item); int tmp; @@ -610,7 +604,7 @@ qemuFirmwareFeatureParse(const char *path, /* 1MiB should be enough for everybody (TM) */ #define DOCUMENT_SIZE (1024 * 1024) -qemuFirmwarePtr +qemuFirmware * qemuFirmwareParse(const char *path) { g_autofree char *cont = NULL; @@ -646,8 +640,8 @@ qemuFirmwareParse(const char *path) static int -qemuFirmwareInterfaceFormat(virJSONValuePtr doc, - qemuFirmwarePtr fw) +qemuFirmwareInterfaceFormat(virJSONValue *doc, + qemuFirmware *fw) { g_autoptr(virJSONValue) interfacesJSON = NULL; size_t i; @@ -669,11 +663,11 @@ qemuFirmwareInterfaceFormat(virJSONValuePtr doc, } -static virJSONValuePtr +static virJSONValue * qemuFirmwareFlashFileFormat(qemuFirmwareFlashFile flash) { g_autoptr(virJSONValue) json = virJSONValueNewObject(); - virJSONValuePtr ret; + virJSONValue *ret; if (virJSONValueObjectAppendString(json, "filename", @@ -691,8 +685,8 @@ qemuFirmwareFlashFileFormat(qemuFirmwareFlashFile flash) static int -qemuFirmwareMappingFlashFormat(virJSONValuePtr mapping, - qemuFirmwareMappingFlashPtr flash) +qemuFirmwareMappingFlashFormat(virJSONValue *mapping, + qemuFirmwareMappingFlash *flash) { g_autoptr(virJSONValue) executable = NULL; g_autoptr(virJSONValue) nvram_template = NULL; @@ -719,8 +713,8 @@ qemuFirmwareMappingFlashFormat(virJSONValuePtr mapping, static int -qemuFirmwareMappingKernelFormat(virJSONValuePtr mapping, - qemuFirmwareMappingKernelPtr kernel) +qemuFirmwareMappingKernelFormat(virJSONValue *mapping, + qemuFirmwareMappingKernel *kernel) { if (virJSONValueObjectAppendString(mapping, "filename", @@ -732,8 +726,8 @@ qemuFirmwareMappingKernelFormat(virJSONValuePtr mapping, static int -qemuFirmwareMappingMemoryFormat(virJSONValuePtr mapping, - qemuFirmwareMappingMemoryPtr memory) +qemuFirmwareMappingMemoryFormat(virJSONValue *mapping, + qemuFirmwareMappingMemory *memory) { if (virJSONValueObjectAppendString(mapping, "filename", @@ -745,8 +739,8 @@ qemuFirmwareMappingMemoryFormat(virJSONValuePtr mapping, static int -qemuFirmwareMappingFormat(virJSONValuePtr doc, - qemuFirmwarePtr fw) +qemuFirmwareMappingFormat(virJSONValue *doc, + qemuFirmware *fw) { g_autoptr(virJSONValue) mapping = virJSONValueNewObject(); @@ -782,8 +776,8 @@ qemuFirmwareMappingFormat(virJSONValuePtr doc, static int -qemuFirmwareTargetFormat(virJSONValuePtr doc, - qemuFirmwarePtr fw) +qemuFirmwareTargetFormat(virJSONValue *doc, + qemuFirmware *fw) { g_autoptr(virJSONValue) targetsJSON = NULL; size_t i; @@ -791,7 +785,7 @@ qemuFirmwareTargetFormat(virJSONValuePtr doc, targetsJSON = virJSONValueNewArray(); for (i = 0; i < fw->ntargets; i++) { - qemuFirmwareTargetPtr t = fw->targets[i]; + qemuFirmwareTarget *t = fw->targets[i]; g_autoptr(virJSONValue) target = virJSONValueNewObject(); g_autoptr(virJSONValue) machines = NULL; size_t j; @@ -824,8 +818,8 @@ qemuFirmwareTargetFormat(virJSONValuePtr doc, static int -qemuFirmwareFeatureFormat(virJSONValuePtr doc, - qemuFirmwarePtr fw) +qemuFirmwareFeatureFormat(virJSONValue *doc, + qemuFirmware *fw) { g_autoptr(virJSONValue) featuresJSON = NULL; size_t i; @@ -848,7 +842,7 @@ qemuFirmwareFeatureFormat(virJSONValuePtr doc, char * -qemuFirmwareFormat(qemuFirmwarePtr fw) +qemuFirmwareFormat(qemuFirmware *fw) { g_autoptr(virJSONValue) doc = virJSONValueNewObject(); @@ -1061,8 +1055,8 @@ qemuFirmwareMatchDomain(const virDomainDef *def, static int -qemuFirmwareEnableFeatures(virQEMUDriverPtr driver, - virDomainDefPtr def, +qemuFirmwareEnableFeatures(virQEMUDriver *driver, + virDomainDef *def, const qemuFirmware *fw) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); @@ -1209,12 +1203,12 @@ qemuFirmwareSanityCheck(const qemuFirmware *fw, static ssize_t qemuFirmwareFetchParsedConfigs(bool privileged, - qemuFirmwarePtr **firmwaresRet, + qemuFirmware ***firmwaresRet, char ***pathsRet) { g_auto(GStrv) paths = NULL; size_t npaths; - qemuFirmwarePtr *firmwares = NULL; + qemuFirmware **firmwares = NULL; size_t i; if (qemuFirmwareFetchConfigs(&paths, privileged) < 0) @@ -1225,7 +1219,7 @@ qemuFirmwareFetchParsedConfigs(bool privileged, npaths = g_strv_length(paths); - firmwares = g_new0(qemuFirmwarePtr, npaths); + firmwares = g_new0(qemuFirmware *, npaths); for (i = 0; i < npaths; i++) { if (!(firmwares[i] = qemuFirmwareParse(paths[i]))) @@ -1246,12 +1240,12 @@ qemuFirmwareFetchParsedConfigs(bool privileged, int -qemuFirmwareFillDomain(virQEMUDriverPtr driver, - virDomainDefPtr def, +qemuFirmwareFillDomain(virQEMUDriver *driver, + virDomainDef *def, unsigned int flags) { g_auto(GStrv) paths = NULL; - qemuFirmwarePtr *firmwares = NULL; + qemuFirmware **firmwares = NULL; ssize_t nfirmwares = 0; const qemuFirmware *theone = NULL; bool needResult = true; @@ -1362,10 +1356,10 @@ qemuFirmwareGetSupported(const char *machine, bool privileged, uint64_t *supported, bool *secure, - virFirmwarePtr **fws, + virFirmware ***fws, size_t *nfws) { - qemuFirmwarePtr *firmwares = NULL; + qemuFirmware **firmwares = NULL; ssize_t nfirmwares = 0; size_t i; @@ -1382,7 +1376,7 @@ qemuFirmwareGetSupported(const char *machine, return -1; for (i = 0; i < nfirmwares; i++) { - qemuFirmwarePtr fw = firmwares[i]; + qemuFirmware *fw = firmwares[i]; const qemuFirmwareMappingFlash *flash = &fw->mapping.data.flash; const qemuFirmwareMappingMemory *memory = &fw->mapping.data.memory; const char *fwpath = NULL; diff --git a/src/qemu/qemu_firmware.h b/src/qemu/qemu_firmware.h index 2fdd71ba52..103b6e4643 100644 --- a/src/qemu/qemu_firmware.h +++ b/src/qemu/qemu_firmware.h @@ -26,26 +26,25 @@ #include "virfirmware.h" typedef struct _qemuFirmware qemuFirmware; -typedef qemuFirmware *qemuFirmwarePtr; void -qemuFirmwareFree(qemuFirmwarePtr fw); +qemuFirmwareFree(qemuFirmware *fw); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuFirmware, qemuFirmwareFree); -qemuFirmwarePtr +qemuFirmware * qemuFirmwareParse(const char *path); char * -qemuFirmwareFormat(qemuFirmwarePtr fw); +qemuFirmwareFormat(qemuFirmware *fw); int qemuFirmwareFetchConfigs(char ***firmwares, bool privileged); int -qemuFirmwareFillDomain(virQEMUDriverPtr driver, - virDomainDefPtr def, +qemuFirmwareFillDomain(virQEMUDriver *driver, + virDomainDef *def, unsigned int flags); int @@ -54,7 +53,7 @@ qemuFirmwareGetSupported(const char *machine, bool privileged, uint64_t *supported, bool *secure, - virFirmwarePtr **fws, + virFirmware ***fws, size_t *nfws); G_STATIC_ASSERT(VIR_DOMAIN_OS_DEF_FIRMWARE_LAST <= 64); diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c index c5d89e1fc8..00f301f941 100644 --- a/src/qemu/qemu_hostdev.c +++ b/src/qemu/qemu_hostdev.c @@ -43,10 +43,10 @@ VIR_LOG_INIT("qemu.qemu_hostdev"); int -qemuHostdevUpdateActivePCIDevices(virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuHostdevUpdateActivePCIDevices(virQEMUDriver *driver, + virDomainDef *def) { - virHostdevManagerPtr mgr = driver->hostdevMgr; + virHostdevManager *mgr = driver->hostdevMgr; if (!def->nhostdevs) return 0; @@ -56,10 +56,10 @@ qemuHostdevUpdateActivePCIDevices(virQEMUDriverPtr driver, } int -qemuHostdevUpdateActiveUSBDevices(virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuHostdevUpdateActiveUSBDevices(virQEMUDriver *driver, + virDomainDef *def) { - virHostdevManagerPtr mgr = driver->hostdevMgr; + virHostdevManager *mgr = driver->hostdevMgr; if (!def->nhostdevs) return 0; @@ -69,10 +69,10 @@ qemuHostdevUpdateActiveUSBDevices(virQEMUDriverPtr driver, } int -qemuHostdevUpdateActiveSCSIDevices(virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuHostdevUpdateActiveSCSIDevices(virQEMUDriver *driver, + virDomainDef *def) { - virHostdevManagerPtr mgr = driver->hostdevMgr; + virHostdevManager *mgr = driver->hostdevMgr; if (!def->nhostdevs) return 0; @@ -83,10 +83,10 @@ qemuHostdevUpdateActiveSCSIDevices(virQEMUDriverPtr driver, int -qemuHostdevUpdateActiveMediatedDevices(virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuHostdevUpdateActiveMediatedDevices(virQEMUDriver *driver, + virDomainDef *def) { - virHostdevManagerPtr mgr = driver->hostdevMgr; + virHostdevManager *mgr = driver->hostdevMgr; if (!def->nhostdevs) return 0; @@ -98,8 +98,8 @@ qemuHostdevUpdateActiveMediatedDevices(virQEMUDriverPtr driver, int -qemuHostdevUpdateActiveNVMeDisks(virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuHostdevUpdateActiveNVMeDisks(virQEMUDriver *driver, + virDomainDef *def) { return virHostdevUpdateActiveNVMeDevices(driver->hostdevMgr, QEMU_DRIVER_NAME, @@ -110,8 +110,8 @@ qemuHostdevUpdateActiveNVMeDisks(virQEMUDriverPtr driver, int -qemuHostdevUpdateActiveDomainDevices(virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuHostdevUpdateActiveDomainDevices(virQEMUDriver *driver, + virDomainDef *def) { if (!def->nhostdevs && !def->ndisks) return 0; @@ -159,16 +159,16 @@ qemuHostdevHostSupportsPassthroughVFIO(void) static bool -qemuHostdevPreparePCIDevicesCheckSupport(virDomainHostdevDefPtr *hostdevs, +qemuHostdevPreparePCIDevicesCheckSupport(virDomainHostdevDef **hostdevs, size_t nhostdevs, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { bool supportsPassthroughVFIO = qemuHostdevHostSupportsPassthroughVFIO(); size_t i; /* assign defaults for hostdev passthrough */ for (i = 0; i < nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = hostdevs[i]; + virDomainHostdevDef *hostdev = hostdevs[i]; int *backend = &hostdev->source.subsys.u.pci.backend; if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) @@ -213,9 +213,9 @@ qemuHostdevPreparePCIDevicesCheckSupport(virDomainHostdevDefPtr *hostdevs, } int -qemuHostdevPrepareOneNVMeDisk(virQEMUDriverPtr driver, +qemuHostdevPrepareOneNVMeDisk(virQEMUDriver *driver, const char *name, - virStorageSourcePtr src) + virStorageSource *src) { return virHostdevPrepareOneNVMeDevice(driver->hostdevMgr, QEMU_DRIVER_NAME, @@ -224,9 +224,9 @@ qemuHostdevPrepareOneNVMeDisk(virQEMUDriverPtr driver, } int -qemuHostdevPrepareNVMeDisks(virQEMUDriverPtr driver, +qemuHostdevPrepareNVMeDisks(virQEMUDriver *driver, const char *name, - virDomainDiskDefPtr *disks, + virDomainDiskDef **disks, size_t ndisks) { return virHostdevPrepareNVMeDevices(driver->hostdevMgr, @@ -235,15 +235,15 @@ qemuHostdevPrepareNVMeDisks(virQEMUDriverPtr driver, } int -qemuHostdevPreparePCIDevices(virQEMUDriverPtr driver, +qemuHostdevPreparePCIDevices(virQEMUDriver *driver, const char *name, const unsigned char *uuid, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, unsigned int flags) { - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; if (!qemuHostdevPreparePCIDevicesCheckSupport(hostdevs, nhostdevs, qemuCaps)) return -1; @@ -254,26 +254,26 @@ qemuHostdevPreparePCIDevices(virQEMUDriverPtr driver, } int -qemuHostdevPrepareUSBDevices(virQEMUDriverPtr driver, +qemuHostdevPrepareUSBDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs, unsigned int flags) { - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; return virHostdevPrepareUSBDevices(hostdev_mgr, QEMU_DRIVER_NAME, name, hostdevs, nhostdevs, flags); } int -qemuHostdevPrepareSCSIDevices(virQEMUDriverPtr driver, +qemuHostdevPrepareSCSIDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { size_t i; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; /* Loop 1: Add the shared scsi host device to shared device * table. @@ -299,24 +299,24 @@ qemuHostdevPrepareSCSIDevices(virQEMUDriverPtr driver, } int -qemuHostdevPrepareSCSIVHostDevices(virQEMUDriverPtr driver, +qemuHostdevPrepareSCSIVHostDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; return virHostdevPrepareSCSIVHostDevices(hostdev_mgr, QEMU_DRIVER_NAME, name, hostdevs, nhostdevs); } int -qemuHostdevPrepareMediatedDevices(virQEMUDriverPtr driver, +qemuHostdevPrepareMediatedDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; bool supportsVFIO; size_t i; @@ -342,9 +342,9 @@ qemuHostdevPrepareMediatedDevices(virQEMUDriverPtr driver, } int -qemuHostdevPrepareDomainDevices(virQEMUDriverPtr driver, - virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, +qemuHostdevPrepareDomainDevices(virQEMUDriver *driver, + virDomainDef *def, + virQEMUCaps *qemuCaps, unsigned int flags) { if (!def->nhostdevs && !def->ndisks) @@ -378,9 +378,9 @@ qemuHostdevPrepareDomainDevices(virQEMUDriverPtr driver, } void -qemuHostdevReAttachOneNVMeDisk(virQEMUDriverPtr driver, +qemuHostdevReAttachOneNVMeDisk(virQEMUDriver *driver, const char *name, - virStorageSourcePtr src) + virStorageSource *src) { virHostdevReAttachOneNVMeDevice(driver->hostdevMgr, QEMU_DRIVER_NAME, @@ -389,9 +389,9 @@ qemuHostdevReAttachOneNVMeDisk(virQEMUDriverPtr driver, } void -qemuHostdevReAttachNVMeDisks(virQEMUDriverPtr driver, +qemuHostdevReAttachNVMeDisks(virQEMUDriver *driver, const char *name, - virDomainDiskDefPtr *disks, + virDomainDiskDef **disks, size_t ndisks) { virHostdevReAttachNVMeDevices(driver->hostdevMgr, @@ -400,40 +400,40 @@ qemuHostdevReAttachNVMeDisks(virQEMUDriverPtr driver, } void -qemuHostdevReAttachPCIDevices(virQEMUDriverPtr driver, +qemuHostdevReAttachPCIDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; virHostdevReAttachPCIDevices(hostdev_mgr, QEMU_DRIVER_NAME, name, hostdevs, nhostdevs); } void -qemuHostdevReAttachUSBDevices(virQEMUDriverPtr driver, +qemuHostdevReAttachUSBDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; virHostdevReAttachUSBDevices(hostdev_mgr, QEMU_DRIVER_NAME, name, hostdevs, nhostdevs); } void -qemuHostdevReAttachSCSIDevices(virQEMUDriverPtr driver, +qemuHostdevReAttachSCSIDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { size_t i; - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; for (i = 0; i < nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = hostdevs[i]; + virDomainHostdevDef *hostdev = hostdevs[i]; virDomainDeviceDef dev; dev.type = VIR_DOMAIN_DEVICE_HOSTDEV; @@ -447,32 +447,32 @@ qemuHostdevReAttachSCSIDevices(virQEMUDriverPtr driver, } void -qemuHostdevReAttachSCSIVHostDevices(virQEMUDriverPtr driver, +qemuHostdevReAttachSCSIVHostDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; virHostdevReAttachSCSIVHostDevices(hostdev_mgr, QEMU_DRIVER_NAME, name, hostdevs, nhostdevs); } void -qemuHostdevReAttachMediatedDevices(virQEMUDriverPtr driver, +qemuHostdevReAttachMediatedDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs) { - virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr; + virHostdevManager *hostdev_mgr = driver->hostdevMgr; virHostdevReAttachMediatedDevices(hostdev_mgr, QEMU_DRIVER_NAME, name, hostdevs, nhostdevs); } void -qemuHostdevReAttachDomainDevices(virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuHostdevReAttachDomainDevices(virQEMUDriver *driver, + virDomainDef *def) { if (!def->nhostdevs && !def->ndisks) return; diff --git a/src/qemu/qemu_hostdev.h b/src/qemu/qemu_hostdev.h index 23df925529..09006851b1 100644 --- a/src/qemu/qemu_hostdev.h +++ b/src/qemu/qemu_hostdev.h @@ -28,81 +28,81 @@ bool qemuHostdevNeedsVFIO(const virDomainHostdevDef *hostdev); bool qemuHostdevHostSupportsPassthroughVFIO(void); -int qemuHostdevUpdateActiveNVMeDisks(virQEMUDriverPtr driver, - virDomainDefPtr def); -int qemuHostdevUpdateActiveMediatedDevices(virQEMUDriverPtr driver, - virDomainDefPtr def); -int qemuHostdevUpdateActivePCIDevices(virQEMUDriverPtr driver, - virDomainDefPtr def); -int qemuHostdevUpdateActiveUSBDevices(virQEMUDriverPtr driver, - virDomainDefPtr def); -int qemuHostdevUpdateActiveSCSIDevices(virQEMUDriverPtr driver, - virDomainDefPtr def); -int qemuHostdevUpdateActiveDomainDevices(virQEMUDriverPtr driver, - virDomainDefPtr def); +int qemuHostdevUpdateActiveNVMeDisks(virQEMUDriver *driver, + virDomainDef *def); +int qemuHostdevUpdateActiveMediatedDevices(virQEMUDriver *driver, + virDomainDef *def); +int qemuHostdevUpdateActivePCIDevices(virQEMUDriver *driver, + virDomainDef *def); +int qemuHostdevUpdateActiveUSBDevices(virQEMUDriver *driver, + virDomainDef *def); +int qemuHostdevUpdateActiveSCSIDevices(virQEMUDriver *driver, + virDomainDef *def); +int qemuHostdevUpdateActiveDomainDevices(virQEMUDriver *driver, + virDomainDef *def); -int qemuHostdevPrepareOneNVMeDisk(virQEMUDriverPtr driver, +int qemuHostdevPrepareOneNVMeDisk(virQEMUDriver *driver, const char *name, - virStorageSourcePtr src); -int qemuHostdevPrepareNVMeDisks(virQEMUDriverPtr driver, + virStorageSource *src); +int qemuHostdevPrepareNVMeDisks(virQEMUDriver *driver, const char *name, - virDomainDiskDefPtr *disks, + virDomainDiskDef **disks, size_t ndisks); -int qemuHostdevPreparePCIDevices(virQEMUDriverPtr driver, +int qemuHostdevPreparePCIDevices(virQEMUDriver *driver, const char *name, const unsigned char *uuid, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, unsigned int flags); -int qemuHostdevPrepareUSBDevices(virQEMUDriverPtr driver, +int qemuHostdevPrepareUSBDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs, unsigned int flags); -int qemuHostdevPrepareSCSIDevices(virQEMUDriverPtr driver, +int qemuHostdevPrepareSCSIDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs); -int qemuHostdevPrepareSCSIVHostDevices(virQEMUDriverPtr driver, +int qemuHostdevPrepareSCSIVHostDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs); -int qemuHostdevPrepareMediatedDevices(virQEMUDriverPtr driver, +int qemuHostdevPrepareMediatedDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs); -int qemuHostdevPrepareDomainDevices(virQEMUDriverPtr driver, - virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, +int qemuHostdevPrepareDomainDevices(virQEMUDriver *driver, + virDomainDef *def, + virQEMUCaps *qemuCaps, unsigned int flags); -void qemuHostdevReAttachOneNVMeDisk(virQEMUDriverPtr driver, +void qemuHostdevReAttachOneNVMeDisk(virQEMUDriver *driver, const char *name, - virStorageSourcePtr src); -void qemuHostdevReAttachNVMeDisks(virQEMUDriverPtr driver, + virStorageSource *src); +void qemuHostdevReAttachNVMeDisks(virQEMUDriver *driver, const char *name, - virDomainDiskDefPtr *disks, + virDomainDiskDef **disks, size_t ndisks); -void qemuHostdevReAttachPCIDevices(virQEMUDriverPtr driver, +void qemuHostdevReAttachPCIDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs); -void qemuHostdevReAttachUSBDevices(virQEMUDriverPtr driver, +void qemuHostdevReAttachUSBDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs); -void qemuHostdevReAttachSCSIDevices(virQEMUDriverPtr driver, +void qemuHostdevReAttachSCSIDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs); -void qemuHostdevReAttachSCSIVHostDevices(virQEMUDriverPtr driver, +void qemuHostdevReAttachSCSIVHostDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs); -void qemuHostdevReAttachMediatedDevices(virQEMUDriverPtr driver, +void qemuHostdevReAttachMediatedDevices(virQEMUDriver *driver, const char *name, - virDomainHostdevDefPtr *hostdevs, + virDomainHostdevDef **hostdevs, int nhostdevs); -void qemuHostdevReAttachDomainDevices(virQEMUDriverPtr driver, - virDomainDefPtr def); +void qemuHostdevReAttachDomainDevices(virQEMUDriver *driver, + virDomainDef *def); diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 58d2abb862..4ac67971ff 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -73,7 +73,7 @@ VIR_LOG_INIT("qemu.qemu_hotplug"); static void -qemuDomainResetDeviceRemoval(virDomainObjPtr vm); +qemuDomainResetDeviceRemoval(virDomainObj *vm); /** * qemuDomainDeleteDevice: @@ -96,11 +96,11 @@ qemuDomainResetDeviceRemoval(virDomainObjPtr vm); * -1 otherwise. */ static int -qemuDomainDeleteDevice(virDomainObjPtr vm, +qemuDomainDeleteDevice(virDomainObj *vm, const char *alias) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; int rc; qemuDomainObjEnterMonitor(driver, vm); @@ -138,8 +138,8 @@ qemuDomainDeleteDevice(virDomainObjPtr vm, static int -qemuDomainAttachZPCIDevice(qemuMonitorPtr mon, - virDomainDeviceInfoPtr info) +qemuDomainAttachZPCIDevice(qemuMonitor *mon, + virDomainDeviceInfo *info) { g_autofree char *devstr_zpci = NULL; @@ -154,8 +154,8 @@ qemuDomainAttachZPCIDevice(qemuMonitorPtr mon, static int -qemuDomainDetachZPCIDevice(qemuMonitorPtr mon, - virDomainDeviceInfoPtr info) +qemuDomainDetachZPCIDevice(qemuMonitor *mon, + virDomainDeviceInfo *info) { g_autofree char *zpciAlias = NULL; @@ -169,8 +169,8 @@ qemuDomainDetachZPCIDevice(qemuMonitorPtr mon, static int -qemuDomainAttachExtensionDevice(qemuMonitorPtr mon, - virDomainDeviceInfoPtr info) +qemuDomainAttachExtensionDevice(qemuMonitor *mon, + virDomainDeviceInfo *info) { if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI || info->addr.pci.extFlags == VIR_PCI_ADDRESS_EXTENSION_NONE) { @@ -185,8 +185,8 @@ qemuDomainAttachExtensionDevice(qemuMonitorPtr mon, static int -qemuDomainDetachExtensionDevice(qemuMonitorPtr mon, - virDomainDeviceInfoPtr info) +qemuDomainDetachExtensionDevice(qemuMonitor *mon, + virDomainDeviceInfo *info) { if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI || info->addr.pci.extFlags == VIR_PCI_ADDRESS_EXTENSION_NONE) { @@ -201,8 +201,8 @@ qemuDomainDetachExtensionDevice(qemuMonitorPtr mon, static int -qemuHotplugWaitForTrayEject(virDomainObjPtr vm, - virDomainDiskDefPtr disk) +qemuHotplugWaitForTrayEject(virDomainObj *vm, + virDomainDiskDef *disk) { unsigned long long now; int rc; @@ -246,16 +246,16 @@ qemuHotplugWaitForTrayEject(virDomainObjPtr vm, * Returns 0 on success, -1 on error and reports libvirt error */ static int -qemuDomainChangeMediaLegacy(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr newsrc, +qemuDomainChangeMediaLegacy(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *newsrc, bool force) { int rc; g_autofree char *driveAlias = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); const char *format = NULL; g_autofree char *sourcestr = NULL; @@ -325,11 +325,11 @@ qemuDomainChangeMediaLegacy(virQEMUDriverPtr driver, * Returns: 0 on success, -1 on error. */ int -qemuHotplugAttachDBusVMState(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuHotplugAttachDBusVMState(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virJSONValue) props = NULL; int ret; @@ -371,11 +371,11 @@ qemuHotplugAttachDBusVMState(virQEMUDriverPtr driver, * Returns: 0 on success, -1 on error. */ int -qemuHotplugRemoveDBusVMState(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuHotplugRemoveDBusVMState(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret; if (!priv->dbusVMState) @@ -409,13 +409,13 @@ qemuHotplugRemoveDBusVMState(virQEMUDriverPtr driver, * Returns: 0 on success, -1 on error. */ static int -qemuHotplugAttachManagedPR(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src, +qemuHotplugAttachManagedPR(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virJSONValuePtr props = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + virJSONValue *props = NULL; bool daemonStarted = false; int ret = -1; int rc; @@ -460,11 +460,11 @@ qemuHotplugAttachManagedPR(virQEMUDriverPtr driver, * it any more. */ static int -qemuHotplugRemoveManagedPR(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuHotplugRemoveManagedPR(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virErrorPtr orig_err; int ret = -1; @@ -506,15 +506,15 @@ qemuHotplugRemoveManagedPR(virQEMUDriverPtr driver, * Returns 0 on success, -1 on error and reports libvirt error */ static int -qemuDomainChangeMediaBlockdev(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr oldsrc, - virStorageSourcePtr newsrc, +qemuDomainChangeMediaBlockdev(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *oldsrc, + virStorageSource *newsrc, bool force) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); g_autoptr(qemuBlockStorageSourceChainData) newbackend = NULL; g_autoptr(qemuBlockStorageSourceChainData) oldbackend = NULL; g_autofree char *nodename = NULL; @@ -598,16 +598,16 @@ qemuDomainChangeMediaBlockdev(virQEMUDriverPtr driver, * Returns 0 on success, -1 on error and reports libvirt error */ int -qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr newsrc, +qemuDomainChangeEjectableMedia(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *newsrc, bool force) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; - virStorageSourcePtr oldsrc = disk->src; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainObjPrivate *priv = vm->privateData; + virStorageSource *oldsrc = disk->src; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); bool sharedAdded = false; bool managedpr = virStorageSourceChainHasManagedPR(oldsrc) || virStorageSourceChainHasManagedPR(newsrc); @@ -691,13 +691,13 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, * Attaches disk to a VM. This function aggregates common code for all bus types. * In cases when the VM crashed while adding the disk, -2 is returned. */ static int -qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk) +qemuDomainAttachDiskGeneric(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk) { g_autoptr(qemuBlockStorageSourceChainData) data = NULL; int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *devstr = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autoptr(virJSONValue) corProps = NULL; @@ -770,7 +770,7 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver, */ if (blockdev && qemuDiskConfigBlkdeviotuneEnabled(disk)) { - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); if (qemuMonitorSetBlockIoThrottle(priv->mon, NULL, diskPriv->qomName, &disk->blkdeviotune, true, true, true) < 0) @@ -811,9 +811,9 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver, static int -qemuDomainAttachVirtioDiskDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk) +qemuDomainAttachVirtioDiskDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk) { virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_DISK, { .disk = disk } }; bool releaseaddr = false; @@ -833,14 +833,14 @@ qemuDomainAttachVirtioDiskDevice(virQEMUDriverPtr driver, } -int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainControllerDefPtr controller) +int qemuDomainAttachControllerDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainControllerDef *controller) { int ret = -1; const char* type = virDomainControllerTypeToString(controller->type); g_autofree char *devstr = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_CONTROLLER, { .controller = controller } }; bool releaseaddr = false; @@ -908,14 +908,14 @@ int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver, return ret; } -static virDomainControllerDefPtr -qemuDomainFindOrCreateSCSIDiskController(virQEMUDriverPtr driver, - virDomainObjPtr vm, +static virDomainControllerDef * +qemuDomainFindOrCreateSCSIDiskController(virQEMUDriver *driver, + virDomainObj *vm, int controller) { size_t i; - virDomainControllerDefPtr cont; - qemuDomainObjPrivatePtr priv = vm->privateData; + virDomainControllerDef *cont; + qemuDomainObjPrivate *priv = vm->privateData; int model = -1; for (i = 0; i < vm->def->ncontrollers; i++) { @@ -968,9 +968,9 @@ qemuDomainFindOrCreateSCSIDiskController(virQEMUDriverPtr driver, static int -qemuDomainAttachSCSIDisk(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk) +qemuDomainAttachSCSIDisk(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk) { size_t i; @@ -1008,11 +1008,11 @@ qemuDomainAttachSCSIDisk(virQEMUDriverPtr driver, static int -qemuDomainAttachUSBMassStorageDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk) +qemuDomainAttachUSBMassStorageDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (virDomainUSBAddressEnsure(priv->usbaddrs, &disk->info) < 0) return -1; @@ -1027,12 +1027,12 @@ qemuDomainAttachUSBMassStorageDevice(virQEMUDriverPtr driver, static int -qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { size_t i; - virDomainDiskDefPtr disk = dev->data.disk; + virDomainDiskDef *disk = dev->data.disk; int ret = -1; if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM || @@ -1116,12 +1116,12 @@ qemuDomainAttachDeviceDiskLiveInternal(virQEMUDriverPtr driver, * to the VM. */ int -qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +qemuDomainAttachDeviceDiskLive(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { - virDomainDiskDefPtr disk = dev->data.disk; - virDomainDiskDefPtr orig_disk = NULL; + virDomainDiskDef *disk = dev->data.disk; + virDomainDiskDef *orig_disk = NULL; /* this API overloads media change semantics on disk hotplug * for devices supporting media changes */ @@ -1142,7 +1142,7 @@ qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver, static void -qemuDomainNetDeviceVportRemove(virDomainNetDefPtr net) +qemuDomainNetDeviceVportRemove(virDomainNetDef *net) { const virNetDevVPortProfile *vport = virDomainNetGetActualVirtPortProfile(net); const char *brname; @@ -1160,11 +1160,11 @@ qemuDomainNetDeviceVportRemove(virDomainNetDefPtr net) int -qemuDomainAttachNetDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainNetDefPtr net) +qemuDomainAttachNetDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainNetDef *net) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_NET, { .net = net } }; virErrorPtr originalError = NULL; g_autofree char *slirpfdName = NULL; @@ -1186,7 +1186,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, virDomainNetType actualType; const virNetDevBandwidth *actualBandwidth; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - virDomainCCWAddressSetPtr ccwaddrs = NULL; + virDomainCCWAddressSet *ccwaddrs = NULL; size_t i; g_autofree char *charDevAlias = NULL; bool charDevPlugged = false; @@ -1325,7 +1325,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, case VIR_DOMAIN_NET_TYPE_USER: if (!priv->disableSlirp && virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) { - qemuSlirpPtr slirp = NULL; + qemuSlirp *slirp = NULL; int rv = qemuInterfacePrepareSlirp(driver, net, &slirp); if (rv == -1) @@ -1582,14 +1582,14 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, static int -qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainAttachHostPCIDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_HOSTDEV, { .hostdev = hostdev } }; - virDomainDeviceInfoPtr info = hostdev->info; + virDomainDeviceInfo *info = hostdev->info; int ret; g_autofree char *devstr = NULL; bool releaseaddr = false; @@ -1714,13 +1714,13 @@ qemuDomainAttachHostPCIDevice(virQEMUDriverPtr driver, void -qemuDomainDelTLSObjects(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainDelTLSObjects(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, const char *secAlias, const char *tlsAlias) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virErrorPtr orig_err; if (!tlsAlias && !secAlias) @@ -1745,13 +1745,13 @@ qemuDomainDelTLSObjects(virQEMUDriverPtr driver, int -qemuDomainAddTLSObjects(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainAddTLSObjects(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - virJSONValuePtr *secProps, - virJSONValuePtr *tlsProps) + virJSONValue **secProps, + virJSONValue **tlsProps) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virErrorPtr orig_err; g_autofree char *secAlias = NULL; @@ -1782,14 +1782,14 @@ qemuDomainAddTLSObjects(virQEMUDriverPtr driver, int -qemuDomainGetTLSObjects(virQEMUCapsPtr qemuCaps, - qemuDomainSecretInfoPtr secinfo, +qemuDomainGetTLSObjects(virQEMUCaps *qemuCaps, + qemuDomainSecretInfo *secinfo, const char *tlsCertdir, bool tlsListen, bool tlsVerify, const char *alias, - virJSONValuePtr *tlsProps, - virJSONValuePtr *secProps) + virJSONValue **tlsProps, + virJSONValue **secProps) { const char *secAlias = NULL; @@ -1809,9 +1809,9 @@ qemuDomainGetTLSObjects(virQEMUCapsPtr qemuCaps, static int -qemuDomainAddChardevTLSObjects(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainChrSourceDefPtr dev, +qemuDomainAddChardevTLSObjects(virQEMUDriver *driver, + virDomainObj *vm, + virDomainChrSourceDef *dev, char *devAlias, char *charAlias, char **tlsAlias, @@ -1819,11 +1819,11 @@ qemuDomainAddChardevTLSObjects(virQEMUDriverPtr driver, { int ret = -1; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainChrSourcePrivatePtr chrSourcePriv; - qemuDomainSecretInfoPtr secinfo = NULL; - virJSONValuePtr tlsProps = NULL; - virJSONValuePtr secProps = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainChrSourcePrivate *chrSourcePriv; + qemuDomainSecretInfo *secinfo = NULL; + virJSONValue *tlsProps = NULL; + virJSONValue *secProps = NULL; /* NB: This may alter haveTLS based on cfg */ qemuDomainPrepareChardevSourceTLS(dev, cfg); @@ -1869,13 +1869,13 @@ qemuDomainAddChardevTLSObjects(virQEMUDriverPtr driver, static int -qemuDomainDelChardevTLSObjects(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainChrSourceDefPtr dev, +qemuDomainDelChardevTLSObjects(virQEMUDriver *driver, + virDomainObj *vm, + virDomainChrSourceDef *dev, const char *inAlias) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *tlsAlias = NULL; g_autofree char *secAlias = NULL; @@ -1908,13 +1908,13 @@ qemuDomainDelChardevTLSObjects(virQEMUDriverPtr driver, } -int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainRedirdevDefPtr redirdev) +int qemuDomainAttachRedirdevDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainRedirdevDef *redirdev) { int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainDefPtr def = vm->def; + qemuDomainObjPrivate *priv = vm->privateData; + virDomainDef *def = vm->def; g_autofree char *charAlias = NULL; g_autofree char *devstr = NULL; bool chardevAdded = false; @@ -1977,8 +1977,8 @@ int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver, } static int -qemuDomainChrPreInsert(virDomainDefPtr vmdef, - virDomainChrDefPtr chr) +qemuDomainChrPreInsert(virDomainDef *vmdef, + virDomainChrDef *chr) { if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && chr->targetType == VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SERIAL) { @@ -2003,7 +2003,7 @@ qemuDomainChrPreInsert(virDomainDefPtr vmdef, if (vmdef->nserials == 0 && vmdef->nconsoles == 0 && chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { if (!vmdef->consoles) - vmdef->consoles = g_new0(virDomainChrDefPtr, 1); + vmdef->consoles = g_new0(virDomainChrDef *, 1); /* We'll be dealing with serials[0] directly, so NULL is fine here. */ if (!(vmdef->consoles[0] = virDomainChrDefNew(NULL))) { @@ -2016,8 +2016,8 @@ qemuDomainChrPreInsert(virDomainDefPtr vmdef, } static void -qemuDomainChrInsertPreAlloced(virDomainDefPtr vmdef, - virDomainChrDefPtr chr) +qemuDomainChrInsertPreAlloced(virDomainDef *vmdef, + virDomainChrDef *chr) { virDomainChrInsertPreAlloced(vmdef, chr); if (vmdef->nserials == 1 && vmdef->nconsoles == 0 && @@ -2031,8 +2031,8 @@ qemuDomainChrInsertPreAlloced(virDomainDefPtr vmdef, } static void -qemuDomainChrInsertPreAllocCleanup(virDomainDefPtr vmdef, - virDomainChrDefPtr chr) +qemuDomainChrInsertPreAllocCleanup(virDomainDef *vmdef, + virDomainChrDef *chr) { /* Remove the stub console added by qemuDomainChrPreInsert */ if (vmdef->nserials == 0 && vmdef->nconsoles == 1 && @@ -2044,8 +2044,8 @@ qemuDomainChrInsertPreAllocCleanup(virDomainDefPtr vmdef, } int -qemuDomainChrInsert(virDomainDefPtr vmdef, - virDomainChrDefPtr chr) +qemuDomainChrInsert(virDomainDef *vmdef, + virDomainChrDef *chr) { if (qemuDomainChrPreInsert(vmdef, chr) < 0) { qemuDomainChrInsertPreAllocCleanup(vmdef, chr); @@ -2055,11 +2055,11 @@ qemuDomainChrInsert(virDomainDefPtr vmdef, return 0; } -virDomainChrDefPtr -qemuDomainChrRemove(virDomainDefPtr vmdef, - virDomainChrDefPtr chr) +virDomainChrDef * +qemuDomainChrRemove(virDomainDef *vmdef, + virDomainChrDef *chr) { - virDomainChrDefPtr ret; + virDomainChrDef *ret; bool removeCompat; if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && @@ -2094,12 +2094,12 @@ qemuDomainChrRemove(virDomainDefPtr vmdef, * 0 otherwise */ static int -qemuDomainAttachChrDeviceAssignAddr(virDomainObjPtr vm, - virDomainChrDefPtr chr, - virQEMUDriverPtr driver) +qemuDomainAttachChrDeviceAssignAddr(virDomainObj *vm, + virDomainChrDef *chr, + virQEMUDriver *driver) { - virDomainDefPtr def = vm->def; - qemuDomainObjPrivatePtr priv = vm->privateData; + virDomainDef *def = vm->def; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_CHR, { .chr = chr } }; if (chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && @@ -2137,17 +2137,17 @@ qemuDomainAttachChrDeviceAssignAddr(virDomainObjPtr vm, return 0; } -int qemuDomainAttachChrDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainChrDefPtr chr) +int qemuDomainAttachChrDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainChrDef *chr) { int ret = -1, rc; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virErrorPtr orig_err; - virDomainDefPtr vmdef = vm->def; + virDomainDef *vmdef = vm->def; g_autofree char *devstr = NULL; g_autoptr(virJSONValue) netdevprops = NULL; - virDomainChrSourceDefPtr dev = chr->source; + virDomainChrSourceDef *dev = chr->source; g_autofree char *charAlias = NULL; bool chardevAttached = false; bool teardowncgroup = false; @@ -2258,11 +2258,11 @@ int qemuDomainAttachChrDevice(virQEMUDriverPtr driver, int -qemuDomainAttachRNGDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainRNGDefPtr rng) +qemuDomainAttachRNGDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainRNGDef *rng) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_RNG, { .rng = rng } }; virErrorPtr orig_err; g_autofree char *devstr = NULL; @@ -2274,7 +2274,7 @@ qemuDomainAttachRNGDevice(virQEMUDriverPtr driver, bool teardowncgroup = false; bool teardowndevice = false; bool chardevAdded = false; - virJSONValuePtr props = NULL; + virJSONValue *props = NULL; int ret = -1; if (qemuAssignDeviceRNGAlias(vm->def, rng) < 0) @@ -2382,11 +2382,11 @@ qemuDomainAttachRNGDevice(virQEMUDriverPtr driver, * Returns 0 on success -1 on error. */ int -qemuDomainAttachMemory(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem) +qemuDomainAttachMemory(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virErrorPtr orig_err; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); unsigned long long oldmem = virDomainDefGetMemoryTotal(vm->def); @@ -2398,8 +2398,8 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver, bool teardownlabel = false; bool teardowncgroup = false; bool teardowndevice = false; - virJSONValuePtr props = NULL; - virObjectEventPtr event; + virJSONValue *props = NULL; + virObjectEvent *event; int id; int ret = -1; @@ -2526,11 +2526,11 @@ qemuDomainAttachMemory(virQEMUDriverPtr driver, static int -qemuDomainAttachHostUSBDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainAttachHostUSBDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *devstr = NULL; bool added = false; bool teardowncgroup = false; @@ -2597,13 +2597,13 @@ qemuDomainAttachHostUSBDevice(virQEMUDriverPtr driver, static int -qemuDomainAttachHostSCSIDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainAttachHostSCSIDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { size_t i; int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virErrorPtr orig_err; g_autoptr(qemuBlockStorageSourceAttachData) data = NULL; const char *backendalias = NULL; @@ -2701,15 +2701,15 @@ qemuDomainAttachHostSCSIDevice(virQEMUDriverPtr driver, } static int -qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainAttachSCSIVHostDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_HOSTDEV, { .hostdev = hostdev } }; - virDomainCCWAddressSetPtr ccwaddrs = NULL; + virDomainCCWAddressSet *ccwaddrs = NULL; g_autofree char *vhostfdName = NULL; int vhostfd = -1; g_autofree char *devstr = NULL; @@ -2811,9 +2811,9 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver, static int -qemuDomainAttachMediatedDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainAttachMediatedDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { int ret = -1; g_autofree char *devstr = NULL; @@ -2822,7 +2822,7 @@ qemuDomainAttachMediatedDevice(virQEMUDriverPtr driver, bool teardownlabel = false; bool teardowndevice = false; bool teardownmemlock = false; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_HOSTDEV, { .hostdev = hostdev } }; @@ -2911,9 +2911,9 @@ qemuDomainAttachMediatedDevice(virQEMUDriverPtr driver, int -qemuDomainAttachHostDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainAttachHostDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -2962,9 +2962,9 @@ qemuDomainAttachHostDevice(virQEMUDriverPtr driver, int -qemuDomainAttachShmemDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainShmemDefPtr shmem) +qemuDomainAttachShmemDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainShmemDef *shmem) { int ret = -1; g_autofree char *shmstr = NULL; @@ -2973,8 +2973,8 @@ qemuDomainAttachShmemDevice(virQEMUDriverPtr driver, bool release_backing = false; bool release_address = true; virErrorPtr orig_err = NULL; - virJSONValuePtr props = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + virJSONValue *props = NULL; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_SHMEM, { .shmem = shmem } }; switch ((virDomainShmemModel)shmem->model) { @@ -3077,12 +3077,12 @@ qemuDomainAttachShmemDevice(virQEMUDriverPtr driver, int -qemuDomainAttachWatchdog(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainWatchdogDefPtr watchdog) +qemuDomainAttachWatchdog(virQEMUDriver *driver, + virDomainObj *vm, + virDomainWatchdogDef *watchdog) { int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_WATCHDOG, { .watchdog = watchdog } }; virDomainWatchdogAction actualAction = watchdog->action; const char *actionStr = NULL; @@ -3148,13 +3148,13 @@ qemuDomainAttachWatchdog(virQEMUDriverPtr driver, int -qemuDomainAttachInputDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainInputDefPtr input) +qemuDomainAttachInputDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainInputDef *input) { int ret = -1; g_autofree char *devstr = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_INPUT, { .input = input } }; virErrorPtr originalError = NULL; @@ -3248,12 +3248,12 @@ qemuDomainAttachInputDevice(virQEMUDriverPtr driver, int -qemuDomainAttachVsockDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainVsockDefPtr vsock) +qemuDomainAttachVsockDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainVsockDef *vsock) { - qemuDomainVsockPrivatePtr vsockPriv = (qemuDomainVsockPrivatePtr)vsock->privateData; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainVsockPrivate *vsockPriv = (qemuDomainVsockPrivate *)vsock->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev = { VIR_DOMAIN_DEVICE_VSOCK, { .vsock = vsock } }; virErrorPtr originalError = NULL; @@ -3320,9 +3320,9 @@ qemuDomainAttachVsockDevice(virQEMUDriverPtr driver, int -qemuDomainAttachLease(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainLeaseDefPtr lease) +qemuDomainAttachLease(virQEMUDriver *driver, + virDomainObj *vm, + virDomainLeaseDef *lease) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); @@ -3340,9 +3340,9 @@ qemuDomainAttachLease(virQEMUDriverPtr driver, static int -qemuDomainChangeNetBridge(virDomainObjPtr vm, - virDomainNetDefPtr olddev, - virDomainNetDefPtr newdev) +qemuDomainChangeNetBridge(virDomainObj *vm, + virDomainNetDef *olddev, + virDomainNetDef *newdev) { int ret = -1; const char *oldbridge = virDomainNetGetActualBridgeName(olddev); @@ -3405,9 +3405,9 @@ qemuDomainChangeNetBridge(virDomainObjPtr vm, } static int -qemuDomainChangeNetFilter(virDomainObjPtr vm, - virDomainNetDefPtr olddev, - virDomainNetDefPtr newdev) +qemuDomainChangeNetFilter(virDomainObj *vm, + virDomainNetDef *olddev, + virDomainNetDef *newdev) { /* make sure this type of device supports filters. */ switch (virDomainNetGetActualType(newdev)) { @@ -3456,13 +3456,13 @@ qemuDomainChangeNetFilter(virDomainObjPtr vm, return 0; } -int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainNetDefPtr dev, +int qemuDomainChangeNetLinkState(virQEMUDriver *driver, + virDomainObj *vm, + virDomainNetDef *dev, int linkstate) { int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!dev->info.alias) { virReportError(VIR_ERR_OPERATION_FAILED, "%s", @@ -3489,14 +3489,14 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver, } int -qemuDomainChangeNet(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +qemuDomainChangeNet(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainNetDefPtr newdev = dev->data.net; - virDomainNetDefPtr *devslot = NULL; - virDomainNetDefPtr olddev; + qemuDomainObjPrivate *priv = vm->privateData; + virDomainNetDef *newdev = dev->data.net; + virDomainNetDef **devslot = NULL; + virDomainNetDef *olddev; virDomainNetType oldType, newType; bool needReconnect = false; bool needBridgeChange = false; @@ -3997,9 +3997,9 @@ qemuDomainChangeNet(virQEMUDriverPtr driver, return ret; } -static virDomainGraphicsDefPtr -qemuDomainFindGraphics(virDomainObjPtr vm, - virDomainGraphicsDefPtr dev) +static virDomainGraphicsDef * +qemuDomainFindGraphics(virDomainObj *vm, + virDomainGraphicsDef *dev) { size_t i; @@ -4012,8 +4012,8 @@ qemuDomainFindGraphics(virDomainObjPtr vm, } int -qemuDomainFindGraphicsIndex(virDomainDefPtr def, - virDomainGraphicsDefPtr dev) +qemuDomainFindGraphicsIndex(virDomainDef *def, + virDomainGraphicsDef *dev) { size_t i; @@ -4027,14 +4027,14 @@ qemuDomainFindGraphicsIndex(virDomainDefPtr def, int -qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainChangeGraphicsPasswords(virQEMUDriver *driver, + virDomainObj *vm, int type, - virDomainGraphicsAuthDefPtr auth, + virDomainGraphicsAuthDef *auth, const char *defaultPasswd, int asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; time_t now = time(NULL); const char *expire; g_autofree char *validTo = NULL; @@ -4078,11 +4078,11 @@ qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver, int -qemuDomainChangeGraphics(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainGraphicsDefPtr dev) +qemuDomainChangeGraphics(virQEMUDriver *driver, + virDomainObj *vm, + virDomainGraphicsDef *dev) { - virDomainGraphicsDefPtr olddev = qemuDomainFindGraphics(vm, dev); + virDomainGraphicsDef *olddev = qemuDomainFindGraphics(vm, dev); g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); const char *type = virDomainGraphicsTypeToString(dev->type); size_t i; @@ -4102,8 +4102,8 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, } for (i = 0; i < dev->nListens; i++) { - virDomainGraphicsListenDefPtr newlisten = &dev->listens[i]; - virDomainGraphicsListenDefPtr oldlisten = &olddev->listens[i]; + virDomainGraphicsListenDef *newlisten = &dev->listens[i]; + virDomainGraphicsListenDef *oldlisten = &olddev->listens[i]; if (newlisten->type != oldlisten->type) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, @@ -4258,12 +4258,12 @@ qemuDomainChangeGraphics(virQEMUDriverPtr driver, } -static int qemuComparePCIDevice(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr device G_GNUC_UNUSED, - virDomainDeviceInfoPtr info1, +static int qemuComparePCIDevice(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *device G_GNUC_UNUSED, + virDomainDeviceInfo *info1, void *opaque) { - virDomainDeviceInfoPtr info2 = opaque; + virDomainDeviceInfo *info2 = opaque; if (info1->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI || info2->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) @@ -4277,8 +4277,8 @@ static int qemuComparePCIDevice(virDomainDefPtr def G_GNUC_UNUSED, return 0; } -static bool qemuIsMultiFunctionDevice(virDomainDefPtr def, - virDomainDeviceInfoPtr info) +static bool qemuIsMultiFunctionDevice(virDomainDef *def, + virDomainDeviceInfo *info) { if (info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) return false; @@ -4290,15 +4290,15 @@ static bool qemuIsMultiFunctionDevice(virDomainDefPtr def, static int -qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk) +qemuDomainRemoveDiskDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk) { - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); g_autoptr(qemuBlockStorageSourceChainData) diskBackend = NULL; virDomainDeviceDef dev; size_t i; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *corAlias = NULL; bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); int ret = -1; @@ -4387,8 +4387,8 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver, static int -qemuDomainRemoveControllerDevice(virDomainObjPtr vm, - virDomainControllerDefPtr controller) +qemuDomainRemoveControllerDevice(virDomainObj *vm, + virDomainControllerDef *controller) { size_t i; @@ -4409,11 +4409,11 @@ qemuDomainRemoveControllerDevice(virDomainObjPtr vm, static int -qemuDomainRemoveMemoryDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem) +qemuDomainRemoveMemoryDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; unsigned long long oldmem = virDomainDefGetMemoryTotal(vm->def); unsigned long long newmem = oldmem - mem->size; g_autofree char *backendAlias = NULL; @@ -4464,44 +4464,44 @@ qemuDomainRemoveMemoryDevice(virQEMUDriverPtr driver, static void -qemuDomainRemovePCIHostDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainRemovePCIHostDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { qemuHostdevReAttachPCIDevices(driver, vm->def->name, &hostdev, 1); qemuDomainReleaseDeviceAddress(vm, hostdev->info); } static void -qemuDomainRemoveUSBHostDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainRemoveUSBHostDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { qemuHostdevReAttachUSBDevices(driver, vm->def->name, &hostdev, 1); qemuDomainReleaseDeviceAddress(vm, hostdev->info); } static void -qemuDomainRemoveSCSIHostDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainRemoveSCSIHostDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { qemuHostdevReAttachSCSIDevices(driver, vm->def->name, &hostdev, 1); } static void -qemuDomainRemoveSCSIVHostDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainRemoveSCSIVHostDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { qemuHostdevReAttachSCSIVHostDevices(driver, vm->def->name, &hostdev, 1); } static void -qemuDomainRemoveMediatedDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainRemoveMediatedDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { qemuHostdevReAttachMediatedDevices(driver, vm->def->name, &hostdev, 1); qemuDomainReleaseDeviceAddress(vm, hostdev->info); @@ -4509,13 +4509,13 @@ qemuDomainRemoveMediatedDevice(virQEMUDriverPtr driver, static int -qemuDomainRemoveHostDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainRemoveHostDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { - virDomainNetDefPtr net = NULL; + virDomainNetDef *net = NULL; size_t i; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; VIR_DEBUG("Removing host device %s from domain %p %s", hostdev->info->alias, vm, vm->def->name); @@ -4602,12 +4602,12 @@ qemuDomainRemoveHostDevice(virQEMUDriverPtr driver, static int -qemuDomainRemoveNetDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainNetDefPtr net) +qemuDomainRemoveNetDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainNetDef *net) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *hostnet_name = NULL; g_autofree char *charDevAlias = NULL; size_t i; @@ -4664,10 +4664,10 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver, if (qemuMonitorQueryFdsets(priv->mon, &fdsets) == 0) { for (i = 0; i < fdsets->nfdsets && vdpafdset < 0; i++) { size_t j; - qemuMonitorFdsetInfoPtr set = &fdsets->fdsets[i]; + qemuMonitorFdsetInfo *set = &fdsets->fdsets[i]; for (j = 0; j < set->nfds; j++) { - qemuMonitorFdsetFdInfoPtr fdinfo = &set->fds[j]; + qemuMonitorFdsetFdInfo *fdinfo = &set->fds[j]; if (STREQ_NULLABLE(fdinfo->opaque, net->data.vdpa.devicepath)) { vdpafdset = set->id; break; @@ -4738,14 +4738,14 @@ qemuDomainRemoveNetDevice(virQEMUDriverPtr driver, static int -qemuDomainRemoveChrDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainChrDefPtr chr, +qemuDomainRemoveChrDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainChrDef *chr, bool monitor) { - virObjectEventPtr event; + virObjectEvent *event; g_autofree char *charAlias = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int rc = 0; VIR_DEBUG("Removing character device %s from domain %p %s", @@ -4795,13 +4795,13 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver, static int -qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainRNGDefPtr rng) +qemuDomainRemoveRNGDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainRNGDef *rng) { g_autofree char *charAlias = NULL; g_autofree char *objAlias = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; ssize_t idx; int rc = 0; @@ -4853,15 +4853,15 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver, static int -qemuDomainRemoveShmemDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainShmemDefPtr shmem) +qemuDomainRemoveShmemDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainShmemDef *shmem) { int rc; ssize_t idx = -1; g_autofree char *charAlias = NULL; g_autofree char *memAlias = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; VIR_DEBUG("Removing shmem device %s from domain %p %s", shmem->info.alias, vm, vm->def->name); @@ -4897,8 +4897,8 @@ qemuDomainRemoveShmemDevice(virQEMUDriverPtr driver, static int -qemuDomainRemoveWatchdog(virDomainObjPtr vm, - virDomainWatchdogDefPtr watchdog) +qemuDomainRemoveWatchdog(virDomainObj *vm, + virDomainWatchdogDef *watchdog) { VIR_DEBUG("Removing watchdog %s from domain %p %s", watchdog->info.alias, vm, vm->def->name); @@ -4911,8 +4911,8 @@ qemuDomainRemoveWatchdog(virDomainObjPtr vm, static int -qemuDomainRemoveInputDevice(virDomainObjPtr vm, - virDomainInputDefPtr dev) +qemuDomainRemoveInputDevice(virDomainObj *vm, + virDomainInputDef *dev) { size_t i; @@ -4940,8 +4940,8 @@ qemuDomainRemoveInputDevice(virDomainObjPtr vm, static int -qemuDomainRemoveVsockDevice(virDomainObjPtr vm, - virDomainVsockDefPtr dev) +qemuDomainRemoveVsockDevice(virDomainObj *vm, + virDomainVsockDef *dev) { VIR_DEBUG("Removing vsock device %s from domain %p %s", dev->info.alias, vm, vm->def->name); @@ -4954,11 +4954,11 @@ qemuDomainRemoveVsockDevice(virDomainObjPtr vm, static int -qemuDomainRemoveRedirdevDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainRedirdevDefPtr dev) +qemuDomainRemoveRedirdevDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainRedirdevDef *dev) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *charAlias = NULL; ssize_t idx; @@ -4992,8 +4992,8 @@ qemuDomainRemoveRedirdevDevice(virQEMUDriverPtr driver, static void -qemuDomainRemoveAuditDevice(virDomainObjPtr vm, - virDomainDeviceDefPtr detach, +qemuDomainRemoveAuditDevice(virDomainObj *vm, + virDomainDeviceDef *detach, bool success) { switch ((virDomainDeviceType)detach->type) { @@ -5057,12 +5057,12 @@ qemuDomainRemoveAuditDevice(virDomainObjPtr vm, int -qemuDomainRemoveDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +qemuDomainRemoveDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev) { - virDomainDeviceInfoPtr info; - virObjectEventPtr event; + virDomainDeviceInfo *info; + virObjectEvent *event; g_autofree char *alias = NULL; /* @@ -5163,10 +5163,10 @@ qemuDomainRemoveDevice(virQEMUDriverPtr driver, static void -qemuDomainMarkDeviceAliasForRemoval(virDomainObjPtr vm, +qemuDomainMarkDeviceAliasForRemoval(virDomainObj *vm, const char *alias) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; memset(&priv->unplug, 0, sizeof(priv->unplug)); @@ -5175,8 +5175,8 @@ qemuDomainMarkDeviceAliasForRemoval(virDomainObjPtr vm, static void -qemuDomainMarkDeviceForRemoval(virDomainObjPtr vm, - virDomainDeviceInfoPtr info) +qemuDomainMarkDeviceForRemoval(virDomainObj *vm, + virDomainDeviceInfo *info) { qemuDomainMarkDeviceAliasForRemoval(vm, info->alias); @@ -5184,16 +5184,16 @@ qemuDomainMarkDeviceForRemoval(virDomainObjPtr vm, static void -qemuDomainResetDeviceRemoval(virDomainObjPtr vm) +qemuDomainResetDeviceRemoval(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; priv->unplug.alias = NULL; priv->unplug.eventSeen = false; } unsigned long long G_GNUC_NO_INLINE -qemuDomainGetUnplugTimeout(virDomainObjPtr vm) +qemuDomainGetUnplugTimeout(virDomainObj *vm) { if (qemuDomainIsPSeries(vm->def)) return QEMU_UNPLUG_TIMEOUT_PPC64; @@ -5212,9 +5212,9 @@ qemuDomainGetUnplugTimeout(virDomainObjPtr vm) * - we failed to reliably wait for the event and thus use fallback behavior */ static int -qemuDomainWaitForDeviceRemoval(virDomainObjPtr vm) +qemuDomainWaitForDeviceRemoval(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; unsigned long long until; int rc; @@ -5249,11 +5249,11 @@ qemuDomainWaitForDeviceRemoval(virDomainObjPtr vm) * finishing the removal to a new thread */ bool -qemuDomainSignalDeviceRemoval(virDomainObjPtr vm, +qemuDomainSignalDeviceRemoval(virDomainObj *vm, const char *devAlias, qemuDomainUnpluggingDeviceStatus status) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (STREQ_NULLABLE(priv->unplug.alias, devAlias)) { VIR_DEBUG("Removal of device '%s' continues in waiting thread", devAlias); @@ -5268,7 +5268,7 @@ qemuDomainSignalDeviceRemoval(virDomainObjPtr vm, static int -qemuFindDisk(virDomainDefPtr def, const char *dst) +qemuFindDisk(virDomainDef *def, const char *dst) { size_t i; @@ -5281,11 +5281,11 @@ qemuFindDisk(virDomainDefPtr def, const char *dst) } static int -qemuDomainDetachPrepDisk(virDomainObjPtr vm, - virDomainDiskDefPtr match, - virDomainDiskDefPtr *detach) +qemuDomainDetachPrepDisk(virDomainObj *vm, + virDomainDiskDef *match, + virDomainDiskDef **detach) { - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; int idx; if ((idx = qemuFindDisk(vm->def, match->dst)) < 0) { @@ -5343,12 +5343,12 @@ qemuDomainDetachPrepDisk(virDomainObjPtr vm, static bool -qemuDomainDiskControllerIsBusy(virDomainObjPtr vm, - virDomainControllerDefPtr detach) +qemuDomainDiskControllerIsBusy(virDomainObj *vm, + virDomainControllerDef *detach) { size_t i; - virDomainDiskDefPtr disk; - virDomainHostdevDefPtr hostdev; + virDomainDiskDef *disk; + virDomainHostdevDef *hostdev; for (i = 0; i < vm->def->ndisks; i++) { disk = vm->def->disks[i]; @@ -5419,8 +5419,8 @@ qemuDomainDiskControllerIsBusy(virDomainObjPtr vm, static bool -qemuDomainControllerIsBusy(virDomainObjPtr vm, - virDomainControllerDefPtr detach) +qemuDomainControllerIsBusy(virDomainObj *vm, + virDomainControllerDef *detach) { switch ((virDomainControllerType) detach->type) { case VIR_DOMAIN_CONTROLLER_TYPE_IDE: @@ -5449,12 +5449,12 @@ qemuDomainControllerIsBusy(virDomainObjPtr vm, static int -qemuDomainDetachPrepController(virDomainObjPtr vm, - virDomainControllerDefPtr match, - virDomainControllerDefPtr *detach) +qemuDomainDetachPrepController(virDomainObj *vm, + virDomainControllerDef *match, + virDomainControllerDef **detach) { int idx; - virDomainControllerDefPtr controller = NULL; + virDomainControllerDef *controller = NULL; if (match->type != VIR_DOMAIN_CONTROLLER_TYPE_SCSI) { virReportError(VIR_ERR_OPERATION_UNSUPPORTED, @@ -5485,16 +5485,16 @@ qemuDomainDetachPrepController(virDomainObjPtr vm, /* search for a hostdev matching dev and detach it */ static int -qemuDomainDetachPrepHostdev(virDomainObjPtr vm, - virDomainHostdevDefPtr match, - virDomainHostdevDefPtr *detach) +qemuDomainDetachPrepHostdev(virDomainObj *vm, + virDomainHostdevDef *match, + virDomainHostdevDef **detach) { - virDomainHostdevSubsysPtr subsys = &match->source.subsys; - virDomainHostdevSubsysUSBPtr usbsrc = &subsys->u.usb; - virDomainHostdevSubsysPCIPtr pcisrc = &subsys->u.pci; - virDomainHostdevSubsysSCSIPtr scsisrc = &subsys->u.scsi; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &subsys->u.mdev; - virDomainHostdevDefPtr hostdev = NULL; + virDomainHostdevSubsys *subsys = &match->source.subsys; + virDomainHostdevSubsysUSB *usbsrc = &subsys->u.usb; + virDomainHostdevSubsysPCI *pcisrc = &subsys->u.pci; + virDomainHostdevSubsysSCSI *scsisrc = &subsys->u.scsi; + virDomainHostdevSubsysMediatedDev *mdevsrc = &subsys->u.mdev; + virDomainHostdevDef *hostdev = NULL; int idx; if (match->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS) { @@ -5530,12 +5530,12 @@ qemuDomainDetachPrepHostdev(virDomainObjPtr vm, case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: { if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) { - virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc = &scsisrc->u.iscsi; + virDomainHostdevSubsysSCSIiSCSI *iscsisrc = &scsisrc->u.iscsi; virReportError(VIR_ERR_DEVICE_MISSING, _("host scsi iSCSI path %s not found"), iscsisrc->src->path); } else { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; virReportError(VIR_ERR_DEVICE_MISSING, _("host scsi device %s:%u:%u.%llu not found"), @@ -5564,12 +5564,12 @@ qemuDomainDetachPrepHostdev(virDomainObjPtr vm, static int -qemuDomainDetachPrepShmem(virDomainObjPtr vm, - virDomainShmemDefPtr match, - virDomainShmemDefPtr *detach) +qemuDomainDetachPrepShmem(virDomainObj *vm, + virDomainShmemDef *match, + virDomainShmemDef **detach) { ssize_t idx = -1; - virDomainShmemDefPtr shmem = NULL; + virDomainShmemDef *shmem = NULL; if ((idx = virDomainShmemDefFind(vm->def, match)) < 0) { virReportError(VIR_ERR_DEVICE_MISSING, @@ -5600,11 +5600,11 @@ qemuDomainDetachPrepShmem(virDomainObjPtr vm, static int -qemuDomainDetachPrepWatchdog(virDomainObjPtr vm, - virDomainWatchdogDefPtr match, - virDomainWatchdogDefPtr *detach) +qemuDomainDetachPrepWatchdog(virDomainObj *vm, + virDomainWatchdogDef *match, + virDomainWatchdogDef **detach) { - virDomainWatchdogDefPtr watchdog; + virDomainWatchdogDef *watchdog; *detach = watchdog = vm->def->watchdog; @@ -5639,9 +5639,9 @@ qemuDomainDetachPrepWatchdog(virDomainObjPtr vm, static int -qemuDomainDetachPrepRedirdev(virDomainObjPtr vm, - virDomainRedirdevDefPtr match, - virDomainRedirdevDefPtr *detach) +qemuDomainDetachPrepRedirdev(virDomainObj *vm, + virDomainRedirdevDef *match, + virDomainRedirdevDef **detach) { ssize_t idx; @@ -5658,9 +5658,9 @@ qemuDomainDetachPrepRedirdev(virDomainObjPtr vm, static int -qemuDomainDetachPrepNet(virDomainObjPtr vm, - virDomainNetDefPtr match, - virDomainNetDefPtr *detach) +qemuDomainDetachPrepNet(virDomainObj *vm, + virDomainNetDef *match, + virDomainNetDef **detach) { int detachidx; @@ -5674,15 +5674,15 @@ qemuDomainDetachPrepNet(virDomainObjPtr vm, static int -qemuDomainDetachDeviceChr(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainChrDefPtr chr, +qemuDomainDetachDeviceChr(virQEMUDriver *driver, + virDomainObj *vm, + virDomainChrDef *chr, bool async) { int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainDefPtr vmdef = vm->def; - virDomainChrDefPtr tmpChr; + qemuDomainObjPrivate *priv = vm->privateData; + virDomainDef *vmdef = vm->def; + virDomainChrDef *tmpChr; bool guestfwd = false; if (!(tmpChr = virDomainChrFind(vmdef, chr))) { @@ -5732,9 +5732,9 @@ qemuDomainDetachDeviceChr(virQEMUDriverPtr driver, static int -qemuDomainDetachPrepRNG(virDomainObjPtr vm, - virDomainRNGDefPtr match, - virDomainRNGDefPtr *detach) +qemuDomainDetachPrepRNG(virDomainObj *vm, + virDomainRNGDef *match, + virDomainRNGDef **detach) { ssize_t idx; @@ -5753,9 +5753,9 @@ qemuDomainDetachPrepRNG(virDomainObjPtr vm, static int -qemuDomainDetachPrepMemory(virDomainObjPtr vm, - virDomainMemoryDefPtr match, - virDomainMemoryDefPtr *detach) +qemuDomainDetachPrepMemory(virDomainObj *vm, + virDomainMemoryDef *match, + virDomainMemoryDef **detach) { int idx; @@ -5777,11 +5777,11 @@ qemuDomainDetachPrepMemory(virDomainObjPtr vm, static int -qemuDomainDetachPrepInput(virDomainObjPtr vm, - virDomainInputDefPtr match, - virDomainInputDefPtr *detach) +qemuDomainDetachPrepInput(virDomainObj *vm, + virDomainInputDef *match, + virDomainInputDef **detach) { - virDomainInputDefPtr input; + virDomainInputDef *input; int idx; if ((idx = virDomainInputDefFind(vm->def, match)) < 0) { @@ -5811,11 +5811,11 @@ qemuDomainDetachPrepInput(virDomainObjPtr vm, static int -qemuDomainDetachPrepVsock(virDomainObjPtr vm, - virDomainVsockDefPtr match, - virDomainVsockDefPtr *detach) +qemuDomainDetachPrepVsock(virDomainObj *vm, + virDomainVsockDef *match, + virDomainVsockDef **detach) { - virDomainVsockDefPtr vsock; + virDomainVsockDef *vsock; *detach = vsock = vm->def->vsock; if (!vsock || @@ -5830,11 +5830,11 @@ qemuDomainDetachPrepVsock(virDomainObjPtr vm, static int -qemuDomainDetachDeviceLease(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainLeaseDefPtr lease) +qemuDomainDetachDeviceLease(virQEMUDriver *driver, + virDomainObj *vm, + virDomainLeaseDef *lease) { - virDomainLeaseDefPtr det_lease; + virDomainLeaseDef *det_lease; int idx; if ((idx = virDomainLeaseIndex(vm->def, lease)) < 0) { @@ -5854,13 +5854,13 @@ qemuDomainDetachDeviceLease(virQEMUDriverPtr driver, int -qemuDomainDetachDeviceLive(virDomainObjPtr vm, - virDomainDeviceDefPtr match, - virQEMUDriverPtr driver, +qemuDomainDetachDeviceLive(virDomainObj *vm, + virDomainDeviceDef *match, + virQEMUDriver *driver, bool async) { virDomainDeviceDef detach = { .type = match->type }; - virDomainDeviceInfoPtr info = NULL; + virDomainDeviceInfo *info = NULL; int ret = -1; switch ((virDomainDeviceType)match->type) { @@ -6005,7 +6005,7 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm, if (info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) { - virDomainControllerDefPtr controller; + virDomainControllerDef *controller; int controllerIdx = virDomainControllerFind(vm->def, VIR_DOMAIN_CONTROLLER_TYPE_PCI, info->addr.pci.bus); @@ -6063,13 +6063,13 @@ qemuDomainDetachDeviceLive(virDomainObjPtr vm, static int -qemuDomainRemoveVcpu(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainRemoveVcpu(virQEMUDriver *driver, + virDomainObj *vm, unsigned int vcpu) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainVcpuDefPtr vcpuinfo = virDomainDefGetVcpu(vm->def, vcpu); - qemuDomainVcpuPrivatePtr vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpuinfo); + qemuDomainObjPrivate *priv = vm->privateData; + virDomainVcpuDef *vcpuinfo = virDomainDefGetVcpu(vm->def, vcpu); + qemuDomainVcpuPrivate *vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpuinfo); int oldvcpus = virDomainDefGetVcpus(vm->def); unsigned int nvcpus = vcpupriv->vcpus; virErrorPtr save_error = NULL; @@ -6109,12 +6109,12 @@ qemuDomainRemoveVcpu(virQEMUDriverPtr driver, void -qemuDomainRemoveVcpuAlias(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuDomainRemoveVcpuAlias(virQEMUDriver *driver, + virDomainObj *vm, const char *alias) { - virDomainVcpuDefPtr vcpu; - qemuDomainVcpuPrivatePtr vcpupriv; + virDomainVcpuDef *vcpu; + qemuDomainVcpuPrivate *vcpupriv; size_t i; for (i = 0; i < virDomainDefGetVcpusMax(vm->def); i++) { @@ -6130,13 +6130,13 @@ qemuDomainRemoveVcpuAlias(virQEMUDriverPtr driver, static int -qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, - virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, +qemuDomainHotplugDelVcpu(virQEMUDriver *driver, + virQEMUDriverConfig *cfg, + virDomainObj *vm, unsigned int vcpu) { - virDomainVcpuDefPtr vcpuinfo = virDomainDefGetVcpu(vm->def, vcpu); - qemuDomainVcpuPrivatePtr vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpuinfo); + virDomainVcpuDef *vcpuinfo = virDomainDefGetVcpu(vm->def, vcpu); + qemuDomainVcpuPrivate *vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpuinfo); int oldvcpus = virDomainDefGetVcpus(vm->def); unsigned int nvcpus = vcpupriv->vcpus; int rc; @@ -6182,14 +6182,14 @@ qemuDomainHotplugDelVcpu(virQEMUDriverPtr driver, static int -qemuDomainHotplugAddVcpu(virQEMUDriverPtr driver, - virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, +qemuDomainHotplugAddVcpu(virQEMUDriver *driver, + virQEMUDriverConfig *cfg, + virDomainObj *vm, unsigned int vcpu) { - virJSONValuePtr vcpuprops = NULL; - virDomainVcpuDefPtr vcpuinfo = virDomainDefGetVcpu(vm->def, vcpu); - qemuDomainVcpuPrivatePtr vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpuinfo); + virJSONValue *vcpuprops = NULL; + virDomainVcpuDef *vcpuinfo = virDomainDefGetVcpu(vm->def, vcpu); + qemuDomainVcpuPrivate *vcpupriv = QEMU_DOMAIN_VCPU_PRIVATE(vcpuinfo); unsigned int nvcpus = vcpupriv->vcpus; bool newhotplug = qemuDomainSupportsNewVcpuHotplug(vm); int ret = -1; @@ -6269,14 +6269,14 @@ qemuDomainHotplugAddVcpu(virQEMUDriverPtr driver, * * Returns the bitmap of vcpus to modify on success, NULL on error. */ -static virBitmapPtr -qemuDomainSelectHotplugVcpuEntities(virDomainDefPtr def, +static virBitmap * +qemuDomainSelectHotplugVcpuEntities(virDomainDef *def, unsigned int nvcpus, bool *enable) { - virBitmapPtr ret = NULL; - virDomainVcpuDefPtr vcpu; - qemuDomainVcpuPrivatePtr vcpupriv; + virBitmap *ret = NULL; + virDomainVcpuDef *vcpu; + qemuDomainVcpuPrivate *vcpupriv; unsigned int maxvcpus = virDomainDefGetVcpusMax(def); unsigned int curvcpus = virDomainDefGetVcpus(def); ssize_t i; @@ -6352,14 +6352,14 @@ qemuDomainSelectHotplugVcpuEntities(virDomainDefPtr def, static int -qemuDomainSetVcpusLive(virQEMUDriverPtr driver, - virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, - virBitmapPtr vcpumap, +qemuDomainSetVcpusLive(virQEMUDriver *driver, + virQEMUDriverConfig *cfg, + virDomainObj *vm, + virBitmap *vcpumap, bool enable) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuCgroupEmulatorAllNodesDataPtr emulatorCgroup = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + qemuCgroupEmulatorAllNodesData *emulatorCgroup = NULL; ssize_t nextvcpu = -1; int ret = -1; @@ -6400,11 +6400,11 @@ qemuDomainSetVcpusLive(virQEMUDriverPtr driver, * - fix hotpluggable state */ static void -qemuDomainSetVcpusConfig(virDomainDefPtr def, +qemuDomainSetVcpusConfig(virDomainDef *def, unsigned int nvcpus, bool hotpluggable) { - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; size_t curvcpus = virDomainDefGetVcpus(def); size_t maxvcpus = virDomainDefGetVcpusMax(def); size_t i; @@ -6462,15 +6462,15 @@ qemuDomainSetVcpusConfig(virDomainDefPtr def, int -qemuDomainSetVcpusInternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDefPtr def, - virDomainDefPtr persistentDef, +qemuDomainSetVcpusInternal(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDef *def, + virDomainDef *persistentDef, unsigned int nvcpus, bool hotpluggable) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - virBitmapPtr vcpumap = NULL; + virBitmap *vcpumap = NULL; bool enable; int ret = -1; @@ -6515,11 +6515,11 @@ qemuDomainSetVcpusInternal(virQEMUDriverPtr driver, static void -qemuDomainSetVcpuConfig(virDomainDefPtr def, - virBitmapPtr map, +qemuDomainSetVcpuConfig(virDomainDef *def, + virBitmap *map, bool state) { - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; ssize_t next = -1; def->individualvcpus = true; @@ -6543,13 +6543,13 @@ qemuDomainSetVcpuConfig(virDomainDefPtr def, * Returns a bitmap of hotpluggable vcpu entities that correspond to the logical * vcpus requested in @vcpus. */ -static virBitmapPtr -qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def, - virBitmapPtr vcpus, +static virBitmap * +qemuDomainFilterHotplugVcpuEntities(virDomainDef *def, + virBitmap *vcpus, bool state) { - qemuDomainVcpuPrivatePtr vcpupriv; - virDomainVcpuDefPtr vcpu; + qemuDomainVcpuPrivate *vcpupriv; + virDomainVcpuDef *vcpu; g_autoptr(virBitmap) map = virBitmapNewCopy(vcpus); ssize_t next = -1; size_t i; @@ -6608,10 +6608,10 @@ qemuDomainFilterHotplugVcpuEntities(virDomainDefPtr def, static int -qemuDomainVcpuValidateConfig(virDomainDefPtr def, - virBitmapPtr map) +qemuDomainVcpuValidateConfig(virDomainDef *def, + virBitmap *map) { - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; size_t maxvcpus = virDomainDefGetVcpusMax(def); ssize_t next; ssize_t firstvcpu = -1; @@ -6647,15 +6647,15 @@ qemuDomainVcpuValidateConfig(virDomainDefPtr def, int -qemuDomainSetVcpuInternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDefPtr def, - virDomainDefPtr persistentDef, - virBitmapPtr map, +qemuDomainSetVcpuInternal(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDef *def, + virDomainDef *persistentDef, + virBitmap *map, bool state) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - virBitmapPtr livevcpus = NULL; + virBitmap *livevcpus = NULL; int ret = -1; if (def) { diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h index 6287c5b5e8..df8f76f8d6 100644 --- a/src/qemu/qemu_hotplug.h +++ b/src/qemu/qemu_hotplug.h @@ -25,138 +25,138 @@ #include "qemu_domain.h" #include "domain_conf.h" -int qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virStorageSourcePtr newsrc, +int qemuDomainChangeEjectableMedia(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk, + virStorageSource *newsrc, bool force); -void qemuDomainDelTLSObjects(virQEMUDriverPtr driver, - virDomainObjPtr vm, +void qemuDomainDelTLSObjects(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, const char *secAlias, const char *tlsAlias); -int qemuDomainAddTLSObjects(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuDomainAddTLSObjects(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - virJSONValuePtr *secProps, - virJSONValuePtr *tlsProps); + virJSONValue **secProps, + virJSONValue **tlsProps); -int qemuDomainGetTLSObjects(virQEMUCapsPtr qemuCaps, - qemuDomainSecretInfoPtr secinfo, +int qemuDomainGetTLSObjects(virQEMUCaps *qemuCaps, + qemuDomainSecretInfo *secinfo, const char *tlsCertdir, bool tlsListen, bool tlsVerify, const char *alias, - virJSONValuePtr *tlsProps, - virJSONValuePtr *secProps); + virJSONValue **tlsProps, + virJSONValue **secProps); -int qemuDomainAttachControllerDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainControllerDefPtr controller); -int qemuDomainAttachDeviceDiskLive(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev); -int qemuDomainAttachNetDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainNetDefPtr net); -int qemuDomainAttachRedirdevDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainRedirdevDefPtr hostdev); -int qemuDomainAttachHostDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev); -int qemuDomainAttachShmemDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainShmemDefPtr shmem); -int qemuDomainAttachWatchdog(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainWatchdogDefPtr watchdog); -int qemuDomainFindGraphicsIndex(virDomainDefPtr def, - virDomainGraphicsDefPtr dev); -int qemuDomainAttachMemory(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem); -int qemuDomainChangeGraphics(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainGraphicsDefPtr dev); -int qemuDomainChangeGraphicsPasswords(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuDomainAttachControllerDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainControllerDef *controller); +int qemuDomainAttachDeviceDiskLive(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev); +int qemuDomainAttachNetDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainNetDef *net); +int qemuDomainAttachRedirdevDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainRedirdevDef *hostdev); +int qemuDomainAttachHostDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev); +int qemuDomainAttachShmemDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainShmemDef *shmem); +int qemuDomainAttachWatchdog(virQEMUDriver *driver, + virDomainObj *vm, + virDomainWatchdogDef *watchdog); +int qemuDomainFindGraphicsIndex(virDomainDef *def, + virDomainGraphicsDef *dev); +int qemuDomainAttachMemory(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem); +int qemuDomainChangeGraphics(virQEMUDriver *driver, + virDomainObj *vm, + virDomainGraphicsDef *dev); +int qemuDomainChangeGraphicsPasswords(virQEMUDriver *driver, + virDomainObj *vm, int type, - virDomainGraphicsAuthDefPtr auth, + virDomainGraphicsAuthDef *auth, const char *defaultPasswd, int asyncJob); -int qemuDomainChangeNet(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev); -int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainNetDefPtr dev, +int qemuDomainChangeNet(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev); +int qemuDomainChangeNetLinkState(virQEMUDriver *driver, + virDomainObj *vm, + virDomainNetDef *dev, int linkstate); -int qemuDomainAttachInputDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainInputDefPtr input); +int qemuDomainAttachInputDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainInputDef *input); -int qemuDomainAttachVsockDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainVsockDefPtr vsock); +int qemuDomainAttachVsockDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainVsockDef *vsock); -int qemuDomainAttachLease(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainLeaseDefPtr lease); -int qemuDomainAttachChrDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainChrDefPtr chr); -int qemuDomainAttachRNGDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainRNGDefPtr rng); +int qemuDomainAttachLease(virQEMUDriver *driver, + virDomainObj *vm, + virDomainLeaseDef *lease); +int qemuDomainAttachChrDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainChrDef *chr); +int qemuDomainAttachRNGDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainRNGDef *rng); -int qemuDomainDetachDeviceLive(virDomainObjPtr vm, - virDomainDeviceDefPtr match, - virQEMUDriverPtr driver, +int qemuDomainDetachDeviceLive(virDomainObj *vm, + virDomainDeviceDef *match, + virQEMUDriver *driver, bool async); -void qemuDomainRemoveVcpuAlias(virQEMUDriverPtr driver, - virDomainObjPtr vm, +void qemuDomainRemoveVcpuAlias(virQEMUDriver *driver, + virDomainObj *vm, const char *alias); int -qemuDomainChrInsert(virDomainDefPtr vmdef, - virDomainChrDefPtr chr); -virDomainChrDefPtr -qemuDomainChrRemove(virDomainDefPtr vmdef, - virDomainChrDefPtr chr); +qemuDomainChrInsert(virDomainDef *vmdef, + virDomainChrDef *chr); +virDomainChrDef * +qemuDomainChrRemove(virDomainDef *vmdef, + virDomainChrDef *chr); -int qemuDomainRemoveDevice(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDeviceDefPtr dev); +int qemuDomainRemoveDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev); -bool qemuDomainSignalDeviceRemoval(virDomainObjPtr vm, +bool qemuDomainSignalDeviceRemoval(virDomainObj *vm, const char *devAlias, qemuDomainUnpluggingDeviceStatus status); -int qemuDomainSetVcpusInternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDefPtr def, - virDomainDefPtr persistentDef, +int qemuDomainSetVcpusInternal(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDef *def, + virDomainDef *persistentDef, unsigned int nvcpus, bool hotpluggable); -int qemuDomainSetVcpuInternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDefPtr def, - virDomainDefPtr persistentDef, - virBitmapPtr vcpus, +int qemuDomainSetVcpuInternal(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDef *def, + virDomainDef *persistentDef, + virBitmap *vcpus, bool state); -unsigned long long qemuDomainGetUnplugTimeout(virDomainObjPtr vm) G_GNUC_NO_INLINE; +unsigned long long qemuDomainGetUnplugTimeout(virDomainObj *vm) G_GNUC_NO_INLINE; -int qemuHotplugAttachDBusVMState(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuHotplugAttachDBusVMState(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob); -int qemuHotplugRemoveDBusVMState(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuHotplugRemoveDBusVMState(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob); diff --git a/src/qemu/qemu_interface.c b/src/qemu/qemu_interface.c index be2f53945c..704edc4ec7 100644 --- a/src/qemu/qemu_interface.c +++ b/src/qemu/qemu_interface.c @@ -51,7 +51,7 @@ VIR_LOG_INIT("qemu.qemu_interface"); * the rest of the network. */ int -qemuInterfaceStartDevice(virDomainNetDefPtr net) +qemuInterfaceStartDevice(virDomainNetDef *net) { virDomainNetType actualType = virDomainNetGetActualType(net); @@ -134,7 +134,7 @@ qemuInterfaceStartDevice(virDomainNetDefPtr net) * Set all ifaces associated with this domain to the online state. */ int -qemuInterfaceStartDevices(virDomainDefPtr def) +qemuInterfaceStartDevices(virDomainDef *def) { size_t i; @@ -155,7 +155,7 @@ qemuInterfaceStartDevices(virDomainDefPtr def) * it from the rest of the network. */ int -qemuInterfaceStopDevice(virDomainNetDefPtr net) +qemuInterfaceStopDevice(virDomainNetDef *net) { virDomainNetType actualType = virDomainNetGetActualType(net); @@ -221,7 +221,7 @@ qemuInterfaceStopDevice(virDomainNetDefPtr net) * the rest of the network. */ int -qemuInterfaceStopDevices(virDomainDefPtr def) +qemuInterfaceStopDevices(virDomainDef *def) { size_t i; @@ -254,9 +254,9 @@ qemuInterfaceIsVnetCompatModel(const virDomainNetDef *net) * Returns 0 on success or -1 in case of error. */ int -qemuInterfaceDirectConnect(virDomainDefPtr def, - virQEMUDriverPtr driver, - virDomainNetDefPtr net, +qemuInterfaceDirectConnect(virDomainDef *def, + virQEMUDriver *driver, + virDomainNetDef *net, int *tapfd, size_t tapfdSize, virNetDevVPortProfileOp vmop) @@ -314,13 +314,13 @@ qemuInterfaceDirectConnect(virDomainDefPtr def, * Returns 0 in case of success or -1 on failure */ static int -qemuCreateInBridgePortWithHelper(virQEMUDriverConfigPtr cfg, +qemuCreateInBridgePortWithHelper(virQEMUDriverConfig *cfg, const char *brname, char **ifname, int *tapfd, unsigned int flags) { - virCommandPtr cmd; + virCommand *cmd; char *errbuf = NULL, *cmdstr = NULL; int pair[2] = { -1, -1 }; @@ -404,9 +404,9 @@ qemuCreateInBridgePortWithHelper(virQEMUDriverConfigPtr cfg, * (i.e. if the connection is made with a tap device) */ int -qemuInterfaceEthernetConnect(virDomainDefPtr def, - virQEMUDriverPtr driver, - virDomainNetDefPtr net, +qemuInterfaceEthernetConnect(virDomainDef *def, + virQEMUDriver *driver, + virDomainNetDef *net, int *tapfd, size_t tapfdSize) { @@ -528,9 +528,9 @@ qemuInterfaceEthernetConnect(virDomainDefPtr def, * device connecting to a bridge device) */ int -qemuInterfaceBridgeConnect(virDomainDefPtr def, - virQEMUDriverPtr driver, - virDomainNetDefPtr net, +qemuInterfaceBridgeConnect(virDomainDef *def, + virQEMUDriver *driver, + virDomainNetDef *net, int *tapfd, size_t *tapfdSize) { @@ -636,7 +636,7 @@ qemuInterfaceBridgeConnect(virDomainDefPtr def, * Called *only* called if actualType is VIR_DOMAIN_NET_TYPE_VDPA */ int -qemuInterfaceVDPAConnect(virDomainNetDefPtr net) +qemuInterfaceVDPAConnect(virDomainNetDef *net) { int fd; @@ -655,9 +655,9 @@ qemuInterfaceVDPAConnect(virDomainNetDefPtr net) * Returns: -1 on error, 0 if slirp isn't available, 1 on succcess */ int -qemuInterfacePrepareSlirp(virQEMUDriverPtr driver, - virDomainNetDefPtr net, - qemuSlirpPtr *slirpret) +qemuInterfacePrepareSlirp(virQEMUDriver *driver, + virDomainNetDef *net, + qemuSlirp **slirpret) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autoptr(qemuSlirp) slirp = NULL; @@ -703,8 +703,8 @@ qemuInterfacePrepareSlirp(virQEMUDriverPtr driver, * -1 on failure */ int -qemuInterfaceOpenVhostNet(virDomainDefPtr def, - virDomainNetDefPtr net, +qemuInterfaceOpenVhostNet(virDomainDef *def, + virDomainNetDef *net, int *vhostfd, size_t *vhostfdSize) { diff --git a/src/qemu/qemu_interface.h b/src/qemu/qemu_interface.h index aed8464c7c..438d548065 100644 --- a/src/qemu/qemu_interface.h +++ b/src/qemu/qemu_interface.h @@ -26,38 +26,38 @@ #include "qemu_domain.h" #include "qemu_slirp.h" -int qemuInterfaceStartDevice(virDomainNetDefPtr net); -int qemuInterfaceStartDevices(virDomainDefPtr def); -int qemuInterfaceStopDevice(virDomainNetDefPtr net); -int qemuInterfaceStopDevices(virDomainDefPtr def); +int qemuInterfaceStartDevice(virDomainNetDef *net); +int qemuInterfaceStartDevices(virDomainDef *def); +int qemuInterfaceStopDevice(virDomainNetDef *net); +int qemuInterfaceStopDevices(virDomainDef *def); -int qemuInterfaceDirectConnect(virDomainDefPtr def, - virQEMUDriverPtr driver, - virDomainNetDefPtr net, +int qemuInterfaceDirectConnect(virDomainDef *def, + virQEMUDriver *driver, + virDomainNetDef *net, int *tapfd, size_t tapfdSize, virNetDevVPortProfileOp vmop); -int qemuInterfaceEthernetConnect(virDomainDefPtr def, - virQEMUDriverPtr driver, - virDomainNetDefPtr net, +int qemuInterfaceEthernetConnect(virDomainDef *def, + virQEMUDriver *driver, + virDomainNetDef *net, int *tapfd, size_t tapfdSize); -int qemuInterfaceBridgeConnect(virDomainDefPtr def, - virQEMUDriverPtr driver, - virDomainNetDefPtr net, +int qemuInterfaceBridgeConnect(virDomainDef *def, + virQEMUDriver *driver, + virDomainNetDef *net, int *tapfd, size_t *tapfdSize) ATTRIBUTE_NONNULL(2); -int qemuInterfaceOpenVhostNet(virDomainDefPtr def, - virDomainNetDefPtr net, +int qemuInterfaceOpenVhostNet(virDomainDef *def, + virDomainNetDef *net, int *vhostfd, size_t *vhostfdSize) G_GNUC_NO_INLINE; -int qemuInterfacePrepareSlirp(virQEMUDriverPtr driver, - virDomainNetDefPtr net, - qemuSlirpPtr *slirp); +int qemuInterfacePrepareSlirp(virQEMUDriver *driver, + virDomainNetDef *net, + qemuSlirp **slirp); -int qemuInterfaceVDPAConnect(virDomainNetDefPtr net) G_GNUC_NO_INLINE; +int qemuInterfaceVDPAConnect(virDomainNetDef *net) G_GNUC_NO_INLINE; diff --git a/src/qemu/qemu_interop_config.c b/src/qemu/qemu_interop_config.c index 9733df7194..ea2afcc070 100644 --- a/src/qemu/qemu_interop_config.c +++ b/src/qemu/qemu_interop_config.c @@ -93,9 +93,9 @@ qemuInteropFetchConfigs(const char *name, g_autofree char *xdgConfig = NULL; g_autofree char *sysLocation = virFileBuildPath(QEMU_SYSTEM_LOCATION, name, NULL); g_autofree char *etcLocation = virFileBuildPath(QEMU_ETC_LOCATION, name, NULL); - g_autofree virHashKeyValuePairPtr pairs = NULL; + g_autofree virHashKeyValuePair *pairs = NULL; size_t npairs; - virHashKeyValuePairPtr tmp = NULL; + virHashKeyValuePair *tmp = NULL; size_t nconfigs = 0; *configs = NULL; diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index ba2ee4f081..df88f954ed 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -82,42 +82,42 @@ VIR_ENUM_IMPL(qemuMigrationJobPhase, ); static int -qemuMigrationJobStart(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationJobStart(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob job, unsigned long apiFlags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; static void -qemuMigrationJobSetPhase(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationJobSetPhase(virQEMUDriver *driver, + virDomainObj *vm, qemuMigrationJobPhase phase) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); static void -qemuMigrationJobStartPhase(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationJobStartPhase(virQEMUDriver *driver, + virDomainObj *vm, qemuMigrationJobPhase phase) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); static void -qemuMigrationJobContinue(virDomainObjPtr obj) +qemuMigrationJobContinue(virDomainObj *obj) ATTRIBUTE_NONNULL(1); static bool -qemuMigrationJobIsActive(virDomainObjPtr vm, +qemuMigrationJobIsActive(virDomainObj *vm, qemuDomainAsyncJob job) ATTRIBUTE_NONNULL(1); static void -qemuMigrationJobFinish(virQEMUDriverPtr driver, - virDomainObjPtr obj) +qemuMigrationJobFinish(virQEMUDriver *driver, + virDomainObj *obj) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); static void -qemuMigrationSrcStoreDomainState(virDomainObjPtr vm) +qemuMigrationSrcStoreDomainState(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; priv->preMigrationState = virDomainObjGetState(vm, NULL); VIR_DEBUG("Storing pre-migration state=%d domain=%p", @@ -126,9 +126,9 @@ qemuMigrationSrcStoreDomainState(virDomainObjPtr vm) /* Returns true if the domain was resumed, false otherwise */ static bool -qemuMigrationSrcRestoreDomainState(virQEMUDriverPtr driver, virDomainObjPtr vm) +qemuMigrationSrcRestoreDomainState(virQEMUDriver *driver, virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int reason; virDomainState state = virDomainObjGetState(vm, &reason); bool ret = false; @@ -170,7 +170,7 @@ qemuMigrationSrcRestoreDomainState(virQEMUDriverPtr driver, virDomainObjPtr vm) static int qemuMigrationDstPrecreateDisk(virConnectPtr *conn, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, unsigned long long capacity) { int ret = -1; @@ -313,8 +313,8 @@ qemuMigrationAnyCopyDisk(virDomainDiskDef const *disk, static int -qemuMigrationDstPrecreateStorage(virDomainObjPtr vm, - qemuMigrationCookieNBDPtr nbd, +qemuMigrationDstPrecreateStorage(virDomainObj *vm, + qemuMigrationCookieNBD *nbd, size_t nmigrate_disks, const char **migrate_disks, bool incremental) @@ -327,7 +327,7 @@ qemuMigrationDstPrecreateStorage(virDomainObjPtr vm, return 0; for (i = 0; i < nbd->ndisks; i++) { - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; const char *diskSrcPath; g_autofree char *nvmePath = NULL; @@ -388,8 +388,8 @@ qemuMigrationDstPrecreateStorage(virDomainObjPtr vm, * Returns 0 on success, -1 otherwise. */ static int -qemuMigrationDstStartNBDServer(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationDstStartNBDServer(virQEMUDriver *driver, + virDomainObj *vm, const char *listenAddr, size_t nmigrate_disks, const char **migrate_disks, @@ -398,7 +398,7 @@ qemuMigrationDstStartNBDServer(virQEMUDriverPtr driver, const char *tls_alias) { int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; size_t i; virStorageNetHostDef server = { .name = (char *)listenAddr, /* cast away const */ @@ -455,7 +455,7 @@ qemuMigrationDstStartNBDServer(virQEMUDriverPtr driver, } for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; + virDomainDiskDef *disk = vm->def->disks[i]; g_autofree char *diskAlias = NULL; /* check whether disk should be migrated */ @@ -520,11 +520,11 @@ qemuMigrationDstStartNBDServer(virQEMUDriverPtr driver, static int -qemuMigrationDstStopNBDServer(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuMigrationCookiePtr mig) +qemuMigrationDstStopNBDServer(virQEMUDriver *driver, + virDomainObj *vm, + qemuMigrationCookie *mig) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!mig->nbd) return 0; @@ -545,7 +545,7 @@ qemuMigrationDstStopNBDServer(virQEMUDriverPtr driver, static void -qemuMigrationNBDReportMirrorError(qemuBlockJobDataPtr job, +qemuMigrationNBDReportMirrorError(qemuBlockJobData *job, const char *diskdst) { if (job->errmsg) { @@ -571,16 +571,16 @@ qemuMigrationNBDReportMirrorError(qemuBlockJobDataPtr job, * -1 on error. */ static int -qemuMigrationSrcNBDStorageCopyReady(virDomainObjPtr vm, +qemuMigrationSrcNBDStorageCopyReady(virDomainObj *vm, qemuDomainAsyncJob asyncJob) { size_t i; size_t notReady = 0; for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); - qemuBlockJobDataPtr job; + virDomainDiskDef *disk = vm->def->disks[i]; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuBlockJobData *job; if (!diskPriv->migrating) continue; @@ -625,7 +625,7 @@ qemuMigrationSrcNBDStorageCopyReady(virDomainObjPtr vm, * -2 all mirrors are gone but some of them failed. */ static int -qemuMigrationSrcNBDCopyCancelled(virDomainObjPtr vm, +qemuMigrationSrcNBDCopyCancelled(virDomainObj *vm, qemuDomainAsyncJob asyncJob, bool check) { @@ -636,9 +636,9 @@ qemuMigrationSrcNBDCopyCancelled(virDomainObjPtr vm, retry: for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); - qemuBlockJobDataPtr job; + virDomainDiskDef *disk = vm->def->disks[i]; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuBlockJobData *job; if (!diskPriv->migrating) continue; @@ -706,14 +706,14 @@ qemuMigrationSrcNBDCopyCancelled(virDomainObjPtr vm, * -1 on error or when job failed and failNoJob is true. */ static int -qemuMigrationSrcNBDCopyCancelOne(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, - qemuBlockJobDataPtr job, +qemuMigrationSrcNBDCopyCancelOne(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk, + qemuBlockJobData *job, bool failNoJob, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int rv; qemuBlockJobUpdate(vm, job, asyncJob); @@ -755,8 +755,8 @@ qemuMigrationSrcNBDCopyCancelOne(virQEMUDriverPtr driver, * Returns 0 on success, -1 otherwise. */ static int -qemuMigrationSrcNBDCopyCancel(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcNBDCopyCancel(virQEMUDriver *driver, + virDomainObj *vm, bool check, qemuDomainAsyncJob asyncJob, virConnectPtr dconn) @@ -770,9 +770,9 @@ qemuMigrationSrcNBDCopyCancel(virQEMUDriverPtr driver, VIR_DEBUG("Cancelling drive mirrors for domain %s", vm->def->name); for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); - qemuBlockJobDataPtr job; + virDomainDiskDef *disk = vm->def->disks[i]; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuBlockJobData *job; if (!(job = qemuBlockJobDiskGetJob(disk)) || !qemuBlockJobIsRunning(job)) @@ -820,8 +820,8 @@ qemuMigrationSrcNBDCopyCancel(virQEMUDriverPtr driver, } for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + virDomainDiskDef *disk = vm->def->disks[i]; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); if (!diskPriv->migrSource) continue; @@ -841,16 +841,16 @@ qemuMigrationSrcNBDCopyCancel(virQEMUDriverPtr driver, static int -qemuMigrationSrcCancelRemoveTempBitmaps(virDomainObjPtr vm, +qemuMigrationSrcCancelRemoveTempBitmaps(virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; GSList *next; for (next = jobPriv->migTempBitmaps; next; next = next->next) { - qemuDomainJobPrivateMigrateTempBitmapPtr t = next->data; + qemuDomainJobPrivateMigrateTempBitmap *t = next->data; if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) return -1; @@ -863,8 +863,8 @@ qemuMigrationSrcCancelRemoveTempBitmaps(virDomainObjPtr vm, } -static virStorageSourcePtr -qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource(virDomainDiskDefPtr disk, +static virStorageSource * +qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource(virDomainDiskDef *disk, const char *host, int port, const char *socket, @@ -904,9 +904,9 @@ qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource(virDomainDiskDefPtr disk, static int -qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, +qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk, const char *jobname, const char *sourcename, bool persistjob, @@ -918,7 +918,7 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr driver, const char *tlsAlias) { g_autoptr(qemuBlockStorageSourceAttachData) data = NULL; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); int mon_ret = 0; g_autoptr(virStorageSource) copysrc = NULL; @@ -958,8 +958,8 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virQEMUDriverPtr driver, static int -qemuMigrationSrcNBDStorageCopyDriveMirror(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcNBDStorageCopyDriveMirror(virQEMUDriver *driver, + virDomainObj *vm, const char *diskAlias, const char *host, int port, @@ -997,9 +997,9 @@ qemuMigrationSrcNBDStorageCopyDriveMirror(virQEMUDriverPtr driver, static int -qemuMigrationSrcNBDStorageCopyOne(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainDiskDefPtr disk, +qemuMigrationSrcNBDStorageCopyOne(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDiskDef *disk, const char *host, int port, const char *socket, @@ -1008,9 +1008,9 @@ qemuMigrationSrcNBDStorageCopyOne(virQEMUDriverPtr driver, const char *tlsAlias, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); - qemuBlockJobDataPtr job = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuBlockJobData *job = NULL; char *diskAlias = NULL; const char *jobname = NULL; const char *sourcename = NULL; @@ -1087,9 +1087,9 @@ qemuMigrationSrcNBDStorageCopyOne(virQEMUDriverPtr driver, * -1 otherwise. */ static int -qemuMigrationSrcNBDStorageCopy(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuMigrationCookiePtr mig, +qemuMigrationSrcNBDStorageCopy(virQEMUDriver *driver, + virDomainObj *vm, + qemuMigrationCookie *mig, const char *host, unsigned long speed, unsigned int *migrate_flags, @@ -1100,7 +1100,7 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriverPtr driver, const char *nbdURI, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int port; size_t i; unsigned long long mirror_speed = speed; @@ -1158,7 +1158,7 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriverPtr driver, } for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; + virDomainDiskDef *disk = vm->def->disks[i]; /* check whether disk should be migrated */ if (!qemuMigrationAnyCopyDisk(disk, nmigrate_disks, migrate_disks)) @@ -1224,7 +1224,7 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *def) /* Migration with USB host devices is allowed, all other devices are * forbidden. */ for (i = 0; i < def->nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = def->hostdevs[i]; + virDomainHostdevDef *hostdev = def->hostdevs[i]; switch ((virDomainHostdevMode)hostdev->mode) { case VIR_DOMAIN_HOSTDEV_MODE_CAPABILITIES: virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", @@ -1300,12 +1300,12 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *def) * false otherwise. */ bool -qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcIsAllowed(virQEMUDriver *driver, + virDomainObj *vm, bool remote, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int nsnapshots; int pauseReason; size_t i; @@ -1362,7 +1362,7 @@ qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, bool block = true; for (i = 0; i < vm->def->clock.ntimers; i++) { - virDomainTimerDefPtr timer = vm->def->clock.timers[i]; + virDomainTimerDef *timer = vm->def->clock.timers[i]; if (timer->name == VIR_DOMAIN_TIMER_NAME_TSC && timer->frequency > 0) { @@ -1382,7 +1382,7 @@ qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, /* Verify that memory device config can be transferred reliably */ for (i = 0; i < vm->def->nmems; i++) { - virDomainMemoryDefPtr mem = vm->def->mems[i]; + virDomainMemoryDef *mem = vm->def->mems[i]; if (mem->model == VIR_DOMAIN_MEMORY_MODEL_DIMM && mem->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DIMM) { @@ -1395,7 +1395,7 @@ qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, } for (i = 0; i < vm->def->nshmems; i++) { - virDomainShmemDefPtr shmem = vm->def->shmems[i]; + virDomainShmemDef *shmem = vm->def->shmems[i]; if (shmem->model == VIR_DOMAIN_SHMEM_MODEL_IVSHMEM) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", @@ -1413,8 +1413,8 @@ qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, } for (i = 0; i < vm->def->nnets; i++) { - virDomainNetDefPtr net = vm->def->nets[i]; - qemuSlirpPtr slirp; + virDomainNetDef *net = vm->def->nets[i]; + qemuSlirp *slirp; if (net->type == VIR_DOMAIN_NET_TYPE_VDPA) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", @@ -1432,7 +1432,7 @@ qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, } for (i = 0; i < vm->def->nfss; i++) { - virDomainFSDefPtr fs = vm->def->fss[i]; + virDomainFSDef *fs = vm->def->fss[i]; if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", @@ -1449,7 +1449,7 @@ qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, } for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; + virDomainDiskDef *disk = vm->def->disks[i]; if (disk->transient) { virReportError(VIR_ERR_OPERATION_INVALID, "%s", @@ -1463,8 +1463,8 @@ qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, } static bool -qemuMigrationSrcIsSafe(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, +qemuMigrationSrcIsSafe(virDomainDef *def, + virQEMUCaps *qemuCaps, size_t nmigrate_disks, const char **migrate_disks, unsigned int flags) @@ -1476,7 +1476,7 @@ qemuMigrationSrcIsSafe(virDomainDefPtr def, int rc; for (i = 0; i < def->ndisks; i++) { - virDomainDiskDefPtr disk = def->disks[i]; + virDomainDiskDef *disk = def->disks[i]; const char *src = virDomainDiskGetSource(disk); int actualType = virStorageSourceGetActualType(disk->src); bool unsafe = false; @@ -1551,8 +1551,8 @@ qemuMigrationSrcIsSafe(virDomainDefPtr def, void -qemuMigrationAnyPostcopyFailed(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuMigrationAnyPostcopyFailed(virQEMUDriver *driver, + virDomainObj *vm) { virDomainState state; int reason; @@ -1583,10 +1583,10 @@ qemuMigrationAnyPostcopyFailed(virQEMUDriverPtr driver, static int -qemuMigrationSrcWaitForSpice(virDomainObjPtr vm) +qemuMigrationSrcWaitForSpice(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; if (!jobPriv->spiceMigration) return 0; @@ -1601,7 +1601,7 @@ qemuMigrationSrcWaitForSpice(virDomainObjPtr vm) static void -qemuMigrationUpdateJobType(qemuDomainJobInfoPtr jobInfo) +qemuMigrationUpdateJobType(qemuDomainJobInfo *jobInfo) { switch ((qemuMonitorMigrationStatus) jobInfo->stats.mig.status) { case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY: @@ -1643,13 +1643,13 @@ qemuMigrationUpdateJobType(qemuDomainJobInfoPtr jobInfo) int -qemuMigrationAnyFetchStats(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationAnyFetchStats(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - qemuDomainJobInfoPtr jobInfo, + qemuDomainJobInfo *jobInfo, char **error) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; qemuMonitorMigrationStats stats; int rv; @@ -1668,9 +1668,9 @@ qemuMigrationAnyFetchStats(virQEMUDriverPtr driver, static const char * -qemuMigrationJobName(virDomainObjPtr vm) +qemuMigrationJobName(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; switch (priv->job.asyncJob) { case QEMU_ASYNC_JOB_MIGRATION_OUT: @@ -1697,12 +1697,12 @@ qemuMigrationJobName(virDomainObjPtr vm) static int -qemuMigrationJobCheckStatus(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationJobCheckStatus(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobInfoPtr jobInfo = priv->job.current; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobInfo *jobInfo = priv->job.current; g_autofree char *error = NULL; bool events = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT); @@ -1760,14 +1760,14 @@ enum qemuMigrationCompletedFlags { * -2 something else failed, we need to cancel migration. */ static int -qemuMigrationAnyCompleted(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationAnyCompleted(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, virConnectPtr dconn, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobInfoPtr jobInfo = priv->job.current; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobInfo *jobInfo = priv->job.current; int pauseReason; if (qemuMigrationJobCheckStatus(driver, vm, asyncJob) < 0) @@ -1851,14 +1851,14 @@ qemuMigrationAnyCompleted(virQEMUDriverPtr driver, * QEMU reports failed migration. */ static int -qemuMigrationSrcWaitForCompletion(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcWaitForCompletion(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, virConnectPtr dconn, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobInfoPtr jobInfo = priv->job.current; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobInfo *jobInfo = priv->job.current; bool events = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT); int rv; @@ -1903,12 +1903,12 @@ qemuMigrationSrcWaitForCompletion(virQEMUDriverPtr driver, static int -qemuMigrationDstWaitForCompletion(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationDstWaitForCompletion(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, bool postcopy) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; unsigned int flags = 0; int rv; @@ -1931,16 +1931,16 @@ qemuMigrationDstWaitForCompletion(virQEMUDriverPtr driver, static int -qemuMigrationSrcGraphicsRelocate(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuMigrationCookiePtr cookie, +qemuMigrationSrcGraphicsRelocate(virQEMUDriver *driver, + virDomainObj *vm, + qemuMigrationCookie *cookie, const char *graphicsuri) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret = -1; const char *listenAddress = NULL; virSocketAddr addr; - virURIPtr uri = NULL; + virURI *uri = NULL; int type = -1; int port = -1; int tlsPort = -1; @@ -1982,7 +1982,7 @@ qemuMigrationSrcGraphicsRelocate(virQEMUDriverPtr driver, port = uri->port; for (i = 0; i < uri->paramsCount; i++) { - virURIParamPtr param = uri->params + i; + virURIParam *param = uri->params + i; if (STRCASEEQ(param->name, "tlsPort")) { if (virStrToLong_i(param->value, NULL, 10, &tlsPort) < 0) { @@ -2016,7 +2016,7 @@ qemuMigrationSrcGraphicsRelocate(virQEMUDriverPtr driver, if (qemuDomainObjEnterMonitorAsync(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT) == 0) { - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; ret = qemuMonitorGraphicsRelocate(priv->mon, type, listenAddress, port, tlsPort, tlsSubject); @@ -2032,11 +2032,11 @@ qemuMigrationSrcGraphicsRelocate(virQEMUDriverPtr driver, static int -qemuMigrationDstOPDRelocate(virQEMUDriverPtr driver G_GNUC_UNUSED, - virDomainObjPtr vm, - qemuMigrationCookiePtr cookie) +qemuMigrationDstOPDRelocate(virQEMUDriver *driver G_GNUC_UNUSED, + virDomainObj *vm, + qemuMigrationCookie *cookie) { - virDomainNetDefPtr netptr; + virDomainNetDef *netptr; size_t i; for (i = 0; i < cookie->network->nnets; i++) { @@ -2066,7 +2066,7 @@ qemuMigrationDstOPDRelocate(virQEMUDriverPtr driver G_GNUC_UNUSED, int -qemuMigrationDstCheckProtocol(virQEMUCapsPtr qemuCaps, +qemuMigrationDstCheckProtocol(virQEMUCaps *qemuCaps, const char *migrateFrom) { if (STRPREFIX(migrateFrom, "rdma")) { @@ -2106,12 +2106,12 @@ qemuMigrationDstGetURI(const char *migrateFrom, int -qemuMigrationDstRun(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationDstRun(virQEMUDriver *driver, + virDomainObj *vm, const char *uri, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int rv; VIR_DEBUG("Setting up incoming migration with URI %s", uri); @@ -2148,13 +2148,13 @@ qemuMigrationDstRun(virQEMUDriverPtr driver, * qemuDomainMigratePerform3 and qemuDomainMigrateConfirm3. */ static void -qemuMigrationSrcCleanup(virDomainObjPtr vm, +qemuMigrationSrcCleanup(virDomainObj *vm, virConnectPtr conn, void *opaque) { - virQEMUDriverPtr driver = opaque; - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; + virQEMUDriver *driver = opaque; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; VIR_DEBUG("vm=%s, conn=%p, asyncJob=%s, phase=%s", vm->def->name, conn, @@ -2215,14 +2215,14 @@ qemuMigrationSrcCleanup(virDomainObjPtr vm, * and fills them into @mig to be offered to the destination. */ static int -qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(qemuMigrationCookiePtr mig, - virDomainObjPtr vm, +qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(qemuMigrationCookie *mig, + virDomainObj *vm, const char **migrate_disks, size_t nmigrate_disks) { GSList *disks = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; size_t i; g_autoptr(GHashTable) blockNamedNodeData = NULL; @@ -2231,10 +2231,10 @@ qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(qemuMigrationCookiePtr mig, return -1; for (i = 0; i < vm->def->ndisks; i++) { - qemuMigrationBlockDirtyBitmapsDiskPtr disk; + qemuMigrationBlockDirtyBitmapsDisk *disk; GSList *bitmaps = NULL; - virDomainDiskDefPtr diskdef = vm->def->disks[i]; - qemuBlockNamedNodeDataPtr nodedata = virHashLookup(blockNamedNodeData, diskdef->src->nodeformat); + virDomainDiskDef *diskdef = vm->def->disks[i]; + qemuBlockNamedNodeData *nodedata = virHashLookup(blockNamedNodeData, diskdef->src->nodeformat); size_t j; if (!nodedata) @@ -2255,7 +2255,7 @@ qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(qemuMigrationCookiePtr mig, } for (j = 0; j < nodedata->nbitmaps; j++) { - qemuMigrationBlockDirtyBitmapsDiskBitmapPtr bitmap; + qemuMigrationBlockDirtyBitmapsDiskBitmap *bitmap; if (!qemuBlockBitmapChainIsValid(diskdef->src, nodedata->bitmaps[j]->name, @@ -2291,8 +2291,8 @@ qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(qemuMigrationCookiePtr mig, /* The caller is supposed to lock the vm and start a migration job. */ static char * -qemuMigrationSrcBeginPhase(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcBeginPhase(virQEMUDriver *driver, + virDomainObj *vm, const char *xmlin, const char *dname, char **cookieout, @@ -2303,7 +2303,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriverPtr driver, { g_autoptr(qemuMigrationCookie) mig = NULL; g_autoptr(virDomainDef) def = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; unsigned int cookieFlags = QEMU_MIGRATION_COOKIE_LOCKSTATE; VIR_DEBUG("driver=%p, vm=%p, xmlin=%s, dname=%s," @@ -2453,7 +2453,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriverPtr driver, char * qemuMigrationSrcBegin(virConnectPtr conn, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlin, const char *dname, char **cookieout, @@ -2462,7 +2462,7 @@ qemuMigrationSrcBegin(virConnectPtr conn, const char **migrate_disks, unsigned long flags) { - virQEMUDriverPtr driver = conn->privateData; + virQEMUDriver *driver = conn->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); char *xml = NULL; qemuDomainAsyncJob asyncJob; @@ -2535,10 +2535,10 @@ qemuMigrationSrcBegin(virConnectPtr conn, */ static void -qemuMigrationDstPrepareCleanup(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuMigrationDstPrepareCleanup(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; VIR_DEBUG("driver=%p, vm=%s, job=%s, asyncJob=%s", driver, @@ -2554,15 +2554,15 @@ qemuMigrationDstPrepareCleanup(virQEMUDriverPtr driver, qemuDomainObjDiscardAsyncJob(driver, vm); } -static qemuProcessIncomingDefPtr -qemuMigrationDstPrepare(virDomainObjPtr vm, +static qemuProcessIncomingDef * +qemuMigrationDstPrepare(virDomainObj *vm, bool tunnel, const char *protocol, const char *listenAddress, unsigned short port, int fd) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *migrateFrom = NULL; if (tunnel) { @@ -2635,12 +2635,12 @@ qemuMigrationDstPrepare(virDomainObjPtr vm, * source. */ static int -qemuMigrationDstPrepareAnyBlockDirtyBitmaps(virDomainObjPtr vm, - qemuMigrationCookiePtr mig, - qemuMigrationParamsPtr migParams, +qemuMigrationDstPrepareAnyBlockDirtyBitmaps(virDomainObj *vm, + qemuMigrationCookie *mig, + qemuMigrationParams *migParams, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virJSONValue) mapping = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL; GSList *nextdisk; @@ -2658,8 +2658,8 @@ qemuMigrationDstPrepareAnyBlockDirtyBitmaps(virDomainObjPtr vm, return -1; for (nextdisk = mig->blockDirtyBitmaps; nextdisk; nextdisk = nextdisk->next) { - qemuMigrationBlockDirtyBitmapsDiskPtr disk = nextdisk->data; - qemuBlockNamedNodeDataPtr nodedata; + qemuMigrationBlockDirtyBitmapsDisk *disk = nextdisk->data; + qemuBlockNamedNodeData *nodedata; GSList *nextbitmap; if (!(nodedata = virHashLookup(blockNamedNodeData, disk->nodename))) { @@ -2677,7 +2677,7 @@ qemuMigrationDstPrepareAnyBlockDirtyBitmaps(virDomainObjPtr vm, } for (nextbitmap = disk->bitmaps; nextbitmap; nextbitmap = nextbitmap->next) { - qemuMigrationBlockDirtyBitmapsDiskBitmapPtr bitmap = nextbitmap->data; + qemuMigrationBlockDirtyBitmapsDiskBitmap *bitmap = nextbitmap->data; size_t k; /* don't migrate into existing bitmaps */ @@ -2707,13 +2707,13 @@ qemuMigrationDstPrepareAnyBlockDirtyBitmaps(virDomainObjPtr vm, static int -qemuMigrationDstPrepareAny(virQEMUDriverPtr driver, +qemuMigrationDstPrepareAny(virQEMUDriver *driver, virConnectPtr dconn, const char *cookiein, int cookieinlen, char **cookieout, int *cookieoutlen, - virDomainDefPtr *def, + virDomainDef **def, const char *origname, virStreamPtr st, const char *protocol, @@ -2724,23 +2724,23 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver, const char **migrate_disks, int nbdPort, const char *nbdURI, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, unsigned long flags) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - virDomainObjPtr vm = NULL; - virObjectEventPtr event = NULL; + virDomainObj *vm = NULL; + virObjectEvent *event = NULL; virErrorPtr origErr; int ret = -1; int dataFD[2] = { -1, -1 }; - qemuDomainObjPrivatePtr priv = NULL; - qemuMigrationCookiePtr mig = NULL; - qemuDomainJobPrivatePtr jobPriv = NULL; + qemuDomainObjPrivate *priv = NULL; + qemuMigrationCookie *mig = NULL; + qemuDomainJobPrivate *jobPriv = NULL; bool tunnel = !!st; g_autofree char *xmlout = NULL; unsigned int cookieFlags; unsigned int startFlags; - qemuProcessIncomingDefPtr incoming = NULL; + qemuProcessIncomingDef *incoming = NULL; bool taint_hook = false; bool stopProcess = false; bool relabel = false; @@ -3100,16 +3100,16 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver, * sets up the corresponding virStream to handle the incoming data. */ int -qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driver, +qemuMigrationDstPrepareTunnel(virQEMUDriver *driver, virConnectPtr dconn, const char *cookiein, int cookieinlen, char **cookieout, int *cookieoutlen, virStreamPtr st, - virDomainDefPtr *def, + virDomainDef **def, const char *origname, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, unsigned long flags) { VIR_DEBUG("driver=%p, dconn=%p, cookiein=%s, cookieinlen=%d, " @@ -3131,11 +3131,11 @@ qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driver, } -static virURIPtr +static virURI * qemuMigrationAnyParseURI(const char *uri, bool *wellFormed) { char *tmp = NULL; - virURIPtr parsed; + virURI *parsed; /* For compatibility reasons tcp://... URIs are sent as tcp:... * We need to transform them to a well-formed URI before parsing. */ @@ -3154,7 +3154,7 @@ qemuMigrationAnyParseURI(const char *uri, bool *wellFormed) int -qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver, +qemuMigrationDstPrepareDirect(virQEMUDriver *driver, virConnectPtr dconn, const char *cookiein, int cookieinlen, @@ -3162,14 +3162,14 @@ qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver, int *cookieoutlen, const char *uri_in, char **uri_out, - virDomainDefPtr *def, + virDomainDef **def, const char *origname, const char *listenAddress, size_t nmigrate_disks, const char **migrate_disks, int nbdPort, const char *nbdURI, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, unsigned long flags) { unsigned short port = 0; @@ -3309,14 +3309,14 @@ qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver, } -virDomainDefPtr -qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, +virDomainDef * +qemuMigrationAnyPrepareDef(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, const char *dom_xml, const char *dname, char **origname) { - virDomainDefPtr def; + virDomainDef *def; char *name = NULL; if (!dom_xml) { @@ -3346,19 +3346,19 @@ qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver, static int -qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcConfirmPhase(virQEMUDriver *driver, + virDomainObj *vm, const char *cookiein, int cookieinlen, unsigned int flags, int retcode) { g_autoptr(qemuMigrationCookie) mig = NULL; - virObjectEventPtr event; + virObjectEvent *event; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; - qemuDomainJobInfoPtr jobInfo = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; + qemuDomainJobInfo *jobInfo = NULL; VIR_DEBUG("driver=%p, vm=%p, cookiein=%s, cookieinlen=%d, " "flags=0x%x, retcode=%d", @@ -3453,8 +3453,8 @@ qemuMigrationSrcConfirmPhase(virQEMUDriverPtr driver, } int -qemuMigrationSrcConfirm(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcConfirm(virQEMUDriver *driver, + virDomainObj *vm, const char *cookiein, int cookieinlen, unsigned int flags, @@ -3509,7 +3509,6 @@ enum qemuMigrationForwardType { }; typedef struct _qemuMigrationSpec qemuMigrationSpec; -typedef qemuMigrationSpec *qemuMigrationSpecPtr; struct _qemuMigrationSpec { enum qemuMigrationDestinationType destType; union { @@ -3538,7 +3537,6 @@ struct _qemuMigrationSpec { #define TUNNEL_SEND_BUF_SIZE 65536 typedef struct _qemuMigrationIOThread qemuMigrationIOThread; -typedef qemuMigrationIOThread *qemuMigrationIOThreadPtr; struct _qemuMigrationIOThread { virThread thread; virStreamPtr st; @@ -3550,7 +3548,7 @@ struct _qemuMigrationIOThread { static void qemuMigrationSrcIOFunc(void *arg) { - qemuMigrationIOThreadPtr data = arg; + qemuMigrationIOThread *data = arg; char *buffer = NULL; struct pollfd fds[2]; int timeout = -1; @@ -3653,11 +3651,11 @@ static void qemuMigrationSrcIOFunc(void *arg) } -static qemuMigrationIOThreadPtr +static qemuMigrationIOThread * qemuMigrationSrcStartTunnel(virStreamPtr st, int sock) { - qemuMigrationIOThreadPtr io = NULL; + qemuMigrationIOThread *io = NULL; int wakeupFD[2] = { -1, -1 }; if (virPipe(wakeupFD) < 0) @@ -3690,7 +3688,7 @@ qemuMigrationSrcStartTunnel(virStreamPtr st, } static int -qemuMigrationSrcStopTunnel(qemuMigrationIOThreadPtr io, bool error) +qemuMigrationSrcStopTunnel(qemuMigrationIOThread *io, bool error) { int rv = -1; char stop = error ? 1 : 0; @@ -3724,11 +3722,11 @@ qemuMigrationSrcStopTunnel(qemuMigrationIOThreadPtr io, bool error) } static int -qemuMigrationSrcConnect(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuMigrationSpecPtr spec) +qemuMigrationSrcConnect(virQEMUDriver *driver, + virDomainObj *vm, + qemuMigrationSpec *spec) { - virNetSocketPtr sock; + virNetSocket *sock; g_autofree char *port = NULL; int fd_qemu = -1; int ret = -1; @@ -3785,12 +3783,12 @@ qemuMigrationSrcConnect(virQEMUDriverPtr driver, static int -qemuMigrationSrcContinue(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcContinue(virQEMUDriver *driver, + virDomainObj *vm, qemuMonitorMigrationStatus status, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret; if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) @@ -3806,10 +3804,10 @@ qemuMigrationSrcContinue(virQEMUDriverPtr driver, static int -qemuMigrationSetDBusVMState(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuMigrationSetDBusVMState(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (priv->dbusVMStateIds) { int rv; @@ -3850,13 +3848,13 @@ qemuMigrationSetDBusVMState(virQEMUDriverPtr driver, * bitmaps for deletion on failed migration. */ static int -qemuMigrationSrcRunPrepareBlockDirtyBitmapsMerge(virDomainObjPtr vm, - qemuMigrationCookiePtr mig) +qemuMigrationSrcRunPrepareBlockDirtyBitmapsMerge(virDomainObj *vm, + qemuMigrationCookie *mig) { g_autoslist(qemuDomainJobPrivateMigrateTempBitmap) tmpbitmaps = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(virJSONValue) actions = virJSONValueNewArray(); g_autoptr(GHashTable) blockNamedNodeData = NULL; GSList *nextdisk; @@ -3866,7 +3864,7 @@ qemuMigrationSrcRunPrepareBlockDirtyBitmapsMerge(virDomainObjPtr vm, return -1; for (nextdisk = mig->blockDirtyBitmaps; nextdisk; nextdisk = nextdisk->next) { - qemuMigrationBlockDirtyBitmapsDiskPtr disk = nextdisk->data; + qemuMigrationBlockDirtyBitmapsDisk *disk = nextdisk->data; GSList *nextbitmap; /* if a disk doesn't have a backing chain we don't need the code below */ @@ -3874,14 +3872,14 @@ qemuMigrationSrcRunPrepareBlockDirtyBitmapsMerge(virDomainObjPtr vm, continue; for (nextbitmap = disk->bitmaps; nextbitmap; nextbitmap = nextbitmap->next) { - qemuMigrationBlockDirtyBitmapsDiskBitmapPtr bitmap = nextbitmap->data; - qemuDomainJobPrivateMigrateTempBitmapPtr tmpbmp; - virStorageSourcePtr n; + qemuMigrationBlockDirtyBitmapsDiskBitmap *bitmap = nextbitmap->data; + qemuDomainJobPrivateMigrateTempBitmap *tmpbmp; + virStorageSource *n; unsigned long long granularity = 0; g_autoptr(virJSONValue) merge = virJSONValueNewArray(); for (n = disk->disk->src; virStorageSourceIsBacking(n); n = n->backingStore) { - qemuBlockNamedNodeDataBitmapPtr b; + qemuBlockNamedNodeDataBitmap *b; if (!(b = qemuBlockNamedNodeDataGetBitmapByName(blockNamedNodeData, n, bitmap->bitmapname))) @@ -3943,9 +3941,9 @@ qemuMigrationSrcRunPrepareBlockDirtyBitmapsMerge(virDomainObjPtr vm, * for bitmaps. */ static int -qemuMigrationSrcRunPrepareBlockDirtyBitmaps(virDomainObjPtr vm, - qemuMigrationCookiePtr mig, - qemuMigrationParamsPtr migParams, +qemuMigrationSrcRunPrepareBlockDirtyBitmaps(virDomainObj *vm, + qemuMigrationCookie *mig, + qemuMigrationParams *migParams, unsigned int flags) { @@ -3975,8 +3973,8 @@ qemuMigrationSrcRunPrepareBlockDirtyBitmaps(virDomainObjPtr vm, static int -qemuMigrationSrcRun(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcRun(virQEMUDriver *driver, + virDomainObj *vm, const char *persist_xml, const char *cookiein, int cookieinlen, @@ -3984,20 +3982,20 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver, int *cookieoutlen, unsigned long flags, unsigned long resource, - qemuMigrationSpecPtr spec, + qemuMigrationSpec *spec, virConnectPtr dconn, const char *graphicsuri, size_t nmigrate_disks, const char **migrate_disks, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, const char *nbdURI) { int ret = -1; unsigned int migrate_flags = QEMU_MONITOR_MIGRATE_BACKGROUND; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(qemuMigrationCookie) mig = NULL; g_autofree char *tlsAlias = NULL; - qemuMigrationIOThreadPtr iothread = NULL; + qemuMigrationIOThread *iothread = NULL; VIR_AUTOCLOSE fd = -1; unsigned long migrate_speed = resource ? resource : priv->migMaxBandwidth; virErrorPtr orig_err = NULL; @@ -4054,7 +4052,7 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver, NULL, NULL))) goto error; } else { - virDomainDefPtr def = vm->newDef ? vm->newDef : vm->def; + virDomainDef *def = vm->newDef ? vm->newDef : vm->def; if (!(persistDef = qemuDomainDefCopy(driver, priv->qemuCaps, def, VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_MIGRATABLE))) @@ -4304,7 +4302,7 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver, } if (iothread) { - qemuMigrationIOThreadPtr io; + qemuMigrationIOThread *io; io = g_steal_pointer(&iothread); if (qemuMigrationSrcStopTunnel(io, false) < 0) @@ -4376,8 +4374,8 @@ qemuMigrationSrcRun(virQEMUDriverPtr driver, * not encrypted obviously */ static int -qemuMigrationSrcPerformNative(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcPerformNative(virQEMUDriver *driver, + virDomainObj *vm, const char *persist_xml, const char *uri, const char *cookiein, @@ -4390,10 +4388,10 @@ qemuMigrationSrcPerformNative(virQEMUDriverPtr driver, const char *graphicsuri, size_t nmigrate_disks, const char **migrate_disks, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, const char *nbdURI) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virURI) uribits = NULL; int ret = -1; qemuMigrationSpec spec; @@ -4474,8 +4472,8 @@ qemuMigrationSrcPerformNative(virQEMUDriverPtr driver, static int -qemuMigrationSrcPerformTunnel(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcPerformTunnel(virQEMUDriver *driver, + virDomainObj *vm, virStreamPtr st, const char *persist_xml, const char *cookiein, @@ -4488,7 +4486,7 @@ qemuMigrationSrcPerformTunnel(virQEMUDriverPtr driver, const char *graphicsuri, size_t nmigrate_disks, const char **migrate_disks, - qemuMigrationParamsPtr migParams) + qemuMigrationParams *migParams) { int ret = -1; qemuMigrationSpec spec; @@ -4541,15 +4539,15 @@ qemuMigrationSrcPerformTunnel(virQEMUDriverPtr driver, * instead of client app context & also adding in tunnel * handling */ static int -qemuMigrationSrcPerformPeer2Peer2(virQEMUDriverPtr driver, +qemuMigrationSrcPerformPeer2Peer2(virQEMUDriver *driver, virConnectPtr sconn, virConnectPtr dconn, - virDomainObjPtr vm, + virDomainObj *vm, const char *dconnuri, unsigned long flags, const char *dname, unsigned long resource, - qemuMigrationParamsPtr migParams) + qemuMigrationParams *migParams) { virDomainPtr ddomain = NULL; char *uri_out = NULL; @@ -4682,11 +4680,11 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriverPtr driver, * instead of client app context & also adding in tunnel * handling */ static int -qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr driver, +qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver, virConnectPtr sconn, virConnectPtr dconn, const char *dconnuri, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlin, const char *persist_xml, const char *dname, @@ -4697,7 +4695,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriverPtr driver, const char **migrate_disks, int nbdPort, const char *nbdURI, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, unsigned long long bandwidth, bool useParams, unsigned long flags) @@ -5026,7 +5024,7 @@ qemuMigrationSrcConnectionClosed(virConnectPtr conn, int reason, void *opaque) { - virDomainObjPtr vm = opaque; + virDomainObj *vm = opaque; VIR_DEBUG("conn=%p, reason=%d, vm=%s", conn, reason, vm->def->name); virDomainObjBroadcast(vm); @@ -5046,9 +5044,9 @@ static virConnectAuth virConnectAuthConfig = { static int -qemuMigrationSrcPerformPeer2Peer(virQEMUDriverPtr driver, +qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver, virConnectPtr sconn, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlin, const char *persist_xml, const char *dconnuri, @@ -5059,7 +5057,7 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriverPtr driver, const char **migrate_disks, int nbdPort, const char *nbdURI, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, unsigned long flags, const char *dname, unsigned long resource, @@ -5214,9 +5212,9 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriverPtr driver, * perform phase of v2 non-peer2peer migration. */ static int -qemuMigrationSrcPerformJob(virQEMUDriverPtr driver, +qemuMigrationSrcPerformJob(virQEMUDriver *driver, virConnectPtr conn, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlin, const char *persist_xml, const char *dconnuri, @@ -5227,7 +5225,7 @@ qemuMigrationSrcPerformJob(virQEMUDriverPtr driver, const char **migrate_disks, int nbdPort, const char *nbdURI, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, const char *cookiein, int cookieinlen, char **cookieout, @@ -5237,12 +5235,12 @@ qemuMigrationSrcPerformJob(virQEMUDriverPtr driver, unsigned long resource, bool v3proto) { - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; int ret = -1; virErrorPtr orig_err = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; if (qemuMigrationJobStart(driver, vm, QEMU_ASYNC_JOB_MIGRATION_OUT, flags) < 0) @@ -5325,15 +5323,15 @@ qemuMigrationSrcPerformJob(virQEMUDriverPtr driver, * This implements perform phase of v3 migration protocol. */ static int -qemuMigrationSrcPerformPhase(virQEMUDriverPtr driver, +qemuMigrationSrcPerformPhase(virQEMUDriver *driver, virConnectPtr conn, - virDomainObjPtr vm, + virDomainObj *vm, const char *persist_xml, const char *uri, const char *graphicsuri, size_t nmigrate_disks, const char **migrate_disks, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, const char *cookiein, int cookieinlen, char **cookieout, @@ -5342,8 +5340,8 @@ qemuMigrationSrcPerformPhase(virQEMUDriverPtr driver, unsigned long resource, const char *nbdURI) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; int ret = -1; /* If we didn't start the job in the begin phase, start it now. */ @@ -5391,9 +5389,9 @@ qemuMigrationSrcPerformPhase(virQEMUDriverPtr driver, } int -qemuMigrationSrcPerform(virQEMUDriverPtr driver, +qemuMigrationSrcPerform(virQEMUDriver *driver, virConnectPtr conn, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlin, const char *persist_xml, const char *dconnuri, @@ -5404,7 +5402,7 @@ qemuMigrationSrcPerform(virQEMUDriverPtr driver, const char **migrate_disks, int nbdPort, const char *nbdURI, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, const char *cookiein, int cookieinlen, char **cookieout, @@ -5478,11 +5476,11 @@ qemuMigrationSrcPerform(virQEMUDriverPtr driver, } static int -qemuMigrationDstVPAssociatePortProfiles(virDomainDefPtr def) +qemuMigrationDstVPAssociatePortProfiles(virDomainDef *def) { size_t i; int last_good_net = -1; - virDomainNetDefPtr net; + virDomainNetDef *net; for (i = 0; i < def->nnets; i++) { net = def->nets[i]; @@ -5530,17 +5528,17 @@ qemuMigrationDstVPAssociatePortProfiles(virDomainDefPtr def) static int -qemuMigrationDstPersist(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuMigrationCookiePtr mig, +qemuMigrationDstPersist(virQEMUDriver *driver, + virDomainObj *vm, + qemuMigrationCookie *mig, bool ignoreSaveError) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainDefPtr vmdef; + qemuDomainObjPrivate *priv = vm->privateData; + virDomainDef *vmdef; g_autoptr(virDomainDef) oldDef = NULL; unsigned int oldPersist = vm->persistent; - virObjectEventPtr event; + virObjectEvent *event; vm->persistent = 1; oldDef = vm->newDef; @@ -5576,9 +5574,9 @@ qemuMigrationDstPersist(virQEMUDriverPtr driver, virDomainPtr -qemuMigrationDstFinish(virQEMUDriverPtr driver, +qemuMigrationDstFinish(virQEMUDriver *driver, virConnectPtr dconn, - virDomainObjPtr vm, + virDomainObj *vm, const char *cookiein, int cookieinlen, char **cookieout, @@ -5591,13 +5589,13 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver, g_autoptr(qemuMigrationCookie) mig = NULL; virErrorPtr orig_err = NULL; int cookie_flags = 0; - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); unsigned short port; unsigned long long timeReceived = 0; - virObjectEventPtr event; - qemuDomainJobInfoPtr jobInfo = NULL; + virObjectEvent *event; + qemuDomainJobInfo *jobInfo = NULL; bool inPostCopy = false; bool doKill = true; @@ -5872,12 +5870,12 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver, /* Helper function called while vm is active. */ int -qemuMigrationSrcToFile(virQEMUDriverPtr driver, virDomainObjPtr vm, +qemuMigrationSrcToFile(virQEMUDriver *driver, virDomainObj *vm, int fd, - virCommandPtr compressor, + virCommand *compressor, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool bwParam = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_PARAM_BANDWIDTH); int rc; int ret = -1; @@ -6023,10 +6021,10 @@ qemuMigrationSrcToFile(virQEMUDriverPtr driver, virDomainObjPtr vm, int -qemuMigrationSrcCancel(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuMigrationSrcCancel(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool storage = false; size_t i; @@ -6039,9 +6037,9 @@ qemuMigrationSrcCancel(virQEMUDriverPtr driver, return -1; for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); - qemuBlockJobDataPtr job; + virDomainDiskDef *disk = vm->def->disks[i]; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuBlockJobData *job; if (!(job = qemuBlockJobDiskGetJob(disk)) || !qemuBlockJobIsRunning(job)) @@ -6068,12 +6066,12 @@ qemuMigrationSrcCancel(virQEMUDriverPtr driver, static int -qemuMigrationJobStart(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationJobStart(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob job, unsigned long apiFlags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainJobOperation op; unsigned long long mask; @@ -6097,11 +6095,11 @@ qemuMigrationJobStart(virQEMUDriverPtr driver, } static void -qemuMigrationJobSetPhase(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationJobSetPhase(virQEMUDriver *driver, + virDomainObj *vm, qemuMigrationJobPhase phase) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (phase < priv->job.phase) { VIR_ERROR(_("migration protocol going backwards %s => %s"), @@ -6114,24 +6112,24 @@ qemuMigrationJobSetPhase(virQEMUDriverPtr driver, } static void -qemuMigrationJobStartPhase(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationJobStartPhase(virQEMUDriver *driver, + virDomainObj *vm, qemuMigrationJobPhase phase) { qemuMigrationJobSetPhase(driver, vm, phase); } static void -qemuMigrationJobContinue(virDomainObjPtr vm) +qemuMigrationJobContinue(virDomainObj *vm) { qemuDomainObjReleaseAsyncJob(vm); } static bool -qemuMigrationJobIsActive(virDomainObjPtr vm, +qemuMigrationJobIsActive(virDomainObj *vm, qemuDomainAsyncJob job) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (priv->job.asyncJob != job) { const char *msg; @@ -6148,7 +6146,7 @@ qemuMigrationJobIsActive(virDomainObjPtr vm, } static void -qemuMigrationJobFinish(virQEMUDriverPtr driver, virDomainObjPtr vm) +qemuMigrationJobFinish(virQEMUDriver *driver, virDomainObj *vm) { qemuDomainObjEndAsyncJob(driver, vm); } @@ -6162,7 +6160,7 @@ qemuMigrationDstErrorFree(void *data) } int -qemuMigrationDstErrorInit(virQEMUDriverPtr driver) +qemuMigrationDstErrorInit(virQEMUDriver *driver) { driver->migrationErrors = virHashAtomicNew(qemuMigrationDstErrorFree); if (driver->migrationErrors) @@ -6176,7 +6174,7 @@ qemuMigrationDstErrorInit(virQEMUDriverPtr driver) * invalid after calling this function. */ void -qemuMigrationDstErrorSave(virQEMUDriverPtr driver, +qemuMigrationDstErrorSave(virQEMUDriver *driver, const char *name, virErrorPtr err) { @@ -6192,7 +6190,7 @@ qemuMigrationDstErrorSave(virQEMUDriverPtr driver, } void -qemuMigrationDstErrorReport(virQEMUDriverPtr driver, +qemuMigrationDstErrorReport(virQEMUDriver *driver, const char *name) { virErrorPtr err; @@ -6207,19 +6205,19 @@ qemuMigrationDstErrorReport(virQEMUDriverPtr driver, int -qemuMigrationSrcFetchMirrorStats(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcFetchMirrorStats(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - qemuDomainJobInfoPtr jobInfo) + qemuDomainJobInfo *jobInfo) { size_t i; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool nbd = false; GHashTable *blockinfo = NULL; - qemuDomainMirrorStatsPtr stats = &jobInfo->mirrorStats; + qemuDomainMirrorStats *stats = &jobInfo->mirrorStats; for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; + virDomainDiskDef *disk = vm->def->disks[i]; if (QEMU_DOMAIN_DISK_PRIVATE(disk)->migrating) { nbd = true; break; @@ -6240,9 +6238,9 @@ qemuMigrationSrcFetchMirrorStats(virQEMUDriverPtr driver, memset(stats, 0, sizeof(*stats)); for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); - qemuMonitorBlockJobInfoPtr data; + virDomainDiskDef *disk = vm->def->disks[i]; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + qemuMonitorBlockJobInfo *data; if (!diskPriv->migrating || !(data = virHashLookup(blockinfo, disk->info.alias))) diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h index fd9eb7cab0..dd74f8bc88 100644 --- a/src/qemu/qemu_migration.h +++ b/src/qemu/qemu_migration.h @@ -106,7 +106,7 @@ VIR_ENUM_DECL(qemuMigrationJobPhase); char * qemuMigrationSrcBegin(virConnectPtr conn, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlin, const char *dname, char **cookieout, @@ -115,28 +115,28 @@ qemuMigrationSrcBegin(virConnectPtr conn, const char **migrate_disks, unsigned long flags); -virDomainDefPtr -qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, +virDomainDef * +qemuMigrationAnyPrepareDef(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, const char *dom_xml, const char *dname, char **origname); int -qemuMigrationDstPrepareTunnel(virQEMUDriverPtr driver, +qemuMigrationDstPrepareTunnel(virQEMUDriver *driver, virConnectPtr dconn, const char *cookiein, int cookieinlen, char **cookieout, int *cookieoutlen, virStreamPtr st, - virDomainDefPtr *def, + virDomainDef **def, const char *origname, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, unsigned long flags); int -qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver, +qemuMigrationDstPrepareDirect(virQEMUDriver *driver, virConnectPtr dconn, const char *cookiein, int cookieinlen, @@ -144,20 +144,20 @@ qemuMigrationDstPrepareDirect(virQEMUDriverPtr driver, int *cookieoutlen, const char *uri_in, char **uri_out, - virDomainDefPtr *def, + virDomainDef **def, const char *origname, const char *listenAddress, size_t nmigrate_disks, const char **migrate_disks, int nbdPort, const char *nbdURI, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, unsigned long flags); int -qemuMigrationSrcPerform(virQEMUDriverPtr driver, +qemuMigrationSrcPerform(virQEMUDriver *driver, virConnectPtr conn, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlin, const char *persist_xml, const char *dconnuri, @@ -168,7 +168,7 @@ qemuMigrationSrcPerform(virQEMUDriverPtr driver, const char **migrate_disks, int nbdPort, const char *nbdURI, - qemuMigrationParamsPtr migParams, + qemuMigrationParams *migParams, const char *cookiein, int cookieinlen, char **cookieout, @@ -179,9 +179,9 @@ qemuMigrationSrcPerform(virQEMUDriverPtr driver, bool v3proto); virDomainPtr -qemuMigrationDstFinish(virQEMUDriverPtr driver, +qemuMigrationDstFinish(virQEMUDriver *driver, virConnectPtr dconn, - virDomainObjPtr vm, + virDomainObj *vm, const char *cookiein, int cookieinlen, char **cookieout, @@ -191,52 +191,52 @@ qemuMigrationDstFinish(virQEMUDriverPtr driver, bool v3proto); int -qemuMigrationSrcConfirm(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcConfirm(virQEMUDriver *driver, + virDomainObj *vm, const char *cookiein, int cookieinlen, unsigned int flags, int cancelled); bool -qemuMigrationSrcIsAllowed(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcIsAllowed(virQEMUDriver *driver, + virDomainObj *vm, bool remote, unsigned int flags); int -qemuMigrationSrcToFile(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcToFile(virQEMUDriver *driver, + virDomainObj *vm, int fd, - virCommandPtr compressor, + virCommand *compressor, qemuDomainAsyncJob asyncJob) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int -qemuMigrationSrcCancel(virQEMUDriverPtr driver, - virDomainObjPtr vm); +qemuMigrationSrcCancel(virQEMUDriver *driver, + virDomainObj *vm); int -qemuMigrationAnyFetchStats(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationAnyFetchStats(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - qemuDomainJobInfoPtr jobInfo, + qemuDomainJobInfo *jobInfo, char **error); int -qemuMigrationDstErrorInit(virQEMUDriverPtr driver); +qemuMigrationDstErrorInit(virQEMUDriver *driver); void -qemuMigrationDstErrorSave(virQEMUDriverPtr driver, +qemuMigrationDstErrorSave(virQEMUDriver *driver, const char *name, virErrorPtr err); void -qemuMigrationDstErrorReport(virQEMUDriverPtr driver, +qemuMigrationDstErrorReport(virQEMUDriver *driver, const char *name); int -qemuMigrationDstCheckProtocol(virQEMUCapsPtr qemuCaps, +qemuMigrationDstCheckProtocol(virQEMUCaps *qemuCaps, const char *migrateFrom); char * @@ -244,17 +244,17 @@ qemuMigrationDstGetURI(const char *migrateFrom, int migrateFd); int -qemuMigrationDstRun(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationDstRun(virQEMUDriver *driver, + virDomainObj *vm, const char *uri, qemuDomainAsyncJob asyncJob); void -qemuMigrationAnyPostcopyFailed(virQEMUDriverPtr driver, - virDomainObjPtr vm); +qemuMigrationAnyPostcopyFailed(virQEMUDriver *driver, + virDomainObj *vm); int -qemuMigrationSrcFetchMirrorStats(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationSrcFetchMirrorStats(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - qemuDomainJobInfoPtr jobInfo); + qemuDomainJobInfo *jobInfo); diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c index 15eaf994a9..41533e4549 100644 --- a/src/qemu/qemu_migration_cookie.c +++ b/src/qemu/qemu_migration_cookie.c @@ -56,7 +56,7 @@ VIR_ENUM_IMPL(qemuMigrationCookieFlag, static void -qemuMigrationCookieGraphicsFree(qemuMigrationCookieGraphicsPtr grap) +qemuMigrationCookieGraphicsFree(qemuMigrationCookieGraphics *grap) { if (!grap) return; @@ -70,7 +70,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookieGraphics, static void -qemuMigrationCookieNetworkFree(qemuMigrationCookieNetworkPtr network) +qemuMigrationCookieNetworkFree(qemuMigrationCookieNetwork *network) { size_t i; @@ -89,7 +89,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookieNetwork, qemuMigrationCookieNetworkFree); static void -qemuMigrationCookieNBDFree(qemuMigrationCookieNBDPtr nbd) +qemuMigrationCookieNBDFree(qemuMigrationCookieNBD *nbd) { if (!nbd) return; @@ -104,7 +104,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookieNBD, qemuMigrationCookieNBDFree); static void -qemuMigrationCookieCapsFree(qemuMigrationCookieCapsPtr caps) +qemuMigrationCookieCapsFree(qemuMigrationCookieCaps *caps) { if (!caps) return; @@ -118,7 +118,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookieCaps, qemuMigrationCookieCapsFree); static void -qemuMigrationBlockDirtyBitmapsDiskBitmapFree(qemuMigrationBlockDirtyBitmapsDiskBitmapPtr bmp) +qemuMigrationBlockDirtyBitmapsDiskBitmapFree(qemuMigrationBlockDirtyBitmapsDiskBitmap *bmp) { if (!bmp) return; @@ -134,7 +134,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationBlockDirtyBitmapsDiskBitmap, static void -qemuMigrationBlockDirtyBitmapsDiskFree(qemuMigrationBlockDirtyBitmapsDiskPtr dsk) +qemuMigrationBlockDirtyBitmapsDiskFree(qemuMigrationBlockDirtyBitmapsDisk *dsk) { if (!dsk) return; @@ -151,7 +151,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationBlockDirtyBitmapsDisk, void -qemuMigrationCookieFree(qemuMigrationCookiePtr mig) +qemuMigrationCookieFree(qemuMigrationCookie *mig) { if (!mig) return; @@ -224,10 +224,10 @@ qemuDomainExtractTLSSubject(const char *certdir) } -static qemuMigrationCookieGraphicsPtr -qemuMigrationCookieGraphicsSpiceAlloc(virQEMUDriverPtr driver, - virDomainGraphicsDefPtr def, - virDomainGraphicsListenDefPtr glisten) +static qemuMigrationCookieGraphics * +qemuMigrationCookieGraphicsSpiceAlloc(virQEMUDriver *driver, + virDomainGraphicsDef *def, + virDomainGraphicsListenDef *glisten) { g_autoptr(qemuMigrationCookieGraphics) mig = g_new0(qemuMigrationCookieGraphics, 1); const char *listenAddr; @@ -253,9 +253,9 @@ qemuMigrationCookieGraphicsSpiceAlloc(virQEMUDriverPtr driver, } -static qemuMigrationCookieNetworkPtr -qemuMigrationCookieNetworkAlloc(virQEMUDriverPtr driver G_GNUC_UNUSED, - virDomainDefPtr def) +static qemuMigrationCookieNetwork * +qemuMigrationCookieNetworkAlloc(virQEMUDriver *driver G_GNUC_UNUSED, + virDomainDef *def) { g_autoptr(qemuMigrationCookieNetwork) mig = g_new0(qemuMigrationCookieNetwork, 1); size_t i; @@ -264,7 +264,7 @@ qemuMigrationCookieNetworkAlloc(virQEMUDriverPtr driver G_GNUC_UNUSED, mig->net = g_new0(qemuMigrationCookieNetData, def->nnets); for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr netptr; + virDomainNetDef *netptr; const virNetDevVPortProfile *vport; netptr = def->nets[i]; @@ -296,11 +296,11 @@ qemuMigrationCookieNetworkAlloc(virQEMUDriverPtr driver G_GNUC_UNUSED, } -qemuMigrationCookiePtr +qemuMigrationCookie * qemuMigrationCookieNew(const virDomainDef *def, const char *origname) { - qemuMigrationCookiePtr mig = NULL; + qemuMigrationCookie *mig = NULL; unsigned char localHostUUID[VIR_UUID_BUFLEN]; g_autofree char *localHostname = NULL; @@ -329,9 +329,9 @@ qemuMigrationCookieNew(const virDomainDef *def, static int -qemuMigrationCookieAddGraphics(qemuMigrationCookiePtr mig, - virQEMUDriverPtr driver, - virDomainObjPtr dom) +qemuMigrationCookieAddGraphics(qemuMigrationCookie *mig, + virQEMUDriver *driver, + virDomainObj *dom) { size_t i = 0; @@ -343,7 +343,7 @@ qemuMigrationCookieAddGraphics(qemuMigrationCookiePtr mig, for (i = 0; i < dom->def->ngraphics; i++) { if (dom->def->graphics[i]->type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE) { - virDomainGraphicsListenDefPtr glisten = + virDomainGraphicsListenDef *glisten = virDomainGraphicsGetListen(dom->def->graphics[i], 0); if (!glisten) { @@ -382,11 +382,11 @@ qemuMigrationCookieAddGraphics(qemuMigrationCookiePtr mig, static int -qemuMigrationCookieAddLockstate(qemuMigrationCookiePtr mig, - virQEMUDriverPtr driver, - virDomainObjPtr dom) +qemuMigrationCookieAddLockstate(qemuMigrationCookie *mig, + virQEMUDriver *driver, + virDomainObj *dom) { - qemuDomainObjPrivatePtr priv = dom->privateData; + qemuDomainObjPrivate *priv = dom->privateData; if (mig->flags & QEMU_MIGRATION_COOKIE_LOCKSTATE) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -411,8 +411,8 @@ qemuMigrationCookieAddLockstate(qemuMigrationCookiePtr mig, int -qemuMigrationCookieAddPersistent(qemuMigrationCookiePtr mig, - virDomainDefPtr *def) +qemuMigrationCookieAddPersistent(qemuMigrationCookie *mig, + virDomainDef **def) { if (mig->flags & QEMU_MIGRATION_COOKIE_PERSISTENT) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -430,10 +430,10 @@ qemuMigrationCookieAddPersistent(qemuMigrationCookiePtr mig, } -virDomainDefPtr -qemuMigrationCookieGetPersistent(qemuMigrationCookiePtr mig) +virDomainDef * +qemuMigrationCookieGetPersistent(qemuMigrationCookie *mig) { - virDomainDefPtr def = mig->persistent; + virDomainDef *def = mig->persistent; mig->persistent = NULL; mig->flags &= ~QEMU_MIGRATION_COOKIE_PERSISTENT; @@ -444,9 +444,9 @@ qemuMigrationCookieGetPersistent(qemuMigrationCookiePtr mig) static int -qemuMigrationCookieAddNetwork(qemuMigrationCookiePtr mig, - virQEMUDriverPtr driver, - virDomainObjPtr dom) +qemuMigrationCookieAddNetwork(qemuMigrationCookie *mig, + virQEMUDriver *driver, + virDomainObj *dom) { if (mig->flags & QEMU_MIGRATION_COOKIE_NETWORK) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -466,11 +466,11 @@ qemuMigrationCookieAddNetwork(qemuMigrationCookiePtr mig, static int -qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig, - virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuMigrationCookieAddNBD(qemuMigrationCookie *mig, + virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(GHashTable) stats = virHashNew(g_free); bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); size_t i; @@ -500,7 +500,7 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig, return -1; for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; + virDomainDiskDef *disk = vm->def->disks[i]; qemuBlockStats *entry; if (blockdev) { @@ -522,10 +522,10 @@ qemuMigrationCookieAddNBD(qemuMigrationCookiePtr mig, static int -qemuMigrationCookieAddStatistics(qemuMigrationCookiePtr mig, - virDomainObjPtr vm) +qemuMigrationCookieAddStatistics(qemuMigrationCookie *mig, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!priv->job.completed) return 0; @@ -540,8 +540,8 @@ qemuMigrationCookieAddStatistics(qemuMigrationCookiePtr mig, static int -qemuMigrationCookieAddCPU(qemuMigrationCookiePtr mig, - virDomainObjPtr vm) +qemuMigrationCookieAddCPU(qemuMigrationCookie *mig, + virDomainObj *vm) { if (mig->cpu) return 0; @@ -559,10 +559,10 @@ qemuMigrationCookieAddCPU(qemuMigrationCookiePtr mig, static void -qemuMigrationCookieAddAllowReboot(qemuMigrationCookiePtr mig, - virDomainObjPtr vm) +qemuMigrationCookieAddAllowReboot(qemuMigrationCookie *mig, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; mig->allowReboot = priv->allowReboot; @@ -571,11 +571,11 @@ qemuMigrationCookieAddAllowReboot(qemuMigrationCookiePtr mig, static int -qemuMigrationCookieAddCaps(qemuMigrationCookiePtr mig, - virDomainObjPtr vm, +qemuMigrationCookieAddCaps(qemuMigrationCookie *mig, + virDomainObj *vm, qemuMigrationParty party) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; qemuMigrationCookieCapsFree(mig->caps); mig->caps = g_new0(qemuMigrationCookieCaps, 1); @@ -594,8 +594,8 @@ qemuMigrationCookieAddCaps(qemuMigrationCookiePtr mig, static void -qemuMigrationCookieGraphicsXMLFormat(virBufferPtr buf, - qemuMigrationCookieGraphicsPtr grap) +qemuMigrationCookieGraphicsXMLFormat(virBuffer *buf, + qemuMigrationCookieGraphics *grap) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -614,8 +614,8 @@ qemuMigrationCookieGraphicsXMLFormat(virBufferPtr buf, static void -qemuMigrationCookieNetworkXMLFormat(virBufferPtr buf, - qemuMigrationCookieNetworkPtr optr) +qemuMigrationCookieNetworkXMLFormat(virBuffer *buf, + qemuMigrationCookieNetwork *optr) { g_auto(virBuffer) interfaceBuf = VIR_BUFFER_INIT_CHILD(buf); size_t i; @@ -642,8 +642,8 @@ qemuMigrationCookieNetworkXMLFormat(virBufferPtr buf, static void -qemuMigrationCookieStatisticsXMLFormat(virBufferPtr buf, - qemuDomainJobInfoPtr jobInfo) +qemuMigrationCookieStatisticsXMLFormat(virBuffer *buf, + qemuDomainJobInfo *jobInfo) { qemuMonitorMigrationStats *stats = &jobInfo->stats.mig; @@ -748,8 +748,8 @@ qemuMigrationCookieStatisticsXMLFormat(virBufferPtr buf, static void -qemuMigrationCookieCapsXMLFormat(virBufferPtr buf, - qemuMigrationCookieCapsPtr caps) +qemuMigrationCookieCapsXMLFormat(virBuffer *buf, + qemuMigrationCookieCaps *caps) { qemuMigrationCapability cap; @@ -775,8 +775,8 @@ qemuMigrationCookieCapsXMLFormat(virBufferPtr buf, static void -qemuMigrationCookieNBDXMLFormat(qemuMigrationCookieNBDPtr nbd, - virBufferPtr buf) +qemuMigrationCookieNBDXMLFormat(qemuMigrationCookieNBD *nbd, + virBuffer *buf) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -795,14 +795,14 @@ qemuMigrationCookieNBDXMLFormat(qemuMigrationCookieNBDPtr nbd, static void -qemuMigrationCookieBlockDirtyBitmapsFormat(virBufferPtr buf, +qemuMigrationCookieBlockDirtyBitmapsFormat(virBuffer *buf, GSList *bitmaps) { g_auto(virBuffer) disksBuf = VIR_BUFFER_INIT_CHILD(buf); GSList *nextdisk; for (nextdisk = bitmaps; nextdisk; nextdisk = nextdisk->next) { - qemuMigrationBlockDirtyBitmapsDiskPtr disk = nextdisk->data; + qemuMigrationBlockDirtyBitmapsDisk *disk = nextdisk->data; g_auto(virBuffer) diskAttrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) diskChildBuf = VIR_BUFFER_INIT_CHILD(&disksBuf); bool hasBitmaps = false; @@ -812,7 +812,7 @@ qemuMigrationCookieBlockDirtyBitmapsFormat(virBufferPtr buf, continue; for (nextbitmap = disk->bitmaps; nextbitmap; nextbitmap = nextbitmap->next) { - qemuMigrationBlockDirtyBitmapsDiskBitmapPtr bitmap = nextbitmap->data; + qemuMigrationBlockDirtyBitmapsDiskBitmap *bitmap = nextbitmap->data; if (bitmap->skip) continue; @@ -837,10 +837,10 @@ qemuMigrationCookieBlockDirtyBitmapsFormat(virBufferPtr buf, int -qemuMigrationCookieXMLFormat(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virBufferPtr buf, - qemuMigrationCookiePtr mig) +qemuMigrationCookieXMLFormat(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virBuffer *buf, + qemuMigrationCookie *mig) { char uuidstr[VIR_UUID_STRING_BUFLEN]; char hostuuidstr[VIR_UUID_STRING_BUFLEN]; @@ -916,7 +916,7 @@ qemuMigrationCookieXMLFormat(virQEMUDriverPtr driver, } -static qemuMigrationCookieGraphicsPtr +static qemuMigrationCookieGraphics * qemuMigrationCookieGraphicsXMLParse(xmlXPathContextPtr ctxt) { g_autoptr(qemuMigrationCookieGraphics) grap = g_new0(qemuMigrationCookieGraphics, 1); @@ -956,7 +956,7 @@ qemuMigrationCookieGraphicsXMLParse(xmlXPathContextPtr ctxt) } -static qemuMigrationCookieNetworkPtr +static qemuMigrationCookieNetwork * qemuMigrationCookieNetworkXMLParse(xmlXPathContextPtr ctxt) { g_autoptr(qemuMigrationCookieNetwork) optr = g_new0(qemuMigrationCookieNetwork, 1); @@ -993,7 +993,7 @@ qemuMigrationCookieNetworkXMLParse(xmlXPathContextPtr ctxt) } -static qemuMigrationCookieNBDPtr +static qemuMigrationCookieNBD * qemuMigrationCookieNBDXMLParse(xmlXPathContextPtr ctxt) { g_autoptr(qemuMigrationCookieNBD) ret = g_new0(qemuMigrationCookieNBD, 1); @@ -1045,10 +1045,10 @@ qemuMigrationCookieNBDXMLParse(xmlXPathContextPtr ctxt) } -static qemuDomainJobInfoPtr +static qemuDomainJobInfo * qemuMigrationCookieStatisticsXMLParse(xmlXPathContextPtr ctxt) { - qemuDomainJobInfoPtr jobInfo = NULL; + qemuDomainJobInfo *jobInfo = NULL; qemuMonitorMigrationStats *stats; VIR_XPATH_NODE_AUTORESTORE(ctxt) @@ -1131,7 +1131,7 @@ qemuMigrationCookieStatisticsXMLParse(xmlXPathContextPtr ctxt) } -static qemuMigrationCookieCapsPtr +static qemuMigrationCookieCaps * qemuMigrationCookieCapsXMLParse(xmlXPathContextPtr ctxt) { g_autoptr(qemuMigrationCookieCaps) caps = g_new0(qemuMigrationCookieCaps, 1); @@ -1215,7 +1215,7 @@ qemuMigrationCookieXMLParseMandatoryFeatures(xmlXPathContextPtr ctxt, static int qemuMigrationCookieBlockDirtyBitmapsParse(xmlXPathContextPtr ctxt, - qemuMigrationCookiePtr mig) + qemuMigrationCookie *mig) { g_autoslist(qemuMigrationBlockDirtyBitmapsDisk) disks = NULL; g_autofree xmlNodePtr *disknodes = NULL; @@ -1228,7 +1228,7 @@ qemuMigrationCookieBlockDirtyBitmapsParse(xmlXPathContextPtr ctxt, for (i = 0; i < ndisknodes; i++) { g_autoslist(qemuMigrationBlockDirtyBitmapsDiskBitmap) bitmaps = NULL; - qemuMigrationBlockDirtyBitmapsDiskPtr disk; + qemuMigrationBlockDirtyBitmapsDisk *disk; g_autofree xmlNodePtr *bitmapnodes = NULL; int nbitmapnodes; size_t j; @@ -1239,7 +1239,7 @@ qemuMigrationCookieBlockDirtyBitmapsParse(xmlXPathContextPtr ctxt, return -1; for (j = 0; j < nbitmapnodes; j++) { - qemuMigrationBlockDirtyBitmapsDiskBitmapPtr bitmap; + qemuMigrationBlockDirtyBitmapsDiskBitmap *bitmap; bitmap = g_new0(qemuMigrationBlockDirtyBitmapsDiskBitmap, 1); bitmap->bitmapname = virXMLPropString(bitmapnodes[j], "name"); @@ -1273,9 +1273,9 @@ qemuMigrationCookieBlockDirtyBitmapsParse(xmlXPathContextPtr ctxt, static int -qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, - virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, +qemuMigrationCookieXMLParse(qemuMigrationCookie *mig, + virQEMUDriver *driver, + virQEMUCaps *qemuCaps, xmlDocPtr doc, xmlXPathContextPtr ctxt, unsigned int flags) @@ -1425,9 +1425,9 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig, static int -qemuMigrationCookieXMLParseStr(qemuMigrationCookiePtr mig, - virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, +qemuMigrationCookieXMLParseStr(qemuMigrationCookie *mig, + virQEMUDriver *driver, + virQEMUCaps *qemuCaps, const char *xml, unsigned int flags) { @@ -1451,15 +1451,15 @@ qemuMigrationCookieXMLParseStr(qemuMigrationCookiePtr mig, int -qemuMigrationCookieFormat(qemuMigrationCookiePtr mig, - virQEMUDriverPtr driver, - virDomainObjPtr dom, +qemuMigrationCookieFormat(qemuMigrationCookie *mig, + virQEMUDriver *driver, + virDomainObj *dom, qemuMigrationParty party, char **cookieout, int *cookieoutlen, unsigned int flags) { - qemuDomainObjPrivatePtr priv = dom->privateData; + qemuDomainObjPrivate *priv = dom->privateData; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; if (!cookieout || !cookieoutlen) @@ -1517,11 +1517,11 @@ qemuMigrationCookieFormat(qemuMigrationCookiePtr mig, } -qemuMigrationCookiePtr -qemuMigrationCookieParse(virQEMUDriverPtr driver, +qemuMigrationCookie * +qemuMigrationCookieParse(virQEMUDriver *driver, const virDomainDef *def, const char *origname, - qemuDomainObjPrivatePtr priv, + qemuDomainObjPrivate *priv, const char *cookiein, int cookieinlen, unsigned int flags) @@ -1584,19 +1584,19 @@ qemuMigrationCookieParse(virQEMUDriverPtr driver, /** * qemuMigrationCookieBlockDirtyBitmapsMatchDisks: * @def: domain definition - * @disks: list of qemuMigrationBlockDirtyBitmapsDiskPtr + * @disks: list of qemuMigrationBlockDirtyBitmapsDisk * * * Matches all of the @disks to the actual domain disk definition objects * by looking up the target. */ int -qemuMigrationCookieBlockDirtyBitmapsMatchDisks(virDomainDefPtr def, +qemuMigrationCookieBlockDirtyBitmapsMatchDisks(virDomainDef *def, GSList *disks) { GSList *next; for (next = disks; next; next = next->next) { - qemuMigrationBlockDirtyBitmapsDiskPtr disk = next->data; + qemuMigrationBlockDirtyBitmapsDisk *disk = next->data; if (!(disk->disk = virDomainDiskByTarget(def, disk->target))) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -1622,14 +1622,14 @@ qemuMigrationCookieBlockDirtyBitmapsMatchDisks(virDomainDefPtr def, */ int qemuMigrationCookieBlockDirtyBitmapsToParams(GSList *disks, - virJSONValuePtr *mapping) + virJSONValue **mapping) { g_autoptr(virJSONValue) map = virJSONValueNewArray(); bool hasDisks = false; GSList *nextdisk; for (nextdisk = disks; nextdisk; nextdisk = nextdisk->next) { - qemuMigrationBlockDirtyBitmapsDiskPtr disk = nextdisk->data; + qemuMigrationBlockDirtyBitmapsDisk *disk = nextdisk->data; g_autoptr(virJSONValue) jsondisk = NULL; g_autoptr(virJSONValue) jsonbitmaps = virJSONValueNewArray(); bool hasBitmaps = false; @@ -1639,7 +1639,7 @@ qemuMigrationCookieBlockDirtyBitmapsToParams(GSList *disks, continue; for (nextbitmap = disk->bitmaps; nextbitmap; nextbitmap = nextbitmap->next) { - qemuMigrationBlockDirtyBitmapsDiskBitmapPtr bitmap = nextbitmap->data; + qemuMigrationBlockDirtyBitmapsDiskBitmap *bitmap = nextbitmap->data; g_autoptr(virJSONValue) jsonbitmap = NULL; g_autoptr(virJSONValue) transform = NULL; const char *bitmapname = bitmap->sourcebitmap; diff --git a/src/qemu/qemu_migration_cookie.h b/src/qemu/qemu_migration_cookie.h index e50dee7ba7..6ac7b2084c 100644 --- a/src/qemu/qemu_migration_cookie.h +++ b/src/qemu/qemu_migration_cookie.h @@ -58,7 +58,6 @@ typedef enum { } qemuMigrationCookieFeatures; typedef struct _qemuMigrationCookieGraphics qemuMigrationCookieGraphics; -typedef qemuMigrationCookieGraphics *qemuMigrationCookieGraphicsPtr; struct _qemuMigrationCookieGraphics { int type; int port; @@ -68,7 +67,6 @@ struct _qemuMigrationCookieGraphics { }; typedef struct _qemuMigrationCookieNetData qemuMigrationCookieNetData; -typedef qemuMigrationCookieNetData *qemuMigrationCookieNetDataPtr; struct _qemuMigrationCookieNetData { int vporttype; /* enum virNetDevVPortProfile */ @@ -80,12 +78,11 @@ struct _qemuMigrationCookieNetData { }; typedef struct _qemuMigrationCookieNetwork qemuMigrationCookieNetwork; -typedef qemuMigrationCookieNetwork *qemuMigrationCookieNetworkPtr; struct _qemuMigrationCookieNetwork { /* How many virtual NICs are we saving data for? */ int nnets; - qemuMigrationCookieNetDataPtr net; + qemuMigrationCookieNetData *net; }; struct qemuMigrationCookieNBDDisk { @@ -94,7 +91,6 @@ struct qemuMigrationCookieNBDDisk { }; typedef struct _qemuMigrationCookieNBD qemuMigrationCookieNBD; -typedef qemuMigrationCookieNBD *qemuMigrationCookieNBDPtr; struct _qemuMigrationCookieNBD { int port; /* on which port does NBD server listen for incoming data */ @@ -103,14 +99,12 @@ struct _qemuMigrationCookieNBD { }; typedef struct _qemuMigrationCookieCaps qemuMigrationCookieCaps; -typedef qemuMigrationCookieCaps *qemuMigrationCookieCapsPtr; struct _qemuMigrationCookieCaps { - virBitmapPtr supported; - virBitmapPtr automatic; + virBitmap *supported; + virBitmap *automatic; }; typedef struct _qemuMigrationBlockDirtyBitmapsDiskBitmap qemuMigrationBlockDirtyBitmapsDiskBitmap; -typedef qemuMigrationBlockDirtyBitmapsDiskBitmap *qemuMigrationBlockDirtyBitmapsDiskBitmapPtr; struct _qemuMigrationBlockDirtyBitmapsDiskBitmap { /* config */ char *bitmapname; @@ -125,21 +119,19 @@ struct _qemuMigrationBlockDirtyBitmapsDiskBitmap { typedef struct _qemuMigrationBlockDirtyBitmapsDisk qemuMigrationBlockDirtyBitmapsDisk; -typedef qemuMigrationBlockDirtyBitmapsDisk *qemuMigrationBlockDirtyBitmapsDiskPtr; struct _qemuMigrationBlockDirtyBitmapsDisk { char *target; GSList *bitmaps; /* runtime data */ - virDomainDiskDefPtr disk; /* disk object corresponding to 'target' */ + virDomainDiskDef *disk; /* disk object corresponding to 'target' */ const char *nodename; /* nodename of the top level source of 'disk' */ bool skip; /* omit this disk */ }; typedef struct _qemuMigrationCookie qemuMigrationCookie; -typedef qemuMigrationCookie *qemuMigrationCookiePtr; struct _qemuMigrationCookie { unsigned int flags; unsigned int flagsMandatory; @@ -159,78 +151,78 @@ struct _qemuMigrationCookie { char *lockDriver; /* If (flags & QEMU_MIGRATION_COOKIE_GRAPHICS) */ - qemuMigrationCookieGraphicsPtr graphics; + qemuMigrationCookieGraphics *graphics; /* If (flags & QEMU_MIGRATION_COOKIE_PERSISTENT) */ - virDomainDefPtr persistent; + virDomainDef *persistent; /* If (flags & QEMU_MIGRATION_COOKIE_NETWORK) */ - qemuMigrationCookieNetworkPtr network; + qemuMigrationCookieNetwork *network; /* If (flags & QEMU_MIGRATION_COOKIE_NBD) */ - qemuMigrationCookieNBDPtr nbd; + qemuMigrationCookieNBD *nbd; /* If (flags & QEMU_MIGRATION_COOKIE_STATS) */ - qemuDomainJobInfoPtr jobInfo; + qemuDomainJobInfo *jobInfo; /* If flags & QEMU_MIGRATION_COOKIE_CPU */ - virCPUDefPtr cpu; + virCPUDef *cpu; /* If flags & QEMU_MIGRATION_COOKIE_ALLOW_REBOOT */ virTristateBool allowReboot; /* If flags & QEMU_MIGRATION_COOKIE_CAPS */ - qemuMigrationCookieCapsPtr caps; + qemuMigrationCookieCaps *caps; /* If flags & QEMU_MIGRATION_COOKIE_BLOCK_DIRTY_BITMAPS */ GSList *blockDirtyBitmaps; }; -qemuMigrationCookiePtr +qemuMigrationCookie * qemuMigrationCookieNew(const virDomainDef *def, const char *origname); int -qemuMigrationCookieFormat(qemuMigrationCookiePtr mig, - virQEMUDriverPtr driver, - virDomainObjPtr dom, +qemuMigrationCookieFormat(qemuMigrationCookie *mig, + virQEMUDriver *driver, + virDomainObj *dom, qemuMigrationParty party, char **cookieout, int *cookieoutlen, unsigned int flags); -qemuMigrationCookiePtr -qemuMigrationCookieParse(virQEMUDriverPtr driver, +qemuMigrationCookie * +qemuMigrationCookieParse(virQEMUDriver *driver, const virDomainDef *def, const char *origname, - qemuDomainObjPrivatePtr priv, + qemuDomainObjPrivate *priv, const char *cookiein, int cookieinlen, unsigned int flags); void -qemuMigrationCookieFree(qemuMigrationCookiePtr mig); +qemuMigrationCookieFree(qemuMigrationCookie *mig); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationCookie, qemuMigrationCookieFree); int -qemuMigrationCookieAddPersistent(qemuMigrationCookiePtr mig, - virDomainDefPtr *def); +qemuMigrationCookieAddPersistent(qemuMigrationCookie *mig, + virDomainDef **def); -virDomainDefPtr -qemuMigrationCookieGetPersistent(qemuMigrationCookiePtr mig); +virDomainDef * +qemuMigrationCookieGetPersistent(qemuMigrationCookie *mig); /* qemuMigrationCookieXMLFormat is exported for test use only! */ int -qemuMigrationCookieXMLFormat(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, - virBufferPtr buf, - qemuMigrationCookiePtr mig); +qemuMigrationCookieXMLFormat(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, + virBuffer *buf, + qemuMigrationCookie *mig); int -qemuMigrationCookieBlockDirtyBitmapsMatchDisks(virDomainDefPtr def, +qemuMigrationCookieBlockDirtyBitmapsMatchDisks(virDomainDef *def, GSList *disks); int qemuMigrationCookieBlockDirtyBitmapsToParams(GSList *disks, - virJSONValuePtr *mapping); + virJSONValue **mapping); diff --git a/src/qemu/qemu_migration_params.c b/src/qemu/qemu_migration_params.c index 593eb93ffc..018e62cf6e 100644 --- a/src/qemu/qemu_migration_params.c +++ b/src/qemu/qemu_migration_params.c @@ -48,7 +48,6 @@ typedef enum { } qemuMigrationParamType; typedef struct _qemuMigrationParamValue qemuMigrationParamValue; -typedef qemuMigrationParamValue *qemuMigrationParamValuePtr; struct _qemuMigrationParamValue { bool set; union { @@ -61,9 +60,9 @@ struct _qemuMigrationParamValue { struct _qemuMigrationParams { unsigned long long compMethods; /* bit-wise OR of qemuMigrationCompressMethod */ - virBitmapPtr caps; + virBitmap *caps; qemuMigrationParamValue params[QEMU_MIGRATION_PARAM_LAST]; - virJSONValuePtr blockDirtyBitmapMapping; + virJSONValue *blockDirtyBitmapMapping; }; typedef enum { @@ -223,10 +222,10 @@ static const qemuMigrationParamType qemuMigrationParamTypes[] = { G_STATIC_ASSERT(G_N_ELEMENTS(qemuMigrationParamTypes) == QEMU_MIGRATION_PARAM_LAST); -virBitmapPtr +virBitmap * qemuMigrationParamsGetAlwaysOnCaps(qemuMigrationParty party) { - virBitmapPtr caps = virBitmapNew(QEMU_MIGRATION_CAP_LAST); + virBitmap *caps = virBitmapNew(QEMU_MIGRATION_CAP_LAST); size_t i; for (i = 0; i < G_N_ELEMENTS(qemuMigrationParamsAlwaysOn); i++) { @@ -240,7 +239,7 @@ qemuMigrationParamsGetAlwaysOnCaps(qemuMigrationParty party) } -qemuMigrationParamsPtr +qemuMigrationParams * qemuMigrationParamsNew(void) { g_autoptr(qemuMigrationParams) params = NULL; @@ -254,7 +253,7 @@ qemuMigrationParamsNew(void) void -qemuMigrationParamsFree(qemuMigrationParamsPtr migParams) +qemuMigrationParamsFree(qemuMigrationParams *migParams) { size_t i; @@ -288,7 +287,7 @@ qemuMigrationParamsCheckType(qemuMigrationParam param, static int -qemuMigrationParamsGetTPInt(qemuMigrationParamsPtr migParams, +qemuMigrationParamsGetTPInt(qemuMigrationParams *migParams, qemuMigrationParam param, virTypedParameterPtr params, int nparams, @@ -324,7 +323,7 @@ qemuMigrationParamsGetTPInt(qemuMigrationParamsPtr migParams, static int -qemuMigrationParamsSetTPInt(qemuMigrationParamsPtr migParams, +qemuMigrationParamsSetTPInt(qemuMigrationParams *migParams, qemuMigrationParam param, virTypedParameterPtr *params, int *nparams, @@ -349,7 +348,7 @@ qemuMigrationParamsSetTPInt(qemuMigrationParamsPtr migParams, static int -qemuMigrationParamsGetTPULL(qemuMigrationParamsPtr migParams, +qemuMigrationParamsGetTPULL(qemuMigrationParams *migParams, qemuMigrationParam param, virTypedParameterPtr params, int nparams, @@ -385,7 +384,7 @@ qemuMigrationParamsGetTPULL(qemuMigrationParamsPtr migParams, static int -qemuMigrationParamsSetTPULL(qemuMigrationParamsPtr migParams, +qemuMigrationParamsSetTPULL(qemuMigrationParams *migParams, qemuMigrationParam param, virTypedParameterPtr *params, int *nparams, @@ -410,7 +409,7 @@ qemuMigrationParamsSetTPULL(qemuMigrationParamsPtr migParams, static int -qemuMigrationParamsGetTPString(qemuMigrationParamsPtr migParams, +qemuMigrationParamsGetTPString(qemuMigrationParams *migParams, qemuMigrationParam param, virTypedParameterPtr params, int nparams, @@ -435,7 +434,7 @@ qemuMigrationParamsGetTPString(qemuMigrationParamsPtr migParams, static int -qemuMigrationParamsSetTPString(qemuMigrationParamsPtr migParams, +qemuMigrationParamsSetTPString(qemuMigrationParams *migParams, qemuMigrationParam param, virTypedParameterPtr *params, int *nparams, @@ -458,7 +457,7 @@ static int qemuMigrationParamsSetCompression(virTypedParameterPtr params, int nparams, unsigned long flags, - qemuMigrationParamsPtr migParams) + qemuMigrationParams *migParams) { size_t i; int method; @@ -528,8 +527,8 @@ qemuMigrationParamsSetCompression(virTypedParameterPtr params, void -qemuMigrationParamsSetBlockDirtyBitmapMapping(qemuMigrationParamsPtr migParams, - virJSONValuePtr *params) +qemuMigrationParamsSetBlockDirtyBitmapMapping(qemuMigrationParams *migParams, + virJSONValue **params) { virJSONValueFree(migParams->blockDirtyBitmapMapping); migParams->blockDirtyBitmapMapping = g_steal_pointer(params); @@ -541,7 +540,7 @@ qemuMigrationParamsSetBlockDirtyBitmapMapping(qemuMigrationParamsPtr migParams, } -qemuMigrationParamsPtr +qemuMigrationParams * qemuMigrationParamsFromFlags(virTypedParameterPtr params, int nparams, unsigned long flags, @@ -622,7 +621,7 @@ qemuMigrationParamsFromFlags(virTypedParameterPtr params, int -qemuMigrationParamsDump(qemuMigrationParamsPtr migParams, +qemuMigrationParamsDump(qemuMigrationParams *migParams, virTypedParameterPtr *params, int *nparams, int *maxparams, @@ -680,11 +679,11 @@ qemuMigrationParamsDump(qemuMigrationParamsPtr migParams, } -qemuMigrationParamsPtr -qemuMigrationParamsFromJSON(virJSONValuePtr params) +qemuMigrationParams * +qemuMigrationParamsFromJSON(virJSONValue *params) { g_autoptr(qemuMigrationParams) migParams = NULL; - qemuMigrationParamValuePtr pv; + qemuMigrationParamValue *pv; const char *name; const char *str; size_t i; @@ -728,15 +727,15 @@ qemuMigrationParamsFromJSON(virJSONValuePtr params) } -virJSONValuePtr -qemuMigrationParamsToJSON(qemuMigrationParamsPtr migParams) +virJSONValue * +qemuMigrationParamsToJSON(qemuMigrationParams *migParams) { g_autoptr(virJSONValue) params = virJSONValueNewObject(); size_t i; for (i = 0; i < QEMU_MIGRATION_PARAM_LAST; i++) { const char *name = qemuMigrationParamTypeToString(i); - qemuMigrationParamValuePtr pv = &migParams->params[i]; + qemuMigrationParamValue *pv = &migParams->params[i]; int rc = 0; if (!pv->set) @@ -778,9 +777,9 @@ qemuMigrationParamsToJSON(qemuMigrationParamsPtr migParams) } -virJSONValuePtr -qemuMigrationCapsToJSON(virBitmapPtr caps, - virBitmapPtr states) +virJSONValue * +qemuMigrationCapsToJSON(virBitmap *caps, + virBitmap *states) { g_autoptr(virJSONValue) json = virJSONValueNewArray(); qemuMigrationCapability bit; @@ -817,12 +816,12 @@ qemuMigrationCapsToJSON(virBitmapPtr caps, * Returns 0 on success, -1 on failure. */ int -qemuMigrationParamsApply(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationParamsApply(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob, - qemuMigrationParamsPtr migParams) + qemuMigrationParams *migParams) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool xbzrleCacheSize_old = false; g_autoptr(virJSONValue) params = NULL; g_autoptr(virJSONValue) caps = NULL; @@ -891,7 +890,7 @@ qemuMigrationParamsApply(virQEMUDriverPtr driver, * success and -1 on error. Libvirt error is reported. */ static int -qemuMigrationParamsSetString(qemuMigrationParamsPtr migParams, +qemuMigrationParamsSetString(qemuMigrationParams *migParams, qemuMigrationParam param, const char *value) { @@ -922,16 +921,16 @@ qemuMigrationParamsSetString(qemuMigrationParamsPtr migParams, * Returns 0 on success, -1 on failure */ int -qemuMigrationParamsEnableTLS(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationParamsEnableTLS(virQEMUDriver *driver, + virDomainObj *vm, bool tlsListen, int asyncJob, char **tlsAlias, const char *hostname, - qemuMigrationParamsPtr migParams) + qemuMigrationParams *migParams) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; g_autoptr(virJSONValue) tlsProps = NULL; g_autoptr(virJSONValue) secProps = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); @@ -1003,11 +1002,11 @@ qemuMigrationParamsEnableTLS(virQEMUDriverPtr driver, * Returns 0 on success, -1 on failure */ int -qemuMigrationParamsDisableTLS(virDomainObjPtr vm, - qemuMigrationParamsPtr migParams) +qemuMigrationParamsDisableTLS(virDomainObj *vm, + qemuMigrationParams *migParams) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; if (!jobPriv->migParams->params[QEMU_MIGRATION_PARAM_TLS_CREDS].set) return 0; @@ -1023,7 +1022,7 @@ qemuMigrationParamsDisableTLS(virDomainObjPtr vm, bool -qemuMigrationParamsTLSHostnameIsSet(qemuMigrationParamsPtr migParams) +qemuMigrationParamsTLSHostnameIsSet(qemuMigrationParams *migParams) { int param = QEMU_MIGRATION_PARAM_TLS_HOSTNAME; return (migParams->params[param].set && @@ -1041,10 +1040,10 @@ qemuMigrationParamsTLSHostnameIsSet(qemuMigrationParamsPtr migParams) * security objects and free the secinfo */ static void -qemuMigrationParamsResetTLS(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationParamsResetTLS(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob, - qemuMigrationParamsPtr origParams, + qemuMigrationParams *origParams, unsigned long apiFlags) { g_autofree char *tlsAlias = NULL; @@ -1065,12 +1064,12 @@ qemuMigrationParamsResetTLS(virQEMUDriverPtr driver, int -qemuMigrationParamsFetch(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationParamsFetch(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob, - qemuMigrationParamsPtr *migParams) + qemuMigrationParams **migParams) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virJSONValue) jsonParams = NULL; int rc; @@ -1092,7 +1091,7 @@ qemuMigrationParamsFetch(virQEMUDriverPtr driver, int -qemuMigrationParamsSetULL(qemuMigrationParamsPtr migParams, +qemuMigrationParamsSetULL(qemuMigrationParams *migParams, qemuMigrationParam param, unsigned long long value) { @@ -1111,7 +1110,7 @@ qemuMigrationParamsSetULL(qemuMigrationParamsPtr migParams, * 1 if the parameter is not supported by QEMU. */ int -qemuMigrationParamsGetULL(qemuMigrationParamsPtr migParams, +qemuMigrationParamsGetULL(qemuMigrationParams *migParams, qemuMigrationParam param, unsigned long long *value) { @@ -1135,14 +1134,14 @@ qemuMigrationParamsGetULL(qemuMigrationParamsPtr migParams, * are unsupported by QEMU. */ int -qemuMigrationParamsCheck(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationParamsCheck(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob, - qemuMigrationParamsPtr migParams, - virBitmapPtr remoteCaps) + qemuMigrationParams *migParams, + virBitmap *remoteCaps) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuDomainJobPrivatePtr jobPriv = priv->job.privateData; + qemuDomainObjPrivate *priv = vm->privateData; + qemuDomainJobPrivate *jobPriv = priv->job.privateData; qemuMigrationCapability cap; qemuMigrationParty party; size_t i; @@ -1207,10 +1206,10 @@ qemuMigrationParamsCheck(virQEMUDriverPtr driver, * migration (save, managedsave, snapshots, dump) will not try to use them. */ void -qemuMigrationParamsReset(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationParamsReset(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob, - qemuMigrationParamsPtr origParams, + qemuMigrationParams *origParams, unsigned long apiFlags) { virErrorPtr err; @@ -1235,10 +1234,10 @@ qemuMigrationParamsReset(virQEMUDriverPtr driver, void -qemuMigrationParamsFormat(virBufferPtr buf, - qemuMigrationParamsPtr migParams) +qemuMigrationParamsFormat(virBuffer *buf, + qemuMigrationParams *migParams) { - qemuMigrationParamValuePtr pv; + qemuMigrationParamValue *pv; size_t i; virBufferAddLit(buf, "\n"); @@ -1281,10 +1280,10 @@ qemuMigrationParamsFormat(virBufferPtr buf, int qemuMigrationParamsParse(xmlXPathContextPtr ctxt, - qemuMigrationParamsPtr *migParams) + qemuMigrationParams **migParams) { g_autoptr(qemuMigrationParams) params = NULL; - qemuMigrationParamValuePtr pv; + qemuMigrationParamValue *pv; g_autofree xmlNodePtr *nodes = NULL; size_t i; int rc; @@ -1365,11 +1364,11 @@ qemuMigrationParamsParse(xmlXPathContextPtr ctxt, int -qemuMigrationCapsCheck(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationCapsCheck(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virBitmap) migEvent = NULL; g_autoptr(virJSONValue) json = NULL; g_auto(GStrv) caps = NULL; @@ -1435,10 +1434,10 @@ qemuMigrationCapsCheck(virQEMUDriverPtr driver, bool -qemuMigrationCapsGet(virDomainObjPtr vm, +qemuMigrationCapsGet(virDomainObj *vm, qemuMigrationCapability cap) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool enabled = false; if (priv->migrationCaps) diff --git a/src/qemu/qemu_migration_params.h b/src/qemu/qemu_migration_params.h index f1db42ce94..f770bd2576 100644 --- a/src/qemu/qemu_migration_params.h +++ b/src/qemu/qemu_migration_params.h @@ -64,7 +64,6 @@ typedef enum { } qemuMigrationParam; typedef struct _qemuMigrationParams qemuMigrationParams; -typedef qemuMigrationParams *qemuMigrationParamsPtr; typedef enum { QEMU_MIGRATION_SOURCE = (1 << 0), @@ -72,98 +71,98 @@ typedef enum { } qemuMigrationParty; -virBitmapPtr +virBitmap * qemuMigrationParamsGetAlwaysOnCaps(qemuMigrationParty party); -qemuMigrationParamsPtr +qemuMigrationParams * qemuMigrationParamsFromFlags(virTypedParameterPtr params, int nparams, unsigned long flags, qemuMigrationParty party); int -qemuMigrationParamsDump(qemuMigrationParamsPtr migParams, +qemuMigrationParamsDump(qemuMigrationParams *migParams, virTypedParameterPtr *params, int *nparams, int *maxparams, unsigned long *flags); -qemuMigrationParamsPtr +qemuMigrationParams * qemuMigrationParamsNew(void); void -qemuMigrationParamsFree(qemuMigrationParamsPtr migParams); +qemuMigrationParamsFree(qemuMigrationParams *migParams); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMigrationParams, qemuMigrationParamsFree); int -qemuMigrationParamsApply(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationParamsApply(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob, - qemuMigrationParamsPtr migParams); + qemuMigrationParams *migParams); int -qemuMigrationParamsEnableTLS(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationParamsEnableTLS(virQEMUDriver *driver, + virDomainObj *vm, bool tlsListen, int asyncJob, char **tlsAlias, const char *hostname, - qemuMigrationParamsPtr migParams); + qemuMigrationParams *migParams); int -qemuMigrationParamsDisableTLS(virDomainObjPtr vm, - qemuMigrationParamsPtr migParams); +qemuMigrationParamsDisableTLS(virDomainObj *vm, + qemuMigrationParams *migParams); bool -qemuMigrationParamsTLSHostnameIsSet(qemuMigrationParamsPtr migParams); +qemuMigrationParamsTLSHostnameIsSet(qemuMigrationParams *migParams); int -qemuMigrationParamsFetch(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationParamsFetch(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob, - qemuMigrationParamsPtr *migParams); + qemuMigrationParams **migParams); int -qemuMigrationParamsSetULL(qemuMigrationParamsPtr migParams, +qemuMigrationParamsSetULL(qemuMigrationParams *migParams, qemuMigrationParam param, unsigned long long value); int -qemuMigrationParamsGetULL(qemuMigrationParamsPtr migParams, +qemuMigrationParamsGetULL(qemuMigrationParams *migParams, qemuMigrationParam param, unsigned long long *value); void -qemuMigrationParamsSetBlockDirtyBitmapMapping(qemuMigrationParamsPtr migParams, - virJSONValuePtr *params); +qemuMigrationParamsSetBlockDirtyBitmapMapping(qemuMigrationParams *migParams, + virJSONValue **params); int -qemuMigrationParamsCheck(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationParamsCheck(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob, - qemuMigrationParamsPtr migParams, - virBitmapPtr remoteCaps); + qemuMigrationParams *migParams, + virBitmap *remoteCaps); void -qemuMigrationParamsReset(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationParamsReset(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob, - qemuMigrationParamsPtr origParams, + qemuMigrationParams *origParams, unsigned long apiFlags); void -qemuMigrationParamsFormat(virBufferPtr buf, - qemuMigrationParamsPtr migParams); +qemuMigrationParamsFormat(virBuffer *buf, + qemuMigrationParams *migParams); int qemuMigrationParamsParse(xmlXPathContextPtr ctxt, - qemuMigrationParamsPtr *migParams); + qemuMigrationParams **migParams); int -qemuMigrationCapsCheck(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMigrationCapsCheck(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob); bool -qemuMigrationCapsGet(virDomainObjPtr vm, +qemuMigrationCapsGet(virDomainObj *vm, qemuMigrationCapability cap); diff --git a/src/qemu/qemu_migration_paramspriv.h b/src/qemu/qemu_migration_paramspriv.h index ca72400c7e..f7e0f51fbd 100644 --- a/src/qemu/qemu_migration_paramspriv.h +++ b/src/qemu/qemu_migration_paramspriv.h @@ -25,12 +25,12 @@ #pragma once -virJSONValuePtr -qemuMigrationParamsToJSON(qemuMigrationParamsPtr migParams); +virJSONValue * +qemuMigrationParamsToJSON(qemuMigrationParams *migParams); -qemuMigrationParamsPtr -qemuMigrationParamsFromJSON(virJSONValuePtr params); +qemuMigrationParams * +qemuMigrationParamsFromJSON(virJSONValue *params); -virJSONValuePtr -qemuMigrationCapsToJSON(virBitmapPtr caps, - virBitmapPtr states); +virJSONValue * +qemuMigrationCapsToJSON(virBitmap *caps, + virBitmap *states); diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index fede34210d..f3f14c46b6 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -79,14 +79,14 @@ struct _qemuMonitor { GSocket *socket; GSource *watch; - virDomainObjPtr vm; + virDomainObj *vm; - qemuMonitorCallbacksPtr cb; + qemuMonitorCallbacks *cb; void *callbackOpaque; /* If there's a command being processed this will be * non-NULL */ - qemuMonitorMessagePtr msg; + qemuMonitorMessage *msg; /* Buffer incoming data ready for Text/QMP monitor * code to process & find message boundaries */ @@ -146,7 +146,7 @@ struct _qemuMonitor { #define QEMU_CHECK_MONITOR_GOTO(mon, label) \ QEMU_CHECK_MONITOR_FULL(mon, goto label) -static virClassPtr qemuMonitorClass; +static virClass *qemuMonitorClass; static __thread bool qemuMonitorDisposed; static void qemuMonitorDispose(void *obj); @@ -229,7 +229,7 @@ qemuMonitorEscapeNonPrintable(const char *text) static void qemuMonitorDispose(void *obj) { - qemuMonitorPtr mon = obj; + qemuMonitor *mon = obj; VIR_DEBUG("mon=%p", mon); qemuMonitorDisposed = true; @@ -318,10 +318,10 @@ qemuMonitorOpenUnix(const char *monitor, * replies/errors. */ static int -qemuMonitorIOProcess(qemuMonitorPtr mon) +qemuMonitorIOProcess(qemuMonitor *mon) { int len; - qemuMonitorMessagePtr msg = NULL; + qemuMonitorMessage *msg = NULL; /* See if there's a message & whether its ready for its reply * ie whether its completed writing all its data */ @@ -374,7 +374,7 @@ qemuMonitorIOProcess(qemuMonitorPtr mon) /* Call this function while holding the monitor lock. */ static int -qemuMonitorIOWriteWithFD(qemuMonitorPtr mon, +qemuMonitorIOWriteWithFD(qemuMonitor *mon, const char *data, size_t len, int fd) @@ -419,7 +419,7 @@ qemuMonitorIOWriteWithFD(qemuMonitorPtr mon, * Call this function while holding the monitor lock. */ static int -qemuMonitorIOWrite(qemuMonitorPtr mon) +qemuMonitorIOWrite(qemuMonitor *mon) { int done; char *buf; @@ -466,7 +466,7 @@ qemuMonitorIOWrite(qemuMonitorPtr mon) * Returns -1 on error, or number of bytes read */ static int -qemuMonitorIORead(qemuMonitorPtr mon) +qemuMonitorIORead(qemuMonitor *mon) { size_t avail = mon->bufferLength - mon->bufferOffset; int ret = 0; @@ -516,7 +516,7 @@ qemuMonitorIORead(qemuMonitorPtr mon) static void -qemuMonitorUpdateWatch(qemuMonitorPtr mon) +qemuMonitorUpdateWatch(qemuMonitor *mon) { qemuMonitorUnregister(mon); if (mon->socket) @@ -529,7 +529,7 @@ qemuMonitorIO(GSocket *socket G_GNUC_UNUSED, GIOCondition cond, gpointer opaque) { - qemuMonitorPtr mon = opaque; + qemuMonitor *mon = opaque; bool error = false; bool eof = false; bool hangup = false; @@ -634,10 +634,10 @@ qemuMonitorIO(GSocket *socket G_GNUC_UNUSED, /* We have to unlock to avoid deadlock against command thread, * but is this safe ? I think it is, because the callback - * will try to acquire the virDomainObjPtr mutex next */ + * will try to acquire the virDomainObj *mutex next */ if (eof) { qemuMonitorEofNotifyCallback eofNotify = mon->cb->eofNotify; - virDomainObjPtr vm = mon->vm; + virDomainObj *vm = mon->vm; /* Make sure anyone waiting wakes up now */ virCondSignal(&mon->notify); @@ -647,7 +647,7 @@ qemuMonitorIO(GSocket *socket G_GNUC_UNUSED, virObjectUnref(mon); } else if (error) { qemuMonitorErrorNotifyCallback errorNotify = mon->cb->errorNotify; - virDomainObjPtr vm = mon->vm; + virDomainObj *vm = mon->vm; /* Make sure anyone waiting wakes up now */ virCondSignal(&mon->notify); @@ -664,15 +664,15 @@ qemuMonitorIO(GSocket *socket G_GNUC_UNUSED, } -static qemuMonitorPtr -qemuMonitorOpenInternal(virDomainObjPtr vm, +static qemuMonitor * +qemuMonitorOpenInternal(virDomainObj *vm, int fd, GMainContext *context, - qemuMonitorCallbacksPtr cb, + qemuMonitorCallbacks *cb, void *opaque) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuMonitorPtr mon; + qemuDomainObjPrivate *priv = vm->privateData; + qemuMonitor *mon; g_autoptr(GError) gerr = NULL; if (!cb->eofNotify) { @@ -732,7 +732,7 @@ qemuMonitorOpenInternal(virDomainObjPtr vm, cleanup: /* We don't want the 'destroy' callback invoked during * cleanup from construction failure, because that can - * give a double-unref on virDomainObjPtr in the caller, + * give a double-unref on virDomainObj *in the caller, * so kill the callbacks now. */ mon->cb = NULL; @@ -761,17 +761,17 @@ qemuMonitorOpenInternal(virDomainObjPtr vm, * * Returns monitor object, NULL on error. */ -qemuMonitorPtr -qemuMonitorOpen(virDomainObjPtr vm, - virDomainChrSourceDefPtr config, +qemuMonitor * +qemuMonitorOpen(virDomainObj *vm, + virDomainChrSourceDef *config, bool retry, unsigned long long timeout, GMainContext *context, - qemuMonitorCallbacksPtr cb, + qemuMonitorCallbacks *cb, void *opaque) { int fd = -1; - qemuMonitorPtr ret = NULL; + qemuMonitor *ret = NULL; timeout += QEMU_DEFAULT_MONITOR_WAIT; @@ -829,7 +829,7 @@ bool qemuMonitorWasDisposed(void) * lock for @mon. */ void -qemuMonitorRegister(qemuMonitorPtr mon) +qemuMonitorRegister(qemuMonitor *mon) { GIOCondition cond = 0; @@ -864,7 +864,7 @@ qemuMonitorRegister(qemuMonitorPtr mon) * must be locked before calling this function. */ void -qemuMonitorUnregister(qemuMonitorPtr mon) +qemuMonitorUnregister(qemuMonitor *mon) { if (mon->watch) { g_source_destroy(mon->watch); @@ -874,7 +874,7 @@ qemuMonitorUnregister(qemuMonitorPtr mon) } void -qemuMonitorClose(qemuMonitorPtr mon) +qemuMonitorClose(qemuMonitor *mon) { if (!mon) return; @@ -924,7 +924,7 @@ qemuMonitorClose(qemuMonitorPtr mon) char * -qemuMonitorNextCommandID(qemuMonitorPtr mon) +qemuMonitorNextCommandID(qemuMonitor *mon) { char *id; @@ -935,15 +935,15 @@ qemuMonitorNextCommandID(qemuMonitorPtr mon) /* for use only in the test suite */ void -qemuMonitorResetCommandID(qemuMonitorPtr mon) +qemuMonitorResetCommandID(qemuMonitor *mon) { mon->nextSerial = 0; } int -qemuMonitorSend(qemuMonitorPtr mon, - qemuMonitorMessagePtr msg) +qemuMonitorSend(qemuMonitor *mon, + qemuMonitorMessage *msg) { int ret = -1; @@ -992,7 +992,7 @@ qemuMonitorSend(qemuMonitorPtr mon, * for freeing it. */ virErrorPtr -qemuMonitorLastError(qemuMonitorPtr mon) +qemuMonitorLastError(qemuMonitor *mon) { if (mon->lastError.code == VIR_ERR_OK) return NULL; @@ -1011,13 +1011,13 @@ qemuMonitorLastError(qemuMonitorPtr mon) * This feature was added to QEMU 1.5. */ static void -qemuMonitorInitBalloonObjectPath(qemuMonitorPtr mon, - virDomainMemballoonDefPtr balloon) +qemuMonitorInitBalloonObjectPath(qemuMonitor *mon, + virDomainMemballoonDef *balloon) { ssize_t i, nprops = 0; char *path = NULL; const char *name; - qemuMonitorJSONListPathPtr *bprops = NULL; + qemuMonitorJSONListPath **bprops = NULL; if (mon->balloonpath) { return; @@ -1096,8 +1096,8 @@ qemuMonitorInitBalloonObjectPath(qemuMonitorPtr mon, * Returns 0 on success, -1 on failure and sets proper error message. */ int -qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon, - virDomainVideoDefPtr video, +qemuMonitorUpdateVideoMemorySize(qemuMonitor *mon, + virDomainVideoDef *video, const char *videoName) { int rc = -1; @@ -1126,8 +1126,8 @@ qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon, * Returns 0 on success, -1 on failure and sets proper error message. */ int -qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon, - virDomainVideoDefPtr video, +qemuMonitorUpdateVideoVram64Size(qemuMonitor *mon, + virDomainVideoDef *video, const char *videoName) { int rc = -1; @@ -1163,7 +1163,7 @@ qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon, int -qemuMonitorEmitEvent(qemuMonitorPtr mon, const char *event, +qemuMonitorEmitEvent(qemuMonitor *mon, const char *event, long long seconds, unsigned int micros, const char *details) { @@ -1177,7 +1177,7 @@ qemuMonitorEmitEvent(qemuMonitorPtr mon, const char *event, int -qemuMonitorEmitShutdown(qemuMonitorPtr mon, virTristateBool guest) +qemuMonitorEmitShutdown(qemuMonitor *mon, virTristateBool guest) { int ret = -1; VIR_DEBUG("mon=%p guest=%u", mon, guest); @@ -1188,7 +1188,7 @@ qemuMonitorEmitShutdown(qemuMonitorPtr mon, virTristateBool guest) int -qemuMonitorEmitReset(qemuMonitorPtr mon) +qemuMonitorEmitReset(qemuMonitor *mon) { int ret = -1; VIR_DEBUG("mon=%p", mon); @@ -1199,7 +1199,7 @@ qemuMonitorEmitReset(qemuMonitorPtr mon) int -qemuMonitorEmitPowerdown(qemuMonitorPtr mon) +qemuMonitorEmitPowerdown(qemuMonitor *mon) { int ret = -1; VIR_DEBUG("mon=%p", mon); @@ -1210,7 +1210,7 @@ qemuMonitorEmitPowerdown(qemuMonitorPtr mon) int -qemuMonitorEmitStop(qemuMonitorPtr mon) +qemuMonitorEmitStop(qemuMonitor *mon) { int ret = -1; VIR_DEBUG("mon=%p", mon); @@ -1221,7 +1221,7 @@ qemuMonitorEmitStop(qemuMonitorPtr mon) int -qemuMonitorEmitResume(qemuMonitorPtr mon) +qemuMonitorEmitResume(qemuMonitor *mon) { int ret = -1; VIR_DEBUG("mon=%p", mon); @@ -1232,8 +1232,8 @@ qemuMonitorEmitResume(qemuMonitorPtr mon) int -qemuMonitorEmitGuestPanic(qemuMonitorPtr mon, - qemuMonitorEventPanicInfoPtr info) +qemuMonitorEmitGuestPanic(qemuMonitor *mon, + qemuMonitorEventPanicInfo *info) { int ret = -1; VIR_DEBUG("mon=%p", mon); @@ -1243,7 +1243,7 @@ qemuMonitorEmitGuestPanic(qemuMonitorPtr mon, int -qemuMonitorEmitRTCChange(qemuMonitorPtr mon, long long offset) +qemuMonitorEmitRTCChange(qemuMonitor *mon, long long offset) { int ret = -1; VIR_DEBUG("mon=%p", mon); @@ -1254,7 +1254,7 @@ qemuMonitorEmitRTCChange(qemuMonitorPtr mon, long long offset) int -qemuMonitorEmitWatchdog(qemuMonitorPtr mon, int action) +qemuMonitorEmitWatchdog(qemuMonitor *mon, int action) { int ret = -1; VIR_DEBUG("mon=%p", mon); @@ -1265,7 +1265,7 @@ qemuMonitorEmitWatchdog(qemuMonitorPtr mon, int action) int -qemuMonitorEmitIOError(qemuMonitorPtr mon, +qemuMonitorEmitIOError(qemuMonitor *mon, const char *diskAlias, const char *nodename, int action, @@ -1281,7 +1281,7 @@ qemuMonitorEmitIOError(qemuMonitorPtr mon, int -qemuMonitorEmitGraphics(qemuMonitorPtr mon, +qemuMonitorEmitGraphics(qemuMonitor *mon, int phase, int localFamily, const char *localNode, @@ -1305,7 +1305,7 @@ qemuMonitorEmitGraphics(qemuMonitorPtr mon, int -qemuMonitorEmitTrayChange(qemuMonitorPtr mon, +qemuMonitorEmitTrayChange(qemuMonitor *mon, const char *devAlias, const char *devid, int reason) @@ -1321,7 +1321,7 @@ qemuMonitorEmitTrayChange(qemuMonitorPtr mon, int -qemuMonitorEmitPMWakeup(qemuMonitorPtr mon) +qemuMonitorEmitPMWakeup(qemuMonitor *mon) { int ret = -1; VIR_DEBUG("mon=%p", mon); @@ -1333,7 +1333,7 @@ qemuMonitorEmitPMWakeup(qemuMonitorPtr mon) int -qemuMonitorEmitPMSuspend(qemuMonitorPtr mon) +qemuMonitorEmitPMSuspend(qemuMonitor *mon) { int ret = -1; VIR_DEBUG("mon=%p", mon); @@ -1345,7 +1345,7 @@ qemuMonitorEmitPMSuspend(qemuMonitorPtr mon) int -qemuMonitorEmitPMSuspendDisk(qemuMonitorPtr mon) +qemuMonitorEmitPMSuspendDisk(qemuMonitor *mon) { int ret = -1; VIR_DEBUG("mon=%p", mon); @@ -1357,7 +1357,7 @@ qemuMonitorEmitPMSuspendDisk(qemuMonitorPtr mon) int -qemuMonitorEmitBlockJob(qemuMonitorPtr mon, +qemuMonitorEmitBlockJob(qemuMonitor *mon, const char *diskAlias, int type, int status, @@ -1373,7 +1373,7 @@ qemuMonitorEmitBlockJob(qemuMonitorPtr mon, int -qemuMonitorEmitJobStatusChange(qemuMonitorPtr mon, +qemuMonitorEmitJobStatusChange(qemuMonitor *mon, const char *jobname, qemuMonitorJobStatus status) { @@ -1386,7 +1386,7 @@ qemuMonitorEmitJobStatusChange(qemuMonitorPtr mon, int -qemuMonitorEmitBalloonChange(qemuMonitorPtr mon, +qemuMonitorEmitBalloonChange(qemuMonitor *mon, unsigned long long actual) { int ret = -1; @@ -1398,7 +1398,7 @@ qemuMonitorEmitBalloonChange(qemuMonitorPtr mon, int -qemuMonitorEmitDeviceDeleted(qemuMonitorPtr mon, +qemuMonitorEmitDeviceDeleted(qemuMonitor *mon, const char *devAlias) { int ret = -1; @@ -1411,7 +1411,7 @@ qemuMonitorEmitDeviceDeleted(qemuMonitorPtr mon, int -qemuMonitorEmitNicRxFilterChanged(qemuMonitorPtr mon, +qemuMonitorEmitNicRxFilterChanged(qemuMonitor *mon, const char *devAlias) { int ret = -1; @@ -1424,7 +1424,7 @@ qemuMonitorEmitNicRxFilterChanged(qemuMonitorPtr mon, int -qemuMonitorEmitSerialChange(qemuMonitorPtr mon, +qemuMonitorEmitSerialChange(qemuMonitor *mon, const char *devAlias, bool connected) { @@ -1438,7 +1438,7 @@ qemuMonitorEmitSerialChange(qemuMonitorPtr mon, int -qemuMonitorEmitSpiceMigrated(qemuMonitorPtr mon) +qemuMonitorEmitSpiceMigrated(qemuMonitor *mon) { int ret = -1; VIR_DEBUG("mon=%p", mon); @@ -1450,8 +1450,8 @@ qemuMonitorEmitSpiceMigrated(qemuMonitorPtr mon) int -qemuMonitorEmitMemoryFailure(qemuMonitorPtr mon, - qemuMonitorEventMemoryFailurePtr mfp) +qemuMonitorEmitMemoryFailure(qemuMonitor *mon, + qemuMonitorEventMemoryFailure *mfp) { int ret = -1; @@ -1462,7 +1462,7 @@ qemuMonitorEmitMemoryFailure(qemuMonitorPtr mon, int -qemuMonitorEmitMigrationStatus(qemuMonitorPtr mon, +qemuMonitorEmitMigrationStatus(qemuMonitor *mon, int status) { int ret = -1; @@ -1476,7 +1476,7 @@ qemuMonitorEmitMigrationStatus(qemuMonitorPtr mon, int -qemuMonitorEmitMigrationPass(qemuMonitorPtr mon, +qemuMonitorEmitMigrationPass(qemuMonitor *mon, int pass) { int ret = -1; @@ -1489,7 +1489,7 @@ qemuMonitorEmitMigrationPass(qemuMonitorPtr mon, int -qemuMonitorEmitAcpiOstInfo(qemuMonitorPtr mon, +qemuMonitorEmitAcpiOstInfo(qemuMonitor *mon, const char *alias, const char *slotType, const char *slot, @@ -1508,7 +1508,7 @@ qemuMonitorEmitAcpiOstInfo(qemuMonitorPtr mon, int -qemuMonitorEmitBlockThreshold(qemuMonitorPtr mon, +qemuMonitorEmitBlockThreshold(qemuMonitor *mon, const char *nodename, unsigned long long threshold, unsigned long long excess) @@ -1526,9 +1526,9 @@ qemuMonitorEmitBlockThreshold(qemuMonitorPtr mon, int -qemuMonitorEmitDumpCompleted(qemuMonitorPtr mon, +qemuMonitorEmitDumpCompleted(qemuMonitor *mon, int status, - qemuMonitorDumpStatsPtr stats, + qemuMonitorDumpStats *stats, const char *error) { int ret = -1; @@ -1543,7 +1543,7 @@ qemuMonitorEmitDumpCompleted(qemuMonitorPtr mon, int -qemuMonitorEmitPRManagerStatusChanged(qemuMonitorPtr mon, +qemuMonitorEmitPRManagerStatusChanged(qemuMonitor *mon, const char *prManager, bool connected) { @@ -1558,7 +1558,7 @@ qemuMonitorEmitPRManagerStatusChanged(qemuMonitorPtr mon, int -qemuMonitorEmitRdmaGidStatusChanged(qemuMonitorPtr mon, +qemuMonitorEmitRdmaGidStatusChanged(qemuMonitor *mon, const char *netdev, bool gid_status, unsigned long long subnet_prefix, @@ -1576,7 +1576,7 @@ qemuMonitorEmitRdmaGidStatusChanged(qemuMonitorPtr mon, int -qemuMonitorEmitGuestCrashloaded(qemuMonitorPtr mon) +qemuMonitorEmitGuestCrashloaded(qemuMonitor *mon) { int ret = -1; VIR_DEBUG("mon=%p", mon); @@ -1586,7 +1586,7 @@ qemuMonitorEmitGuestCrashloaded(qemuMonitorPtr mon) int -qemuMonitorSetCapabilities(qemuMonitorPtr mon) +qemuMonitorSetCapabilities(qemuMonitor *mon) { QEMU_CHECK_MONITOR(mon); @@ -1595,7 +1595,7 @@ qemuMonitorSetCapabilities(qemuMonitorPtr mon) int -qemuMonitorStartCPUs(qemuMonitorPtr mon) +qemuMonitorStartCPUs(qemuMonitor *mon) { QEMU_CHECK_MONITOR(mon); @@ -1604,7 +1604,7 @@ qemuMonitorStartCPUs(qemuMonitorPtr mon) int -qemuMonitorStopCPUs(qemuMonitorPtr mon) +qemuMonitorStopCPUs(qemuMonitor *mon) { QEMU_CHECK_MONITOR(mon); @@ -1613,7 +1613,7 @@ qemuMonitorStopCPUs(qemuMonitorPtr mon) int -qemuMonitorCheck(qemuMonitorPtr mon) +qemuMonitorCheck(qemuMonitor *mon) { bool running; return qemuMonitorGetStatus(mon, &running, NULL); @@ -1621,7 +1621,7 @@ qemuMonitorCheck(qemuMonitorPtr mon) int -qemuMonitorGetStatus(qemuMonitorPtr mon, +qemuMonitorGetStatus(qemuMonitor *mon, bool *running, virDomainPausedReason *reason) { @@ -1634,7 +1634,7 @@ qemuMonitorGetStatus(qemuMonitorPtr mon, int -qemuMonitorSystemPowerdown(qemuMonitorPtr mon) +qemuMonitorSystemPowerdown(qemuMonitor *mon) { QEMU_CHECK_MONITOR(mon); @@ -1643,7 +1643,7 @@ qemuMonitorSystemPowerdown(qemuMonitorPtr mon) int -qemuMonitorSystemReset(qemuMonitorPtr mon) +qemuMonitorSystemReset(qemuMonitor *mon) { QEMU_CHECK_MONITOR(mon); @@ -1652,7 +1652,7 @@ qemuMonitorSystemReset(qemuMonitorPtr mon) static void -qemuMonitorCPUInfoClear(qemuMonitorCPUInfoPtr cpus, +qemuMonitorCPUInfoClear(qemuMonitorCPUInfo *cpus, size_t ncpus) { size_t i; @@ -1679,7 +1679,7 @@ qemuMonitorCPUInfoClear(qemuMonitorCPUInfoPtr cpus, void -qemuMonitorCPUInfoFree(qemuMonitorCPUInfoPtr cpus, +qemuMonitorCPUInfoFree(qemuMonitorCPUInfo *cpus, size_t ncpus) { if (!cpus) @@ -1712,7 +1712,7 @@ qemuMonitorQueryCpusFree(struct qemuMonitorQueryCpusEntry *entries, static void qemuMonitorGetCPUInfoLegacy(struct qemuMonitorQueryCpusEntry *cpuentries, size_t ncpuentries, - qemuMonitorCPUInfoPtr vcpus, + qemuMonitorCPUInfo *vcpus, size_t maxvcpus) { size_t i; @@ -1763,7 +1763,7 @@ qemuMonitorGetCPUInfoHotplug(struct qemuMonitorQueryHotpluggableCpusEntry *hotpl size_t nhotplugvcpus, struct qemuMonitorQueryCpusEntry *cpuentries, size_t ncpuentries, - qemuMonitorCPUInfoPtr vcpus, + qemuMonitorCPUInfo *vcpus, size_t maxvcpus) { char *tmp; @@ -1888,8 +1888,8 @@ qemuMonitorGetCPUInfoHotplug(struct qemuMonitorQueryHotpluggableCpusEntry *hotpl * -1 on error (reports libvirt error). */ int -qemuMonitorGetCPUInfo(qemuMonitorPtr mon, - qemuMonitorCPUInfoPtr *vcpus, +qemuMonitorGetCPUInfo(qemuMonitor *mon, + qemuMonitorCPUInfo **vcpus, size_t maxvcpus, bool hotplug, bool fast) @@ -1900,7 +1900,7 @@ qemuMonitorGetCPUInfo(qemuMonitorPtr mon, size_t ncpuentries = 0; int ret = -1; int rc; - qemuMonitorCPUInfoPtr info = NULL; + qemuMonitorCPUInfo *info = NULL; QEMU_CHECK_MONITOR(mon); @@ -1952,8 +1952,8 @@ qemuMonitorGetCPUInfo(qemuMonitorPtr mon, * Returns a bitmap of vcpu id's that are halted. The id's correspond to the * 'CPU' field as reported by query-cpus[-fast]'. */ -virBitmapPtr -qemuMonitorGetCpuHalted(qemuMonitorPtr mon, +virBitmap * +qemuMonitorGetCpuHalted(qemuMonitor *mon, size_t maxvcpus, bool fast) { @@ -1961,7 +1961,7 @@ qemuMonitorGetCpuHalted(qemuMonitorPtr mon, size_t ncpuentries = 0; size_t i; int rc; - virBitmapPtr ret = NULL; + virBitmap *ret = NULL; QEMU_CHECK_MONITOR_NULL(mon); @@ -1985,7 +1985,7 @@ qemuMonitorGetCpuHalted(qemuMonitorPtr mon, int -qemuMonitorSetLink(qemuMonitorPtr mon, +qemuMonitorSetLink(qemuMonitor *mon, const char *name, virDomainNetInterfaceLinkState state) { @@ -2002,7 +2002,7 @@ qemuMonitorSetLink(qemuMonitorPtr mon, * or -1 on failure */ int -qemuMonitorGetBalloonInfo(qemuMonitorPtr mon, +qemuMonitorGetBalloonInfo(qemuMonitor *mon, unsigned long long *currmem) { QEMU_CHECK_MONITOR(mon); @@ -2012,8 +2012,8 @@ qemuMonitorGetBalloonInfo(qemuMonitorPtr mon, int -qemuMonitorGetMemoryStats(qemuMonitorPtr mon, - virDomainMemballoonDefPtr balloon, +qemuMonitorGetMemoryStats(qemuMonitor *mon, + virDomainMemballoonDef *balloon, virDomainMemoryStatPtr stats, unsigned int nr_stats) { @@ -2035,8 +2035,8 @@ qemuMonitorGetMemoryStats(qemuMonitorPtr mon, * Returns 0 on success and -1 on error, but does *not* set an error. */ int -qemuMonitorSetMemoryStatsPeriod(qemuMonitorPtr mon, - virDomainMemballoonDefPtr balloon, +qemuMonitorSetMemoryStatsPeriod(qemuMonitor *mon, + virDomainMemballoonDef *balloon, int period) { int ret = -1; @@ -2104,7 +2104,7 @@ qemuDomainDiskInfoFree(void *value) GHashTable * -qemuMonitorGetBlockInfo(qemuMonitorPtr mon) +qemuMonitorGetBlockInfo(qemuMonitor *mon) { int ret; GHashTable *table; @@ -2131,8 +2131,8 @@ qemuMonitorGetBlockInfo(qemuMonitorPtr mon) * * Returns data from a call to 'query-blockstats'. */ -virJSONValuePtr -qemuMonitorQueryBlockstats(qemuMonitorPtr mon) +virJSONValue * +qemuMonitorQueryBlockstats(qemuMonitor *mon) { QEMU_CHECK_MONITOR_NULL(mon); @@ -2153,7 +2153,7 @@ qemuMonitorQueryBlockstats(qemuMonitorPtr mon) * Returns < 0 on error, count of supported block stats fields on success. */ int -qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, +qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, GHashTable **ret_stats, bool backingChain) { @@ -2182,7 +2182,7 @@ qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, /* Updates "stats" to fill virtual and physical size of the image */ int -qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, +qemuMonitorBlockStatsUpdateCapacity(qemuMonitor *mon, GHashTable *stats, bool backingChain) { @@ -2195,7 +2195,7 @@ qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, int -qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, +qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon, GHashTable *stats) { VIR_DEBUG("stats=%p", stats); @@ -2212,11 +2212,11 @@ qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, * @supports_flat: don't query data for backing store * * Uses 'query-named-block-nodes' to retrieve information about individual - * storage nodes and returns them in a hash table of qemuBlockNamedNodeDataPtrs + * storage nodes and returns them in a hash table of qemuBlockNamedNodeData *s * filled with the data. The hash table keys are node names. */ GHashTable * -qemuMonitorBlockGetNamedNodeData(qemuMonitorPtr mon, +qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon, bool supports_flat) { QEMU_CHECK_MONITOR_NULL(mon); @@ -2227,7 +2227,7 @@ qemuMonitorBlockGetNamedNodeData(qemuMonitorPtr mon, int -qemuMonitorBlockResize(qemuMonitorPtr mon, +qemuMonitorBlockResize(qemuMonitor *mon, const char *device, const char *nodename, unsigned long long size) @@ -2265,7 +2265,7 @@ qemuMonitorTypeToProtocol(int type) int -qemuMonitorSetPassword(qemuMonitorPtr mon, +qemuMonitorSetPassword(qemuMonitor *mon, int type, const char *password, const char *action_if_connected) @@ -2291,7 +2291,7 @@ qemuMonitorSetPassword(qemuMonitorPtr mon, int -qemuMonitorExpirePassword(qemuMonitorPtr mon, +qemuMonitorExpirePassword(qemuMonitor *mon, int type, const char *expire_time) { @@ -2316,7 +2316,7 @@ qemuMonitorExpirePassword(qemuMonitorPtr mon, * or -1 on failure */ int -qemuMonitorSetBalloon(qemuMonitorPtr mon, +qemuMonitorSetBalloon(qemuMonitor *mon, unsigned long long newmem) { VIR_DEBUG("newmem=%llu", newmem); @@ -2331,7 +2331,7 @@ qemuMonitorSetBalloon(qemuMonitorPtr mon, * Returns: 0 if CPU modification was successful or -1 on failure */ int -qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, bool online) +qemuMonitorSetCPU(qemuMonitor *mon, int cpu, bool online) { VIR_DEBUG("cpu=%d online=%d", cpu, online); @@ -2342,7 +2342,7 @@ qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, bool online) int -qemuMonitorEjectMedia(qemuMonitorPtr mon, +qemuMonitorEjectMedia(qemuMonitor *mon, const char *dev_name, bool force) { @@ -2355,7 +2355,7 @@ qemuMonitorEjectMedia(qemuMonitorPtr mon, int -qemuMonitorChangeMedia(qemuMonitorPtr mon, +qemuMonitorChangeMedia(qemuMonitor *mon, const char *dev_name, const char *newmedia, const char *format) @@ -2369,7 +2369,7 @@ qemuMonitorChangeMedia(qemuMonitorPtr mon, int -qemuMonitorSaveVirtualMemory(qemuMonitorPtr mon, +qemuMonitorSaveVirtualMemory(qemuMonitor *mon, unsigned long long offset, unsigned long long length, const char *path) @@ -2383,7 +2383,7 @@ qemuMonitorSaveVirtualMemory(qemuMonitorPtr mon, int -qemuMonitorSavePhysicalMemory(qemuMonitorPtr mon, +qemuMonitorSavePhysicalMemory(qemuMonitor *mon, unsigned long long offset, unsigned long long length, const char *path) @@ -2397,7 +2397,7 @@ qemuMonitorSavePhysicalMemory(qemuMonitorPtr mon, int -qemuMonitorSetDBusVMStateIdList(qemuMonitorPtr mon, +qemuMonitorSetDBusVMStateIdList(qemuMonitor *mon, GSList *list) { g_autofree char *path = NULL; @@ -2424,7 +2424,7 @@ qemuMonitorSetDBusVMStateIdList(qemuMonitorPtr mon, int -qemuMonitorSetMigrationSpeed(qemuMonitorPtr mon, +qemuMonitorSetMigrationSpeed(qemuMonitor *mon, unsigned long bandwidth) { VIR_DEBUG("bandwidth=%lu", bandwidth); @@ -2443,7 +2443,7 @@ qemuMonitorSetMigrationSpeed(qemuMonitorPtr mon, int -qemuMonitorSetMigrationDowntime(qemuMonitorPtr mon, +qemuMonitorSetMigrationDowntime(qemuMonitor *mon, unsigned long long downtime) { VIR_DEBUG("downtime=%llu", downtime); @@ -2455,7 +2455,7 @@ qemuMonitorSetMigrationDowntime(qemuMonitorPtr mon, int -qemuMonitorGetMigrationCacheSize(qemuMonitorPtr mon, +qemuMonitorGetMigrationCacheSize(qemuMonitor *mon, unsigned long long *cacheSize) { VIR_DEBUG("cacheSize=%p", cacheSize); @@ -2467,7 +2467,7 @@ qemuMonitorGetMigrationCacheSize(qemuMonitorPtr mon, int -qemuMonitorSetMigrationCacheSize(qemuMonitorPtr mon, +qemuMonitorSetMigrationCacheSize(qemuMonitor *mon, unsigned long long cacheSize) { VIR_DEBUG("cacheSize=%llu", cacheSize); @@ -2490,8 +2490,8 @@ qemuMonitorSetMigrationCacheSize(qemuMonitorPtr mon, * Returns 0 on success, -1 on error. */ int -qemuMonitorGetMigrationParams(qemuMonitorPtr mon, - virJSONValuePtr *params) +qemuMonitorGetMigrationParams(qemuMonitor *mon, + virJSONValue **params) { QEMU_CHECK_MONITOR(mon); @@ -2509,8 +2509,8 @@ qemuMonitorGetMigrationParams(qemuMonitorPtr mon, * Returns 0 on success, -1 on error. */ int -qemuMonitorSetMigrationParams(qemuMonitorPtr mon, - virJSONValuePtr *params) +qemuMonitorSetMigrationParams(qemuMonitor *mon, + virJSONValue **params) { QEMU_CHECK_MONITOR(mon); @@ -2519,8 +2519,8 @@ qemuMonitorSetMigrationParams(qemuMonitorPtr mon, int -qemuMonitorGetMigrationStats(qemuMonitorPtr mon, - qemuMonitorMigrationStatsPtr stats, +qemuMonitorGetMigrationStats(qemuMonitor *mon, + qemuMonitorMigrationStats *stats, char **error) { QEMU_CHECK_MONITOR(mon); @@ -2533,7 +2533,7 @@ qemuMonitorGetMigrationStats(qemuMonitorPtr mon, int -qemuMonitorMigrateToFd(qemuMonitorPtr mon, +qemuMonitorMigrateToFd(qemuMonitor *mon, unsigned int flags, int fd) { @@ -2557,7 +2557,7 @@ qemuMonitorMigrateToFd(qemuMonitorPtr mon, int -qemuMonitorMigrateToHost(qemuMonitorPtr mon, +qemuMonitorMigrateToHost(qemuMonitor *mon, unsigned int flags, const char *protocol, const char *hostname, @@ -2581,7 +2581,7 @@ qemuMonitorMigrateToHost(qemuMonitorPtr mon, int -qemuMonitorMigrateToSocket(qemuMonitorPtr mon, +qemuMonitorMigrateToSocket(qemuMonitor *mon, unsigned int flags, const char *socketPath) { @@ -2596,7 +2596,7 @@ qemuMonitorMigrateToSocket(qemuMonitorPtr mon, int -qemuMonitorMigrateCancel(qemuMonitorPtr mon) +qemuMonitorMigrateCancel(qemuMonitor *mon) { QEMU_CHECK_MONITOR(mon); @@ -2605,8 +2605,8 @@ qemuMonitorMigrateCancel(qemuMonitorPtr mon) int -qemuMonitorQueryDump(qemuMonitorPtr mon, - qemuMonitorDumpStatsPtr stats) +qemuMonitorQueryDump(qemuMonitor *mon, + qemuMonitorDumpStats *stats) { QEMU_CHECK_MONITOR(mon); @@ -2618,7 +2618,7 @@ qemuMonitorQueryDump(qemuMonitorPtr mon, * Returns 1 if @capability is supported, 0 if it's not, or -1 on error. */ int -qemuMonitorGetDumpGuestMemoryCapability(qemuMonitorPtr mon, +qemuMonitorGetDumpGuestMemoryCapability(qemuMonitor *mon, const char *capability) { VIR_DEBUG("capability=%s", capability); @@ -2630,7 +2630,7 @@ qemuMonitorGetDumpGuestMemoryCapability(qemuMonitorPtr mon, int -qemuMonitorDumpToFd(qemuMonitorPtr mon, +qemuMonitorDumpToFd(qemuMonitor *mon, int fd, const char *dumpformat, bool detach) @@ -2655,7 +2655,7 @@ qemuMonitorDumpToFd(qemuMonitorPtr mon, int -qemuMonitorGraphicsRelocate(qemuMonitorPtr mon, +qemuMonitorGraphicsRelocate(qemuMonitor *mon, int type, const char *hostname, int port, @@ -2688,11 +2688,11 @@ qemuMonitorGraphicsRelocate(qemuMonitorPtr mon, * via the file path /dev/fdset/$FDSETID * Returns 0 if ok, and -1 on failure */ int -qemuMonitorAddFileHandleToSet(qemuMonitorPtr mon, +qemuMonitorAddFileHandleToSet(qemuMonitor *mon, int fd, int fdset, const char *opaque, - qemuMonitorAddFdInfoPtr info) + qemuMonitorAddFdInfo *info) { VIR_DEBUG("fd=%d,fdset=%i,opaque=%s", fd, fdset, opaque); @@ -2716,7 +2716,7 @@ qemuMonitorAddFileHandleToSet(qemuMonitorPtr mon, * Attempts to remove a fdset from qemu and close associated file descriptors * Returns 0 if ok, and -1 on failure */ int -qemuMonitorRemoveFdset(qemuMonitorPtr mon, +qemuMonitorRemoveFdset(qemuMonitor *mon, int fdset) { VIR_DEBUG("fdset=%d", fdset); @@ -2733,13 +2733,13 @@ qemuMonitorRemoveFdset(qemuMonitorPtr mon, } -void qemuMonitorFdsetsFree(qemuMonitorFdsetsPtr fdsets) +void qemuMonitorFdsetsFree(qemuMonitorFdsets *fdsets) { size_t i; for (i = 0; i < fdsets->nfdsets; i++) { size_t j; - qemuMonitorFdsetInfoPtr set = &fdsets->fdsets[i]; + qemuMonitorFdsetInfo *set = &fdsets->fdsets[i]; for (j = 0; j < set->nfds; j++) g_free(set->fds[j].opaque); @@ -2762,8 +2762,8 @@ void qemuMonitorFdsetsFree(qemuMonitorFdsetsPtr fdsets) * * Returns 0 if ok, and -1 on failure */ int -qemuMonitorQueryFdsets(qemuMonitorPtr mon, - qemuMonitorFdsetsPtr *fdsets) +qemuMonitorQueryFdsets(qemuMonitor *mon, + qemuMonitorFdsets **fdsets) { QEMU_CHECK_MONITOR(mon); @@ -2772,7 +2772,7 @@ qemuMonitorQueryFdsets(qemuMonitorPtr mon, int -qemuMonitorSendFileHandle(qemuMonitorPtr mon, +qemuMonitorSendFileHandle(qemuMonitor *mon, const char *fdname, int fd) { @@ -2791,7 +2791,7 @@ qemuMonitorSendFileHandle(qemuMonitorPtr mon, int -qemuMonitorCloseFileHandle(qemuMonitorPtr mon, +qemuMonitorCloseFileHandle(qemuMonitor *mon, const char *fdname) { int ret = -1; @@ -2812,8 +2812,8 @@ qemuMonitorCloseFileHandle(qemuMonitorPtr mon, int -qemuMonitorAddNetdev(qemuMonitorPtr mon, - virJSONValuePtr *props, +qemuMonitorAddNetdev(qemuMonitor *mon, + virJSONValue **props, int *tapfd, char **tapfdName, int tapfdSize, int *vhostfd, char **vhostfdName, int vhostfdSize, int slirpfd, char *slirpfdName) @@ -2863,7 +2863,7 @@ qemuMonitorAddNetdev(qemuMonitorPtr mon, int -qemuMonitorRemoveNetdev(qemuMonitorPtr mon, +qemuMonitorRemoveNetdev(qemuMonitor *mon, const char *alias) { VIR_DEBUG("alias=%s", alias); @@ -2875,8 +2875,8 @@ qemuMonitorRemoveNetdev(qemuMonitorPtr mon, int -qemuMonitorQueryRxFilter(qemuMonitorPtr mon, const char *alias, - virNetDevRxFilterPtr *filter) +qemuMonitorQueryRxFilter(qemuMonitor *mon, const char *alias, + virNetDevRxFilter **filter) { VIR_DEBUG("alias=%s filter=%p", alias, filter); @@ -2889,7 +2889,7 @@ qemuMonitorQueryRxFilter(qemuMonitorPtr mon, const char *alias, void qemuMonitorChardevInfoFree(void *data) { - qemuMonitorChardevInfoPtr info = data; + qemuMonitorChardevInfo *info = data; g_free(info->ptyPath); g_free(info); @@ -2897,7 +2897,7 @@ qemuMonitorChardevInfoFree(void *data) int -qemuMonitorGetChardevInfo(qemuMonitorPtr mon, +qemuMonitorGetChardevInfo(qemuMonitor *mon, GHashTable **retinfo) { int ret; @@ -2933,7 +2933,7 @@ qemuMonitorGetChardevInfo(qemuMonitorPtr mon, * Attempts to remove a host drive. * Returns 1 if unsupported, 0 if ok, and -1 on other failure */ int -qemuMonitorDriveDel(qemuMonitorPtr mon, +qemuMonitorDriveDel(qemuMonitor *mon, const char *drivestr) { VIR_DEBUG("drivestr=%s", drivestr); @@ -2956,7 +2956,7 @@ qemuMonitorDriveDel(qemuMonitorPtr mon, * -1 otherwise (error reported) */ int -qemuMonitorDelDevice(qemuMonitorPtr mon, +qemuMonitorDelDevice(qemuMonitor *mon, const char *devalias) { VIR_DEBUG("devalias=%s", devalias); @@ -2968,7 +2968,7 @@ qemuMonitorDelDevice(qemuMonitorPtr mon, int -qemuMonitorAddDeviceWithFd(qemuMonitorPtr mon, +qemuMonitorAddDeviceWithFd(qemuMonitor *mon, const char *devicestr, int fd, const char *fdname) @@ -2994,7 +2994,7 @@ qemuMonitorAddDeviceWithFd(qemuMonitorPtr mon, int -qemuMonitorAddDevice(qemuMonitorPtr mon, +qemuMonitorAddDevice(qemuMonitor *mon, const char *devicestr) { return qemuMonitorAddDeviceWithFd(mon, devicestr, -1, NULL); @@ -3010,8 +3010,8 @@ qemuMonitorAddDevice(qemuMonitorPtr mon, * Returns 0 on success -1 on error. */ int -qemuMonitorAddDeviceArgs(qemuMonitorPtr mon, - virJSONValuePtr args) +qemuMonitorAddDeviceArgs(qemuMonitor *mon, + virJSONValue *args) { QEMU_CHECK_MONITOR(mon); @@ -3029,7 +3029,7 @@ qemuMonitorAddDeviceArgs(qemuMonitorPtr mon, * Returns a JSONValue containing everything on success and NULL on error. */ int -qemuMonitorCreateObjectProps(virJSONValuePtr *propsret, +qemuMonitorCreateObjectProps(virJSONValue **propsret, const char *type, const char *alias, ...) @@ -3071,8 +3071,8 @@ qemuMonitorCreateObjectProps(virJSONValuePtr *propsret, * Returns 0 on success -1 on error. */ int -qemuMonitorAddObject(qemuMonitorPtr mon, - virJSONValuePtr *props, +qemuMonitorAddObject(qemuMonitor *mon, + virJSONValue **props, char **alias) { g_autoptr(virJSONValue) pr = NULL; @@ -3138,7 +3138,7 @@ qemuMonitorAddObject(qemuMonitorPtr mon, int -qemuMonitorDelObject(qemuMonitorPtr mon, +qemuMonitorDelObject(qemuMonitor *mon, const char *objalias, bool report_error) { @@ -3151,7 +3151,7 @@ qemuMonitorDelObject(qemuMonitorPtr mon, int -qemuMonitorAddDrive(qemuMonitorPtr mon, +qemuMonitorAddDrive(qemuMonitor *mon, const char *drivestr) { VIR_DEBUG("drive=%s", drivestr); @@ -3164,7 +3164,7 @@ qemuMonitorAddDrive(qemuMonitorPtr mon, int -qemuMonitorCreateSnapshot(qemuMonitorPtr mon, const char *name) +qemuMonitorCreateSnapshot(qemuMonitor *mon, const char *name) { VIR_DEBUG("name=%s", name); @@ -3175,7 +3175,7 @@ qemuMonitorCreateSnapshot(qemuMonitorPtr mon, const char *name) } int -qemuMonitorLoadSnapshot(qemuMonitorPtr mon, const char *name) +qemuMonitorLoadSnapshot(qemuMonitor *mon, const char *name) { VIR_DEBUG("name=%s", name); @@ -3187,7 +3187,7 @@ qemuMonitorLoadSnapshot(qemuMonitorPtr mon, const char *name) int -qemuMonitorDeleteSnapshot(qemuMonitorPtr mon, const char *name) +qemuMonitorDeleteSnapshot(qemuMonitor *mon, const char *name) { VIR_DEBUG("name=%s", name); @@ -3200,7 +3200,7 @@ qemuMonitorDeleteSnapshot(qemuMonitorPtr mon, const char *name) /* Start a drive-mirror block job. bandwidth is in bytes/sec. */ int -qemuMonitorDriveMirror(qemuMonitorPtr mon, +qemuMonitorDriveMirror(qemuMonitor *mon, const char *device, const char *file, const char *format, unsigned long long bandwidth, unsigned int granularity, unsigned long long buf_size, @@ -3220,7 +3220,7 @@ qemuMonitorDriveMirror(qemuMonitorPtr mon, int -qemuMonitorBlockdevMirror(qemuMonitorPtr mon, +qemuMonitorBlockdevMirror(qemuMonitor *mon, const char *jobname, bool persistjob, const char *device, @@ -3244,7 +3244,7 @@ qemuMonitorBlockdevMirror(qemuMonitorPtr mon, /* Use the transaction QMP command to run atomic snapshot commands. */ int -qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions) +qemuMonitorTransaction(qemuMonitor *mon, virJSONValue **actions) { VIR_DEBUG("actions=%p", *actions); @@ -3256,7 +3256,7 @@ qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions) /* Start a block-commit block job. bandwidth is in bytes/sec. */ int -qemuMonitorBlockCommit(qemuMonitorPtr mon, +qemuMonitorBlockCommit(qemuMonitor *mon, const char *device, const char *jobname, bool persistjob, @@ -3282,7 +3282,7 @@ qemuMonitorBlockCommit(qemuMonitorPtr mon, /* Probe whether active commits are supported by a given qemu binary. */ bool -qemuMonitorSupportsActiveCommit(qemuMonitorPtr mon) +qemuMonitorSupportsActiveCommit(qemuMonitor *mon) { if (!mon) return false; @@ -3294,10 +3294,10 @@ qemuMonitorSupportsActiveCommit(qemuMonitorPtr mon) /* Determine the name that qemu is using for tracking the backing * element TARGET within the chain starting at TOP. */ char * -qemuMonitorDiskNameLookup(qemuMonitorPtr mon, +qemuMonitorDiskNameLookup(qemuMonitor *mon, const char *device, - virStorageSourcePtr top, - virStorageSourcePtr target) + virStorageSource *top, + virStorageSource *target) { QEMU_CHECK_MONITOR_NULL(mon); @@ -3307,7 +3307,7 @@ qemuMonitorDiskNameLookup(qemuMonitorPtr mon, /* Use the block-job-complete monitor command to pivot a block copy job. */ int -qemuMonitorDrivePivot(qemuMonitorPtr mon, +qemuMonitorDrivePivot(qemuMonitor *mon, const char *jobname) { VIR_DEBUG("jobname=%s", jobname); @@ -3319,7 +3319,7 @@ qemuMonitorDrivePivot(qemuMonitorPtr mon, int -qemuMonitorArbitraryCommand(qemuMonitorPtr mon, +qemuMonitorArbitraryCommand(qemuMonitor *mon, const char *cmd, char **reply, bool hmp) @@ -3336,7 +3336,7 @@ qemuMonitorArbitraryCommand(qemuMonitorPtr mon, int -qemuMonitorInjectNMI(qemuMonitorPtr mon) +qemuMonitorInjectNMI(qemuMonitor *mon) { QEMU_CHECK_MONITOR(mon); @@ -3345,7 +3345,7 @@ qemuMonitorInjectNMI(qemuMonitorPtr mon) int -qemuMonitorSendKey(qemuMonitorPtr mon, +qemuMonitorSendKey(qemuMonitor *mon, unsigned int holdtime, unsigned int *keycodes, unsigned int nkeycodes) @@ -3359,7 +3359,7 @@ qemuMonitorSendKey(qemuMonitorPtr mon, int -qemuMonitorScreendump(qemuMonitorPtr mon, +qemuMonitorScreendump(qemuMonitor *mon, const char *device, unsigned int head, const char *file) @@ -3374,7 +3374,7 @@ qemuMonitorScreendump(qemuMonitorPtr mon, /* bandwidth is in bytes/sec */ int -qemuMonitorBlockStream(qemuMonitorPtr mon, +qemuMonitorBlockStream(qemuMonitor *mon, const char *device, const char *jobname, bool persistjob, @@ -3402,7 +3402,7 @@ qemuMonitorBlockStream(qemuMonitorPtr mon, int -qemuMonitorBlockJobCancel(qemuMonitorPtr mon, +qemuMonitorBlockJobCancel(qemuMonitor *mon, const char *jobname) { VIR_DEBUG("jobname=%s", jobname); @@ -3414,7 +3414,7 @@ qemuMonitorBlockJobCancel(qemuMonitorPtr mon, int -qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon, +qemuMonitorBlockJobSetSpeed(qemuMonitor *mon, const char *jobname, unsigned long long bandwidth) { @@ -3427,7 +3427,7 @@ qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon, GHashTable * -qemuMonitorGetAllBlockJobInfo(qemuMonitorPtr mon, +qemuMonitorGetAllBlockJobInfo(qemuMonitor *mon, bool rawjobname) { QEMU_CHECK_MONITOR_NULL(mon); @@ -3436,7 +3436,7 @@ qemuMonitorGetAllBlockJobInfo(qemuMonitorPtr mon, int -qemuMonitorJobDismiss(qemuMonitorPtr mon, +qemuMonitorJobDismiss(qemuMonitor *mon, const char *jobname) { VIR_DEBUG("jobname=%s", jobname); @@ -3448,7 +3448,7 @@ qemuMonitorJobDismiss(qemuMonitorPtr mon, int -qemuMonitorJobCancel(qemuMonitorPtr mon, +qemuMonitorJobCancel(qemuMonitor *mon, const char *jobname, bool quiet) { @@ -3461,7 +3461,7 @@ qemuMonitorJobCancel(qemuMonitorPtr mon, int -qemuMonitorJobComplete(qemuMonitorPtr mon, +qemuMonitorJobComplete(qemuMonitor *mon, const char *jobname) { VIR_DEBUG("jobname=%s", jobname); @@ -3473,10 +3473,10 @@ qemuMonitorJobComplete(qemuMonitorPtr mon, int -qemuMonitorSetBlockIoThrottle(qemuMonitorPtr mon, +qemuMonitorSetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, const char *qomid, - virDomainBlockIoTuneInfoPtr info, + virDomainBlockIoTuneInfo *info, bool supportMaxOptions, bool supportGroupNameOption, bool supportMaxLengthOptions) @@ -3494,10 +3494,10 @@ qemuMonitorSetBlockIoThrottle(qemuMonitorPtr mon, int -qemuMonitorGetBlockIoThrottle(qemuMonitorPtr mon, +qemuMonitorGetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, const char *qdevid, - virDomainBlockIoTuneInfoPtr reply) + virDomainBlockIoTuneInfo *reply) { VIR_DEBUG("drivealias=%s, qdevid=%s, reply=%p", NULLSTR(drivealias), NULLSTR(qdevid), reply); @@ -3564,7 +3564,7 @@ qemuMonitorVMStatusToPausedReason(const char *status) int -qemuMonitorOpenGraphics(qemuMonitorPtr mon, +qemuMonitorOpenGraphics(qemuMonitor *mon, const char *protocol, int fd, const char *fdname, @@ -3592,7 +3592,7 @@ qemuMonitorOpenGraphics(qemuMonitorPtr mon, int -qemuMonitorSystemWakeup(qemuMonitorPtr mon) +qemuMonitorSystemWakeup(qemuMonitor *mon) { QEMU_CHECK_MONITOR(mon); @@ -3601,7 +3601,7 @@ qemuMonitorSystemWakeup(qemuMonitorPtr mon) int -qemuMonitorGetVersion(qemuMonitorPtr mon, +qemuMonitorGetVersion(qemuMonitor *mon, int *major, int *minor, int *micro, @@ -3617,8 +3617,8 @@ qemuMonitorGetVersion(qemuMonitorPtr mon, int -qemuMonitorGetMachines(qemuMonitorPtr mon, - qemuMonitorMachineInfoPtr **machines) +qemuMonitorGetMachines(qemuMonitor *mon, + qemuMonitorMachineInfo ***machines) { VIR_DEBUG("machines=%p", machines); @@ -3629,7 +3629,7 @@ qemuMonitorGetMachines(qemuMonitorPtr mon, void -qemuMonitorMachineInfoFree(qemuMonitorMachineInfoPtr machine) +qemuMonitorMachineInfoFree(qemuMonitorMachineInfo *machine) { if (!machine) return; @@ -3642,8 +3642,8 @@ qemuMonitorMachineInfoFree(qemuMonitorMachineInfoPtr machine) int -qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon, - qemuMonitorCPUDefsPtr *cpuDefs) +qemuMonitorGetCPUDefinitions(qemuMonitor *mon, + qemuMonitorCPUDefs **cpuDefs) { VIR_DEBUG("cpuDefs=%p", cpuDefs); @@ -3654,7 +3654,7 @@ qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon, void -qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs) +qemuMonitorCPUDefsFree(qemuMonitorCPUDefs *defs) { size_t i; @@ -3672,7 +3672,7 @@ qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs) } -qemuMonitorCPUDefsPtr +qemuMonitorCPUDefs * qemuMonitorCPUDefsNew(size_t count) { g_autoptr(qemuMonitorCPUDefs) defs = NULL; @@ -3685,8 +3685,8 @@ qemuMonitorCPUDefsNew(size_t count) } -qemuMonitorCPUDefsPtr -qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr src) +qemuMonitorCPUDefs * +qemuMonitorCPUDefsCopy(qemuMonitorCPUDefs *src) { g_autoptr(qemuMonitorCPUDefs) defs = NULL; size_t i; @@ -3696,8 +3696,8 @@ qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr src) defs = qemuMonitorCPUDefsNew(src->ncpus); for (i = 0; i < src->ncpus; i++) { - qemuMonitorCPUDefInfoPtr cpuDst = defs->cpus + i; - qemuMonitorCPUDefInfoPtr cpuSrc = src->cpus + i; + qemuMonitorCPUDefInfo *cpuDst = defs->cpus + i; + qemuMonitorCPUDefInfo *cpuSrc = src->cpus + i; cpuDst->usable = cpuSrc->usable; cpuDst->name = g_strdup(cpuSrc->name); @@ -3711,12 +3711,12 @@ qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr src) int -qemuMonitorGetCPUModelExpansion(qemuMonitorPtr mon, +qemuMonitorGetCPUModelExpansion(qemuMonitor *mon, qemuMonitorCPUModelExpansionType type, - virCPUDefPtr cpu, + virCPUDef *cpu, bool migratable, bool fail_no_props, - qemuMonitorCPUModelInfoPtr *model_info) + qemuMonitorCPUModelInfo **model_info) { VIR_DEBUG("type=%d cpu=%p migratable=%d", type, cpu, migratable); @@ -3729,10 +3729,10 @@ qemuMonitorGetCPUModelExpansion(qemuMonitorPtr mon, int -qemuMonitorGetCPUModelBaseline(qemuMonitorPtr mon, - virCPUDefPtr cpu_a, - virCPUDefPtr cpu_b, - qemuMonitorCPUModelInfoPtr *baseline) +qemuMonitorGetCPUModelBaseline(qemuMonitor *mon, + virCPUDef *cpu_a, + virCPUDef *cpu_b, + qemuMonitorCPUModelInfo **baseline) { VIR_DEBUG("cpu_a=%p cpu_b=%p", cpu_a, cpu_b); @@ -3743,9 +3743,9 @@ qemuMonitorGetCPUModelBaseline(qemuMonitorPtr mon, int -qemuMonitorGetCPUModelComparison(qemuMonitorPtr mon, - virCPUDefPtr cpu_a, - virCPUDefPtr cpu_b, +qemuMonitorGetCPUModelComparison(qemuMonitor *mon, + virCPUDef *cpu_a, + virCPUDef *cpu_b, char **result) { VIR_DEBUG("cpu_a=%p cpu_b=%p", cpu_a, cpu_b); @@ -3757,7 +3757,7 @@ qemuMonitorGetCPUModelComparison(qemuMonitorPtr mon, void -qemuMonitorCPUModelInfoFree(qemuMonitorCPUModelInfoPtr model_info) +qemuMonitorCPUModelInfoFree(qemuMonitorCPUModelInfo *model_info) { size_t i; @@ -3776,10 +3776,10 @@ qemuMonitorCPUModelInfoFree(qemuMonitorCPUModelInfoPtr model_info) } -qemuMonitorCPUModelInfoPtr +qemuMonitorCPUModelInfo * qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModelInfo *orig) { - qemuMonitorCPUModelInfoPtr copy; + qemuMonitorCPUModelInfo *copy; size_t i; copy = g_new0(qemuMonitorCPUModelInfo, 1); @@ -3819,7 +3819,7 @@ qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModelInfo *orig) int -qemuMonitorGetCommands(qemuMonitorPtr mon, +qemuMonitorGetCommands(qemuMonitor *mon, char ***commands) { VIR_DEBUG("commands=%p", commands); @@ -3831,7 +3831,7 @@ qemuMonitorGetCommands(qemuMonitorPtr mon, int -qemuMonitorGetEvents(qemuMonitorPtr mon, +qemuMonitorGetEvents(qemuMonitor *mon, char ***events) { VIR_DEBUG("events=%p", events); @@ -3843,7 +3843,7 @@ qemuMonitorGetEvents(qemuMonitorPtr mon, GHashTable * -qemuMonitorGetCommandLineOptions(qemuMonitorPtr mon) +qemuMonitorGetCommandLineOptions(qemuMonitor *mon) { QEMU_CHECK_MONITOR_NULL(mon); @@ -3852,7 +3852,7 @@ qemuMonitorGetCommandLineOptions(qemuMonitorPtr mon) int -qemuMonitorGetKVMState(qemuMonitorPtr mon, +qemuMonitorGetKVMState(qemuMonitor *mon, bool *enabled, bool *present) { @@ -3865,7 +3865,7 @@ qemuMonitorGetKVMState(qemuMonitorPtr mon, int -qemuMonitorGetObjectTypes(qemuMonitorPtr mon, +qemuMonitorGetObjectTypes(qemuMonitor *mon, char ***types) { VIR_DEBUG("types=%p", types); @@ -3877,7 +3877,7 @@ qemuMonitorGetObjectTypes(qemuMonitorPtr mon, GHashTable * -qemuMonitorGetDeviceProps(qemuMonitorPtr mon, +qemuMonitorGetDeviceProps(qemuMonitor *mon, const char *device) { VIR_DEBUG("device=%s", device); @@ -3889,7 +3889,7 @@ qemuMonitorGetDeviceProps(qemuMonitorPtr mon, int -qemuMonitorGetObjectProps(qemuMonitorPtr mon, +qemuMonitorGetObjectProps(qemuMonitor *mon, const char *object, char ***props) { @@ -3902,7 +3902,7 @@ qemuMonitorGetObjectProps(qemuMonitorPtr mon, char * -qemuMonitorGetTargetArch(qemuMonitorPtr mon) +qemuMonitorGetTargetArch(qemuMonitor *mon) { QEMU_CHECK_MONITOR_NULL(mon); @@ -3911,7 +3911,7 @@ qemuMonitorGetTargetArch(qemuMonitorPtr mon) int -qemuMonitorGetMigrationCapabilities(qemuMonitorPtr mon, +qemuMonitorGetMigrationCapabilities(qemuMonitor *mon, char ***capabilities) { QEMU_CHECK_MONITOR(mon); @@ -3930,8 +3930,8 @@ qemuMonitorGetMigrationCapabilities(qemuMonitorPtr mon, * Returns 0 on success, -1 on error. */ int -qemuMonitorSetMigrationCapabilities(qemuMonitorPtr mon, - virJSONValuePtr *caps) +qemuMonitorSetMigrationCapabilities(qemuMonitor *mon, + virJSONValue **caps) { QEMU_CHECK_MONITOR(mon); @@ -3947,7 +3947,7 @@ qemuMonitorSetMigrationCapabilities(qemuMonitorPtr mon, * See qemuMonitorJSONGetGICCapabilities(). */ int -qemuMonitorGetGICCapabilities(qemuMonitorPtr mon, +qemuMonitorGetGICCapabilities(qemuMonitor *mon, virGICCapability **capabilities) { QEMU_CHECK_MONITOR(mon); @@ -3957,7 +3957,7 @@ qemuMonitorGetGICCapabilities(qemuMonitorPtr mon, int -qemuMonitorGetSEVCapabilities(qemuMonitorPtr mon, +qemuMonitorGetSEVCapabilities(qemuMonitor *mon, virSEVCapability **capabilities) { QEMU_CHECK_MONITOR(mon); @@ -3967,7 +3967,7 @@ qemuMonitorGetSEVCapabilities(qemuMonitorPtr mon, int -qemuMonitorNBDServerStart(qemuMonitorPtr mon, +qemuMonitorNBDServerStart(qemuMonitor *mon, const virStorageNetHostDef *server, const char *tls_alias) { @@ -3986,7 +3986,7 @@ qemuMonitorNBDServerStart(qemuMonitorPtr mon, int -qemuMonitorNBDServerAdd(qemuMonitorPtr mon, +qemuMonitorNBDServerAdd(qemuMonitor *mon, const char *deviceID, const char *export, bool writable, @@ -4003,7 +4003,7 @@ qemuMonitorNBDServerAdd(qemuMonitorPtr mon, int -qemuMonitorNBDServerStop(qemuMonitorPtr mon) +qemuMonitorNBDServerStop(qemuMonitor *mon) { QEMU_CHECK_MONITOR(mon); @@ -4012,8 +4012,8 @@ qemuMonitorNBDServerStop(qemuMonitorPtr mon) int -qemuMonitorBlockExportAdd(qemuMonitorPtr mon, - virJSONValuePtr *props) +qemuMonitorBlockExportAdd(qemuMonitor *mon, + virJSONValue **props) { QEMU_CHECK_MONITOR(mon); @@ -4022,7 +4022,7 @@ qemuMonitorBlockExportAdd(qemuMonitorPtr mon, int -qemuMonitorGetTPMModels(qemuMonitorPtr mon, +qemuMonitorGetTPMModels(qemuMonitor *mon, char ***tpmmodels) { VIR_DEBUG("tpmmodels=%p", tpmmodels); @@ -4034,7 +4034,7 @@ qemuMonitorGetTPMModels(qemuMonitorPtr mon, int -qemuMonitorGetTPMTypes(qemuMonitorPtr mon, +qemuMonitorGetTPMTypes(qemuMonitor *mon, char ***tpmtypes) { VIR_DEBUG("tpmtypes=%p", tpmtypes); @@ -4046,9 +4046,9 @@ qemuMonitorGetTPMTypes(qemuMonitorPtr mon, int -qemuMonitorAttachCharDev(qemuMonitorPtr mon, +qemuMonitorAttachCharDev(qemuMonitor *mon, const char *chrID, - virDomainChrSourceDefPtr chr) + virDomainChrSourceDef *chr) { VIR_DEBUG("chrID=%s chr=%p", chrID, chr); @@ -4059,7 +4059,7 @@ qemuMonitorAttachCharDev(qemuMonitorPtr mon, int -qemuMonitorDetachCharDev(qemuMonitorPtr mon, +qemuMonitorDetachCharDev(qemuMonitor *mon, const char *chrID) { VIR_DEBUG("chrID=%s", chrID); @@ -4071,7 +4071,7 @@ qemuMonitorDetachCharDev(qemuMonitorPtr mon, int -qemuMonitorGetDeviceAliases(qemuMonitorPtr mon, +qemuMonitorGetDeviceAliases(qemuMonitor *mon, char ***aliases) { VIR_DEBUG("aliases=%p", aliases); @@ -4094,7 +4094,7 @@ qemuMonitorGetDeviceAliases(qemuMonitorPtr mon, * locked already! */ void -qemuMonitorSetDomainLogLocked(qemuMonitorPtr mon, +qemuMonitorSetDomainLogLocked(qemuMonitor *mon, qemuMonitorReportDomainLogError func, void *opaque, virFreeCallback destroy) @@ -4120,7 +4120,7 @@ qemuMonitorSetDomainLogLocked(qemuMonitorPtr mon, * unlocked. */ void -qemuMonitorSetDomainLog(qemuMonitorPtr mon, +qemuMonitorSetDomainLog(qemuMonitor *mon, qemuMonitorReportDomainLogError func, void *opaque, virFreeCallback destroy) @@ -4143,9 +4143,9 @@ qemuMonitorSetDomainLog(qemuMonitorPtr mon, * -1 on other errors. */ int -qemuMonitorGetGuestCPUx86(qemuMonitorPtr mon, - virCPUDataPtr *data, - virCPUDataPtr *disabled) +qemuMonitorGetGuestCPUx86(qemuMonitor *mon, + virCPUData **data, + virCPUData **disabled) { VIR_DEBUG("data=%p disabled=%p", data, disabled); @@ -4174,12 +4174,12 @@ qemuMonitorGetGuestCPUx86(qemuMonitorPtr mon, * Returns 0 on success, -1 on error. */ int -qemuMonitorGetGuestCPU(qemuMonitorPtr mon, +qemuMonitorGetGuestCPU(qemuMonitor *mon, virArch arch, qemuMonitorCPUFeatureTranslationCallback translate, void *opaque, - virCPUDataPtr *enabled, - virCPUDataPtr *disabled) + virCPUData **enabled, + virCPUData **disabled) { VIR_DEBUG("arch=%s translate=%p opaque=%p enabled=%p disabled=%p", virArchToString(arch), translate, opaque, enabled, disabled); @@ -4208,7 +4208,7 @@ qemuMonitorGetGuestCPU(qemuMonitorPtr mon, * -1 on error. */ int -qemuMonitorRTCResetReinjection(qemuMonitorPtr mon) +qemuMonitorRTCResetReinjection(qemuMonitor *mon) { QEMU_CHECK_MONITOR(mon); @@ -4229,8 +4229,8 @@ qemuMonitorRTCResetReinjection(qemuMonitorPtr mon) * -1 on error. */ int -qemuMonitorGetIOThreads(qemuMonitorPtr mon, - qemuMonitorIOThreadInfoPtr **iothreads, +qemuMonitorGetIOThreads(qemuMonitor *mon, + qemuMonitorIOThreadInfo ***iothreads, int *niothreads) { VIR_DEBUG("iothreads=%p", iothreads); @@ -4249,8 +4249,8 @@ qemuMonitorGetIOThreads(qemuMonitorPtr mon, * Alter the specified IOThread's IOThreadInfo values. */ int -qemuMonitorSetIOThread(qemuMonitorPtr mon, - qemuMonitorIOThreadInfoPtr iothreadInfo) +qemuMonitorSetIOThread(qemuMonitor *mon, + qemuMonitorIOThreadInfo *iothreadInfo) { VIR_DEBUG("iothread=%p", iothreadInfo); @@ -4273,7 +4273,7 @@ qemuMonitorSetIOThread(qemuMonitorPtr mon, * other errors returns -1. */ int -qemuMonitorGetMemoryDeviceInfo(qemuMonitorPtr mon, +qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, GHashTable **info) { int ret; @@ -4297,7 +4297,7 @@ qemuMonitorGetMemoryDeviceInfo(qemuMonitorPtr mon, int -qemuMonitorMigrateIncoming(qemuMonitorPtr mon, +qemuMonitorMigrateIncoming(qemuMonitor *mon, const char *uri) { VIR_DEBUG("uri=%s", uri); @@ -4309,7 +4309,7 @@ qemuMonitorMigrateIncoming(qemuMonitorPtr mon, int -qemuMonitorMigrateStartPostCopy(qemuMonitorPtr mon) +qemuMonitorMigrateStartPostCopy(qemuMonitor *mon) { QEMU_CHECK_MONITOR(mon); @@ -4318,7 +4318,7 @@ qemuMonitorMigrateStartPostCopy(qemuMonitorPtr mon) int -qemuMonitorMigrateContinue(qemuMonitorPtr mon, +qemuMonitorMigrateContinue(qemuMonitor *mon, qemuMonitorMigrationStatus status) { VIR_DEBUG("status=%s", qemuMonitorMigrationStatusTypeToString(status)); @@ -4330,7 +4330,7 @@ qemuMonitorMigrateContinue(qemuMonitorPtr mon, int -qemuMonitorGetRTCTime(qemuMonitorPtr mon, +qemuMonitorGetRTCTime(qemuMonitor *mon, struct tm *tm) { QEMU_CHECK_MONITOR(mon); @@ -4339,8 +4339,8 @@ qemuMonitorGetRTCTime(qemuMonitorPtr mon, } -virJSONValuePtr -qemuMonitorQueryQMPSchema(qemuMonitorPtr mon) +virJSONValue * +qemuMonitorQueryQMPSchema(qemuMonitor *mon) { QEMU_CHECK_MONITOR_NULL(mon); @@ -4349,7 +4349,7 @@ qemuMonitorQueryQMPSchema(qemuMonitorPtr mon) int -qemuMonitorSetBlockThreshold(qemuMonitorPtr mon, +qemuMonitorSetBlockThreshold(qemuMonitor *mon, const char *nodename, unsigned long long threshold) { @@ -4361,8 +4361,8 @@ qemuMonitorSetBlockThreshold(qemuMonitorPtr mon, } -virJSONValuePtr -qemuMonitorQueryNamedBlockNodes(qemuMonitorPtr mon) +virJSONValue * +qemuMonitorQueryNamedBlockNodes(qemuMonitor *mon) { QEMU_CHECK_MONITOR_NULL(mon); @@ -4371,7 +4371,7 @@ qemuMonitorQueryNamedBlockNodes(qemuMonitorPtr mon) char * -qemuMonitorGuestPanicEventInfoFormatMsg(qemuMonitorEventPanicInfoPtr info) +qemuMonitorGuestPanicEventInfoFormatMsg(qemuMonitorEventPanicInfo *info) { char *ret = NULL; @@ -4401,7 +4401,7 @@ qemuMonitorGuestPanicEventInfoFormatMsg(qemuMonitorEventPanicInfoPtr info) void -qemuMonitorEventPanicInfoFree(qemuMonitorEventPanicInfoPtr info) +qemuMonitorEventPanicInfoFree(qemuMonitorEventPanicInfo *info) { if (!info) return; @@ -4421,7 +4421,7 @@ qemuMonitorEventPanicInfoFree(qemuMonitorEventPanicInfoPtr info) void -qemuMonitorEventRdmaGidStatusFree(qemuMonitorRdmaGidStatusPtr info) +qemuMonitorEventRdmaGidStatusFree(qemuMonitorRdmaGidStatus *info) { if (!info) return; @@ -4432,7 +4432,7 @@ qemuMonitorEventRdmaGidStatusFree(qemuMonitorRdmaGidStatusPtr info) int -qemuMonitorSetWatchdogAction(qemuMonitorPtr mon, +qemuMonitorSetWatchdogAction(qemuMonitor *mon, const char *action) { VIR_DEBUG("watchdogAction=%s", action); @@ -4458,9 +4458,9 @@ qemuMonitorSetWatchdogAction(qemuMonitorPtr mon, * accessed after calling this function. */ int -qemuMonitorBlockdevCreate(qemuMonitorPtr mon, +qemuMonitorBlockdevCreate(qemuMonitor *mon, const char *jobname, - virJSONValuePtr props) + virJSONValue *props) { VIR_DEBUG("jobname=%s props=%p", jobname, props); @@ -4482,8 +4482,8 @@ qemuMonitorBlockdevCreate(qemuMonitorPtr mon, * and set to NULL on success. */ int -qemuMonitorBlockdevAdd(qemuMonitorPtr mon, - virJSONValuePtr *props) +qemuMonitorBlockdevAdd(qemuMonitor *mon, + virJSONValue **props) { VIR_DEBUG("props=%p (node-name=%s)", *props, NULLSTR(virJSONValueObjectGetString(*props, "node-name"))); @@ -4495,8 +4495,8 @@ qemuMonitorBlockdevAdd(qemuMonitorPtr mon, int -qemuMonitorBlockdevReopen(qemuMonitorPtr mon, - virJSONValuePtr *props) +qemuMonitorBlockdevReopen(qemuMonitor *mon, + virJSONValue **props) { VIR_DEBUG("props=%p (node-name=%s)", *props, NULLSTR(virJSONValueObjectGetString(*props, "node-name"))); @@ -4508,7 +4508,7 @@ qemuMonitorBlockdevReopen(qemuMonitorPtr mon, int -qemuMonitorBlockdevDel(qemuMonitorPtr mon, +qemuMonitorBlockdevDel(qemuMonitor *mon, const char *nodename) { VIR_DEBUG("nodename=%s", nodename); @@ -4519,7 +4519,7 @@ qemuMonitorBlockdevDel(qemuMonitorPtr mon, } int -qemuMonitorBlockdevTrayOpen(qemuMonitorPtr mon, +qemuMonitorBlockdevTrayOpen(qemuMonitor *mon, const char *id, bool force) { @@ -4532,7 +4532,7 @@ qemuMonitorBlockdevTrayOpen(qemuMonitorPtr mon, int -qemuMonitorBlockdevTrayClose(qemuMonitorPtr mon, +qemuMonitorBlockdevTrayClose(qemuMonitor *mon, const char *id) { VIR_DEBUG("id=%s", id); @@ -4544,7 +4544,7 @@ qemuMonitorBlockdevTrayClose(qemuMonitorPtr mon, int -qemuMonitorBlockdevMediumRemove(qemuMonitorPtr mon, +qemuMonitorBlockdevMediumRemove(qemuMonitor *mon, const char *id) { VIR_DEBUG("id=%s", id); @@ -4556,7 +4556,7 @@ qemuMonitorBlockdevMediumRemove(qemuMonitorPtr mon, int -qemuMonitorBlockdevMediumInsert(qemuMonitorPtr mon, +qemuMonitorBlockdevMediumInsert(qemuMonitor *mon, const char *id, const char *nodename) { @@ -4569,7 +4569,7 @@ qemuMonitorBlockdevMediumInsert(qemuMonitorPtr mon, char * -qemuMonitorGetSEVMeasurement(qemuMonitorPtr mon) +qemuMonitorGetSEVMeasurement(qemuMonitor *mon) { QEMU_CHECK_MONITOR_NULL(mon); @@ -4578,7 +4578,7 @@ qemuMonitorGetSEVMeasurement(qemuMonitorPtr mon) int -qemuMonitorGetPRManagerInfo(qemuMonitorPtr mon, +qemuMonitorGetPRManagerInfo(qemuMonitor *mon, GHashTable **retinfo) { int ret = -1; @@ -4603,8 +4603,8 @@ qemuMonitorGetPRManagerInfo(qemuMonitorPtr mon, int -qemuMonitorGetCurrentMachineInfo(qemuMonitorPtr mon, - qemuMonitorCurrentMachineInfoPtr info) +qemuMonitorGetCurrentMachineInfo(qemuMonitor *mon, + qemuMonitorCurrentMachineInfo *info) { QEMU_CHECK_MONITOR(mon); @@ -4613,7 +4613,7 @@ qemuMonitorGetCurrentMachineInfo(qemuMonitorPtr mon, void -qemuMonitorJobInfoFree(qemuMonitorJobInfoPtr job) +qemuMonitorJobInfoFree(qemuMonitorJobInfo *job) { if (!job) return; @@ -4625,8 +4625,8 @@ qemuMonitorJobInfoFree(qemuMonitorJobInfoPtr job) int -qemuMonitorGetJobInfo(qemuMonitorPtr mon, - qemuMonitorJobInfoPtr **jobs, +qemuMonitorGetJobInfo(qemuMonitor *mon, + qemuMonitorJobInfo ***jobs, size_t *njobs) { QEMU_CHECK_MONITOR(mon); @@ -4644,7 +4644,7 @@ qemuMonitorGetJobInfo(qemuMonitorPtr mon, * 0 on success (@migratable is set accordingly). */ int -qemuMonitorGetCPUMigratable(qemuMonitorPtr mon, +qemuMonitorGetCPUMigratable(qemuMonitor *mon, bool *migratable) { QEMU_CHECK_MONITOR(mon); @@ -4654,7 +4654,7 @@ qemuMonitorGetCPUMigratable(qemuMonitorPtr mon, int -qemuMonitorTransactionBitmapAdd(virJSONValuePtr actions, +qemuMonitorTransactionBitmapAdd(virJSONValue *actions, const char *node, const char *name, bool persistent, @@ -4667,7 +4667,7 @@ qemuMonitorTransactionBitmapAdd(virJSONValuePtr actions, int -qemuMonitorTransactionBitmapRemove(virJSONValuePtr actions, +qemuMonitorTransactionBitmapRemove(virJSONValue *actions, const char *node, const char *name) { @@ -4676,7 +4676,7 @@ qemuMonitorTransactionBitmapRemove(virJSONValuePtr actions, int -qemuMonitorBitmapRemove(qemuMonitorPtr mon, +qemuMonitorBitmapRemove(qemuMonitor *mon, const char *node, const char *name) { @@ -4689,7 +4689,7 @@ qemuMonitorBitmapRemove(qemuMonitorPtr mon, int -qemuMonitorTransactionBitmapEnable(virJSONValuePtr actions, +qemuMonitorTransactionBitmapEnable(virJSONValue *actions, const char *node, const char *name) { @@ -4698,7 +4698,7 @@ qemuMonitorTransactionBitmapEnable(virJSONValuePtr actions, int -qemuMonitorTransactionBitmapDisable(virJSONValuePtr actions, +qemuMonitorTransactionBitmapDisable(virJSONValue *actions, const char *node, const char *name) { @@ -4707,17 +4707,17 @@ qemuMonitorTransactionBitmapDisable(virJSONValuePtr actions, int -qemuMonitorTransactionBitmapMerge(virJSONValuePtr actions, +qemuMonitorTransactionBitmapMerge(virJSONValue *actions, const char *node, const char *target, - virJSONValuePtr *sources) + virJSONValue **sources) { return qemuMonitorJSONTransactionBitmapMerge(actions, node, target, sources); } int -qemuMonitorTransactionBitmapMergeSourceAddBitmap(virJSONValuePtr sources, +qemuMonitorTransactionBitmapMergeSourceAddBitmap(virJSONValue *sources, const char *sourcenode, const char *sourcebitmap) { @@ -4726,7 +4726,7 @@ qemuMonitorTransactionBitmapMergeSourceAddBitmap(virJSONValuePtr sources, int -qemuMonitorTransactionSnapshotLegacy(virJSONValuePtr actions, +qemuMonitorTransactionSnapshotLegacy(virJSONValue *actions, const char *device, const char *path, const char *format, @@ -4738,7 +4738,7 @@ qemuMonitorTransactionSnapshotLegacy(virJSONValuePtr actions, int -qemuMonitorTransactionSnapshotBlockdev(virJSONValuePtr actions, +qemuMonitorTransactionSnapshotBlockdev(virJSONValue *actions, const char *node, const char *overlay) { @@ -4747,7 +4747,7 @@ qemuMonitorTransactionSnapshotBlockdev(virJSONValuePtr actions, int -qemuMonitorTransactionBackup(virJSONValuePtr actions, +qemuMonitorTransactionBackup(virJSONValue *actions, const char *device, const char *jobname, const char *target, @@ -4760,7 +4760,7 @@ qemuMonitorTransactionBackup(virJSONValuePtr actions, int -qemuMonitorStartDirtyRateCalc(qemuMonitorPtr mon, +qemuMonitorStartDirtyRateCalc(qemuMonitor *mon, int seconds) { VIR_DEBUG("seconds=%d", seconds); @@ -4772,8 +4772,8 @@ qemuMonitorStartDirtyRateCalc(qemuMonitorPtr mon, int -qemuMonitorQueryDirtyRate(qemuMonitorPtr mon, - qemuMonitorDirtyRateInfoPtr info) +qemuMonitorQueryDirtyRate(qemuMonitor *mon, + qemuMonitorDirtyRateInfo *info) { VIR_DEBUG("info=%p", info); diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 9106f966da..230d00a894 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -34,11 +34,8 @@ #include "virenum.h" typedef struct _qemuMonitor qemuMonitor; -typedef qemuMonitor *qemuMonitorPtr; typedef struct _qemuMonitorMessage qemuMonitorMessage; -typedef qemuMonitorMessage *qemuMonitorMessagePtr; - struct _qemuMonitorMessage { int txFD; @@ -67,7 +64,6 @@ typedef enum { } qemuMonitorEventPanicInfoType; typedef struct _qemuMonitorEventPanicInfoHyperv qemuMonitorEventPanicInfoHyperv; -typedef qemuMonitorEventPanicInfoHyperv *qemuMonitorEventPanicInfoHypervPtr; struct _qemuMonitorEventPanicInfoHyperv { /* Hyper-V specific guest panic information (HV crash MSRs) */ unsigned long long arg1; @@ -78,7 +74,6 @@ struct _qemuMonitorEventPanicInfoHyperv { }; typedef struct _qemuMonitorEventPanicInfoS390 qemuMonitorEventPanicInfoS390; -typedef qemuMonitorEventPanicInfoS390 *qemuMonitorEventPanicInfoS390Ptr; struct _qemuMonitorEventPanicInfoS390 { /* S390 specific guest panic information */ int core; @@ -88,7 +83,6 @@ struct _qemuMonitorEventPanicInfoS390 { }; typedef struct _qemuMonitorEventPanicInfo qemuMonitorEventPanicInfo; -typedef qemuMonitorEventPanicInfo *qemuMonitorEventPanicInfoPtr; struct _qemuMonitorEventPanicInfo { qemuMonitorEventPanicInfoType type; union { @@ -99,7 +93,6 @@ struct _qemuMonitorEventPanicInfo { typedef struct _qemuMonitorRdmaGidStatus qemuMonitorRdmaGidStatus; -typedef qemuMonitorRdmaGidStatus *qemuMonitorRdmaGidStatusPtr; struct _qemuMonitorRdmaGidStatus { char *netdev; bool gid_status; @@ -139,7 +132,6 @@ typedef enum { VIR_ENUM_DECL(qemuMonitorJobStatus); typedef struct _qemuMonitorJobInfo qemuMonitorJobInfo; -typedef qemuMonitorJobInfo *qemuMonitorJobInfoPtr; struct _qemuMonitorJobInfo { char *id; qemuMonitorJobType type; @@ -150,59 +142,59 @@ struct _qemuMonitorJobInfo { }; -char *qemuMonitorGuestPanicEventInfoFormatMsg(qemuMonitorEventPanicInfoPtr info); -void qemuMonitorEventPanicInfoFree(qemuMonitorEventPanicInfoPtr info); -void qemuMonitorEventRdmaGidStatusFree(qemuMonitorRdmaGidStatusPtr info); +char *qemuMonitorGuestPanicEventInfoFormatMsg(qemuMonitorEventPanicInfo *info); +void qemuMonitorEventPanicInfoFree(qemuMonitorEventPanicInfo *info); +void qemuMonitorEventRdmaGidStatusFree(qemuMonitorRdmaGidStatus *info); -typedef void (*qemuMonitorDestroyCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef void (*qemuMonitorDestroyCallback)(qemuMonitor *mon, + virDomainObj *vm, void *opaque); -typedef void (*qemuMonitorEofNotifyCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef void (*qemuMonitorEofNotifyCallback)(qemuMonitor *mon, + virDomainObj *vm, void *opaque); -typedef void (*qemuMonitorErrorNotifyCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef void (*qemuMonitorErrorNotifyCallback)(qemuMonitor *mon, + virDomainObj *vm, void *opaque); -typedef int (*qemuMonitorDomainEventCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainEventCallback)(qemuMonitor *mon, + virDomainObj *vm, const char *event, long long seconds, unsigned int micros, const char *details, void *opaque); -typedef int (*qemuMonitorDomainShutdownCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainShutdownCallback)(qemuMonitor *mon, + virDomainObj *vm, virTristateBool guest, void *opaque); -typedef int (*qemuMonitorDomainResetCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainResetCallback)(qemuMonitor *mon, + virDomainObj *vm, void *opaque); -typedef int (*qemuMonitorDomainPowerdownCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainPowerdownCallback)(qemuMonitor *mon, + virDomainObj *vm, void *opaque); -typedef int (*qemuMonitorDomainStopCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainStopCallback)(qemuMonitor *mon, + virDomainObj *vm, void *opaque); -typedef int (*qemuMonitorDomainResumeCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainResumeCallback)(qemuMonitor *mon, + virDomainObj *vm, void *opaque); -typedef int (*qemuMonitorDomainRTCChangeCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainRTCChangeCallback)(qemuMonitor *mon, + virDomainObj *vm, long long offset, void *opaque); -typedef int (*qemuMonitorDomainWatchdogCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainWatchdogCallback)(qemuMonitor *mon, + virDomainObj *vm, int action, void *opaque); -typedef int (*qemuMonitorDomainIOErrorCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainIOErrorCallback)(qemuMonitor *mon, + virDomainObj *vm, const char *diskAlias, const char *nodename, int action, const char *reason, void *opaque); -typedef int (*qemuMonitorDomainGraphicsCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainGraphicsCallback)(qemuMonitor *mon, + virDomainObj *vm, int phase, int localFamily, const char *localNode, @@ -214,72 +206,72 @@ typedef int (*qemuMonitorDomainGraphicsCallback)(qemuMonitorPtr mon, const char *x509dname, const char *saslUsername, void *opaque); -typedef int (*qemuMonitorDomainBlockJobCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainBlockJobCallback)(qemuMonitor *mon, + virDomainObj *vm, const char *diskAlias, int type, int status, const char *error, void *opaque); -typedef int (*qemuMonitorDomainJobStatusChangeCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainJobStatusChangeCallback)(qemuMonitor *mon, + virDomainObj *vm, const char *jobname, int status, void *opaque); -typedef int (*qemuMonitorDomainTrayChangeCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainTrayChangeCallback)(qemuMonitor *mon, + virDomainObj *vm, const char *devAlias, const char *devid, int reason, void *opaque); -typedef int (*qemuMonitorDomainPMWakeupCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainPMWakeupCallback)(qemuMonitor *mon, + virDomainObj *vm, void *opaque); -typedef int (*qemuMonitorDomainPMSuspendCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainPMSuspendCallback)(qemuMonitor *mon, + virDomainObj *vm, void *opaque); -typedef int (*qemuMonitorDomainBalloonChangeCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainBalloonChangeCallback)(qemuMonitor *mon, + virDomainObj *vm, unsigned long long actual, void *opaque); -typedef int (*qemuMonitorDomainPMSuspendDiskCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainPMSuspendDiskCallback)(qemuMonitor *mon, + virDomainObj *vm, void *opaque); -typedef int (*qemuMonitorDomainGuestPanicCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, - qemuMonitorEventPanicInfoPtr info, +typedef int (*qemuMonitorDomainGuestPanicCallback)(qemuMonitor *mon, + virDomainObj *vm, + qemuMonitorEventPanicInfo *info, void *opaque); -typedef int (*qemuMonitorDomainDeviceDeletedCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainDeviceDeletedCallback)(qemuMonitor *mon, + virDomainObj *vm, const char *devAlias, void *opaque); -typedef int (*qemuMonitorDomainNicRxFilterChangedCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainNicRxFilterChangedCallback)(qemuMonitor *mon, + virDomainObj *vm, const char *devAlias, void *opaque); -typedef int (*qemuMonitorDomainSerialChangeCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainSerialChangeCallback)(qemuMonitor *mon, + virDomainObj *vm, const char *devAlias, bool connected, void *opaque); -typedef int (*qemuMonitorDomainSpiceMigratedCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainSpiceMigratedCallback)(qemuMonitor *mon, + virDomainObj *vm, void *opaque); -typedef int (*qemuMonitorDomainMigrationStatusCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainMigrationStatusCallback)(qemuMonitor *mon, + virDomainObj *vm, int status, void *opaque); -typedef int (*qemuMonitorDomainMigrationPassCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainMigrationPassCallback)(qemuMonitor *mon, + virDomainObj *vm, int pass, void *opaque); -typedef int (*qemuMonitorDomainAcpiOstInfoCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainAcpiOstInfoCallback)(qemuMonitor *mon, + virDomainObj *vm, const char *alias, const char *slotType, const char *slot, @@ -288,8 +280,8 @@ typedef int (*qemuMonitorDomainAcpiOstInfoCallback)(qemuMonitorPtr mon, void *opaque); -typedef int (*qemuMonitorDomainBlockThresholdCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainBlockThresholdCallback)(qemuMonitor *mon, + virDomainObj *vm, const char *nodename, unsigned long long threshold, unsigned long long excess, @@ -308,36 +300,35 @@ typedef enum { VIR_ENUM_DECL(qemuMonitorDumpStatus); typedef struct _qemuMonitorDumpStats qemuMonitorDumpStats; -typedef qemuMonitorDumpStats *qemuMonitorDumpStatsPtr; struct _qemuMonitorDumpStats { int status; /* qemuMonitorDumpStatus */ unsigned long long completed; /* bytes written */ unsigned long long total; /* total bytes to be written */ }; -typedef int (*qemuMonitorDomainDumpCompletedCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainDumpCompletedCallback)(qemuMonitor *mon, + virDomainObj *vm, int status, - qemuMonitorDumpStatsPtr stats, + qemuMonitorDumpStats *stats, const char *error, void *opaque); -typedef int (*qemuMonitorDomainPRManagerStatusChangedCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainPRManagerStatusChangedCallback)(qemuMonitor *mon, + virDomainObj *vm, const char *prManager, bool connected, void *opaque); -typedef int (*qemuMonitorDomainRdmaGidStatusChangedCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainRdmaGidStatusChangedCallback)(qemuMonitor *mon, + virDomainObj *vm, const char *netdev, bool gid_status, unsigned long long subnet_prefix, unsigned long long interface_id, void *opaque); -typedef int (*qemuMonitorDomainGuestCrashloadedCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, +typedef int (*qemuMonitorDomainGuestCrashloadedCallback)(qemuMonitor *mon, + virDomainObj *vm, void *opaque); typedef enum { @@ -361,7 +352,6 @@ typedef enum { VIR_ENUM_DECL(qemuMonitorMemoryFailureAction); typedef struct _qemuMonitorEventMemoryFailure qemuMonitorEventMemoryFailure; -typedef qemuMonitorEventMemoryFailure *qemuMonitorEventMemoryFailurePtr; struct _qemuMonitorEventMemoryFailure { qemuMonitorMemoryFailureRecipient recipient; qemuMonitorMemoryFailureAction action; @@ -369,13 +359,12 @@ struct _qemuMonitorEventMemoryFailure { bool recursive; }; -typedef int (*qemuMonitorDomainMemoryFailureCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, - qemuMonitorEventMemoryFailurePtr mfp, +typedef int (*qemuMonitorDomainMemoryFailureCallback)(qemuMonitor *mon, + virDomainObj *vm, + qemuMonitorEventMemoryFailure *mfp, void *opaque); typedef struct _qemuMonitorCallbacks qemuMonitorCallbacks; -typedef qemuMonitorCallbacks *qemuMonitorCallbacksPtr; struct _qemuMonitorCallbacks { qemuMonitorDestroyCallback destroy; qemuMonitorEofNotifyCallback eofNotify; @@ -413,62 +402,62 @@ struct _qemuMonitorCallbacks { qemuMonitorDomainMemoryFailureCallback domainMemoryFailure; }; -qemuMonitorPtr qemuMonitorOpen(virDomainObjPtr vm, - virDomainChrSourceDefPtr config, +qemuMonitor *qemuMonitorOpen(virDomainObj *vm, + virDomainChrSourceDef *config, bool retry, unsigned long long timeout, GMainContext *context, - qemuMonitorCallbacksPtr cb, + qemuMonitorCallbacks *cb, void *opaque) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(5); void qemuMonitorWatchDispose(void); bool qemuMonitorWasDisposed(void); -void qemuMonitorRegister(qemuMonitorPtr mon) +void qemuMonitorRegister(qemuMonitor *mon) ATTRIBUTE_NONNULL(1); -void qemuMonitorUnregister(qemuMonitorPtr mon) +void qemuMonitorUnregister(qemuMonitor *mon) ATTRIBUTE_NONNULL(1); -void qemuMonitorClose(qemuMonitorPtr mon); +void qemuMonitorClose(qemuMonitor *mon); -virErrorPtr qemuMonitorLastError(qemuMonitorPtr mon); +virErrorPtr qemuMonitorLastError(qemuMonitor *mon); -int qemuMonitorSetCapabilities(qemuMonitorPtr mon); +int qemuMonitorSetCapabilities(qemuMonitor *mon); -int qemuMonitorSetLink(qemuMonitorPtr mon, +int qemuMonitorSetLink(qemuMonitor *mon, const char *name, virDomainNetInterfaceLinkState state) ATTRIBUTE_NONNULL(2); /* These APIs are for use by the internal Text/JSON monitor impl code only */ -char *qemuMonitorNextCommandID(qemuMonitorPtr mon); -int qemuMonitorSend(qemuMonitorPtr mon, - qemuMonitorMessagePtr msg) G_GNUC_NO_INLINE; -int qemuMonitorUpdateVideoMemorySize(qemuMonitorPtr mon, - virDomainVideoDefPtr video, +char *qemuMonitorNextCommandID(qemuMonitor *mon); +int qemuMonitorSend(qemuMonitor *mon, + qemuMonitorMessage *msg) G_GNUC_NO_INLINE; +int qemuMonitorUpdateVideoMemorySize(qemuMonitor *mon, + virDomainVideoDef *video, const char *videoName) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuMonitorUpdateVideoVram64Size(qemuMonitorPtr mon, - virDomainVideoDefPtr video, +int qemuMonitorUpdateVideoVram64Size(qemuMonitor *mon, + virDomainVideoDef *video, const char *videoName) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuMonitorEmitEvent(qemuMonitorPtr mon, const char *event, +int qemuMonitorEmitEvent(qemuMonitor *mon, const char *event, long long seconds, unsigned int micros, const char *details); -int qemuMonitorEmitShutdown(qemuMonitorPtr mon, virTristateBool guest); -int qemuMonitorEmitReset(qemuMonitorPtr mon); -int qemuMonitorEmitPowerdown(qemuMonitorPtr mon); -int qemuMonitorEmitStop(qemuMonitorPtr mon); -int qemuMonitorEmitResume(qemuMonitorPtr mon); -int qemuMonitorEmitRTCChange(qemuMonitorPtr mon, long long offset); -int qemuMonitorEmitWatchdog(qemuMonitorPtr mon, int action); -int qemuMonitorEmitIOError(qemuMonitorPtr mon, +int qemuMonitorEmitShutdown(qemuMonitor *mon, virTristateBool guest); +int qemuMonitorEmitReset(qemuMonitor *mon); +int qemuMonitorEmitPowerdown(qemuMonitor *mon); +int qemuMonitorEmitStop(qemuMonitor *mon); +int qemuMonitorEmitResume(qemuMonitor *mon); +int qemuMonitorEmitRTCChange(qemuMonitor *mon, long long offset); +int qemuMonitorEmitWatchdog(qemuMonitor *mon, int action); +int qemuMonitorEmitIOError(qemuMonitor *mon, const char *diskAlias, const char *nodename, int action, const char *reason); -int qemuMonitorEmitGraphics(qemuMonitorPtr mon, +int qemuMonitorEmitGraphics(qemuMonitor *mon, int phase, int localFamily, const char *localNode, @@ -479,73 +468,73 @@ int qemuMonitorEmitGraphics(qemuMonitorPtr mon, const char *authScheme, const char *x509dname, const char *saslUsername); -int qemuMonitorEmitTrayChange(qemuMonitorPtr mon, +int qemuMonitorEmitTrayChange(qemuMonitor *mon, const char *devAlias, const char *devid, int reason); -int qemuMonitorEmitPMWakeup(qemuMonitorPtr mon); -int qemuMonitorEmitPMSuspend(qemuMonitorPtr mon); -int qemuMonitorEmitBlockJob(qemuMonitorPtr mon, +int qemuMonitorEmitPMWakeup(qemuMonitor *mon); +int qemuMonitorEmitPMSuspend(qemuMonitor *mon); +int qemuMonitorEmitBlockJob(qemuMonitor *mon, const char *diskAlias, int type, int status, const char *error); -int qemuMonitorEmitJobStatusChange(qemuMonitorPtr mon, +int qemuMonitorEmitJobStatusChange(qemuMonitor *mon, const char *jobname, qemuMonitorJobStatus status); -int qemuMonitorEmitBalloonChange(qemuMonitorPtr mon, +int qemuMonitorEmitBalloonChange(qemuMonitor *mon, unsigned long long actual); -int qemuMonitorEmitPMSuspendDisk(qemuMonitorPtr mon); -int qemuMonitorEmitGuestPanic(qemuMonitorPtr mon, - qemuMonitorEventPanicInfoPtr info); -int qemuMonitorEmitDeviceDeleted(qemuMonitorPtr mon, +int qemuMonitorEmitPMSuspendDisk(qemuMonitor *mon); +int qemuMonitorEmitGuestPanic(qemuMonitor *mon, + qemuMonitorEventPanicInfo *info); +int qemuMonitorEmitDeviceDeleted(qemuMonitor *mon, const char *devAlias); -int qemuMonitorEmitNicRxFilterChanged(qemuMonitorPtr mon, +int qemuMonitorEmitNicRxFilterChanged(qemuMonitor *mon, const char *devAlias); -int qemuMonitorEmitSerialChange(qemuMonitorPtr mon, +int qemuMonitorEmitSerialChange(qemuMonitor *mon, const char *devAlias, bool connected); -int qemuMonitorEmitSpiceMigrated(qemuMonitorPtr mon); +int qemuMonitorEmitSpiceMigrated(qemuMonitor *mon); -int qemuMonitorEmitMemoryFailure(qemuMonitorPtr mon, - qemuMonitorEventMemoryFailurePtr mfp); +int qemuMonitorEmitMemoryFailure(qemuMonitor *mon, + qemuMonitorEventMemoryFailure *mfp); -int qemuMonitorEmitMigrationStatus(qemuMonitorPtr mon, +int qemuMonitorEmitMigrationStatus(qemuMonitor *mon, int status); -int qemuMonitorEmitMigrationPass(qemuMonitorPtr mon, +int qemuMonitorEmitMigrationPass(qemuMonitor *mon, int pass); -int qemuMonitorEmitAcpiOstInfo(qemuMonitorPtr mon, +int qemuMonitorEmitAcpiOstInfo(qemuMonitor *mon, const char *alias, const char *slotType, const char *slot, unsigned int source, unsigned int status); -int qemuMonitorEmitBlockThreshold(qemuMonitorPtr mon, +int qemuMonitorEmitBlockThreshold(qemuMonitor *mon, const char *nodename, unsigned long long threshold, unsigned long long excess); -int qemuMonitorEmitDumpCompleted(qemuMonitorPtr mon, +int qemuMonitorEmitDumpCompleted(qemuMonitor *mon, int status, - qemuMonitorDumpStatsPtr stats, + qemuMonitorDumpStats *stats, const char *error); -int qemuMonitorEmitPRManagerStatusChanged(qemuMonitorPtr mon, +int qemuMonitorEmitPRManagerStatusChanged(qemuMonitor *mon, const char *prManager, bool connected); -int qemuMonitorEmitRdmaGidStatusChanged(qemuMonitorPtr mon, +int qemuMonitorEmitRdmaGidStatusChanged(qemuMonitor *mon, const char *netdev, bool gid_status, unsigned long long subnet_prefix, unsigned long long interface_id); -int qemuMonitorEmitGuestCrashloaded(qemuMonitorPtr mon); +int qemuMonitorEmitGuestCrashloaded(qemuMonitor *mon); -int qemuMonitorStartCPUs(qemuMonitorPtr mon); -int qemuMonitorStopCPUs(qemuMonitorPtr mon); +int qemuMonitorStartCPUs(qemuMonitor *mon); +int qemuMonitorStopCPUs(qemuMonitor *mon); typedef enum { QEMU_MONITOR_VM_STATUS_DEBUG, @@ -568,14 +557,14 @@ typedef enum { VIR_ENUM_DECL(qemuMonitorVMStatus); int qemuMonitorVMStatusToPausedReason(const char *status); -int qemuMonitorCheck(qemuMonitorPtr mon); -int qemuMonitorGetStatus(qemuMonitorPtr mon, +int qemuMonitorCheck(qemuMonitor *mon); +int qemuMonitorGetStatus(qemuMonitor *mon, bool *running, virDomainPausedReason *reason) ATTRIBUTE_NONNULL(2); -int qemuMonitorSystemReset(qemuMonitorPtr mon); -int qemuMonitorSystemPowerdown(qemuMonitorPtr mon); +int qemuMonitorSystemReset(qemuMonitor *mon); +int qemuMonitorSystemPowerdown(qemuMonitor *mon); struct qemuMonitorQueryCpusEntry { int qemu_id; /* id of the cpu as reported by qemu */ @@ -594,7 +583,7 @@ struct qemuMonitorQueryHotpluggableCpusEntry { char *alias; /* device alias, may be NULL for non-hotpluggable entities */ /* verbatim copy of the JSON data representing the CPU which must be used for hotplug */ - virJSONValuePtr props; + virJSONValue *props; /* topology information -1 if qemu didn't report given parameter */ int node_id; @@ -632,7 +621,7 @@ struct _qemuMonitorCPUInfo { char *type; /* verbatim copy of the returned data from qemu which should be used when plugging */ - virJSONValuePtr props; + virJSONValue *props; /* alias of an hotpluggable entry. Entries with alias can be hot-unplugged */ char *alias; @@ -643,36 +632,34 @@ struct _qemuMonitorCPUInfo { bool halted; }; typedef struct _qemuMonitorCPUInfo qemuMonitorCPUInfo; -typedef qemuMonitorCPUInfo *qemuMonitorCPUInfoPtr; -void qemuMonitorCPUInfoFree(qemuMonitorCPUInfoPtr list, +void qemuMonitorCPUInfoFree(qemuMonitorCPUInfo *list, size_t nitems); -int qemuMonitorGetCPUInfo(qemuMonitorPtr mon, - qemuMonitorCPUInfoPtr *vcpus, +int qemuMonitorGetCPUInfo(qemuMonitor *mon, + qemuMonitorCPUInfo **vcpus, size_t maxvcpus, bool hotplug, bool fast); -virBitmapPtr qemuMonitorGetCpuHalted(qemuMonitorPtr mon, +virBitmap *qemuMonitorGetCpuHalted(qemuMonitor *mon, size_t maxvcpus, bool fast); -int qemuMonitorGetBalloonInfo(qemuMonitorPtr mon, +int qemuMonitorGetBalloonInfo(qemuMonitor *mon, unsigned long long *currmem); -int qemuMonitorGetMemoryStats(qemuMonitorPtr mon, - virDomainMemballoonDefPtr balloon, +int qemuMonitorGetMemoryStats(qemuMonitor *mon, + virDomainMemballoonDef *balloon, virDomainMemoryStatPtr stats, unsigned int nr_stats); -int qemuMonitorSetMemoryStatsPeriod(qemuMonitorPtr mon, - virDomainMemballoonDefPtr balloon, +int qemuMonitorSetMemoryStatsPeriod(qemuMonitor *mon, + virDomainMemballoonDef *balloon, int period); int qemuMonitorBlockIOStatusToError(const char *status); -GHashTable *qemuMonitorGetBlockInfo(qemuMonitorPtr mon); +GHashTable *qemuMonitorGetBlockInfo(qemuMonitor *mon); -virJSONValuePtr qemuMonitorQueryBlockstats(qemuMonitorPtr mon); +virJSONValue *qemuMonitorQueryBlockstats(qemuMonitor *mon); typedef struct _qemuBlockStats qemuBlockStats; -typedef qemuBlockStats *qemuBlockStatsPtr; struct _qemuBlockStats { unsigned long long rd_req; unsigned long long rd_bytes; @@ -694,22 +681,21 @@ struct _qemuBlockStats { unsigned long long write_threshold; }; -int qemuMonitorGetAllBlockStatsInfo(qemuMonitorPtr mon, +int qemuMonitorGetAllBlockStatsInfo(qemuMonitor *mon, GHashTable **ret_stats, bool backingChain) ATTRIBUTE_NONNULL(2); -int qemuMonitorBlockStatsUpdateCapacity(qemuMonitorPtr mon, +int qemuMonitorBlockStatsUpdateCapacity(qemuMonitor *mon, GHashTable *stats, bool backingChain) ATTRIBUTE_NONNULL(2); -int qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, +int qemuMonitorBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon, GHashTable *stats) ATTRIBUTE_NONNULL(2); typedef struct _qemuBlockNamedNodeDataBitmap qemuBlockNamedNodeDataBitmap; -typedef qemuBlockNamedNodeDataBitmap *qemuBlockNamedNodeDataBitmapPtr; struct _qemuBlockNamedNodeDataBitmap { char *name; bool recording; @@ -722,12 +708,11 @@ struct _qemuBlockNamedNodeDataBitmap { }; typedef struct _qemuBlockNamedNodeData qemuBlockNamedNodeData; -typedef qemuBlockNamedNodeData *qemuBlockNamedNodeDataPtr; struct _qemuBlockNamedNodeData { unsigned long long capacity; unsigned long long physical; - qemuBlockNamedNodeDataBitmapPtr *bitmaps; + qemuBlockNamedNodeDataBitmap **bitmaps; size_t nbitmaps; /* the cluster size of the image is valid only when > 0 */ @@ -738,65 +723,65 @@ struct _qemuBlockNamedNodeData { }; GHashTable * -qemuMonitorBlockGetNamedNodeData(qemuMonitorPtr mon, +qemuMonitorBlockGetNamedNodeData(qemuMonitor *mon, bool supports_flat); -int qemuMonitorBlockResize(qemuMonitorPtr mon, +int qemuMonitorBlockResize(qemuMonitor *mon, const char *device, const char *nodename, unsigned long long size); -int qemuMonitorSetPassword(qemuMonitorPtr mon, +int qemuMonitorSetPassword(qemuMonitor *mon, int type, const char *password, const char *action_if_connected); -int qemuMonitorExpirePassword(qemuMonitorPtr mon, +int qemuMonitorExpirePassword(qemuMonitor *mon, int type, const char *expire_time); -int qemuMonitorSetBalloon(qemuMonitorPtr mon, +int qemuMonitorSetBalloon(qemuMonitor *mon, unsigned long long newmem); -int qemuMonitorSetCPU(qemuMonitorPtr mon, int cpu, bool online); +int qemuMonitorSetCPU(qemuMonitor *mon, int cpu, bool online); -/* XXX should we pass the virDomainDiskDefPtr instead +/* XXX should we pass the virDomainDiskDef *instead * and hide dev_name details inside monitor. Reconsider * this when doing the QMP implementation */ -int qemuMonitorEjectMedia(qemuMonitorPtr mon, +int qemuMonitorEjectMedia(qemuMonitor *mon, const char *dev_name, bool force); -int qemuMonitorChangeMedia(qemuMonitorPtr mon, +int qemuMonitorChangeMedia(qemuMonitor *mon, const char *dev_name, const char *newmedia, const char *format); -int qemuMonitorSaveVirtualMemory(qemuMonitorPtr mon, +int qemuMonitorSaveVirtualMemory(qemuMonitor *mon, unsigned long long offset, unsigned long long length, const char *path); -int qemuMonitorSavePhysicalMemory(qemuMonitorPtr mon, +int qemuMonitorSavePhysicalMemory(qemuMonitor *mon, unsigned long long offset, unsigned long long length, const char *path); -int qemuMonitorSetDBusVMStateIdList(qemuMonitorPtr mon, +int qemuMonitorSetDBusVMStateIdList(qemuMonitor *mon, GSList *list); -int qemuMonitorSetMigrationSpeed(qemuMonitorPtr mon, +int qemuMonitorSetMigrationSpeed(qemuMonitor *mon, unsigned long bandwidth); -int qemuMonitorSetMigrationDowntime(qemuMonitorPtr mon, +int qemuMonitorSetMigrationDowntime(qemuMonitor *mon, unsigned long long downtime); -int qemuMonitorGetMigrationCacheSize(qemuMonitorPtr mon, +int qemuMonitorGetMigrationCacheSize(qemuMonitor *mon, unsigned long long *cacheSize); -int qemuMonitorSetMigrationCacheSize(qemuMonitorPtr mon, +int qemuMonitorSetMigrationCacheSize(qemuMonitor *mon, unsigned long long cacheSize); -int qemuMonitorGetMigrationParams(qemuMonitorPtr mon, - virJSONValuePtr *params); -int qemuMonitorSetMigrationParams(qemuMonitorPtr mon, - virJSONValuePtr *params); +int qemuMonitorGetMigrationParams(qemuMonitor *mon, + virJSONValue **params); +int qemuMonitorSetMigrationParams(qemuMonitor *mon, + virJSONValue **params); typedef enum { QEMU_MONITOR_MIGRATION_STATUS_INACTIVE, @@ -817,7 +802,6 @@ typedef enum { VIR_ENUM_DECL(qemuMonitorMigrationStatus); typedef struct _qemuMonitorMigrationStats qemuMonitorMigrationStats; -typedef qemuMonitorMigrationStats *qemuMonitorMigrationStatsPtr; struct _qemuMonitorMigrationStats { int status; /* qemuMonitorMigrationStatus */ unsigned long long total_time; @@ -860,19 +844,19 @@ struct _qemuMonitorMigrationStats { int cpu_throttle_percentage; }; -int qemuMonitorGetMigrationStats(qemuMonitorPtr mon, - qemuMonitorMigrationStatsPtr stats, +int qemuMonitorGetMigrationStats(qemuMonitor *mon, + qemuMonitorMigrationStats *stats, char **error); -int qemuMonitorGetMigrationCapabilities(qemuMonitorPtr mon, +int qemuMonitorGetMigrationCapabilities(qemuMonitor *mon, char ***capabilities); -int qemuMonitorSetMigrationCapabilities(qemuMonitorPtr mon, - virJSONValuePtr *caps); +int qemuMonitorSetMigrationCapabilities(qemuMonitor *mon, + virJSONValue **caps); -int qemuMonitorGetGICCapabilities(qemuMonitorPtr mon, +int qemuMonitorGetGICCapabilities(qemuMonitor *mon, virGICCapability **capabilities); -int qemuMonitorGetSEVCapabilities(qemuMonitorPtr mon, +int qemuMonitorGetSEVCapabilities(qemuMonitor *mon, virSEVCapability **capabilities); typedef enum { @@ -882,34 +866,34 @@ typedef enum { QEMU_MONITOR_MIGRATION_FLAGS_LAST } QEMU_MONITOR_MIGRATE; -int qemuMonitorMigrateToFd(qemuMonitorPtr mon, +int qemuMonitorMigrateToFd(qemuMonitor *mon, unsigned int flags, int fd); -int qemuMonitorMigrateToHost(qemuMonitorPtr mon, +int qemuMonitorMigrateToHost(qemuMonitor *mon, unsigned int flags, const char *protocol, const char *hostname, int port); -int qemuMonitorMigrateToSocket(qemuMonitorPtr mon, +int qemuMonitorMigrateToSocket(qemuMonitor *mon, unsigned int flags, const char *socketPath); -int qemuMonitorMigrateCancel(qemuMonitorPtr mon); +int qemuMonitorMigrateCancel(qemuMonitor *mon); -int qemuMonitorGetDumpGuestMemoryCapability(qemuMonitorPtr mon, +int qemuMonitorGetDumpGuestMemoryCapability(qemuMonitor *mon, const char *capability); -int qemuMonitorQueryDump(qemuMonitorPtr mon, - qemuMonitorDumpStatsPtr stats); +int qemuMonitorQueryDump(qemuMonitor *mon, + qemuMonitorDumpStats *stats); -int qemuMonitorDumpToFd(qemuMonitorPtr mon, +int qemuMonitorDumpToFd(qemuMonitor *mon, int fd, const char *dumpformat, bool detach); -int qemuMonitorGraphicsRelocate(qemuMonitorPtr mon, +int qemuMonitorGraphicsRelocate(qemuMonitor *mon, int type, const char *hostname, int port, @@ -917,122 +901,117 @@ int qemuMonitorGraphicsRelocate(qemuMonitorPtr mon, const char *tlsSubject); typedef struct _qemuMonitorAddFdInfo qemuMonitorAddFdInfo; -typedef qemuMonitorAddFdInfo *qemuMonitorAddFdInfoPtr; struct _qemuMonitorAddFdInfo { int fd; int fdset; }; int -qemuMonitorAddFileHandleToSet(qemuMonitorPtr mon, +qemuMonitorAddFileHandleToSet(qemuMonitor *mon, int fd, int fdset, const char *opaque, - qemuMonitorAddFdInfoPtr info); + qemuMonitorAddFdInfo *info); int -qemuMonitorRemoveFdset(qemuMonitorPtr mon, +qemuMonitorRemoveFdset(qemuMonitor *mon, int fdset); typedef struct _qemuMonitorFdsetFdInfo qemuMonitorFdsetFdInfo; -typedef qemuMonitorFdsetFdInfo *qemuMonitorFdsetFdInfoPtr; struct _qemuMonitorFdsetFdInfo { int fd; char *opaque; }; typedef struct _qemuMonitorFdsetInfo qemuMonitorFdsetInfo; -typedef qemuMonitorFdsetInfo *qemuMonitorFdsetInfoPtr; struct _qemuMonitorFdsetInfo { int id; - qemuMonitorFdsetFdInfoPtr fds; + qemuMonitorFdsetFdInfo *fds; int nfds; }; typedef struct _qemuMonitorFdsets qemuMonitorFdsets; -typedef qemuMonitorFdsets *qemuMonitorFdsetsPtr; struct _qemuMonitorFdsets { - qemuMonitorFdsetInfoPtr fdsets; + qemuMonitorFdsetInfo *fdsets; int nfdsets; }; -void qemuMonitorFdsetsFree(qemuMonitorFdsetsPtr fdsets); +void qemuMonitorFdsetsFree(qemuMonitorFdsets *fdsets); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMonitorFdsets, qemuMonitorFdsetsFree); -int qemuMonitorQueryFdsets(qemuMonitorPtr mon, - qemuMonitorFdsetsPtr *fdsets); +int qemuMonitorQueryFdsets(qemuMonitor *mon, + qemuMonitorFdsets **fdsets); -int qemuMonitorSendFileHandle(qemuMonitorPtr mon, +int qemuMonitorSendFileHandle(qemuMonitor *mon, const char *fdname, int fd); /* This function preserves previous error and only set their own * error if no error was set before. */ -int qemuMonitorCloseFileHandle(qemuMonitorPtr mon, +int qemuMonitorCloseFileHandle(qemuMonitor *mon, const char *fdname); -int qemuMonitorAddNetdev(qemuMonitorPtr mon, - virJSONValuePtr *props, +int qemuMonitorAddNetdev(qemuMonitor *mon, + virJSONValue **props, int *tapfd, char **tapfdName, int tapfdSize, int *vhostfd, char **vhostfdName, int vhostfdSize, int slirpfd, char *slirpfdName); -int qemuMonitorRemoveNetdev(qemuMonitorPtr mon, +int qemuMonitorRemoveNetdev(qemuMonitor *mon, const char *alias); -int qemuMonitorQueryRxFilter(qemuMonitorPtr mon, const char *alias, - virNetDevRxFilterPtr *filter); +int qemuMonitorQueryRxFilter(qemuMonitor *mon, const char *alias, + virNetDevRxFilter **filter); typedef struct _qemuMonitorChardevInfo qemuMonitorChardevInfo; -typedef qemuMonitorChardevInfo *qemuMonitorChardevInfoPtr; struct _qemuMonitorChardevInfo { char *ptyPath; virDomainChrDeviceState state; }; void qemuMonitorChardevInfoFree(void *data); -int qemuMonitorGetChardevInfo(qemuMonitorPtr mon, +int qemuMonitorGetChardevInfo(qemuMonitor *mon, GHashTable **retinfo); -int qemuMonitorAttachPCIDiskController(qemuMonitorPtr mon, +int qemuMonitorAttachPCIDiskController(qemuMonitor *mon, const char *bus, virPCIDeviceAddress *guestAddr); -int qemuMonitorAddDeviceArgs(qemuMonitorPtr mon, - virJSONValuePtr args); -int qemuMonitorAddDevice(qemuMonitorPtr mon, +int qemuMonitorAddDeviceArgs(qemuMonitor *mon, + virJSONValue *args); +int qemuMonitorAddDevice(qemuMonitor *mon, const char *devicestr); -int qemuMonitorAddDeviceWithFd(qemuMonitorPtr mon, +int qemuMonitorAddDeviceWithFd(qemuMonitor *mon, const char *devicestr, int fd, const char *fdname); -int qemuMonitorDelDevice(qemuMonitorPtr mon, +int qemuMonitorDelDevice(qemuMonitor *mon, const char *devalias); -int qemuMonitorCreateObjectProps(virJSONValuePtr *propsret, +int qemuMonitorCreateObjectProps(virJSONValue **propsret, const char *type, const char *alias, ...); -int qemuMonitorAddObject(qemuMonitorPtr mon, - virJSONValuePtr *props, +int qemuMonitorAddObject(qemuMonitor *mon, + virJSONValue **props, char **alias) ATTRIBUTE_NONNULL(2); -int qemuMonitorDelObject(qemuMonitorPtr mon, +int qemuMonitorDelObject(qemuMonitor *mon, const char *objalias, bool report_error); -int qemuMonitorAddDrive(qemuMonitorPtr mon, +int qemuMonitorAddDrive(qemuMonitor *mon, const char *drivestr); -int qemuMonitorDriveDel(qemuMonitorPtr mon, +int qemuMonitorDriveDel(qemuMonitor *mon, const char *drivestr); -int qemuMonitorCreateSnapshot(qemuMonitorPtr mon, const char *name); -int qemuMonitorLoadSnapshot(qemuMonitorPtr mon, const char *name); -int qemuMonitorDeleteSnapshot(qemuMonitorPtr mon, const char *name); +int qemuMonitorCreateSnapshot(qemuMonitor *mon, const char *name); +int qemuMonitorLoadSnapshot(qemuMonitor *mon, const char *name); +int qemuMonitorDeleteSnapshot(qemuMonitor *mon, const char *name); -int qemuMonitorTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions) +int qemuMonitorTransaction(qemuMonitor *mon, virJSONValue **actions) ATTRIBUTE_NONNULL(2); -int qemuMonitorDriveMirror(qemuMonitorPtr mon, +int qemuMonitorDriveMirror(qemuMonitor *mon, const char *device, const char *file, const char *format, @@ -1042,7 +1021,7 @@ int qemuMonitorDriveMirror(qemuMonitorPtr mon, bool shallow, bool reuse) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuMonitorBlockdevMirror(qemuMonitorPtr mon, +int qemuMonitorBlockdevMirror(qemuMonitor *mon, const char *jobname, bool persistjob, const char *device, @@ -1052,11 +1031,11 @@ int qemuMonitorBlockdevMirror(qemuMonitorPtr mon, unsigned long long buf_size, bool shallow) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5); -int qemuMonitorDrivePivot(qemuMonitorPtr mon, +int qemuMonitorDrivePivot(qemuMonitor *mon, const char *jobname) ATTRIBUTE_NONNULL(2); -int qemuMonitorBlockCommit(qemuMonitorPtr mon, +int qemuMonitorBlockCommit(qemuMonitor *mon, const char *device, const char *jobname, bool persistjob, @@ -1067,31 +1046,31 @@ int qemuMonitorBlockCommit(qemuMonitorPtr mon, const char *backingName, unsigned long long bandwidth) ATTRIBUTE_NONNULL(2); -bool qemuMonitorSupportsActiveCommit(qemuMonitorPtr mon); -char *qemuMonitorDiskNameLookup(qemuMonitorPtr mon, +bool qemuMonitorSupportsActiveCommit(qemuMonitor *mon); +char *qemuMonitorDiskNameLookup(qemuMonitor *mon, const char *device, - virStorageSourcePtr top, - virStorageSourcePtr target) + virStorageSource *top, + virStorageSource *target) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -int qemuMonitorArbitraryCommand(qemuMonitorPtr mon, +int qemuMonitorArbitraryCommand(qemuMonitor *mon, const char *cmd, char **reply, bool hmp); -int qemuMonitorInjectNMI(qemuMonitorPtr mon); +int qemuMonitorInjectNMI(qemuMonitor *mon); -int qemuMonitorScreendump(qemuMonitorPtr mon, +int qemuMonitorScreendump(qemuMonitor *mon, const char *device, unsigned int head, const char *file); -int qemuMonitorSendKey(qemuMonitorPtr mon, +int qemuMonitorSendKey(qemuMonitor *mon, unsigned int holdtime, unsigned int *keycodes, unsigned int nkeycodes); -int qemuMonitorBlockStream(qemuMonitorPtr mon, +int qemuMonitorBlockStream(qemuMonitor *mon, const char *device, const char *jobname, bool persistjob, @@ -1101,16 +1080,15 @@ int qemuMonitorBlockStream(qemuMonitorPtr mon, unsigned long long bandwidth) ATTRIBUTE_NONNULL(2); -int qemuMonitorBlockJobCancel(qemuMonitorPtr mon, +int qemuMonitorBlockJobCancel(qemuMonitor *mon, const char *jobname) ATTRIBUTE_NONNULL(2); -int qemuMonitorBlockJobSetSpeed(qemuMonitorPtr mon, +int qemuMonitorBlockJobSetSpeed(qemuMonitor *mon, const char *jobname, unsigned long long bandwidth); typedef struct _qemuMonitorBlockJobInfo qemuMonitorBlockJobInfo; -typedef qemuMonitorBlockJobInfo *qemuMonitorBlockJobInfoPtr; struct _qemuMonitorBlockJobInfo { int type; /* virDomainBlockJobType */ unsigned long long bandwidth; /* in bytes/s */ @@ -1120,44 +1098,44 @@ struct _qemuMonitorBlockJobInfo { bool ready; }; -GHashTable *qemuMonitorGetAllBlockJobInfo(qemuMonitorPtr mon, +GHashTable *qemuMonitorGetAllBlockJobInfo(qemuMonitor *mon, bool rawjobname); -int qemuMonitorJobDismiss(qemuMonitorPtr mon, +int qemuMonitorJobDismiss(qemuMonitor *mon, const char *jobname) ATTRIBUTE_NONNULL(2); -int qemuMonitorJobCancel(qemuMonitorPtr mon, +int qemuMonitorJobCancel(qemuMonitor *mon, const char *jobname, bool quiet) ATTRIBUTE_NONNULL(2); -int qemuMonitorJobComplete(qemuMonitorPtr mon, +int qemuMonitorJobComplete(qemuMonitor *mon, const char *jobname) ATTRIBUTE_NONNULL(2); -int qemuMonitorOpenGraphics(qemuMonitorPtr mon, +int qemuMonitorOpenGraphics(qemuMonitor *mon, const char *protocol, int fd, const char *fdname, bool skipauth); -int qemuMonitorSetBlockIoThrottle(qemuMonitorPtr mon, +int qemuMonitorSetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, const char *qomid, - virDomainBlockIoTuneInfoPtr info, + virDomainBlockIoTuneInfo *info, bool supportMaxOptions, bool supportGroupNameOption, bool supportMaxLengthOptions); -int qemuMonitorGetBlockIoThrottle(qemuMonitorPtr mon, +int qemuMonitorGetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, const char *qdevid, - virDomainBlockIoTuneInfoPtr reply); + virDomainBlockIoTuneInfo *reply); -int qemuMonitorSystemWakeup(qemuMonitorPtr mon); +int qemuMonitorSystemWakeup(qemuMonitor *mon); -int qemuMonitorGetVersion(qemuMonitorPtr mon, +int qemuMonitorGetVersion(qemuMonitor *mon, int *major, int *minor, int *micro, @@ -1166,8 +1144,6 @@ int qemuMonitorGetVersion(qemuMonitorPtr mon, typedef struct _qemuMonitorMachineInfo qemuMonitorMachineInfo; -typedef qemuMonitorMachineInfo *qemuMonitorMachineInfoPtr; - struct _qemuMonitorMachineInfo { char *name; bool isDefault; @@ -1180,14 +1156,12 @@ struct _qemuMonitorMachineInfo { bool deprecated; }; -int qemuMonitorGetMachines(qemuMonitorPtr mon, - qemuMonitorMachineInfoPtr **machines); +int qemuMonitorGetMachines(qemuMonitor *mon, + qemuMonitorMachineInfo ***machines); -void qemuMonitorMachineInfoFree(qemuMonitorMachineInfoPtr machine); +void qemuMonitorMachineInfoFree(qemuMonitorMachineInfo *machine); typedef struct _qemuMonitorCPUDefInfo qemuMonitorCPUDefInfo; -typedef qemuMonitorCPUDefInfo *qemuMonitorCPUDefInfoPtr; - struct _qemuMonitorCPUDefInfo { virDomainCapsCPUUsable usable; char *name; @@ -1197,17 +1171,16 @@ struct _qemuMonitorCPUDefInfo { }; typedef struct _qemuMonitorCPUDefs qemuMonitorCPUDefs; -typedef qemuMonitorCPUDefs *qemuMonitorCPUDefsPtr; struct _qemuMonitorCPUDefs { size_t ncpus; - qemuMonitorCPUDefInfoPtr cpus; + qemuMonitorCPUDefInfo *cpus; }; -int qemuMonitorGetCPUDefinitions(qemuMonitorPtr mon, - qemuMonitorCPUDefsPtr *cpuDefs); -qemuMonitorCPUDefsPtr qemuMonitorCPUDefsNew(size_t count); -qemuMonitorCPUDefsPtr qemuMonitorCPUDefsCopy(qemuMonitorCPUDefsPtr src); -void qemuMonitorCPUDefsFree(qemuMonitorCPUDefsPtr defs); +int qemuMonitorGetCPUDefinitions(qemuMonitor *mon, + qemuMonitorCPUDefs **cpuDefs); +qemuMonitorCPUDefs *qemuMonitorCPUDefsNew(size_t count); +qemuMonitorCPUDefs *qemuMonitorCPUDefsCopy(qemuMonitorCPUDefs *src); +void qemuMonitorCPUDefsFree(qemuMonitorCPUDefs *defs); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMonitorCPUDefs, qemuMonitorCPUDefsFree); @@ -1222,7 +1195,6 @@ typedef enum { VIR_ENUM_DECL(qemuMonitorCPUProperty); typedef struct _qemuMonitorCPUProperty qemuMonitorCPUProperty; -typedef qemuMonitorCPUProperty *qemuMonitorCPUPropertyPtr; struct _qemuMonitorCPUProperty { char *name; qemuMonitorCPUPropertyType type; @@ -1235,12 +1207,10 @@ struct _qemuMonitorCPUProperty { }; typedef struct _qemuMonitorCPUModelInfo qemuMonitorCPUModelInfo; -typedef qemuMonitorCPUModelInfo *qemuMonitorCPUModelInfoPtr; - struct _qemuMonitorCPUModelInfo { char *name; size_t nprops; - qemuMonitorCPUPropertyPtr props; + qemuMonitorCPUProperty *props; bool migratability; }; @@ -1250,107 +1220,105 @@ typedef enum { QEMU_MONITOR_CPU_MODEL_EXPANSION_FULL, } qemuMonitorCPUModelExpansionType; -int qemuMonitorGetCPUModelExpansion(qemuMonitorPtr mon, +int qemuMonitorGetCPUModelExpansion(qemuMonitor *mon, qemuMonitorCPUModelExpansionType type, - virCPUDefPtr cpu, + virCPUDef *cpu, bool migratable, bool fail_no_props, - qemuMonitorCPUModelInfoPtr *model_info); + qemuMonitorCPUModelInfo **model_info); -void qemuMonitorCPUModelInfoFree(qemuMonitorCPUModelInfoPtr model_info); +void qemuMonitorCPUModelInfoFree(qemuMonitorCPUModelInfo *model_info); -int qemuMonitorGetCPUModelBaseline(qemuMonitorPtr mon, - virCPUDefPtr cpu_a, - virCPUDefPtr cpu_b, - qemuMonitorCPUModelInfoPtr *baseline); +int qemuMonitorGetCPUModelBaseline(qemuMonitor *mon, + virCPUDef *cpu_a, + virCPUDef *cpu_b, + qemuMonitorCPUModelInfo **baseline); -int qemuMonitorGetCPUModelComparison(qemuMonitorPtr mon, - virCPUDefPtr cpu_a, - virCPUDefPtr cpu_b, +int qemuMonitorGetCPUModelComparison(qemuMonitor *mon, + virCPUDef *cpu_a, + virCPUDef *cpu_b, char **result); -qemuMonitorCPUModelInfoPtr +qemuMonitorCPUModelInfo * qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModelInfo *orig); -int qemuMonitorGetCommands(qemuMonitorPtr mon, +int qemuMonitorGetCommands(qemuMonitor *mon, char ***commands); -int qemuMonitorGetEvents(qemuMonitorPtr mon, +int qemuMonitorGetEvents(qemuMonitor *mon, char ***events); -GHashTable *qemuMonitorGetCommandLineOptions(qemuMonitorPtr mon); +GHashTable *qemuMonitorGetCommandLineOptions(qemuMonitor *mon); -int qemuMonitorGetKVMState(qemuMonitorPtr mon, +int qemuMonitorGetKVMState(qemuMonitor *mon, bool *enabled, bool *present); -int qemuMonitorGetObjectTypes(qemuMonitorPtr mon, +int qemuMonitorGetObjectTypes(qemuMonitor *mon, char ***types); -GHashTable *qemuMonitorGetDeviceProps(qemuMonitorPtr mon, +GHashTable *qemuMonitorGetDeviceProps(qemuMonitor *mon, const char *device); -int qemuMonitorGetObjectProps(qemuMonitorPtr mon, +int qemuMonitorGetObjectProps(qemuMonitor *mon, const char *object, char ***props); -char *qemuMonitorGetTargetArch(qemuMonitorPtr mon); +char *qemuMonitorGetTargetArch(qemuMonitor *mon); -int qemuMonitorNBDServerStart(qemuMonitorPtr mon, +int qemuMonitorNBDServerStart(qemuMonitor *mon, const virStorageNetHostDef *server, const char *tls_alias) ATTRIBUTE_NONNULL(2); -int qemuMonitorNBDServerAdd(qemuMonitorPtr mon, +int qemuMonitorNBDServerAdd(qemuMonitor *mon, const char *deviceID, const char *export, bool writable, const char *bitmap); -int qemuMonitorNBDServerStop(qemuMonitorPtr); +int qemuMonitorNBDServerStop(qemuMonitor *); -int qemuMonitorBlockExportAdd(qemuMonitorPtr mon, - virJSONValuePtr *props); +int qemuMonitorBlockExportAdd(qemuMonitor *mon, + virJSONValue **props); -int qemuMonitorGetTPMModels(qemuMonitorPtr mon, +int qemuMonitorGetTPMModels(qemuMonitor *mon, char ***tpmmodels); -int qemuMonitorGetTPMTypes(qemuMonitorPtr mon, +int qemuMonitorGetTPMTypes(qemuMonitor *mon, char ***tpmtypes); -int qemuMonitorAttachCharDev(qemuMonitorPtr mon, +int qemuMonitorAttachCharDev(qemuMonitor *mon, const char *chrID, - virDomainChrSourceDefPtr chr); -int qemuMonitorDetachCharDev(qemuMonitorPtr mon, + virDomainChrSourceDef *chr); +int qemuMonitorDetachCharDev(qemuMonitor *mon, const char *chrID); -int qemuMonitorGetDeviceAliases(qemuMonitorPtr mon, +int qemuMonitorGetDeviceAliases(qemuMonitor *mon, char ***aliases); -typedef void (*qemuMonitorReportDomainLogError)(qemuMonitorPtr mon, +typedef void (*qemuMonitorReportDomainLogError)(qemuMonitor *mon, const char *msg, void *opaque); -void qemuMonitorSetDomainLogLocked(qemuMonitorPtr mon, +void qemuMonitorSetDomainLogLocked(qemuMonitor *mon, qemuMonitorReportDomainLogError func, void *opaque, virFreeCallback destroy); -void qemuMonitorSetDomainLog(qemuMonitorPtr mon, +void qemuMonitorSetDomainLog(qemuMonitor *mon, qemuMonitorReportDomainLogError func, void *opaque, virFreeCallback destroy); -int qemuMonitorGetGuestCPUx86(qemuMonitorPtr mon, - virCPUDataPtr *data, - virCPUDataPtr *disabled); +int qemuMonitorGetGuestCPUx86(qemuMonitor *mon, + virCPUData **data, + virCPUData **disabled); typedef const char *(*qemuMonitorCPUFeatureTranslationCallback)(const char *name, void *opaque); -int qemuMonitorGetGuestCPU(qemuMonitorPtr mon, +int qemuMonitorGetGuestCPU(qemuMonitor *mon, virArch arch, qemuMonitorCPUFeatureTranslationCallback translate, void *opaque, - virCPUDataPtr *enabled, - virCPUDataPtr *disabled); + virCPUData **enabled, + virCPUData **disabled); -int qemuMonitorRTCResetReinjection(qemuMonitorPtr mon); +int qemuMonitorRTCResetReinjection(qemuMonitor *mon); typedef struct _qemuMonitorIOThreadInfo qemuMonitorIOThreadInfo; -typedef qemuMonitorIOThreadInfo *qemuMonitorIOThreadInfoPtr; - struct _qemuMonitorIOThreadInfo { unsigned int iothread_id; int thread_id; @@ -1362,15 +1330,13 @@ struct _qemuMonitorIOThreadInfo { bool set_poll_grow; bool set_poll_shrink; }; -int qemuMonitorGetIOThreads(qemuMonitorPtr mon, - qemuMonitorIOThreadInfoPtr **iothreads, +int qemuMonitorGetIOThreads(qemuMonitor *mon, + qemuMonitorIOThreadInfo ***iothreads, int *niothreads); -int qemuMonitorSetIOThread(qemuMonitorPtr mon, - qemuMonitorIOThreadInfoPtr iothreadInfo); +int qemuMonitorSetIOThread(qemuMonitor *mon, + qemuMonitorIOThreadInfo *iothreadInfo); typedef struct _qemuMonitorMemoryDeviceInfo qemuMonitorMemoryDeviceInfo; -typedef qemuMonitorMemoryDeviceInfo *qemuMonitorMemoryDeviceInfoPtr; - struct _qemuMonitorMemoryDeviceInfo { unsigned long long address; unsigned int slot; @@ -1378,133 +1344,131 @@ struct _qemuMonitorMemoryDeviceInfo { bool hotpluggable; }; -int qemuMonitorGetMemoryDeviceInfo(qemuMonitorPtr mon, +int qemuMonitorGetMemoryDeviceInfo(qemuMonitor *mon, GHashTable **info) ATTRIBUTE_NONNULL(2); -int qemuMonitorMigrateIncoming(qemuMonitorPtr mon, +int qemuMonitorMigrateIncoming(qemuMonitor *mon, const char *uri); -int qemuMonitorMigrateStartPostCopy(qemuMonitorPtr mon); +int qemuMonitorMigrateStartPostCopy(qemuMonitor *mon); -int qemuMonitorMigrateContinue(qemuMonitorPtr mon, +int qemuMonitorMigrateContinue(qemuMonitor *mon, qemuMonitorMigrationStatus status); -int qemuMonitorGetRTCTime(qemuMonitorPtr mon, +int qemuMonitorGetRTCTime(qemuMonitor *mon, struct tm *tm); -virJSONValuePtr qemuMonitorQueryQMPSchema(qemuMonitorPtr mon); +virJSONValue *qemuMonitorQueryQMPSchema(qemuMonitor *mon); -int qemuMonitorSetBlockThreshold(qemuMonitorPtr mon, +int qemuMonitorSetBlockThreshold(qemuMonitor *mon, const char *nodename, unsigned long long threshold); -virJSONValuePtr qemuMonitorQueryNamedBlockNodes(qemuMonitorPtr mon); +virJSONValue *qemuMonitorQueryNamedBlockNodes(qemuMonitor *mon); -int qemuMonitorSetWatchdogAction(qemuMonitorPtr mon, +int qemuMonitorSetWatchdogAction(qemuMonitor *mon, const char *action); -int qemuMonitorBlockdevCreate(qemuMonitorPtr mon, +int qemuMonitorBlockdevCreate(qemuMonitor *mon, const char *jobname, - virJSONValuePtr props); + virJSONValue *props); -int qemuMonitorBlockdevAdd(qemuMonitorPtr mon, - virJSONValuePtr *props); +int qemuMonitorBlockdevAdd(qemuMonitor *mon, + virJSONValue **props); -int qemuMonitorBlockdevReopen(qemuMonitorPtr mon, - virJSONValuePtr *props); +int qemuMonitorBlockdevReopen(qemuMonitor *mon, + virJSONValue **props); -int qemuMonitorBlockdevDel(qemuMonitorPtr mon, +int qemuMonitorBlockdevDel(qemuMonitor *mon, const char *nodename); -int qemuMonitorBlockdevTrayOpen(qemuMonitorPtr mon, +int qemuMonitorBlockdevTrayOpen(qemuMonitor *mon, const char *id, bool force); -int qemuMonitorBlockdevTrayClose(qemuMonitorPtr mon, +int qemuMonitorBlockdevTrayClose(qemuMonitor *mon, const char *id); -int qemuMonitorBlockdevMediumRemove(qemuMonitorPtr mon, +int qemuMonitorBlockdevMediumRemove(qemuMonitor *mon, const char *id); -int qemuMonitorBlockdevMediumInsert(qemuMonitorPtr mon, +int qemuMonitorBlockdevMediumInsert(qemuMonitor *mon, const char *id, const char *nodename); char * -qemuMonitorGetSEVMeasurement(qemuMonitorPtr mon); +qemuMonitorGetSEVMeasurement(qemuMonitor *mon); typedef struct _qemuMonitorPRManagerInfo qemuMonitorPRManagerInfo; -typedef qemuMonitorPRManagerInfo *qemuMonitorPRManagerInfoPtr; struct _qemuMonitorPRManagerInfo { bool connected; }; -int qemuMonitorGetPRManagerInfo(qemuMonitorPtr mon, +int qemuMonitorGetPRManagerInfo(qemuMonitor *mon, GHashTable **retinfo); typedef struct _qemuMonitorCurrentMachineInfo qemuMonitorCurrentMachineInfo; -typedef qemuMonitorCurrentMachineInfo *qemuMonitorCurrentMachineInfoPtr; struct _qemuMonitorCurrentMachineInfo { bool wakeupSuspendSupport; }; -int qemuMonitorGetCurrentMachineInfo(qemuMonitorPtr mon, - qemuMonitorCurrentMachineInfoPtr info); -void qemuMonitorJobInfoFree(qemuMonitorJobInfoPtr job); +int qemuMonitorGetCurrentMachineInfo(qemuMonitor *mon, + qemuMonitorCurrentMachineInfo *info); +void qemuMonitorJobInfoFree(qemuMonitorJobInfo *job); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMonitorJobInfo, qemuMonitorJobInfoFree); -int qemuMonitorGetJobInfo(qemuMonitorPtr mon, - qemuMonitorJobInfoPtr **jobs, +int qemuMonitorGetJobInfo(qemuMonitor *mon, + qemuMonitorJobInfo ***jobs, size_t *njobs); int -qemuMonitorGetCPUMigratable(qemuMonitorPtr mon, +qemuMonitorGetCPUMigratable(qemuMonitor *mon, bool *migratable); int -qemuMonitorTransactionBitmapAdd(virJSONValuePtr actions, +qemuMonitorTransactionBitmapAdd(virJSONValue *actions, const char *node, const char *name, bool persistent, bool disabled, unsigned long long granularity); int -qemuMonitorTransactionBitmapRemove(virJSONValuePtr actions, +qemuMonitorTransactionBitmapRemove(virJSONValue *actions, const char *node, const char *name); int -qemuMonitorBitmapRemove(qemuMonitorPtr mon, +qemuMonitorBitmapRemove(qemuMonitor *mon, const char *node, const char *name); int -qemuMonitorTransactionBitmapEnable(virJSONValuePtr actions, +qemuMonitorTransactionBitmapEnable(virJSONValue *actions, const char *node, const char *name); int -qemuMonitorTransactionBitmapDisable(virJSONValuePtr actions, +qemuMonitorTransactionBitmapDisable(virJSONValue *actions, const char *node, const char *name); int -qemuMonitorTransactionBitmapMerge(virJSONValuePtr actions, +qemuMonitorTransactionBitmapMerge(virJSONValue *actions, const char *node, const char *target, - virJSONValuePtr *sources); + virJSONValue **sources); int -qemuMonitorTransactionBitmapMergeSourceAddBitmap(virJSONValuePtr sources, +qemuMonitorTransactionBitmapMergeSourceAddBitmap(virJSONValue *sources, const char *sourcenode, const char *sourcebitmap); int -qemuMonitorTransactionSnapshotLegacy(virJSONValuePtr actions, +qemuMonitorTransactionSnapshotLegacy(virJSONValue *actions, const char *device, const char *path, const char *format, bool existing); int -qemuMonitorTransactionSnapshotBlockdev(virJSONValuePtr actions, +qemuMonitorTransactionSnapshotBlockdev(virJSONValue *actions, const char *node, const char *overlay); @@ -1516,7 +1480,7 @@ typedef enum { } qemuMonitorTransactionBackupSyncMode; int -qemuMonitorTransactionBackup(virJSONValuePtr actions, +qemuMonitorTransactionBackup(virJSONValue *actions, const char *device, const char *jobname, const char *target, @@ -1524,12 +1488,10 @@ qemuMonitorTransactionBackup(virJSONValuePtr actions, qemuMonitorTransactionBackupSyncMode syncmode); int -qemuMonitorStartDirtyRateCalc(qemuMonitorPtr mon, +qemuMonitorStartDirtyRateCalc(qemuMonitor *mon, int seconds); typedef struct _qemuMonitorDirtyRateInfo qemuMonitorDirtyRateInfo; -typedef qemuMonitorDirtyRateInfo *qemuMonitorDirtyRateInfoPtr; - struct _qemuMonitorDirtyRateInfo { int status; /* the status of last dirtyrate calculation, one of virDomainDirtyRateStatus */ @@ -1539,5 +1501,5 @@ struct _qemuMonitorDirtyRateInfo { }; int -qemuMonitorQueryDirtyRate(qemuMonitorPtr mon, - qemuMonitorDirtyRateInfoPtr info); +qemuMonitorQueryDirtyRate(qemuMonitor *mon, + qemuMonitorDirtyRateInfo *info); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 0602d8e0dd..652034472a 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -76,47 +76,47 @@ VIR_ENUM_IMPL(qemuMonitorJobStatus, "undefined", "null"); -static void qemuMonitorJSONHandleShutdown(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleReset(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandlePowerdown(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleStop(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleResume(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleRTCChange(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleWatchdog(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleVNCConnect(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleVNCInitialize(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleVNCDisconnect(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleSPICEConnect(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleSPICEInitialize(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleSPICEDisconnect(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleTrayChange(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandlePMWakeup(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandlePMSuspend(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleBlockJobCompleted(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleBlockJobCanceled(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleBlockJobReady(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleJobStatusChange(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleBalloonChange(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandlePMSuspendDisk(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleGuestCrashloaded(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleGuestPanic(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleDeviceDeleted(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleSerialChange(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleSpiceMigrated(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleMigrationStatus(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleMigrationPass(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleAcpiOstInfo(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleBlockThreshold(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleDumpCompleted(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandlePRManagerStatusChanged(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleRdmaGidStatusChanged(qemuMonitorPtr mon, virJSONValuePtr data); -static void qemuMonitorJSONHandleMemoryFailure(qemuMonitorPtr mon, virJSONValuePtr data); +static void qemuMonitorJSONHandleShutdown(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleReset(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandlePowerdown(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleStop(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleResume(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleRTCChange(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleWatchdog(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleIOError(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleVNCConnect(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleVNCInitialize(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleVNCDisconnect(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleSPICEConnect(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleSPICEInitialize(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleSPICEDisconnect(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleTrayChange(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandlePMWakeup(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandlePMSuspend(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleBlockJobCompleted(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleBlockJobCanceled(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleBlockJobReady(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleJobStatusChange(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleBalloonChange(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandlePMSuspendDisk(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleGuestCrashloaded(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleGuestPanic(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleDeviceDeleted(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleSerialChange(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleSpiceMigrated(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleMigrationStatus(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleMigrationPass(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleAcpiOstInfo(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleBlockThreshold(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleDumpCompleted(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandlePRManagerStatusChanged(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleRdmaGidStatusChanged(qemuMonitor *mon, virJSONValue *data); +static void qemuMonitorJSONHandleMemoryFailure(qemuMonitor *mon, virJSONValue *data); typedef struct { const char *type; - void (*handler)(qemuMonitorPtr mon, virJSONValuePtr data); + void (*handler)(qemuMonitor *mon, virJSONValue *data); } qemuEventHandler; static qemuEventHandler eventHandlers[] = { @@ -169,14 +169,14 @@ qemuMonitorEventCompare(const void *key, const void *elt) } static int -qemuMonitorJSONIOProcessEvent(qemuMonitorPtr mon, - virJSONValuePtr obj) +qemuMonitorJSONIOProcessEvent(qemuMonitor *mon, + virJSONValue *obj) { const char *type; qemuEventHandler *handler; - virJSONValuePtr data; + virJSONValue *data; char *details = NULL; - virJSONValuePtr timestamp; + virJSONValue *timestamp; long long seconds = -1; unsigned int micros = 0; @@ -212,11 +212,11 @@ qemuMonitorJSONIOProcessEvent(qemuMonitorPtr mon, } int -qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon, +qemuMonitorJSONIOProcessLine(qemuMonitor *mon, const char *line, - qemuMonitorMessagePtr msg) + qemuMonitorMessage *msg) { - virJSONValuePtr obj = NULL; + virJSONValue *obj = NULL; int ret = -1; VIR_DEBUG("Line [%s]", line); @@ -258,10 +258,10 @@ qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon, return ret; } -int qemuMonitorJSONIOProcess(qemuMonitorPtr mon, +int qemuMonitorJSONIOProcess(qemuMonitor *mon, const char *data, size_t len, - qemuMonitorMessagePtr msg) + qemuMonitorMessage *msg) { int used = 0; /*VIR_DEBUG("Data %d bytes [%s]", len, data);*/ @@ -294,10 +294,10 @@ int qemuMonitorJSONIOProcess(qemuMonitorPtr mon, } static int -qemuMonitorJSONCommandWithFd(qemuMonitorPtr mon, - virJSONValuePtr cmd, +qemuMonitorJSONCommandWithFd(qemuMonitor *mon, + virJSONValue *cmd, int scm_fd, - virJSONValuePtr *reply) + virJSONValue **reply) { int ret = -1; qemuMonitorMessage msg; @@ -347,9 +347,9 @@ qemuMonitorJSONCommandWithFd(qemuMonitorPtr mon, static int -qemuMonitorJSONCommand(qemuMonitorPtr mon, - virJSONValuePtr cmd, - virJSONValuePtr *reply) +qemuMonitorJSONCommand(qemuMonitor *mon, + virJSONValue *cmd, + virJSONValue **reply) { return qemuMonitorJSONCommandWithFd(mon, cmd, -1, reply); } @@ -360,7 +360,7 @@ qemuMonitorJSONCommand(qemuMonitorPtr mon, * XXX see qerror.h for different klasses & fill out useful params */ static const char * -qemuMonitorJSONStringifyError(virJSONValuePtr error) +qemuMonitorJSONStringifyError(virJSONValue *error) { const char *klass = virJSONValueObjectGetString(error, "class"); const char *detail = NULL; @@ -379,7 +379,7 @@ qemuMonitorJSONStringifyError(virJSONValuePtr error) } static const char * -qemuMonitorJSONCommandName(virJSONValuePtr cmd) +qemuMonitorJSONCommandName(virJSONValue *cmd) { const char *name = virJSONValueObjectGetString(cmd, "execute"); if (name) @@ -389,12 +389,12 @@ qemuMonitorJSONCommandName(virJSONValuePtr cmd) } static int -qemuMonitorJSONCheckErrorFull(virJSONValuePtr cmd, - virJSONValuePtr reply, +qemuMonitorJSONCheckErrorFull(virJSONValue *cmd, + virJSONValue *reply, bool report) { if (virJSONValueObjectHasKey(reply, "error")) { - virJSONValuePtr error = virJSONValueObjectGet(reply, "error"); + virJSONValue *error = virJSONValueObjectGet(reply, "error"); g_autofree char *cmdstr = virJSONValueToString(cmd, false); g_autofree char *replystr = virJSONValueToString(reply, false); @@ -437,19 +437,19 @@ qemuMonitorJSONCheckErrorFull(virJSONValuePtr cmd, static int -qemuMonitorJSONCheckError(virJSONValuePtr cmd, - virJSONValuePtr reply) +qemuMonitorJSONCheckError(virJSONValue *cmd, + virJSONValue *reply) { return qemuMonitorJSONCheckErrorFull(cmd, reply, true); } static int -qemuMonitorJSONCheckReply(virJSONValuePtr cmd, - virJSONValuePtr reply, +qemuMonitorJSONCheckReply(virJSONValue *cmd, + virJSONValue *reply, virJSONType type) { - virJSONValuePtr data; + virJSONValue *data; if (qemuMonitorJSONCheckError(cmd, reply) < 0) return -1; @@ -473,7 +473,7 @@ qemuMonitorJSONCheckReply(virJSONValuePtr cmd, static bool -qemuMonitorJSONErrorIsClass(virJSONValuePtr error, +qemuMonitorJSONErrorIsClass(virJSONValue *error, const char *klass) { return STREQ_NULLABLE(virJSONValueObjectGetString(error, "class"), klass); @@ -481,10 +481,10 @@ qemuMonitorJSONErrorIsClass(virJSONValuePtr error, static bool -qemuMonitorJSONHasError(virJSONValuePtr reply, +qemuMonitorJSONHasError(virJSONValue *reply, const char *klass) { - virJSONValuePtr error; + virJSONValue *error; if (!(error = virJSONValueObjectGet(reply, "error"))) return false; @@ -505,7 +505,7 @@ qemuMonitorJSONHasError(virJSONValuePtr reply, * Returns 0 on success and -1 on error. */ static int -qemuMonitorJSONTransactionAdd(virJSONValuePtr actions, +qemuMonitorJSONTransactionAdd(virJSONValue *actions, const char *cmdname, ...) { @@ -543,11 +543,11 @@ qemuMonitorJSONTransactionAdd(virJSONValuePtr actions, * * Note that @arguments is consumed and cleared. */ -static virJSONValuePtr +static virJSONValue * qemuMonitorJSONMakeCommandInternal(const char *cmdname, - virJSONValuePtr *arguments) + virJSONValue **arguments) { - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; ignore_value(virJSONValueObjectCreate(&ret, "s:execute", cmdname, @@ -557,11 +557,11 @@ qemuMonitorJSONMakeCommandInternal(const char *cmdname, } -static virJSONValuePtr G_GNUC_NULL_TERMINATED +static virJSONValue *G_GNUC_NULL_TERMINATED qemuMonitorJSONMakeCommand(const char *cmdname, ...) { - virJSONValuePtr obj = NULL; + virJSONValue *obj = NULL; g_autoptr(virJSONValue) jargs = NULL; va_list args; @@ -677,10 +677,10 @@ qemuMonitorJSONParseKeywords(const char *str, } -static virJSONValuePtr +static virJSONValue * qemuMonitorJSONKeywordStringToJSON(const char *str, const char *firstkeyword) { - virJSONValuePtr ret = virJSONValueNewObject(); + virJSONValue *ret = virJSONValueNewObject(); char **keywords = NULL; char **values = NULL; int nkeywords = 0; @@ -717,7 +717,7 @@ qemuMonitorJSONKeywordStringToJSON(const char *str, const char *firstkeyword) } -static void qemuMonitorJSONHandleShutdown(qemuMonitorPtr mon, virJSONValuePtr data) +static void qemuMonitorJSONHandleShutdown(qemuMonitor *mon, virJSONValue *data) { bool guest = false; virTristateBool guest_initiated = VIR_TRISTATE_BOOL_ABSENT; @@ -728,31 +728,31 @@ static void qemuMonitorJSONHandleShutdown(qemuMonitorPtr mon, virJSONValuePtr da qemuMonitorEmitShutdown(mon, guest_initiated); } -static void qemuMonitorJSONHandleReset(qemuMonitorPtr mon, virJSONValuePtr data G_GNUC_UNUSED) +static void qemuMonitorJSONHandleReset(qemuMonitor *mon, virJSONValue *data G_GNUC_UNUSED) { qemuMonitorEmitReset(mon); } -static void qemuMonitorJSONHandlePowerdown(qemuMonitorPtr mon, virJSONValuePtr data G_GNUC_UNUSED) +static void qemuMonitorJSONHandlePowerdown(qemuMonitor *mon, virJSONValue *data G_GNUC_UNUSED) { qemuMonitorEmitPowerdown(mon); } -static void qemuMonitorJSONHandleStop(qemuMonitorPtr mon, virJSONValuePtr data G_GNUC_UNUSED) +static void qemuMonitorJSONHandleStop(qemuMonitor *mon, virJSONValue *data G_GNUC_UNUSED) { qemuMonitorEmitStop(mon); } -static void qemuMonitorJSONHandleResume(qemuMonitorPtr mon, virJSONValuePtr data G_GNUC_UNUSED) +static void qemuMonitorJSONHandleResume(qemuMonitor *mon, virJSONValue *data G_GNUC_UNUSED) { qemuMonitorEmitResume(mon); } -static qemuMonitorEventPanicInfoPtr -qemuMonitorJSONGuestPanicExtractInfoHyperv(virJSONValuePtr data) +static qemuMonitorEventPanicInfo * +qemuMonitorJSONGuestPanicExtractInfoHyperv(virJSONValue *data) { - qemuMonitorEventPanicInfoPtr ret; + qemuMonitorEventPanicInfo *ret; ret = g_new0(qemuMonitorEventPanicInfo, 1); @@ -775,10 +775,10 @@ qemuMonitorJSONGuestPanicExtractInfoHyperv(virJSONValuePtr data) return NULL; } -static qemuMonitorEventPanicInfoPtr -qemuMonitorJSONGuestPanicExtractInfoS390(virJSONValuePtr data) +static qemuMonitorEventPanicInfo * +qemuMonitorJSONGuestPanicExtractInfoS390(virJSONValue *data) { - qemuMonitorEventPanicInfoPtr ret; + qemuMonitorEventPanicInfo *ret; int core; unsigned long long psw_mask, psw_addr; const char *reason = NULL; @@ -808,8 +808,8 @@ qemuMonitorJSONGuestPanicExtractInfoS390(virJSONValuePtr data) return NULL; } -static qemuMonitorEventPanicInfoPtr -qemuMonitorJSONGuestPanicExtractInfo(virJSONValuePtr data) +static qemuMonitorEventPanicInfo * +qemuMonitorJSONGuestPanicExtractInfo(virJSONValue *data) { const char *type = virJSONValueObjectGetString(data, "type"); @@ -825,11 +825,11 @@ qemuMonitorJSONGuestPanicExtractInfo(virJSONValuePtr data) static void -qemuMonitorJSONHandleGuestPanic(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleGuestPanic(qemuMonitor *mon, + virJSONValue *data) { - virJSONValuePtr infojson = virJSONValueObjectGetObject(data, "info"); - qemuMonitorEventPanicInfoPtr info = NULL; + virJSONValue *infojson = virJSONValueObjectGetObject(data, "info"); + qemuMonitorEventPanicInfo *info = NULL; if (infojson) info = qemuMonitorJSONGuestPanicExtractInfo(infojson); @@ -838,7 +838,7 @@ qemuMonitorJSONHandleGuestPanic(qemuMonitorPtr mon, } -static void qemuMonitorJSONHandleRTCChange(qemuMonitorPtr mon, virJSONValuePtr data) +static void qemuMonitorJSONHandleRTCChange(qemuMonitor *mon, virJSONValue *data) { long long offset = 0; if (virJSONValueObjectGetNumberLong(data, "offset", &offset) < 0) { @@ -854,7 +854,7 @@ VIR_ENUM_IMPL(qemuMonitorWatchdogAction, "none", "pause", "reset", "poweroff", "shutdown", "debug", "inject-nmi", ); -static void qemuMonitorJSONHandleWatchdog(qemuMonitorPtr mon, virJSONValuePtr data) +static void qemuMonitorJSONHandleWatchdog(qemuMonitor *mon, virJSONValue *data) { const char *action; int actionID; @@ -879,7 +879,7 @@ VIR_ENUM_IMPL(qemuMonitorIOErrorAction, static void -qemuMonitorJSONHandleIOError(qemuMonitorPtr mon, virJSONValuePtr data) +qemuMonitorJSONHandleIOError(qemuMonitor *mon, virJSONValue *data) { const char *device; const char *nodename; @@ -921,16 +921,16 @@ VIR_ENUM_IMPL(qemuMonitorGraphicsAddressFamily, ); static void -qemuMonitorJSONHandleGraphicsVNC(qemuMonitorPtr mon, - virJSONValuePtr data, +qemuMonitorJSONHandleGraphicsVNC(qemuMonitor *mon, + virJSONValue *data, int phase) { const char *localNode, *localService, *localFamily; const char *remoteNode, *remoteService, *remoteFamily; const char *authScheme, *saslUsername, *x509dname; int localFamilyID, remoteFamilyID; - virJSONValuePtr client; - virJSONValuePtr server; + virJSONValue *client; + virJSONValue *server; if (!(client = virJSONValueObjectGetObject(data, "client"))) { VIR_WARN("missing client info in VNC event"); @@ -991,35 +991,35 @@ qemuMonitorJSONHandleGraphicsVNC(qemuMonitorPtr mon, authScheme, x509dname, saslUsername); } -static void qemuMonitorJSONHandleVNCConnect(qemuMonitorPtr mon, virJSONValuePtr data) +static void qemuMonitorJSONHandleVNCConnect(qemuMonitor *mon, virJSONValue *data) { qemuMonitorJSONHandleGraphicsVNC(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_CONNECT); } -static void qemuMonitorJSONHandleVNCInitialize(qemuMonitorPtr mon, virJSONValuePtr data) +static void qemuMonitorJSONHandleVNCInitialize(qemuMonitor *mon, virJSONValue *data) { qemuMonitorJSONHandleGraphicsVNC(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE); } -static void qemuMonitorJSONHandleVNCDisconnect(qemuMonitorPtr mon, virJSONValuePtr data) +static void qemuMonitorJSONHandleVNCDisconnect(qemuMonitor *mon, virJSONValue *data) { qemuMonitorJSONHandleGraphicsVNC(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT); } static void -qemuMonitorJSONHandleGraphicsSPICE(qemuMonitorPtr mon, - virJSONValuePtr data, +qemuMonitorJSONHandleGraphicsSPICE(qemuMonitor *mon, + virJSONValue *data, int phase) { const char *lhost, *lport, *lfamily; const char *rhost, *rport, *rfamily; const char *auth = ""; int lfamilyID, rfamilyID; - virJSONValuePtr client; - virJSONValuePtr server; + virJSONValue *client; + virJSONValue *server; if (!(client = virJSONValueObjectGetObject(data, "client")) || !(server = virJSONValueObjectGetObject(data, "server"))) { @@ -1073,26 +1073,26 @@ qemuMonitorJSONHandleGraphicsSPICE(qemuMonitorPtr mon, } -static void qemuMonitorJSONHandleSPICEConnect(qemuMonitorPtr mon, virJSONValuePtr data) +static void qemuMonitorJSONHandleSPICEConnect(qemuMonitor *mon, virJSONValue *data) { qemuMonitorJSONHandleGraphicsSPICE(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_CONNECT); } -static void qemuMonitorJSONHandleSPICEInitialize(qemuMonitorPtr mon, virJSONValuePtr data) +static void qemuMonitorJSONHandleSPICEInitialize(qemuMonitor *mon, virJSONValue *data) { qemuMonitorJSONHandleGraphicsSPICE(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_INITIALIZE); } -static void qemuMonitorJSONHandleSPICEDisconnect(qemuMonitorPtr mon, virJSONValuePtr data) +static void qemuMonitorJSONHandleSPICEDisconnect(qemuMonitor *mon, virJSONValue *data) { qemuMonitorJSONHandleGraphicsSPICE(mon, data, VIR_DOMAIN_EVENT_GRAPHICS_DISCONNECT); } static void -qemuMonitorJSONHandleBlockJobImpl(qemuMonitorPtr mon, - virJSONValuePtr data, +qemuMonitorJSONHandleBlockJobImpl(qemuMonitor *mon, + virJSONValue *data, int event) { const char *device; @@ -1152,8 +1152,8 @@ qemuMonitorJSONHandleBlockJobImpl(qemuMonitorPtr mon, static void -qemuMonitorJSONHandleJobStatusChange(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleJobStatusChange(qemuMonitor *mon, + virJSONValue *data) { const char *jobname = virJSONValueObjectGetString(data, "id"); const char *statusstr = virJSONValueObjectGetString(data, "status"); @@ -1175,8 +1175,8 @@ qemuMonitorJSONHandleJobStatusChange(qemuMonitorPtr mon, static void -qemuMonitorJSONHandleTrayChange(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleTrayChange(qemuMonitor *mon, + virJSONValue *data) { const char *devAlias = virJSONValueObjectGetString(data, "device"); const char *devid = virJSONValueObjectGetString(data, "id"); @@ -1206,46 +1206,46 @@ qemuMonitorJSONHandleTrayChange(qemuMonitorPtr mon, } static void -qemuMonitorJSONHandlePMWakeup(qemuMonitorPtr mon, - virJSONValuePtr data G_GNUC_UNUSED) +qemuMonitorJSONHandlePMWakeup(qemuMonitor *mon, + virJSONValue *data G_GNUC_UNUSED) { qemuMonitorEmitPMWakeup(mon); } static void -qemuMonitorJSONHandlePMSuspend(qemuMonitorPtr mon, - virJSONValuePtr data G_GNUC_UNUSED) +qemuMonitorJSONHandlePMSuspend(qemuMonitor *mon, + virJSONValue *data G_GNUC_UNUSED) { qemuMonitorEmitPMSuspend(mon); } static void -qemuMonitorJSONHandleBlockJobCompleted(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleBlockJobCompleted(qemuMonitor *mon, + virJSONValue *data) { qemuMonitorJSONHandleBlockJobImpl(mon, data, VIR_DOMAIN_BLOCK_JOB_COMPLETED); } static void -qemuMonitorJSONHandleBlockJobCanceled(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleBlockJobCanceled(qemuMonitor *mon, + virJSONValue *data) { qemuMonitorJSONHandleBlockJobImpl(mon, data, VIR_DOMAIN_BLOCK_JOB_CANCELED); } static void -qemuMonitorJSONHandleBlockJobReady(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleBlockJobReady(qemuMonitor *mon, + virJSONValue *data) { qemuMonitorJSONHandleBlockJobImpl(mon, data, VIR_DOMAIN_BLOCK_JOB_READY); } static void -qemuMonitorJSONHandleBalloonChange(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleBalloonChange(qemuMonitor *mon, + virJSONValue *data) { unsigned long long actual = 0; if (virJSONValueObjectGetNumberUlong(data, "actual", &actual) < 0) { @@ -1257,14 +1257,14 @@ qemuMonitorJSONHandleBalloonChange(qemuMonitorPtr mon, } static void -qemuMonitorJSONHandlePMSuspendDisk(qemuMonitorPtr mon, - virJSONValuePtr data G_GNUC_UNUSED) +qemuMonitorJSONHandlePMSuspendDisk(qemuMonitor *mon, + virJSONValue *data G_GNUC_UNUSED) { qemuMonitorEmitPMSuspendDisk(mon); } static void -qemuMonitorJSONHandleDeviceDeleted(qemuMonitorPtr mon, virJSONValuePtr data) +qemuMonitorJSONHandleDeviceDeleted(qemuMonitor *mon, virJSONValue *data) { const char *device; @@ -1278,7 +1278,7 @@ qemuMonitorJSONHandleDeviceDeleted(qemuMonitorPtr mon, virJSONValuePtr data) static void -qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitorPtr mon, virJSONValuePtr data) +qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitor *mon, virJSONValue *data) { const char *name; @@ -1292,8 +1292,8 @@ qemuMonitorJSONHandleNicRxFilterChanged(qemuMonitorPtr mon, virJSONValuePtr data static void -qemuMonitorJSONHandleSerialChange(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleSerialChange(qemuMonitor *mon, + virJSONValue *data) { const char *name; bool connected; @@ -1313,18 +1313,18 @@ qemuMonitorJSONHandleSerialChange(qemuMonitorPtr mon, static void -qemuMonitorJSONHandleSpiceMigrated(qemuMonitorPtr mon, - virJSONValuePtr data G_GNUC_UNUSED) +qemuMonitorJSONHandleSpiceMigrated(qemuMonitor *mon, + virJSONValue *data G_GNUC_UNUSED) { qemuMonitorEmitSpiceMigrated(mon); } static void -qemuMonitorJSONHandleMemoryFailure(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleMemoryFailure(qemuMonitor *mon, + virJSONValue *data) { - virJSONValuePtr flagsjson = virJSONValueObjectGetObject(data, "flags"); + virJSONValue *flagsjson = virJSONValueObjectGetObject(data, "flags"); const char *str; int recipient; int action; @@ -1368,8 +1368,8 @@ qemuMonitorJSONHandleMemoryFailure(qemuMonitorPtr mon, static void -qemuMonitorJSONHandleMigrationStatus(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleMigrationStatus(qemuMonitor *mon, + virJSONValue *data) { const char *str; int status; @@ -1389,8 +1389,8 @@ qemuMonitorJSONHandleMigrationStatus(qemuMonitorPtr mon, static void -qemuMonitorJSONHandleMigrationPass(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleMigrationPass(qemuMonitor *mon, + virJSONValue *data) { int pass; @@ -1404,9 +1404,9 @@ qemuMonitorJSONHandleMigrationPass(qemuMonitorPtr mon, static void -qemuMonitorJSONHandleAcpiOstInfo(qemuMonitorPtr mon, virJSONValuePtr data) +qemuMonitorJSONHandleAcpiOstInfo(qemuMonitor *mon, virJSONValue *data) { - virJSONValuePtr info; + virJSONValue *info; const char *alias; const char *slotType; const char *slot; @@ -1441,7 +1441,7 @@ qemuMonitorJSONHandleAcpiOstInfo(qemuMonitorPtr mon, virJSONValuePtr data) static void -qemuMonitorJSONHandleBlockThreshold(qemuMonitorPtr mon, virJSONValuePtr data) +qemuMonitorJSONHandleBlockThreshold(qemuMonitor *mon, virJSONValue *data) { const char *nodename; unsigned long long threshold; @@ -1465,8 +1465,8 @@ qemuMonitorJSONHandleBlockThreshold(qemuMonitorPtr mon, virJSONValuePtr data) static int -qemuMonitorJSONExtractDumpStats(virJSONValuePtr result, - qemuMonitorDumpStatsPtr ret) +qemuMonitorJSONExtractDumpStats(virJSONValue *result, + qemuMonitorDumpStats *ret) { const char *statusstr; @@ -1501,10 +1501,10 @@ qemuMonitorJSONExtractDumpStats(virJSONValuePtr result, static void -qemuMonitorJSONHandleDumpCompleted(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleDumpCompleted(qemuMonitor *mon, + virJSONValue *data) { - virJSONValuePtr result; + virJSONValue *result; int status; qemuMonitorDumpStats stats = { 0 }; const char *error = NULL; @@ -1522,8 +1522,8 @@ qemuMonitorJSONHandleDumpCompleted(qemuMonitorPtr mon, } -static void qemuMonitorJSONHandlePRManagerStatusChanged(qemuMonitorPtr mon, - virJSONValuePtr data) +static void qemuMonitorJSONHandlePRManagerStatusChanged(qemuMonitor *mon, + virJSONValue *data) { const char *name; bool connected; @@ -1543,8 +1543,8 @@ static void qemuMonitorJSONHandlePRManagerStatusChanged(qemuMonitorPtr mon, } -static void qemuMonitorJSONHandleRdmaGidStatusChanged(qemuMonitorPtr mon, - virJSONValuePtr data) +static void qemuMonitorJSONHandleRdmaGidStatusChanged(qemuMonitor *mon, + virJSONValue *data) { const char *netdev; bool gid_status; @@ -1578,8 +1578,8 @@ static void qemuMonitorJSONHandleRdmaGidStatusChanged(qemuMonitorPtr mon, static void -qemuMonitorJSONHandleGuestCrashloaded(qemuMonitorPtr mon, - virJSONValuePtr data) +qemuMonitorJSONHandleGuestCrashloaded(qemuMonitor *mon, + virJSONValue *data) { VIR_DEBUG("qemuMonitorJSONHandleGuestCrashloaded event, mon %p, data %p", mon, data); @@ -1588,13 +1588,13 @@ qemuMonitorJSONHandleGuestCrashloaded(qemuMonitorPtr mon, int -qemuMonitorJSONHumanCommand(qemuMonitorPtr mon, +qemuMonitorJSONHumanCommand(qemuMonitor *mon, const char *cmd_str, char **reply_str) { - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; - virJSONValuePtr obj; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; + virJSONValue *obj; int ret = -1; cmd = qemuMonitorJSONMakeCommand("human-monitor-command", @@ -1633,7 +1633,7 @@ qemuMonitorJSONHumanCommand(qemuMonitorPtr mon, int -qemuMonitorJSONSetCapabilities(qemuMonitorPtr mon) +qemuMonitorJSONSetCapabilities(qemuMonitor *mon) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; @@ -1653,11 +1653,11 @@ qemuMonitorJSONSetCapabilities(qemuMonitorPtr mon) int -qemuMonitorJSONStartCPUs(qemuMonitorPtr mon) +qemuMonitorJSONStartCPUs(qemuMonitor *mon) { int ret; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("cont", NULL); - virJSONValuePtr reply = NULL; + virJSONValue *cmd = qemuMonitorJSONMakeCommand("cont", NULL); + virJSONValue *reply = NULL; size_t i = 0; int timeout = 3; if (!cmd) @@ -1690,11 +1690,11 @@ qemuMonitorJSONStartCPUs(qemuMonitorPtr mon) int -qemuMonitorJSONStopCPUs(qemuMonitorPtr mon) +qemuMonitorJSONStopCPUs(qemuMonitor *mon) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("stop", NULL); - virJSONValuePtr reply = NULL; + virJSONValue *cmd = qemuMonitorJSONMakeCommand("stop", NULL); + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -1713,15 +1713,15 @@ qemuMonitorJSONStopCPUs(qemuMonitorPtr mon) int -qemuMonitorJSONGetStatus(qemuMonitorPtr mon, +qemuMonitorJSONGetStatus(qemuMonitor *mon, bool *running, virDomainPausedReason *reason) { int ret = -1; const char *status; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; if (reason) *reason = VIR_DOMAIN_PAUSED_UNKNOWN; @@ -1759,11 +1759,11 @@ qemuMonitorJSONGetStatus(qemuMonitorPtr mon, } -int qemuMonitorJSONSystemPowerdown(qemuMonitorPtr mon) +int qemuMonitorJSONSystemPowerdown(qemuMonitor *mon) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("system_powerdown", NULL); - virJSONValuePtr reply = NULL; + virJSONValue *cmd = qemuMonitorJSONMakeCommand("system_powerdown", NULL); + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -1780,13 +1780,13 @@ int qemuMonitorJSONSystemPowerdown(qemuMonitorPtr mon) return ret; } -int qemuMonitorJSONSetLink(qemuMonitorPtr mon, +int qemuMonitorJSONSetLink(qemuMonitor *mon, const char *name, virDomainNetInterfaceLinkState state) { int ret = -1; - virJSONValuePtr reply = NULL; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("set_link", + virJSONValue *reply = NULL; + virJSONValue *cmd = qemuMonitorJSONMakeCommand("set_link", "s:name", name, "b:up", state != VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN, NULL); @@ -1807,11 +1807,11 @@ int qemuMonitorJSONSetLink(qemuMonitorPtr mon, return ret; } -int qemuMonitorJSONSystemReset(qemuMonitorPtr mon) +int qemuMonitorJSONSystemReset(qemuMonitor *mon) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("system_reset", NULL); - virJSONValuePtr reply = NULL; + virJSONValue *cmd = qemuMonitorJSONMakeCommand("system_reset", NULL); + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -1850,7 +1850,7 @@ int qemuMonitorJSONSystemReset(qemuMonitorPtr mon) * */ static void -qemuMonitorJSONExtractCPUS390Info(virJSONValuePtr jsoncpu, +qemuMonitorJSONExtractCPUS390Info(virJSONValue *jsoncpu, struct qemuMonitorQueryCpusEntry *cpu) { const char *cpu_state = virJSONValueObjectGetString(jsoncpu, "cpu-state"); @@ -1913,7 +1913,7 @@ qemuMonitorJSONExtractCPUS390Info(virJSONValuePtr jsoncpu, * "query-cpus-fast" command is replaced by "target". */ static int -qemuMonitorJSONExtractCPUInfo(virJSONValuePtr data, +qemuMonitorJSONExtractCPUInfo(virJSONValue *data, struct qemuMonitorQueryCpusEntry **entries, size_t *nentries, bool fast) @@ -1930,7 +1930,7 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr data, cpus = g_new0(struct qemuMonitorQueryCpusEntry, ncpus); for (i = 0; i < ncpus; i++) { - virJSONValuePtr entry = virJSONValueArrayGet(data, i); + virJSONValue *entry = virJSONValueArrayGet(data, i); int cpuid = -1; int thread = 0; bool halted = false; @@ -1995,16 +1995,16 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr data, * query failed gracefully. */ int -qemuMonitorJSONQueryCPUs(qemuMonitorPtr mon, +qemuMonitorJSONQueryCPUs(qemuMonitor *mon, struct qemuMonitorQueryCpusEntry **entries, size_t *nentries, bool force, bool fast) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; if (fast) cmd = qemuMonitorJSONMakeCommand("query-cpus-fast", NULL); @@ -2041,8 +2041,8 @@ qemuMonitorJSONQueryCPUs(qemuMonitorPtr mon, * Return 0 on success, -1 on failure and set proper error message. */ int -qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon, - virDomainVideoDefPtr video, +qemuMonitorJSONUpdateVideoMemorySize(qemuMonitor *mon, + virDomainVideoDef *video, char *path) { qemuMonitorJSONObjectProperty prop = { @@ -2111,8 +2111,8 @@ qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon, * Return 0 on success, -1 on failure and set proper error message. */ int -qemuMonitorJSONUpdateVideoVram64Size(qemuMonitorPtr mon, - virDomainVideoDefPtr video, +qemuMonitorJSONUpdateVideoVram64Size(qemuMonitor *mon, + virDomainVideoDef *video, char *path) { qemuMonitorJSONObjectProperty prop = { @@ -2147,15 +2147,15 @@ qemuMonitorJSONUpdateVideoVram64Size(qemuMonitorPtr mon, int -qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon, +qemuMonitorJSONGetBalloonInfo(qemuMonitor *mon, unsigned long long *currmem) { int ret = -1; - virJSONValuePtr data; + virJSONValue *data; unsigned long long mem; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-balloon", + virJSONValue *cmd = qemuMonitorJSONMakeCommand("query-balloon", NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; *currmem = 0; @@ -2230,16 +2230,16 @@ qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon, } -int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon, +int qemuMonitorJSONGetMemoryStats(qemuMonitor *mon, char *balloonpath, virDomainMemoryStatPtr stats, unsigned int nr_stats) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; - virJSONValuePtr statsdata; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; + virJSONValue *data; + virJSONValue *statsdata; unsigned long long mem; int got = 0; @@ -2321,7 +2321,7 @@ int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon, * collection interval property to enable statistics gathering. */ int -qemuMonitorJSONSetMemoryStatsPeriod(qemuMonitorPtr mon, +qemuMonitorJSONSetMemoryStatsPeriod(qemuMonitor *mon, char *balloonpath, int period) { @@ -2341,7 +2341,7 @@ qemuMonitorJSONSetMemoryStatsPeriod(qemuMonitorPtr mon, int -qemuMonitorJSONSetDBusVMStateIdList(qemuMonitorPtr mon, +qemuMonitorJSONSetDBusVMStateIdList(qemuMonitor *mon, const char *vmstatepath, const char *idstr) { @@ -2362,12 +2362,12 @@ qemuMonitorJSONSetDBusVMStateIdList(qemuMonitorPtr mon, * * Returns: NULL on error, reply on success */ -static virJSONValuePtr -qemuMonitorJSONQueryBlock(qemuMonitorPtr mon) +static virJSONValue * +qemuMonitorJSONQueryBlock(qemuMonitor *mon) { - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr devices = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *devices = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("query-block", NULL))) return NULL; @@ -2385,11 +2385,11 @@ qemuMonitorJSONQueryBlock(qemuMonitorPtr mon) } -static virJSONValuePtr -qemuMonitorJSONGetBlockDev(virJSONValuePtr devices, +static virJSONValue * +qemuMonitorJSONGetBlockDev(virJSONValue *devices, size_t idx) { - virJSONValuePtr dev = virJSONValueArrayGet(devices, idx); + virJSONValue *dev = virJSONValueArrayGet(devices, idx); if (!dev || virJSONValueGetType(dev) != VIR_JSON_TYPE_OBJECT) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -2401,7 +2401,7 @@ qemuMonitorJSONGetBlockDev(virJSONValuePtr devices, static const char * -qemuMonitorJSONGetBlockDevDevice(virJSONValuePtr dev) +qemuMonitorJSONGetBlockDevDevice(virJSONValue *dev) { const char *thisdev; @@ -2445,20 +2445,20 @@ qemuMonitorJSONBlockInfoAdd(GHashTable *table, } -int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, +int qemuMonitorJSONGetBlockInfo(qemuMonitor *mon, GHashTable *table) { int ret = -1; size_t i; - virJSONValuePtr devices; + virJSONValue *devices; if (!(devices = qemuMonitorJSONQueryBlock(mon))) return -1; for (i = 0; i < virJSONValueArraySize(devices); i++) { - virJSONValuePtr dev; - virJSONValuePtr image; + virJSONValue *dev; + virJSONValue *image; struct qemuDomainDiskInfo info = { false }; const char *thisdev; const char *status; @@ -2523,14 +2523,14 @@ int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, } -static qemuBlockStatsPtr -qemuMonitorJSONBlockStatsCollectData(virJSONValuePtr dev, +static qemuBlockStats * +qemuMonitorJSONBlockStatsCollectData(virJSONValue *dev, int *nstats) { - g_autofree qemuBlockStatsPtr bstats = NULL; - virJSONValuePtr parent; - virJSONValuePtr parentstats; - virJSONValuePtr stats; + g_autofree qemuBlockStats *bstats = NULL; + virJSONValue *parent; + virJSONValue *parentstats; + virJSONValue *stats; if ((stats = virJSONValueObjectGetObject(dev, "stats")) == NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -2572,11 +2572,11 @@ qemuMonitorJSONBlockStatsCollectData(virJSONValuePtr dev, static int -qemuMonitorJSONAddOneBlockStatsInfo(qemuBlockStatsPtr bstats, +qemuMonitorJSONAddOneBlockStatsInfo(qemuBlockStats *bstats, const char *name, GHashTable *stats) { - qemuBlockStatsPtr copy = NULL; + qemuBlockStats *copy = NULL; copy = g_new0(qemuBlockStats, 1); @@ -2593,18 +2593,18 @@ qemuMonitorJSONAddOneBlockStatsInfo(qemuBlockStatsPtr bstats, static int -qemuMonitorJSONGetOneBlockStatsInfo(virJSONValuePtr dev, +qemuMonitorJSONGetOneBlockStatsInfo(virJSONValue *dev, const char *dev_name, int depth, GHashTable *hash, bool backingChain) { - g_autofree qemuBlockStatsPtr bstats = NULL; + g_autofree qemuBlockStats *bstats = NULL; int nstats = 0; const char *qdevname = NULL; const char *nodename = NULL; g_autofree char *devicename = NULL; - virJSONValuePtr backing; + virJSONValue *backing; if (dev_name && !(devicename = qemuDomainStorageAlias(dev_name, depth))) @@ -2644,12 +2644,12 @@ qemuMonitorJSONGetOneBlockStatsInfo(virJSONValuePtr dev, } -virJSONValuePtr -qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon) +virJSONValue * +qemuMonitorJSONQueryBlockstats(qemuMonitor *mon) { - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr ret = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *ret = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("query-blockstats", NULL))) return NULL; @@ -2670,7 +2670,7 @@ qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon) int -qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, +qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon, GHashTable *hash, bool backingChain) { @@ -2683,7 +2683,7 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, return -1; for (i = 0; i < virJSONValueArraySize(devices); i++) { - virJSONValuePtr dev = virJSONValueArrayGet(devices, i); + virJSONValue *dev = virJSONValueArrayGet(devices, i); const char *dev_name; if (!dev || virJSONValueGetType(dev) != VIR_JSON_TYPE_OBJECT) { @@ -2718,12 +2718,12 @@ qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, static int -qemuMonitorJSONBlockStatsUpdateCapacityData(virJSONValuePtr image, +qemuMonitorJSONBlockStatsUpdateCapacityData(virJSONValue *image, const char *name, GHashTable *stats, - qemuBlockStatsPtr *entry) + qemuBlockStats **entry) { - qemuBlockStatsPtr bstats; + qemuBlockStats *bstats; if (!(bstats = virHashLookup(stats, name))) { bstats = g_new0(qemuBlockStats, 1); @@ -2752,7 +2752,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityData(virJSONValuePtr image, static int -qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValuePtr image, +qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValue *image, const char *dev_name, int depth, GHashTable *stats, @@ -2760,7 +2760,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValuePtr image, { int ret = -1; char *entry_name = qemuDomainStorageAlias(dev_name, depth); - virJSONValuePtr backing; + virJSONValue *backing; if (qemuMonitorJSONBlockStatsUpdateCapacityData(image, entry_name, stats, NULL) < 0) @@ -2783,21 +2783,21 @@ qemuMonitorJSONBlockStatsUpdateCapacityOne(virJSONValuePtr image, int -qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, +qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitor *mon, GHashTable *stats, bool backingChain) { int ret = -1; size_t i; - virJSONValuePtr devices; + virJSONValue *devices; if (!(devices = qemuMonitorJSONQueryBlock(mon))) return -1; for (i = 0; i < virJSONValueArraySize(devices); i++) { - virJSONValuePtr dev; - virJSONValuePtr inserted; - virJSONValuePtr image; + virJSONValue *dev; + virJSONValue *inserted; + virJSONValue *image; const char *dev_name; if (!(dev = qemuMonitorJSONGetBlockDev(devices, i))) @@ -2827,13 +2827,13 @@ qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, static int qemuMonitorJSONBlockStatsUpdateCapacityBlockdevWorker(size_t pos G_GNUC_UNUSED, - virJSONValuePtr val, + virJSONValue *val, void *opaque) { GHashTable *stats = opaque; - virJSONValuePtr image; + virJSONValue *image; const char *nodename; - qemuBlockStatsPtr entry; + qemuBlockStats *entry; if (!(nodename = virJSONValueObjectGetString(val, "node-name")) || !(image = virJSONValueObjectGetObject(val, "image"))) { @@ -2854,10 +2854,10 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdevWorker(size_t pos G_GNUC_UNUSED, int -qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, +qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon, GHashTable *stats) { - virJSONValuePtr nodes; + virJSONValue *nodes; int ret = -1; if (!(nodes = qemuMonitorJSONQueryNamedBlockNodes(mon, false))) @@ -2877,7 +2877,7 @@ qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, static void -qemuMonitorJSONBlockNamedNodeDataBitmapFree(qemuBlockNamedNodeDataBitmapPtr bitmap) +qemuMonitorJSONBlockNamedNodeDataBitmapFree(qemuBlockNamedNodeDataBitmap *bitmap) { if (!bitmap) return; @@ -2891,7 +2891,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuBlockNamedNodeDataBitmap, static void -qemuMonitorJSONBlockNamedNodeDataFree(qemuBlockNamedNodeDataPtr data) +qemuMonitorJSONBlockNamedNodeDataFree(qemuBlockNamedNodeData *data) { size_t i; @@ -2906,8 +2906,8 @@ qemuMonitorJSONBlockNamedNodeDataFree(qemuBlockNamedNodeDataPtr data) G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuBlockNamedNodeData, qemuMonitorJSONBlockNamedNodeDataFree); -static qemuBlockNamedNodeDataBitmapPtr -qemuMonitorJSONBlockGetNamedNodeDataBitmapOne(virJSONValuePtr val) +static qemuBlockNamedNodeDataBitmap * +qemuMonitorJSONBlockGetNamedNodeDataBitmapOne(virJSONValue *val) { g_autoptr(qemuBlockNamedNodeDataBitmap) bitmap = NULL; const char *name; @@ -2931,17 +2931,17 @@ qemuMonitorJSONBlockGetNamedNodeDataBitmapOne(virJSONValuePtr val) static void -qemuMonitorJSONBlockGetNamedNodeDataBitmaps(virJSONValuePtr bitmaps, - qemuBlockNamedNodeDataPtr data) +qemuMonitorJSONBlockGetNamedNodeDataBitmaps(virJSONValue *bitmaps, + qemuBlockNamedNodeData *data) { size_t nbitmaps = virJSONValueArraySize(bitmaps); size_t i; - data->bitmaps = g_new0(qemuBlockNamedNodeDataBitmapPtr, nbitmaps); + data->bitmaps = g_new0(qemuBlockNamedNodeDataBitmap *, nbitmaps); for (i = 0; i < nbitmaps; i++) { - virJSONValuePtr bitmap = virJSONValueArrayGet(bitmaps, i); - qemuBlockNamedNodeDataBitmapPtr tmp; + virJSONValue *bitmap = virJSONValueArrayGet(bitmaps, i); + qemuBlockNamedNodeDataBitmap *tmp; if (!bitmap) continue; @@ -2956,13 +2956,13 @@ qemuMonitorJSONBlockGetNamedNodeDataBitmaps(virJSONValuePtr bitmaps, static int qemuMonitorJSONBlockGetNamedNodeDataWorker(size_t pos G_GNUC_UNUSED, - virJSONValuePtr val, + virJSONValue *val, void *opaque) { GHashTable *nodes = opaque; - virJSONValuePtr img; - virJSONValuePtr bitmaps; - virJSONValuePtr format_specific; + virJSONValue *img; + virJSONValue *bitmaps; + virJSONValue *format_specific; const char *nodename; g_autoptr(qemuBlockNamedNodeData) ent = NULL; @@ -2988,7 +2988,7 @@ qemuMonitorJSONBlockGetNamedNodeDataWorker(size_t pos G_GNUC_UNUSED, /* query qcow2 format specific props */ if ((format_specific = virJSONValueObjectGetObject(img, "format-specific")) && STREQ_NULLABLE(virJSONValueObjectGetString(format_specific, "type"), "qcow2")) { - virJSONValuePtr qcow2props = virJSONValueObjectGetObject(format_specific, "data"); + virJSONValue *qcow2props = virJSONValueObjectGetObject(format_specific, "data"); if (qcow2props && STREQ_NULLABLE(virJSONValueObjectGetString(qcow2props, "compat"), "0.10")) @@ -3010,7 +3010,7 @@ qemuMonitorJSONBlockGetNamedNodeDataWorker(size_t pos G_GNUC_UNUSED, GHashTable * -qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValuePtr nodes) +qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValue *nodes) { g_autoptr(GHashTable) ret = NULL; @@ -3026,7 +3026,7 @@ qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValuePtr nodes) GHashTable * -qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon, +qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon, bool supports_flat) { g_autoptr(virJSONValue) nodes = NULL; @@ -3038,14 +3038,14 @@ qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon, } -int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, +int qemuMonitorJSONBlockResize(qemuMonitor *mon, const char *device, const char *nodename, unsigned long long size) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("block_resize", "S:device", device, @@ -3069,18 +3069,18 @@ int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, } -int qemuMonitorJSONSetPassword(qemuMonitorPtr mon, +int qemuMonitorJSONSetPassword(qemuMonitor *mon, const char *protocol, const char *password, const char *action_if_connected) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("set_password", + virJSONValue *cmd = qemuMonitorJSONMakeCommand("set_password", "s:protocol", protocol, "s:password", password, "s:connected", action_if_connected, NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -3097,16 +3097,16 @@ int qemuMonitorJSONSetPassword(qemuMonitorPtr mon, return ret; } -int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon, +int qemuMonitorJSONExpirePassword(qemuMonitor *mon, const char *protocol, const char *expire_time) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("expire_password", + virJSONValue *cmd = qemuMonitorJSONMakeCommand("expire_password", "s:protocol", protocol, "s:time", expire_time, NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -3125,14 +3125,14 @@ int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon, int -qemuMonitorJSONSetBalloon(qemuMonitorPtr mon, +qemuMonitorJSONSetBalloon(qemuMonitor *mon, unsigned long long newmem) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("balloon", + virJSONValue *cmd = qemuMonitorJSONMakeCommand("balloon", "U:value", newmem * 1024, NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -3159,12 +3159,12 @@ qemuMonitorJSONSetBalloon(qemuMonitorPtr mon, } -int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, +int qemuMonitorJSONSetCPU(qemuMonitor *mon, int cpu, bool online) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; if (online) { cmd = qemuMonitorJSONMakeCommand("cpu-add", @@ -3197,16 +3197,16 @@ int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, * -1 on error * 0 on success */ -int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon, +int qemuMonitorJSONEjectMedia(qemuMonitor *mon, const char *dev_name, bool force) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("eject", + virJSONValue *cmd = qemuMonitorJSONMakeCommand("eject", "s:device", dev_name, "b:force", force ? 1 : 0, NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -3224,14 +3224,14 @@ int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon, } -int qemuMonitorJSONChangeMedia(qemuMonitorPtr mon, +int qemuMonitorJSONChangeMedia(qemuMonitor *mon, const char *dev_name, const char *newmedia, const char *format) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("change", "s:device", dev_name, @@ -3256,19 +3256,19 @@ int qemuMonitorJSONChangeMedia(qemuMonitorPtr mon, } -static int qemuMonitorJSONSaveMemory(qemuMonitorPtr mon, +static int qemuMonitorJSONSaveMemory(qemuMonitor *mon, const char *cmdtype, unsigned long long offset, unsigned long long length, const char *path) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand(cmdtype, + virJSONValue *cmd = qemuMonitorJSONMakeCommand(cmdtype, "U:val", offset, "U:size", length, "s:filename", path, NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -3286,7 +3286,7 @@ static int qemuMonitorJSONSaveMemory(qemuMonitorPtr mon, } -int qemuMonitorJSONSaveVirtualMemory(qemuMonitorPtr mon, +int qemuMonitorJSONSaveVirtualMemory(qemuMonitor *mon, unsigned long long offset, unsigned long long length, const char *path) @@ -3294,7 +3294,7 @@ int qemuMonitorJSONSaveVirtualMemory(qemuMonitorPtr mon, return qemuMonitorJSONSaveMemory(mon, "memsave", offset, length, path); } -int qemuMonitorJSONSavePhysicalMemory(qemuMonitorPtr mon, +int qemuMonitorJSONSavePhysicalMemory(qemuMonitor *mon, unsigned long long offset, unsigned long long length, const char *path) @@ -3303,12 +3303,12 @@ int qemuMonitorJSONSavePhysicalMemory(qemuMonitorPtr mon, } -int qemuMonitorJSONSetMigrationSpeed(qemuMonitorPtr mon, +int qemuMonitorJSONSetMigrationSpeed(qemuMonitor *mon, unsigned long bandwidth) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("migrate_set_speed", "U:value", bandwidth * 1024ULL * 1024ULL, NULL); @@ -3329,12 +3329,12 @@ int qemuMonitorJSONSetMigrationSpeed(qemuMonitorPtr mon, } -int qemuMonitorJSONSetMigrationDowntime(qemuMonitorPtr mon, +int qemuMonitorJSONSetMigrationDowntime(qemuMonitor *mon, unsigned long long downtime) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("migrate_set_downtime", "d:value", downtime / 1000.0, @@ -3357,12 +3357,12 @@ int qemuMonitorJSONSetMigrationDowntime(qemuMonitorPtr mon, int -qemuMonitorJSONGetMigrationCacheSize(qemuMonitorPtr mon, +qemuMonitorJSONGetMigrationCacheSize(qemuMonitor *mon, unsigned long long *cacheSize) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; *cacheSize = 0; @@ -3391,12 +3391,12 @@ qemuMonitorJSONGetMigrationCacheSize(qemuMonitorPtr mon, int -qemuMonitorJSONSetMigrationCacheSize(qemuMonitorPtr mon, +qemuMonitorJSONSetMigrationCacheSize(qemuMonitor *mon, unsigned long long cacheSize) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("migrate-set-cache-size", "U:value", cacheSize, @@ -3419,12 +3419,12 @@ qemuMonitorJSONSetMigrationCacheSize(qemuMonitorPtr mon, int -qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon, - virJSONValuePtr *params) +qemuMonitorJSONGetMigrationParams(qemuMonitor *mon, + virJSONValue **params) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; *params = NULL; @@ -3452,8 +3452,8 @@ qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon, } int -qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon, - virJSONValuePtr *params) +qemuMonitorJSONSetMigrationParams(qemuMonitor *mon, + virJSONValue **params) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; @@ -3472,14 +3472,14 @@ qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon, static int -qemuMonitorJSONGetMigrationStatsReply(virJSONValuePtr reply, - qemuMonitorMigrationStatsPtr stats, +qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply, + qemuMonitorMigrationStats *stats, char **error) { - virJSONValuePtr ret; - virJSONValuePtr ram; - virJSONValuePtr disk; - virJSONValuePtr comp; + virJSONValue *ret; + virJSONValue *ram; + virJSONValue *disk; + virJSONValue *comp; const char *statusstr; int rc; double mbps; @@ -3683,14 +3683,14 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValuePtr reply, } -int qemuMonitorJSONGetMigrationStats(qemuMonitorPtr mon, - qemuMonitorMigrationStatsPtr stats, +int qemuMonitorJSONGetMigrationStats(qemuMonitor *mon, + qemuMonitorMigrationStats *stats, char **error) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-migrate", + virJSONValue *cmd = qemuMonitorJSONMakeCommand("query-migrate", NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; memset(stats, 0, sizeof(*stats)); @@ -3716,19 +3716,19 @@ int qemuMonitorJSONGetMigrationStats(qemuMonitorPtr mon, } -int qemuMonitorJSONMigrate(qemuMonitorPtr mon, +int qemuMonitorJSONMigrate(qemuMonitor *mon, unsigned int flags, const char *uri) { int ret = -1; - virJSONValuePtr cmd = + virJSONValue *cmd = qemuMonitorJSONMakeCommand("migrate", "b:detach", flags & QEMU_MONITOR_MIGRATE_BACKGROUND ? 1 : 0, "b:blk", flags & QEMU_MONITOR_MIGRATE_NON_SHARED_DISK ? 1 : 0, "b:inc", flags & QEMU_MONITOR_MIGRATE_NON_SHARED_INC ? 1 : 0, "s:uri", uri, NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -3746,11 +3746,11 @@ int qemuMonitorJSONMigrate(qemuMonitorPtr mon, return ret; } -int qemuMonitorJSONMigrateCancel(qemuMonitorPtr mon) +int qemuMonitorJSONMigrateCancel(qemuMonitor *mon) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("migrate_cancel", NULL); - virJSONValuePtr reply = NULL; + virJSONValue *cmd = qemuMonitorJSONMakeCommand("migrate_cancel", NULL); + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -3778,12 +3778,12 @@ int qemuMonitorJSONMigrateCancel(qemuMonitorPtr mon) * Returns: 0 on success, -1 on failure */ int -qemuMonitorJSONQueryDump(qemuMonitorPtr mon, - qemuMonitorDumpStatsPtr stats) +qemuMonitorJSONQueryDump(qemuMonitor *mon, + qemuMonitorDumpStats *stats) { - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-dump", NULL); - virJSONValuePtr reply = NULL; - virJSONValuePtr result = NULL; + virJSONValue *cmd = qemuMonitorJSONMakeCommand("query-dump", NULL); + virJSONValue *reply = NULL; + virJSONValue *result = NULL; int ret = -1; if (!cmd) @@ -3807,14 +3807,14 @@ qemuMonitorJSONQueryDump(qemuMonitorPtr mon, int -qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitorPtr mon, +qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitor *mon, const char *capability) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr caps; - virJSONValuePtr formats; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *caps; + virJSONValue *formats; size_t i; if (!(cmd = qemuMonitorJSONMakeCommand("query-dump-guest-memory-capability", @@ -3841,7 +3841,7 @@ qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitorPtr mon, } for (i = 0; i < virJSONValueArraySize(formats); i++) { - virJSONValuePtr dumpformat = virJSONValueArrayGet(formats, i); + virJSONValue *dumpformat = virJSONValueArrayGet(formats, i); if (!dumpformat || virJSONValueGetType(dumpformat) != VIR_JSON_TYPE_STRING) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -3863,14 +3863,14 @@ qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitorPtr mon, } int -qemuMonitorJSONDump(qemuMonitorPtr mon, +qemuMonitorJSONDump(qemuMonitor *mon, const char *protocol, const char *dumpformat, bool detach) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("dump-guest-memory", "b:paging", false, @@ -3894,7 +3894,7 @@ qemuMonitorJSONDump(qemuMonitorPtr mon, return ret; } -int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon, +int qemuMonitorJSONGraphicsRelocate(qemuMonitor *mon, int type, const char *hostname, int port, @@ -3902,7 +3902,7 @@ int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon, const char *tlsSubject) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("client_migrate_info", + virJSONValue *cmd = qemuMonitorJSONMakeCommand("client_migrate_info", "s:protocol", (type == VIR_DOMAIN_GRAPHICS_TYPE_SPICE ? "spice" : "vnc"), "s:hostname", hostname, @@ -3910,7 +3910,7 @@ int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon, "i:tls-port", tlsPort, "S:cert-subject", tlsSubject, NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -3929,10 +3929,10 @@ int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon, static int -qemuAddfdInfoParse(virJSONValuePtr msg, - qemuMonitorAddFdInfoPtr fdinfo) +qemuAddfdInfoParse(virJSONValue *msg, + qemuMonitorAddFdInfo *fdinfo) { - virJSONValuePtr returnObj; + virJSONValue *returnObj; if (!(returnObj = virJSONValueObjectGetObject(msg, "return"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -3957,11 +3957,11 @@ qemuAddfdInfoParse(virJSONValuePtr msg, /* if fdset is negative, qemu will create a new fdset and add the fd to that */ -int qemuMonitorJSONAddFileHandleToSet(qemuMonitorPtr mon, +int qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon, int fd, int fdset, const char *opaque, - qemuMonitorAddFdInfoPtr fdinfo) + qemuMonitorAddFdInfo *fdinfo) { g_autoptr(virJSONValue) args = NULL; g_autoptr(virJSONValue) reply = NULL; @@ -3991,11 +3991,11 @@ int qemuMonitorJSONAddFileHandleToSet(qemuMonitorPtr mon, } static int -qemuMonitorJSONQueryFdsetsParse(virJSONValuePtr msg, - qemuMonitorFdsetsPtr *fdsets) +qemuMonitorJSONQueryFdsetsParse(virJSONValue *msg, + qemuMonitorFdsets **fdsets) { - virJSONValuePtr returnArray; - virJSONValuePtr entry; + virJSONValue *returnArray; + virJSONValue *entry; size_t i; g_autoptr(qemuMonitorFdsets) sets = g_new0(qemuMonitorFdsets, 1); int ninfo; @@ -4010,8 +4010,8 @@ qemuMonitorJSONQueryFdsetsParse(virJSONValuePtr msg, for (i = 0; i < ninfo; i++) { size_t j; const char *tmp; - virJSONValuePtr fdarray; - qemuMonitorFdsetInfoPtr fdsetinfo = &sets->fdsets[i]; + virJSONValue *fdarray; + qemuMonitorFdsetInfo *fdsetinfo = &sets->fdsets[i]; if (!(entry = virJSONValueArrayGet(returnArray, i))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -4032,8 +4032,8 @@ qemuMonitorJSONQueryFdsetsParse(virJSONValuePtr msg, fdsetinfo->fds = g_new0(qemuMonitorFdsetFdInfo, fdsetinfo->nfds); for (j = 0; j < fdsetinfo->nfds; j++) { - qemuMonitorFdsetFdInfoPtr fdinfo = &fdsetinfo->fds[j]; - virJSONValuePtr fdentry; + qemuMonitorFdsetFdInfo *fdinfo = &fdsetinfo->fds[j]; + virJSONValue *fdentry; if (!(fdentry = virJSONValueArrayGet(fdarray, j))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -4059,8 +4059,8 @@ qemuMonitorJSONQueryFdsetsParse(virJSONValuePtr msg, } -int qemuMonitorJSONQueryFdsets(qemuMonitorPtr mon, - qemuMonitorFdsetsPtr *fdsets) +int qemuMonitorJSONQueryFdsets(qemuMonitor *mon, + qemuMonitorFdsets **fdsets) { g_autoptr(virJSONValue) reply = NULL; g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("query-fdsets", @@ -4082,7 +4082,7 @@ int qemuMonitorJSONQueryFdsets(qemuMonitorPtr mon, } -int qemuMonitorJSONRemoveFdset(qemuMonitorPtr mon, +int qemuMonitorJSONRemoveFdset(qemuMonitor *mon, int fdset) { g_autoptr(virJSONValue) reply = NULL; @@ -4103,15 +4103,15 @@ int qemuMonitorJSONRemoveFdset(qemuMonitorPtr mon, } -int qemuMonitorJSONSendFileHandle(qemuMonitorPtr mon, +int qemuMonitorJSONSendFileHandle(qemuMonitor *mon, const char *fdname, int fd) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("getfd", + virJSONValue *cmd = qemuMonitorJSONMakeCommand("getfd", "s:fdname", fdname, NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -4129,14 +4129,14 @@ int qemuMonitorJSONSendFileHandle(qemuMonitorPtr mon, } -int qemuMonitorJSONCloseFileHandle(qemuMonitorPtr mon, +int qemuMonitorJSONCloseFileHandle(qemuMonitor *mon, const char *fdname) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("closefd", + virJSONValue *cmd = qemuMonitorJSONMakeCommand("closefd", "s:fdname", fdname, NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -4155,8 +4155,8 @@ int qemuMonitorJSONCloseFileHandle(qemuMonitorPtr mon, int -qemuMonitorJSONAddNetdev(qemuMonitorPtr mon, - virJSONValuePtr *props) +qemuMonitorJSONAddNetdev(qemuMonitor *mon, + virJSONValue **props) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; @@ -4175,7 +4175,7 @@ qemuMonitorJSONAddNetdev(qemuMonitorPtr mon, int -qemuMonitorJSONRemoveNetdev(qemuMonitorPtr mon, +qemuMonitorJSONRemoveNetdev(qemuMonitor *mon, const char *alias) { g_autoptr(virJSONValue) cmd = qemuMonitorJSONMakeCommand("netdev_del", @@ -4197,18 +4197,18 @@ qemuMonitorJSONRemoveNetdev(qemuMonitorPtr mon, static int -qemuMonitorJSONQueryRxFilterParse(virJSONValuePtr msg, - virNetDevRxFilterPtr *filter) +qemuMonitorJSONQueryRxFilterParse(virJSONValue *msg, + virNetDevRxFilter **filter) { int ret = -1; const char *tmp; - virJSONValuePtr returnArray; - virJSONValuePtr entry; - virJSONValuePtr table; - virJSONValuePtr element; + virJSONValue *returnArray; + virJSONValue *entry; + virJSONValue *table; + virJSONValue *element; size_t nTable; size_t i; - virNetDevRxFilterPtr fil = virNetDevRxFilterNew(); + virNetDevRxFilter *fil = virNetDevRxFilterNew(); if (!fil) goto cleanup; @@ -4372,14 +4372,14 @@ qemuMonitorJSONQueryRxFilterParse(virJSONValuePtr msg, int -qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias, - virNetDevRxFilterPtr *filter) +qemuMonitorJSONQueryRxFilter(qemuMonitor *mon, const char *alias, + virNetDevRxFilter **filter) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-rx-filter", + virJSONValue *cmd = qemuMonitorJSONMakeCommand("query-rx-filter", "s:name", alias, NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; if (!cmd) goto cleanup; @@ -4416,18 +4416,18 @@ qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias, * */ static int -qemuMonitorJSONExtractChardevInfo(virJSONValuePtr reply, +qemuMonitorJSONExtractChardevInfo(virJSONValue *reply, GHashTable *info) { - virJSONValuePtr data; + virJSONValue *data; int ret = -1; size_t i; - qemuMonitorChardevInfoPtr entry = NULL; + qemuMonitorChardevInfo *entry = NULL; data = virJSONValueObjectGetArray(reply, "return"); for (i = 0; i < virJSONValueArraySize(data); i++) { - virJSONValuePtr chardev = virJSONValueArrayGet(data, i); + virJSONValue *chardev = virJSONValueArrayGet(data, i); const char *type; const char *alias; bool connected; @@ -4484,14 +4484,14 @@ qemuMonitorJSONExtractChardevInfo(virJSONValuePtr reply, int -qemuMonitorJSONGetChardevInfo(qemuMonitorPtr mon, +qemuMonitorJSONGetChardevInfo(qemuMonitor *mon, GHashTable *info) { int ret = -1; - virJSONValuePtr cmd = qemuMonitorJSONMakeCommand("query-chardev", + virJSONValue *cmd = qemuMonitorJSONMakeCommand("query-chardev", NULL); - virJSONValuePtr reply = NULL; + virJSONValue *reply = NULL; if (!cmd) return -1; @@ -4510,12 +4510,12 @@ qemuMonitorJSONGetChardevInfo(qemuMonitorPtr mon, } -int qemuMonitorJSONDelDevice(qemuMonitorPtr mon, +int qemuMonitorJSONDelDevice(qemuMonitor *mon, const char *devalias) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("device_del", "s:id", devalias, @@ -4543,12 +4543,12 @@ int qemuMonitorJSONDelDevice(qemuMonitorPtr mon, int -qemuMonitorJSONAddDeviceArgs(qemuMonitorPtr mon, - virJSONValuePtr args) +qemuMonitorJSONAddDeviceArgs(qemuMonitor *mon, + virJSONValue *args) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("device_add", NULL))) goto cleanup; @@ -4572,10 +4572,10 @@ qemuMonitorJSONAddDeviceArgs(qemuMonitorPtr mon, int -qemuMonitorJSONAddDevice(qemuMonitorPtr mon, +qemuMonitorJSONAddDevice(qemuMonitor *mon, const char *devicestr) { - virJSONValuePtr args; + virJSONValue *args; if (!(args = qemuMonitorJSONKeywordStringToJSON(devicestr, "driver"))) return -1; @@ -4585,8 +4585,8 @@ qemuMonitorJSONAddDevice(qemuMonitorPtr mon, int -qemuMonitorJSONAddObject(qemuMonitorPtr mon, - virJSONValuePtr *props) +qemuMonitorJSONAddObject(qemuMonitor *mon, + virJSONValue **props) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; @@ -4605,7 +4605,7 @@ qemuMonitorJSONAddObject(qemuMonitorPtr mon, int -qemuMonitorJSONDelObject(qemuMonitorPtr mon, +qemuMonitorJSONDelObject(qemuMonitor *mon, const char *objalias, bool report_error) { @@ -4627,7 +4627,7 @@ qemuMonitorJSONDelObject(qemuMonitorPtr mon, /* speed is in bytes/sec */ int -qemuMonitorJSONDriveMirror(qemuMonitorPtr mon, +qemuMonitorJSONDriveMirror(qemuMonitor *mon, const char *device, const char *file, const char *format, unsigned long long speed, unsigned int granularity, @@ -4659,7 +4659,7 @@ qemuMonitorJSONDriveMirror(qemuMonitorPtr mon, int -qemuMonitorJSONBlockdevMirror(qemuMonitorPtr mon, +qemuMonitorJSONBlockdevMirror(qemuMonitor *mon, const char *jobname, bool persistjob, const char *device, @@ -4701,11 +4701,11 @@ qemuMonitorJSONBlockdevMirror(qemuMonitorPtr mon, int -qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions) +qemuMonitorJSONTransaction(qemuMonitor *mon, virJSONValue **actions) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("transaction", "a:actions", actions, @@ -4730,11 +4730,11 @@ qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions) * and base. The probe return is true if active commit is detected or false * if not supported or on any error */ bool -qemuMonitorJSONSupportsActiveCommit(qemuMonitorPtr mon) +qemuMonitorJSONSupportsActiveCommit(qemuMonitor *mon) { bool ret = false; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("block-commit", "s:device", "bogus", NULL))) @@ -4763,7 +4763,7 @@ qemuMonitorJSONSupportsActiveCommit(qemuMonitorPtr mon) /* speed is in bytes/sec. Returns 0 on success, -1 with error message * emitted on failure. */ int -qemuMonitorJSONBlockCommit(qemuMonitorPtr mon, +qemuMonitorJSONBlockCommit(qemuMonitor *mon, const char *device, const char *jobname, bool persistjob, @@ -4775,8 +4775,8 @@ qemuMonitorJSONBlockCommit(qemuMonitorPtr mon, unsigned long long speed) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; virTristateBool autofinalize = VIR_TRISTATE_BOOL_ABSENT; virTristateBool autodismiss = VIR_TRISTATE_BOOL_ABSENT; @@ -4815,11 +4815,11 @@ qemuMonitorJSONBlockCommit(qemuMonitorPtr mon, static char * -qemuMonitorJSONDiskNameLookupOne(virJSONValuePtr image, - virStorageSourcePtr top, - virStorageSourcePtr target) +qemuMonitorJSONDiskNameLookupOne(virJSONValue *image, + virStorageSource *top, + virStorageSource *target) { - virJSONValuePtr backing; + virJSONValue *backing; char *ret; /* The caller will report a generic message if we return NULL @@ -4848,22 +4848,22 @@ qemuMonitorJSONDiskNameLookupOne(virJSONValuePtr image, char * -qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon, +qemuMonitorJSONDiskNameLookup(qemuMonitor *mon, const char *device, - virStorageSourcePtr top, - virStorageSourcePtr target) + virStorageSource *top, + virStorageSource *target) { char *ret = NULL; - virJSONValuePtr devices; + virJSONValue *devices; size_t i; if (!(devices = qemuMonitorJSONQueryBlock(mon))) return NULL; for (i = 0; i < virJSONValueArraySize(devices); i++) { - virJSONValuePtr dev; - virJSONValuePtr inserted; - virJSONValuePtr image; + virJSONValue *dev; + virJSONValue *inserted; + virJSONValue *image; const char *thisdev; if (!(dev = qemuMonitorJSONGetBlockDev(devices, i))) @@ -4894,12 +4894,12 @@ qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon, } -int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon, +int qemuMonitorJSONArbitraryCommand(qemuMonitor *mon, const char *cmd_str, char **reply_str) { - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; int ret = -1; if (!(cmd = virJSONValueFromString(cmd_str))) @@ -4919,11 +4919,11 @@ int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon, return ret; } -int qemuMonitorJSONInjectNMI(qemuMonitorPtr mon) +int qemuMonitorJSONInjectNMI(qemuMonitor *mon) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("inject-nmi", NULL); if (!cmd) @@ -4942,16 +4942,16 @@ int qemuMonitorJSONInjectNMI(qemuMonitorPtr mon) return ret; } -int qemuMonitorJSONSendKey(qemuMonitorPtr mon, +int qemuMonitorJSONSendKey(qemuMonitor *mon, unsigned int holdtime, unsigned int *keycodes, unsigned int nkeycodes) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; - virJSONValuePtr keys = NULL; - virJSONValuePtr key = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; + virJSONValue *keys = NULL; + virJSONValue *key = NULL; size_t i; /* create the key data array */ @@ -5001,14 +5001,14 @@ int qemuMonitorJSONSendKey(qemuMonitorPtr mon, return ret; } -int qemuMonitorJSONScreendump(qemuMonitorPtr mon, +int qemuMonitorJSONScreendump(qemuMonitor *mon, const char *device, unsigned int head, const char *file) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("screendump", "s:filename", file, @@ -5035,10 +5035,10 @@ int qemuMonitorJSONScreendump(qemuMonitorPtr mon, static int qemuMonitorJSONParseBlockJobInfo(GHashTable *blockJobs, - virJSONValuePtr entry, + virJSONValue *entry, bool rawjobname) { - qemuMonitorBlockJobInfoPtr info = NULL; + qemuMonitorBlockJobInfo *info = NULL; const char *device; const char *type; @@ -5099,12 +5099,12 @@ qemuMonitorJSONParseBlockJobInfo(GHashTable *blockJobs, } GHashTable * -qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon, +qemuMonitorJSONGetAllBlockJobInfo(qemuMonitor *mon, bool rawjobname) { - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; + virJSONValue *data; size_t nr_results; size_t i; GHashTable *blockJobs = NULL; @@ -5126,7 +5126,7 @@ qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon, goto cleanup; for (i = 0; i < nr_results; i++) { - virJSONValuePtr entry = virJSONValueArrayGet(data, i); + virJSONValue *entry = virJSONValueArrayGet(data, i); if (!entry) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing array element")); @@ -5149,11 +5149,11 @@ qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon, static int -qemuMonitorJSONBlockJobError(virJSONValuePtr cmd, - virJSONValuePtr reply, +qemuMonitorJSONBlockJobError(virJSONValue *cmd, + virJSONValue *reply, const char *jobname) { - virJSONValuePtr error; + virJSONValue *error; if ((error = virJSONValueObjectGet(reply, "error")) && (qemuMonitorJSONErrorIsClass(error, "DeviceNotActive"))) { @@ -5168,7 +5168,7 @@ qemuMonitorJSONBlockJobError(virJSONValuePtr cmd, /* speed is in bytes/sec */ int -qemuMonitorJSONBlockStream(qemuMonitorPtr mon, +qemuMonitorJSONBlockStream(qemuMonitor *mon, const char *device, const char *jobname, bool persistjob, @@ -5178,8 +5178,8 @@ qemuMonitorJSONBlockStream(qemuMonitorPtr mon, unsigned long long speed) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; virTristateBool autofinalize = VIR_TRISTATE_BOOL_ABSENT; virTristateBool autodismiss = VIR_TRISTATE_BOOL_ABSENT; @@ -5216,12 +5216,12 @@ qemuMonitorJSONBlockStream(qemuMonitorPtr mon, int -qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon, +qemuMonitorJSONBlockJobCancel(qemuMonitor *mon, const char *jobname) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("block-job-cancel", "s:device", jobname, @@ -5244,13 +5244,13 @@ qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon, int -qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon, +qemuMonitorJSONBlockJobSetSpeed(qemuMonitor *mon, const char *jobname, unsigned long long speed) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("block-job-set-speed", "s:device", jobname, @@ -5274,12 +5274,12 @@ qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon, int -qemuMonitorJSONDrivePivot(qemuMonitorPtr mon, +qemuMonitorJSONDrivePivot(qemuMonitor *mon, const char *jobname) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("block-job-complete", "s:device", jobname, @@ -5302,7 +5302,7 @@ qemuMonitorJSONDrivePivot(qemuMonitorPtr mon, int -qemuMonitorJSONJobDismiss(qemuMonitorPtr mon, +qemuMonitorJSONJobDismiss(qemuMonitor *mon, const char *jobname) { g_autoptr(virJSONValue) cmd = NULL; @@ -5324,7 +5324,7 @@ qemuMonitorJSONJobDismiss(qemuMonitorPtr mon, int -qemuMonitorJSONJobCancel(qemuMonitorPtr mon, +qemuMonitorJSONJobCancel(qemuMonitor *mon, const char *jobname, bool quiet) { @@ -5352,7 +5352,7 @@ qemuMonitorJSONJobCancel(qemuMonitorPtr mon, int -qemuMonitorJSONJobComplete(qemuMonitorPtr mon, +qemuMonitorJSONJobComplete(qemuMonitor *mon, const char *jobname) { g_autoptr(virJSONValue) cmd = NULL; @@ -5373,14 +5373,14 @@ qemuMonitorJSONJobComplete(qemuMonitorPtr mon, } -int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon, +int qemuMonitorJSONOpenGraphics(qemuMonitor *mon, const char *protocol, const char *fdname, bool skipauth) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("add_client", "s:protocol", protocol, @@ -5422,17 +5422,17 @@ int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon, return -1; \ } static int -qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io_throttle, +qemuMonitorJSONBlockIoThrottleInfo(virJSONValue *io_throttle, const char *drivealias, const char *qdevid, - virDomainBlockIoTuneInfoPtr reply) + virDomainBlockIoTuneInfo *reply) { size_t i; bool found = false; for (i = 0; i < virJSONValueArraySize(io_throttle); i++) { - virJSONValuePtr temp_dev = virJSONValueArrayGet(io_throttle, i); - virJSONValuePtr inserted; + virJSONValue *temp_dev = virJSONValueArrayGet(io_throttle, i); + virJSONValue *inserted; const char *current_drive; const char *current_qdev; @@ -5502,18 +5502,18 @@ qemuMonitorJSONBlockIoThrottleInfo(virJSONValuePtr io_throttle, #undef GET_THROTTLE_STATS #undef GET_THROTTLE_STATS_OPTIONAL -int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon, +int qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, const char *qomid, - virDomainBlockIoTuneInfoPtr info, + virDomainBlockIoTuneInfo *info, bool supportMaxOptions, bool supportGroupNameOption, bool supportMaxLengthOptions) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr result = NULL; - virJSONValuePtr args = NULL; + virJSONValue *cmd = NULL; + virJSONValue *result = NULL; + virJSONValue *args = NULL; const char *errdev = drivealias; if (!errdev) @@ -5583,7 +5583,7 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon, virReportError(VIR_ERR_OPERATION_INVALID, _("Operation is not supported for device: %s"), errdev); } else { - virJSONValuePtr error = virJSONValueObjectGet(result, "error"); + virJSONValue *error = virJSONValueObjectGet(result, "error"); virReportError(VIR_ERR_INTERNAL_ERROR, _("unable to execute '%s', unexpected error: '%s'"), qemuMonitorJSONCommandName(cmd), @@ -5600,13 +5600,13 @@ int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon, return ret; } -int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon, +int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, const char *qdevid, - virDomainBlockIoTuneInfoPtr reply) + virDomainBlockIoTuneInfo *reply) { int ret = -1; - virJSONValuePtr devices = NULL; + virJSONValue *devices = NULL; if (!(devices = qemuMonitorJSONQueryBlock(mon))) return -1; @@ -5616,11 +5616,11 @@ int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon, return ret; } -int qemuMonitorJSONSystemWakeup(qemuMonitorPtr mon) +int qemuMonitorJSONSystemWakeup(qemuMonitor *mon) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; cmd = qemuMonitorJSONMakeCommand("system_wakeup", NULL); if (!cmd) @@ -5639,17 +5639,17 @@ int qemuMonitorJSONSystemWakeup(qemuMonitorPtr mon) return ret; } -int qemuMonitorJSONGetVersion(qemuMonitorPtr mon, +int qemuMonitorJSONGetVersion(qemuMonitor *mon, int *major, int *minor, int *micro, char **package) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; - virJSONValuePtr qemu; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; + virJSONValue *qemu; *major = *minor = *micro = 0; if (package) @@ -5707,14 +5707,14 @@ int qemuMonitorJSONGetVersion(qemuMonitorPtr mon, } -int qemuMonitorJSONGetMachines(qemuMonitorPtr mon, - qemuMonitorMachineInfoPtr **machines) +int qemuMonitorJSONGetMachines(qemuMonitor *mon, + qemuMonitorMachineInfo ***machines) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; - qemuMonitorMachineInfoPtr *infolist = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; + qemuMonitorMachineInfo **infolist = NULL; size_t n = 0; size_t i; @@ -5733,12 +5733,12 @@ int qemuMonitorJSONGetMachines(qemuMonitorPtr mon, n = virJSONValueArraySize(data); /* null-terminated list */ - infolist = g_new0(qemuMonitorMachineInfoPtr, n + 1); + infolist = g_new0(qemuMonitorMachineInfo *, n + 1); for (i = 0; i < n; i++) { - virJSONValuePtr child = virJSONValueArrayGet(data, i); + virJSONValue *child = virJSONValueArrayGet(data, i); const char *tmp; - qemuMonitorMachineInfoPtr info; + qemuMonitorMachineInfo *info; info = g_new0(qemuMonitorMachineInfo, 1); @@ -5831,13 +5831,13 @@ int qemuMonitorJSONGetMachines(qemuMonitorPtr mon, int -qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, - qemuMonitorCPUDefsPtr *cpuDefs) +qemuMonitorJSONGetCPUDefinitions(qemuMonitor *mon, + qemuMonitorCPUDefs **cpuDefs) { g_autoptr(qemuMonitorCPUDefs) defs = NULL; g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr data; + virJSONValue *data; size_t ncpus; size_t i; @@ -5866,9 +5866,9 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, return -1; for (i = 0; i < defs->ncpus; i++) { - virJSONValuePtr child = virJSONValueArrayGet(data, i); + virJSONValue *child = virJSONValueArrayGet(data, i); const char *tmp; - qemuMonitorCPUDefInfoPtr cpu = defs->cpus + i; + qemuMonitorCPUDefInfo *cpu = defs->cpus + i; if (!(tmp = virJSONValueObjectGetString(child, "name"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -5915,8 +5915,8 @@ qemuMonitorJSONParseCPUModelProperty(const char *key, virJSONValue *value, void *opaque) { - qemuMonitorCPUModelInfoPtr machine_model = opaque; - qemuMonitorCPUPropertyPtr prop; + qemuMonitorCPUModelInfo *machine_model = opaque; + qemuMonitorCPUProperty *prop; prop = machine_model->props + machine_model->nprops; @@ -5951,12 +5951,12 @@ qemuMonitorJSONParseCPUModelProperty(const char *key, } -static virJSONValuePtr -qemuMonitorJSONMakeCPUModel(virCPUDefPtr cpu, +static virJSONValue * +qemuMonitorJSONMakeCPUModel(virCPUDef *cpu, bool migratable) { - virJSONValuePtr model = virJSONValueNewObject(); - virJSONValuePtr props = NULL; + virJSONValue *model = virJSONValueNewObject(); + virJSONValue *props = NULL; size_t i; if (virJSONValueObjectAppendString(model, "name", cpu->model) < 0) @@ -5998,11 +5998,11 @@ qemuMonitorJSONMakeCPUModel(virCPUDefPtr cpu, static int -qemuMonitorJSONParseCPUModelData(virJSONValuePtr data, +qemuMonitorJSONParseCPUModelData(virJSONValue *data, const char *cmd_name, bool fail_no_props, - virJSONValuePtr *cpu_model, - virJSONValuePtr *cpu_props, + virJSONValue **cpu_model, + virJSONValue **cpu_props, const char **cpu_name) { if (!(*cpu_model = virJSONValueObjectGetObject(data, "model"))) { @@ -6030,10 +6030,10 @@ qemuMonitorJSONParseCPUModelData(virJSONValuePtr data, static int qemuMonitorJSONParseCPUModel(const char *cpu_name, - virJSONValuePtr cpu_props, - qemuMonitorCPUModelInfoPtr *model_info) + virJSONValue *cpu_props, + qemuMonitorCPUModelInfo **model_info) { - qemuMonitorCPUModelInfoPtr machine_model = NULL; + qemuMonitorCPUModelInfo *machine_model = NULL; int ret = -1; machine_model = g_new0(qemuMonitorCPUModelInfo, 1); @@ -6060,19 +6060,19 @@ qemuMonitorJSONParseCPUModel(const char *cpu_name, int -qemuMonitorJSONGetCPUModelExpansion(qemuMonitorPtr mon, +qemuMonitorJSONGetCPUModelExpansion(qemuMonitor *mon, qemuMonitorCPUModelExpansionType type, - virCPUDefPtr cpu, + virCPUDef *cpu, bool migratable, bool fail_no_props, - qemuMonitorCPUModelInfoPtr *model_info) + qemuMonitorCPUModelInfo **model_info) { g_autoptr(virJSONValue) model = NULL; g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr data; - virJSONValuePtr cpu_model; - virJSONValuePtr cpu_props = NULL; + virJSONValue *data; + virJSONValue *cpu_model; + virJSONValue *cpu_props = NULL; const char *cpu_name = ""; const char *typeStr = ""; @@ -6137,18 +6137,18 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitorPtr mon, int -qemuMonitorJSONGetCPUModelBaseline(qemuMonitorPtr mon, - virCPUDefPtr cpu_a, - virCPUDefPtr cpu_b, - qemuMonitorCPUModelInfoPtr *baseline) +qemuMonitorJSONGetCPUModelBaseline(qemuMonitor *mon, + virCPUDef *cpu_a, + virCPUDef *cpu_b, + qemuMonitorCPUModelInfo **baseline) { g_autoptr(virJSONValue) model_a = NULL; g_autoptr(virJSONValue) model_b = NULL; g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr data; - virJSONValuePtr cpu_model; - virJSONValuePtr cpu_props = NULL; + virJSONValue *data; + virJSONValue *cpu_model; + virJSONValue *cpu_props = NULL; const char *cpu_name = ""; if (!(model_a = qemuMonitorJSONMakeCPUModel(cpu_a, true)) || @@ -6179,9 +6179,9 @@ qemuMonitorJSONGetCPUModelBaseline(qemuMonitorPtr mon, int -qemuMonitorJSONGetCPUModelComparison(qemuMonitorPtr mon, - virCPUDefPtr cpu_a, - virCPUDefPtr cpu_b, +qemuMonitorJSONGetCPUModelComparison(qemuMonitor *mon, + virCPUDef *cpu_a, + virCPUDef *cpu_b, char **result) { g_autoptr(virJSONValue) model_a = NULL; @@ -6189,7 +6189,7 @@ qemuMonitorJSONGetCPUModelComparison(qemuMonitorPtr mon, g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; const char *data_result; - virJSONValuePtr data; + virJSONValue *data; if (!(model_a = qemuMonitorJSONMakeCPUModel(cpu_a, true)) || !(model_b = qemuMonitorJSONMakeCPUModel(cpu_b, true))) @@ -6221,13 +6221,13 @@ qemuMonitorJSONGetCPUModelComparison(qemuMonitorPtr mon, } -int qemuMonitorJSONGetCommands(qemuMonitorPtr mon, +int qemuMonitorJSONGetCommands(qemuMonitor *mon, char ***commands) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; char **commandlist = NULL; size_t n = 0; size_t i; @@ -6250,7 +6250,7 @@ int qemuMonitorJSONGetCommands(qemuMonitorPtr mon, commandlist = g_new0(char *, n + 1); for (i = 0; i < n; i++) { - virJSONValuePtr child = virJSONValueArrayGet(data, i); + virJSONValue *child = virJSONValueArrayGet(data, i); const char *tmp; if (!(tmp = virJSONValueObjectGetString(child, "name"))) { @@ -6274,13 +6274,13 @@ int qemuMonitorJSONGetCommands(qemuMonitorPtr mon, } -int qemuMonitorJSONGetEvents(qemuMonitorPtr mon, +int qemuMonitorJSONGetEvents(qemuMonitor *mon, char ***events) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; char **eventlist = NULL; size_t n = 0; size_t i; @@ -6308,7 +6308,7 @@ int qemuMonitorJSONGetEvents(qemuMonitorPtr mon, eventlist = g_new0(char *, n + 1); for (i = 0; i < n; i++) { - virJSONValuePtr child = virJSONValueArrayGet(data, i); + virJSONValue *child = virJSONValueArrayGet(data, i); const char *tmp; if (!(tmp = virJSONValueObjectGetString(child, "name"))) { @@ -6333,7 +6333,7 @@ int qemuMonitorJSONGetEvents(qemuMonitorPtr mon, static int qemuMonitorJSONGetCommandLineOptionsWorker(size_t pos G_GNUC_UNUSED, - virJSONValuePtr item, + virJSONValue *item, void *opaque) { const char *name = virJSONValueObjectGetString(item, "option"); @@ -6355,7 +6355,7 @@ qemuMonitorJSONGetCommandLineOptionsWorker(size_t pos G_GNUC_UNUSED, GHashTable * -qemuMonitorJSONGetCommandLineOptions(qemuMonitorPtr mon) +qemuMonitorJSONGetCommandLineOptions(qemuMonitor *mon) { g_autoptr(GHashTable) ret = virHashNew(virJSONValueHashFree); g_autoptr(virJSONValue) cmd = NULL; @@ -6379,14 +6379,14 @@ qemuMonitorJSONGetCommandLineOptions(qemuMonitorPtr mon) } -int qemuMonitorJSONGetKVMState(qemuMonitorPtr mon, +int qemuMonitorJSONGetKVMState(qemuMonitor *mon, bool *enabled, bool *present) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; - virJSONValuePtr data = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; + virJSONValue *data = NULL; /* Safe defaults */ *enabled = *present = false; @@ -6423,13 +6423,13 @@ int qemuMonitorJSONGetKVMState(qemuMonitorPtr mon, } -int qemuMonitorJSONGetObjectTypes(qemuMonitorPtr mon, +int qemuMonitorJSONGetObjectTypes(qemuMonitor *mon, char ***types) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; char **typelist = NULL; size_t n = 0; size_t i; @@ -6452,7 +6452,7 @@ int qemuMonitorJSONGetObjectTypes(qemuMonitorPtr mon, typelist = g_new0(char *, n + 1); for (i = 0; i < n; i++) { - virJSONValuePtr child = virJSONValueArrayGet(data, i); + virJSONValue *child = virJSONValueArrayGet(data, i); const char *tmp; if (!(tmp = virJSONValueObjectGetString(child, "name"))) { @@ -6475,15 +6475,15 @@ int qemuMonitorJSONGetObjectTypes(qemuMonitorPtr mon, } -int qemuMonitorJSONGetObjectListPaths(qemuMonitorPtr mon, +int qemuMonitorJSONGetObjectListPaths(qemuMonitor *mon, const char *path, - qemuMonitorJSONListPathPtr **paths) + qemuMonitorJSONListPath ***paths) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; - qemuMonitorJSONListPathPtr *pathlist = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; + qemuMonitorJSONListPath **pathlist = NULL; size_t n = 0; size_t i; @@ -6504,12 +6504,12 @@ int qemuMonitorJSONGetObjectListPaths(qemuMonitorPtr mon, n = virJSONValueArraySize(data); /* null-terminated list */ - pathlist = g_new0(qemuMonitorJSONListPathPtr, n + 1); + pathlist = g_new0(qemuMonitorJSONListPath *, n + 1); for (i = 0; i < n; i++) { - virJSONValuePtr child = virJSONValueArrayGet(data, i); + virJSONValue *child = virJSONValueArrayGet(data, i); const char *tmp; - qemuMonitorJSONListPathPtr info; + qemuMonitorJSONListPath *info; info = g_new0(qemuMonitorJSONListPath, 1); @@ -6547,7 +6547,7 @@ int qemuMonitorJSONGetObjectListPaths(qemuMonitorPtr mon, return ret; } -void qemuMonitorJSONListPathFree(qemuMonitorJSONListPathPtr paths) +void qemuMonitorJSONListPathFree(qemuMonitorJSONListPath *paths) { if (!paths) return; @@ -6557,15 +6557,15 @@ void qemuMonitorJSONListPathFree(qemuMonitorJSONListPathPtr paths) } -int qemuMonitorJSONGetObjectProperty(qemuMonitorPtr mon, +int qemuMonitorJSONGetObjectProperty(qemuMonitor *mon, const char *path, const char *property, - qemuMonitorJSONObjectPropertyPtr prop) + qemuMonitorJSONObjectProperty *prop) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; const char *tmp; if (!(cmd = qemuMonitorJSONMakeCommand("qom-get", @@ -6635,7 +6635,7 @@ int qemuMonitorJSONGetObjectProperty(qemuMonitorPtr mon, static int -qemuMonitorJSONGetStringListProperty(qemuMonitorPtr mon, +qemuMonitorJSONGetStringListProperty(qemuMonitor *mon, const char *path, const char *property, char ***strList) @@ -6670,14 +6670,14 @@ qemuMonitorJSONGetStringListProperty(qemuMonitorPtr mon, "s:property", property, \ STRING, VALUE, \ NULL) -int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon, +int qemuMonitorJSONSetObjectProperty(qemuMonitor *mon, const char *path, const char *property, - qemuMonitorJSONObjectPropertyPtr prop) + qemuMonitorJSONObjectProperty *prop) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; switch ((qemuMonitorJSONObjectPropertyType) prop->type) { /* Simple cases of boolean, int, long, uint, ulong, double, and string @@ -6731,12 +6731,12 @@ int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon, static int -qemuMonitorJSONParsePropsList(virJSONValuePtr cmd, - virJSONValuePtr reply, +qemuMonitorJSONParsePropsList(virJSONValue *cmd, + virJSONValue *reply, const char *type, char ***props) { - virJSONValuePtr data; + virJSONValue *data; char **proplist = NULL; size_t n = 0; size_t count = 0; @@ -6753,7 +6753,7 @@ qemuMonitorJSONParsePropsList(virJSONValuePtr cmd, proplist = g_new0(char *, n + 1); for (i = 0; i < n; i++) { - virJSONValuePtr child = virJSONValueArrayGet(data, i); + virJSONValue *child = virJSONValueArrayGet(data, i); const char *tmp; if (type && @@ -6780,7 +6780,7 @@ qemuMonitorJSONParsePropsList(virJSONValuePtr cmd, static int qemuMonitorJSONGetDevicePropsWorker(size_t pos G_GNUC_UNUSED, - virJSONValuePtr item, + virJSONValue *item, void *opaque) { const char *name = virJSONValueObjectGetString(item, "name"); @@ -6800,7 +6800,7 @@ qemuMonitorJSONGetDevicePropsWorker(size_t pos G_GNUC_UNUSED, GHashTable * -qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, +qemuMonitorJSONGetDeviceProps(qemuMonitor *mon, const char *device) { g_autoptr(GHashTable) props = virHashNew(virJSONValueHashFree); @@ -6832,13 +6832,13 @@ qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, int -qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, +qemuMonitorJSONGetObjectProps(qemuMonitor *mon, const char *object, char ***props) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; *props = NULL; @@ -6864,13 +6864,13 @@ qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, char * -qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon) +qemuMonitorJSONGetTargetArch(qemuMonitor *mon) { char *ret = NULL; const char *arch; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; if (!(cmd = qemuMonitorJSONMakeCommand("query-target", NULL))) return NULL; @@ -6899,13 +6899,13 @@ qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon) int -qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon, +qemuMonitorJSONGetMigrationCapabilities(qemuMonitor *mon, char ***capabilities) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr caps; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *caps; char **list = NULL; size_t i; size_t n; @@ -6933,7 +6933,7 @@ qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon, list = g_new0(char *, n + 1); for (i = 0; i < n; i++) { - virJSONValuePtr cap = virJSONValueArrayGet(caps, i); + virJSONValue *cap = virJSONValueArrayGet(caps, i); const char *name; if (!cap || virJSONValueGetType(cap) != VIR_JSON_TYPE_OBJECT) { @@ -6963,8 +6963,8 @@ qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon, int -qemuMonitorJSONSetMigrationCapabilities(qemuMonitorPtr mon, - virJSONValuePtr *caps) +qemuMonitorJSONSetMigrationCapabilities(qemuMonitor *mon, + virJSONValue **caps) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; @@ -7000,13 +7000,13 @@ qemuMonitorJSONSetMigrationCapabilities(qemuMonitorPtr mon, * <0 on failure */ int -qemuMonitorJSONGetGICCapabilities(qemuMonitorPtr mon, +qemuMonitorJSONGetGICCapabilities(qemuMonitor *mon, virGICCapability **capabilities) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr caps; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *caps; virGICCapability *list = NULL; size_t i; size_t n; @@ -7043,7 +7043,7 @@ qemuMonitorJSONGetGICCapabilities(qemuMonitorPtr mon, list = g_new0(virGICCapability, n); for (i = 0; i < n; i++) { - virJSONValuePtr cap = virJSONValueArrayGet(caps, i); + virJSONValue *cap = virJSONValueArrayGet(caps, i); int version; bool kernel; bool emulated; @@ -7106,13 +7106,13 @@ qemuMonitorJSONGetGICCapabilities(qemuMonitorPtr mon, * the platform. */ int -qemuMonitorJSONGetSEVCapabilities(qemuMonitorPtr mon, +qemuMonitorJSONGetSEVCapabilities(qemuMonitor *mon, virSEVCapability **capabilities) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr caps; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *caps; const char *pdh = NULL; const char *cert_chain = NULL; unsigned int cbitpos; @@ -7185,12 +7185,12 @@ qemuMonitorJSONGetSEVCapabilities(qemuMonitorPtr mon, return ret; } -static virJSONValuePtr +static virJSONValue * qemuMonitorJSONBuildInetSocketAddress(const char *host, const char *port) { - virJSONValuePtr addr = NULL; - virJSONValuePtr data = NULL; + virJSONValue *addr = NULL; + virJSONValue *data = NULL; if (virJSONValueObjectCreate(&data, "s:host", host, "s:port", port, NULL) < 0) @@ -7205,11 +7205,11 @@ qemuMonitorJSONBuildInetSocketAddress(const char *host, return addr; } -static virJSONValuePtr +static virJSONValue * qemuMonitorJSONBuildUnixSocketAddress(const char *path) { - virJSONValuePtr addr = NULL; - virJSONValuePtr data = NULL; + virJSONValue *addr = NULL; + virJSONValue *data = NULL; if (virJSONValueObjectCreate(&data, "s:path", path, NULL) < 0) return NULL; @@ -7224,14 +7224,14 @@ qemuMonitorJSONBuildUnixSocketAddress(const char *path) } int -qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon, +qemuMonitorJSONNBDServerStart(qemuMonitor *mon, const virStorageNetHostDef *server, const char *tls_alias) { int ret = -1; - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; - virJSONValuePtr addr = NULL; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; + virJSONValue *addr = NULL; char *port_str = NULL; switch ((virStorageNetHostTransport)server->transport) { @@ -7274,15 +7274,15 @@ qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon, } int -qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon, +qemuMonitorJSONNBDServerAdd(qemuMonitor *mon, const char *deviceID, const char *export, bool writable, const char *bitmap) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; /* Note: bitmap must be NULL if QEMU_CAPS_NBD_BITMAP is lacking */ if (!(cmd = qemuMonitorJSONMakeCommand("nbd-server-add", @@ -7307,11 +7307,11 @@ qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon, } int -qemuMonitorJSONNBDServerStop(qemuMonitorPtr mon) +qemuMonitorJSONNBDServerStop(qemuMonitor *mon) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("nbd-server-stop", NULL))) @@ -7332,8 +7332,8 @@ qemuMonitorJSONNBDServerStop(qemuMonitorPtr mon) int -qemuMonitorJSONBlockExportAdd(qemuMonitorPtr mon, - virJSONValuePtr *props) +qemuMonitorJSONBlockExportAdd(qemuMonitor *mon, + virJSONValue **props) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; @@ -7352,12 +7352,12 @@ qemuMonitorJSONBlockExportAdd(qemuMonitorPtr mon, static int -qemuMonitorJSONGetStringArray(qemuMonitorPtr mon, const char *qmpCmd, +qemuMonitorJSONGetStringArray(qemuMonitor *mon, const char *qmpCmd, char ***array) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; *array = NULL; @@ -7386,21 +7386,21 @@ qemuMonitorJSONGetStringArray(qemuMonitorPtr mon, const char *qmpCmd, return ret; } -int qemuMonitorJSONGetTPMModels(qemuMonitorPtr mon, +int qemuMonitorJSONGetTPMModels(qemuMonitor *mon, char ***tpmmodels) { return qemuMonitorJSONGetStringArray(mon, "query-tpm-models", tpmmodels); } -int qemuMonitorJSONGetTPMTypes(qemuMonitorPtr mon, +int qemuMonitorJSONGetTPMTypes(qemuMonitor *mon, char ***tpmtypes) { return qemuMonitorJSONGetStringArray(mon, "query-tpm-types", tpmtypes); } static int -qemuMonitorJSONBuildChrChardevReconnect(virJSONValuePtr object, +qemuMonitorJSONBuildChrChardevReconnect(virJSONValue *object, const virDomainChrSourceReconnectDef *def) { if (def->enabled != VIR_TRISTATE_BOOL_YES) @@ -7409,14 +7409,14 @@ qemuMonitorJSONBuildChrChardevReconnect(virJSONValuePtr object, return virJSONValueObjectAppendNumberUint(object, "reconnect", def->timeout); } -static virJSONValuePtr +static virJSONValue * qemuMonitorJSONAttachCharDevCommand(const char *chrID, const virDomainChrSourceDef *chr) { - virJSONValuePtr ret = NULL; - virJSONValuePtr backend = virJSONValueNewObject(); - virJSONValuePtr data = virJSONValueNewObject(); - virJSONValuePtr addr = NULL; + virJSONValue *ret = NULL; + virJSONValue *backend = virJSONValueNewObject(); + virJSONValue *data = virJSONValueNewObject(); + virJSONValue *addr = NULL; const char *backend_type = NULL; const char *host; const char *port; @@ -7578,13 +7578,13 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID, int -qemuMonitorJSONAttachCharDev(qemuMonitorPtr mon, +qemuMonitorJSONAttachCharDev(qemuMonitor *mon, const char *chrID, - virDomainChrSourceDefPtr chr) + virDomainChrSourceDef *chr) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; if (!(cmd = qemuMonitorJSONAttachCharDevCommand(chrID, chr))) return ret; @@ -7601,7 +7601,7 @@ qemuMonitorJSONAttachCharDev(qemuMonitorPtr mon, } if (chr->type == VIR_DOMAIN_CHR_TYPE_PTY) { - virJSONValuePtr data = virJSONValueObjectGetObject(reply, "return"); + virJSONValue *data = virJSONValueObjectGetObject(reply, "return"); const char *path; if (!(path = virJSONValueObjectGetString(data, "pty"))) { @@ -7622,12 +7622,12 @@ qemuMonitorJSONAttachCharDev(qemuMonitorPtr mon, } int -qemuMonitorJSONDetachCharDev(qemuMonitorPtr mon, +qemuMonitorJSONDetachCharDev(qemuMonitor *mon, const char *chrID) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("chardev-remove", "s:id", chrID, @@ -7649,10 +7649,10 @@ qemuMonitorJSONDetachCharDev(qemuMonitorPtr mon, int -qemuMonitorJSONGetDeviceAliases(qemuMonitorPtr mon, +qemuMonitorJSONGetDeviceAliases(qemuMonitor *mon, char ***aliases) { - qemuMonitorJSONListPathPtr *paths = NULL; + qemuMonitorJSONListPath **paths = NULL; char **alias; int ret = -1; size_t i; @@ -7684,7 +7684,7 @@ qemuMonitorJSONGetDeviceAliases(qemuMonitorPtr mon, static int -qemuMonitorJSONParseCPUx86FeatureWord(virJSONValuePtr data, +qemuMonitorJSONParseCPUx86FeatureWord(virJSONValue *data, virCPUx86CPUID *cpuid) { const char *reg; @@ -7732,10 +7732,10 @@ qemuMonitorJSONParseCPUx86FeatureWord(virJSONValuePtr data, } -static virCPUDataPtr -qemuMonitorJSONParseCPUx86Features(virJSONValuePtr data) +static virCPUData * +qemuMonitorJSONParseCPUx86Features(virJSONValue *data) { - virCPUDataPtr cpudata = NULL; + virCPUData *cpudata = NULL; virCPUx86DataItem item = { 0 }; size_t i; @@ -7759,13 +7759,13 @@ qemuMonitorJSONParseCPUx86Features(virJSONValuePtr data) int -qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon, +qemuMonitorJSONGetCPUx86Data(qemuMonitor *mon, const char *property, - virCPUDataPtr *cpudata) + virCPUData **cpudata) { - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; + virJSONValue *data; int ret = -1; if (!(cmd = qemuMonitorJSONMakeCommand("qom-get", @@ -7798,11 +7798,11 @@ qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon, * of a guest CPU, and 1 if the feature is supported. */ static int -qemuMonitorJSONCheckCPUx86(qemuMonitorPtr mon) +qemuMonitorJSONCheckCPUx86(qemuMonitor *mon) { - virJSONValuePtr cmd = NULL; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; + virJSONValue *cmd = NULL; + virJSONValue *reply = NULL; + virJSONValue *data; size_t i; size_t n; int ret = -1; @@ -7831,7 +7831,7 @@ qemuMonitorJSONCheckCPUx86(qemuMonitorPtr mon) n = virJSONValueArraySize(data); for (i = 0; i < n; i++) { - virJSONValuePtr element = virJSONValueArrayGet(data, i); + virJSONValue *element = virJSONValueArrayGet(data, i); if (STREQ_NULLABLE(virJSONValueObjectGetString(element, "name"), "feature-words")) break; @@ -7861,12 +7861,12 @@ qemuMonitorJSONCheckCPUx86(qemuMonitorPtr mon) * -1 on other errors. */ int -qemuMonitorJSONGetGuestCPUx86(qemuMonitorPtr mon, - virCPUDataPtr *data, - virCPUDataPtr *disabled) +qemuMonitorJSONGetGuestCPUx86(qemuMonitor *mon, + virCPUData **data, + virCPUData **disabled) { - virCPUDataPtr cpuEnabled = NULL; - virCPUDataPtr cpuDisabled = NULL; + virCPUData *cpuEnabled = NULL; + virCPUData *cpuDisabled = NULL; int rc; if ((rc = qemuMonitorJSONCheckCPUx86(mon)) < 0) @@ -7896,7 +7896,7 @@ qemuMonitorJSONGetGuestCPUx86(qemuMonitorPtr mon, static int -qemuMonitorJSONGetCPUProperties(qemuMonitorPtr mon, +qemuMonitorJSONGetCPUProperties(qemuMonitor *mon, char ***props) { g_autoptr(virJSONValue) cmd = NULL; @@ -7920,10 +7920,10 @@ qemuMonitorJSONGetCPUProperties(qemuMonitorPtr mon, static int -qemuMonitorJSONGetCPUData(qemuMonitorPtr mon, +qemuMonitorJSONGetCPUData(qemuMonitor *mon, qemuMonitorCPUFeatureTranslationCallback translate, void *opaque, - virCPUDataPtr data) + virCPUData *data) { qemuMonitorJSONObjectProperty prop = { .type = QEMU_MONITOR_OBJECT_PROPERTY_BOOLEAN }; g_auto(GStrv) props = NULL; @@ -7953,10 +7953,10 @@ qemuMonitorJSONGetCPUData(qemuMonitorPtr mon, static int -qemuMonitorJSONGetCPUDataDisabled(qemuMonitorPtr mon, +qemuMonitorJSONGetCPUDataDisabled(qemuMonitor *mon, qemuMonitorCPUFeatureTranslationCallback translate, void *opaque, - virCPUDataPtr data) + virCPUData *data) { g_auto(GStrv) props = NULL; char **p; @@ -7994,15 +7994,15 @@ qemuMonitorJSONGetCPUDataDisabled(qemuMonitorPtr mon, * Returns 0 on success, -1 on error. */ int -qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon, +qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, virArch arch, qemuMonitorCPUFeatureTranslationCallback translate, void *opaque, - virCPUDataPtr *enabled, - virCPUDataPtr *disabled) + virCPUData **enabled, + virCPUData **disabled) { - virCPUDataPtr cpuEnabled = NULL; - virCPUDataPtr cpuDisabled = NULL; + virCPUData *cpuEnabled = NULL; + virCPUData *cpuDisabled = NULL; int ret = -1; if (!(cpuEnabled = virCPUDataNew(arch)) || @@ -8030,11 +8030,11 @@ qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon, int -qemuMonitorJSONRTCResetReinjection(qemuMonitorPtr mon) +qemuMonitorJSONRTCResetReinjection(qemuMonitor *mon) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("rtc-reset-reinjection", NULL))) @@ -8060,15 +8060,15 @@ qemuMonitorJSONRTCResetReinjection(qemuMonitorPtr mon) * {u'id': u'iothread2', u'thread-id': 30993}]} */ int -qemuMonitorJSONGetIOThreads(qemuMonitorPtr mon, - qemuMonitorIOThreadInfoPtr **iothreads, +qemuMonitorJSONGetIOThreads(qemuMonitor *mon, + qemuMonitorIOThreadInfo ***iothreads, int *niothreads) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; - qemuMonitorIOThreadInfoPtr *infolist = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; + qemuMonitorIOThreadInfo **infolist = NULL; size_t n = 0; size_t i; @@ -8087,12 +8087,12 @@ qemuMonitorJSONGetIOThreads(qemuMonitorPtr mon, n = virJSONValueArraySize(data); /* null-terminated list */ - infolist = g_new0(qemuMonitorIOThreadInfoPtr, n + 1); + infolist = g_new0(qemuMonitorIOThreadInfo *, n + 1); for (i = 0; i < n; i++) { - virJSONValuePtr child = virJSONValueArrayGet(data, i); + virJSONValue *child = virJSONValueArrayGet(data, i); const char *tmp; - qemuMonitorIOThreadInfoPtr info; + qemuMonitorIOThreadInfo *info; if (!(tmp = virJSONValueObjectGetString(child, "id"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -8156,8 +8156,8 @@ qemuMonitorJSONGetIOThreads(qemuMonitorPtr mon, int -qemuMonitorJSONSetIOThread(qemuMonitorPtr mon, - qemuMonitorIOThreadInfoPtr iothreadInfo) +qemuMonitorJSONSetIOThread(qemuMonitor *mon, + qemuMonitorIOThreadInfo *iothreadInfo) { int ret = -1; char *path = NULL; @@ -8189,14 +8189,14 @@ qemuMonitorJSONSetIOThread(qemuMonitorPtr mon, int -qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon, +qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitor *mon, GHashTable *info) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data = NULL; - qemuMonitorMemoryDeviceInfoPtr meminfo = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data = NULL; + qemuMonitorMemoryDeviceInfo *meminfo = NULL; size_t i; if (!(cmd = qemuMonitorJSONMakeCommand("query-memory-devices", NULL))) @@ -8216,7 +8216,7 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon, data = virJSONValueObjectGetArray(reply, "return"); for (i = 0; i < virJSONValueArraySize(data); i++) { - virJSONValuePtr elem = virJSONValueArrayGet(data, i); + virJSONValue *elem = virJSONValueArrayGet(data, i); const char *type; if (!(type = virJSONValueObjectGetString(elem, "type"))) { @@ -8228,7 +8228,7 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon, /* dimm memory devices */ if (STREQ(type, "dimm")) { - virJSONValuePtr dimminfo; + virJSONValue *dimminfo; const char *devalias; if (!(dimminfo = virJSONValueObjectGetObject(elem, "data"))) { @@ -8305,12 +8305,12 @@ qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon, * -2 - Not found */ static int -qemuMonitorJSONFindObjectPathByAlias(qemuMonitorPtr mon, +qemuMonitorJSONFindObjectPathByAlias(qemuMonitor *mon, const char *name, const char *alias, char **path) { - qemuMonitorJSONListPathPtr *paths = NULL; + qemuMonitorJSONListPath **paths = NULL; char *child = NULL; int npaths; int ret = -1; @@ -8355,7 +8355,7 @@ qemuMonitorJSONFindObjectPathByAlias(qemuMonitorPtr mon, * -2 - Not found */ static int -qemuMonitorJSONFindObjectPathByName(qemuMonitorPtr mon, +qemuMonitorJSONFindObjectPathByName(qemuMonitor *mon, const char *curpath, const char *name, char **path) @@ -8363,7 +8363,7 @@ qemuMonitorJSONFindObjectPathByName(qemuMonitorPtr mon, ssize_t i, npaths = 0; int ret = -2; char *nextpath = NULL; - qemuMonitorJSONListPathPtr *paths = NULL; + qemuMonitorJSONListPath **paths = NULL; VIR_DEBUG("Searching for '%s' Object Path starting at '%s'", name, curpath); @@ -8413,7 +8413,7 @@ qemuMonitorJSONFindObjectPathByName(qemuMonitorPtr mon, * -2 - Not found */ int -qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon, +qemuMonitorJSONFindLinkPath(qemuMonitor *mon, const char *name, const char *alias, char **path) @@ -8436,7 +8436,7 @@ qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon, int -qemuMonitorJSONMigrateIncoming(qemuMonitorPtr mon, +qemuMonitorJSONMigrateIncoming(qemuMonitor *mon, const char *uri) { g_autoptr(virJSONValue) cmd = NULL; @@ -8455,11 +8455,11 @@ qemuMonitorJSONMigrateIncoming(qemuMonitorPtr mon, int -qemuMonitorJSONMigrateStartPostCopy(qemuMonitorPtr mon) +qemuMonitorJSONMigrateStartPostCopy(qemuMonitor *mon) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("migrate-start-postcopy", NULL))) return -1; @@ -8477,13 +8477,13 @@ qemuMonitorJSONMigrateStartPostCopy(qemuMonitorPtr mon) int -qemuMonitorJSONMigrateContinue(qemuMonitorPtr mon, +qemuMonitorJSONMigrateContinue(qemuMonitor *mon, qemuMonitorMigrationStatus status) { const char *statusStr = qemuMonitorMigrationStatusTypeToString(status); int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("migrate-continue", "s:state", statusStr, @@ -8503,13 +8503,13 @@ qemuMonitorJSONMigrateContinue(qemuMonitorPtr mon, int -qemuMonitorJSONGetRTCTime(qemuMonitorPtr mon, +qemuMonitorJSONGetRTCTime(qemuMonitor *mon, struct tm *tm) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; if (!(cmd = qemuMonitorJSONMakeCommand("qom-get", "s:path", "/machine", @@ -8582,10 +8582,10 @@ qemuMonitorQueryHotpluggableCpusFree(struct qemuMonitorQueryHotpluggableCpusEntr * ] */ static int -qemuMonitorJSONProcessHotpluggableCpusReply(virJSONValuePtr vcpu, +qemuMonitorJSONProcessHotpluggableCpusReply(virJSONValue *vcpu, struct qemuMonitorQueryHotpluggableCpusEntry *entry) { - virJSONValuePtr props; + virJSONValue *props; const char *tmp; if (!(tmp = virJSONValueObjectGetString(vcpu, "type"))) { @@ -8665,7 +8665,7 @@ qemuMonitorQueryHotpluggableCpusEntrySort(const void *p1, int -qemuMonitorJSONGetHotpluggableCPUs(qemuMonitorPtr mon, +qemuMonitorJSONGetHotpluggableCPUs(qemuMonitor *mon, struct qemuMonitorQueryHotpluggableCpusEntry **entries, size_t *nentries) { @@ -8673,10 +8673,10 @@ qemuMonitorJSONGetHotpluggableCPUs(qemuMonitorPtr mon, size_t ninfo = 0; int ret = -1; size_t i; - virJSONValuePtr data; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr vcpu; + virJSONValue *data; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *vcpu; if (!(cmd = qemuMonitorJSONMakeCommand("query-hotpluggable-cpus", NULL))) return -1; @@ -8713,12 +8713,12 @@ qemuMonitorJSONGetHotpluggableCPUs(qemuMonitorPtr mon, } -virJSONValuePtr -qemuMonitorJSONQueryQMPSchema(qemuMonitorPtr mon) +virJSONValue * +qemuMonitorJSONQueryQMPSchema(qemuMonitor *mon) { - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr ret = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *ret = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("query-qmp-schema", NULL))) return NULL; @@ -8740,12 +8740,12 @@ qemuMonitorJSONQueryQMPSchema(qemuMonitorPtr mon) int -qemuMonitorJSONSetBlockThreshold(qemuMonitorPtr mon, +qemuMonitorJSONSetBlockThreshold(qemuMonitor *mon, const char *nodename, unsigned long long threshold) { - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; int ret = -1; if (!(cmd = qemuMonitorJSONMakeCommand("block-set-write-threshold", @@ -8770,8 +8770,8 @@ qemuMonitorJSONSetBlockThreshold(qemuMonitorPtr mon, } -virJSONValuePtr -qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon, +virJSONValue * +qemuMonitorJSONQueryNamedBlockNodes(qemuMonitor *mon, bool flat) { g_autoptr(virJSONValue) cmd = NULL; @@ -8793,11 +8793,11 @@ qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon, int -qemuMonitorJSONSetWatchdogAction(qemuMonitorPtr mon, +qemuMonitorJSONSetWatchdogAction(qemuMonitor *mon, const char *action) { - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; int ret = -1; if (!(cmd = qemuMonitorJSONMakeCommand("watchdog-set-action", @@ -8821,9 +8821,9 @@ qemuMonitorJSONSetWatchdogAction(qemuMonitorPtr mon, int -qemuMonitorJSONBlockdevCreate(qemuMonitorPtr mon, +qemuMonitorJSONBlockdevCreate(qemuMonitor *mon, const char *jobname, - virJSONValuePtr props) + virJSONValue *props) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; @@ -8847,8 +8847,8 @@ qemuMonitorJSONBlockdevCreate(qemuMonitorPtr mon, int -qemuMonitorJSONBlockdevAdd(qemuMonitorPtr mon, - virJSONValuePtr *props) +qemuMonitorJSONBlockdevAdd(qemuMonitor *mon, + virJSONValue **props) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; @@ -8867,8 +8867,8 @@ qemuMonitorJSONBlockdevAdd(qemuMonitorPtr mon, int -qemuMonitorJSONBlockdevReopen(qemuMonitorPtr mon, - virJSONValuePtr *props) +qemuMonitorJSONBlockdevReopen(qemuMonitor *mon, + virJSONValue **props) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; @@ -8887,7 +8887,7 @@ qemuMonitorJSONBlockdevReopen(qemuMonitorPtr mon, int -qemuMonitorJSONBlockdevDel(qemuMonitorPtr mon, +qemuMonitorJSONBlockdevDel(qemuMonitor *mon, const char *nodename) { g_autoptr(virJSONValue) cmd = NULL; @@ -8909,12 +8909,12 @@ qemuMonitorJSONBlockdevDel(qemuMonitorPtr mon, int -qemuMonitorJSONBlockdevTrayOpen(qemuMonitorPtr mon, +qemuMonitorJSONBlockdevTrayOpen(qemuMonitor *mon, const char *id, bool force) { - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; int ret = -1; if (!(cmd = qemuMonitorJSONMakeCommand("blockdev-open-tray", @@ -8938,11 +8938,11 @@ qemuMonitorJSONBlockdevTrayOpen(qemuMonitorPtr mon, int -qemuMonitorJSONBlockdevTrayClose(qemuMonitorPtr mon, +qemuMonitorJSONBlockdevTrayClose(qemuMonitor *mon, const char *id) { - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; int ret = -1; if (!(cmd = qemuMonitorJSONMakeCommand("blockdev-close-tray", @@ -8965,11 +8965,11 @@ qemuMonitorJSONBlockdevTrayClose(qemuMonitorPtr mon, int -qemuMonitorJSONBlockdevMediumRemove(qemuMonitorPtr mon, +qemuMonitorJSONBlockdevMediumRemove(qemuMonitor *mon, const char *id) { - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; int ret = -1; if (!(cmd = qemuMonitorJSONMakeCommand("blockdev-remove-medium", @@ -8992,12 +8992,12 @@ qemuMonitorJSONBlockdevMediumRemove(qemuMonitorPtr mon, int -qemuMonitorJSONBlockdevMediumInsert(qemuMonitorPtr mon, +qemuMonitorJSONBlockdevMediumInsert(qemuMonitor *mon, const char *id, const char *nodename) { - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; int ret = -1; if (!(cmd = qemuMonitorJSONMakeCommand("blockdev-insert-medium", @@ -9032,13 +9032,13 @@ qemuMonitorJSONBlockdevMediumInsert(qemuMonitorPtr mon, * { "return" : { "data" : "4l8LXeNlSPUDlXPJG5966/8%YZ" } } */ char * -qemuMonitorJSONGetSEVMeasurement(qemuMonitorPtr mon) +qemuMonitorJSONGetSEVMeasurement(qemuMonitor *mon) { const char *tmp; char *measurement = NULL; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; - virJSONValuePtr data; + virJSONValue *cmd; + virJSONValue *reply = NULL; + virJSONValue *data; if (!(cmd = qemuMonitorJSONMakeCommand("query-sev-launch-measure", NULL))) return NULL; @@ -9071,18 +9071,18 @@ qemuMonitorJSONGetSEVMeasurement(qemuMonitorPtr mon) * ] */ static int -qemuMonitorJSONExtractPRManagerInfo(virJSONValuePtr reply, +qemuMonitorJSONExtractPRManagerInfo(virJSONValue *reply, GHashTable *info) { - qemuMonitorPRManagerInfoPtr entry = NULL; - virJSONValuePtr data; + qemuMonitorPRManagerInfo *entry = NULL; + virJSONValue *data; int ret = -1; size_t i; data = virJSONValueObjectGetArray(reply, "return"); for (i = 0; i < virJSONValueArraySize(data); i++) { - virJSONValuePtr prManager = virJSONValueArrayGet(data, i); + virJSONValue *prManager = virJSONValueArrayGet(data, i); const char *alias; if (!(alias = virJSONValueObjectGetString(prManager, "id"))) @@ -9115,12 +9115,12 @@ qemuMonitorJSONExtractPRManagerInfo(virJSONValuePtr reply, int -qemuMonitorJSONGetPRManagerInfo(qemuMonitorPtr mon, +qemuMonitorJSONGetPRManagerInfo(qemuMonitor *mon, GHashTable *info) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("query-pr-managers", NULL))) @@ -9142,10 +9142,10 @@ qemuMonitorJSONGetPRManagerInfo(qemuMonitorPtr mon, static int -qemuMonitorJSONExtractCurrentMachineInfo(virJSONValuePtr reply, - qemuMonitorCurrentMachineInfoPtr info) +qemuMonitorJSONExtractCurrentMachineInfo(virJSONValue *reply, + qemuMonitorCurrentMachineInfo *info) { - virJSONValuePtr data; + virJSONValue *data; data = virJSONValueObjectGetObject(reply, "return"); if (!data) @@ -9165,12 +9165,12 @@ qemuMonitorJSONExtractCurrentMachineInfo(virJSONValuePtr reply, int -qemuMonitorJSONGetCurrentMachineInfo(qemuMonitorPtr mon, - qemuMonitorCurrentMachineInfoPtr info) +qemuMonitorJSONGetCurrentMachineInfo(qemuMonitor *mon, + qemuMonitorCurrentMachineInfo *info) { int ret = -1; - virJSONValuePtr cmd; - virJSONValuePtr reply = NULL; + virJSONValue *cmd; + virJSONValue *reply = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("query-current-machine", NULL))) @@ -9192,7 +9192,7 @@ qemuMonitorJSONGetCurrentMachineInfo(qemuMonitorPtr mon, int -qemuMonitorJSONTransactionBitmapAdd(virJSONValuePtr actions, +qemuMonitorJSONTransactionBitmapAdd(virJSONValue *actions, const char *node, const char *name, bool persistent, @@ -9211,7 +9211,7 @@ qemuMonitorJSONTransactionBitmapAdd(virJSONValuePtr actions, int -qemuMonitorJSONTransactionBitmapRemove(virJSONValuePtr actions, +qemuMonitorJSONTransactionBitmapRemove(virJSONValue *actions, const char *node, const char *name) { @@ -9224,7 +9224,7 @@ qemuMonitorJSONTransactionBitmapRemove(virJSONValuePtr actions, int -qemuMonitorJSONBitmapRemove(qemuMonitorPtr mon, +qemuMonitorJSONBitmapRemove(qemuMonitor *mon, const char *node, const char *name) { @@ -9248,7 +9248,7 @@ qemuMonitorJSONBitmapRemove(qemuMonitorPtr mon, int -qemuMonitorJSONTransactionBitmapEnable(virJSONValuePtr actions, +qemuMonitorJSONTransactionBitmapEnable(virJSONValue *actions, const char *node, const char *name) { @@ -9261,7 +9261,7 @@ qemuMonitorJSONTransactionBitmapEnable(virJSONValuePtr actions, int -qemuMonitorJSONTransactionBitmapDisable(virJSONValuePtr actions, +qemuMonitorJSONTransactionBitmapDisable(virJSONValue *actions, const char *node, const char *name) { @@ -9274,10 +9274,10 @@ qemuMonitorJSONTransactionBitmapDisable(virJSONValuePtr actions, int -qemuMonitorJSONTransactionBitmapMerge(virJSONValuePtr actions, +qemuMonitorJSONTransactionBitmapMerge(virJSONValue *actions, const char *node, const char *target, - virJSONValuePtr *sources) + virJSONValue **sources) { return qemuMonitorJSONTransactionAdd(actions, "block-dirty-bitmap-merge", @@ -9289,7 +9289,7 @@ qemuMonitorJSONTransactionBitmapMerge(virJSONValuePtr actions, int -qemuMonitorJSONTransactionBitmapMergeSourceAddBitmap(virJSONValuePtr sources, +qemuMonitorJSONTransactionBitmapMergeSourceAddBitmap(virJSONValue *sources, const char *sourcenode, const char *sourcebitmap) { @@ -9309,7 +9309,7 @@ qemuMonitorJSONTransactionBitmapMergeSourceAddBitmap(virJSONValuePtr sources, int -qemuMonitorJSONTransactionSnapshotLegacy(virJSONValuePtr actions, +qemuMonitorJSONTransactionSnapshotLegacy(virJSONValue *actions, const char *device, const char *path, const char *format, @@ -9331,7 +9331,7 @@ qemuMonitorJSONTransactionSnapshotLegacy(virJSONValuePtr actions, int -qemuMonitorJSONTransactionSnapshotBlockdev(virJSONValuePtr actions, +qemuMonitorJSONTransactionSnapshotBlockdev(virJSONValue *actions, const char *node, const char *overlay) { @@ -9350,7 +9350,7 @@ VIR_ENUM_IMPL(qemuMonitorTransactionBackupSyncMode, "full"); int -qemuMonitorJSONTransactionBackup(virJSONValuePtr actions, +qemuMonitorJSONTransactionBackup(virJSONValue *actions, const char *device, const char *jobname, const char *target, @@ -9372,8 +9372,8 @@ qemuMonitorJSONTransactionBackup(virJSONValuePtr actions, } -static qemuMonitorJobInfoPtr -qemuMonitorJSONGetJobInfoOne(virJSONValuePtr data) +static qemuMonitorJobInfo * +qemuMonitorJSONGetJobInfoOne(virJSONValue *data) { const char *id = virJSONValueObjectGetString(data, "id"); const char *type = virJSONValueObjectGetString(data, "type"); @@ -9408,11 +9408,11 @@ qemuMonitorJSONGetJobInfoOne(virJSONValuePtr data) int -qemuMonitorJSONGetJobInfo(qemuMonitorPtr mon, - qemuMonitorJobInfoPtr **jobs, +qemuMonitorJSONGetJobInfo(qemuMonitor *mon, + qemuMonitorJobInfo ***jobs, size_t *njobs) { - virJSONValuePtr data; + virJSONValue *data; g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; size_t i; @@ -9429,7 +9429,7 @@ qemuMonitorJSONGetJobInfo(qemuMonitorPtr mon, data = virJSONValueObjectGetArray(reply, "return"); for (i = 0; i < virJSONValueArraySize(data); i++) { - qemuMonitorJobInfoPtr job = NULL; + qemuMonitorJobInfo *job = NULL; if (!(job = qemuMonitorJSONGetJobInfoOne(virJSONValueArrayGet(data, i)))) return -1; @@ -9443,7 +9443,7 @@ qemuMonitorJSONGetJobInfo(qemuMonitorPtr mon, int -qemuMonitorJSONGetCPUMigratable(qemuMonitorPtr mon, +qemuMonitorJSONGetCPUMigratable(qemuMonitor *mon, bool *migratable) { g_autoptr(virJSONValue) cmd = NULL; @@ -9470,7 +9470,7 @@ qemuMonitorJSONGetCPUMigratable(qemuMonitorPtr mon, int -qemuMonitorJSONStartDirtyRateCalc(qemuMonitorPtr mon, +qemuMonitorJSONStartDirtyRateCalc(qemuMonitor *mon, int seconds) { g_autoptr(virJSONValue) cmd = NULL; @@ -9498,8 +9498,8 @@ VIR_ENUM_IMPL(qemuMonitorDirtyRateStatus, "measured"); static int -qemuMonitorJSONExtractDirtyRateInfo(virJSONValuePtr data, - qemuMonitorDirtyRateInfoPtr info) +qemuMonitorJSONExtractDirtyRateInfo(virJSONValue *data, + qemuMonitorDirtyRateInfo *info) { const char *statusstr; int status; @@ -9544,12 +9544,12 @@ qemuMonitorJSONExtractDirtyRateInfo(virJSONValuePtr data, int -qemuMonitorJSONQueryDirtyRate(qemuMonitorPtr mon, - qemuMonitorDirtyRateInfoPtr info) +qemuMonitorJSONQueryDirtyRate(qemuMonitor *mon, + qemuMonitorDirtyRateInfo *info) { g_autoptr(virJSONValue) cmd = NULL; g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr data = NULL; + virJSONValue *data = NULL; if (!(cmd = qemuMonitorJSONMakeCommand("query-dirty-rate", NULL))) return -1; diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 8d4232f67b..0846325a81 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -28,231 +28,231 @@ #include "cpu/cpu.h" #include "util/virgic.h" -int qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon, +int qemuMonitorJSONIOProcessLine(qemuMonitor *mon, const char *line, - qemuMonitorMessagePtr msg) G_GNUC_NO_INLINE; + qemuMonitorMessage *msg) G_GNUC_NO_INLINE; -int qemuMonitorJSONIOProcess(qemuMonitorPtr mon, +int qemuMonitorJSONIOProcess(qemuMonitor *mon, const char *data, size_t len, - qemuMonitorMessagePtr msg); + qemuMonitorMessage *msg); -int qemuMonitorJSONHumanCommand(qemuMonitorPtr mon, +int qemuMonitorJSONHumanCommand(qemuMonitor *mon, const char *cmd, char **reply); -int qemuMonitorJSONSetCapabilities(qemuMonitorPtr mon); +int qemuMonitorJSONSetCapabilities(qemuMonitor *mon); -int qemuMonitorJSONStartCPUs(qemuMonitorPtr mon); -int qemuMonitorJSONStopCPUs(qemuMonitorPtr mon); -int qemuMonitorJSONGetStatus(qemuMonitorPtr mon, +int qemuMonitorJSONStartCPUs(qemuMonitor *mon); +int qemuMonitorJSONStopCPUs(qemuMonitor *mon); +int qemuMonitorJSONGetStatus(qemuMonitor *mon, bool *running, virDomainPausedReason *reason); -int qemuMonitorJSONSystemPowerdown(qemuMonitorPtr mon); -int qemuMonitorJSONSystemReset(qemuMonitorPtr mon); +int qemuMonitorJSONSystemPowerdown(qemuMonitor *mon); +int qemuMonitorJSONSystemReset(qemuMonitor *mon); -int qemuMonitorJSONQueryCPUs(qemuMonitorPtr mon, +int qemuMonitorJSONQueryCPUs(qemuMonitor *mon, struct qemuMonitorQueryCpusEntry **entries, size_t *nentries, bool force, bool fast); -int qemuMonitorJSONUpdateVideoMemorySize(qemuMonitorPtr mon, - virDomainVideoDefPtr video, +int qemuMonitorJSONUpdateVideoMemorySize(qemuMonitor *mon, + virDomainVideoDef *video, char *path); -int qemuMonitorJSONUpdateVideoVram64Size(qemuMonitorPtr mon, - virDomainVideoDefPtr video, +int qemuMonitorJSONUpdateVideoVram64Size(qemuMonitor *mon, + virDomainVideoDef *video, char *path); -int qemuMonitorJSONGetBalloonInfo(qemuMonitorPtr mon, +int qemuMonitorJSONGetBalloonInfo(qemuMonitor *mon, unsigned long long *currmem); -int qemuMonitorJSONGetMemoryStats(qemuMonitorPtr mon, +int qemuMonitorJSONGetMemoryStats(qemuMonitor *mon, char *balloonpath, virDomainMemoryStatPtr stats, unsigned int nr_stats); -int qemuMonitorJSONSetMemoryStatsPeriod(qemuMonitorPtr mon, +int qemuMonitorJSONSetMemoryStatsPeriod(qemuMonitor *mon, char *balloonpath, int period); -int qemuMonitorJSONGetBlockInfo(qemuMonitorPtr mon, +int qemuMonitorJSONGetBlockInfo(qemuMonitor *mon, GHashTable *table); -virJSONValuePtr qemuMonitorJSONQueryBlockstats(qemuMonitorPtr mon); -int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitorPtr mon, +virJSONValue *qemuMonitorJSONQueryBlockstats(qemuMonitor *mon); +int qemuMonitorJSONGetAllBlockStatsInfo(qemuMonitor *mon, GHashTable *hash, bool backingChain); -int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitorPtr mon, +int qemuMonitorJSONBlockStatsUpdateCapacity(qemuMonitor *mon, GHashTable *stats, bool backingChain); -int qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitorPtr mon, +int qemuMonitorJSONBlockStatsUpdateCapacityBlockdev(qemuMonitor *mon, GHashTable *stats); GHashTable * -qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValuePtr nodes); +qemuMonitorJSONBlockGetNamedNodeDataJSON(virJSONValue *nodes); GHashTable * -qemuMonitorJSONBlockGetNamedNodeData(qemuMonitorPtr mon, +qemuMonitorJSONBlockGetNamedNodeData(qemuMonitor *mon, bool supports_flat); -int qemuMonitorJSONBlockResize(qemuMonitorPtr mon, +int qemuMonitorJSONBlockResize(qemuMonitor *mon, const char *device, const char *nodename, unsigned long long size); -int qemuMonitorJSONSetPassword(qemuMonitorPtr mon, +int qemuMonitorJSONSetPassword(qemuMonitor *mon, const char *protocol, const char *password, const char *action_if_connected); -int qemuMonitorJSONExpirePassword(qemuMonitorPtr mon, +int qemuMonitorJSONExpirePassword(qemuMonitor *mon, const char *protocol, const char *expire_time); -int qemuMonitorJSONSetBalloon(qemuMonitorPtr mon, +int qemuMonitorJSONSetBalloon(qemuMonitor *mon, unsigned long long newmem); -int qemuMonitorJSONSetCPU(qemuMonitorPtr mon, int cpu, bool online); +int qemuMonitorJSONSetCPU(qemuMonitor *mon, int cpu, bool online); -int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon, +int qemuMonitorJSONEjectMedia(qemuMonitor *mon, const char *dev_name, bool force); -int qemuMonitorJSONChangeMedia(qemuMonitorPtr mon, +int qemuMonitorJSONChangeMedia(qemuMonitor *mon, const char *dev_name, const char *newmedia, const char *format); -int qemuMonitorJSONSaveVirtualMemory(qemuMonitorPtr mon, +int qemuMonitorJSONSaveVirtualMemory(qemuMonitor *mon, unsigned long long offset, unsigned long long length, const char *path); -int qemuMonitorJSONSavePhysicalMemory(qemuMonitorPtr mon, +int qemuMonitorJSONSavePhysicalMemory(qemuMonitor *mon, unsigned long long offset, unsigned long long length, const char *path); -int qemuMonitorJSONSetMigrationSpeed(qemuMonitorPtr mon, +int qemuMonitorJSONSetMigrationSpeed(qemuMonitor *mon, unsigned long bandwidth); -int qemuMonitorJSONSetMigrationDowntime(qemuMonitorPtr mon, +int qemuMonitorJSONSetMigrationDowntime(qemuMonitor *mon, unsigned long long downtime); -int qemuMonitorJSONGetMigrationCacheSize(qemuMonitorPtr mon, +int qemuMonitorJSONGetMigrationCacheSize(qemuMonitor *mon, unsigned long long *cacheSize); -int qemuMonitorJSONSetMigrationCacheSize(qemuMonitorPtr mon, +int qemuMonitorJSONSetMigrationCacheSize(qemuMonitor *mon, unsigned long long cacheSize); -int qemuMonitorJSONGetMigrationParams(qemuMonitorPtr mon, - virJSONValuePtr *params); -int qemuMonitorJSONSetMigrationParams(qemuMonitorPtr mon, - virJSONValuePtr *params); +int qemuMonitorJSONGetMigrationParams(qemuMonitor *mon, + virJSONValue **params); +int qemuMonitorJSONSetMigrationParams(qemuMonitor *mon, + virJSONValue **params); -int qemuMonitorJSONGetMigrationStats(qemuMonitorPtr mon, - qemuMonitorMigrationStatsPtr stats, +int qemuMonitorJSONGetMigrationStats(qemuMonitor *mon, + qemuMonitorMigrationStats *stats, char **error); -int qemuMonitorJSONGetMigrationCapabilities(qemuMonitorPtr mon, +int qemuMonitorJSONGetMigrationCapabilities(qemuMonitor *mon, char ***capabilities); -int qemuMonitorJSONSetMigrationCapabilities(qemuMonitorPtr mon, - virJSONValuePtr *caps); +int qemuMonitorJSONSetMigrationCapabilities(qemuMonitor *mon, + virJSONValue **caps); -int qemuMonitorJSONGetGICCapabilities(qemuMonitorPtr mon, +int qemuMonitorJSONGetGICCapabilities(qemuMonitor *mon, virGICCapability **capabilities); -int qemuMonitorJSONGetSEVCapabilities(qemuMonitorPtr mon, +int qemuMonitorJSONGetSEVCapabilities(qemuMonitor *mon, virSEVCapability **capabilities); -int qemuMonitorJSONMigrate(qemuMonitorPtr mon, +int qemuMonitorJSONMigrate(qemuMonitor *mon, unsigned int flags, const char *uri); -int qemuMonitorJSONGetSpiceMigrationStatus(qemuMonitorPtr mon, +int qemuMonitorJSONGetSpiceMigrationStatus(qemuMonitor *mon, bool *spice_migrated); -int qemuMonitorJSONMigrateCancel(qemuMonitorPtr mon); +int qemuMonitorJSONMigrateCancel(qemuMonitor *mon); -int qemuMonitorJSONQueryDump(qemuMonitorPtr mon, - qemuMonitorDumpStatsPtr stats); +int qemuMonitorJSONQueryDump(qemuMonitor *mon, + qemuMonitorDumpStats *stats); -int qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitorPtr mon, +int qemuMonitorJSONGetDumpGuestMemoryCapability(qemuMonitor *mon, const char *capability); -int qemuMonitorJSONDump(qemuMonitorPtr mon, +int qemuMonitorJSONDump(qemuMonitor *mon, const char *protocol, const char *dumpformat, bool detach); -int qemuMonitorJSONGraphicsRelocate(qemuMonitorPtr mon, +int qemuMonitorJSONGraphicsRelocate(qemuMonitor *mon, int type, const char *hostname, int port, int tlsPort, const char *tlsSubject); -int qemuMonitorJSONAddPCIHostDevice(qemuMonitorPtr mon, +int qemuMonitorJSONAddPCIHostDevice(qemuMonitor *mon, virPCIDeviceAddress *hostAddr, virPCIDeviceAddress *guestAddr); -int qemuMonitorJSONAddPCIDisk(qemuMonitorPtr mon, +int qemuMonitorJSONAddPCIDisk(qemuMonitor *mon, const char *path, const char *bus, virPCIDeviceAddress *guestAddr); -int qemuMonitorJSONAddPCINetwork(qemuMonitorPtr mon, +int qemuMonitorJSONAddPCINetwork(qemuMonitor *mon, const char *nicstr, virPCIDeviceAddress *guestAddr); -int qemuMonitorJSONRemovePCIDevice(qemuMonitorPtr mon, +int qemuMonitorJSONRemovePCIDevice(qemuMonitor *mon, virPCIDeviceAddress *guestAddr); -int qemuMonitorJSONAddFileHandleToSet(qemuMonitorPtr mon, +int qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon, int fd, int fdset, const char *opaque, - qemuMonitorAddFdInfoPtr info); + qemuMonitorAddFdInfo *info); -int qemuMonitorJSONRemoveFdset(qemuMonitorPtr mon, +int qemuMonitorJSONRemoveFdset(qemuMonitor *mon, int fdset); -int qemuMonitorJSONQueryFdsets(qemuMonitorPtr mon, - qemuMonitorFdsetsPtr *fdsets); +int qemuMonitorJSONQueryFdsets(qemuMonitor *mon, + qemuMonitorFdsets **fdsets); -int qemuMonitorJSONSendFileHandle(qemuMonitorPtr mon, +int qemuMonitorJSONSendFileHandle(qemuMonitor *mon, const char *fdname, int fd); -int qemuMonitorJSONCloseFileHandle(qemuMonitorPtr mon, +int qemuMonitorJSONCloseFileHandle(qemuMonitor *mon, const char *fdname); -int qemuMonitorJSONAddNetdev(qemuMonitorPtr mon, - virJSONValuePtr *props); +int qemuMonitorJSONAddNetdev(qemuMonitor *mon, + virJSONValue **props); -int qemuMonitorJSONRemoveNetdev(qemuMonitorPtr mon, +int qemuMonitorJSONRemoveNetdev(qemuMonitor *mon, const char *alias); -int qemuMonitorJSONQueryRxFilter(qemuMonitorPtr mon, const char *alias, - virNetDevRxFilterPtr *filter); +int qemuMonitorJSONQueryRxFilter(qemuMonitor *mon, const char *alias, + virNetDevRxFilter **filter); -int qemuMonitorJSONGetChardevInfo(qemuMonitorPtr mon, +int qemuMonitorJSONGetChardevInfo(qemuMonitor *mon, GHashTable *info); -int qemuMonitorJSONAttachPCIDiskController(qemuMonitorPtr mon, +int qemuMonitorJSONAttachPCIDiskController(qemuMonitor *mon, const char *bus, virPCIDeviceAddress *guestAddr); -int qemuMonitorJSONAddDeviceArgs(qemuMonitorPtr mon, - virJSONValuePtr args); -int qemuMonitorJSONAddDevice(qemuMonitorPtr mon, +int qemuMonitorJSONAddDeviceArgs(qemuMonitor *mon, + virJSONValue *args); +int qemuMonitorJSONAddDevice(qemuMonitor *mon, const char *devicestr); -int qemuMonitorJSONDelDevice(qemuMonitorPtr mon, +int qemuMonitorJSONDelDevice(qemuMonitor *mon, const char *devalias); -int qemuMonitorJSONAddObject(qemuMonitorPtr mon, - virJSONValuePtr *props); +int qemuMonitorJSONAddObject(qemuMonitor *mon, + virJSONValue **props); -int qemuMonitorJSONDelObject(qemuMonitorPtr mon, +int qemuMonitorJSONDelObject(qemuMonitor *mon, const char *objalias, bool report_error); -int qemuMonitorJSONTransaction(qemuMonitorPtr mon, virJSONValuePtr *actions) +int qemuMonitorJSONTransaction(qemuMonitor *mon, virJSONValue **actions) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONDriveMirror(qemuMonitorPtr mon, +int qemuMonitorJSONDriveMirror(qemuMonitor *mon, const char *device, const char *file, const char *format, @@ -262,7 +262,7 @@ int qemuMonitorJSONDriveMirror(qemuMonitorPtr mon, bool shallow, bool reuse) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuMonitorJSONBlockdevMirror(qemuMonitorPtr mon, +int qemuMonitorJSONBlockdevMirror(qemuMonitor *mon, const char *jobname, bool persistjob, const char *device, @@ -272,14 +272,14 @@ int qemuMonitorJSONBlockdevMirror(qemuMonitorPtr mon, unsigned long long buf_size, bool shallow) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5); -int qemuMonitorJSONDrivePivot(qemuMonitorPtr mon, +int qemuMonitorJSONDrivePivot(qemuMonitor *mon, const char *jobname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -bool qemuMonitorJSONSupportsActiveCommit(qemuMonitorPtr mon) +bool qemuMonitorJSONSupportsActiveCommit(qemuMonitor *mon) ATTRIBUTE_NONNULL(1); -int qemuMonitorJSONBlockCommit(qemuMonitorPtr mon, +int qemuMonitorJSONBlockCommit(qemuMonitor *mon, const char *device, const char *jobname, bool persistjob, @@ -291,30 +291,30 @@ int qemuMonitorJSONBlockCommit(qemuMonitorPtr mon, unsigned long long bandwidth) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -char *qemuMonitorJSONDiskNameLookup(qemuMonitorPtr mon, +char *qemuMonitorJSONDiskNameLookup(qemuMonitor *mon, const char *device, - virStorageSourcePtr top, - virStorageSourcePtr target) + virStorageSource *top, + virStorageSource *target) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -int qemuMonitorJSONArbitraryCommand(qemuMonitorPtr mon, +int qemuMonitorJSONArbitraryCommand(qemuMonitor *mon, const char *cmd_str, char **reply_str); -int qemuMonitorJSONInjectNMI(qemuMonitorPtr mon); +int qemuMonitorJSONInjectNMI(qemuMonitor *mon); -int qemuMonitorJSONSendKey(qemuMonitorPtr mon, +int qemuMonitorJSONSendKey(qemuMonitor *mon, unsigned int holdtime, unsigned int *keycodes, unsigned int nkeycodes); -int qemuMonitorJSONScreendump(qemuMonitorPtr mon, +int qemuMonitorJSONScreendump(qemuMonitor *mon, const char *device, unsigned int head, const char *file); -int qemuMonitorJSONBlockStream(qemuMonitorPtr mon, +int qemuMonitorJSONBlockStream(qemuMonitor *mon, const char *device, const char *jobname, bool persistjob, @@ -324,131 +324,129 @@ int qemuMonitorJSONBlockStream(qemuMonitorPtr mon, unsigned long long speed) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONBlockJobCancel(qemuMonitorPtr mon, +int qemuMonitorJSONBlockJobCancel(qemuMonitor *mon, const char *jobname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int -qemuMonitorJSONGetJobInfo(qemuMonitorPtr mon, - qemuMonitorJobInfoPtr **jobs, +qemuMonitorJSONGetJobInfo(qemuMonitor *mon, + qemuMonitorJobInfo ***jobs, size_t *njobs); -int qemuMonitorJSONBlockJobSetSpeed(qemuMonitorPtr mon, +int qemuMonitorJSONBlockJobSetSpeed(qemuMonitor *mon, const char *jobname, unsigned long long speed) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -GHashTable *qemuMonitorJSONGetAllBlockJobInfo(qemuMonitorPtr mon, +GHashTable *qemuMonitorJSONGetAllBlockJobInfo(qemuMonitor *mon, bool rawjobname) ATTRIBUTE_NONNULL(1); -int qemuMonitorJSONJobDismiss(qemuMonitorPtr mon, +int qemuMonitorJSONJobDismiss(qemuMonitor *mon, const char *jobname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONJobCancel(qemuMonitorPtr mon, +int qemuMonitorJSONJobCancel(qemuMonitor *mon, const char *jobname, bool quiet) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONJobComplete(qemuMonitorPtr mon, +int qemuMonitorJSONJobComplete(qemuMonitor *mon, const char *jobname) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONSetLink(qemuMonitorPtr mon, +int qemuMonitorJSONSetLink(qemuMonitor *mon, const char *name, virDomainNetInterfaceLinkState state); -int qemuMonitorJSONOpenGraphics(qemuMonitorPtr mon, +int qemuMonitorJSONOpenGraphics(qemuMonitor *mon, const char *protocol, const char *fdname, bool skipauth); -int qemuMonitorJSONSetBlockIoThrottle(qemuMonitorPtr mon, +int qemuMonitorJSONSetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, const char *qomid, - virDomainBlockIoTuneInfoPtr info, + virDomainBlockIoTuneInfo *info, bool supportMaxOptions, bool supportGroupNameOption, bool supportMaxLengthOptions); -int qemuMonitorJSONGetBlockIoThrottle(qemuMonitorPtr mon, +int qemuMonitorJSONGetBlockIoThrottle(qemuMonitor *mon, const char *drivealias, const char *qdevid, - virDomainBlockIoTuneInfoPtr reply); + virDomainBlockIoTuneInfo *reply); -int qemuMonitorJSONSystemWakeup(qemuMonitorPtr mon); +int qemuMonitorJSONSystemWakeup(qemuMonitor *mon); -char *qemuMonitorJSONGetSEVMeasurement(qemuMonitorPtr mon); +char *qemuMonitorJSONGetSEVMeasurement(qemuMonitor *mon); -int qemuMonitorJSONGetVersion(qemuMonitorPtr mon, +int qemuMonitorJSONGetVersion(qemuMonitor *mon, int *major, int *minor, int *micro, char **package) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -int qemuMonitorJSONGetMachines(qemuMonitorPtr mon, - qemuMonitorMachineInfoPtr **machines) +int qemuMonitorJSONGetMachines(qemuMonitor *mon, + qemuMonitorMachineInfo ***machines) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONGetCPUDefinitions(qemuMonitorPtr mon, - qemuMonitorCPUDefsPtr *cpuDefs) +int qemuMonitorJSONGetCPUDefinitions(qemuMonitor *mon, + qemuMonitorCPUDefs **cpuDefs) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONGetCPUModelExpansion(qemuMonitorPtr mon, +int qemuMonitorJSONGetCPUModelExpansion(qemuMonitor *mon, qemuMonitorCPUModelExpansionType type, - virCPUDefPtr cpu, + virCPUDef *cpu, bool migratable, bool fail_no_props, - qemuMonitorCPUModelInfoPtr *model_info) + qemuMonitorCPUModelInfo **model_info) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(6); -int qemuMonitorJSONGetCPUModelBaseline(qemuMonitorPtr mon, - virCPUDefPtr cpu_a, - virCPUDefPtr cpu_b, - qemuMonitorCPUModelInfoPtr *baseline) +int qemuMonitorJSONGetCPUModelBaseline(qemuMonitor *mon, + virCPUDef *cpu_a, + virCPUDef *cpu_b, + qemuMonitorCPUModelInfo **baseline) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -int qemuMonitorJSONGetCPUModelComparison(qemuMonitorPtr mon, - virCPUDefPtr cpu_a, - virCPUDefPtr cpu_b, +int qemuMonitorJSONGetCPUModelComparison(qemuMonitor *mon, + virCPUDef *cpu_a, + virCPUDef *cpu_b, char **result) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuMonitorJSONGetCommands(qemuMonitorPtr mon, +int qemuMonitorJSONGetCommands(qemuMonitor *mon, char ***commands) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONGetEvents(qemuMonitorPtr mon, +int qemuMonitorJSONGetEvents(qemuMonitor *mon, char ***events) ATTRIBUTE_NONNULL(2); -GHashTable *qemuMonitorJSONGetCommandLineOptions(qemuMonitorPtr mon); +GHashTable *qemuMonitorJSONGetCommandLineOptions(qemuMonitor *mon); -int qemuMonitorJSONGetKVMState(qemuMonitorPtr mon, +int qemuMonitorJSONGetKVMState(qemuMonitor *mon, bool *enabled, bool *present) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuMonitorJSONGetObjectTypes(qemuMonitorPtr mon, +int qemuMonitorJSONGetObjectTypes(qemuMonitor *mon, char ***types) ATTRIBUTE_NONNULL(2); /* ListPath structures and API's are public only for qemumonitorjsontest */ typedef struct _qemuMonitorJSONListPath qemuMonitorJSONListPath; -typedef qemuMonitorJSONListPath *qemuMonitorJSONListPathPtr; - struct _qemuMonitorJSONListPath { char *name; char *type; }; -int qemuMonitorJSONGetObjectListPaths(qemuMonitorPtr mon, +int qemuMonitorJSONGetObjectListPaths(qemuMonitor *mon, const char *path, - qemuMonitorJSONListPathPtr **paths) + qemuMonitorJSONListPath ***paths) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -void qemuMonitorJSONListPathFree(qemuMonitorJSONListPathPtr paths); +void qemuMonitorJSONListPathFree(qemuMonitorJSONListPath *paths); /* ObjectProperty structures and Get/Set API's are public only * for qemumonitorjsontest @@ -467,7 +465,6 @@ typedef enum { } qemuMonitorJSONObjectPropertyType; typedef struct _qemuMonitorJSONObjectProperty qemuMonitorJSONObjectProperty; -typedef qemuMonitorJSONObjectProperty *qemuMonitorJSONObjectPropertyPtr; struct _qemuMonitorJSONObjectProperty { int type; /* qemuMonitorJSONObjectPropertyType */ union { @@ -481,241 +478,241 @@ struct _qemuMonitorJSONObjectProperty { } val; }; -int qemuMonitorJSONGetObjectProperty(qemuMonitorPtr mon, +int qemuMonitorJSONGetObjectProperty(qemuMonitor *mon, const char *path, const char *property, - qemuMonitorJSONObjectPropertyPtr prop) + qemuMonitorJSONObjectProperty *prop) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -int qemuMonitorJSONSetObjectProperty(qemuMonitorPtr mon, +int qemuMonitorJSONSetObjectProperty(qemuMonitor *mon, const char *path, const char *property, - qemuMonitorJSONObjectPropertyPtr prop) + qemuMonitorJSONObjectProperty *prop) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); -GHashTable *qemuMonitorJSONGetDeviceProps(qemuMonitorPtr mon, +GHashTable *qemuMonitorJSONGetDeviceProps(qemuMonitor *mon, const char *device) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONGetObjectProps(qemuMonitorPtr mon, +int qemuMonitorJSONGetObjectProps(qemuMonitor *mon, const char *object, char ***props) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -char *qemuMonitorJSONGetTargetArch(qemuMonitorPtr mon); +char *qemuMonitorJSONGetTargetArch(qemuMonitor *mon); -int qemuMonitorJSONNBDServerStart(qemuMonitorPtr mon, +int qemuMonitorJSONNBDServerStart(qemuMonitor *mon, const virStorageNetHostDef *server, const char *tls_alias); -int qemuMonitorJSONNBDServerAdd(qemuMonitorPtr mon, +int qemuMonitorJSONNBDServerAdd(qemuMonitor *mon, const char *deviceID, const char *export, bool writable, const char *bitmap); -int qemuMonitorJSONNBDServerStop(qemuMonitorPtr mon); +int qemuMonitorJSONNBDServerStop(qemuMonitor *mon); -int qemuMonitorJSONBlockExportAdd(qemuMonitorPtr mon, - virJSONValuePtr *props); +int qemuMonitorJSONBlockExportAdd(qemuMonitor *mon, + virJSONValue **props); -int qemuMonitorJSONGetTPMModels(qemuMonitorPtr mon, +int qemuMonitorJSONGetTPMModels(qemuMonitor *mon, char ***tpmmodels) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONGetTPMTypes(qemuMonitorPtr mon, +int qemuMonitorJSONGetTPMTypes(qemuMonitor *mon, char ***tpmtypes) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONAttachCharDev(qemuMonitorPtr mon, +int qemuMonitorJSONAttachCharDev(qemuMonitor *mon, const char *chrID, - virDomainChrSourceDefPtr chr); -int qemuMonitorJSONDetachCharDev(qemuMonitorPtr mon, + virDomainChrSourceDef *chr); +int qemuMonitorJSONDetachCharDev(qemuMonitor *mon, const char *chrID); -int qemuMonitorJSONGetDeviceAliases(qemuMonitorPtr mon, +int qemuMonitorJSONGetDeviceAliases(qemuMonitor *mon, char ***aliases); -int qemuMonitorJSONGetCPUx86Data(qemuMonitorPtr mon, +int qemuMonitorJSONGetCPUx86Data(qemuMonitor *mon, const char *property, - virCPUDataPtr *cpudata); + virCPUData **cpudata); -int qemuMonitorJSONGetGuestCPUx86(qemuMonitorPtr mon, - virCPUDataPtr *data, - virCPUDataPtr *disabled); +int qemuMonitorJSONGetGuestCPUx86(qemuMonitor *mon, + virCPUData **data, + virCPUData **disabled); -int qemuMonitorJSONGetGuestCPU(qemuMonitorPtr mon, +int qemuMonitorJSONGetGuestCPU(qemuMonitor *mon, virArch arch, qemuMonitorCPUFeatureTranslationCallback translate, void *opaque, - virCPUDataPtr *enabled, - virCPUDataPtr *disabled); + virCPUData **enabled, + virCPUData **disabled); -int qemuMonitorJSONRTCResetReinjection(qemuMonitorPtr mon); +int qemuMonitorJSONRTCResetReinjection(qemuMonitor *mon); -int qemuMonitorJSONGetIOThreads(qemuMonitorPtr mon, - qemuMonitorIOThreadInfoPtr **iothreads, +int qemuMonitorJSONGetIOThreads(qemuMonitor *mon, + qemuMonitorIOThreadInfo ***iothreads, int *niothreads) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONSetIOThread(qemuMonitorPtr mon, - qemuMonitorIOThreadInfoPtr iothreadInfo) +int qemuMonitorJSONSetIOThread(qemuMonitor *mon, + qemuMonitorIOThreadInfo *iothreadInfo) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitorPtr mon, +int qemuMonitorJSONGetMemoryDeviceInfo(qemuMonitor *mon, GHashTable *info) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONFindLinkPath(qemuMonitorPtr mon, +int qemuMonitorJSONFindLinkPath(qemuMonitor *mon, const char *name, const char *alias, char **path) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4); -int qemuMonitorJSONMigrateIncoming(qemuMonitorPtr mon, +int qemuMonitorJSONMigrateIncoming(qemuMonitor *mon, const char *uri) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONMigrateStartPostCopy(qemuMonitorPtr mon) +int qemuMonitorJSONMigrateStartPostCopy(qemuMonitor *mon) ATTRIBUTE_NONNULL(1); -int qemuMonitorJSONMigrateContinue(qemuMonitorPtr mon, +int qemuMonitorJSONMigrateContinue(qemuMonitor *mon, qemuMonitorMigrationStatus status) ATTRIBUTE_NONNULL(1); -int qemuMonitorJSONGetRTCTime(qemuMonitorPtr mon, +int qemuMonitorJSONGetRTCTime(qemuMonitor *mon, struct tm *tm) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONGetHotpluggableCPUs(qemuMonitorPtr mon, +int qemuMonitorJSONGetHotpluggableCPUs(qemuMonitor *mon, struct qemuMonitorQueryHotpluggableCpusEntry **entries, size_t *nentries) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -virJSONValuePtr qemuMonitorJSONQueryQMPSchema(qemuMonitorPtr mon) +virJSONValue *qemuMonitorJSONQueryQMPSchema(qemuMonitor *mon) ATTRIBUTE_NONNULL(1); -int qemuMonitorJSONSetBlockThreshold(qemuMonitorPtr mon, +int qemuMonitorJSONSetBlockThreshold(qemuMonitor *mon, const char *nodename, unsigned long long threshold) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -virJSONValuePtr qemuMonitorJSONQueryNamedBlockNodes(qemuMonitorPtr mon, +virJSONValue *qemuMonitorJSONQueryNamedBlockNodes(qemuMonitor *mon, bool flat) ATTRIBUTE_NONNULL(1); -int qemuMonitorJSONSetWatchdogAction(qemuMonitorPtr mon, +int qemuMonitorJSONSetWatchdogAction(qemuMonitor *mon, const char *action) ATTRIBUTE_NONNULL(1); -int qemuMonitorJSONBlockdevCreate(qemuMonitorPtr mon, +int qemuMonitorJSONBlockdevCreate(qemuMonitor *mon, const char *jobname, - virJSONValuePtr props) + virJSONValue *props) ATTRIBUTE_NONNULL(1); -int qemuMonitorJSONBlockdevAdd(qemuMonitorPtr mon, - virJSONValuePtr *props) +int qemuMonitorJSONBlockdevAdd(qemuMonitor *mon, + virJSONValue **props) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONBlockdevReopen(qemuMonitorPtr mon, - virJSONValuePtr *props) +int qemuMonitorJSONBlockdevReopen(qemuMonitor *mon, + virJSONValue **props) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONBlockdevDel(qemuMonitorPtr mon, +int qemuMonitorJSONBlockdevDel(qemuMonitor *mon, const char *nodename) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONBlockdevTrayOpen(qemuMonitorPtr mon, +int qemuMonitorJSONBlockdevTrayOpen(qemuMonitor *mon, const char *id, bool force) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONBlockdevTrayClose(qemuMonitorPtr mon, +int qemuMonitorJSONBlockdevTrayClose(qemuMonitor *mon, const char *id) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONBlockdevMediumRemove(qemuMonitorPtr mon, +int qemuMonitorJSONBlockdevMediumRemove(qemuMonitor *mon, const char *id) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuMonitorJSONBlockdevMediumInsert(qemuMonitorPtr mon, +int qemuMonitorJSONBlockdevMediumInsert(qemuMonitor *mon, const char *id, const char *nodename) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -int qemuMonitorJSONGetPRManagerInfo(qemuMonitorPtr mon, +int qemuMonitorJSONGetPRManagerInfo(qemuMonitor *mon, GHashTable *info) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int -qemuMonitorJSONGetCurrentMachineInfo(qemuMonitorPtr mon, - qemuMonitorCurrentMachineInfoPtr info) +qemuMonitorJSONGetCurrentMachineInfo(qemuMonitor *mon, + qemuMonitorCurrentMachineInfo *info) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int -qemuMonitorJSONTransactionBitmapAdd(virJSONValuePtr actions, +qemuMonitorJSONTransactionBitmapAdd(virJSONValue *actions, const char *node, const char *name, bool persistent, bool disabled, unsigned long long granularity); int -qemuMonitorJSONTransactionBitmapRemove(virJSONValuePtr actions, +qemuMonitorJSONTransactionBitmapRemove(virJSONValue *actions, const char *node, const char *name); int -qemuMonitorJSONBitmapRemove(qemuMonitorPtr mon, +qemuMonitorJSONBitmapRemove(qemuMonitor *mon, const char *node, const char *name); int -qemuMonitorJSONTransactionBitmapEnable(virJSONValuePtr actions, +qemuMonitorJSONTransactionBitmapEnable(virJSONValue *actions, const char *node, const char *name); int -qemuMonitorJSONTransactionBitmapDisable(virJSONValuePtr actions, +qemuMonitorJSONTransactionBitmapDisable(virJSONValue *actions, const char *node, const char *name); int -qemuMonitorJSONTransactionBitmapMerge(virJSONValuePtr actions, +qemuMonitorJSONTransactionBitmapMerge(virJSONValue *actions, const char *node, const char *target, - virJSONValuePtr *sources); + virJSONValue **sources); int -qemuMonitorJSONTransactionBitmapMergeSourceAddBitmap(virJSONValuePtr sources, +qemuMonitorJSONTransactionBitmapMergeSourceAddBitmap(virJSONValue *sources, const char *sourcenode, const char *sourcebitmap); int -qemuMonitorJSONTransactionSnapshotLegacy(virJSONValuePtr actions, +qemuMonitorJSONTransactionSnapshotLegacy(virJSONValue *actions, const char *device, const char *path, const char *format, bool existing); int -qemuMonitorJSONTransactionSnapshotBlockdev(virJSONValuePtr actions, +qemuMonitorJSONTransactionSnapshotBlockdev(virJSONValue *actions, const char *node, const char *overlay); int -qemuMonitorJSONTransactionBackup(virJSONValuePtr actions, +qemuMonitorJSONTransactionBackup(virJSONValue *actions, const char *device, const char *jobname, const char *target, const char *bitmap, qemuMonitorTransactionBackupSyncMode syncmode); -int qemuMonitorJSONSetDBusVMStateIdList(qemuMonitorPtr mon, +int qemuMonitorJSONSetDBusVMStateIdList(qemuMonitor *mon, const char *vmstatepath, const char *idstr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int -qemuMonitorJSONGetCPUMigratable(qemuMonitorPtr mon, +qemuMonitorJSONGetCPUMigratable(qemuMonitor *mon, bool *migratable); int -qemuMonitorJSONStartDirtyRateCalc(qemuMonitorPtr mon, +qemuMonitorJSONStartDirtyRateCalc(qemuMonitor *mon, int seconds); int -qemuMonitorJSONQueryDirtyRate(qemuMonitorPtr mon, - qemuMonitorDirtyRateInfoPtr info); +qemuMonitorJSONQueryDirtyRate(qemuMonitor *mon, + qemuMonitorDirtyRateInfo *info); diff --git a/src/qemu/qemu_monitor_priv.h b/src/qemu/qemu_monitor_priv.h index 8ab97a4ce7..31bb3526b9 100644 --- a/src/qemu/qemu_monitor_priv.h +++ b/src/qemu/qemu_monitor_priv.h @@ -25,4 +25,4 @@ #include "qemu_monitor.h" void -qemuMonitorResetCommandID(qemuMonitorPtr mon); +qemuMonitorResetCommandID(qemuMonitor *mon); diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c index 5a890af001..6a1a913055 100644 --- a/src/qemu/qemu_monitor_text.c +++ b/src/qemu/qemu_monitor_text.c @@ -33,7 +33,7 @@ VIR_LOG_INIT("qemu.qemu_monitor_text"); -int qemuMonitorTextAddDrive(qemuMonitorPtr mon, +int qemuMonitorTextAddDrive(qemuMonitor *mon, const char *drivestr) { g_autofree char *cmd = NULL; @@ -85,7 +85,7 @@ int qemuMonitorTextAddDrive(qemuMonitorPtr mon, } -int qemuMonitorTextDriveDel(qemuMonitorPtr mon, +int qemuMonitorTextDriveDel(qemuMonitor *mon, const char *drivestr) { g_autofree char *cmd = NULL; @@ -116,7 +116,7 @@ int qemuMonitorTextDriveDel(qemuMonitorPtr mon, } int -qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, +qemuMonitorTextCreateSnapshot(qemuMonitor *mon, const char *name) { g_autofree char *cmd = NULL; @@ -144,7 +144,7 @@ qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, return 0; } -int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name) +int qemuMonitorTextLoadSnapshot(qemuMonitor *mon, const char *name) { g_autofree char *cmd = NULL; g_autofree char *reply = NULL; @@ -180,7 +180,7 @@ int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name) return 0; } -int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, const char *name) +int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name) { g_autofree char *cmd = NULL; g_autofree char *reply = NULL; diff --git a/src/qemu/qemu_monitor_text.h b/src/qemu/qemu_monitor_text.h index ce6dd979a5..c8177d3b3b 100644 --- a/src/qemu/qemu_monitor_text.h +++ b/src/qemu/qemu_monitor_text.h @@ -25,12 +25,12 @@ #include "qemu_monitor.h" -int qemuMonitorTextAddDrive(qemuMonitorPtr mon, +int qemuMonitorTextAddDrive(qemuMonitor *mon, const char *drivestr); -int qemuMonitorTextDriveDel(qemuMonitorPtr mon, +int qemuMonitorTextDriveDel(qemuMonitor *mon, const char *drivestr); -int qemuMonitorTextCreateSnapshot(qemuMonitorPtr mon, const char *name); -int qemuMonitorTextLoadSnapshot(qemuMonitorPtr mon, const char *name); -int qemuMonitorTextDeleteSnapshot(qemuMonitorPtr mon, const char *name); +int qemuMonitorTextCreateSnapshot(qemuMonitor *mon, const char *name); +int qemuMonitorTextLoadSnapshot(qemuMonitor *mon, const char *name); +int qemuMonitorTextDeleteSnapshot(qemuMonitor *mon, const char *name); diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c index cc08aa8c36..6a97863d92 100644 --- a/src/qemu/qemu_namespace.c +++ b/src/qemu/qemu_namespace.c @@ -66,8 +66,8 @@ VIR_ENUM_IMPL(qemuDomainNamespace, * NULL on failure. */ static char * -qemuDomainGetPreservedMountPath(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, +qemuDomainGetPreservedMountPath(virQEMUDriverConfig *cfg, + virDomainObj *vm, const char *mountpoint) { char *path = NULL; @@ -114,8 +114,8 @@ qemuDomainGetPreservedMountPath(virQEMUDriverConfigPtr cfg, * Returns 0 on success, -1 otherwise (with error reported) */ static int -qemuDomainGetPreservedMounts(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, +qemuDomainGetPreservedMounts(virQEMUDriverConfig *cfg, + virDomainObj *vm, char ***devPath, char ***devSavePath, size_t *ndevPath) @@ -190,7 +190,7 @@ qemuDomainGetPreservedMounts(virQEMUDriverConfigPtr cfg, static int -qemuDomainPopulateDevices(virQEMUDriverConfigPtr cfg, +qemuDomainPopulateDevices(virQEMUDriverConfig *cfg, GSList **paths) { const char *const *devices = (const char *const *) cfg->cgroupDeviceACL; @@ -208,8 +208,8 @@ qemuDomainPopulateDevices(virQEMUDriverConfigPtr cfg, static int -qemuDomainSetupDev(virSecurityManagerPtr mgr, - virDomainObjPtr vm, +qemuDomainSetupDev(virSecurityManager *mgr, + virDomainObj *vm, const char *path) { g_autofree char *mount_options = NULL; @@ -236,10 +236,10 @@ qemuDomainSetupDev(virSecurityManagerPtr mgr, static int -qemuDomainSetupDisk(virStorageSourcePtr src, +qemuDomainSetupDisk(virStorageSource *src, GSList **paths) { - virStorageSourcePtr next; + virStorageSource *next; bool hasNVMe = false; for (next = src; virStorageSourceIsBacking(next); next = next->backingStore) { @@ -291,7 +291,7 @@ qemuDomainSetupDisk(virStorageSourcePtr src, static int -qemuDomainSetupAllDisks(virDomainObjPtr vm, +qemuDomainSetupAllDisks(virDomainObj *vm, GSList **paths) { size_t i; @@ -310,8 +310,8 @@ qemuDomainSetupAllDisks(virDomainObjPtr vm, static int -qemuDomainSetupHostdev(virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev, +qemuDomainSetupHostdev(virDomainObj *vm, + virDomainHostdevDef *hostdev, bool hotplug, GSList **paths) { @@ -332,7 +332,7 @@ qemuDomainSetupHostdev(virDomainObjPtr vm, static int -qemuDomainSetupAllHostdevs(virDomainObjPtr vm, +qemuDomainSetupAllHostdevs(virDomainObj *vm, GSList **paths) { size_t i; @@ -351,7 +351,7 @@ qemuDomainSetupAllHostdevs(virDomainObjPtr vm, static int -qemuDomainSetupMemory(virDomainMemoryDefPtr mem, +qemuDomainSetupMemory(virDomainMemoryDef *mem, GSList **paths) { if (mem->model != VIR_DOMAIN_MEMORY_MODEL_NVDIMM && @@ -365,7 +365,7 @@ qemuDomainSetupMemory(virDomainMemoryDefPtr mem, static int -qemuDomainSetupAllMemories(virDomainObjPtr vm, +qemuDomainSetupAllMemories(virDomainObj *vm, GSList **paths) { size_t i; @@ -382,8 +382,8 @@ qemuDomainSetupAllMemories(virDomainObjPtr vm, static int -qemuDomainSetupChardev(virDomainDefPtr def G_GNUC_UNUSED, - virDomainChrDefPtr dev, +qemuDomainSetupChardev(virDomainDef *def G_GNUC_UNUSED, + virDomainChrDef *dev, void *opaque) { GSList **paths = opaque; @@ -403,7 +403,7 @@ qemuDomainSetupChardev(virDomainDefPtr def G_GNUC_UNUSED, static int -qemuDomainSetupAllChardevs(virDomainObjPtr vm, +qemuDomainSetupAllChardevs(virDomainObj *vm, GSList **paths) { VIR_DEBUG("Setting up chardevs"); @@ -420,7 +420,7 @@ qemuDomainSetupAllChardevs(virDomainObjPtr vm, static int -qemuDomainSetupTPM(virDomainTPMDefPtr dev, +qemuDomainSetupTPM(virDomainTPMDef *dev, GSList **paths) { switch (dev->type) { @@ -439,7 +439,7 @@ qemuDomainSetupTPM(virDomainTPMDefPtr dev, static int -qemuDomainSetupAllTPMs(virDomainObjPtr vm, +qemuDomainSetupAllTPMs(virDomainObj *vm, GSList **paths) { size_t i; @@ -457,7 +457,7 @@ qemuDomainSetupAllTPMs(virDomainObjPtr vm, static int -qemuDomainSetupGraphics(virDomainGraphicsDefPtr gfx, +qemuDomainSetupGraphics(virDomainGraphicsDef *gfx, GSList **paths) { const char *rendernode = virDomainGraphicsGetRenderNode(gfx); @@ -471,7 +471,7 @@ qemuDomainSetupGraphics(virDomainGraphicsDefPtr gfx, static int -qemuDomainSetupAllGraphics(virDomainObjPtr vm, +qemuDomainSetupAllGraphics(virDomainObj *vm, GSList **paths) { size_t i; @@ -489,7 +489,7 @@ qemuDomainSetupAllGraphics(virDomainObjPtr vm, static int -qemuDomainSetupInput(virDomainInputDefPtr input, +qemuDomainSetupInput(virDomainInputDef *input, GSList **paths) { const char *path = virDomainInputDefGetPath(input); @@ -504,7 +504,7 @@ qemuDomainSetupInput(virDomainInputDefPtr input, static int -qemuDomainSetupAllInputs(virDomainObjPtr vm, +qemuDomainSetupAllInputs(virDomainObj *vm, GSList **paths) { size_t i; @@ -521,7 +521,7 @@ qemuDomainSetupAllInputs(virDomainObjPtr vm, static int -qemuDomainSetupRNG(virDomainRNGDefPtr rng, +qemuDomainSetupRNG(virDomainRNGDef *rng, GSList **paths) { switch ((virDomainRNGBackend) rng->backend) { @@ -541,7 +541,7 @@ qemuDomainSetupRNG(virDomainRNGDefPtr rng, static int -qemuDomainSetupAllRNGs(virDomainObjPtr vm, +qemuDomainSetupAllRNGs(virDomainObj *vm, GSList **paths) { size_t i; @@ -559,10 +559,10 @@ qemuDomainSetupAllRNGs(virDomainObjPtr vm, static int -qemuDomainSetupLoader(virDomainObjPtr vm, +qemuDomainSetupLoader(virDomainObj *vm, GSList **paths) { - virDomainLoaderDefPtr loader = vm->def->os.loader; + virDomainLoaderDef *loader = vm->def->os.loader; VIR_DEBUG("Setting up loader"); @@ -591,10 +591,10 @@ qemuDomainSetupLoader(virDomainObjPtr vm, static int -qemuDomainSetupLaunchSecurity(virDomainObjPtr vm, +qemuDomainSetupLaunchSecurity(virDomainObj *vm, GSList **paths) { - virDomainSEVDefPtr sev = vm->def->sev; + virDomainSEVDef *sev = vm->def->sev; if (!sev || sev->sectype != VIR_DOMAIN_LAUNCH_SECURITY_SEV) return 0; @@ -609,13 +609,13 @@ qemuDomainSetupLaunchSecurity(virDomainObjPtr vm, static int -qemuNamespaceMknodPaths(virDomainObjPtr vm, +qemuNamespaceMknodPaths(virDomainObj *vm, GSList *paths); int -qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm) +qemuDomainBuildNamespace(virQEMUDriverConfig *cfg, + virDomainObj *vm) { g_autoptr(virGSListString) paths = NULL; @@ -665,9 +665,9 @@ qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg, int -qemuDomainUnshareNamespace(virQEMUDriverConfigPtr cfg, - virSecurityManagerPtr mgr, - virDomainObjPtr vm) +qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg, + virSecurityManager *mgr, + virDomainObj *vm) { const char *devPath = NULL; char **devMountsPath = NULL, **devMountsSavePath = NULL; @@ -786,10 +786,10 @@ qemuDomainUnshareNamespace(virQEMUDriverConfigPtr cfg, bool -qemuDomainNamespaceEnabled(virDomainObjPtr vm, +qemuDomainNamespaceEnabled(virDomainObj *vm, qemuDomainNamespace ns) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; return priv->namespaces && virBitmapIsBitSet(priv->namespaces, ns); @@ -797,10 +797,10 @@ qemuDomainNamespaceEnabled(virDomainObjPtr vm, int -qemuDomainEnableNamespace(virDomainObjPtr vm, +qemuDomainEnableNamespace(virDomainObj *vm, qemuDomainNamespace ns) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!priv->namespaces) priv->namespaces = virBitmapNew(QEMU_DOMAIN_NS_LAST); @@ -817,10 +817,10 @@ qemuDomainEnableNamespace(virDomainObjPtr vm, static void -qemuDomainDisableNamespace(virDomainObjPtr vm, +qemuDomainDisableNamespace(virDomainObj *vm, qemuDomainNamespace ns) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (priv->namespaces) { ignore_value(virBitmapClearBit(priv->namespaces, ns)); @@ -833,8 +833,8 @@ qemuDomainDisableNamespace(virDomainObjPtr vm, void -qemuDomainDestroyNamespace(virQEMUDriverPtr driver G_GNUC_UNUSED, - virDomainObjPtr vm) +qemuDomainDestroyNamespace(virQEMUDriver *driver G_GNUC_UNUSED, + virDomainObj *vm) { if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) qemuDomainDisableNamespace(vm, QEMU_DOMAIN_NS_MOUNT); @@ -871,7 +871,6 @@ qemuDomainNamespaceAvailable(qemuDomainNamespace ns G_GNUC_UNUSED) typedef struct _qemuNamespaceMknodItem qemuNamespaceMknodItem; -typedef qemuNamespaceMknodItem *qemuNamespaceMknodItemPtr; struct _qemuNamespaceMknodItem { char *file; char *target; @@ -882,17 +881,16 @@ struct _qemuNamespaceMknodItem { }; typedef struct _qemuNamespaceMknodData qemuNamespaceMknodData; -typedef qemuNamespaceMknodData *qemuNamespaceMknodDataPtr; struct _qemuNamespaceMknodData { - virQEMUDriverPtr driver; - virDomainObjPtr vm; - qemuNamespaceMknodItemPtr items; + virQEMUDriver *driver; + virDomainObj *vm; + qemuNamespaceMknodItem *items; size_t nitems; }; static void -qemuNamespaceMknodItemClear(qemuNamespaceMknodItemPtr item) +qemuNamespaceMknodItemClear(qemuNamespaceMknodItem *item) { VIR_FREE(item->file); VIR_FREE(item->target); @@ -906,12 +904,12 @@ qemuNamespaceMknodItemClear(qemuNamespaceMknodItemPtr item) G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(qemuNamespaceMknodItem, qemuNamespaceMknodItemClear); static void -qemuNamespaceMknodDataClear(qemuNamespaceMknodDataPtr data) +qemuNamespaceMknodDataClear(qemuNamespaceMknodData *data) { size_t i; for (i = 0; i < data->nitems; i++) { - qemuNamespaceMknodItemPtr item = &data->items[i]; + qemuNamespaceMknodItem *item = &data->items[i]; qemuNamespaceMknodItemClear(item); } @@ -923,7 +921,7 @@ qemuNamespaceMknodDataClear(qemuNamespaceMknodDataPtr data) /* Our way of creating devices is highly linux specific */ #if defined(__linux__) static int -qemuNamespaceMknodOne(qemuNamespaceMknodItemPtr data) +qemuNamespaceMknodOne(qemuNamespaceMknodItem *data) { int ret = -1; bool delDevice = false; @@ -1068,7 +1066,7 @@ static int qemuNamespaceMknodHelper(pid_t pid G_GNUC_UNUSED, void *opaque) { - qemuNamespaceMknodDataPtr data = opaque; + qemuNamespaceMknodData *data = opaque; size_t i; int ret = -1; @@ -1087,9 +1085,9 @@ qemuNamespaceMknodHelper(pid_t pid G_GNUC_UNUSED, static int -qemuNamespaceMknodItemInit(qemuNamespaceMknodItemPtr item, - virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, +qemuNamespaceMknodItemInit(qemuNamespaceMknodItem *item, + virQEMUDriverConfig *cfg, + virDomainObj *vm, const char *file) { g_autofree char *target = NULL; @@ -1163,9 +1161,9 @@ qemuNamespaceMknodItemInit(qemuNamespaceMknodItemPtr item, static int -qemuNamespacePrepareOneItem(qemuNamespaceMknodDataPtr data, - virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm, +qemuNamespacePrepareOneItem(qemuNamespaceMknodData *data, + virQEMUDriverConfig *cfg, + virDomainObj *vm, const char *file, char * const *devMountsPath, size_t ndevMountsPath) @@ -1226,11 +1224,11 @@ qemuNamespacePrepareOneItem(qemuNamespaceMknodDataPtr data, static int -qemuNamespaceMknodPaths(virDomainObjPtr vm, +qemuNamespaceMknodPaths(virDomainObj *vm, GSList *paths) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(virQEMUDriverConfig) cfg = NULL; char **devMountsPath = NULL; size_t ndevMountsPath = 0; @@ -1260,7 +1258,7 @@ qemuNamespaceMknodPaths(virDomainObjPtr vm, } for (i = 0; i < data.nitems; i++) { - qemuNamespaceMknodItemPtr item = &data.items[i]; + qemuNamespaceMknodItem *item = &data.items[i]; if (item->target && qemuNamespaceMknodItemNeedsBindMount(item->sb.st_mode)) { if (virFileBindMountDevice(item->file, item->target) < 0) @@ -1298,7 +1296,7 @@ qemuNamespaceMknodPaths(virDomainObjPtr vm, static int -qemuNamespaceMknodPaths(virDomainObjPtr vm G_GNUC_UNUSED, +qemuNamespaceMknodPaths(virDomainObj *vm G_GNUC_UNUSED, GSList *paths G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -1333,11 +1331,11 @@ qemuNamespaceUnlinkHelper(pid_t pid G_GNUC_UNUSED, static int -qemuNamespaceUnlinkPaths(virDomainObjPtr vm, +qemuNamespaceUnlinkPaths(virDomainObj *vm, GSList *paths) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(virQEMUDriverConfig) cfg = NULL; g_auto(GStrv) devMountsPath = NULL; g_autoptr(virGSListString) unlinkPaths = NULL; @@ -1384,8 +1382,8 @@ qemuNamespaceUnlinkPaths(virDomainObjPtr vm, int -qemuDomainNamespaceSetupDisk(virDomainObjPtr vm, - virStorageSourcePtr src) +qemuDomainNamespaceSetupDisk(virDomainObj *vm, + virStorageSource *src) { g_autoptr(virGSListString) paths = NULL; @@ -1403,8 +1401,8 @@ qemuDomainNamespaceSetupDisk(virDomainObjPtr vm, int -qemuDomainNamespaceTeardownDisk(virDomainObjPtr vm G_GNUC_UNUSED, - virStorageSourcePtr src G_GNUC_UNUSED) +qemuDomainNamespaceTeardownDisk(virDomainObj *vm G_GNUC_UNUSED, + virStorageSource *src G_GNUC_UNUSED) { /* While in hotplug case we create the whole backing chain, * here we must limit ourselves. The disk we want to remove @@ -1428,8 +1426,8 @@ qemuDomainNamespaceTeardownDisk(virDomainObjPtr vm G_GNUC_UNUSED, * -1 otherwise. */ int -qemuDomainNamespaceSetupHostdev(virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainNamespaceSetupHostdev(virDomainObj *vm, + virDomainHostdevDef *hostdev) { g_autoptr(virGSListString) paths = NULL; @@ -1461,8 +1459,8 @@ qemuDomainNamespaceSetupHostdev(virDomainObjPtr vm, * -1 otherwise. */ int -qemuDomainNamespaceTeardownHostdev(virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuDomainNamespaceTeardownHostdev(virDomainObj *vm, + virDomainHostdevDef *hostdev) { g_autoptr(virGSListString) paths = NULL; @@ -1483,8 +1481,8 @@ qemuDomainNamespaceTeardownHostdev(virDomainObjPtr vm, int -qemuDomainNamespaceSetupMemory(virDomainObjPtr vm, - virDomainMemoryDefPtr mem) +qemuDomainNamespaceSetupMemory(virDomainObj *vm, + virDomainMemoryDef *mem) { g_autoptr(virGSListString) paths = NULL; @@ -1502,8 +1500,8 @@ qemuDomainNamespaceSetupMemory(virDomainObjPtr vm, int -qemuDomainNamespaceTeardownMemory(virDomainObjPtr vm, - virDomainMemoryDefPtr mem) +qemuDomainNamespaceTeardownMemory(virDomainObj *vm, + virDomainMemoryDef *mem) { g_autoptr(virGSListString) paths = NULL; @@ -1521,8 +1519,8 @@ qemuDomainNamespaceTeardownMemory(virDomainObjPtr vm, int -qemuDomainNamespaceSetupChardev(virDomainObjPtr vm, - virDomainChrDefPtr chr) +qemuDomainNamespaceSetupChardev(virDomainObj *vm, + virDomainChrDef *chr) { g_autoptr(virGSListString) paths = NULL; @@ -1540,8 +1538,8 @@ qemuDomainNamespaceSetupChardev(virDomainObjPtr vm, int -qemuDomainNamespaceTeardownChardev(virDomainObjPtr vm, - virDomainChrDefPtr chr) +qemuDomainNamespaceTeardownChardev(virDomainObj *vm, + virDomainChrDef *chr) { g_autoptr(virGSListString) paths = NULL; @@ -1559,8 +1557,8 @@ qemuDomainNamespaceTeardownChardev(virDomainObjPtr vm, int -qemuDomainNamespaceSetupRNG(virDomainObjPtr vm, - virDomainRNGDefPtr rng) +qemuDomainNamespaceSetupRNG(virDomainObj *vm, + virDomainRNGDef *rng) { g_autoptr(virGSListString) paths = NULL; @@ -1578,8 +1576,8 @@ qemuDomainNamespaceSetupRNG(virDomainObjPtr vm, int -qemuDomainNamespaceTeardownRNG(virDomainObjPtr vm, - virDomainRNGDefPtr rng) +qemuDomainNamespaceTeardownRNG(virDomainObj *vm, + virDomainRNGDef *rng) { g_autoptr(virGSListString) paths = NULL; @@ -1597,8 +1595,8 @@ qemuDomainNamespaceTeardownRNG(virDomainObjPtr vm, int -qemuDomainNamespaceSetupInput(virDomainObjPtr vm, - virDomainInputDefPtr input) +qemuDomainNamespaceSetupInput(virDomainObj *vm, + virDomainInputDef *input) { g_autoptr(virGSListString) paths = NULL; @@ -1615,8 +1613,8 @@ qemuDomainNamespaceSetupInput(virDomainObjPtr vm, int -qemuDomainNamespaceTeardownInput(virDomainObjPtr vm, - virDomainInputDefPtr input) +qemuDomainNamespaceTeardownInput(virDomainObj *vm, + virDomainInputDef *input) { g_autoptr(virGSListString) paths = NULL; diff --git a/src/qemu/qemu_namespace.h b/src/qemu/qemu_namespace.h index 52ca3ba0a1..771d7873ef 100644 --- a/src/qemu/qemu_namespace.h +++ b/src/qemu/qemu_namespace.h @@ -31,56 +31,56 @@ typedef enum { } qemuDomainNamespace; VIR_ENUM_DECL(qemuDomainNamespace); -int qemuDomainEnableNamespace(virDomainObjPtr vm, +int qemuDomainEnableNamespace(virDomainObj *vm, qemuDomainNamespace ns); -bool qemuDomainNamespaceEnabled(virDomainObjPtr vm, +bool qemuDomainNamespaceEnabled(virDomainObj *vm, qemuDomainNamespace ns); -int qemuDomainUnshareNamespace(virQEMUDriverConfigPtr cfg, - virSecurityManagerPtr mgr, - virDomainObjPtr vm); +int qemuDomainUnshareNamespace(virQEMUDriverConfig *cfg, + virSecurityManager *mgr, + virDomainObj *vm); -int qemuDomainBuildNamespace(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm); +int qemuDomainBuildNamespace(virQEMUDriverConfig *cfg, + virDomainObj *vm); -void qemuDomainDestroyNamespace(virQEMUDriverPtr driver, - virDomainObjPtr vm); +void qemuDomainDestroyNamespace(virQEMUDriver *driver, + virDomainObj *vm); bool qemuDomainNamespaceAvailable(qemuDomainNamespace ns); -int qemuDomainNamespaceSetupDisk(virDomainObjPtr vm, - virStorageSourcePtr src); +int qemuDomainNamespaceSetupDisk(virDomainObj *vm, + virStorageSource *src); -int qemuDomainNamespaceTeardownDisk(virDomainObjPtr vm, - virStorageSourcePtr src); +int qemuDomainNamespaceTeardownDisk(virDomainObj *vm, + virStorageSource *src); -int qemuDomainNamespaceSetupHostdev(virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev); +int qemuDomainNamespaceSetupHostdev(virDomainObj *vm, + virDomainHostdevDef *hostdev); -int qemuDomainNamespaceTeardownHostdev(virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev); +int qemuDomainNamespaceTeardownHostdev(virDomainObj *vm, + virDomainHostdevDef *hostdev); -int qemuDomainNamespaceSetupMemory(virDomainObjPtr vm, - virDomainMemoryDefPtr memory); +int qemuDomainNamespaceSetupMemory(virDomainObj *vm, + virDomainMemoryDef *memory); -int qemuDomainNamespaceTeardownMemory(virDomainObjPtr vm, - virDomainMemoryDefPtr memory); +int qemuDomainNamespaceTeardownMemory(virDomainObj *vm, + virDomainMemoryDef *memory); -int qemuDomainNamespaceSetupChardev(virDomainObjPtr vm, - virDomainChrDefPtr chr); +int qemuDomainNamespaceSetupChardev(virDomainObj *vm, + virDomainChrDef *chr); -int qemuDomainNamespaceTeardownChardev(virDomainObjPtr vm, - virDomainChrDefPtr chr); +int qemuDomainNamespaceTeardownChardev(virDomainObj *vm, + virDomainChrDef *chr); -int qemuDomainNamespaceSetupRNG(virDomainObjPtr vm, - virDomainRNGDefPtr rng); +int qemuDomainNamespaceSetupRNG(virDomainObj *vm, + virDomainRNGDef *rng); -int qemuDomainNamespaceTeardownRNG(virDomainObjPtr vm, - virDomainRNGDefPtr rng); +int qemuDomainNamespaceTeardownRNG(virDomainObj *vm, + virDomainRNGDef *rng); -int qemuDomainNamespaceSetupInput(virDomainObjPtr vm, - virDomainInputDefPtr input); +int qemuDomainNamespaceSetupInput(virDomainObj *vm, + virDomainInputDef *input); -int qemuDomainNamespaceTeardownInput(virDomainObjPtr vm, - virDomainInputDefPtr input); +int qemuDomainNamespaceTeardownInput(virDomainObj *vm, + virDomainInputDef *input); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index b74afedd07..4df33dc0d5 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -108,11 +108,11 @@ VIR_LOG_INIT("qemu.qemu_process"); * remove all state files of a domain from statedir */ static void -qemuProcessRemoveDomainStatus(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuProcessRemoveDomainStatus(virQEMUDriver *driver, + virDomainObj *vm) { g_autofree char *file = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); file = g_strdup_printf("%s/%s.xml", cfg->stateDir, vm->def->name); @@ -130,16 +130,16 @@ qemuProcessRemoveDomainStatus(virQEMUDriverPtr driver, /* - * This is a callback registered with a qemuAgentPtr instance, + * This is a callback registered with a qemuAgent *instance, * and to be invoked when the agent console hits an end of file * condition, or error, thus indicating VM shutdown should be * performed */ static void -qemuProcessHandleAgentEOF(qemuAgentPtr agent, - virDomainObjPtr vm) +qemuProcessHandleAgentEOF(qemuAgent *agent, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; VIR_DEBUG("Received EOF from agent on %p '%s'", vm, vm->def->name); @@ -177,10 +177,10 @@ qemuProcessHandleAgentEOF(qemuAgentPtr agent, * allowed */ static void -qemuProcessHandleAgentError(qemuAgentPtr agent G_GNUC_UNUSED, - virDomainObjPtr vm) +qemuProcessHandleAgentError(qemuAgent *agent G_GNUC_UNUSED, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; VIR_DEBUG("Received error from agent on %p '%s'", vm, vm->def->name); @@ -193,8 +193,8 @@ qemuProcessHandleAgentError(qemuAgentPtr agent G_GNUC_UNUSED, virObjectUnlock(vm); } -static void qemuProcessHandleAgentDestroy(qemuAgentPtr agent, - virDomainObjPtr vm) +static void qemuProcessHandleAgentDestroy(qemuAgent *agent, + virDomainObj *vm) { VIR_DEBUG("Received destroy agent=%p vm=%p", agent, vm); @@ -210,11 +210,11 @@ static qemuAgentCallbacks agentCallbacks = { int -qemuConnectAgent(virQEMUDriverPtr driver, virDomainObjPtr vm) +qemuConnectAgent(virQEMUDriver *driver, virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuAgentPtr agent = NULL; - virDomainChrDefPtr config = qemuFindAgentConfig(vm->def); + qemuDomainObjPrivate *priv = vm->privateData; + qemuAgent *agent = NULL; + virDomainChrDef *config = qemuFindAgentConfig(vm->def); if (!config) return 0; @@ -281,18 +281,18 @@ qemuConnectAgent(virQEMUDriverPtr driver, virDomainObjPtr vm) /* - * This is a callback registered with a qemuMonitorPtr instance, + * This is a callback registered with a qemuMonitor *instance, * and to be invoked when the monitor console hits an end of file * condition, or error, thus indicating VM shutdown should be * performed */ static void -qemuProcessHandleMonitorEOF(qemuMonitorPtr mon, - virDomainObjPtr vm, +qemuProcessHandleMonitorEOF(qemuMonitor *mon, + virDomainObj *vm, void *opaque) { - virQEMUDriverPtr driver = opaque; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = opaque; + qemuDomainObjPrivate *priv; struct qemuProcessEvent *processEvent; virObjectLock(vm); @@ -339,18 +339,18 @@ qemuProcessHandleMonitorEOF(qemuMonitorPtr mon, * allowed */ static void -qemuProcessHandleMonitorError(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleMonitorError(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; VIR_DEBUG("Received error on %p '%s'", vm, vm->def->name); virObjectLock(vm); - ((qemuDomainObjPrivatePtr) vm->privateData)->monError = true; + ((qemuDomainObjPrivate *) vm->privateData)->monError = true; event = virDomainEventControlErrorNewFromObj(vm); virObjectEventStateQueue(driver->domainEventState, event); @@ -371,8 +371,8 @@ qemuProcessHandleMonitorError(qemuMonitorPtr mon G_GNUC_UNUSED, * * Returns a disk from @vm or NULL if it could not be found. */ -virDomainDiskDefPtr -qemuProcessFindDomainDiskByAliasOrQOM(virDomainObjPtr vm, +virDomainDiskDef * +qemuProcessFindDomainDiskByAliasOrQOM(virDomainObj *vm, const char *alias, const char *qomid) { @@ -385,8 +385,8 @@ qemuProcessFindDomainDiskByAliasOrQOM(virDomainObjPtr vm, alias = qemuAliasDiskDriveSkipPrefix(alias); for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + virDomainDiskDef *disk = vm->def->disks[i]; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); if ((disk->info.alias && STREQ_NULLABLE(disk->info.alias, alias)) || (diskPriv->qomName && STREQ_NULLABLE(diskPriv->qomName, qomid))) @@ -401,13 +401,13 @@ qemuProcessFindDomainDiskByAliasOrQOM(virDomainObjPtr vm, static int -qemuProcessHandleReset(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleReset(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = opaque; + virObjectEvent *event; + qemuDomainObjPrivate *priv; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); int ret = -1; @@ -460,9 +460,9 @@ qemuProcessHandleReset(qemuMonitorPtr mon G_GNUC_UNUSED, static void qemuProcessFakeReboot(void *opaque) { - virDomainObjPtr vm = opaque; - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + virDomainObj *vm = opaque; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); virDomainRunningReason reason = VIR_DOMAIN_RUNNING_BOOTED; int ret = -1, rc; @@ -518,10 +518,10 @@ qemuProcessFakeReboot(void *opaque) void -qemuProcessShutdownOrReboot(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuProcessShutdownOrReboot(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (priv->fakeReboot) { g_autofree char *name = g_strdup_printf("reboot-%s", vm->def->name); @@ -547,16 +547,16 @@ qemuProcessShutdownOrReboot(virQEMUDriverPtr driver, static int -qemuProcessHandleEvent(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleEvent(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, const char *eventName, long long seconds, unsigned int micros, const char *details, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; VIR_DEBUG("vm=%p", vm); @@ -573,14 +573,14 @@ qemuProcessHandleEvent(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleShutdown(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleShutdown(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, virTristateBool guest_initiated, void *opaque) { - virQEMUDriverPtr driver = opaque; - qemuDomainObjPrivatePtr priv; - virObjectEventPtr event = NULL; + virQEMUDriver *driver = opaque; + qemuDomainObjPrivate *priv; + virObjectEvent *event = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); int detail = 0; @@ -650,16 +650,16 @@ qemuProcessHandleShutdown(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleStop(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleStop(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; virDomainPausedReason reason; virDomainEventSuspendedDetailType detail; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virObjectLock(vm); @@ -713,14 +713,14 @@ qemuProcessHandleStop(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleResume(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleResume(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; virDomainRunningReason reason = VIR_DOMAIN_RUNNING_UNPAUSED; virDomainEventResumedDetailType eventDetail; @@ -756,13 +756,13 @@ qemuProcessHandleResume(qemuMonitorPtr mon G_GNUC_UNUSED, } static int -qemuProcessHandleRTCChange(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleRTCChange(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, long long offset, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -800,14 +800,14 @@ qemuProcessHandleRTCChange(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleWatchdog(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleWatchdog(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, int action, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr watchdogEvent = NULL; - virObjectEventPtr lifecycleEvent = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *watchdogEvent = NULL; + virObjectEvent *lifecycleEvent = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -815,7 +815,7 @@ qemuProcessHandleWatchdog(qemuMonitorPtr mon G_GNUC_UNUSED, if (action == VIR_DOMAIN_EVENT_WATCHDOG_PAUSE && virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; VIR_DEBUG("Transitioned guest %s to paused state due to watchdog", vm->def->name); virDomainObjSetState(vm, VIR_DOMAIN_PAUSED, VIR_DOMAIN_PAUSED_WATCHDOG); @@ -859,21 +859,21 @@ qemuProcessHandleWatchdog(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleIOError(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleIOError(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, const char *diskAlias, const char *nodename, int action, const char *reason, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr ioErrorEvent = NULL; - virObjectEventPtr ioErrorEvent2 = NULL; - virObjectEventPtr lifecycleEvent = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *ioErrorEvent = NULL; + virObjectEvent *ioErrorEvent2 = NULL; + virObjectEvent *lifecycleEvent = NULL; const char *srcPath; const char *devAlias; - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -901,7 +901,7 @@ qemuProcessHandleIOError(qemuMonitorPtr mon G_GNUC_UNUSED, if (action == VIR_DOMAIN_EVENT_IO_ERROR_PAUSE && virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; VIR_DEBUG("Transitioned guest %s to paused state due to IO error", vm->def->name); if (priv->signalIOError) @@ -929,18 +929,18 @@ qemuProcessHandleIOError(qemuMonitorPtr mon G_GNUC_UNUSED, } static int -qemuProcessHandleBlockJob(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleBlockJob(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, const char *diskAlias, int type, int status, const char *error, void *opaque) { - qemuDomainObjPrivatePtr priv; - virQEMUDriverPtr driver = opaque; + qemuDomainObjPrivate *priv; + virQEMUDriver *driver = opaque; struct qemuProcessEvent *processEvent = NULL; - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; g_autoptr(qemuBlockJobData) job = NULL; char *data = NULL; @@ -993,16 +993,16 @@ qemuProcessHandleBlockJob(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleJobStatusChange(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleJobStatusChange(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, const char *jobname, int status, void *opaque) { - virQEMUDriverPtr driver = opaque; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = opaque; + qemuDomainObjPrivate *priv; struct qemuProcessEvent *processEvent = NULL; - qemuBlockJobDataPtr job = NULL; + qemuBlockJobData *job = NULL; int jobnewstate; virObjectLock(vm); @@ -1054,8 +1054,8 @@ qemuProcessHandleJobStatusChange(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleGraphics(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleGraphics(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, int phase, int localFamily, const char *localNode, @@ -1068,8 +1068,8 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon G_GNUC_UNUSED, const char *saslUsername, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event; + virQEMUDriver *driver = opaque; + virObjectEvent *event; virDomainEventGraphicsAddressPtr localAddr = NULL; virDomainEventGraphicsAddressPtr remoteAddr = NULL; virDomainEventGraphicsSubjectPtr subject = NULL; @@ -1108,16 +1108,16 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon G_GNUC_UNUSED, } static int -qemuProcessHandleTrayChange(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleTrayChange(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, const char *devAlias, const char *devid, int reason, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; - virDomainDiskDefPtr disk; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; + virDomainDiskDef *disk; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -1145,13 +1145,13 @@ qemuProcessHandleTrayChange(qemuMonitorPtr mon G_GNUC_UNUSED, } static int -qemuProcessHandlePMWakeup(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandlePMWakeup(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; - virObjectEventPtr lifecycleEvent = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; + virObjectEvent *lifecycleEvent = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -1183,20 +1183,20 @@ qemuProcessHandlePMWakeup(qemuMonitorPtr mon G_GNUC_UNUSED, } static int -qemuProcessHandlePMSuspend(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandlePMSuspend(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; - virObjectEventPtr lifecycleEvent = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; + virObjectEvent *lifecycleEvent = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); event = virDomainEventPMSuspendNewFromObj(vm); if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; VIR_DEBUG("Transitioned guest %s to pmsuspended state due to " "QMP suspend event", vm->def->name); @@ -1224,13 +1224,13 @@ qemuProcessHandlePMSuspend(qemuMonitorPtr mon G_GNUC_UNUSED, } static int -qemuProcessHandleBalloonChange(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleBalloonChange(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, unsigned long long actual, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); @@ -1250,20 +1250,20 @@ qemuProcessHandleBalloonChange(qemuMonitorPtr mon G_GNUC_UNUSED, } static int -qemuProcessHandlePMSuspendDisk(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandlePMSuspendDisk(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; - virObjectEventPtr lifecycleEvent = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; + virObjectEvent *lifecycleEvent = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); virObjectLock(vm); event = virDomainEventPMSuspendDiskNewFromObj(vm); if (virDomainObjGetState(vm, NULL) == VIR_DOMAIN_RUNNING) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; VIR_DEBUG("Transitioned guest %s to pmsuspended state due to " "QMP suspend_disk event", vm->def->name); @@ -1293,12 +1293,12 @@ qemuProcessHandlePMSuspendDisk(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleGuestPanic(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, - qemuMonitorEventPanicInfoPtr info, +qemuProcessHandleGuestPanic(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, + qemuMonitorEventPanicInfo *info, void *opaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; struct qemuProcessEvent *processEvent; virObjectLock(vm); @@ -1324,12 +1324,12 @@ qemuProcessHandleGuestPanic(qemuMonitorPtr mon G_GNUC_UNUSED, int -qemuProcessHandleDeviceDeleted(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleDeviceDeleted(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, const char *devAlias, void *opaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; struct qemuProcessEvent *processEvent = NULL; char *data; @@ -1420,8 +1420,8 @@ qemuProcessHandleDeviceDeleted(qemuMonitorPtr mon G_GNUC_UNUSED, * devices. */ static int -qemuProcessHandleAcpiOstInfo(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleAcpiOstInfo(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, const char *alias, const char *slotType, const char *slot, @@ -1429,8 +1429,8 @@ qemuProcessHandleAcpiOstInfo(qemuMonitorPtr mon G_GNUC_UNUSED, unsigned int status, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; virObjectLock(vm); @@ -1460,19 +1460,19 @@ qemuProcessHandleAcpiOstInfo(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleBlockThreshold(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleBlockThreshold(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, const char *nodename, unsigned long long threshold, unsigned long long excess, void *opaque) { - qemuDomainObjPrivatePtr priv; - virQEMUDriverPtr driver = opaque; - virObjectEventPtr eventSource = NULL; - virObjectEventPtr eventDevice = NULL; - virDomainDiskDefPtr disk; - virStorageSourcePtr src; + qemuDomainObjPrivate *priv; + virQEMUDriver *driver = opaque; + virObjectEvent *eventSource = NULL; + virObjectEvent *eventDevice = NULL; + virDomainDiskDef *disk; + virStorageSource *src; const char *path = NULL; virObjectLock(vm); @@ -1511,12 +1511,12 @@ qemuProcessHandleBlockThreshold(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleNicRxFilterChanged(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleNicRxFilterChanged(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, const char *devAlias, void *opaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; struct qemuProcessEvent *processEvent = NULL; char *data; @@ -1547,13 +1547,13 @@ qemuProcessHandleNicRxFilterChanged(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleSerialChanged(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleSerialChanged(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, const char *devAlias, bool connected, void *opaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; struct qemuProcessEvent *processEvent = NULL; char *data; @@ -1585,12 +1585,12 @@ qemuProcessHandleSerialChanged(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleSpiceMigrated(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleSpiceMigrated(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, void *opaque G_GNUC_UNUSED) { - qemuDomainObjPrivatePtr priv; - qemuDomainJobPrivatePtr jobPriv; + qemuDomainObjPrivate *priv; + qemuDomainJobPrivate *jobPriv; virObjectLock(vm); @@ -1614,14 +1614,14 @@ qemuProcessHandleSpiceMigrated(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleMigrationStatus(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleMigrationStatus(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, int status, void *opaque) { - qemuDomainObjPrivatePtr priv; - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; + qemuDomainObjPrivate *priv; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); int reason; @@ -1667,13 +1667,13 @@ qemuProcessHandleMigrationStatus(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleMigrationPass(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleMigrationPass(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, int pass, void *opaque) { - virQEMUDriverPtr driver = opaque; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = opaque; + qemuDomainObjPrivate *priv; virObjectLock(vm); @@ -1696,15 +1696,15 @@ qemuProcessHandleMigrationPass(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleDumpCompleted(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleDumpCompleted(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, int status, - qemuMonitorDumpStatsPtr stats, + qemuMonitorDumpStats *stats, const char *error, void *opaque G_GNUC_UNUSED) { - qemuDomainObjPrivatePtr priv; - qemuDomainJobPrivatePtr jobPriv; + qemuDomainObjPrivate *priv; + qemuDomainJobPrivate *jobPriv; virObjectLock(vm); @@ -1737,14 +1737,14 @@ qemuProcessHandleDumpCompleted(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandlePRManagerStatusChanged(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandlePRManagerStatusChanged(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, const char *prManager, bool connected, void *opaque) { - virQEMUDriverPtr driver = opaque; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = opaque; + qemuDomainObjPrivate *priv; struct qemuProcessEvent *processEvent = NULL; const char *managedAlias = qemuDomainGetManagedPRAlias(); int ret = -1; @@ -1790,17 +1790,17 @@ qemuProcessHandlePRManagerStatusChanged(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleRdmaGidStatusChanged(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleRdmaGidStatusChanged(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, const char *netdev, bool gid_status, unsigned long long subnet_prefix, unsigned long long interface_id, void *opaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; struct qemuProcessEvent *processEvent = NULL; - qemuMonitorRdmaGidStatusPtr info = NULL; + qemuMonitorRdmaGidStatus *info = NULL; int ret = -1; virObjectLock(vm); @@ -1837,11 +1837,11 @@ qemuProcessHandleRdmaGidStatusChanged(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleGuestCrashloaded(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, +qemuProcessHandleGuestCrashloaded(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, void *opaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; struct qemuProcessEvent *processEvent; virObjectLock(vm); @@ -1862,13 +1862,13 @@ qemuProcessHandleGuestCrashloaded(qemuMonitorPtr mon G_GNUC_UNUSED, static int -qemuProcessHandleMemoryFailure(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm, - qemuMonitorEventMemoryFailurePtr mfp, +qemuProcessHandleMemoryFailure(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm, + qemuMonitorEventMemoryFailure *mfp, void *opaque) { - virQEMUDriverPtr driver = opaque; - virObjectEventPtr event = NULL; + virQEMUDriver *driver = opaque; + virObjectEvent *event = NULL; virDomainMemoryFailureRecipientType recipient; virDomainMemoryFailureActionType action; unsigned int flags = 0; @@ -1955,7 +1955,7 @@ static qemuMonitorCallbacks monitorCallbacks = { }; static void -qemuProcessMonitorReportLogError(qemuMonitorPtr mon, +qemuProcessMonitorReportLogError(qemuMonitor *mon, const char *msg, void *opaque); @@ -1963,14 +1963,14 @@ qemuProcessMonitorReportLogError(qemuMonitorPtr mon, static void qemuProcessMonitorLogFree(void *opaque) { - qemuDomainLogContextPtr logCtxt = opaque; + qemuDomainLogContext *logCtxt = opaque; g_clear_object(&logCtxt); } static int -qemuProcessInitMonitor(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessInitMonitor(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { int ret; @@ -1988,11 +1988,11 @@ qemuProcessInitMonitor(virQEMUDriverPtr driver, static int -qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob, - bool retry, qemuDomainLogContextPtr logCtxt) +qemuConnectMonitor(virQEMUDriver *driver, virDomainObj *vm, int asyncJob, + bool retry, qemuDomainLogContext *logCtxt) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuMonitorPtr mon = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + qemuMonitor *mon = NULL; unsigned long long timeout = 0; if (qemuSecuritySetDaemonSocketLabel(driver->securityManager, vm->def) < 0) { @@ -2062,7 +2062,7 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob, * Returns 0 on success or -1 on error */ static int -qemuProcessReadLog(qemuDomainLogContextPtr logCtxt, +qemuProcessReadLog(qemuDomainLogContext *logCtxt, char **msg, size_t max) { @@ -2116,7 +2116,7 @@ qemuProcessReadLog(qemuDomainLogContextPtr logCtxt, static int -qemuProcessReportLogError(qemuDomainLogContextPtr logCtxt, +qemuProcessReportLogError(qemuDomainLogContext *logCtxt, const char *msgprefix) { g_autofree char *logmsg = NULL; @@ -2137,17 +2137,17 @@ qemuProcessReportLogError(qemuDomainLogContextPtr logCtxt, static void -qemuProcessMonitorReportLogError(qemuMonitorPtr mon G_GNUC_UNUSED, +qemuProcessMonitorReportLogError(qemuMonitor *mon G_GNUC_UNUSED, const char *msg, void *opaque) { - qemuDomainLogContextPtr logCtxt = opaque; + qemuDomainLogContext *logCtxt = opaque; qemuProcessReportLogError(logCtxt, msg); } static int -qemuProcessLookupPTYs(virDomainChrDefPtr *devices, +qemuProcessLookupPTYs(virDomainChrDef **devices, int count, GHashTable *info) { @@ -2155,9 +2155,9 @@ qemuProcessLookupPTYs(virDomainChrDefPtr *devices, for (i = 0; i < count; i++) { g_autofree char *id = NULL; - virDomainChrDefPtr chr = devices[i]; + virDomainChrDef *chr = devices[i]; if (chr->source->type == VIR_DOMAIN_CHR_TYPE_PTY) { - qemuMonitorChardevInfoPtr entry; + qemuMonitorChardevInfo *entry; id = g_strdup_printf("char%s", chr->info.alias); @@ -2187,7 +2187,7 @@ qemuProcessLookupPTYs(virDomainChrDefPtr *devices, } static int -qemuProcessFindCharDevicePTYsMonitor(virDomainObjPtr vm, +qemuProcessFindCharDevicePTYsMonitor(virDomainObj *vm, GHashTable *info) { size_t i = 0; @@ -2204,7 +2204,7 @@ qemuProcessFindCharDevicePTYsMonitor(virDomainObjPtr vm, /* For historical reasons, console[0] can be just an alias * for serial[0]. That's why we need to update it as well. */ if (vm->def->nconsoles) { - virDomainChrDefPtr chr = vm->def->consoles[0]; + virDomainChrDef *chr = vm->def->consoles[0]; if (vm->def->nserials && chr->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CONSOLE && @@ -2226,22 +2226,22 @@ qemuProcessFindCharDevicePTYsMonitor(virDomainObjPtr vm, static void -qemuProcessRefreshChannelVirtioState(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessRefreshChannelVirtioState(virQEMUDriver *driver, + virDomainObj *vm, GHashTable *info, int booted) { size_t i; int agentReason = VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_CHANNEL; - qemuMonitorChardevInfoPtr entry; - virObjectEventPtr event = NULL; + qemuMonitorChardevInfo *entry; + virObjectEvent *event = NULL; g_autofree char *id = NULL; if (booted) agentReason = VIR_CONNECT_DOMAIN_EVENT_AGENT_LIFECYCLE_REASON_DOMAIN_STARTED; for (i = 0; i < vm->def->nchannels; i++) { - virDomainChrDefPtr chr = vm->def->channels[i]; + virDomainChrDef *chr = vm->def->channels[i]; if (chr->targetType == VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_VIRTIO) { VIR_FREE(id); @@ -2265,11 +2265,11 @@ qemuProcessRefreshChannelVirtioState(virQEMUDriverPtr driver, int -qemuRefreshVirtioChannelState(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuRefreshVirtioChannelState(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; GHashTable *info = NULL; int ret = -1; @@ -2293,11 +2293,11 @@ qemuRefreshVirtioChannelState(virQEMUDriverPtr driver, static int -qemuProcessRefreshPRManagerState(virDomainObjPtr vm, +qemuProcessRefreshPRManagerState(virDomainObj *vm, GHashTable *info) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuMonitorPRManagerInfoPtr prManagerInfo; + qemuDomainObjPrivate *priv = vm->privateData; + qemuMonitorPRManagerInfo *prManagerInfo; const char *managedAlias = qemuDomainGetManagedPRAlias(); if (!(prManagerInfo = virHashLookup(info, managedAlias))) { @@ -2318,10 +2318,10 @@ qemuProcessRefreshPRManagerState(virDomainObjPtr vm, static int -qemuRefreshPRManagerState(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuRefreshPRManagerState(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; GHashTable *info = NULL; int ret = -1; @@ -2346,10 +2346,10 @@ qemuRefreshPRManagerState(virQEMUDriverPtr driver, static void -qemuRefreshRTC(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuRefreshRTC(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; time_t now, then; struct tm thenbits; long localOffset; @@ -2383,8 +2383,8 @@ qemuRefreshRTC(virQEMUDriverPtr driver, } int -qemuProcessRefreshBalloonState(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessRefreshBalloonState(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob) { unsigned long long balloon; @@ -2411,14 +2411,14 @@ qemuProcessRefreshBalloonState(virQEMUDriverPtr driver, static int -qemuProcessWaitForMonitor(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessWaitForMonitor(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob, - qemuDomainLogContextPtr logCtxt) + qemuDomainLogContext *logCtxt) { int ret = -1; GHashTable *info = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool retry = true; if (priv->qemuCaps && @@ -2463,12 +2463,12 @@ qemuProcessWaitForMonitor(virQEMUDriverPtr driver, static int -qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessDetectIOThreadPIDs(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuMonitorIOThreadInfoPtr *iothreads = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + qemuMonitorIOThreadInfo **iothreads = NULL; int niothreads = 0; int ret = -1; size_t i; @@ -2502,7 +2502,7 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver, } for (i = 0; i < niothreads; i++) { - virDomainIOThreadIDDefPtr iothrid; + virDomainIOThreadIDDef *iothrid; if (!(iothrid = virDomainIOThreadIDFind(vm->def, iothreads[i]->iothread_id))) { @@ -2527,7 +2527,7 @@ qemuProcessDetectIOThreadPIDs(virQEMUDriverPtr driver, static int -qemuProcessGetAllCpuAffinity(virBitmapPtr *cpumapRet) +qemuProcessGetAllCpuAffinity(virBitmap **cpumapRet) { *cpumapRet = NULL; @@ -2546,12 +2546,12 @@ qemuProcessGetAllCpuAffinity(virBitmapPtr *cpumapRet) */ #if defined(WITH_SCHED_GETAFFINITY) || defined(WITH_BSD_CPU_AFFINITY) static int -qemuProcessInitCpuAffinity(virDomainObjPtr vm) +qemuProcessInitCpuAffinity(virDomainObj *vm) { bool settingAll = false; g_autoptr(virBitmap) cpumapToSet = NULL; virDomainNumatuneMemMode mem_mode; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!vm->pid) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -2573,7 +2573,7 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm) if (virDomainNumaGetNodeCount(vm->def->numa) <= 1 && virDomainNumatuneGetMode(vm->def->numa, -1, &mem_mode) == 0 && mem_mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT) { - virBitmapPtr nodeset = NULL; + virBitmap *nodeset = NULL; if (virDomainNumatuneMaybeGetNodeset(vm->def->numa, priv->autoNodeset, @@ -2612,7 +2612,7 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm) } #else /* !defined(WITH_SCHED_GETAFFINITY) && !defined(WITH_BSD_CPU_AFFINITY) */ static int -qemuProcessInitCpuAffinity(virDomainObjPtr vm G_GNUC_UNUSED) +qemuProcessInitCpuAffinity(virDomainObj *vm G_GNUC_UNUSED) { return 0; } @@ -2620,12 +2620,12 @@ qemuProcessInitCpuAffinity(virDomainObjPtr vm G_GNUC_UNUSED) /* set link states to down on interfaces at qemu start */ static int -qemuProcessSetLinkStates(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessSetLinkStates(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainDefPtr def = vm->def; + qemuDomainObjPrivate *priv = vm->privateData; + virDomainDef *def = vm->def; size_t i; int ret = -1; int rv; @@ -2675,20 +2675,20 @@ qemuProcessSetLinkStates(virQEMUDriverPtr driver, * Returns 0 on success, -1 on error. */ static int -qemuProcessSetupPid(virDomainObjPtr vm, +qemuProcessSetupPid(virDomainObj *vm, pid_t pid, virCgroupThreadName nameval, int id, - virBitmapPtr cpumask, + virBitmap *cpumask, unsigned long long period, long long quota, - virDomainThreadSchedParamPtr sched) + virDomainThreadSchedParam *sched) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainNumatuneMemMode mem_mode; - virCgroupPtr cgroup = NULL; - virBitmapPtr use_cpumask = NULL; - virBitmapPtr affinity_cpumask = NULL; + virCgroup *cgroup = NULL; + virBitmap *use_cpumask = NULL; + virBitmap *affinity_cpumask = NULL; g_autoptr(virBitmap) hostcpumap = NULL; g_autofree char *mem_mask = NULL; int ret = -1; @@ -2796,7 +2796,7 @@ qemuProcessSetupPid(virDomainObjPtr vm, static int -qemuProcessSetupEmulator(virDomainObjPtr vm) +qemuProcessSetupEmulator(virDomainObj *vm) { return qemuProcessSetupPid(vm, vm->pid, VIR_CGROUP_THREAD_EMULATOR, 0, vm->def->cputune.emulatorpin, @@ -2807,12 +2807,12 @@ qemuProcessSetupEmulator(virDomainObjPtr vm) static int -qemuProcessResctrlCreate(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuProcessResctrlCreate(virQEMUDriver *driver, + virDomainObj *vm) { size_t i = 0; g_autoptr(virCaps) caps = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!vm->def->nresctrls) return 0; @@ -2831,7 +2831,7 @@ qemuProcessResctrlCreate(virQEMUDriverPtr driver, return -1; for (j = 0; j < vm->def->resctrls[i]->nmonitors; j++) { - virDomainResctrlMonDefPtr mon = NULL; + virDomainResctrlMonDef *mon = NULL; mon = vm->def->resctrls[i]->monitors[j]; if (virResctrlMonitorCreate(mon->instance, @@ -2845,9 +2845,9 @@ qemuProcessResctrlCreate(virQEMUDriverPtr driver, static char * -qemuProcessBuildPRHelperPidfilePath(virDomainObjPtr vm) +qemuProcessBuildPRHelperPidfilePath(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; const char *prdAlias = qemuDomainGetManagedPRAlias(); return virPidFileBuildPath(priv->libDir, prdAlias); @@ -2855,9 +2855,9 @@ qemuProcessBuildPRHelperPidfilePath(virDomainObjPtr vm) void -qemuProcessKillManagedPRDaemon(virDomainObjPtr vm) +qemuProcessKillManagedPRDaemon(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virErrorPtr orig_err; g_autofree char *pidfile = NULL; @@ -2879,7 +2879,7 @@ qemuProcessKillManagedPRDaemon(virDomainObjPtr vm) static int qemuProcessStartPRDaemonHook(void *opaque) { - virDomainObjPtr vm = opaque; + virDomainObj *vm = opaque; size_t i, nfds = 0; g_autofree int *fds = NULL; int ret = -1; @@ -2902,10 +2902,10 @@ qemuProcessStartPRDaemonHook(void *opaque) int -qemuProcessStartManagedPRDaemon(virDomainObjPtr vm) +qemuProcessStartManagedPRDaemon(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(virQEMUDriverConfig) cfg = NULL; int errfd = -1; g_autofree char *pidfile = NULL; @@ -3013,8 +3013,8 @@ qemuProcessStartManagedPRDaemon(virDomainObjPtr vm) static int -qemuProcessInitPasswords(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessInitPasswords(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob) { int ret = 0; @@ -3022,7 +3022,7 @@ qemuProcessInitPasswords(virQEMUDriverPtr driver, size_t i; for (i = 0; i < vm->def->ngraphics; ++i) { - virDomainGraphicsDefPtr graphics = vm->def->graphics[i]; + virDomainGraphicsDef *graphics = vm->def->graphics[i]; if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) { ret = qemuDomainChangeGraphicsPasswords(driver, vm, VIR_DOMAIN_GRAPHICS_TYPE_VNC, @@ -3046,8 +3046,8 @@ qemuProcessInitPasswords(virQEMUDriverPtr driver, static int -qemuProcessPrepareChardevDevice(virDomainDefPtr def G_GNUC_UNUSED, - virDomainChrDefPtr dev, +qemuProcessPrepareChardevDevice(virDomainDef *def G_GNUC_UNUSED, + virDomainChrDef *dev, void *opaque G_GNUC_UNUSED) { int fd; @@ -3069,8 +3069,8 @@ qemuProcessPrepareChardevDevice(virDomainDefPtr def G_GNUC_UNUSED, static int -qemuProcessCleanupChardevDevice(virDomainDefPtr def G_GNUC_UNUSED, - virDomainChrDefPtr dev, +qemuProcessCleanupChardevDevice(virDomainDef *def G_GNUC_UNUSED, + virDomainChrDef *dev, void *opaque G_GNUC_UNUSED) { if (dev->source->type == VIR_DOMAIN_CHR_TYPE_UNIX && @@ -3093,14 +3093,14 @@ qemuProcessCleanupChardevDevice(virDomainDefPtr def G_GNUC_UNUSED, * migration. */ static int -qemuProcessUpdateVideoRamSize(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessUpdateVideoRamSize(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob) { int ret = -1; ssize_t i; - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainVideoDefPtr video = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + virDomainVideoDef *video = NULL; g_autoptr(virQEMUDriverConfig) cfg = NULL; if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0) @@ -3170,18 +3170,18 @@ qemuProcessUpdateVideoRamSize(virQEMUDriverPtr driver, struct qemuProcessHookData { - virDomainObjPtr vm; - virQEMUDriverPtr driver; - virQEMUDriverConfigPtr cfg; + virDomainObj *vm; + virQEMUDriver *driver; + virQEMUDriverConfig *cfg; }; static int qemuProcessHook(void *data) { struct qemuProcessHookData *h = data; - qemuDomainObjPrivatePtr priv = h->vm->privateData; + qemuDomainObjPrivate *priv = h->vm->privateData; int ret = -1; int fd; - virBitmapPtr nodeset = NULL; + virBitmap *nodeset = NULL; virDomainNumatuneMemMode mode; /* This method cannot use any mutexes, which are not @@ -3242,7 +3242,7 @@ static int qemuProcessHook(void *data) } int -qemuProcessPrepareMonitorChr(virDomainChrSourceDefPtr monConfig, +qemuProcessPrepareMonitorChr(virDomainChrSourceDef *monConfig, const char *domainDir) { monConfig->type = VIR_DOMAIN_CHR_TYPE_UNIX; @@ -3258,12 +3258,12 @@ qemuProcessPrepareMonitorChr(virDomainChrSourceDefPtr monConfig, * This method will call {Enter,Exit}Monitor */ int -qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm, +qemuProcessStartCPUs(virQEMUDriver *driver, virDomainObj *vm, virDomainRunningReason reason, qemuDomainAsyncJob asyncJob) { int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); /* Bring up netdevs before starting CPUs */ @@ -3309,13 +3309,13 @@ qemuProcessStartCPUs(virQEMUDriverPtr driver, virDomainObjPtr vm, } -int qemuProcessStopCPUs(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessStopCPUs(virQEMUDriver *driver, + virDomainObj *vm, virDomainPausedReason reason, qemuDomainAsyncJob asyncJob) { int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; VIR_FREE(priv->lockState); @@ -3356,13 +3356,13 @@ int qemuProcessStopCPUs(virQEMUDriverPtr driver, static void -qemuProcessNotifyNets(virDomainDefPtr def) +qemuProcessNotifyNets(virDomainDef *def) { size_t i; g_autoptr(virConnect) conn = NULL; for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; /* keep others from trying to use the macvtap device name, but * don't return error if this happens, since that causes the * domain to be unceremoniously killed, which would be *very* @@ -3405,12 +3405,12 @@ qemuProcessNotifyNets(virDomainDefPtr def) * same. We'll just log the error conditions other than of course * ignoreExists possibility (e.g. the true flag) */ static void -qemuProcessFiltersInstantiate(virDomainDefPtr def) +qemuProcessFiltersInstantiate(virDomainDef *def) { size_t i; for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; if ((net->filter) && (net->ifname)) { if (virDomainConfNWFilterInstantiate(def->name, def->uuid, net, true) < 0) { @@ -3423,9 +3423,9 @@ qemuProcessFiltersInstantiate(virDomainDefPtr def) } static int -qemuProcessUpdateState(virQEMUDriverPtr driver, virDomainObjPtr vm) +qemuProcessUpdateState(virQEMUDriver *driver, virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainState state; virDomainPausedReason reason; virDomainState newState = VIR_DOMAIN_NOSTATE; @@ -3487,14 +3487,14 @@ qemuProcessUpdateState(virQEMUDriverPtr driver, virDomainObjPtr vm) } static int -qemuProcessRecoverMigrationIn(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessRecoverMigrationIn(virQEMUDriver *driver, + virDomainObj *vm, const qemuDomainJobObj *job, virDomainState state, int reason) { - qemuDomainJobPrivatePtr jobPriv = job->privateData; + qemuDomainJobPrivate *jobPriv = job->privateData; bool postcopy = (state == VIR_DOMAIN_PAUSED && reason == VIR_DOMAIN_PAUSED_POSTCOPY_FAILED) || (state == VIR_DOMAIN_RUNNING && @@ -3548,14 +3548,14 @@ qemuProcessRecoverMigrationIn(virQEMUDriverPtr driver, } static int -qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessRecoverMigrationOut(virQEMUDriver *driver, + virDomainObj *vm, const qemuDomainJobObj *job, virDomainState state, int reason, unsigned int *stopFlags) { - qemuDomainJobPrivatePtr jobPriv = job->privateData; + qemuDomainJobPrivate *jobPriv = job->privateData; bool postcopy = state == VIR_DOMAIN_PAUSED && (reason == VIR_DOMAIN_PAUSED_POSTCOPY || reason == VIR_DOMAIN_PAUSED_POSTCOPY_FAILED); @@ -3644,12 +3644,12 @@ qemuProcessRecoverMigrationOut(virQEMUDriverPtr driver, } static int -qemuProcessRecoverJob(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessRecoverJob(virQEMUDriver *driver, + virDomainObj *vm, const qemuDomainJobObj *job, unsigned int *stopFlags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainState state; int reason; unsigned long long now; @@ -3771,10 +3771,10 @@ qemuProcessRecoverJob(virQEMUDriverPtr driver, } static int -qemuProcessUpdateDevices(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuProcessUpdateDevices(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainDeviceDef dev; g_auto(GStrv) old = g_steal_pointer(&priv->qemuDevices); GStrv tmp; @@ -3796,11 +3796,11 @@ qemuProcessUpdateDevices(virQEMUDriverPtr driver, } static int -qemuDomainPerfRestart(virDomainObjPtr vm) +qemuDomainPerfRestart(virDomainObj *vm) { size_t i; - virDomainDefPtr def = vm->def; - qemuDomainObjPrivatePtr priv = vm->privateData; + virDomainDef *def = vm->def; + qemuDomainObjPrivate *priv = vm->privateData; if (!(priv->perf = virPerfNew())) return -1; @@ -3820,12 +3820,12 @@ qemuDomainPerfRestart(virDomainObjPtr vm) static void -qemuProcessReconnectCheckMemAliasOrderMismatch(virDomainObjPtr vm) +qemuProcessReconnectCheckMemAliasOrderMismatch(virDomainObj *vm) { size_t i; int aliasidx; - virDomainDefPtr def = vm->def; - qemuDomainObjPrivatePtr priv = vm->privateData; + virDomainDef *def = vm->def; + qemuDomainObjPrivate *priv = vm->privateData; if (!virDomainDefHasMemoryHotplug(def) || def->nmems == 0) return; @@ -3842,8 +3842,8 @@ qemuProcessReconnectCheckMemAliasOrderMismatch(virDomainObjPtr vm) static bool -qemuProcessNeedHugepagesPath(virDomainDefPtr def, - virDomainMemoryDefPtr mem) +qemuProcessNeedHugepagesPath(virDomainDef *def, + virDomainMemoryDef *mem) { const long system_pagesize = virGetSystemPageSizeKB(); size_t i; @@ -3874,8 +3874,8 @@ qemuProcessNeedHugepagesPath(virDomainDefPtr def, static bool -qemuProcessNeedMemoryBackingPath(virDomainDefPtr def, - virDomainMemoryDefPtr mem) +qemuProcessNeedMemoryBackingPath(virDomainDef *def, + virDomainMemoryDef *mem) { size_t i; size_t numaNodes; @@ -3904,8 +3904,8 @@ qemuProcessNeedMemoryBackingPath(virDomainDefPtr def, static int -qemuProcessBuildDestroyMemoryPathsImpl(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessBuildDestroyMemoryPathsImpl(virQEMUDriver *driver, + virDomainObj *vm, const char *path, bool build) { @@ -3932,9 +3932,9 @@ qemuProcessBuildDestroyMemoryPathsImpl(virQEMUDriverPtr driver, int -qemuProcessBuildDestroyMemoryPaths(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem, +qemuProcessBuildDestroyMemoryPaths(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem, bool build) { @@ -3977,9 +3977,9 @@ qemuProcessBuildDestroyMemoryPaths(virQEMUDriverPtr driver, int -qemuProcessDestroyMemoryBackingPath(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem) +qemuProcessDestroyMemoryBackingPath(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem) { g_autofree char *path = NULL; @@ -3997,8 +3997,8 @@ qemuProcessDestroyMemoryBackingPath(virQEMUDriverPtr driver, static int -qemuProcessVNCAllocatePorts(virQEMUDriverPtr driver, - virDomainGraphicsDefPtr graphics, +qemuProcessVNCAllocatePorts(virQEMUDriver *driver, + virDomainGraphicsDef *graphics, bool allocate) { unsigned short port; @@ -4027,8 +4027,8 @@ qemuProcessVNCAllocatePorts(virQEMUDriverPtr driver, } static int -qemuProcessSPICEAllocatePorts(virQEMUDriverPtr driver, - virDomainGraphicsDefPtr graphics, +qemuProcessSPICEAllocatePorts(virQEMUDriver *driver, + virDomainGraphicsDef *graphics, bool allocate) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); @@ -4116,8 +4116,8 @@ qemuProcessSPICEAllocatePorts(virQEMUDriverPtr driver, static int -qemuProcessVerifyHypervFeatures(virDomainDefPtr def, - virCPUDataPtr cpu) +qemuProcessVerifyHypervFeatures(virDomainDef *def, + virCPUData *cpu) { size_t i; int rc; @@ -4193,8 +4193,8 @@ qemuProcessVerifyHypervFeatures(virDomainDefPtr def, static int -qemuProcessVerifyKVMFeatures(virDomainDefPtr def, - virCPUDataPtr cpu) +qemuProcessVerifyKVMFeatures(virDomainDef *def, + virCPUData *cpu) { int rc = 0; @@ -4215,8 +4215,8 @@ qemuProcessVerifyKVMFeatures(virDomainDefPtr def, static int -qemuProcessVerifyCPUFeatures(virDomainDefPtr def, - virCPUDataPtr cpu) +qemuProcessVerifyCPUFeatures(virDomainDef *def, + virCPUData *cpu) { int rc; @@ -4243,20 +4243,20 @@ static const char * qemuProcessTranslateCPUFeatures(const char *name, void *opaque) { - virQEMUCapsPtr qemuCaps = opaque; + virQEMUCaps *qemuCaps = opaque; return virQEMUCapsCPUFeatureFromQEMU(qemuCaps, name); } static int -qemuProcessFetchGuestCPU(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessFetchGuestCPU(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - virCPUDataPtr *enabled, - virCPUDataPtr *disabled) + virCPUData **enabled, + virCPUData **disabled) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virCPUData) dataEnabled = NULL; g_autoptr(virCPUData) dataDisabled = NULL; bool generic; @@ -4295,10 +4295,10 @@ qemuProcessFetchGuestCPU(virQEMUDriverPtr driver, static int -qemuProcessVerifyCPU(virDomainObjPtr vm, - virCPUDataPtr cpu) +qemuProcessVerifyCPU(virDomainObj *vm, + virCPUData *cpu) { - virDomainDefPtr def = vm->def; + virDomainDef *def = vm->def; if (!cpu) return 0; @@ -4320,12 +4320,12 @@ qemuProcessVerifyCPU(virDomainObjPtr vm, static int -qemuProcessUpdateLiveGuestCPU(virDomainObjPtr vm, - virCPUDataPtr enabled, - virCPUDataPtr disabled) +qemuProcessUpdateLiveGuestCPU(virDomainObj *vm, + virCPUData *enabled, + virCPUData *disabled) { - virDomainDefPtr def = vm->def; - qemuDomainObjPrivatePtr priv = vm->privateData; + virDomainDef *def = vm->def; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virCPUDef) orig = NULL; int rc; @@ -4357,12 +4357,12 @@ qemuProcessUpdateLiveGuestCPU(virDomainObjPtr vm, static int -qemuProcessUpdateAndVerifyCPU(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessUpdateAndVerifyCPU(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - virCPUDataPtr cpu = NULL; - virCPUDataPtr disabled = NULL; + virCPUData *cpu = NULL; + virCPUData *disabled = NULL; int ret = -1; if (qemuProcessFetchGuestCPU(driver, vm, asyncJob, &cpu, &disabled) < 0) @@ -4384,12 +4384,12 @@ qemuProcessUpdateAndVerifyCPU(virQEMUDriverPtr driver, static int -qemuProcessFetchCPUDefinitions(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessFetchCPUDefinitions(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - virDomainCapsCPUModelsPtr *cpuModels) + virDomainCapsCPUModels **cpuModels) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virDomainCapsCPUModels) models = NULL; int rc; @@ -4407,8 +4407,8 @@ qemuProcessFetchCPUDefinitions(virQEMUDriverPtr driver, static int -qemuProcessUpdateCPU(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessUpdateCPU(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { g_autoptr(virCPUData) cpu = NULL; @@ -4435,13 +4435,13 @@ qemuProcessUpdateCPU(virQEMUDriverPtr driver, static int -qemuPrepareNVRAM(virQEMUDriverConfigPtr cfg, - virDomainObjPtr vm) +qemuPrepareNVRAM(virQEMUDriverConfig *cfg, + virDomainObj *vm) { int ret = -1; int srcFD = -1; int dstFD = -1; - virDomainLoaderDefPtr loader = vm->def->os.loader; + virDomainLoaderDef *loader = vm->def->os.loader; bool created = false; const char *master_nvram_path; ssize_t r; @@ -4532,13 +4532,13 @@ qemuPrepareNVRAM(virQEMUDriverConfigPtr cfg, static void -qemuLogOperation(virDomainObjPtr vm, +qemuLogOperation(virDomainObj *vm, const char *msg, - virCommandPtr cmd, - qemuDomainLogContextPtr logCtxt) + virCommand *cmd, + qemuDomainLogContext *logCtxt) { g_autofree char *timestamp = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int qemuVersion = virQEMUCapsGetVersion(priv->qemuCaps); const char *package = virQEMUCapsGetPackage(priv->qemuCaps); g_autofree char *hostname = virGetHostname(); @@ -4568,7 +4568,7 @@ qemuLogOperation(virDomainObjPtr vm, void -qemuProcessIncomingDefFree(qemuProcessIncomingDefPtr inc) +qemuProcessIncomingDefFree(qemuProcessIncomingDef *inc) { if (!inc) return; @@ -4588,14 +4588,14 @@ qemuProcessIncomingDefFree(qemuProcessIncomingDefPtr inc) * The caller is responsible for closing @fd, calling * qemuProcessIncomingDefFree will NOT close it. */ -qemuProcessIncomingDefPtr -qemuProcessIncomingDefNew(virQEMUCapsPtr qemuCaps, +qemuProcessIncomingDef * +qemuProcessIncomingDefNew(virQEMUCaps *qemuCaps, const char *listenAddress, const char *migrateFrom, int fd, const char *path) { - qemuProcessIncomingDefPtr inc = NULL; + qemuProcessIncomingDef *inc = NULL; if (qemuMigrationDstCheckProtocol(qemuCaps, migrateFrom) < 0) return NULL; @@ -4631,8 +4631,8 @@ qemuProcessIncomingDefNew(virQEMUCapsPtr qemuCaps, * parameter between qemuProcessBeginJob and qemuProcessEndJob. */ int -qemuProcessBeginJob(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessBeginJob(virQEMUDriver *driver, + virDomainObj *vm, virDomainJobOperation operation, unsigned long apiFlags) { @@ -4646,20 +4646,20 @@ qemuProcessBeginJob(virQEMUDriverPtr driver, void -qemuProcessEndJob(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuProcessEndJob(virQEMUDriver *driver, + virDomainObj *vm) { qemuDomainObjEndAsyncJob(driver, vm); } static int -qemuProcessStartHook(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessStartHook(virQEMUDriver *driver, + virDomainObj *vm, virHookQemuOpType op, virHookSubopType subop) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *xml = NULL; int ret; @@ -4677,10 +4677,10 @@ qemuProcessStartHook(virQEMUDriverPtr driver, static int -qemuProcessGraphicsReservePorts(virDomainGraphicsDefPtr graphics, +qemuProcessGraphicsReservePorts(virDomainGraphicsDef *graphics, bool reconnect) { - virDomainGraphicsListenDefPtr glisten; + virDomainGraphicsListenDef *glisten; if (graphics->nListens <= 0) return 0; @@ -4734,11 +4734,11 @@ qemuProcessGraphicsReservePorts(virDomainGraphicsDefPtr graphics, static int -qemuProcessGraphicsAllocatePorts(virQEMUDriverPtr driver, - virDomainGraphicsDefPtr graphics, +qemuProcessGraphicsAllocatePorts(virQEMUDriver *driver, + virDomainGraphicsDef *graphics, bool allocate) { - virDomainGraphicsListenDefPtr glisten; + virDomainGraphicsListenDef *glisten; if (graphics->nListens <= 0) return 0; @@ -4778,10 +4778,10 @@ qemuProcessGetNetworkAddress(const char *netname, g_autoptr(virConnect) conn = NULL; int ret = -1; g_autoptr(virNetwork) net = NULL; - virNetworkDefPtr netdef = NULL; - virNetworkIPDefPtr ipdef; + virNetworkDef *netdef = NULL; + virNetworkIPDef *ipdef; virSocketAddr addr; - virSocketAddrPtr addrptr = NULL; + virSocketAddr *addrptr = NULL; char *dev_name = NULL; g_autofree char *xml = NULL; @@ -4868,7 +4868,7 @@ qemuProcessGetNetworkAddress(const char *netname, static int -qemuProcessGraphicsSetupNetworkAddress(virDomainGraphicsListenDefPtr glisten, +qemuProcessGraphicsSetupNetworkAddress(virDomainGraphicsListenDef *glisten, const char *listenAddr) { int rc; @@ -4894,11 +4894,11 @@ qemuProcessGraphicsSetupNetworkAddress(virDomainGraphicsListenDefPtr glisten, static int -qemuProcessGraphicsSetupListen(virQEMUDriverPtr driver, - virDomainGraphicsDefPtr graphics, - virDomainObjPtr vm) +qemuProcessGraphicsSetupListen(virQEMUDriver *driver, + virDomainGraphicsDef *graphics, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); const char *type = virDomainGraphicsTypeToString(graphics->type); char *listenAddr = NULL; @@ -4925,7 +4925,7 @@ qemuProcessGraphicsSetupListen(virQEMUDriverPtr driver, } for (i = 0; i < graphics->nListens; i++) { - virDomainGraphicsListenDefPtr glisten = &graphics->listens[i]; + virDomainGraphicsListenDef *glisten = &graphics->listens[i]; switch (glisten->type) { case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS: @@ -4974,8 +4974,8 @@ qemuProcessGraphicsSetupListen(virQEMUDriverPtr driver, static int -qemuProcessGraphicsSetupRenderNode(virDomainGraphicsDefPtr graphics, - virQEMUCapsPtr qemuCaps) +qemuProcessGraphicsSetupRenderNode(virDomainGraphicsDef *graphics, + virQEMUCaps *qemuCaps) { char **rendernode = NULL; @@ -5003,12 +5003,12 @@ qemuProcessGraphicsSetupRenderNode(virDomainGraphicsDefPtr graphics, static int -qemuProcessSetupGraphics(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virQEMUCapsPtr qemuCaps, +qemuProcessSetupGraphics(virQEMUDriver *driver, + virDomainObj *vm, + virQEMUCaps *qemuCaps, unsigned int flags) { - virDomainGraphicsDefPtr graphics; + virDomainGraphicsDef *graphics; bool allocate = !(flags & VIR_QEMU_PROCESS_START_PRETEND); size_t i; @@ -5043,9 +5043,9 @@ qemuProcessSetupGraphics(virQEMUDriverPtr driver, static int -qemuProcessSetupRawIO(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCommandPtr cmd G_GNUC_UNUSED) +qemuProcessSetupRawIO(virQEMUDriver *driver, + virDomainObj *vm, + virCommand *cmd G_GNUC_UNUSED) { bool rawio = false; size_t i; @@ -5054,7 +5054,7 @@ qemuProcessSetupRawIO(virQEMUDriverPtr driver, /* in case a certain disk is desirous of CAP_SYS_RAWIO, add this */ for (i = 0; i < vm->def->ndisks; i++) { virDomainDeviceDef dev; - virDomainDiskDefPtr disk = vm->def->disks[i]; + virDomainDiskDef *disk = vm->def->disks[i]; if (disk->rawio == VIR_TRISTATE_BOOL_YES) { rawio = true; @@ -5075,7 +5075,7 @@ qemuProcessSetupRawIO(virQEMUDriverPtr driver, /* If rawio not already set, check hostdevs as well */ if (!rawio) { for (i = 0; i < vm->def->nhostdevs; i++) { - virDomainHostdevSubsysSCSIPtr scsisrc; + virDomainHostdevSubsysSCSI *scsisrc; if (!virHostdevIsSCSIDevice(vm->def->hostdevs[i])) continue; @@ -5106,12 +5106,12 @@ qemuProcessSetupRawIO(virQEMUDriverPtr driver, static int -qemuProcessSetupBalloon(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessSetupBalloon(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { unsigned long long balloon = vm->def->mem.cur_balloon; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret = -1; if (!virDomainDefHasMemballoon(vm->def)) @@ -5136,8 +5136,8 @@ qemuProcessSetupBalloon(virQEMUDriverPtr driver, static int -qemuProcessMakeDir(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessMakeDir(virQEMUDriver *driver, + virDomainObj *vm, const char *path) { if (g_mkdir_with_parents(path, 0750) < 0) { @@ -5153,7 +5153,7 @@ qemuProcessMakeDir(virQEMUDriverPtr driver, static void -qemuProcessStartWarnShmem(virDomainObjPtr vm) +qemuProcessStartWarnShmem(virDomainObj *vm) { size_t i; bool check_shmem = false; @@ -5203,12 +5203,12 @@ qemuProcessStartWarnShmem(virDomainObjPtr vm) static int -qemuProcessStartValidateGraphics(virDomainObjPtr vm) +qemuProcessStartValidateGraphics(virDomainObj *vm) { size_t i; for (i = 0; i < vm->def->ngraphics; i++) { - virDomainGraphicsDefPtr graphics = vm->def->graphics[i]; + virDomainGraphicsDef *graphics = vm->def->graphics[i]; switch (graphics->type) { case VIR_DOMAIN_GRAPHICS_TYPE_VNC: @@ -5235,8 +5235,8 @@ qemuProcessStartValidateGraphics(virDomainObjPtr vm) static int -qemuProcessStartValidateIOThreads(virDomainObjPtr vm, - virQEMUCapsPtr qemuCaps) +qemuProcessStartValidateIOThreads(virDomainObj *vm, + virQEMUCaps *qemuCaps) { size_t i; @@ -5248,7 +5248,7 @@ qemuProcessStartValidateIOThreads(virDomainObjPtr vm, } for (i = 0; i < vm->def->ncontrollers; i++) { - virDomainControllerDefPtr cont = vm->def->controllers[i]; + virDomainControllerDef *cont = vm->def->controllers[i]; if (cont->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI && cont->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI && @@ -5266,12 +5266,12 @@ qemuProcessStartValidateIOThreads(virDomainObjPtr vm, static int -qemuProcessStartValidateShmem(virDomainObjPtr vm) +qemuProcessStartValidateShmem(virDomainObj *vm) { size_t i; for (i = 0; i < vm->def->nshmems; i++) { - virDomainShmemDefPtr shmem = vm->def->shmems[i]; + virDomainShmemDef *shmem = vm->def->shmems[i]; if (strchr(shmem->name, '/')) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -5286,14 +5286,14 @@ qemuProcessStartValidateShmem(virDomainObjPtr vm) static int -qemuProcessStartValidateDisks(virDomainObjPtr vm, - virQEMUCapsPtr qemuCaps) +qemuProcessStartValidateDisks(virDomainObj *vm, + virQEMUCaps *qemuCaps) { size_t i; for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; - virStorageSourcePtr src = disk->src; + virDomainDiskDef *disk = vm->def->disks[i]; + virStorageSource *src = disk->src; /* This is a best effort check as we can only check if the command * option exists, but we cannot determine whether the running QEMU @@ -5331,19 +5331,19 @@ qemuProcessStartValidateDisks(virDomainObjPtr vm, #define TSC_TOLERANCE 250 static int -qemuProcessStartValidateTSC(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuProcessStartValidateTSC(virQEMUDriver *driver, + virDomainObj *vm) { size_t i; unsigned long long freq = 0; unsigned long long tolerance; unsigned long long minFreq; unsigned long long maxFreq; - virHostCPUTscInfoPtr tsc; + virHostCPUTscInfo *tsc; g_autoptr(virCPUDef) cpu = NULL; for (i = 0; i < vm->def->clock.ntimers; i++) { - virDomainTimerDefPtr timer = vm->def->clock.timers[i]; + virDomainTimerDef *timer = vm->def->clock.timers[i]; if (timer->name == VIR_DOMAIN_TIMER_NAME_TSC && timer->frequency > 0) { @@ -5409,9 +5409,9 @@ qemuProcessStartValidateTSC(virQEMUDriverPtr driver, * executed in this case, make sure to check this flag. */ static int -qemuProcessStartValidate(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virQEMUCapsPtr qemuCaps, +qemuProcessStartValidate(virQEMUDriver *driver, + virDomainObj *vm, + virQEMUCaps *qemuCaps, unsigned int flags) { if (!(flags & VIR_QEMU_PROCESS_START_PRETEND)) { @@ -5491,11 +5491,11 @@ qemuProcessStartValidate(virQEMUDriverPtr driver, static int -qemuProcessStartUpdateCustomCaps(virDomainObjPtr vm) +qemuProcessStartUpdateCustomCaps(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(priv->driver); - qemuDomainXmlNsDefPtr nsdef = vm->def->namespaceData; + qemuDomainXmlNsDef *nsdef = vm->def->namespaceData; char **next; int tmp; size_t i; @@ -5554,11 +5554,11 @@ qemuProcessStartUpdateCustomCaps(virDomainObjPtr vm) * Returns 0 on success, -1 on error. */ static int -qemuProcessPrepareQEMUCaps(virDomainObjPtr vm, - virFileCachePtr qemuCapsCache, +qemuProcessPrepareQEMUCaps(virDomainObj *vm, + virFileCache *qemuCapsCache, unsigned int processStartFlags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virObjectUnref(priv->qemuCaps); if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(qemuCapsCache, @@ -5594,16 +5594,16 @@ qemuProcessPrepareQEMUCaps(virDomainObjPtr vm, * Returns 0 on success, -1 on error. */ int -qemuProcessInit(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCPUDefPtr updatedCPU, +qemuProcessInit(virQEMUDriver *driver, + virDomainObj *vm, + virCPUDef *updatedCPU, qemuDomainAsyncJob asyncJob, bool migration, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int stopFlags; - virCPUDefPtr origCPU = NULL; + virCPUDef *origCPU = NULL; int ret = -1; VIR_DEBUG("vm=%p name=%s id=%d migration=%d", @@ -5692,16 +5692,16 @@ qemuProcessInit(virQEMUDriverPtr driver, * qemuProcessNetworkPrepareDevices */ static int -qemuProcessNetworkPrepareDevices(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuProcessNetworkPrepareDevices(virQEMUDriver *driver, + virDomainObj *vm) { - virDomainDefPtr def = vm->def; - qemuDomainObjPrivatePtr priv = vm->privateData; + virDomainDef *def = vm->def; + qemuDomainObjPrivate *priv = vm->privateData; size_t i; g_autoptr(virConnect) conn = NULL; for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; virDomainNetType actualType; /* If appropriate, grab a physical device from the configured @@ -5725,8 +5725,8 @@ qemuProcessNetworkPrepareDevices(virQEMUDriverPtr driver, * network / determined at runtime, we need to do it * separately. */ - virDomainHostdevDefPtr hostdev = virDomainNetGetActualHostdev(net); - virDomainHostdevSubsysPCIPtr pcisrc = &hostdev->source.subsys.u.pci; + virDomainHostdevDef *hostdev = virDomainNetGetActualHostdev(net); + virDomainHostdevSubsysPCI *pcisrc = &hostdev->source.subsys.u.pci; if (virDomainHostdevFind(def, hostdev, NULL) >= 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -5743,7 +5743,7 @@ qemuProcessNetworkPrepareDevices(virQEMUDriverPtr driver, } else if (actualType == VIR_DOMAIN_NET_TYPE_USER && !priv->disableSlirp && virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) { - qemuSlirpPtr slirp = NULL; + qemuSlirp *slirp = NULL; int rv = qemuInterfacePrepareSlirp(driver, net, &slirp); if (rv == -1) @@ -5769,12 +5769,12 @@ qemuProcessNetworkPrepareDevices(virQEMUDriverPtr driver, * Returns 0 on success, -1 on error. */ int -qemuProcessSetupVcpu(virDomainObjPtr vm, +qemuProcessSetupVcpu(virDomainObj *vm, unsigned int vcpuid) { pid_t vcpupid = qemuDomainGetVcpuPid(vm, vcpuid); - virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(vm->def, vcpuid); - virDomainResctrlMonDefPtr mon = NULL; + virDomainVcpuDef *vcpu = virDomainDefGetVcpu(vm->def, vcpuid); + virDomainResctrlMonDef *mon = NULL; size_t i = 0; if (qemuProcessSetupPid(vm, vcpupid, VIR_CGROUP_THREAD_VCPU, @@ -5786,7 +5786,7 @@ qemuProcessSetupVcpu(virDomainObjPtr vm, for (i = 0; i < vm->def->nresctrls; i++) { size_t j = 0; - virDomainResctrlDefPtr ct = vm->def->resctrls[i]; + virDomainResctrlDef *ct = vm->def->resctrls[i]; if (virBitmapIsBitSet(ct->vcpus, vcpuid)) { if (virResctrlAllocAddPID(ct->alloc, vcpupid) < 0) @@ -5815,14 +5815,14 @@ qemuProcessSetupVcpu(virDomainObjPtr vm, static int -qemuProcessSetupVcpus(virDomainObjPtr vm) +qemuProcessSetupVcpus(virDomainObj *vm) { - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; unsigned int maxvcpus = virDomainDefGetVcpusMax(vm->def); size_t i; if ((vm->def->cputune.period || vm->def->cputune.quota) && - !virCgroupHasController(((qemuDomainObjPrivatePtr) vm->privateData)->cgroup, + !virCgroupHasController(((qemuDomainObjPrivate *) vm->privateData)->cgroup, VIR_CGROUP_CONTROLLER_CPU)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("cgroup cpu is required for scheduler tuning")); @@ -5864,8 +5864,8 @@ qemuProcessSetupVcpus(virDomainObjPtr vm) int -qemuProcessSetupIOThread(virDomainObjPtr vm, - virDomainIOThreadIDDefPtr iothread) +qemuProcessSetupIOThread(virDomainObj *vm, + virDomainIOThreadIDDef *iothread) { return qemuProcessSetupPid(vm, iothread->thread_id, VIR_CGROUP_THREAD_IOTHREAD, @@ -5878,12 +5878,12 @@ qemuProcessSetupIOThread(virDomainObjPtr vm, static int -qemuProcessSetupIOThreads(virDomainObjPtr vm) +qemuProcessSetupIOThreads(virDomainObj *vm) { size_t i; for (i = 0; i < vm->def->niothreadids; i++) { - virDomainIOThreadIDDefPtr info = vm->def->iothreadids[i]; + virDomainIOThreadIDDef *info = vm->def->iothreadids[i]; if (qemuProcessSetupIOThread(vm, info) < 0) return -1; @@ -5894,15 +5894,15 @@ qemuProcessSetupIOThreads(virDomainObjPtr vm) static int -qemuProcessValidateHotpluggableVcpus(virDomainDefPtr def) +qemuProcessValidateHotpluggableVcpus(virDomainDef *def) { - virDomainVcpuDefPtr vcpu; - virDomainVcpuDefPtr subvcpu; - qemuDomainVcpuPrivatePtr vcpupriv; + virDomainVcpuDef *vcpu; + virDomainVcpuDef *subvcpu; + qemuDomainVcpuPrivate *vcpupriv; unsigned int maxvcpus = virDomainDefGetVcpusMax(def); size_t i = 0; size_t j; - virBitmapPtr ordermap = virBitmapNew(maxvcpus + 1); + virBitmap *ordermap = virBitmapNew(maxvcpus + 1); int ret = -1; /* validate: @@ -5964,10 +5964,10 @@ qemuProcessValidateHotpluggableVcpus(virDomainDefPtr def) static int -qemuDomainHasHotpluggableStartupVcpus(virDomainDefPtr def) +qemuDomainHasHotpluggableStartupVcpus(virDomainDef *def) { size_t maxvcpus = virDomainDefGetVcpusMax(def); - virDomainVcpuDefPtr vcpu; + virDomainVcpuDef *vcpu; size_t i; for (i = 0; i < maxvcpus; i++) { @@ -5985,29 +5985,29 @@ static int qemuProcessVcpusSortOrder(const void *a, const void *b) { - virDomainVcpuDefPtr vcpua = *((virDomainVcpuDefPtr *)a); - virDomainVcpuDefPtr vcpub = *((virDomainVcpuDefPtr *)b); + virDomainVcpuDef *vcpua = *((virDomainVcpuDef **)a); + virDomainVcpuDef *vcpub = *((virDomainVcpuDef **)b); return vcpua->order - vcpub->order; } static int -qemuProcessSetupHotpluggableVcpus(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessSetupHotpluggableVcpus(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { unsigned int maxvcpus = virDomainDefGetVcpusMax(vm->def); - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuCgroupEmulatorAllNodesDataPtr emulatorCgroup = NULL; - virDomainVcpuDefPtr vcpu; - qemuDomainVcpuPrivatePtr vcpupriv; - virJSONValuePtr vcpuprops = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + qemuCgroupEmulatorAllNodesData *emulatorCgroup = NULL; + virDomainVcpuDef *vcpu; + qemuDomainVcpuPrivate *vcpupriv; + virJSONValue *vcpuprops = NULL; size_t i; int ret = -1; int rc; - virDomainVcpuDefPtr *bootHotplug = NULL; + virDomainVcpuDef **bootHotplug = NULL; size_t nbootHotplug = 0; for (i = 0; i < maxvcpus; i++) { @@ -6086,8 +6086,8 @@ qemuProcessDropUnknownCPUFeatures(const char *name, static int -qemuProcessUpdateGuestCPU(virDomainDefPtr def, - virQEMUCapsPtr qemuCaps, +qemuProcessUpdateGuestCPU(virDomainDef *def, + virQEMUCaps *qemuCaps, virArch hostarch, unsigned int flags) { @@ -6126,7 +6126,7 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, return -1; if (def->cpu->check != VIR_CPU_CHECK_NONE) { - virCPUDefPtr host; + virCPUDef *host; host = virQEMUCapsGetHostModel(qemuCaps, def->virtType, VIR_QEMU_CAPS_HOST_CPU_FULL); @@ -6181,9 +6181,9 @@ qemuProcessUpdateGuestCPU(virDomainDefPtr def, static int -qemuProcessPrepareDomainNUMAPlacement(virDomainObjPtr vm) +qemuProcessPrepareDomainNUMAPlacement(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *nodeset = NULL; g_autoptr(virBitmap) numadNodeset = NULL; g_autoptr(virBitmap) hostMemoryNodeset = NULL; @@ -6227,10 +6227,10 @@ qemuProcessPrepareDomainNUMAPlacement(virDomainObjPtr vm) static int -qemuProcessPrepareDomainStorage(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuDomainObjPrivatePtr priv, - virQEMUDriverConfigPtr cfg, +qemuProcessPrepareDomainStorage(virQEMUDriver *driver, + virDomainObj *vm, + qemuDomainObjPrivate *priv, + virQEMUDriverConfig *cfg, unsigned int flags) { size_t i; @@ -6238,7 +6238,7 @@ qemuProcessPrepareDomainStorage(virQEMUDriverPtr driver, for (i = vm->def->ndisks; i > 0; i--) { size_t idx = i - 1; - virDomainDiskDefPtr disk = vm->def->disks[idx]; + virDomainDiskDef *disk = vm->def->disks[idx]; if (virDomainDiskTranslateSourcePool(disk) < 0) { if (qemuDomainCheckDiskStartupPolicy(driver, vm, idx, cold_boot) < 0) @@ -6257,13 +6257,13 @@ qemuProcessPrepareDomainStorage(virQEMUDriverPtr driver, static int -qemuProcessPrepareDomainHostdevs(virDomainObjPtr vm, - qemuDomainObjPrivatePtr priv) +qemuProcessPrepareDomainHostdevs(virDomainObj *vm, + qemuDomainObjPrivate *priv) { size_t i; for (i = 0; i < vm->def->nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = vm->def->hostdevs[i]; + virDomainHostdevDef *hostdev = vm->def->hostdevs[i]; if (qemuDomainPrepareHostdev(hostdev, priv) < 0) return -1; @@ -6274,15 +6274,15 @@ qemuProcessPrepareDomainHostdevs(virDomainObjPtr vm, int -qemuProcessPrepareHostHostdev(virDomainHostdevDefPtr hostdev) +qemuProcessPrepareHostHostdev(virDomainHostdevDef *hostdev) { if (virHostdevIsSCSIDevice(hostdev)) { - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; switch ((virDomainHostdevSCSIProtocolType) scsisrc->protocol) { case VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_NONE: { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; - virStorageSourcePtr src = scsisrc->u.host.src; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; + virStorageSource *src = scsisrc->u.host.src; g_autofree char *devstr = NULL; if (!(devstr = virSCSIDeviceGetSgName(NULL, @@ -6311,12 +6311,12 @@ qemuProcessPrepareHostHostdev(virDomainHostdevDefPtr hostdev) static int -qemuProcessPrepareHostHostdevs(virDomainObjPtr vm) +qemuProcessPrepareHostHostdevs(virDomainObj *vm) { size_t i; for (i = 0; i < vm->def->nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = vm->def->hostdevs[i]; + virDomainHostdevDef *hostdev = vm->def->hostdevs[i]; if (qemuProcessPrepareHostHostdev(hostdev) < 0) return -1; @@ -6327,10 +6327,10 @@ qemuProcessPrepareHostHostdevs(virDomainObjPtr vm) static void -qemuProcessPrepareAllowReboot(virDomainObjPtr vm) +qemuProcessPrepareAllowReboot(virDomainObj *vm) { - virDomainDefPtr def = vm->def; - qemuDomainObjPrivatePtr priv = vm->privateData; + virDomainDef *def = vm->def; + qemuDomainObjPrivate *priv = vm->privateData; if (priv->allowReboot != VIR_TRISTATE_BOOL_ABSENT) return; @@ -6347,12 +6347,12 @@ qemuProcessPrepareAllowReboot(virDomainObjPtr vm) static int -qemuProcessUpdateSEVInfo(virDomainObjPtr vm) +qemuProcessUpdateSEVInfo(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUCapsPtr qemuCaps = priv->qemuCaps; - virDomainSEVDefPtr sev = vm->def->sev; - virSEVCapabilityPtr sevCaps = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUCaps *qemuCaps = priv->qemuCaps; + virDomainSEVDef *sev = vm->def->sev; + virSEVCapability *sevCaps = NULL; /* if platform specific info like 'cbitpos' and 'reducedPhysBits' have * not been supplied, we need to autofill them from caps now as both are @@ -6389,12 +6389,12 @@ qemuProcessUpdateSEVInfo(virDomainObjPtr vm) * TODO: move all XML modification from qemuBuildCommandLine into this function */ int -qemuProcessPrepareDomain(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessPrepareDomain(virQEMUDriver *driver, + virDomainObj *vm, unsigned int flags) { size_t i; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); priv->machineName = qemuDomainGetMachineName(vm); @@ -6518,12 +6518,12 @@ qemuProcessPrepareDomain(virQEMUDriverPtr driver, static int -qemuProcessSEVCreateFile(virDomainObjPtr vm, +qemuProcessSEVCreateFile(virDomainObj *vm, const char *name, const char *data) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autofree char *configFile = NULL; if (!(configFile = virFileBuildPath(priv->libDir, name, ".base64"))) @@ -6543,9 +6543,9 @@ qemuProcessSEVCreateFile(virDomainObjPtr vm, static int -qemuProcessPrepareSEVGuestInput(virDomainObjPtr vm) +qemuProcessPrepareSEVGuestInput(virDomainObj *vm) { - virDomainSEVDefPtr sev = vm->def->sev; + virDomainSEVDef *sev = vm->def->sev; if (!sev) return 0; @@ -6567,18 +6567,18 @@ qemuProcessPrepareSEVGuestInput(virDomainObjPtr vm) static int -qemuProcessPrepareHostStorage(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessPrepareHostStorage(virQEMUDriver *driver, + virDomainObj *vm, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; size_t i; bool cold_boot = flags & VIR_QEMU_PROCESS_START_COLD; bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); for (i = vm->def->ndisks; i > 0; i--) { size_t idx = i - 1; - virDomainDiskDefPtr disk = vm->def->disks[idx]; + virDomainDiskDef *disk = vm->def->disks[idx]; if (virStorageSourceIsEmpty(disk->src)) continue; @@ -6609,9 +6609,9 @@ qemuProcessPrepareHostStorage(virQEMUDriverPtr driver, int -qemuProcessOpenVhostVsock(virDomainVsockDefPtr vsock) +qemuProcessOpenVhostVsock(virDomainVsockDef *vsock) { - qemuDomainVsockPrivatePtr priv = (qemuDomainVsockPrivatePtr)vsock->privateData; + qemuDomainVsockPrivate *priv = (qemuDomainVsockPrivate *)vsock->privateData; const char *vsock_path = "/dev/vhost-vsock"; int fd; @@ -6651,12 +6651,12 @@ qemuProcessOpenVhostVsock(virDomainVsockDefPtr vsock) * TODO: move all host modification from qemuBuildCommandLine into this function */ int -qemuProcessPrepareHost(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessPrepareHost(virQEMUDriver *driver, + virDomainObj *vm, unsigned int flags) { unsigned int hostdev_flags = 0; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); if (qemuPrepareNVRAM(cfg, vm) < 0) @@ -6764,7 +6764,7 @@ qemuProcessPrepareHost(virQEMUDriverPtr driver, * something that has already been executed before. */ static int -qemuProcessGenID(virDomainObjPtr vm, +qemuProcessGenID(virDomainObj *vm, unsigned int flags) { if (!vm->def->genidRequested) @@ -6794,11 +6794,11 @@ qemuProcessGenID(virDomainObjPtr vm, * Same hack is done in qemuDomainAttachDiskGeneric. */ static int -qemuProcessSetupDiskThrottlingBlockdev(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessSetupDiskThrottlingBlockdev(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; size_t i; int ret = -1; @@ -6811,8 +6811,8 @@ qemuProcessSetupDiskThrottlingBlockdev(virQEMUDriverPtr driver, return -1; for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; - qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + virDomainDiskDef *disk = vm->def->disks[i]; + qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); /* sd-cards are instantiated via -drive */ if (qemuDiskBusIsSD(disk->bus)) @@ -6841,8 +6841,8 @@ qemuProcessSetupDiskThrottlingBlockdev(virQEMUDriverPtr driver, static int -qemuProcessEnableDomainNamespaces(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuProcessEnableDomainNamespaces(virQEMUDriver *driver, + virDomainObj *vm) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); @@ -6855,9 +6855,9 @@ qemuProcessEnableDomainNamespaces(virQEMUDriverPtr driver, static int -qemuProcessEnablePerf(virDomainObjPtr vm) +qemuProcessEnablePerf(virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; size_t i; if (!(priv->perf = virPerfNew())) @@ -6888,11 +6888,11 @@ qemuProcessEnablePerf(virDomainObjPtr vm) */ int qemuProcessLaunch(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, + virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - qemuProcessIncomingDefPtr incoming, - virDomainMomentObjPtr snapshot, + qemuProcessIncomingDef *incoming, + virDomainMomentObj *snapshot, virNetDevVPortProfileOp vmop, unsigned int flags) { @@ -6900,7 +6900,7 @@ qemuProcessLaunch(virConnectPtr conn, int rv; int logfile = -1; g_autoptr(qemuDomainLogContext) logCtxt = NULL; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virCommand) cmd = NULL; struct qemuProcessHookData hookData; g_autoptr(virQEMUDriverConfig) cfg = NULL; @@ -7248,11 +7248,11 @@ qemuProcessLaunch(virConnectPtr conn, * state influenced by the migration stream. */ int -qemuProcessRefreshState(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessRefreshState(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; VIR_DEBUG("Fetching list of active devices"); if (qemuDomainUpdateDeviceList(driver, vm, asyncJob) < 0) @@ -7283,8 +7283,8 @@ qemuProcessRefreshState(virQEMUDriverPtr driver, * Finish starting a new domain. */ int -qemuProcessFinishStartup(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessFinishStartup(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, bool startCPUs, virDomainPausedReason pausedReason) @@ -7320,19 +7320,19 @@ qemuProcessFinishStartup(virQEMUDriverPtr driver, int qemuProcessStart(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCPUDefPtr updatedCPU, + virQEMUDriver *driver, + virDomainObj *vm, + virCPUDef *updatedCPU, qemuDomainAsyncJob asyncJob, const char *migrateFrom, int migrateFd, const char *migratePath, - virDomainMomentObjPtr snapshot, + virDomainMomentObj *snapshot, virNetDevVPortProfileOp vmop, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; - qemuProcessIncomingDefPtr incoming = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + qemuProcessIncomingDef *incoming = NULL; unsigned int stopFlags; bool relabel = false; bool relabelSavedState = false; @@ -7436,8 +7436,8 @@ qemuProcessStart(virConnectPtr conn, int -qemuProcessCreatePretendCmdPrepare(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessCreatePretendCmdPrepare(virQEMUDriver *driver, + virDomainObj *vm, const char *migrateURI, bool standalone, unsigned int flags) @@ -7465,9 +7465,9 @@ qemuProcessCreatePretendCmdPrepare(virQEMUDriverPtr driver, } -virCommandPtr -qemuProcessCreatePretendCmdBuild(virQEMUDriverPtr driver, - virDomainObjPtr vm, +virCommand * +qemuProcessCreatePretendCmdBuild(virQEMUDriver *driver, + virDomainObj *vm, const char *migrateURI, bool enableFips, bool standalone, @@ -7495,7 +7495,7 @@ qemuProcessCreatePretendCmdBuild(virQEMUDriverPtr driver, int -qemuProcessKill(virDomainObjPtr vm, unsigned int flags) +qemuProcessKill(virDomainObj *vm, unsigned int flags) { VIR_DEBUG("vm=%p name=%s pid=%lld flags=0x%x", vm, vm->def->name, @@ -7530,12 +7530,12 @@ qemuProcessKill(virDomainObjPtr vm, unsigned int flags) * qemuProcessStop. */ int -qemuProcessBeginStopJob(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessBeginStopJob(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainJob job, bool forceKill) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; unsigned int killFlags = forceKill ? VIR_QEMU_PROCESS_KILL_FORCE : 0; int ret = -1; @@ -7562,17 +7562,17 @@ qemuProcessBeginStopJob(virQEMUDriverPtr driver, } -void qemuProcessStop(virQEMUDriverPtr driver, - virDomainObjPtr vm, +void qemuProcessStop(virQEMUDriver *driver, + virDomainObj *vm, virDomainShutoffReason reason, qemuDomainAsyncJob asyncJob, unsigned int flags) { int ret; int retries = 0; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virErrorPtr orig_err; - virDomainDefPtr def = vm->def; + virDomainDef *def = vm->def; const virNetDevVPortProfile *vport = NULL; size_t i; g_autofree char *timestamp = NULL; @@ -7627,7 +7627,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, if (cfg->macFilter) { for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; if (net->ifname == NULL) continue; ignore_value(ebtablesRemoveForwardAllowIn(driver->ebtables, @@ -7707,7 +7707,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, for (i = 0; i < vm->def->ndisks; i++) { virDomainDeviceDef dev; - virDomainDiskDefPtr disk = vm->def->disks[i]; + virDomainDiskDef *disk = vm->def->disks[i]; dev.type = VIR_DOMAIN_DEVICE_DISK; dev.data.disk = disk; @@ -7724,7 +7724,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, qemuHostdevReAttachDomainDevices(driver, vm->def); for (i = 0; i < def->nnets; i++) { - virDomainNetDefPtr net = def->nets[i]; + virDomainNetDef *net = def->nets[i]; vport = virDomainNetGetActualVirtPortProfile(net); switch (virDomainNetGetActualType(net)) { @@ -7802,7 +7802,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, size_t j = 0; for (j = 0; j < vm->def->resctrls[i]->nmonitors; j++) { - virDomainResctrlMonDefPtr mon = NULL; + virDomainResctrlMonDef *mon = NULL; mon = vm->def->resctrls[i]->monitors[j]; virResctrlMonitorRemove(mon->instance); @@ -7817,7 +7817,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, they were reserved by the driver (autoport=yes) */ for (i = 0; i < vm->def->ngraphics; ++i) { - virDomainGraphicsDefPtr graphics = vm->def->graphics[i]; + virDomainGraphicsDef *graphics = vm->def->graphics[i]; if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) { if (graphics->data.vnc.autoport) { virPortAllocatorRelease(graphics->data.vnc.port); @@ -7871,7 +7871,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, * is no longer running. */ if (!(flags & VIR_QEMU_PROCESS_STOP_NO_RELABEL)) { for (i = 0; i < def->ndisks; i++) { - virDomainDiskDefPtr disk = def->disks[i]; + virDomainDiskDef *disk = def->disks[i]; if (disk->mirror) { if (qemuSecurityRestoreImageLabel(driver, vm, disk->mirror, false) < 0) @@ -7924,13 +7924,13 @@ void qemuProcessStop(virQEMUDriverPtr driver, static void -qemuProcessAutoDestroy(virDomainObjPtr dom, +qemuProcessAutoDestroy(virDomainObj *dom, virConnectPtr conn, void *opaque) { - virQEMUDriverPtr driver = opaque; - qemuDomainObjPrivatePtr priv = dom->privateData; - virObjectEventPtr event = NULL; + virQEMUDriver *driver = opaque; + qemuDomainObjPrivate *priv = dom->privateData; + virObjectEvent *event = NULL; unsigned int stopFlags = 0; VIR_DEBUG("vm=%s, conn=%p", dom->def->name, conn); @@ -7964,8 +7964,8 @@ qemuProcessAutoDestroy(virDomainObjPtr dom, virObjectEventStateQueue(driver->domainEventState, event); } -int qemuProcessAutoDestroyAdd(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessAutoDestroyAdd(virQEMUDriver *driver, + virDomainObj *vm, virConnectPtr conn) { VIR_DEBUG("vm=%s, conn=%p", vm->def->name, conn); @@ -7973,16 +7973,16 @@ int qemuProcessAutoDestroyAdd(virQEMUDriverPtr driver, qemuProcessAutoDestroy); } -int qemuProcessAutoDestroyRemove(virQEMUDriverPtr driver, - virDomainObjPtr vm) +int qemuProcessAutoDestroyRemove(virQEMUDriver *driver, + virDomainObj *vm) { VIR_DEBUG("vm=%s", vm->def->name); return virCloseCallbacksUnset(driver->closeCallbacks, vm, qemuProcessAutoDestroy); } -bool qemuProcessAutoDestroyActive(virQEMUDriverPtr driver, - virDomainObjPtr vm) +bool qemuProcessAutoDestroyActive(virQEMUDriver *driver, + virDomainObj *vm) { virCloseCallback cb; VIR_DEBUG("vm=%s", vm->def->name); @@ -7992,11 +7992,11 @@ bool qemuProcessAutoDestroyActive(virQEMUDriverPtr driver, int -qemuProcessRefreshDisks(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessRefreshDisks(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); GHashTable *table = NULL; int ret = -1; @@ -8012,8 +8012,8 @@ qemuProcessRefreshDisks(virQEMUDriverPtr driver, goto cleanup; for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; - qemuDomainDiskPrivatePtr diskpriv = QEMU_DOMAIN_DISK_PRIVATE(disk); + virDomainDiskDef *disk = vm->def->disks[i]; + qemuDomainDiskPrivate *diskpriv = QEMU_DOMAIN_DISK_PRIVATE(disk); struct qemuDomainDiskInfo *info; const char *entryname = disk->info.alias; @@ -8049,12 +8049,12 @@ qemuProcessRefreshDisks(virQEMUDriverPtr driver, static int -qemuProcessRefreshCPUMigratability(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuProcessRefreshCPUMigratability(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virDomainDefPtr def = vm->def; + qemuDomainObjPrivate *priv = vm->privateData; + virDomainDef *def = vm->def; bool migratable; int rc; @@ -8096,10 +8096,10 @@ qemuProcessRefreshCPUMigratability(virQEMUDriverPtr driver, static int -qemuProcessRefreshCPU(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuProcessRefreshCPU(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virCPUDef) host = NULL; g_autoptr(virCPUDef) hostmig = NULL; g_autoptr(virCPUDef) cpu = NULL; @@ -8167,12 +8167,12 @@ qemuProcessRefreshLegacyBlockjob(void *payload, void *opaque) { const char *jobname = name; - virDomainObjPtr vm = opaque; - qemuMonitorBlockJobInfoPtr info = payload; - virDomainDiskDefPtr disk; - qemuBlockJobDataPtr job; + virDomainObj *vm = opaque; + qemuMonitorBlockJobInfo *info = payload; + virDomainDiskDef *disk; + qemuBlockJobData *job; qemuBlockJobType jobtype = info->type; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (!(disk = qemuProcessFindDomainDiskByAliasOrQOM(vm, jobname, jobname))) { VIR_DEBUG("could not find disk for block job '%s'", jobname); @@ -8224,8 +8224,8 @@ qemuProcessRefreshLegacyBlockjob(void *payload, static int -qemuProcessRefreshLegacyBlockjobs(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuProcessRefreshLegacyBlockjobs(virQEMUDriver *driver, + virDomainObj *vm) { GHashTable *blockJobs = NULL; int ret = -1; @@ -8247,10 +8247,10 @@ qemuProcessRefreshLegacyBlockjobs(virQEMUDriverPtr driver, static int -qemuProcessRefreshBlockjobs(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuProcessRefreshBlockjobs(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV)) return qemuBlockJobRefreshJobs(driver, vm); @@ -8260,9 +8260,9 @@ qemuProcessRefreshBlockjobs(virQEMUDriverPtr driver, struct qemuProcessReconnectData { - virQEMUDriverPtr driver; - virDomainObjPtr obj; - virIdentityPtr identity; + virQEMUDriver *driver; + virDomainObj *obj; + virIdentity *identity; }; /* * Open an existing VM's monitor, re-detect VCPU threads @@ -8286,9 +8286,9 @@ static void qemuProcessReconnect(void *opaque) { struct qemuProcessReconnectData *data = opaque; - virQEMUDriverPtr driver = data->driver; - virDomainObjPtr obj = data->obj; - qemuDomainObjPrivatePtr priv; + virQEMUDriver *driver = data->driver; + virDomainObj *obj = data->obj; + qemuDomainObjPrivate *priv; g_auto(qemuDomainJobObj) oldjob = { .cb = NULL, }; @@ -8371,7 +8371,7 @@ qemuProcessReconnect(void *opaque) * qemu_driver->sharedDevices. */ for (i = 0; i < obj->def->ndisks; i++) { - virDomainDiskDefPtr disk = obj->def->disks[i]; + virDomainDiskDef *disk = obj->def->disks[i]; virDomainDeviceDef dev; if (virDomainDiskTranslateSourcePool(disk) < 0) @@ -8509,7 +8509,7 @@ qemuProcessReconnect(void *opaque) goto error; for (j = 0; j < obj->def->resctrls[i]->nmonitors; j++) { - virDomainResctrlMonDefPtr mon = NULL; + virDomainResctrlMonDef *mon = NULL; mon = obj->def->resctrls[i]->monitors[j]; if (virResctrlMonitorDeterminePath(mon->instance, @@ -8586,7 +8586,7 @@ qemuProcessReconnect(void *opaque) } static int -qemuProcessReconnectHelper(virDomainObjPtr obj, +qemuProcessReconnectHelper(virDomainObj *obj, void *opaque) { virThread thread; @@ -8644,7 +8644,7 @@ qemuProcessReconnectHelper(virDomainObjPtr obj, * about. */ void -qemuProcessReconnectAll(virQEMUDriverPtr driver) +qemuProcessReconnectAll(virQEMUDriver *driver) { struct qemuProcessReconnectData data = {.driver = driver}; virDomainObjListForEach(driver->domains, true, @@ -8652,8 +8652,8 @@ qemuProcessReconnectAll(virQEMUDriverPtr driver) } -static void virQEMUCapsMonitorNotify(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm G_GNUC_UNUSED, +static void virQEMUCapsMonitorNotify(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { } @@ -8665,7 +8665,7 @@ static qemuMonitorCallbacks callbacks = { static void -qemuProcessQMPStop(qemuProcessQMPPtr proc) +qemuProcessQMPStop(qemuProcessQMP *proc) { if (proc->mon) { virObjectUnlock(proc->mon); @@ -8709,7 +8709,7 @@ qemuProcessQMPStop(qemuProcessQMPPtr proc) * Kill QEMU process and free process data structure. */ void -qemuProcessQMPFree(qemuProcessQMPPtr proc) +qemuProcessQMPFree(qemuProcessQMP *proc) { if (!proc) return; @@ -8740,7 +8740,7 @@ qemuProcessQMPFree(qemuProcessQMPPtr proc) * Allocate and initialize domain structure encapsulating QEMU process state * and monitor connection for completing QMP queries. */ -qemuProcessQMPPtr +qemuProcessQMP * qemuProcessQMPNew(const char *binary, const char *libDir, uid_t runUid, @@ -8778,7 +8778,7 @@ qemuProcessQMPNew(const char *binary, static int -qemuProcessQEMULabelUniqPath(qemuProcessQMPPtr proc) +qemuProcessQEMULabelUniqPath(qemuProcessQMP *proc) { /* We cannot use the security driver here, but we should not need to. */ if (chown(proc->uniqDir, proc->runUid, -1) < 0) { @@ -8793,7 +8793,7 @@ qemuProcessQEMULabelUniqPath(qemuProcessQMPPtr proc) static int -qemuProcessQMPInit(qemuProcessQMPPtr proc) +qemuProcessQMPInit(qemuProcessQMP *proc) { g_autofree char *template = NULL; @@ -8832,7 +8832,7 @@ qemuProcessQMPInit(qemuProcessQMPPtr proc) static int -qemuProcessQMPLaunch(qemuProcessQMPPtr proc) +qemuProcessQMPLaunch(qemuProcessQMP *proc) { const char *machine; int status = 0; @@ -8900,7 +8900,7 @@ qemuProcessQMPLaunch(qemuProcessQMPPtr proc) int -qemuProcessQMPInitMonitor(qemuMonitorPtr mon) +qemuProcessQMPInitMonitor(qemuMonitor *mon) { if (qemuMonitorSetCapabilities(mon) < 0) { VIR_DEBUG("Failed to set monitor capabilities %s", @@ -8913,9 +8913,9 @@ qemuProcessQMPInitMonitor(qemuMonitorPtr mon) static int -qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc) +qemuProcessQMPConnectMonitor(qemuProcessQMP *proc) { - virDomainXMLOptionPtr xmlopt = NULL; + virDomainXMLOption *xmlopt = NULL; virDomainChrSourceDef monConfig; int ret = -1; @@ -8967,7 +8967,7 @@ qemuProcessQMPConnectMonitor(qemuProcessQMPPtr proc) * struct until qemuProcessQMPFree is called. */ int -qemuProcessQMPStart(qemuProcessQMPPtr proc) +qemuProcessQMPStart(qemuProcessQMP *proc) { VIR_DEBUG("proc=%p, emulator=%s", proc, proc->binary); diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h index f4feeaa68f..93103eb530 100644 --- a/src/qemu/qemu_process.h +++ b/src/qemu/qemu_process.h @@ -26,31 +26,30 @@ #include "virstoragefile.h" #include "vireventthread.h" -int qemuProcessPrepareMonitorChr(virDomainChrSourceDefPtr monConfig, +int qemuProcessPrepareMonitorChr(virDomainChrSourceDef *monConfig, const char *domainDir); -int qemuProcessStartCPUs(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessStartCPUs(virQEMUDriver *driver, + virDomainObj *vm, virDomainRunningReason reason, qemuDomainAsyncJob asyncJob); -int qemuProcessStopCPUs(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessStopCPUs(virQEMUDriver *driver, + virDomainObj *vm, virDomainPausedReason reason, qemuDomainAsyncJob asyncJob); -int qemuProcessBuildDestroyMemoryPaths(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem, +int qemuProcessBuildDestroyMemoryPaths(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem, bool build); -int qemuProcessDestroyMemoryBackingPath(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem); +int qemuProcessDestroyMemoryBackingPath(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem); -void qemuProcessReconnectAll(virQEMUDriverPtr driver); +void qemuProcessReconnectAll(virQEMUDriver *driver); typedef struct _qemuProcessIncomingDef qemuProcessIncomingDef; -typedef qemuProcessIncomingDef *qemuProcessIncomingDefPtr; struct _qemuProcessIncomingDef { char *address; /* address where QEMU is supposed to listen */ char *launchURI; /* used as a parameter for -incoming command line option */ @@ -59,19 +58,19 @@ struct _qemuProcessIncomingDef { const char *path; /* path associated with fd */ }; -qemuProcessIncomingDefPtr qemuProcessIncomingDefNew(virQEMUCapsPtr qemuCaps, +qemuProcessIncomingDef *qemuProcessIncomingDefNew(virQEMUCaps *qemuCaps, const char *listenAddress, const char *migrateFrom, int fd, const char *path); -void qemuProcessIncomingDefFree(qemuProcessIncomingDefPtr inc); +void qemuProcessIncomingDefFree(qemuProcessIncomingDef *inc); -int qemuProcessBeginJob(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessBeginJob(virQEMUDriver *driver, + virDomainObj *vm, virDomainJobOperation operation, unsigned long apiFlags); -void qemuProcessEndJob(virQEMUDriverPtr driver, - virDomainObjPtr vm); +void qemuProcessEndJob(virQEMUDriver *driver, + virDomainObj *vm); typedef enum { VIR_QEMU_PROCESS_START_COLD = 1 << 0, @@ -85,66 +84,66 @@ typedef enum { } qemuProcessStartFlags; int qemuProcessStart(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCPUDefPtr updatedCPU, + virQEMUDriver *driver, + virDomainObj *vm, + virCPUDef *updatedCPU, qemuDomainAsyncJob asyncJob, const char *migrateFrom, int stdin_fd, const char *stdin_path, - virDomainMomentObjPtr snapshot, + virDomainMomentObj *snapshot, virNetDevVPortProfileOp vmop, unsigned int flags); -int qemuProcessCreatePretendCmdPrepare(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessCreatePretendCmdPrepare(virQEMUDriver *driver, + virDomainObj *vm, const char *migrateURI, bool standalone, unsigned int flags); -virCommandPtr qemuProcessCreatePretendCmdBuild(virQEMUDriverPtr driver, - virDomainObjPtr vm, +virCommand *qemuProcessCreatePretendCmdBuild(virQEMUDriver *driver, + virDomainObj *vm, const char *migrateURI, bool enableFips, bool standalone, bool jsonPropsValidation); -int qemuProcessInit(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCPUDefPtr updatedCPU, +int qemuProcessInit(virQEMUDriver *driver, + virDomainObj *vm, + virCPUDef *updatedCPU, qemuDomainAsyncJob asyncJob, bool migration, unsigned int flags); -int qemuProcessPrepareDomain(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessPrepareDomain(virQEMUDriver *driver, + virDomainObj *vm, unsigned int flags); -int qemuProcessOpenVhostVsock(virDomainVsockDefPtr vsock); +int qemuProcessOpenVhostVsock(virDomainVsockDef *vsock); -int qemuProcessPrepareHostHostdev(virDomainHostdevDefPtr hostdev); +int qemuProcessPrepareHostHostdev(virDomainHostdevDef *hostdev); -int qemuProcessPrepareHost(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessPrepareHost(virQEMUDriver *driver, + virDomainObj *vm, unsigned int flags); int qemuProcessLaunch(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, + virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, - qemuProcessIncomingDefPtr incoming, - virDomainMomentObjPtr snapshot, + qemuProcessIncomingDef *incoming, + virDomainMomentObj *snapshot, virNetDevVPortProfileOp vmop, unsigned int flags); -int qemuProcessFinishStartup(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessFinishStartup(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob, bool startCPUs, virDomainPausedReason pausedReason); -int qemuProcessRefreshState(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessRefreshState(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob); typedef enum { @@ -152,12 +151,12 @@ typedef enum { VIR_QEMU_PROCESS_STOP_NO_RELABEL = 1 << 1, } qemuProcessStopFlags; -int qemuProcessBeginStopJob(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessBeginStopJob(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainJob job, bool forceKill); -void qemuProcessStop(virQEMUDriverPtr driver, - virDomainObjPtr vm, +void qemuProcessStop(virQEMUDriver *driver, + virDomainObj *vm, virDomainShutoffReason reason, qemuDomainAsyncJob asyncJob, unsigned int flags); @@ -168,54 +167,53 @@ typedef enum { VIR_QEMU_PROCESS_KILL_NOCHECK = 1 << 2, /* bypass the running vm check */ } virQemuProcessKillMode; -int qemuProcessKill(virDomainObjPtr vm, unsigned int flags); +int qemuProcessKill(virDomainObj *vm, unsigned int flags); -void qemuProcessShutdownOrReboot(virQEMUDriverPtr driver, - virDomainObjPtr vm); +void qemuProcessShutdownOrReboot(virQEMUDriver *driver, + virDomainObj *vm); -int qemuProcessAutoDestroyInit(virQEMUDriverPtr driver); -void qemuProcessAutoDestroyShutdown(virQEMUDriverPtr driver); -int qemuProcessAutoDestroyAdd(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessAutoDestroyInit(virQEMUDriver *driver); +void qemuProcessAutoDestroyShutdown(virQEMUDriver *driver); +int qemuProcessAutoDestroyAdd(virQEMUDriver *driver, + virDomainObj *vm, virConnectPtr conn); -int qemuProcessAutoDestroyRemove(virQEMUDriverPtr driver, - virDomainObjPtr vm); -bool qemuProcessAutoDestroyActive(virQEMUDriverPtr driver, - virDomainObjPtr vm); +int qemuProcessAutoDestroyRemove(virQEMUDriver *driver, + virDomainObj *vm); +bool qemuProcessAutoDestroyActive(virQEMUDriver *driver, + virDomainObj *vm); int qemuProcessSetSchedParams(int id, pid_t pid, size_t nsp, - virDomainThreadSchedParamPtr sp); + virDomainThreadSchedParam *sp); -virDomainDiskDefPtr qemuProcessFindDomainDiskByAliasOrQOM(virDomainObjPtr vm, +virDomainDiskDef *qemuProcessFindDomainDiskByAliasOrQOM(virDomainObj *vm, const char *alias, const char *qomid); -int qemuConnectAgent(virQEMUDriverPtr driver, virDomainObjPtr vm); +int qemuConnectAgent(virQEMUDriver *driver, virDomainObj *vm); -int qemuProcessSetupVcpu(virDomainObjPtr vm, +int qemuProcessSetupVcpu(virDomainObj *vm, unsigned int vcpuid); -int qemuProcessSetupIOThread(virDomainObjPtr vm, - virDomainIOThreadIDDefPtr iothread); +int qemuProcessSetupIOThread(virDomainObj *vm, + virDomainIOThreadIDDef *iothread); -int qemuRefreshVirtioChannelState(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuRefreshVirtioChannelState(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob); -int qemuProcessRefreshBalloonState(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessRefreshBalloonState(virQEMUDriver *driver, + virDomainObj *vm, int asyncJob); -int qemuProcessRefreshDisks(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuProcessRefreshDisks(virQEMUDriver *driver, + virDomainObj *vm, qemuDomainAsyncJob asyncJob); -int qemuProcessStartManagedPRDaemon(virDomainObjPtr vm) G_GNUC_NO_INLINE; +int qemuProcessStartManagedPRDaemon(virDomainObj *vm) G_GNUC_NO_INLINE; -void qemuProcessKillManagedPRDaemon(virDomainObjPtr vm) G_GNUC_NO_INLINE; +void qemuProcessKillManagedPRDaemon(virDomainObj *vm) G_GNUC_NO_INLINE; typedef struct _qemuProcessQMP qemuProcessQMP; -typedef qemuProcessQMP *qemuProcessQMPPtr; struct _qemuProcessQMP { char *binary; char *libDir; @@ -227,20 +225,20 @@ struct _qemuProcessQMP { char *pidfile; char *uniqDir; virEventThread *eventThread; - virCommandPtr cmd; - qemuMonitorPtr mon; + virCommand *cmd; + qemuMonitor *mon; pid_t pid; - virDomainObjPtr vm; + virDomainObj *vm; bool forceTCG; }; -qemuProcessQMPPtr qemuProcessQMPNew(const char *binary, +qemuProcessQMP *qemuProcessQMPNew(const char *binary, const char *libDir, uid_t runUid, gid_t runGid, bool forceTCG); -void qemuProcessQMPFree(qemuProcessQMPPtr proc); +void qemuProcessQMPFree(qemuProcessQMP *proc); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuProcessQMP, qemuProcessQMPFree); -int qemuProcessQMPStart(qemuProcessQMPPtr proc); +int qemuProcessQMPStart(qemuProcessQMP *proc); diff --git a/src/qemu/qemu_processpriv.h b/src/qemu/qemu_processpriv.h index 84d6bc8420..d0b5735054 100644 --- a/src/qemu/qemu_processpriv.h +++ b/src/qemu/qemu_processpriv.h @@ -32,9 +32,9 @@ * This header file should never be used outside unit tests. */ -int qemuProcessHandleDeviceDeleted(qemuMonitorPtr mon, - virDomainObjPtr vm, +int qemuProcessHandleDeviceDeleted(qemuMonitor *mon, + virDomainObj *vm, const char *devAlias, void *opaque); -int qemuProcessQMPInitMonitor(qemuMonitorPtr mon); +int qemuProcessQMPInitMonitor(qemuMonitor *mon); diff --git a/src/qemu/qemu_qapi.c b/src/qemu/qemu_qapi.c index f4047f507a..36b184b226 100644 --- a/src/qemu/qemu_qapi.c +++ b/src/qemu/qemu_qapi.c @@ -40,14 +40,14 @@ VIR_LOG_INIT("qemu.qemu_qapi"); * Helper that selects the type of a QMP schema object member or it's variant * member. Returns the QMP entry on success or NULL on error. */ -static virJSONValuePtr +static virJSONValue * virQEMUQAPISchemaObjectGet(const char *field, const char *name, const char *namefield, - virJSONValuePtr elem) + virJSONValue *elem) { - virJSONValuePtr arr; - virJSONValuePtr cur; + virJSONValue *arr; + virJSONValue *cur; const char *curname; size_t i; @@ -71,7 +71,7 @@ struct virQEMUQAPISchemaTraverseContext { const char *prevquery; GHashTable *schema; char **queries; - virJSONValuePtr returnType; + virJSONValue *returnType; size_t depth; }; @@ -132,10 +132,10 @@ virQEMUQAPISchemaTraverse(const char *baseName, */ static int virQEMUQAPISchemaTraverseHasObjectFeature(const char *featurename, - virJSONValuePtr elem) + virJSONValue *elem) { - virJSONValuePtr featuresarray; - virJSONValuePtr cur; + virJSONValue *featuresarray; + virJSONValue *cur; const char *curstr; size_t i; @@ -156,10 +156,10 @@ virQEMUQAPISchemaTraverseHasObjectFeature(const char *featurename, static int -virQEMUQAPISchemaTraverseObject(virJSONValuePtr cur, +virQEMUQAPISchemaTraverseObject(virJSONValue *cur, struct virQEMUQAPISchemaTraverseContext *ctxt) { - virJSONValuePtr obj; + virJSONValue *obj; const char *query = virQEMUQAPISchemaTraverseContextNextQuery(ctxt); char modifier = *query; @@ -195,7 +195,7 @@ virQEMUQAPISchemaTraverseObject(virJSONValuePtr cur, static int -virQEMUQAPISchemaTraverseArray(virJSONValuePtr cur, +virQEMUQAPISchemaTraverseArray(virJSONValue *cur, struct virQEMUQAPISchemaTraverseContext *ctxt) { const char *querytype; @@ -209,7 +209,7 @@ virQEMUQAPISchemaTraverseArray(virJSONValuePtr cur, static int -virQEMUQAPISchemaTraverseCommand(virJSONValuePtr cur, +virQEMUQAPISchemaTraverseCommand(virJSONValue *cur, struct virQEMUQAPISchemaTraverseContext *ctxt) { const char *query = virQEMUQAPISchemaTraverseContextNextQuery(ctxt); @@ -238,12 +238,12 @@ virQEMUQAPISchemaTraverseCommand(virJSONValuePtr cur, static int -virQEMUQAPISchemaTraverseEnum(virJSONValuePtr cur, +virQEMUQAPISchemaTraverseEnum(virJSONValue *cur, struct virQEMUQAPISchemaTraverseContext *ctxt) { const char *query = virQEMUQAPISchemaTraverseContextNextQuery(ctxt); - virJSONValuePtr values; - virJSONValuePtr enumval; + virJSONValue *values; + virJSONValue *enumval; const char *value; size_t i; @@ -272,7 +272,7 @@ virQEMUQAPISchemaTraverseEnum(virJSONValuePtr cur, static int -virQEMUQAPISchemaTraverseBuiltin(virJSONValuePtr cur, +virQEMUQAPISchemaTraverseBuiltin(virJSONValue *cur, struct virQEMUQAPISchemaTraverseContext *ctxt) { const char *query = virQEMUQAPISchemaTraverseContextNextQuery(ctxt); @@ -297,12 +297,12 @@ virQEMUQAPISchemaTraverseBuiltin(virJSONValuePtr cur, static int -virQEMUQAPISchemaTraverseAlternate(virJSONValuePtr cur, +virQEMUQAPISchemaTraverseAlternate(virJSONValue *cur, struct virQEMUQAPISchemaTraverseContext *ctxt) { struct virQEMUQAPISchemaTraverseContext savectxt = *ctxt; - virJSONValuePtr members; - virJSONValuePtr member; + virJSONValue *members; + virJSONValue *member; const char *membertype; int rc; size_t i; @@ -328,7 +328,7 @@ virQEMUQAPISchemaTraverseAlternate(virJSONValuePtr cur, /* The function must return 1 on successful query, 0 if the query was not found * -1 when a libvirt error is reported, -2 if the schema is invalid and -3 if * the query component is malformed. */ -typedef int (*virQEMUQAPISchemaTraverseFunc)(virJSONValuePtr cur, +typedef int (*virQEMUQAPISchemaTraverseFunc)(virJSONValue *cur, struct virQEMUQAPISchemaTraverseContext *ctxt); struct virQEMUQAPISchemaTraverseMetaType { @@ -352,7 +352,7 @@ static int virQEMUQAPISchemaTraverse(const char *baseName, struct virQEMUQAPISchemaTraverseContext *ctxt) { - virJSONValuePtr cur; + virJSONValue *cur; const char *metatype; size_t i; @@ -430,7 +430,7 @@ virQEMUQAPISchemaTraverse(const char *baseName, int virQEMUQAPISchemaPathGet(const char *query, GHashTable *schema, - virJSONValuePtr *entry) + virJSONValue **entry) { g_auto(GStrv) elems = NULL; struct virQEMUQAPISchemaTraverseContext ctxt; @@ -485,7 +485,7 @@ virQEMUQAPISchemaPathExists(const char *query, static int virQEMUQAPISchemaEntryProcess(size_t pos G_GNUC_UNUSED, - virJSONValuePtr item, + virJSONValue *item, void *opaque) { const char *name; @@ -512,7 +512,7 @@ virQEMUQAPISchemaEntryProcess(size_t pos G_GNUC_UNUSED, * the schema. @schemareply is consumed and freed. */ GHashTable * -virQEMUQAPISchemaConvert(virJSONValuePtr schemareply) +virQEMUQAPISchemaConvert(virJSONValue *schemareply) { g_autoptr(GHashTable) schema = NULL; g_autoptr(virJSONValue) schemajson = schemareply; diff --git a/src/qemu/qemu_qapi.h b/src/qemu/qemu_qapi.h index 3cb30c8162..386edc046d 100644 --- a/src/qemu/qemu_qapi.h +++ b/src/qemu/qemu_qapi.h @@ -26,11 +26,11 @@ int virQEMUQAPISchemaPathGet(const char *query, GHashTable *schema, - virJSONValuePtr *entry); + virJSONValue **entry); bool virQEMUQAPISchemaPathExists(const char *query, GHashTable *schema); GHashTable * -virQEMUQAPISchemaConvert(virJSONValuePtr schemareply); +virQEMUQAPISchemaConvert(virJSONValue *schemareply); diff --git a/src/qemu/qemu_saveimage.c b/src/qemu/qemu_saveimage.c index 5d542bf977..b4af80f942 100644 --- a/src/qemu/qemu_saveimage.c +++ b/src/qemu/qemu_saveimage.c @@ -67,7 +67,7 @@ VIR_ENUM_IMPL(qemuSaveCompression, ); static inline void -qemuSaveImageBswapHeader(virQEMUSaveHeaderPtr hdr) +qemuSaveImageBswapHeader(virQEMUSaveHeader *hdr) { hdr->version = GUINT32_SWAP_LE_BE(hdr->version); hdr->data_len = GUINT32_SWAP_LE_BE(hdr->data_len); @@ -78,7 +78,7 @@ qemuSaveImageBswapHeader(virQEMUSaveHeaderPtr hdr) void -virQEMUSaveDataFree(virQEMUSaveDataPtr data) +virQEMUSaveDataFree(virQEMUSaveData *data) { if (!data) return; @@ -93,20 +93,20 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virQEMUSaveData, virQEMUSaveDataFree); /** * This function steals @domXML on success. */ -virQEMUSaveDataPtr +virQEMUSaveData * virQEMUSaveDataNew(char *domXML, - qemuDomainSaveCookiePtr cookieObj, + qemuDomainSaveCookie *cookieObj, bool running, int compressed, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { - virQEMUSaveDataPtr data = NULL; - virQEMUSaveHeaderPtr header; + virQEMUSaveData *data = NULL; + virQEMUSaveHeader *header; data = g_new0(virQEMUSaveData, 1); if (cookieObj && - !(data->cookie = virSaveCookieFormat((virObjectPtr) cookieObj, + !(data->cookie = virSaveCookieFormat((virObject *) cookieObj, virDomainXMLOptionGetSaveCookie(xmlopt)))) goto error; @@ -135,11 +135,11 @@ virQEMUSaveDataNew(char *domXML, * Returns -1 on failure, or 0 on success. */ int -virQEMUSaveDataWrite(virQEMUSaveDataPtr data, +virQEMUSaveDataWrite(virQEMUSaveData *data, int fd, const char *path) { - virQEMUSaveHeaderPtr header = &data->header; + virQEMUSaveHeader *header = &data->header; size_t len; size_t xml_len; size_t cookie_len = 0; @@ -206,11 +206,11 @@ virQEMUSaveDataWrite(virQEMUSaveDataPtr data, static int -virQEMUSaveDataFinish(virQEMUSaveDataPtr data, +virQEMUSaveDataFinish(virQEMUSaveData *data, int *fd, const char *path) { - virQEMUSaveHeaderPtr header = &data->header; + virQEMUSaveHeader *header = &data->header; memcpy(header->magic, QEMU_SAVE_MAGIC, sizeof(header->magic)); @@ -226,10 +226,10 @@ virQEMUSaveDataFinish(virQEMUSaveDataPtr data, } -static virCommandPtr +static virCommand * qemuSaveImageGetCompressionCommand(virQEMUSaveFormat compression) { - virCommandPtr ret = NULL; + virCommand *ret = NULL; const char *prog = qemuSaveCompressionTypeToString(compression); if (!prog) { @@ -253,11 +253,11 @@ qemuSaveImageGetCompressionCommand(virQEMUSaveFormat compression) * the caller needs to make sure that the processors are stopped and do all other * actions besides saving memory */ int -qemuSaveImageCreate(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuSaveImageCreate(virQEMUDriver *driver, + virDomainObj *vm, const char *path, - virQEMUSaveDataPtr data, - virCommandPtr compressor, + virQEMUSaveData *data, + virCommand *compressor, unsigned int flags, qemuDomainAsyncJob asyncJob) { @@ -266,7 +266,7 @@ qemuSaveImageCreate(virQEMUDriverPtr driver, int ret = -1; int fd = -1; int directFlag = 0; - virFileWrapperFdPtr wrapperFd = NULL; + virFileWrapperFd *wrapperFd = NULL; unsigned int wrapperFlags = VIR_FILE_WRAPPER_NON_BLOCKING; /* Obtain the file handle. */ @@ -353,7 +353,7 @@ qemuSaveImageCreate(virQEMUDriverPtr driver, */ int qemuSaveImageGetCompressionProgram(const char *imageFormat, - virCommandPtr *compressor, + virCommand **compressor, const char *styleFormat, bool use_raw_on_fail) { @@ -430,20 +430,20 @@ qemuSaveImageGetCompressionProgram(const char *imageFormat, * unlinked (no error raised). */ int -qemuSaveImageOpen(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, +qemuSaveImageOpen(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, const char *path, - virDomainDefPtr *ret_def, - virQEMUSaveDataPtr *ret_data, + virDomainDef **ret_def, + virQEMUSaveData **ret_data, bool bypass_cache, - virFileWrapperFdPtr *wrapperFd, + virFileWrapperFd **wrapperFd, bool open_write, bool unlink_corrupt) { VIR_AUTOCLOSE fd = -1; int ret = -1; g_autoptr(virQEMUSaveData) data = NULL; - virQEMUSaveHeaderPtr header; + virQEMUSaveHeader *header; g_autoptr(virDomainDef) def = NULL; int oflags = open_write ? O_RDWR : O_RDONLY; size_t xml_len; @@ -570,27 +570,27 @@ qemuSaveImageOpen(virQEMUDriverPtr driver, int qemuSaveImageStartVM(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, + virQEMUDriver *driver, + virDomainObj *vm, int *fd, - virQEMUSaveDataPtr data, + virQEMUSaveData *data, const char *path, bool start_paused, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret = -1; bool started = false; - virObjectEventPtr event; + virObjectEvent *event; VIR_AUTOCLOSE intermediatefd = -1; g_autoptr(virCommand) cmd = NULL; g_autofree char *errbuf = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - virQEMUSaveHeaderPtr header = &data->header; + virQEMUSaveHeader *header = &data->header; g_autoptr(qemuDomainSaveCookie) cookie = NULL; int rc = 0; - if (virSaveCookieParseString(data->cookie, (virObjectPtr *)&cookie, + if (virSaveCookieParseString(data->cookie, (virObject **)&cookie, virDomainXMLOptionGetSaveCookie(driver->xmlopt)) < 0) goto cleanup; @@ -712,14 +712,14 @@ qemuSaveImageStartVM(virConnectPtr conn, * Returns the new domain definition in case @newxml is ABI compatible with the * guest. */ -virDomainDefPtr -qemuSaveImageUpdateDef(virQEMUDriverPtr driver, - virDomainDefPtr def, +virDomainDef * +qemuSaveImageUpdateDef(virQEMUDriver *driver, + virDomainDef *def, const char *newxml) { - virDomainDefPtr ret = NULL; - virDomainDefPtr newdef_migr = NULL; - virDomainDefPtr newdef = NULL; + virDomainDef *ret = NULL; + virDomainDef *newdef_migr = NULL; + virDomainDef *newdef = NULL; if (!(newdef = virDomainDefParseString(newxml, driver->xmlopt, NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE))) diff --git a/src/qemu/qemu_saveimage.h b/src/qemu/qemu_saveimage.h index f9fecbcc46..45c5f35e11 100644 --- a/src/qemu/qemu_saveimage.h +++ b/src/qemu/qemu_saveimage.h @@ -35,7 +35,6 @@ G_STATIC_ASSERT(sizeof(QEMU_SAVE_MAGIC) == sizeof(QEMU_SAVE_PARTIAL)); typedef struct _virQEMUSaveHeader virQEMUSaveHeader; -typedef virQEMUSaveHeader *virQEMUSaveHeaderPtr; struct _virQEMUSaveHeader { char magic[sizeof(QEMU_SAVE_MAGIC)-1]; uint32_t version; @@ -48,7 +47,6 @@ struct _virQEMUSaveHeader { typedef struct _virQEMUSaveData virQEMUSaveData; -typedef virQEMUSaveData *virQEMUSaveDataPtr; struct _virQEMUSaveData { virQEMUSaveHeader header; char *xml; @@ -56,61 +54,61 @@ struct _virQEMUSaveData { }; -virDomainDefPtr -qemuSaveImageUpdateDef(virQEMUDriverPtr driver, - virDomainDefPtr def, +virDomainDef * +qemuSaveImageUpdateDef(virQEMUDriver *driver, + virDomainDef *def, const char *newxml); int qemuSaveImageStartVM(virConnectPtr conn, - virQEMUDriverPtr driver, - virDomainObjPtr vm, + virQEMUDriver *driver, + virDomainObj *vm, int *fd, - virQEMUSaveDataPtr data, + virQEMUSaveData *data, const char *path, bool start_paused, qemuDomainAsyncJob asyncJob) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6); int -qemuSaveImageOpen(virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps, +qemuSaveImageOpen(virQEMUDriver *driver, + virQEMUCaps *qemuCaps, const char *path, - virDomainDefPtr *ret_def, - virQEMUSaveDataPtr *ret_data, + virDomainDef **ret_def, + virQEMUSaveData **ret_data, bool bypass_cache, - virFileWrapperFdPtr *wrapperFd, + virFileWrapperFd **wrapperFd, bool open_write, bool unlink_corrupt) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4); int qemuSaveImageGetCompressionProgram(const char *imageFormat, - virCommandPtr *compressor, + virCommand **compressor, const char *styleFormat, bool use_raw_on_fail) ATTRIBUTE_NONNULL(2); int -qemuSaveImageCreate(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuSaveImageCreate(virQEMUDriver *driver, + virDomainObj *vm, const char *path, - virQEMUSaveDataPtr data, - virCommandPtr compressor, + virQEMUSaveData *data, + virCommand *compressor, unsigned int flags, qemuDomainAsyncJob asyncJob); int -virQEMUSaveDataWrite(virQEMUSaveDataPtr data, +virQEMUSaveDataWrite(virQEMUSaveData *data, int fd, const char *path); -virQEMUSaveDataPtr +virQEMUSaveData * virQEMUSaveDataNew(char *domXML, - qemuDomainSaveCookiePtr cookieObj, + qemuDomainSaveCookie *cookieObj, bool running, int compressed, - virDomainXMLOptionPtr xmlopt); + virDomainXMLOption *xmlopt); void -virQEMUSaveDataFree(virQEMUSaveDataPtr data); +virQEMUSaveDataFree(virQEMUSaveData *data); diff --git a/src/qemu/qemu_security.c b/src/qemu/qemu_security.c index 3bda96272c..e582a66071 100644 --- a/src/qemu/qemu_security.c +++ b/src/qemu/qemu_security.c @@ -31,13 +31,13 @@ VIR_LOG_INIT("qemu.qemu_security"); int -qemuSecuritySetAllLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuSecuritySetAllLabel(virQEMUDriver *driver, + virDomainObj *vm, const char *incomingPath, bool migrated) { int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; pid_t pid = -1; if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) @@ -65,11 +65,11 @@ qemuSecuritySetAllLabel(virQEMUDriverPtr driver, void -qemuSecurityRestoreAllLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuSecurityRestoreAllLabel(virQEMUDriver *driver, + virDomainObj *vm, bool migrated) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool transactionStarted = false; /* In contrast to qemuSecuritySetAllLabel, do not use vm->pid @@ -96,13 +96,13 @@ qemuSecurityRestoreAllLabel(virQEMUDriverPtr driver, int -qemuSecuritySetImageLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src, +qemuSecuritySetImageLabel(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src, bool backingChain, bool chainTop) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; pid_t pid = -1; int ret = -1; virSecurityDomainImageLabelFlags labelFlags = 0; @@ -135,12 +135,12 @@ qemuSecuritySetImageLabel(virQEMUDriverPtr driver, int -qemuSecurityRestoreImageLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src, +qemuSecurityRestoreImageLabel(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src, bool backingChain) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; pid_t pid = -1; int ret = -1; virSecurityDomainImageLabelFlags labelFlags = 0; @@ -170,12 +170,12 @@ qemuSecurityRestoreImageLabel(virQEMUDriverPtr driver, int -qemuSecurityMoveImageMetadata(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr dst) +qemuSecurityMoveImageMetadata(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src, + virStorageSource *dst) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; pid_t pid = -1; if (!priv->rememberOwner) @@ -189,11 +189,11 @@ qemuSecurityMoveImageMetadata(virQEMUDriverPtr driver, int -qemuSecuritySetHostdevLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuSecuritySetHostdevLabel(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; pid_t pid = -1; int ret = -1; @@ -221,11 +221,11 @@ qemuSecuritySetHostdevLabel(virQEMUDriverPtr driver, int -qemuSecurityRestoreHostdevLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev) +qemuSecurityRestoreHostdevLabel(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; pid_t pid = -1; int ret = -1; @@ -253,11 +253,11 @@ qemuSecurityRestoreHostdevLabel(virQEMUDriverPtr driver, int -qemuSecuritySetMemoryLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem) +qemuSecuritySetMemoryLabel(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; pid_t pid = -1; int ret = -1; @@ -284,11 +284,11 @@ qemuSecuritySetMemoryLabel(virQEMUDriverPtr driver, int -qemuSecurityRestoreMemoryLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem) +qemuSecurityRestoreMemoryLabel(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; pid_t pid = -1; int ret = -1; @@ -315,11 +315,11 @@ qemuSecurityRestoreMemoryLabel(virQEMUDriverPtr driver, int -qemuSecuritySetInputLabel(virDomainObjPtr vm, - virDomainInputDefPtr input) +qemuSecuritySetInputLabel(virDomainObj *vm, + virDomainInputDef *input) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; pid_t pid = -1; int ret = -1; @@ -346,11 +346,11 @@ qemuSecuritySetInputLabel(virDomainObjPtr vm, int -qemuSecurityRestoreInputLabel(virDomainObjPtr vm, - virDomainInputDefPtr input) +qemuSecurityRestoreInputLabel(virDomainObj *vm, + virDomainInputDef *input) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; pid_t pid = -1; int ret = -1; @@ -377,12 +377,12 @@ qemuSecurityRestoreInputLabel(virDomainObjPtr vm, int -qemuSecuritySetChardevLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainChrDefPtr chr) +qemuSecuritySetChardevLabel(virQEMUDriver *driver, + virDomainObj *vm, + virDomainChrDef *chr) { int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; pid_t pid = -1; if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) @@ -409,12 +409,12 @@ qemuSecuritySetChardevLabel(virQEMUDriverPtr driver, int -qemuSecurityRestoreChardevLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainChrDefPtr chr) +qemuSecurityRestoreChardevLabel(virQEMUDriver *driver, + virDomainObj *vm, + virDomainChrDef *chr) { int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; pid_t pid = -1; if (qemuDomainNamespaceEnabled(vm, QEMU_DOMAIN_NS_MOUNT)) @@ -456,9 +456,9 @@ qemuSecurityRestoreChardevLabel(virQEMUDriverPtr driver, * exitstatus also set. */ int -qemuSecurityStartVhostUserGPU(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCommandPtr cmd, +qemuSecurityStartVhostUserGPU(virQEMUDriver *driver, + virDomainObj *vm, + virCommand *cmd, int *exitstatus, int *cmdret) { @@ -499,15 +499,15 @@ qemuSecurityStartVhostUserGPU(virQEMUDriverPtr driver, * exitstatus also set. */ int -qemuSecurityStartTPMEmulator(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCommandPtr cmd, +qemuSecurityStartTPMEmulator(virQEMUDriver *driver, + virDomainObj *vm, + virCommand *cmd, uid_t uid, gid_t gid, int *exitstatus, int *cmdret) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int ret = -1; bool transactionStarted = false; @@ -555,10 +555,10 @@ qemuSecurityStartTPMEmulator(virQEMUDriverPtr driver, void -qemuSecurityCleanupTPMEmulator(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuSecurityCleanupTPMEmulator(virQEMUDriver *driver, + virDomainObj *vm) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool transactionStarted = false; if (virSecurityManagerTransactionStart(driver->securityManager) >= 0) @@ -576,12 +576,12 @@ qemuSecurityCleanupTPMEmulator(virQEMUDriverPtr driver, int -qemuSecurityDomainSetPathLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuSecurityDomainSetPathLabel(virQEMUDriver *driver, + virDomainObj *vm, const char *path, bool allowSubtree) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; pid_t pid = -1; int ret = -1; @@ -609,11 +609,11 @@ qemuSecurityDomainSetPathLabel(virQEMUDriverPtr driver, int -qemuSecurityDomainRestorePathLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuSecurityDomainRestorePathLabel(virQEMUDriver *driver, + virDomainObj *vm, const char *path) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; pid_t pid = -1; int ret = -1; @@ -656,9 +656,9 @@ qemuSecurityDomainRestorePathLabel(virQEMUDriverPtr driver, * -1 otherwise. */ int -qemuSecurityCommandRun(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCommandPtr cmd, +qemuSecurityCommandRun(virQEMUDriver *driver, + virDomainObj *vm, + virCommand *cmd, uid_t uid, gid_t gid, int *exitstatus, diff --git a/src/qemu/qemu_security.h b/src/qemu/qemu_security.h index ce00661dbb..4c3d81e4b5 100644 --- a/src/qemu/qemu_security.h +++ b/src/qemu/qemu_security.h @@ -24,98 +24,98 @@ #include "domain_conf.h" #include "security/security_manager.h" -int qemuSecuritySetAllLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuSecuritySetAllLabel(virQEMUDriver *driver, + virDomainObj *vm, const char *incomingPath, bool migrated); -void qemuSecurityRestoreAllLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, +void qemuSecurityRestoreAllLabel(virQEMUDriver *driver, + virDomainObj *vm, bool migrated); -int qemuSecuritySetImageLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src, +int qemuSecuritySetImageLabel(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src, bool backingChain, bool chainTop); -int qemuSecurityRestoreImageLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src, +int qemuSecurityRestoreImageLabel(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src, bool backingChain); -int qemuSecurityMoveImageMetadata(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virStorageSourcePtr src, - virStorageSourcePtr dst); +int qemuSecurityMoveImageMetadata(virQEMUDriver *driver, + virDomainObj *vm, + virStorageSource *src, + virStorageSource *dst); -int qemuSecuritySetHostdevLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev); +int qemuSecuritySetHostdevLabel(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev); -int qemuSecurityRestoreHostdevLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainHostdevDefPtr hostdev); +int qemuSecurityRestoreHostdevLabel(virQEMUDriver *driver, + virDomainObj *vm, + virDomainHostdevDef *hostdev); -int qemuSecuritySetMemoryLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem); +int qemuSecuritySetMemoryLabel(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem); -int qemuSecurityRestoreMemoryLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMemoryDefPtr mem); +int qemuSecurityRestoreMemoryLabel(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMemoryDef *mem); -int qemuSecuritySetInputLabel(virDomainObjPtr vm, - virDomainInputDefPtr input); +int qemuSecuritySetInputLabel(virDomainObj *vm, + virDomainInputDef *input); -int qemuSecurityRestoreInputLabel(virDomainObjPtr vm, - virDomainInputDefPtr input); +int qemuSecurityRestoreInputLabel(virDomainObj *vm, + virDomainInputDef *input); -int qemuSecuritySetChardevLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainChrDefPtr chr); +int qemuSecuritySetChardevLabel(virQEMUDriver *driver, + virDomainObj *vm, + virDomainChrDef *chr); -int qemuSecurityRestoreChardevLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainChrDefPtr chr); +int qemuSecurityRestoreChardevLabel(virQEMUDriver *driver, + virDomainObj *vm, + virDomainChrDef *chr); -int qemuSecurityStartVhostUserGPU(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCommandPtr cmd, +int qemuSecurityStartVhostUserGPU(virQEMUDriver *driver, + virDomainObj *vm, + virCommand *cmd, int *exitstatus, int *cmdret); -int qemuSecurityStartTPMEmulator(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCommandPtr cmd, +int qemuSecurityStartTPMEmulator(virQEMUDriver *driver, + virDomainObj *vm, + virCommand *cmd, uid_t uid, gid_t gid, int *exitstatus, int *cmdret); -void qemuSecurityCleanupTPMEmulator(virQEMUDriverPtr driver, - virDomainObjPtr vm); +void qemuSecurityCleanupTPMEmulator(virQEMUDriver *driver, + virDomainObj *vm); -int qemuSecuritySetSavedStateLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuSecuritySetSavedStateLabel(virQEMUDriver *driver, + virDomainObj *vm, const char *savefile); -int qemuSecurityRestoreSavedStateLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuSecurityRestoreSavedStateLabel(virQEMUDriver *driver, + virDomainObj *vm, const char *savefile); -int qemuSecurityDomainSetPathLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuSecurityDomainSetPathLabel(virQEMUDriver *driver, + virDomainObj *vm, const char *path, bool allowSubtree); -int qemuSecurityDomainRestorePathLabel(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuSecurityDomainRestorePathLabel(virQEMUDriver *driver, + virDomainObj *vm, const char *path); -int qemuSecurityCommandRun(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virCommandPtr cmd, +int qemuSecurityCommandRun(virQEMUDriver *driver, + virDomainObj *vm, + virCommand *cmd, uid_t uid, gid_t gid, int *exitstatus, diff --git a/src/qemu/qemu_slirp.c b/src/qemu/qemu_slirp.c index 7f6156fbc1..c832cfc20b 100644 --- a/src/qemu/qemu_slirp.c +++ b/src/qemu/qemu_slirp.c @@ -50,7 +50,7 @@ VIR_ENUM_IMPL(qemuSlirpFeature, void -qemuSlirpFree(qemuSlirpPtr slirp) +qemuSlirpFree(qemuSlirp *slirp) { if (!slirp) return; @@ -63,7 +63,7 @@ qemuSlirpFree(qemuSlirpPtr slirp) void -qemuSlirpSetFeature(qemuSlirpPtr slirp, +qemuSlirpSetFeature(qemuSlirp *slirp, qemuSlirpFeature feature) { ignore_value(virBitmapSetBit(slirp->features, feature)); @@ -78,7 +78,7 @@ qemuSlirpHasFeature(const qemuSlirp *slirp, } -qemuSlirpPtr +qemuSlirp * qemuSlirpNew(void) { g_autoptr(qemuSlirp) slirp = g_new0(qemuSlirp, 1); @@ -91,14 +91,14 @@ qemuSlirpNew(void) } -qemuSlirpPtr +qemuSlirp * qemuSlirpNewForHelper(const char *helper) { g_autoptr(qemuSlirp) slirp = NULL; g_autoptr(virCommand) cmd = NULL; g_autofree char *output = NULL; g_autoptr(virJSONValue) doc = NULL; - virJSONValuePtr featuresJSON; + virJSONValue *featuresJSON; size_t i, nfeatures; slirp = qemuSlirpNew(); @@ -123,7 +123,7 @@ qemuSlirpNewForHelper(const char *helper) nfeatures = virJSONValueArraySize(featuresJSON); for (i = 0; i < nfeatures; i++) { - virJSONValuePtr item = virJSONValueArrayGet(featuresJSON, i); + virJSONValue *item = virJSONValueArrayGet(featuresJSON, i); const char *tmpStr = virJSONValueGetString(item); int tmp; @@ -140,7 +140,7 @@ qemuSlirpNewForHelper(const char *helper) static char * -qemuSlirpCreatePidFilename(virQEMUDriverConfigPtr cfg, +qemuSlirpCreatePidFilename(virQEMUDriverConfig *cfg, const virDomainDef *def, const char *alias) { @@ -157,9 +157,9 @@ qemuSlirpCreatePidFilename(virQEMUDriverConfigPtr cfg, int -qemuSlirpOpen(qemuSlirpPtr slirp, - virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuSlirpOpen(qemuSlirp *slirp, + virQEMUDriver *driver, + virDomainDef *def) { int rc, pair[2] = { -1, -1 }; @@ -189,7 +189,7 @@ qemuSlirpOpen(qemuSlirpPtr slirp, int -qemuSlirpGetFD(qemuSlirpPtr slirp) +qemuSlirpGetFD(qemuSlirp *slirp) { int fd = slirp->fd[0]; slirp->fd[0] = -1; @@ -198,7 +198,7 @@ qemuSlirpGetFD(qemuSlirpPtr slirp) static char * -qemuSlirpGetDBusVMStateId(virDomainNetDefPtr net) +qemuSlirpGetDBusVMStateId(virDomainNetDef *net) { char macstr[VIR_MAC_STRING_BUFLEN] = ""; @@ -208,10 +208,10 @@ qemuSlirpGetDBusVMStateId(virDomainNetDefPtr net) void -qemuSlirpStop(qemuSlirpPtr slirp, - virDomainObjPtr vm, - virQEMUDriverPtr driver, - virDomainNetDefPtr net) +qemuSlirpStop(qemuSlirp *slirp, + virDomainObj *vm, + virQEMUDriver *driver, + virDomainNetDef *net) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autofree char *id = qemuSlirpGetDBusVMStateId(net); @@ -237,18 +237,18 @@ qemuSlirpStop(qemuSlirpPtr slirp, int -qemuSlirpSetupCgroup(qemuSlirpPtr slirp, - virCgroupPtr cgroup) +qemuSlirpSetupCgroup(qemuSlirp *slirp, + virCgroup *cgroup) { return virCgroupAddProcess(cgroup, slirp->pid); } int -qemuSlirpStart(qemuSlirpPtr slirp, - virDomainObjPtr vm, - virQEMUDriverPtr driver, - virDomainNetDefPtr net, +qemuSlirpStart(qemuSlirp *slirp, + virDomainObj *vm, + virQEMUDriver *driver, + virDomainNetDef *net, bool incoming) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); diff --git a/src/qemu/qemu_slirp.h b/src/qemu/qemu_slirp.h index e1db908814..a9a09cd5f8 100644 --- a/src/qemu/qemu_slirp.h +++ b/src/qemu/qemu_slirp.h @@ -39,43 +39,42 @@ typedef enum { VIR_ENUM_DECL(qemuSlirpFeature); typedef struct _qemuSlirp qemuSlirp; -typedef qemuSlirp *qemuSlirpPtr; struct _qemuSlirp { int fd[2]; - virBitmapPtr features; + virBitmap *features; pid_t pid; }; -qemuSlirpPtr qemuSlirpNew(void); +qemuSlirp *qemuSlirpNew(void); -qemuSlirpPtr qemuSlirpNewForHelper(const char *helper); +qemuSlirp *qemuSlirpNewForHelper(const char *helper); -void qemuSlirpFree(qemuSlirpPtr slirp); +void qemuSlirpFree(qemuSlirp *slirp); -void qemuSlirpSetFeature(qemuSlirpPtr slirp, +void qemuSlirpSetFeature(qemuSlirp *slirp, qemuSlirpFeature feature); bool qemuSlirpHasFeature(const qemuSlirp *slirp, qemuSlirpFeature feature); -int qemuSlirpOpen(qemuSlirpPtr slirp, - virQEMUDriverPtr driver, - virDomainDefPtr def); +int qemuSlirpOpen(qemuSlirp *slirp, + virQEMUDriver *driver, + virDomainDef *def); -int qemuSlirpStart(qemuSlirpPtr slirp, - virDomainObjPtr vm, - virQEMUDriverPtr driver, - virDomainNetDefPtr net, +int qemuSlirpStart(qemuSlirp *slirp, + virDomainObj *vm, + virQEMUDriver *driver, + virDomainNetDef *net, bool incoming); -void qemuSlirpStop(qemuSlirpPtr slirp, - virDomainObjPtr vm, - virQEMUDriverPtr driver, - virDomainNetDefPtr net); +void qemuSlirpStop(qemuSlirp *slirp, + virDomainObj *vm, + virQEMUDriver *driver, + virDomainNetDef *net); -int qemuSlirpGetFD(qemuSlirpPtr slirp); +int qemuSlirpGetFD(qemuSlirp *slirp); -int qemuSlirpSetupCgroup(qemuSlirpPtr slirp, - virCgroupPtr cgroup); +int qemuSlirpSetupCgroup(qemuSlirp *slirp, + virCgroup *cgroup); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuSlirp, qemuSlirpFree); diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c index 93b74b035a..f56a03a55d 100644 --- a/src/qemu/qemu_snapshot.c +++ b/src/qemu/qemu_snapshot.c @@ -59,13 +59,13 @@ VIR_LOG_INIT("qemu.qemu_snapshot"); * the snapshot which was 'current' previously is updated. */ static void -qemuSnapshotSetCurrent(virDomainObjPtr vm, - virDomainMomentObjPtr newcurrent) +qemuSnapshotSetCurrent(virDomainObj *vm, + virDomainMomentObj *newcurrent) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - virDomainMomentObjPtr oldcurrent = virDomainSnapshotGetCurrent(vm->snapshots); + virDomainMomentObj *oldcurrent = virDomainSnapshotGetCurrent(vm->snapshots); virDomainSnapshotSetCurrent(vm->snapshots, newcurrent); @@ -80,11 +80,11 @@ qemuSnapshotSetCurrent(virDomainObjPtr vm, /* Looks up snapshot object from VM and name */ -virDomainMomentObjPtr -qemuSnapObjFromName(virDomainObjPtr vm, +virDomainMomentObj * +qemuSnapObjFromName(virDomainObj *vm, const char *name) { - virDomainMomentObjPtr snap = NULL; + virDomainMomentObj *snap = NULL; snap = virDomainSnapshotFindByName(vm->snapshots, name); if (!snap) virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, @@ -96,8 +96,8 @@ qemuSnapObjFromName(virDomainObjPtr vm, /* Looks up snapshot object from VM and snapshotPtr */ -virDomainMomentObjPtr -qemuSnapObjFromSnapshot(virDomainObjPtr vm, +virDomainMomentObj * +qemuSnapObjFromSnapshot(virDomainObj *vm, virDomainSnapshotPtr snapshot) { return qemuSnapObjFromName(vm, snapshot->name); @@ -110,7 +110,7 @@ qemuSnapshotCountExternal(void *payload, const char *name G_GNUC_UNUSED, void *data) { - virDomainMomentObjPtr snap = payload; + virDomainMomentObj *snap = payload; int *count = data; if (virDomainSnapshotIsExternal(snap)) @@ -120,11 +120,11 @@ qemuSnapshotCountExternal(void *payload, int -qemuSnapshotFSFreeze(virDomainObjPtr vm, +qemuSnapshotFSFreeze(virDomainObj *vm, const char **mountpoints, unsigned int nmountpoints) { - qemuAgentPtr agent; + qemuAgent *agent; int frozen; if (!qemuDomainAgentAvailable(vm, true)) @@ -139,10 +139,10 @@ qemuSnapshotFSFreeze(virDomainObjPtr vm, /* Return -1 on error, otherwise number of thawed filesystems. */ int -qemuSnapshotFSThaw(virDomainObjPtr vm, +qemuSnapshotFSThaw(virDomainObj *vm, bool report) { - qemuAgentPtr agent; + qemuAgent *agent; int thawed; virErrorPtr err = NULL; @@ -163,9 +163,9 @@ qemuSnapshotFSThaw(virDomainObjPtr vm, /* The domain is expected to be locked and inactive. */ static int -qemuSnapshotCreateInactiveInternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMomentObjPtr snap) +qemuSnapshotCreateInactiveInternal(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMomentObj *snap) { return qemuDomainSnapshotForEachQcow2(driver, vm->def, snap, "-c", false); } @@ -173,21 +173,21 @@ qemuSnapshotCreateInactiveInternal(virQEMUDriverPtr driver, /* The domain is expected to be locked and inactive. */ static int -qemuSnapshotCreateInactiveExternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMomentObjPtr snap, +qemuSnapshotCreateInactiveExternal(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMomentObj *snap, bool reuse) { size_t i; - virDomainSnapshotDiskDefPtr snapdisk; - virDomainDiskDefPtr defdisk; - virCommandPtr cmd = NULL; + virDomainSnapshotDiskDef *snapdisk; + virDomainDiskDef *defdisk; + virCommand *cmd = NULL; const char *qemuImgPath; - virBitmapPtr created = NULL; + virBitmap *created = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); int ret = -1; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virDomainSnapshotDefPtr snapdef = virDomainSnapshotObjGetDef(snap); + virDomainSnapshotDef *snapdef = virDomainSnapshotObjGetDef(snap); if (!(qemuImgPath = qemuFindQemuImgBinary(driver))) goto cleanup; @@ -292,15 +292,15 @@ qemuSnapshotCreateInactiveExternal(virQEMUDriverPtr driver, /* The domain is expected to be locked and active. */ static int -qemuSnapshotCreateActiveInternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMomentObjPtr snap, +qemuSnapshotCreateActiveInternal(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMomentObj *snap, unsigned int flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virObjectEventPtr event = NULL; + qemuDomainObjPrivate *priv = vm->privateData; + virObjectEvent *event = NULL; bool resume = false; - virDomainSnapshotDefPtr snapdef = virDomainSnapshotObjGetDef(snap); + virDomainSnapshotDef *snapdef = virDomainSnapshotObjGetDef(snap); int ret = -1; if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0)) @@ -335,7 +335,7 @@ qemuSnapshotCreateActiveInternal(virQEMUDriverPtr driver, if (ret < 0) goto cleanup; - if (!(snapdef->cookie = (virObjectPtr) qemuDomainSaveCookieNew(vm))) + if (!(snapdef->cookie = (virObject *) qemuDomainSaveCookieNew(vm))) goto cleanup; if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_HALT) { @@ -368,8 +368,8 @@ qemuSnapshotCreateActiveInternal(virQEMUDriverPtr driver, static int -qemuSnapshotPrepareDiskShared(virDomainSnapshotDiskDefPtr snapdisk, - virDomainDiskDefPtr domdisk) +qemuSnapshotPrepareDiskShared(virDomainSnapshotDiskDef *snapdisk, + virDomainDiskDef *domdisk) { if (!domdisk->src->shared || domdisk->src->readonly) return 0; @@ -386,8 +386,8 @@ qemuSnapshotPrepareDiskShared(virDomainSnapshotDiskDefPtr snapdisk, static int -qemuSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDefPtr snapdisk, - virDomainDiskDefPtr domdisk) +qemuSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDef *snapdisk, + virDomainDiskDef *domdisk) { int domDiskType = virStorageSourceGetActualType(domdisk->src); int snapDiskType = virStorageSourceGetActualType(snapdisk->src); @@ -460,9 +460,9 @@ qemuSnapshotPrepareDiskExternalInactive(virDomainSnapshotDiskDefPtr snapdisk, static int -qemuSnapshotPrepareDiskExternalActive(virDomainObjPtr vm, - virDomainSnapshotDiskDefPtr snapdisk, - virDomainDiskDefPtr domdisk, +qemuSnapshotPrepareDiskExternalActive(virDomainObj *vm, + virDomainSnapshotDiskDef *snapdisk, + virDomainDiskDef *domdisk, bool blockdev) { int actualType = virStorageSourceGetActualType(snapdisk->src); @@ -534,9 +534,9 @@ qemuSnapshotPrepareDiskExternalActive(virDomainObjPtr vm, static int -qemuSnapshotPrepareDiskExternal(virDomainObjPtr vm, - virDomainDiskDefPtr disk, - virDomainSnapshotDiskDefPtr snapdisk, +qemuSnapshotPrepareDiskExternal(virDomainObj *vm, + virDomainDiskDef *disk, + virDomainSnapshotDiskDef *snapdisk, bool active, bool reuse, bool blockdev) @@ -601,7 +601,7 @@ qemuSnapshotPrepareDiskExternal(virDomainObjPtr vm, static int -qemuSnapshotPrepareDiskInternal(virDomainDiskDefPtr disk, +qemuSnapshotPrepareDiskInternal(virDomainDiskDef *disk, bool active) { int actualType; @@ -662,11 +662,11 @@ qemuSnapshotPrepareDiskInternal(virDomainDiskDefPtr disk, static int -qemuSnapshotPrepare(virDomainObjPtr vm, - virDomainSnapshotDefPtr def, +qemuSnapshotPrepare(virDomainObj *vm, + virDomainSnapshotDef *def, unsigned int *flags) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); size_t i; bool active = virDomainObjIsActive(vm); @@ -676,8 +676,8 @@ qemuSnapshotPrepare(virDomainObjPtr vm, int external = 0; for (i = 0; i < def->ndisks; i++) { - virDomainSnapshotDiskDefPtr disk = &def->disks[i]; - virDomainDiskDefPtr dom_disk = vm->def->disks[i]; + virDomainSnapshotDiskDef *disk = &def->disks[i]; + virDomainDiskDef *dom_disk = vm->def->disks[i]; if (disk->snapshot != VIR_DOMAIN_SNAPSHOT_LOCATION_NONE && qemuDomainDiskBlockJobIsActive(dom_disk)) @@ -821,31 +821,30 @@ qemuSnapshotPrepare(virDomainObjPtr vm, struct _qemuSnapshotDiskData { - virStorageSourcePtr src; + virStorageSource *src; bool initialized; /* @src was initialized in the storage driver */ bool created; /* @src was created by the snapshot code */ bool prepared; /* @src was prepared using qemuDomainStorageSourceAccessAllow */ - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; char *relPath; /* relative path component to fill into original disk */ - qemuBlockStorageSourceChainDataPtr crdata; + qemuBlockStorageSourceChainData *crdata; bool blockdevadded; - virStorageSourcePtr persistsrc; - virDomainDiskDefPtr persistdisk; + virStorageSource *persistsrc; + virDomainDiskDef *persistdisk; }; typedef struct _qemuSnapshotDiskData qemuSnapshotDiskData; -typedef qemuSnapshotDiskData *qemuSnapshotDiskDataPtr; static void -qemuSnapshotDiskCleanup(qemuSnapshotDiskDataPtr data, +qemuSnapshotDiskCleanup(qemuSnapshotDiskData *data, size_t ndata, - virDomainObjPtr vm, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; virErrorPtr orig_err; size_t i; @@ -892,26 +891,25 @@ qemuSnapshotDiskCleanup(qemuSnapshotDiskDataPtr data, struct _qemuSnapshotDiskContext { - qemuSnapshotDiskDataPtr dd; + qemuSnapshotDiskData *dd; size_t ndd; - virJSONValuePtr actions; + virJSONValue *actions; /* needed for automatic cleanup of 'dd' */ - virDomainObjPtr vm; + virDomainObj *vm; qemuDomainAsyncJob asyncJob; }; typedef struct _qemuSnapshotDiskContext qemuSnapshotDiskContext; -typedef qemuSnapshotDiskContext *qemuSnapshotDiskContextPtr; -static qemuSnapshotDiskContextPtr +static qemuSnapshotDiskContext * qemuSnapshotDiskContextNew(size_t ndisks, - virDomainObjPtr vm, + virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuSnapshotDiskContextPtr ret = g_new0(qemuSnapshotDiskContext, 1); + qemuSnapshotDiskContext *ret = g_new0(qemuSnapshotDiskContext, 1); ret->dd = g_new0(qemuSnapshotDiskData, ndisks); ret->actions = virJSONValueNewArray(); @@ -923,7 +921,7 @@ qemuSnapshotDiskContextNew(size_t ndisks, static void -qemuSnapshotDiskContextCleanup(qemuSnapshotDiskContextPtr snapctxt) +qemuSnapshotDiskContextCleanup(qemuSnapshotDiskContext *snapctxt) { if (!snapctxt) return; @@ -949,18 +947,18 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuSnapshotDiskContext, qemuSnapshotDiskContextCl * expected. */ static int -qemuSnapshotDiskBitmapsPropagate(qemuSnapshotDiskDataPtr dd, - virJSONValuePtr actions, +qemuSnapshotDiskBitmapsPropagate(qemuSnapshotDiskData *dd, + virJSONValue *actions, GHashTable *blockNamedNodeData) { - qemuBlockNamedNodeDataPtr entry; + qemuBlockNamedNodeData *entry; size_t i; if (!(entry = virHashLookup(blockNamedNodeData, dd->disk->src->nodeformat))) return 0; for (i = 0; i < entry->nbitmaps; i++) { - qemuBlockNamedNodeDataBitmapPtr bitmap = entry->bitmaps[i]; + qemuBlockNamedNodeDataBitmap *bitmap = entry->bitmaps[i]; /* we don't care about temporary, inconsistent, or disabled bitmaps */ if (!bitmap->persistent || !bitmap->recording || bitmap->inconsistent) @@ -977,15 +975,15 @@ qemuSnapshotDiskBitmapsPropagate(qemuSnapshotDiskDataPtr dd, static int -qemuSnapshotDiskPrepareOneBlockdev(virQEMUDriverPtr driver, - virDomainObjPtr vm, - qemuSnapshotDiskDataPtr dd, - virQEMUDriverConfigPtr cfg, +qemuSnapshotDiskPrepareOneBlockdev(virQEMUDriver *driver, + virDomainObj *vm, + qemuSnapshotDiskData *dd, + virQEMUDriverConfig *cfg, bool reuse, GHashTable *blockNamedNodeData, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autoptr(virStorageSource) terminator = NULL; int rc; @@ -1028,21 +1026,21 @@ qemuSnapshotDiskPrepareOneBlockdev(virQEMUDriverPtr driver, static int -qemuSnapshotDiskPrepareOne(virDomainObjPtr vm, - virQEMUDriverConfigPtr cfg, - virDomainDiskDefPtr disk, - virDomainSnapshotDiskDefPtr snapdisk, - qemuSnapshotDiskDataPtr dd, +qemuSnapshotDiskPrepareOne(virDomainObj *vm, + virQEMUDriverConfig *cfg, + virDomainDiskDef *disk, + virDomainSnapshotDiskDef *snapdisk, + qemuSnapshotDiskData *dd, GHashTable *blockNamedNodeData, bool reuse, bool updateConfig, qemuDomainAsyncJob asyncJob, - virJSONValuePtr actions) + virJSONValue *actions) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; bool blockdev = virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV); - virDomainDiskDefPtr persistdisk; + virDomainDiskDef *persistdisk; bool supportsCreate; bool updateRelativeBacking = false; @@ -1137,17 +1135,17 @@ qemuSnapshotDiskPrepareOne(virDomainObjPtr vm, * Collects and prepares a list of structures that hold information about disks * that are selected for the snapshot. */ -static qemuSnapshotDiskContextPtr -qemuSnapshotDiskPrepareActiveExternal(virDomainObjPtr vm, - virDomainMomentObjPtr snap, - virQEMUDriverConfigPtr cfg, +static qemuSnapshotDiskContext * +qemuSnapshotDiskPrepareActiveExternal(virDomainObj *vm, + virDomainMomentObj *snap, + virQEMUDriverConfig *cfg, bool reuse, GHashTable *blockNamedNodeData, qemuDomainAsyncJob asyncJob) { g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL; size_t i; - virDomainSnapshotDefPtr snapdef = virDomainSnapshotObjGetDef(snap); + virDomainSnapshotDef *snapdef = virDomainSnapshotObjGetDef(snap); snapctxt = qemuSnapshotDiskContextNew(snapdef->ndisks, vm, asyncJob); @@ -1170,9 +1168,9 @@ qemuSnapshotDiskPrepareActiveExternal(virDomainObjPtr vm, } -static qemuSnapshotDiskContextPtr -qemuSnapshotDiskPrepareDisksTransient(virDomainObjPtr vm, - virQEMUDriverConfigPtr cfg, +static qemuSnapshotDiskContext * +qemuSnapshotDiskPrepareDisksTransient(virDomainObj *vm, + virQEMUDriverConfig *cfg, GHashTable *blockNamedNodeData, qemuDomainAsyncJob asyncJob) { @@ -1182,7 +1180,7 @@ qemuSnapshotDiskPrepareDisksTransient(virDomainObjPtr vm, snapctxt = qemuSnapshotDiskContextNew(vm->def->ndisks, vm, asyncJob); for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr domdisk = vm->def->disks[i]; + virDomainDiskDef *domdisk = vm->def->disks[i]; g_autoptr(virDomainSnapshotDiskDef) snapdisk = g_new0(virDomainSnapshotDiskDef, 1); if (!domdisk->transient) @@ -1219,9 +1217,9 @@ qemuSnapshotDiskPrepareDisksTransient(virDomainObjPtr vm, static void -qemuSnapshotDiskUpdateSourceRenumber(virStorageSourcePtr src) +qemuSnapshotDiskUpdateSourceRenumber(virStorageSource *src) { - virStorageSourcePtr next; + virStorageSource *next; unsigned int idx = 1; for (next = src->backingStore; virStorageSourceIsBacking(next); next = next->backingStore) @@ -1237,11 +1235,11 @@ qemuSnapshotDiskUpdateSourceRenumber(virStorageSourcePtr src) * Updates disk definition after a successful snapshot. */ static void -qemuSnapshotDiskUpdateSource(virDomainObjPtr vm, - qemuSnapshotDiskDataPtr dd) +qemuSnapshotDiskUpdateSource(virDomainObj *vm, + qemuSnapshotDiskData *dd) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; /* storage driver access won'd be needed */ if (dd->initialized) @@ -1277,11 +1275,11 @@ qemuSnapshotDiskUpdateSource(virDomainObjPtr vm, static int -qemuSnapshotDiskCreate(qemuSnapshotDiskContextPtr snapctxt, - virQEMUDriverConfigPtr cfg) +qemuSnapshotDiskCreate(qemuSnapshotDiskContext *snapctxt, + virQEMUDriverConfig *cfg) { - qemuDomainObjPrivatePtr priv = snapctxt->vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = snapctxt->vm->privateData; + virQEMUDriver *driver = priv->driver; size_t i; int rc; @@ -1298,7 +1296,7 @@ qemuSnapshotDiskCreate(qemuSnapshotDiskContextPtr snapctxt, rc = -1; for (i = 0; i < snapctxt->ndd; i++) { - qemuSnapshotDiskDataPtr dd = snapctxt->dd + i; + qemuSnapshotDiskData *dd = snapctxt->dd + i; virDomainAuditDisk(snapctxt->vm, dd->disk->src, dd->src, "snapshot", rc >= 0); @@ -1320,11 +1318,11 @@ qemuSnapshotDiskCreate(qemuSnapshotDiskContextPtr snapctxt, /* The domain is expected to be locked and active. */ static int -qemuSnapshotCreateActiveExternalDisks(virDomainObjPtr vm, - virDomainMomentObjPtr snap, +qemuSnapshotCreateActiveExternalDisks(virDomainObj *vm, + virDomainMomentObj *snap, GHashTable *blockNamedNodeData, unsigned int flags, - virQEMUDriverConfigPtr cfg, + virQEMUDriverConfig *cfg, qemuDomainAsyncJob asyncJob) { bool reuse = (flags & VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT) != 0; @@ -1356,11 +1354,11 @@ qemuSnapshotCreateActiveExternalDisks(virDomainObjPtr vm, * configuration. */ int -qemuSnapshotCreateDisksTransient(virDomainObjPtr vm, +qemuSnapshotCreateDisksTransient(virDomainObj *vm, qemuDomainAsyncJob asyncJob) { - qemuDomainObjPrivatePtr priv = vm->privateData; - virQEMUDriverPtr driver = priv->driver; + qemuDomainObjPrivate *priv = vm->privateData; + virQEMUDriver *driver = priv->driver; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autoptr(qemuSnapshotDiskContext) snapctxt = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL; @@ -1386,25 +1384,25 @@ qemuSnapshotCreateDisksTransient(virDomainObjPtr vm, static int -qemuSnapshotCreateActiveExternal(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMomentObjPtr snap, - virQEMUDriverConfigPtr cfg, +qemuSnapshotCreateActiveExternal(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMomentObj *snap, + virQEMUDriverConfig *cfg, unsigned int flags) { - virObjectEventPtr event; + virObjectEvent *event; bool resume = false; int ret = -1; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *xml = NULL; - virDomainSnapshotDefPtr snapdef = virDomainSnapshotObjGetDef(snap); + virDomainSnapshotDef *snapdef = virDomainSnapshotObjGetDef(snap); bool memory = snapdef->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL; bool memory_unlink = false; bool thaw = false; bool pmsuspended = false; int compressed; g_autoptr(virCommand) compressor = NULL; - virQEMUSaveDataPtr data = NULL; + virQEMUSaveData *data = NULL; g_autoptr(GHashTable) blockNamedNodeData = NULL; /* If quiesce was requested, then issue a freeze command, and a @@ -1486,11 +1484,11 @@ qemuSnapshotCreateActiveExternal(virQEMUDriverPtr driver, if (!(xml = qemuDomainDefFormatLive(driver, priv->qemuCaps, vm->def, priv->origCPU, true, true)) || - !(snapdef->cookie = (virObjectPtr) qemuDomainSaveCookieNew(vm))) + !(snapdef->cookie = (virObject *) qemuDomainSaveCookieNew(vm))) goto cleanup; if (!(data = virQEMUSaveDataNew(xml, - (qemuDomainSaveCookiePtr) snapdef->cookie, + (qemuDomainSaveCookie *) snapdef->cookie, resume, compressed, driver->xmlopt))) goto cleanup; xml = NULL; @@ -1574,22 +1572,22 @@ qemuSnapshotCreateActiveExternal(virQEMUDriverPtr driver, virDomainSnapshotPtr qemuSnapshotCreateXML(virDomainPtr domain, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlDesc, unsigned int flags) { - virQEMUDriverPtr driver = domain->conn->privateData; + virQEMUDriver *driver = domain->conn->privateData; g_autofree char *xml = NULL; - virDomainMomentObjPtr snap = NULL; + virDomainMomentObj *snap = NULL; virDomainSnapshotPtr snapshot = NULL; - virDomainMomentObjPtr current = NULL; + virDomainMomentObj *current = NULL; bool update_current = true; bool redefine = flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE; unsigned int parse_flags = VIR_DOMAIN_SNAPSHOT_PARSE_DISKS; int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL; bool align_match = true; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; virDomainSnapshotState state; g_autoptr(virDomainSnapshotDef) def = NULL; @@ -1849,14 +1847,14 @@ qemuSnapshotCreateXML(virDomainPtr domain, /* The domain is expected to be locked and inactive. */ static int -qemuSnapshotRevertInactive(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainMomentObjPtr snap) +qemuSnapshotRevertInactive(virQEMUDriver *driver, + virDomainObj *vm, + virDomainMomentObj *snap) { /* Prefer action on the disks in use at the time the snapshot was * created; but fall back to current definition if dealing with a * snapshot created prior to libvirt 0.9.5. */ - virDomainDefPtr def = snap->def->dom; + virDomainDef *def = snap->def->dom; if (!def) def = vm->def; @@ -1870,25 +1868,25 @@ qemuSnapshotRevertInactive(virQEMUDriverPtr driver, int -qemuSnapshotRevert(virDomainObjPtr vm, +qemuSnapshotRevert(virDomainObj *vm, virDomainSnapshotPtr snapshot, unsigned int flags) { - virQEMUDriverPtr driver = snapshot->domain->conn->privateData; + virQEMUDriver *driver = snapshot->domain->conn->privateData; int ret = -1; - virDomainMomentObjPtr snap = NULL; - virDomainSnapshotDefPtr snapdef; - virObjectEventPtr event = NULL; - virObjectEventPtr event2 = NULL; + virDomainMomentObj *snap = NULL; + virDomainSnapshotDef *snapdef; + virObjectEvent *event = NULL; + virObjectEvent *event2 = NULL; int detail; - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; int rc; - virDomainDefPtr config = NULL; - virDomainDefPtr inactiveConfig = NULL; + virDomainDef *config = NULL; + virDomainDef *inactiveConfig = NULL; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); bool was_stopped = false; - qemuDomainSaveCookiePtr cookie; - virCPUDefPtr origCPU = NULL; + qemuDomainSaveCookie *cookie; + virCPUDef *origCPU = NULL; unsigned int start_flags = VIR_QEMU_PROCESS_START_GEN_VMID; bool defined = false; @@ -2009,7 +2007,7 @@ qemuSnapshotRevert(virDomainObjPtr vm, } } - cookie = (qemuDomainSaveCookiePtr) snapdef->cookie; + cookie = (qemuDomainSaveCookie *) snapdef->cookie; switch ((virDomainSnapshotState) snapdef->state) { case VIR_DOMAIN_SNAPSHOT_RUNNING: @@ -2311,15 +2309,14 @@ qemuSnapshotRevert(virDomainObjPtr vm, typedef struct _virQEMUMomentReparent virQEMUMomentReparent; -typedef virQEMUMomentReparent *virQEMUMomentReparentPtr; struct _virQEMUMomentReparent { const char *dir; - virDomainMomentObjPtr parent; - virDomainObjPtr vm; - virDomainXMLOptionPtr xmlopt; + virDomainMomentObj *parent; + virDomainObj *vm; + virDomainXMLOption *xmlopt; int err; - int (*writeMetadata)(virDomainObjPtr, virDomainMomentObjPtr, - virDomainXMLOptionPtr, const char *); + int (*writeMetadata)(virDomainObj *, virDomainMomentObj *, + virDomainXMLOption *, const char *); }; @@ -2328,8 +2325,8 @@ qemuSnapshotChildrenReparent(void *payload, const char *name G_GNUC_UNUSED, void *data) { - virDomainMomentObjPtr moment = payload; - virQEMUMomentReparentPtr rep = data; + virDomainMomentObj *moment = payload; + virQEMUMomentReparent *rep = data; if (rep->err < 0) return 0; @@ -2346,13 +2343,13 @@ qemuSnapshotChildrenReparent(void *payload, int -qemuSnapshotDelete(virDomainObjPtr vm, +qemuSnapshotDelete(virDomainObj *vm, virDomainSnapshotPtr snapshot, unsigned int flags) { - virQEMUDriverPtr driver = snapshot->domain->conn->privateData; + virQEMUDriver *driver = snapshot->domain->conn->privateData; int ret = -1; - virDomainMomentObjPtr snap = NULL; + virDomainMomentObj *snap = NULL; virQEMUMomentRemove rem; virQEMUMomentReparent rep; bool metadata_only = !!(flags & VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY); diff --git a/src/qemu/qemu_snapshot.h b/src/qemu/qemu_snapshot.h index cf9bfec542..62ff22221d 100644 --- a/src/qemu/qemu_snapshot.h +++ b/src/qemu/qemu_snapshot.h @@ -23,38 +23,38 @@ #include "qemu_conf.h" #include "qemu_domainjob.h" -virDomainMomentObjPtr -qemuSnapObjFromName(virDomainObjPtr vm, +virDomainMomentObj * +qemuSnapObjFromName(virDomainObj *vm, const char *name); -virDomainMomentObjPtr -qemuSnapObjFromSnapshot(virDomainObjPtr vm, +virDomainMomentObj * +qemuSnapObjFromSnapshot(virDomainObj *vm, virDomainSnapshotPtr snapshot); int -qemuSnapshotFSFreeze(virDomainObjPtr vm, +qemuSnapshotFSFreeze(virDomainObj *vm, const char **mountpoints, unsigned int nmountpoints); int -qemuSnapshotFSThaw(virDomainObjPtr vm, +qemuSnapshotFSThaw(virDomainObj *vm, bool report); virDomainSnapshotPtr qemuSnapshotCreateXML(virDomainPtr domain, - virDomainObjPtr vm, + virDomainObj *vm, const char *xmlDesc, unsigned int flags); int -qemuSnapshotRevert(virDomainObjPtr vm, +qemuSnapshotRevert(virDomainObj *vm, virDomainSnapshotPtr snapshot, unsigned int flags); int -qemuSnapshotDelete(virDomainObjPtr vm, +qemuSnapshotDelete(virDomainObj *vm, virDomainSnapshotPtr snapshot, unsigned int flags); int -qemuSnapshotCreateDisksTransient(virDomainObjPtr vm, +qemuSnapshotCreateDisksTransient(virDomainObj *vm, qemuDomainAsyncJob asyncJob); diff --git a/src/qemu/qemu_tpm.c b/src/qemu/qemu_tpm.c index 65a6d3781b..9ae7e5f94b 100644 --- a/src/qemu/qemu_tpm.c +++ b/src/qemu/qemu_tpm.c @@ -166,7 +166,7 @@ qemuTPMCreateEmulatorStorage(const char *storagepath, static void -qemuTPMDeleteEmulatorStorage(virDomainTPMDefPtr tpm) +qemuTPMDeleteEmulatorStorage(virDomainTPMDef *tpm) { g_autofree char *path = g_path_get_dirname(tpm->data.emulator.storagepath); @@ -201,7 +201,7 @@ qemuTPMCreateEmulatorSocket(const char *swtpmStateDir, * @uuid: the UUID of the VM */ static int -qemuTPMEmulatorInitPaths(virDomainTPMDefPtr tpm, +qemuTPMEmulatorInitPaths(virDomainTPMDef *tpm, const char *swtpmStorageDir, const char *logDir, const char *vmname, @@ -286,7 +286,7 @@ qemuTPMEmulatorGetPid(const char *swtpmStateDir, * the socket between tss and qemu users. */ static int -qemuTPMEmulatorPrepareHost(virDomainTPMDefPtr tpm, +qemuTPMEmulatorPrepareHost(virDomainTPMDef *tpm, const char *logDir, uid_t swtpm_user, gid_t swtpm_group, @@ -358,7 +358,7 @@ qemuTPMEmulatorPrepareHost(virDomainTPMDefPtr tpm, */ static int qemuTPMSetupEncryption(const unsigned char *secretuuid, - virCommandPtr cmd) + virCommand *cmd) { g_autoptr(virConnect) conn = NULL; g_autofree uint8_t *secret = NULL; @@ -516,8 +516,8 @@ qemuTPMEmulatorRunSetup(const char *storagepath, * Do some initializations on the way, such as creation of storage * and emulator setup. */ -static virCommandPtr -qemuTPMEmulatorBuildCommand(virDomainTPMDefPtr tpm, +static virCommand * +qemuTPMEmulatorBuildCommand(virDomainTPMDef *tpm, const char *vmname, const unsigned char *vmuuid, bool privileged, @@ -630,7 +630,7 @@ static void qemuTPMEmulatorStop(const char *swtpmStateDir, const char *shortName) { - virCommandPtr cmd; + virCommand *cmd; g_autofree char *pathname = NULL; g_autofree char *errbuf = NULL; g_autofree char *swtpm_ioctl = virTPMGetSwtpmIoctl(); @@ -665,8 +665,8 @@ qemuTPMEmulatorStop(const char *swtpmStateDir, int -qemuExtTPMInitPaths(virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuExtTPMInitPaths(virQEMUDriver *driver, + virDomainDef *def) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); size_t i; @@ -687,8 +687,8 @@ qemuExtTPMInitPaths(virQEMUDriverPtr driver, int -qemuExtTPMPrepareHost(virQEMUDriverPtr driver, - virDomainDefPtr def) +qemuExtTPMPrepareHost(virQEMUDriver *driver, + virDomainDef *def) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autofree char *shortName = NULL; @@ -714,7 +714,7 @@ qemuExtTPMPrepareHost(virQEMUDriverPtr driver, void -qemuExtTPMCleanupHost(virDomainDefPtr def) +qemuExtTPMCleanupHost(virDomainDef *def) { size_t i; @@ -740,9 +740,9 @@ qemuExtTPMCleanupHost(virDomainDefPtr def) * - start the external TPM Emulator and sync with it before QEMU start */ static int -qemuExtTPMStartEmulator(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainTPMDefPtr tpm, +qemuExtTPMStartEmulator(virQEMUDriver *driver, + virDomainObj *vm, + virDomainTPMDef *tpm, bool incomingMigration) { g_autoptr(virCommand) cmd = NULL; @@ -812,8 +812,8 @@ qemuExtTPMStartEmulator(virQEMUDriverPtr driver, int -qemuExtTPMStart(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuExtTPMStart(virQEMUDriver *driver, + virDomainObj *vm, bool incomingMigration) { size_t i; @@ -831,8 +831,8 @@ qemuExtTPMStart(virQEMUDriverPtr driver, void -qemuExtTPMStop(virQEMUDriverPtr driver, - virDomainObjPtr vm) +qemuExtTPMStop(virQEMUDriver *driver, + virDomainObj *vm) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); size_t i; @@ -856,9 +856,9 @@ qemuExtTPMStop(virQEMUDriverPtr driver, int -qemuExtTPMSetupCgroup(virQEMUDriverPtr driver, - virDomainDefPtr def, - virCgroupPtr cgroup) +qemuExtTPMSetupCgroup(virQEMUDriver *driver, + virDomainDef *def, + virCgroup *cgroup) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); int rc; diff --git a/src/qemu/qemu_tpm.h b/src/qemu/qemu_tpm.h index 3db0797fab..da8ce4c369 100644 --- a/src/qemu/qemu_tpm.h +++ b/src/qemu/qemu_tpm.h @@ -22,31 +22,31 @@ #include "vircommand.h" -int qemuExtTPMInitPaths(virQEMUDriverPtr driver, - virDomainDefPtr def) +int qemuExtTPMInitPaths(virQEMUDriver *driver, + virDomainDef *def) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int qemuExtTPMPrepareHost(virQEMUDriverPtr driver, - virDomainDefPtr def) +int qemuExtTPMPrepareHost(virQEMUDriver *driver, + virDomainDef *def) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -void qemuExtTPMCleanupHost(virDomainDefPtr def) +void qemuExtTPMCleanupHost(virDomainDef *def) ATTRIBUTE_NONNULL(1); -int qemuExtTPMStart(virQEMUDriverPtr driver, - virDomainObjPtr vm, +int qemuExtTPMStart(virQEMUDriver *driver, + virDomainObj *vm, bool incomingMigration) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -void qemuExtTPMStop(virQEMUDriverPtr driver, - virDomainObjPtr vm) +void qemuExtTPMStop(virQEMUDriver *driver, + virDomainObj *vm) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int qemuExtTPMSetupCgroup(virQEMUDriverPtr driver, - virDomainDefPtr def, - virCgroupPtr cgroup) +int qemuExtTPMSetupCgroup(virQEMUDriver *driver, + virDomainDef *def, + virCgroup *cgroup) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 27afcab9aa..18c851d693 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -36,7 +36,7 @@ VIR_LOG_INIT("qemu.qemu_validate"); static int qemuValidateDomainDefPSeriesFeature(const virDomainDef *def, - virQEMUCapsPtr qemuCaps, + virQEMUCaps *qemuCaps, int feature) { const char *str; @@ -175,7 +175,7 @@ qemuValidateDomainDefPSeriesFeature(const virDomainDef *def, static int qemuValidateDomainDefFeatures(const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i; @@ -344,11 +344,11 @@ qemuValidateDomainDefFeatures(const virDomainDef *def, static int -qemuValidateDomainDefCpu(virQEMUDriverPtr driver, +qemuValidateDomainDefCpu(virQEMUDriver *driver, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { - virCPUDefPtr cpu = def->cpu; + virCPUDef *cpu = def->cpu; if (!cpu) return 0; @@ -407,12 +407,12 @@ qemuValidateDomainDefCpu(virQEMUDriverPtr driver, static int qemuValidateDomainDefClockTimers(const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i; for (i = 0; i < def->clock.ntimers; i++) { - virDomainTimerDefPtr timer = def->clock.timers[i]; + virDomainTimerDef *timer = def->clock.timers[i]; switch ((virDomainTimerNameType)timer->name) { case VIR_DOMAIN_TIMER_NAME_PLATFORM: @@ -558,7 +558,7 @@ qemuValidateDomainDefClockTimers(const virDomainDef *def, static int qemuValidateDomainDefPM(const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { bool q35Dom = qemuDomainIsQ35(def); @@ -590,7 +590,7 @@ qemuValidateDomainDefPM(const virDomainDef *def, static int qemuValidateDomainDefBoot(const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (def->os.loader && def->os.loader->secure == VIR_TRISTATE_BOOL_YES) { @@ -674,7 +674,7 @@ qemuValidateDefGetVcpuHotplugGranularity(const virDomainDef *def) static int -qemuValidateDomainVCpuTopology(const virDomainDef *def, virQEMUCapsPtr qemuCaps) +qemuValidateDomainVCpuTopology(const virDomainDef *def, virQEMUCaps *qemuCaps) { unsigned int maxCpus = virQEMUCapsGetMachineMaxCpus(qemuCaps, def->virtType, def->os.machine); @@ -753,7 +753,7 @@ qemuValidateDomainVCpuTopology(const virDomainDef *def, virQEMUCapsPtr qemuCaps) static int qemuValidateDomainDefMemory(const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { const char *defaultRAMid = virQEMUCapsGetMachineDefaultRAMid(qemuCaps, def->virtType, @@ -812,7 +812,7 @@ qemuValidateDomainDefMemory(const virDomainDef *def, static int qemuValidateDomainDefNuma(const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { const long system_page_size = virGetSystemPageSizeKB(); size_t ncells = virDomainNumaGetNodeCount(def->numa); @@ -839,7 +839,7 @@ qemuValidateDomainDefNuma(const virDomainDef *def, } for (i = 0; i < ncells; i++) { - virBitmapPtr cpumask = virDomainNumaGetNodeCpumask(def->numa, i); + virBitmap *cpumask = virDomainNumaGetNodeCpumask(def->numa, i); if (!hasMemoryCap && virDomainNumaGetNodeMemoryAccessMode(def->numa, i)) { @@ -901,13 +901,13 @@ qemuValidateDomainDefNuma(const virDomainDef *def, static int qemuValidateDomainDefConsole(const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i; /* Explicit console devices */ for (i = 0; i < def->nconsoles; i++) { - virDomainChrDefPtr console = def->consoles[i]; + virDomainChrDef *console = def->consoles[i]; switch (console->targetType) { case VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_SCLP: @@ -944,7 +944,7 @@ qemuValidateDomainDefConsole(const virDomainDef *def, static int qemuValidateDomainDefSysinfo(const virSysinfoDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i; @@ -978,7 +978,7 @@ qemuValidateDomainDefSysinfo(const virSysinfoDef *def, static int qemuValidateDomainDefPanic(const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i; @@ -1070,12 +1070,12 @@ qemuValidateDomainDefPanic(const virDomainDef *def, static int -qemuValidateDomainDeviceInfo(virDomainDefPtr def G_GNUC_UNUSED, - virDomainDeviceDefPtr dev G_GNUC_UNUSED, - virDomainDeviceInfoPtr info, +qemuValidateDomainDeviceInfo(virDomainDef *def G_GNUC_UNUSED, + virDomainDeviceDef *dev G_GNUC_UNUSED, + virDomainDeviceInfo *info, void *opaque) { - virQEMUCapsPtr qemuCaps = opaque; + virQEMUCaps *qemuCaps = opaque; if (info->acpiIndex) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_ACPI_INDEX)) { @@ -1100,10 +1100,10 @@ qemuValidateDomainDef(const virDomainDef *def, void *opaque, void *parseOpaque) { - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autoptr(virQEMUCaps) qemuCapsLocal = NULL; - virQEMUCapsPtr qemuCaps = parseOpaque; + virQEMUCaps *qemuCaps = parseOpaque; size_t i; if (!qemuCaps) { @@ -1265,7 +1265,7 @@ qemuValidateDomainDef(const virDomainDef *def, * we know our callback qemuValidateDomainDeviceInfo will * not modify it */ - if (virDomainDeviceInfoIterate((virDomainDefPtr)def, + if (virDomainDeviceInfoIterate((virDomainDef *)def, qemuValidateDomainDeviceInfo, qemuCaps) < 0) return -1; @@ -1275,10 +1275,10 @@ qemuValidateDomainDef(const virDomainDef *def, static int -qemuValidateDomainDeviceDefZPCIAddress(virDomainDeviceInfoPtr info, - virQEMUCapsPtr qemuCaps) +qemuValidateDomainDeviceDefZPCIAddress(virDomainDeviceInfo *info, + virQEMUCaps *qemuCaps) { - virZPCIDeviceAddressPtr zpci = &info->addr.pci.zpci; + virZPCIDeviceAddress *zpci = &info->addr.pci.zpci; if (virZPCIDeviceAddressIsPresent(zpci) && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_ZPCI)) { @@ -1308,9 +1308,9 @@ qemuValidateDomainDeviceDefZPCIAddress(virDomainDeviceInfoPtr info, static int qemuValidateDomainDeviceDefAddress(const virDomainDeviceDef *dev, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { - virDomainDeviceInfoPtr info; + virDomainDeviceInfo *info; if (!(info = virDomainDeviceGetInfo((virDomainDeviceDef *)dev))) return 0; @@ -1328,7 +1328,7 @@ qemuValidateDomainDeviceDefAddress(const virDomainDeviceDef *dev, break; case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO: { - virDomainDeviceSpaprVioAddressPtr addr = &(info->addr.spaprvio); + virDomainDeviceSpaprVioAddress *addr = &(info->addr.spaprvio); if (addr->has_reg && addr->reg > 0xffffffff) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -1391,7 +1391,7 @@ qemuValidateNetSupportsCoalesce(virDomainNetType type) static int qemuValidateDomainVirtioOptions(const virDomainVirtioOptions *virtio, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (!virtio) return 0; @@ -1438,7 +1438,7 @@ qemuValidateDomainVirtioOptions(const virDomainVirtioOptions *virtio, static int qemuValidateDomainDefVhostUserRequireSharedMemory(const virDomainDef *def, const char *name, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { const char *defaultRAMId = virQEMUCapsGetMachineDefaultRAMid(qemuCaps, def->virtType, @@ -1485,7 +1485,7 @@ qemuValidateDomainDefVhostUserRequireSharedMemory(const virDomainDef *def, static int qemuValidateDomainDeviceDefNetwork(const virDomainNetDef *net, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { bool hasIPv4 = false; bool hasIPv6 = false; @@ -1804,7 +1804,7 @@ qemuValidateDomainChrTargetDef(const virDomainChrDef *chr) static int qemuValidateDomainChrSourceDef(const virDomainChrSourceDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { switch ((virDomainChrType)def->type) { case VIR_DOMAIN_CHR_TYPE_TCP: @@ -1855,7 +1855,7 @@ qemuValidateDomainChrSourceDef(const virDomainChrSourceDef *def, static int qemuValidateDomainChrDef(const virDomainChrDef *dev, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (qemuValidateDomainChrSourceDef(dev->source, qemuCaps) < 0) return -1; @@ -1914,7 +1914,7 @@ qemuValidateDomainChrDef(const virDomainChrDef *dev, static int qemuValidateDomainSmartcardDef(const virDomainSmartcardDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { switch (def->type) { case VIR_DOMAIN_SMARTCARD_TYPE_HOST: @@ -1959,7 +1959,7 @@ qemuValidateDomainSmartcardDef(const virDomainSmartcardDef *def, static int qemuValidateDomainRNGDef(const virDomainRNGDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { virDomainCapsDeviceRNG rngCaps = { 0 }; @@ -2020,7 +2020,7 @@ qemuValidateDomainRNGDef(const virDomainRNGDef *def, static int qemuValidateDomainRedirdevDef(const virDomainRedirdevDef *dev, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (qemuValidateDomainChrSourceDef(dev->source, qemuCaps) < 0) return -1; @@ -2101,7 +2101,7 @@ qemuValidateDomainWatchdogDef(const virDomainWatchdogDef *dev, static int qemuValidateDomainMdevDefVFIOPCI(const virDomainHostdevDef *hostdev, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { const virDomainHostdevSubsysMediatedDev *dev; @@ -2156,7 +2156,7 @@ qemuValidateDomainMdevDefVFIOPCI(const virDomainHostdevDef *hostdev, static int qemuValidateDomainMdevDefVFIOAP(const virDomainHostdevDef *hostdev, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { size_t i; bool vfioap_found = false; @@ -2179,7 +2179,7 @@ qemuValidateDomainMdevDefVFIOAP(const virDomainHostdevDef *hostdev, /* VFIO-AP is restricted to a single mediated device only */ for (i = 0; i < def->nhostdevs; i++) { - virDomainHostdevDefPtr hdev = def->hostdevs[i]; + virDomainHostdevDef *hdev = def->hostdevs[i]; if (virHostdevIsMdevDevice(hdev) && hdev->source.subsys.u.mdev.model == VIR_MDEV_MODEL_TYPE_VFIO_AP) { @@ -2200,7 +2200,7 @@ qemuValidateDomainMdevDefVFIOAP(const virDomainHostdevDef *hostdev, static int qemuValidateDomainMdevDef(const virDomainHostdevDef *hostdev, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { const virDomainHostdevSubsysMediatedDev *mdevsrc; @@ -2232,7 +2232,7 @@ qemuValidateDomainMdevDef(const virDomainHostdevDef *hostdev, static int qemuValidateDomainDeviceDefHostdev(const virDomainHostdevDef *hostdev, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { int backend; @@ -2303,7 +2303,7 @@ qemuValidateDomainDeviceDefHostdev(const virDomainHostdevDef *hostdev, static int qemuValidateDomainDeviceDefVideo(const virDomainVideoDef *video, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { virDomainCapsDeviceVideo videoCaps = { 0 }; @@ -2439,9 +2439,9 @@ qemuValidateDomainDeviceDefDiskSerial(const char *value) static int qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { - virDomainDeviceInfoPtr diskInfo; + virDomainDeviceInfo *diskInfo; int cModel; if (disk->geometry.cylinders > 0 && @@ -2606,7 +2606,7 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk, switch (disk->bus) { case VIR_DOMAIN_DISK_BUS_SCSI: - diskInfo = (virDomainDeviceInfoPtr)&disk->info; + diskInfo = (virDomainDeviceInfo *)&disk->info; cModel = qemuDomainFindSCSIControllerModel(def, diskInfo); if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) { @@ -2834,7 +2834,7 @@ qemuValidateDomainDeviceDefDiskFrontend(const virDomainDiskDef *disk, static int qemuValidateDomainDeviceDefDiskBlkdeviotune(const virDomainDiskDef *disk, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { /* group_name by itself is ignored by qemu */ if (disk->blkdeviotune.group_name && @@ -2850,7 +2850,7 @@ qemuValidateDomainDeviceDefDiskBlkdeviotune(const virDomainDiskDef *disk, size_t i; for (i = 0; i < def->ndisks; i++) { - virDomainDiskDefPtr d = def->disks[i]; + virDomainDiskDef *d = def->disks[i]; if (STREQ(d->dst, disk->dst) || STRNEQ_NULLABLE(d->blkdeviotune.group_name, @@ -2919,7 +2919,7 @@ qemuValidateDomainDeviceDefDiskBlkdeviotune(const virDomainDiskDef *disk, static int qemuValidateDomainDeviceDefDiskTransient(const virDomainDiskDef *disk, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { virStorageType actualType = virStorageSourceGetActualType(disk->src); @@ -2967,11 +2967,11 @@ qemuValidateDomainDeviceDefDiskTransient(const virDomainDiskDef *disk, int qemuValidateDomainDeviceDefDisk(const virDomainDiskDef *disk, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { const char *driverName = virDomainDiskGetDriver(disk); bool isSD = qemuDiskBusIsSD(disk->bus); - virStorageSourcePtr n; + virStorageSource *n; int idx; int partition; @@ -3049,7 +3049,7 @@ qemuValidateDomainDeviceDefDisk(const virDomainDiskDef *disk, * Returns true if acceptable, false otherwise with error message set. */ static bool -qemuValidateCheckSCSIControllerModel(virQEMUCapsPtr qemuCaps, +qemuValidateCheckSCSIControllerModel(virQEMUCaps *qemuCaps, int model) { switch ((virDomainControllerModelSCSI) model) { @@ -3141,7 +3141,7 @@ qemuValidateCheckSCSIControllerModel(virQEMUCapsPtr qemuCaps, static int qemuValidateDomainDeviceDefControllerSATA(const virDomainControllerDef *controller, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { /* first SATA controller on Q35 machines is implicit */ if (controller->idx == 0 && qemuDomainIsQ35(def)) @@ -3310,7 +3310,7 @@ virValidateControllerPCIModelNameToQEMUCaps(int modelName) static int qemuValidateDomainDeviceDefControllerAttributes(const virDomainControllerDef *controller, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (!(controller->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI && (controller->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_VIRTIO_SCSI || @@ -3374,7 +3374,7 @@ qemuValidateDomainDeviceDefControllerAttributes(const virDomainControllerDef *co static int qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { const virDomainPCIControllerOpts *pciopts = &cont->opts.pciopts; @@ -3878,7 +3878,7 @@ qemuValidateDomainDeviceDefControllerPCI(const virDomainControllerDef *cont, static int qemuValidateDomainDeviceDefController(const virDomainControllerDef *controller, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { int ret = 0; @@ -3928,14 +3928,14 @@ qemuValidateDomainDeviceDefController(const virDomainControllerDef *controller, static int qemuValidateDomainDeviceDefSPICEGraphics(const virDomainGraphicsDef *graphics, - virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps) + virQEMUDriver *driver, + virQEMUCaps *qemuCaps) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); - virDomainGraphicsListenDefPtr glisten = NULL; + virDomainGraphicsListenDef *glisten = NULL; int tlsPort = graphics->data.spice.tlsPort; - glisten = virDomainGraphicsGetListen((virDomainGraphicsDefPtr)graphics, 0); + glisten = virDomainGraphicsGetListen((virDomainGraphicsDef *)graphics, 0); if (!glisten) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing listen element")); @@ -3996,7 +3996,7 @@ qemuValidateDomainDeviceDefSPICEGraphics(const virDomainGraphicsDef *graphics, static int qemuValidateDomainDeviceDefVNCGraphics(const virDomainGraphicsDef *graphics, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (graphics->data.vnc.powerControl != VIR_TRISTATE_BOOL_ABSENT && !virQEMUCapsGet(qemuCaps, QEMU_CAPS_VNC_POWER_CONTROL)) { @@ -4012,8 +4012,8 @@ qemuValidateDomainDeviceDefVNCGraphics(const virDomainGraphicsDef *graphics, static int qemuValidateDomainDeviceDefGraphics(const virDomainGraphicsDef *graphics, const virDomainDef *def, - virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps) + virQEMUDriver *driver, + virQEMUCaps *qemuCaps) { virDomainCapsDeviceGraphics graphicsCaps = { 0 }; bool have_egl_headless = false; @@ -4108,10 +4108,10 @@ qemuValidateDomainDeviceDefGraphics(const virDomainGraphicsDef *graphics, static int -qemuValidateDomainDeviceDefFS(virDomainFSDefPtr fs, +qemuValidateDomainDeviceDefFS(virDomainFSDef *fs, const virDomainDef *def, - virQEMUDriverPtr driver, - virQEMUCapsPtr qemuCaps) + virQEMUDriver *driver, + virQEMUCaps *qemuCaps) { if (fs->type != VIR_DOMAIN_FS_TYPE_MOUNT) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -4230,8 +4230,8 @@ qemuValidateDomainDeviceDefFS(virDomainFSDefPtr fs, static int -qemuValidateDomainDeviceDefAudio(virDomainAudioDefPtr audio, - virQEMUCapsPtr qemuCaps G_GNUC_UNUSED) +qemuValidateDomainDeviceDefAudio(virDomainAudioDef *audio, + virQEMUCaps *qemuCaps G_GNUC_UNUSED) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_AUDIODEV)) { if (audio->input.mixingEngine == VIR_TRISTATE_BOOL_NO || @@ -4367,8 +4367,8 @@ qemuSoundCodecTypeToCaps(int type) static int -qemuValidateDomainDeviceDefSound(virDomainSoundDefPtr sound, - virQEMUCapsPtr qemuCaps) +qemuValidateDomainDeviceDefSound(virDomainSoundDef *sound, + virQEMUCaps *qemuCaps) { size_t i; @@ -4428,7 +4428,7 @@ qemuValidateDomainDeviceDefSound(virDomainSoundDefPtr sound, static int qemuValidateDomainDeviceDefVsock(const virDomainVsockDef *vsock, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VHOST_VSOCK)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -4451,7 +4451,7 @@ qemuValidateDomainDeviceDefVsock(const virDomainVsockDef *vsock, static int qemuValidateDomainDeviceDefTPM(virDomainTPMDef *tpm, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { virQEMUCapsFlags flag; @@ -4558,7 +4558,7 @@ qemuValidateDomainDeviceDefTPM(virDomainTPMDef *tpm, static int qemuValidateDomainDeviceDefInput(const virDomainInputDef *input, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { const char *baseName; int cap; @@ -4662,7 +4662,7 @@ qemuValidateDomainDeviceDefInput(const virDomainInputDef *input, static int qemuValidateDomainDeviceDefMemballoon(const virDomainMemballoonDef *memballoon, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (!memballoon || memballoon->model == VIR_DOMAIN_MEMBALLOON_MODEL_NONE) { @@ -4702,7 +4702,7 @@ qemuValidateDomainDeviceDefMemballoon(const virDomainMemballoonDef *memballoon, static int qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef *iommu, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { switch (iommu->model) { case VIR_DOMAIN_IOMMU_MODEL_INTEL: @@ -4792,9 +4792,9 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef *iommu, static int -qemuValidateDomainDeviceDefNVRAM(virDomainNVRAMDefPtr nvram, +qemuValidateDomainDeviceDefNVRAM(virDomainNVRAMDef *nvram, const virDomainDef *def, - virQEMUCapsPtr qemuCaps) + virQEMUCaps *qemuCaps) { if (!nvram) return 0; @@ -4825,8 +4825,8 @@ qemuValidateDomainDeviceDefNVRAM(virDomainNVRAMDefPtr nvram, static int -qemuValidateDomainDeviceDefHub(virDomainHubDefPtr hub, - virQEMUCapsPtr qemuCaps) +qemuValidateDomainDeviceDefHub(virDomainHubDef *hub, + virQEMUCaps *qemuCaps) { if (hub->type != VIR_DOMAIN_HUB_TYPE_USB) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -4846,8 +4846,8 @@ qemuValidateDomainDeviceDefHub(virDomainHubDefPtr hub, static int -qemuValidateDomainDeviceDefMemory(virDomainMemoryDefPtr mem, - virQEMUCapsPtr qemuCaps) +qemuValidateDomainDeviceDefMemory(virDomainMemoryDef *mem, + virQEMUCaps *qemuCaps) { switch (mem->model) { case VIR_DOMAIN_MEMORY_MODEL_DIMM: @@ -4892,8 +4892,8 @@ qemuValidateDomainDeviceDefMemory(virDomainMemoryDefPtr mem, static int -qemuValidateDomainDeviceDefShmem(virDomainShmemDefPtr shmem, - virQEMUCapsPtr qemuCaps) +qemuValidateDomainDeviceDefShmem(virDomainShmemDef *shmem, + virQEMUCaps *qemuCaps) { switch (shmem->model) { case VIR_DOMAIN_SHMEM_MODEL_IVSHMEM: @@ -4936,9 +4936,9 @@ qemuValidateDomainDeviceDef(const virDomainDeviceDef *dev, void *parseOpaque) { int ret = 0; - virQEMUDriverPtr driver = opaque; + virQEMUDriver *driver = opaque; g_autoptr(virQEMUCaps) qemuCapsLocal = NULL; - virQEMUCapsPtr qemuCaps = parseOpaque; + virQEMUCaps *qemuCaps = parseOpaque; if (!qemuCaps) { if (!(qemuCapsLocal = virQEMUCapsCacheLookup(driver->qemuCapsCache, diff --git a/src/qemu/qemu_validate.h b/src/qemu/qemu_validate.h index b6c5441f90..271460d019 100644 --- a/src/qemu/qemu_validate.h +++ b/src/qemu/qemu_validate.h @@ -31,7 +31,7 @@ int qemuValidateDomainDef(const virDomainDef *def, void *parseOpaque); int qemuValidateDomainDeviceDefDisk(const virDomainDiskDef *disk, const virDomainDef *def, - virQEMUCapsPtr qemuCaps); + virQEMUCaps *qemuCaps); int qemuValidateDomainDeviceDef(const virDomainDeviceDef *dev, const virDomainDef *def, void *opaque, diff --git a/src/qemu/qemu_vhost_user.c b/src/qemu/qemu_vhost_user.c index a9f6f3192d..bc8e7ad898 100644 --- a/src/qemu/qemu_vhost_user.c +++ b/src/qemu/qemu_vhost_user.c @@ -92,7 +92,6 @@ VIR_ENUM_IMPL(qemuVhostUserGPUFeature, ); typedef struct _qemuVhostUserGPU qemuVhostUserGPU; -typedef qemuVhostUserGPU *qemuVhostUserGPUPtr; struct _qemuVhostUserGPU { size_t nfeatures; qemuVhostUserGPUFeature *features; @@ -121,7 +120,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuVhostUserGPUFeature, qemuVhostUserGPUFeatureFr void -qemuVhostUserFree(qemuVhostUserPtr vu) +qemuVhostUserFree(qemuVhostUser *vu) { if (!vu) return; @@ -141,8 +140,8 @@ qemuVhostUserFree(qemuVhostUserPtr vu) static int qemuVhostUserTypeParse(const char *path, - virJSONValuePtr doc, - qemuVhostUserPtr vu) + virJSONValue *doc, + qemuVhostUser *vu) { const char *type = virJSONValueObjectGetString(doc, "type"); int tmp; @@ -165,8 +164,8 @@ qemuVhostUserTypeParse(const char *path, static int qemuVhostUserBinaryParse(const char *path, - virJSONValuePtr doc, - qemuVhostUserPtr vu) + virJSONValue *doc, + qemuVhostUser *vu) { const char *binary = virJSONValueObjectGetString(doc, "binary"); @@ -179,7 +178,7 @@ qemuVhostUserBinaryParse(const char *path, } -qemuVhostUserPtr +qemuVhostUser * qemuVhostUserParse(const char *path) { g_autofree char *cont = NULL; @@ -209,7 +208,7 @@ qemuVhostUserParse(const char *path) char * -qemuVhostUserFormat(qemuVhostUserPtr vu) +qemuVhostUserFormat(qemuVhostUser *vu) { g_autoptr(virJSONValue) doc = NULL; @@ -239,12 +238,12 @@ qemuVhostUserFetchConfigs(char ***configs, static ssize_t qemuVhostUserFetchParsedConfigs(bool privileged, - qemuVhostUserPtr **vhostuserRet, + qemuVhostUser ***vhostuserRet, char ***pathsRet) { g_auto(GStrv) paths = NULL; size_t npaths; - qemuVhostUserPtr *vus = NULL; + qemuVhostUser **vus = NULL; size_t i; if (qemuVhostUserFetchConfigs(&paths, privileged) < 0) @@ -254,7 +253,7 @@ qemuVhostUserFetchParsedConfigs(bool privileged, return 0; npaths = g_strv_length(paths); - vus = g_new0(qemuVhostUserPtr, npaths); + vus = g_new0(qemuVhostUser *, npaths); for (i = 0; i < npaths; i++) { if (!(vus[i] = qemuVhostUserParse(paths[i]))) @@ -275,11 +274,11 @@ qemuVhostUserFetchParsedConfigs(bool privileged, static int -qemuVhostUserGPUFillCapabilities(qemuVhostUserPtr vu, - virJSONValuePtr doc) +qemuVhostUserGPUFillCapabilities(qemuVhostUser *vu, + virJSONValue *doc) { - qemuVhostUserGPUPtr gpu = &vu->capabilities.gpu; - virJSONValuePtr featuresJSON; + qemuVhostUserGPU *gpu = &vu->capabilities.gpu; + virJSONValue *featuresJSON; size_t nfeatures; size_t i; g_autoptr(qemuVhostUserGPUFeature) features = NULL; @@ -295,7 +294,7 @@ qemuVhostUserGPUFillCapabilities(qemuVhostUserPtr vu, features = g_new0(qemuVhostUserGPUFeature, nfeatures); for (i = 0; i < nfeatures; i++) { - virJSONValuePtr item = virJSONValueArrayGet(featuresJSON, i); + virJSONValue *item = virJSONValueArrayGet(featuresJSON, i); const char *tmpStr = virJSONValueGetString(item); int tmp; @@ -317,7 +316,7 @@ qemuVhostUserGPUFillCapabilities(qemuVhostUserPtr vu, static bool -qemuVhostUserGPUHasFeature(qemuVhostUserGPUPtr gpu, +qemuVhostUserGPUHasFeature(qemuVhostUserGPU *gpu, qemuVhostUserGPUFeature feature) { size_t i; @@ -332,11 +331,11 @@ qemuVhostUserGPUHasFeature(qemuVhostUserGPUPtr gpu, int -qemuVhostUserFillDomainGPU(virQEMUDriverPtr driver, - virDomainVideoDefPtr video) +qemuVhostUserFillDomainGPU(virQEMUDriver *driver, + virDomainVideoDef *video) { - qemuVhostUserPtr *vus = NULL; - qemuVhostUserPtr vu = NULL; + qemuVhostUser **vus = NULL; + qemuVhostUser *vu = NULL; ssize_t nvus = 0; ssize_t i; int ret = -1; @@ -418,10 +417,10 @@ qemuVhostUserFillDomainGPU(virQEMUDriverPtr driver, int -qemuVhostUserFillDomainFS(virQEMUDriverPtr driver, - virDomainFSDefPtr fs) +qemuVhostUserFillDomainFS(virQEMUDriver *driver, + virDomainFSDef *fs) { - qemuVhostUserPtr *vus = NULL; + qemuVhostUser **vus = NULL; ssize_t nvus = 0; ssize_t i; int ret = -1; @@ -431,7 +430,7 @@ qemuVhostUserFillDomainFS(virQEMUDriverPtr driver, goto end; for (i = 0; i < nvus; i++) { - qemuVhostUserPtr vu = vus[i]; + qemuVhostUser *vu = vus[i]; if (vu->type != QEMU_VHOST_USER_TYPE_FS) continue; diff --git a/src/qemu/qemu_vhost_user.h b/src/qemu/qemu_vhost_user.h index e505c8a473..f4ae1839d1 100644 --- a/src/qemu/qemu_vhost_user.h +++ b/src/qemu/qemu_vhost_user.h @@ -25,27 +25,26 @@ #include "virarch.h" typedef struct _qemuVhostUser qemuVhostUser; -typedef qemuVhostUser *qemuVhostUserPtr; void -qemuVhostUserFree(qemuVhostUserPtr fw); +qemuVhostUserFree(qemuVhostUser *fw); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuVhostUser, qemuVhostUserFree); -qemuVhostUserPtr +qemuVhostUser * qemuVhostUserParse(const char *path); char * -qemuVhostUserFormat(qemuVhostUserPtr fw); +qemuVhostUserFormat(qemuVhostUser *fw); int qemuVhostUserFetchConfigs(char ***configs, bool privileged); int -qemuVhostUserFillDomainGPU(virQEMUDriverPtr driver, - virDomainVideoDefPtr video); +qemuVhostUserFillDomainGPU(virQEMUDriver *driver, + virDomainVideoDef *video); int -qemuVhostUserFillDomainFS(virQEMUDriverPtr driver, - virDomainFSDefPtr fs); +qemuVhostUserFillDomainFS(virQEMUDriver *driver, + virDomainFSDef *fs); diff --git a/src/qemu/qemu_vhost_user_gpu.c b/src/qemu/qemu_vhost_user_gpu.c index 6a37e165ba..ef198a4820 100644 --- a/src/qemu/qemu_vhost_user_gpu.c +++ b/src/qemu/qemu_vhost_user_gpu.c @@ -83,8 +83,8 @@ qemuVhostUserGPUGetPid(const char *binPath, } -int qemuExtVhostUserGPUPrepareDomain(virQEMUDriverPtr driver, - virDomainVideoDefPtr video) +int qemuExtVhostUserGPUPrepareDomain(virQEMUDriver *driver, + virDomainVideoDef *video) { return qemuVhostUserFillDomainGPU(driver, video); } @@ -101,9 +101,9 @@ int qemuExtVhostUserGPUPrepareDomain(virQEMUDriverPtr driver, * - have the command line built * - start the external process and sync with it before QEMU start */ -int qemuExtVhostUserGPUStart(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainVideoDefPtr video) +int qemuExtVhostUserGPUStart(virQEMUDriver *driver, + virDomainObj *vm, + virDomainVideoDef *video) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autofree char *shortname = NULL; @@ -205,9 +205,9 @@ int qemuExtVhostUserGPUStart(virQEMUDriverPtr driver, * Check if vhost-user process pidfile is around, kill the process, * and remove the pidfile. */ -void qemuExtVhostUserGPUStop(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainVideoDefPtr video) +void qemuExtVhostUserGPUStop(virQEMUDriver *driver, + virDomainObj *vm, + virDomainVideoDef *video) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autofree char *pidfile = NULL; @@ -239,10 +239,10 @@ void qemuExtVhostUserGPUStop(virQEMUDriverPtr driver, * Add the vhost-user-gpu PID to the given cgroup. */ int -qemuExtVhostUserGPUSetupCgroup(virQEMUDriverPtr driver, - virDomainDefPtr def, - virDomainVideoDefPtr video, - virCgroupPtr cgroup) +qemuExtVhostUserGPUSetupCgroup(virQEMUDriver *driver, + virDomainDef *def, + virDomainVideoDef *video, + virCgroup *cgroup) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autofree char *shortname = NULL; diff --git a/src/qemu/qemu_vhost_user_gpu.h b/src/qemu/qemu_vhost_user_gpu.h index 2c757fd8d1..0d50dd2464 100644 --- a/src/qemu/qemu_vhost_user_gpu.h +++ b/src/qemu/qemu_vhost_user_gpu.h @@ -24,26 +24,26 @@ #include "qemu_domain.h" #include "qemu_security.h" -int qemuExtVhostUserGPUPrepareDomain(virQEMUDriverPtr driver, - virDomainVideoDefPtr video) +int qemuExtVhostUserGPUPrepareDomain(virQEMUDriver *driver, + virDomainVideoDef *video) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int qemuExtVhostUserGPUStart(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainVideoDefPtr video) +int qemuExtVhostUserGPUStart(virQEMUDriver *driver, + virDomainObj *vm, + virDomainVideoDef *video) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; -void qemuExtVhostUserGPUStop(virQEMUDriverPtr driver, - virDomainObjPtr def, - virDomainVideoDefPtr video) +void qemuExtVhostUserGPUStop(virQEMUDriver *driver, + virDomainObj *def, + virDomainVideoDef *video) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int -qemuExtVhostUserGPUSetupCgroup(virQEMUDriverPtr driver, - virDomainDefPtr def, - virDomainVideoDefPtr video, - virCgroupPtr cgroup) +qemuExtVhostUserGPUSetupCgroup(virQEMUDriver *driver, + virDomainDef *def, + virDomainVideoDef *video, + virCgroup *cgroup) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c index 2e239cad66..c37ac5b4ee 100644 --- a/src/qemu/qemu_virtiofs.c +++ b/src/qemu/qemu_virtiofs.c @@ -40,10 +40,10 @@ VIR_LOG_INIT("qemu.virtiofs"); char * -qemuVirtioFSCreatePidFilename(virDomainObjPtr vm, +qemuVirtioFSCreatePidFilename(virDomainObj *vm, const char *alias) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; g_autofree char *name = NULL; name = g_strdup_printf("%s-fs", alias); @@ -53,17 +53,17 @@ qemuVirtioFSCreatePidFilename(virDomainObjPtr vm, char * -qemuVirtioFSCreateSocketFilename(virDomainObjPtr vm, +qemuVirtioFSCreateSocketFilename(virDomainObj *vm, const char *alias) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; return virFileBuildPath(priv->libDir, alias, "-fs.sock"); } static char * -qemuVirtioFSCreateLogFilename(virQEMUDriverConfigPtr cfg, +qemuVirtioFSCreateLogFilename(virQEMUDriverConfig *cfg, const virDomainDef *def, const char *alias) { @@ -76,11 +76,11 @@ qemuVirtioFSCreateLogFilename(virQEMUDriverConfigPtr cfg, static int -qemuVirtioFSOpenChardev(virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuVirtioFSOpenChardev(virQEMUDriver *driver, + virDomainObj *vm, const char *socket_path) { - virDomainChrSourceDefPtr chrdev = virDomainChrSourceDefNew(NULL); + virDomainChrSourceDef *chrdev = virDomainChrSourceDefNew(NULL); virDomainChrDef chr = { .source = chrdev }; VIR_AUTOCLOSE fd = -1; int ret = -1; @@ -111,9 +111,9 @@ qemuVirtioFSOpenChardev(virQEMUDriverPtr driver, } -static virCommandPtr -qemuVirtioFSBuildCommandLine(virQEMUDriverConfigPtr cfg, - virDomainFSDefPtr fs, +static virCommand * +qemuVirtioFSBuildCommandLine(virQEMUDriverConfig *cfg, + virDomainFSDef *fs, int *fd) { g_autoptr(virCommand) cmd = NULL; @@ -155,10 +155,10 @@ qemuVirtioFSBuildCommandLine(virQEMUDriverConfigPtr cfg, } int -qemuVirtioFSStart(virLogManagerPtr logManager, - virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainFSDefPtr fs) +qemuVirtioFSStart(virLogManager *logManager, + virQEMUDriver *driver, + virDomainObj *vm, + virDomainFSDef *fs) { g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); g_autoptr(virCommand) cmd = NULL; @@ -267,9 +267,9 @@ qemuVirtioFSStart(virLogManagerPtr logManager, void -qemuVirtioFSStop(virQEMUDriverPtr driver G_GNUC_UNUSED, - virDomainObjPtr vm, - virDomainFSDefPtr fs) +qemuVirtioFSStop(virQEMUDriver *driver G_GNUC_UNUSED, + virDomainObj *vm, + virDomainFSDef *fs) { g_autofree char *pidfile = NULL; virErrorPtr orig_err; @@ -292,9 +292,9 @@ qemuVirtioFSStop(virQEMUDriverPtr driver G_GNUC_UNUSED, int -qemuVirtioFSSetupCgroup(virDomainObjPtr vm, - virDomainFSDefPtr fs, - virCgroupPtr cgroup) +qemuVirtioFSSetupCgroup(virDomainObj *vm, + virDomainFSDef *fs, + virCgroup *cgroup) { g_autofree char *pidfile = NULL; pid_t pid = -1; @@ -317,8 +317,8 @@ qemuVirtioFSSetupCgroup(virDomainObjPtr vm, } int -qemuVirtioFSPrepareDomain(virQEMUDriverPtr driver, - virDomainFSDefPtr fs) +qemuVirtioFSPrepareDomain(virQEMUDriver *driver, + virDomainFSDef *fs) { if (fs->binary) return 0; diff --git a/src/qemu/qemu_virtiofs.h b/src/qemu/qemu_virtiofs.h index 7de4ea6190..1886339394 100644 --- a/src/qemu/qemu_virtiofs.h +++ b/src/qemu/qemu_virtiofs.h @@ -20,27 +20,27 @@ char * -qemuVirtioFSCreatePidFilename(virDomainObjPtr vm, +qemuVirtioFSCreatePidFilename(virDomainObj *vm, const char *alias); char * -qemuVirtioFSCreateSocketFilename(virDomainObjPtr vm, +qemuVirtioFSCreateSocketFilename(virDomainObj *vm, const char *alias); int -qemuVirtioFSStart(virLogManagerPtr logManager, - virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainFSDefPtr fs); +qemuVirtioFSStart(virLogManager *logManager, + virQEMUDriver *driver, + virDomainObj *vm, + virDomainFSDef *fs); void -qemuVirtioFSStop(virQEMUDriverPtr driver, - virDomainObjPtr vm, - virDomainFSDefPtr fs); +qemuVirtioFSStop(virQEMUDriver *driver, + virDomainObj *vm, + virDomainFSDef *fs); int -qemuVirtioFSSetupCgroup(virDomainObjPtr vm, - virDomainFSDefPtr fs, - virCgroupPtr cgroup); +qemuVirtioFSSetupCgroup(virDomainObj *vm, + virDomainFSDef *fs, + virCgroup *cgroup); int -qemuVirtioFSPrepareDomain(virQEMUDriverPtr driver, - virDomainFSDefPtr fs); +qemuVirtioFSPrepareDomain(virQEMUDriver *driver, + virDomainFSDef *fs); diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index c5563a0e80..ec2661d0a8 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -72,10 +72,10 @@ VIR_LOG_INIT("daemon." DAEMON_NAME); #endif #if WITH_SASL -virNetSASLContextPtr saslCtxt = NULL; +virNetSASLContext *saslCtxt = NULL; #endif -virNetServerProgramPtr remoteProgram = NULL; -virNetServerProgramPtr qemuProgram = NULL; +virNetServerProgram *remoteProgram = NULL; +virNetServerProgram *qemuProgram = NULL; volatile bool driversInitialized = false; @@ -191,8 +191,8 @@ static int daemonInitialize(void) static int ATTRIBUTE_NONNULL(3) -daemonSetupNetworking(virNetServerPtr srv, - virNetServerPtr srvAdm, +daemonSetupNetworking(virNetServer *srv, + virNetServer *srvAdm, struct daemonConfig *config, #ifdef WITH_IP bool ipsock, @@ -333,7 +333,7 @@ daemonSetupNetworking(virNetServerPtr srv, return -1; if (((ipsock && config->listen_tls) || (act && virSystemdActivationHasName(act, DAEMON_NAME "-tls.socket")))) { - virNetTLSContextPtr ctxt = NULL; + virNetTLSContext *ctxt = NULL; if (config->ca_file || config->cert_file || @@ -422,7 +422,7 @@ daemonSetupNetDevOpenvswitch(struct daemonConfig *config) static int daemonSetupAccessManager(struct daemonConfig *config) { - virAccessManagerPtr mgr; + virAccessManager *mgr; const char *none[] = { "none", NULL }; const char **drv = (const char **)config->access_drivers; @@ -447,7 +447,7 @@ daemonVersion(const char *argv0) } -static void daemonShutdownHandler(virNetDaemonPtr dmn, +static void daemonShutdownHandler(virNetDaemon *dmn, siginfo_t *sig G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { @@ -463,7 +463,7 @@ static void daemonReloadHandlerThread(void *opaque G_GNUC_UNUSED) VIR_WARN("Error while reloading drivers"); } -static void daemonReloadHandler(virNetDaemonPtr dmn G_GNUC_UNUSED, +static void daemonReloadHandler(virNetDaemon *dmn G_GNUC_UNUSED, siginfo_t *sig G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { @@ -483,7 +483,7 @@ static void daemonReloadHandler(virNetDaemonPtr dmn G_GNUC_UNUSED, } } -static int daemonSetupSignals(virNetDaemonPtr dmn) +static int daemonSetupSignals(virNetDaemon *dmn) { if (virNetDaemonAddSignalHandler(dmn, SIGINT, daemonShutdownHandler, NULL) < 0) return -1; @@ -499,7 +499,7 @@ static int daemonSetupSignals(virNetDaemonPtr dmn) static void daemonInhibitCallback(bool inhibit, void *opaque) { - virNetDaemonPtr dmn = opaque; + virNetDaemon *dmn = opaque; if (inhibit) virNetDaemonAddShutdownInhibition(dmn); @@ -513,7 +513,7 @@ static GDBusConnection *systemBus; static void daemonStopWorker(void *opaque) { - virNetDaemonPtr dmn = opaque; + virNetDaemon *dmn = opaque; VIR_DEBUG("Begin stop dmn=%p", dmn); @@ -527,9 +527,9 @@ static void daemonStopWorker(void *opaque) /* We do this in a thread to not block the main loop */ -static void daemonStop(virNetDaemonPtr dmn) +static void daemonStop(virNetDaemon *dmn) { - virThreadPtr thr; + virThread *thr; virObjectRef(dmn); thr = g_new0(virThread, 1); @@ -552,7 +552,7 @@ handleSessionMessageFunc(GDBusConnection *connection G_GNUC_UNUSED, gboolean incoming G_GNUC_UNUSED, gpointer opaque) { - virNetDaemonPtr dmn = opaque; + virNetDaemon *dmn = opaque; VIR_DEBUG("dmn=%p", dmn); @@ -574,7 +574,7 @@ handleSystemMessageFunc(GDBusConnection *connection G_GNUC_UNUSED, GVariant *parameters G_GNUC_UNUSED, gpointer opaque) { - virNetDaemonPtr dmn = opaque; + virNetDaemon *dmn = opaque; VIR_DEBUG("dmn=%p", dmn); @@ -584,7 +584,7 @@ handleSystemMessageFunc(GDBusConnection *connection G_GNUC_UNUSED, static void daemonRunStateInit(void *opaque) { - virNetDaemonPtr dmn = opaque; + virNetDaemon *dmn = opaque; g_autoptr(virIdentity) sysident = virIdentityGetSystem(); #ifdef MODULE_NAME bool mandatory = true; @@ -645,7 +645,7 @@ static void daemonRunStateInit(void *opaque) virIdentitySetCurrent(NULL); } -static int daemonStateInit(virNetDaemonPtr dmn) +static int daemonStateInit(virNetDaemon *dmn) { virThread thr; virObjectRef(dmn); @@ -767,11 +767,11 @@ daemonUsage(const char *argv0, bool privileged) } int main(int argc, char **argv) { - virNetDaemonPtr dmn = NULL; - virNetServerPtr srv = NULL; - virNetServerPtr srvAdm = NULL; - virNetServerProgramPtr adminProgram = NULL; - virNetServerProgramPtr lxcProgram = NULL; + virNetDaemon *dmn = NULL; + virNetServer *srv = NULL; + virNetServer *srvAdm = NULL; + virNetServerProgram *adminProgram = NULL; + virNetServerProgram *lxcProgram = NULL; char *remote_config_file = NULL; int statuswrite = -1; int ret = 1; diff --git a/src/remote/remote_daemon.h b/src/remote/remote_daemon.h index a2d9af4036..1a69311029 100644 --- a/src/remote/remote_daemon.h +++ b/src/remote/remote_daemon.h @@ -36,33 +36,30 @@ #include "virnetserverprogram.h" typedef struct daemonClientStream daemonClientStream; -typedef daemonClientStream *daemonClientStreamPtr; typedef struct daemonClientPrivate daemonClientPrivate; -typedef daemonClientPrivate *daemonClientPrivatePtr; typedef struct daemonClientEventCallback daemonClientEventCallback; -typedef daemonClientEventCallback *daemonClientEventCallbackPtr; /* Stores the per-client connection state */ struct daemonClientPrivate { /* Hold while accessing any data except conn */ virMutex lock; - daemonClientEventCallbackPtr *domainEventCallbacks; + daemonClientEventCallback **domainEventCallbacks; size_t ndomainEventCallbacks; - daemonClientEventCallbackPtr *networkEventCallbacks; + daemonClientEventCallback **networkEventCallbacks; size_t nnetworkEventCallbacks; - daemonClientEventCallbackPtr *qemuEventCallbacks; + daemonClientEventCallback **qemuEventCallbacks; size_t nqemuEventCallbacks; - daemonClientEventCallbackPtr *storageEventCallbacks; + daemonClientEventCallback **storageEventCallbacks; size_t nstorageEventCallbacks; - daemonClientEventCallbackPtr *nodeDeviceEventCallbacks; + daemonClientEventCallback **nodeDeviceEventCallbacks; size_t nnodeDeviceEventCallbacks; - daemonClientEventCallbackPtr *secretEventCallbacks; + daemonClientEventCallback **secretEventCallbacks; size_t nsecretEventCallbacks; bool closeRegistered; #if WITH_SASL - virNetSASLSessionPtr sasl; + virNetSASLSession *sasl; #endif /* This is only valid if a remote open call has been made on this @@ -90,12 +87,12 @@ struct daemonClientPrivate { const char *storageURI; bool readonly; - daemonClientStreamPtr streams; + daemonClientStream *streams; }; #if WITH_SASL -extern virNetSASLContextPtr saslCtxt; +extern virNetSASLContext *saslCtxt; #endif -extern virNetServerProgramPtr remoteProgram; -extern virNetServerProgramPtr qemuProgram; +extern virNetServerProgram *remoteProgram; +extern virNetServerProgram *qemuProgram; diff --git a/src/remote/remote_daemon_config.c b/src/remote/remote_daemon_config.c index b354dc4cc0..a47ec14508 100644 --- a/src/remote/remote_daemon_config.c +++ b/src/remote/remote_daemon_config.c @@ -40,7 +40,7 @@ VIR_LOG_INIT("daemon.libvirtd-config"); static int -remoteConfigGetAuth(virConfPtr conf, +remoteConfigGetAuth(virConf *conf, const char *filename, const char *key, int *auth) @@ -225,7 +225,7 @@ daemonConfigFree(struct daemonConfig *data) static int daemonConfigLoadOptions(struct daemonConfig *data, const char *filename, - virConfPtr conf) + virConf *conf) { #ifdef WITH_IP if (virConfGetValueBool(conf, "listen_tcp", &data->listen_tcp) < 0) diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c index 42c03d6cfc..1b4f5256c3 100644 --- a/src/remote/remote_daemon_dispatch.c +++ b/src/remote/remote_daemon_dispatch.c @@ -74,8 +74,8 @@ VIR_LOG_INIT("daemon.remote"); #endif struct daemonClientEventCallback { - virNetServerClientPtr client; - virNetServerProgramPtr program; + virNetServerClient *client; + virNetServerProgram *program; int eventID; int callbackID; bool legacy; @@ -114,19 +114,19 @@ remoteSerializeDomainDiskErrors(virDomainDiskErrorPtr errors, u_int *ret_errors_len); static virConnectPtr -remoteGetHypervisorConn(virNetServerClientPtr client); +remoteGetHypervisorConn(virNetServerClient *client); static virConnectPtr -remoteGetInterfaceConn(virNetServerClientPtr client); +remoteGetInterfaceConn(virNetServerClient *client); static virConnectPtr -remoteGetNetworkConn(virNetServerClientPtr client); +remoteGetNetworkConn(virNetServerClient *client); static virConnectPtr -remoteGetNodeDevConn(virNetServerClientPtr client); +remoteGetNodeDevConn(virNetServerClient *client); static virConnectPtr -remoteGetNWFilterConn(virNetServerClientPtr client); +remoteGetNWFilterConn(virNetServerClient *client); static virConnectPtr -remoteGetSecretConn(virNetServerClientPtr client); +remoteGetSecretConn(virNetServerClient *client); static virConnectPtr -remoteGetStorageConn(virNetServerClientPtr client); +remoteGetStorageConn(virNetServerClient *client); #include "remote_daemon_dispatch_stubs.h" @@ -136,8 +136,8 @@ remoteGetStorageConn(virNetServerClientPtr client); /* Prototypes */ static void -remoteDispatchObjectEventSend(virNetServerClientPtr client, - virNetServerProgramPtr program, +remoteDispatchObjectEventSend(virNetServerClient *client, + virNetServerProgram *program, int procnr, xdrproc_t proc, void *data); @@ -145,7 +145,7 @@ remoteDispatchObjectEventSend(virNetServerClientPtr client, static void remoteEventCallbackFree(void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; if (!callback) return; virObjectUnref(callback->program); @@ -155,7 +155,7 @@ remoteEventCallbackFree(void *opaque) static bool -remoteRelayDomainEventCheckACL(virNetServerClientPtr client, +remoteRelayDomainEventCheckACL(virNetServerClient *client, virConnectPtr conn, virDomainPtr dom) { virDomainDef def; @@ -182,7 +182,7 @@ remoteRelayDomainEventCheckACL(virNetServerClientPtr client, static bool -remoteRelayNetworkEventCheckACL(virNetServerClientPtr client, +remoteRelayNetworkEventCheckACL(virNetServerClient *client, virConnectPtr conn, virNetworkPtr net) { virNetworkDef def; @@ -207,7 +207,7 @@ remoteRelayNetworkEventCheckACL(virNetServerClientPtr client, } static bool -remoteRelayStoragePoolEventCheckACL(virNetServerClientPtr client, +remoteRelayStoragePoolEventCheckACL(virNetServerClient *client, virConnectPtr conn, virStoragePoolPtr pool) { @@ -233,7 +233,7 @@ remoteRelayStoragePoolEventCheckACL(virNetServerClientPtr client, } static bool -remoteRelayNodeDeviceEventCheckACL(virNetServerClientPtr client, +remoteRelayNodeDeviceEventCheckACL(virNetServerClient *client, virConnectPtr conn, virNodeDevicePtr dev) { @@ -258,7 +258,7 @@ remoteRelayNodeDeviceEventCheckACL(virNetServerClientPtr client, } static bool -remoteRelaySecretEventCheckACL(virNetServerClientPtr client, +remoteRelaySecretEventCheckACL(virNetServerClient *client, virConnectPtr conn, virSecretPtr secret) { @@ -285,7 +285,7 @@ remoteRelaySecretEventCheckACL(virNetServerClientPtr client, } static bool -remoteRelayDomainQemuMonitorEventCheckACL(virNetServerClientPtr client, +remoteRelayDomainQemuMonitorEventCheckACL(virNetServerClient *client, virConnectPtr conn, virDomainPtr dom) { virDomainDef def; @@ -317,7 +317,7 @@ remoteRelayDomainEventLifecycle(virConnectPtr conn, int detail, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_lifecycle_msg data; if (callback->callbackID < 0 || @@ -356,7 +356,7 @@ remoteRelayDomainEventReboot(virConnectPtr conn, virDomainPtr dom, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_reboot_msg data; if (callback->callbackID < 0 || @@ -393,7 +393,7 @@ remoteRelayDomainEventRTCChange(virConnectPtr conn, long long offset, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_rtc_change_msg data; if (callback->callbackID < 0 || @@ -432,7 +432,7 @@ remoteRelayDomainEventWatchdog(virConnectPtr conn, int action, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_watchdog_msg data; if (callback->callbackID < 0 || @@ -472,7 +472,7 @@ remoteRelayDomainEventIOError(virConnectPtr conn, int action, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_io_error_msg data; if (callback->callbackID < 0 || @@ -516,7 +516,7 @@ remoteRelayDomainEventIOErrorReason(virConnectPtr conn, const char *reason, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_io_error_reason_msg data; if (callback->callbackID < 0 || @@ -562,7 +562,7 @@ remoteRelayDomainEventGraphics(virConnectPtr conn, virDomainEventGraphicsSubjectPtr subject, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_graphics_msg data; size_t i; @@ -629,7 +629,7 @@ remoteRelayDomainEventBlockJob(virConnectPtr conn, int status, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_block_job_msg data; if (callback->callbackID < 0 || @@ -668,7 +668,7 @@ remoteRelayDomainEventControlError(virConnectPtr conn, virDomainPtr dom, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_control_error_msg data; if (callback->callbackID < 0 || @@ -708,7 +708,7 @@ remoteRelayDomainEventDiskChange(virConnectPtr conn, int reason, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_disk_change_msg data; if (callback->callbackID < 0 || @@ -759,7 +759,7 @@ remoteRelayDomainEventTrayChange(virConnectPtr conn, int reason, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_tray_change_msg data; if (callback->callbackID < 0 || @@ -798,7 +798,7 @@ remoteRelayDomainEventPMWakeup(virConnectPtr conn, int reason, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_pmwakeup_msg data; if (callback->callbackID < 0 || @@ -834,7 +834,7 @@ remoteRelayDomainEventPMSuspend(virConnectPtr conn, int reason, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_pmsuspend_msg data; if (callback->callbackID < 0 || @@ -870,7 +870,7 @@ remoteRelayDomainEventBalloonChange(virConnectPtr conn, unsigned long long actual, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_balloon_change_msg data; if (callback->callbackID < 0 || @@ -908,7 +908,7 @@ remoteRelayDomainEventPMSuspendDisk(virConnectPtr conn, int reason, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_pmsuspend_disk_msg data; if (callback->callbackID < 0 || @@ -944,7 +944,7 @@ remoteRelayDomainEventDeviceRemoved(virConnectPtr conn, const char *devAlias, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_device_removed_msg data; if (callback->callbackID < 0 || @@ -988,7 +988,7 @@ remoteRelayDomainEventBlockJob2(virConnectPtr conn, int status, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_block_job_2_msg data; if (callback->callbackID < 0 || @@ -1021,7 +1021,7 @@ remoteRelayDomainEventTunable(virConnectPtr conn, int nparams, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_callback_tunable_msg data; if (callback->callbackID < 0 || @@ -1036,7 +1036,7 @@ remoteRelayDomainEventTunable(virConnectPtr conn, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_EVENT_TUNABLE_MAX, - (virTypedParameterRemotePtr *) &data.params.params_val, + (struct _virTypedParameterRemote **) &data.params.params_val, &data.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) return -1; @@ -1061,7 +1061,7 @@ remoteRelayDomainEventAgentLifecycle(virConnectPtr conn, int reason, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_callback_agent_lifecycle_msg data; if (callback->callbackID < 0 || @@ -1094,7 +1094,7 @@ remoteRelayDomainEventDeviceAdded(virConnectPtr conn, const char *devAlias, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_callback_device_added_msg data; if (callback->callbackID < 0 || @@ -1126,7 +1126,7 @@ remoteRelayDomainEventMigrationIteration(virConnectPtr conn, int iteration, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_callback_migration_iteration_msg data; if (callback->callbackID < 0 || @@ -1160,7 +1160,7 @@ remoteRelayDomainEventJobCompleted(virConnectPtr conn, int nparams, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_callback_job_completed_msg data; if (callback->callbackID < 0 || @@ -1176,7 +1176,7 @@ remoteRelayDomainEventJobCompleted(virConnectPtr conn, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_JOB_STATS_MAX, - (virTypedParameterRemotePtr *) &data.params.params_val, + (struct _virTypedParameterRemote **) &data.params.params_val, &data.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) return -1; @@ -1198,7 +1198,7 @@ remoteRelayDomainEventDeviceRemovalFailed(virConnectPtr conn, const char *devAlias, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_callback_device_removal_failed_msg data; if (callback->callbackID < 0 || @@ -1232,7 +1232,7 @@ remoteRelayDomainEventMetadataChange(virConnectPtr conn, const char *nsuri, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_callback_metadata_change_msg data; if (callback->callbackID < 0 || @@ -1272,7 +1272,7 @@ remoteRelayDomainEventBlockThreshold(virConnectPtr conn, unsigned long long excess, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_block_threshold_msg data; if (callback->callbackID < 0 || @@ -1310,7 +1310,7 @@ remoteRelayDomainEventMemoryFailure(virConnectPtr conn, unsigned int flags, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_domain_event_memory_failure_msg data; if (callback->callbackID < 0 || @@ -1371,7 +1371,7 @@ remoteRelayNetworkEventLifecycle(virConnectPtr conn, int detail, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_network_event_lifecycle_msg data; if (callback->callbackID < 0 || @@ -1408,7 +1408,7 @@ remoteRelayStoragePoolEventLifecycle(virConnectPtr conn, int detail, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_storage_pool_event_lifecycle_msg data; if (callback->callbackID < 0 || @@ -1438,7 +1438,7 @@ remoteRelayStoragePoolEventRefresh(virConnectPtr conn, virStoragePoolPtr pool, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_storage_pool_event_refresh_msg data; if (callback->callbackID < 0 || @@ -1475,7 +1475,7 @@ remoteRelayNodeDeviceEventLifecycle(virConnectPtr conn, int detail, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_node_device_event_lifecycle_msg data; if (callback->callbackID < 0 || @@ -1505,7 +1505,7 @@ remoteRelayNodeDeviceEventUpdate(virConnectPtr conn, virNodeDevicePtr dev, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_node_device_event_update_msg data; if (callback->callbackID < 0 || @@ -1542,7 +1542,7 @@ remoteRelaySecretEventLifecycle(virConnectPtr conn, int detail, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_secret_event_lifecycle_msg data; if (callback->callbackID < 0 || @@ -1572,7 +1572,7 @@ remoteRelaySecretEventValueChanged(virConnectPtr conn, virSecretPtr secret, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; remote_secret_event_value_changed_msg data; if (callback->callbackID < 0 || @@ -1611,7 +1611,7 @@ remoteRelayDomainQemuMonitorEvent(virConnectPtr conn, const char *details, void *opaque) { - daemonClientEventCallbackPtr callback = opaque; + daemonClientEventCallback *callback = opaque; qemu_domain_monitor_event_msg data; if (callback->callbackID < 0 || @@ -1644,7 +1644,7 @@ remoteRelayDomainQemuMonitorEvent(virConnectPtr conn, static void remoteRelayConnectionClosedEvent(virConnectPtr conn G_GNUC_UNUSED, int reason, void *opaque) { - virNetServerClientPtr client = opaque; + virNetServerClient *client = opaque; remote_connect_event_connection_closed_msg msg = { reason }; VIR_DEBUG("Relaying connection closed event, reason %d", reason); @@ -1746,7 +1746,7 @@ void remoteClientFree(void *data) } -static void remoteClientCloseFunc(virNetServerClientPtr client) +static void remoteClientCloseFunc(virNetServerClient *client) { struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); @@ -1818,7 +1818,7 @@ remoteOpenConn(const char *uri, static virConnectPtr -remoteGetHypervisorConn(virNetServerClientPtr client) +remoteGetHypervisorConn(virNetServerClient *client) { struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); @@ -1833,7 +1833,7 @@ remoteGetHypervisorConn(virNetServerClientPtr client) static virConnectPtr -remoteGetInterfaceConn(virNetServerClientPtr client) +remoteGetInterfaceConn(virNetServerClient *client) { struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); @@ -1849,7 +1849,7 @@ remoteGetInterfaceConn(virNetServerClientPtr client) static virConnectPtr -remoteGetNetworkConn(virNetServerClientPtr client) +remoteGetNetworkConn(virNetServerClient *client) { struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); @@ -1865,7 +1865,7 @@ remoteGetNetworkConn(virNetServerClientPtr client) static virConnectPtr -remoteGetNodeDevConn(virNetServerClientPtr client) +remoteGetNodeDevConn(virNetServerClient *client) { struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); @@ -1881,7 +1881,7 @@ remoteGetNodeDevConn(virNetServerClientPtr client) static virConnectPtr -remoteGetNWFilterConn(virNetServerClientPtr client) +remoteGetNWFilterConn(virNetServerClient *client) { struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); @@ -1897,7 +1897,7 @@ remoteGetNWFilterConn(virNetServerClientPtr client) static virConnectPtr -remoteGetSecretConn(virNetServerClientPtr client) +remoteGetSecretConn(virNetServerClient *client) { struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); @@ -1913,7 +1913,7 @@ remoteGetSecretConn(virNetServerClientPtr client) static virConnectPtr -remoteGetStorageConn(virNetServerClientPtr client) +remoteGetStorageConn(virNetServerClient *client) { struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); @@ -1928,7 +1928,7 @@ remoteGetStorageConn(virNetServerClientPtr client) } -void *remoteClientNew(virNetServerClientPtr client, +void *remoteClientNew(virNetServerClient *client, void *opaque G_GNUC_UNUSED) { struct daemonClientPrivate *priv; @@ -2068,10 +2068,10 @@ remoteDispatchProbeURI(bool readonly, static int -remoteDispatchConnectOpen(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchConnectOpen(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, struct remote_connect_open_args *args) { const char *name; @@ -2222,10 +2222,10 @@ remoteDispatchConnectOpen(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchConnectClose(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED) +remoteDispatchConnectClose(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED) { virNetServerClientDelayedClose(client); return 0; @@ -2233,10 +2233,10 @@ remoteDispatchConnectClose(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchConnectSetIdentity(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchConnectSetIdentity(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_connect_set_identity_args *args) { virTypedParameterPtr params = NULL; @@ -2248,7 +2248,7 @@ remoteDispatchConnectSetIdentity(virNetServerPtr server G_GNUC_UNUSED, goto cleanup; VIR_DEBUG("Received forwarded identity"); - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) args->params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) args->params.params_val, args->params.params_len, REMOTE_CONNECT_IDENTITY_PARAMS_MAX, ¶ms, @@ -2280,10 +2280,10 @@ remoteDispatchConnectSetIdentity(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainGetSchedulerType(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetSchedulerType(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_scheduler_type_args *args, remote_domain_get_scheduler_type_ret *ret) { @@ -2314,10 +2314,10 @@ remoteDispatchDomainGetSchedulerType(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetSchedulerParameters(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetSchedulerParameters(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_scheduler_parameters_args *args, remote_domain_get_scheduler_parameters_ret *ret) { @@ -2346,7 +2346,7 @@ remoteDispatchDomainGetSchedulerParameters(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, 0) < 0) goto cleanup; @@ -2362,10 +2362,10 @@ remoteDispatchDomainGetSchedulerParameters(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetSchedulerParametersFlags(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetSchedulerParametersFlags(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_scheduler_parameters_flags_args *args, remote_domain_get_scheduler_parameters_flags_ret *ret) { @@ -2395,7 +2395,7 @@ remoteDispatchDomainGetSchedulerParametersFlags(virNetServerPtr server G_GNUC_UN if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, args->flags) < 0) goto cleanup; @@ -2411,10 +2411,10 @@ remoteDispatchDomainGetSchedulerParametersFlags(virNetServerPtr server G_GNUC_UN } static int -remoteDispatchDomainMemoryStats(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMemoryStats(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_memory_stats_args *args, remote_domain_memory_stats_ret *ret) { @@ -2464,10 +2464,10 @@ remoteDispatchDomainMemoryStats(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainBlockPeek(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainBlockPeek(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_block_peek_args *args, remote_domain_block_peek_ret *ret) { @@ -2514,10 +2514,10 @@ remoteDispatchDomainBlockPeek(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainBlockStatsFlags(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainBlockStatsFlags(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_block_stats_flags_args *args, remote_domain_block_stats_flags_ret *ret) { @@ -2558,7 +2558,7 @@ remoteDispatchDomainBlockStatsFlags(virNetServerPtr server G_GNUC_UNUSED, /* Serialize the block stats. */ if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_BLOCK_STATS_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, args->flags) < 0) goto cleanup; @@ -2575,10 +2575,10 @@ remoteDispatchDomainBlockStatsFlags(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainMemoryPeek(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMemoryPeek(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_memory_peek_args *args, remote_domain_memory_peek_ret *ret) { @@ -2623,10 +2623,10 @@ remoteDispatchDomainMemoryPeek(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetSecurityLabel(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetSecurityLabel(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_security_label_args *args, remote_domain_get_security_label_ret *ret) { @@ -2661,10 +2661,10 @@ remoteDispatchDomainGetSecurityLabel(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetSecurityLabelList(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetSecurityLabelList(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_security_label_list_args *args, remote_domain_get_security_label_list_ret *ret) { @@ -2710,10 +2710,10 @@ remoteDispatchDomainGetSecurityLabelList(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchNodeGetSecurityModel(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchNodeGetSecurityModel(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_node_get_security_model_ret *ret) { virSecurityModel secmodel; @@ -2742,10 +2742,10 @@ remoteDispatchNodeGetSecurityModel(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetVcpuPinInfo(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetVcpuPinInfo(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_vcpu_pin_info_args *args, remote_domain_get_vcpu_pin_info_ret *ret) { @@ -2803,10 +2803,10 @@ remoteDispatchDomainGetVcpuPinInfo(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainPinEmulator(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainPinEmulator(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_pin_emulator_args *args) { int rv = -1; @@ -2836,10 +2836,10 @@ remoteDispatchDomainPinEmulator(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainGetEmulatorPinInfo(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetEmulatorPinInfo(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_emulator_pin_info_args *args, remote_domain_get_emulator_pin_info_ret *ret) { @@ -2881,10 +2881,10 @@ remoteDispatchDomainGetEmulatorPinInfo(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetVcpus(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetVcpus(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_vcpus_args *args, remote_domain_get_vcpus_ret *ret) { @@ -2956,10 +2956,10 @@ remoteDispatchDomainGetVcpus(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetIOThreadInfo(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetIOThreadInfo(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_iothread_info_args *args, remote_domain_get_iothread_info_ret *ret) { @@ -3024,10 +3024,10 @@ remoteDispatchDomainGetIOThreadInfo(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainMigratePrepare(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigratePrepare(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_migrate_prepare_args *args, remote_domain_migrate_prepare_ret *ret) { @@ -3074,10 +3074,10 @@ remoteDispatchDomainMigratePrepare(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainMigratePrepare2(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigratePrepare2(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_migrate_prepare2_args *args, remote_domain_migrate_prepare2_ret *ret) { @@ -3122,10 +3122,10 @@ remoteDispatchDomainMigratePrepare2(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetMemoryParameters(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetMemoryParameters(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_memory_parameters_args *args, remote_domain_get_memory_parameters_ret *ret) { @@ -3165,7 +3165,7 @@ remoteDispatchDomainGetMemoryParameters(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, args->flags) < 0) goto cleanup; @@ -3182,10 +3182,10 @@ remoteDispatchDomainGetMemoryParameters(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetNumaParameters(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetNumaParameters(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_numa_parameters_args *args, remote_domain_get_numa_parameters_ret *ret) { @@ -3225,7 +3225,7 @@ remoteDispatchDomainGetNumaParameters(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_NUMA_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, flags) < 0) goto cleanup; @@ -3242,10 +3242,10 @@ remoteDispatchDomainGetNumaParameters(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetBlkioParameters(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetBlkioParameters(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_blkio_parameters_args *args, remote_domain_get_blkio_parameters_ret *ret) { @@ -3285,7 +3285,7 @@ remoteDispatchDomainGetBlkioParameters(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, args->flags) < 0) goto cleanup; @@ -3302,10 +3302,10 @@ remoteDispatchDomainGetBlkioParameters(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchNodeGetCPUStats(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchNodeGetCPUStats(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_node_get_cpu_stats_args *args, remote_node_get_cpu_stats_ret *ret) { @@ -3369,10 +3369,10 @@ remoteDispatchNodeGetCPUStats(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchNodeGetMemoryStats(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchNodeGetMemoryStats(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_node_get_memory_stats_args *args, remote_node_get_memory_stats_ret *ret) { @@ -3436,10 +3436,10 @@ remoteDispatchNodeGetMemoryStats(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetLaunchSecurityInfo(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetLaunchSecurityInfo(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_launch_security_info_args *args, remote_domain_get_launch_security_info_ret *ret) { @@ -3460,7 +3460,7 @@ remoteDispatchDomainGetLaunchSecurityInfo(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_LAUNCH_SECURITY_INFO_PARAMS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, args->flags) < 0) goto cleanup; @@ -3476,10 +3476,10 @@ remoteDispatchDomainGetLaunchSecurityInfo(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetPerfEvents(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetPerfEvents(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_perf_events_args *args, remote_domain_get_perf_events_ret *ret) { @@ -3500,7 +3500,7 @@ remoteDispatchDomainGetPerfEvents(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_PERF_EVENTS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, 0) < 0) goto cleanup; @@ -3516,10 +3516,10 @@ remoteDispatchDomainGetPerfEvents(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetBlockJobInfo(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetBlockJobInfo(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_block_job_info_args *args, remote_domain_get_block_job_info_ret *ret) { @@ -3553,10 +3553,10 @@ remoteDispatchDomainGetBlockJobInfo(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetBlockIoTune(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr hdr G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetBlockIoTune(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *hdr G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_block_io_tune_args *args, remote_domain_get_block_io_tune_ret *ret) { @@ -3596,7 +3596,7 @@ remoteDispatchDomainGetBlockIoTune(virNetServerPtr server G_GNUC_UNUSED, /* Serialize the block I/O tuning parameters. */ if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_BLOCK_IO_TUNE_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, args->flags) < 0) goto cleanup; @@ -3615,10 +3615,10 @@ remoteDispatchDomainGetBlockIoTune(virNetServerPtr server G_GNUC_UNUSED, /*-------------------------------------------------------------*/ static int -remoteDispatchAuthList(virNetServerPtr server, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchAuthList(virNetServer *server, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_auth_list_ret *ret) { int auth = virNetServerClientGetAuth(client); @@ -3673,13 +3673,13 @@ remoteDispatchAuthList(virNetServerPtr server, * and gives the client a list of allowed mechanisms to choose */ static int -remoteDispatchAuthSaslInit(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchAuthSaslInit(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_auth_sasl_init_ret *ret) { - virNetSASLSessionPtr sasl = NULL; + virNetSASLSession *sasl = NULL; struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); @@ -3748,8 +3748,8 @@ remoteDispatchAuthSaslInit(virNetServerPtr server G_GNUC_UNUSED, * Returns 0 if ok, -1 on error, -2 if rejected */ static int -remoteSASLFinish(virNetServerPtr server, - virNetServerClientPtr client) +remoteSASLFinish(virNetServer *server, + virNetServerClient *client) { g_autoptr(virIdentity) clnt_identity = NULL; const char *identity; @@ -3797,10 +3797,10 @@ remoteSASLFinish(virNetServerPtr server, * This starts the SASL authentication negotiation. */ static int -remoteDispatchAuthSaslStart(virNetServerPtr server, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchAuthSaslStart(virNetServer *server, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_auth_sasl_start_args *args, remote_auth_sasl_start_ret *ret) { @@ -3892,10 +3892,10 @@ remoteDispatchAuthSaslStart(virNetServerPtr server, static int -remoteDispatchAuthSaslStep(virNetServerPtr server, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchAuthSaslStep(virNetServer *server, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_auth_sasl_step_args *args, remote_auth_sasl_step_ret *ret) { @@ -3986,10 +3986,10 @@ remoteDispatchAuthSaslStep(virNetServerPtr server, } #else static int -remoteDispatchAuthSaslInit(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client G_GNUC_UNUSED, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchAuthSaslInit(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client G_GNUC_UNUSED, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_auth_sasl_init_ret *ret G_GNUC_UNUSED) { VIR_WARN("Client tried unsupported SASL auth"); @@ -3999,10 +3999,10 @@ remoteDispatchAuthSaslInit(virNetServerPtr server G_GNUC_UNUSED, return -1; } static int -remoteDispatchAuthSaslStart(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client G_GNUC_UNUSED, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchAuthSaslStart(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client G_GNUC_UNUSED, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_auth_sasl_start_args *args G_GNUC_UNUSED, remote_auth_sasl_start_ret *ret G_GNUC_UNUSED) { @@ -4013,10 +4013,10 @@ remoteDispatchAuthSaslStart(virNetServerPtr server G_GNUC_UNUSED, return -1; } static int -remoteDispatchAuthSaslStep(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client G_GNUC_UNUSED, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchAuthSaslStep(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client G_GNUC_UNUSED, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_auth_sasl_step_args *args G_GNUC_UNUSED, remote_auth_sasl_step_ret *ret G_GNUC_UNUSED) { @@ -4031,10 +4031,10 @@ remoteDispatchAuthSaslStep(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchAuthPolkit(virNetServerPtr server, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchAuthPolkit(virNetServer *server, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_auth_polkit_ret *ret) { pid_t callerPid = -1; @@ -4115,10 +4115,10 @@ remoteDispatchAuthPolkit(virNetServerPtr server, static int -remoteDispatchNodeDeviceGetParent(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchNodeDeviceGetParent(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_node_device_get_parent_args *args, remote_node_device_get_parent_ret *ret) { @@ -4153,10 +4153,10 @@ remoteDispatchNodeDeviceGetParent(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchConnectRegisterCloseCallback(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr) +remoteDispatchConnectRegisterCloseCallback(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr) { int rv = -1; struct daemonClientPrivate *priv = @@ -4184,10 +4184,10 @@ remoteDispatchConnectRegisterCloseCallback(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchConnectUnregisterCloseCallback(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr) +remoteDispatchConnectUnregisterCloseCallback(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr) { int rv = -1; struct daemonClientPrivate *priv = @@ -4214,16 +4214,16 @@ remoteDispatchConnectUnregisterCloseCallback(virNetServerPtr server G_GNUC_UNUSE } static int -remoteDispatchConnectDomainEventRegister(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectDomainEventRegister(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_domain_event_register_ret *ret G_GNUC_UNUSED) { int callbackID; int rv = -1; - daemonClientEventCallbackPtr callback = NULL; - daemonClientEventCallbackPtr ref; + daemonClientEventCallback *callback = NULL; + daemonClientEventCallback *ref; struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); virConnectPtr conn = remoteGetHypervisorConn(client); @@ -4278,10 +4278,10 @@ remoteDispatchConnectDomainEventRegister(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchConnectDomainEventDeregister(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectDomainEventDeregister(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_domain_event_deregister_ret *ret G_GNUC_UNUSED) { int callbackID = -1; @@ -4326,13 +4326,13 @@ remoteDispatchConnectDomainEventDeregister(virNetServerPtr server G_GNUC_UNUSED, } static void -remoteDispatchObjectEventSend(virNetServerClientPtr client, - virNetServerProgramPtr program, +remoteDispatchObjectEventSend(virNetServerClient *client, + virNetServerProgram *program, int procnr, xdrproc_t proc, void *data) { - virNetMessagePtr msg; + virNetMessage *msg; if (!(msg = virNetMessageNew(false))) goto cleanup; @@ -4363,10 +4363,10 @@ remoteDispatchObjectEventSend(virNetServerClientPtr client, } static int -remoteDispatchSecretGetValue(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchSecretGetValue(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_secret_get_value_args *args, remote_secret_get_value_ret *ret) { @@ -4398,10 +4398,10 @@ remoteDispatchSecretGetValue(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetState(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetState(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_state_args *args, remote_domain_get_state_ret *ret) { @@ -4434,16 +4434,16 @@ remoteDispatchDomainGetState(virNetServerPtr server G_GNUC_UNUSED, * VIR_DRV_SUPPORTS_FEATURE(VIR_DRV_FEATURE_REMOTE_EVENT_CALLBACK), * and must not mix the two styles. */ static int -remoteDispatchConnectDomainEventRegisterAny(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectDomainEventRegisterAny(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_domain_event_register_any_args *args) { int callbackID; int rv = -1; - daemonClientEventCallbackPtr callback = NULL; - daemonClientEventCallbackPtr ref; + daemonClientEventCallback *callback = NULL; + daemonClientEventCallback *ref; struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); virConnectPtr conn = remoteGetHypervisorConn(client); @@ -4507,17 +4507,17 @@ remoteDispatchConnectDomainEventRegisterAny(virNetServerPtr server G_GNUC_UNUSED static int -remoteDispatchConnectDomainEventCallbackRegisterAny(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectDomainEventCallbackRegisterAny(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_domain_event_callback_register_any_args *args, remote_connect_domain_event_callback_register_any_ret *ret) { int callbackID; int rv = -1; - daemonClientEventCallbackPtr callback = NULL; - daemonClientEventCallbackPtr ref; + daemonClientEventCallback *callback = NULL; + daemonClientEventCallback *ref; struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); virDomainPtr dom = NULL; @@ -4583,10 +4583,10 @@ remoteDispatchConnectDomainEventCallbackRegisterAny(virNetServerPtr server G_GNU static int -remoteDispatchConnectDomainEventDeregisterAny(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectDomainEventDeregisterAny(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_domain_event_deregister_any_args *args) { int callbackID = -1; @@ -4640,10 +4640,10 @@ remoteDispatchConnectDomainEventDeregisterAny(virNetServerPtr server G_GNUC_UNUS static int -remoteDispatchConnectDomainEventCallbackDeregisterAny(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectDomainEventCallbackDeregisterAny(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_domain_event_callback_deregister_any_args *args) { int rv = -1; @@ -4685,10 +4685,10 @@ remoteDispatchConnectDomainEventCallbackDeregisterAny(virNetServerPtr server G_G static int -qemuDispatchDomainMonitorCommand(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +qemuDispatchDomainMonitorCommand(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, qemu_domain_monitor_command_args *args, qemu_domain_monitor_command_ret *ret) { @@ -4717,10 +4717,10 @@ qemuDispatchDomainMonitorCommand(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainMigrateBegin3(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigrateBegin3(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_migrate_begin3_args *args, remote_domain_migrate_begin3_ret *ret) { @@ -4765,10 +4765,10 @@ remoteDispatchDomainMigrateBegin3(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainMigratePrepare3(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigratePrepare3(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_migrate_prepare3_args *args, remote_domain_migrate_prepare3_ret *ret) { @@ -4817,10 +4817,10 @@ remoteDispatchDomainMigratePrepare3(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainMigratePerform3(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigratePerform3(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_migrate_perform3_args *args, remote_domain_migrate_perform3_ret *ret) { @@ -4869,10 +4869,10 @@ remoteDispatchDomainMigratePerform3(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainMigrateFinish3(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigrateFinish3(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_migrate_finish3_args *args, remote_domain_migrate_finish3_ret *ret) { @@ -4919,10 +4919,10 @@ remoteDispatchDomainMigrateFinish3(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainMigrateConfirm3(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigrateConfirm3(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_migrate_confirm3_args *args) { virDomainPtr dom = NULL; @@ -4951,10 +4951,10 @@ remoteDispatchDomainMigrateConfirm3(virNetServerPtr server G_GNUC_UNUSED, } -static int remoteDispatchConnectSupportsFeature(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +static int remoteDispatchConnectSupportsFeature(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_connect_supports_feature_args *args, remote_connect_supports_feature_ret *ret) { @@ -5016,10 +5016,10 @@ static int remoteDispatchConnectSupportsFeature(virNetServerPtr server G_GNUC_UN static int -remoteDispatchDomainOpenGraphics(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg, - virNetMessageErrorPtr rerr, +remoteDispatchDomainOpenGraphics(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg, + struct virNetMessageError *rerr, remote_domain_open_graphics_args *args) { virDomainPtr dom = NULL; @@ -5054,10 +5054,10 @@ remoteDispatchDomainOpenGraphics(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainOpenGraphicsFd(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg, - virNetMessageErrorPtr rerr, +remoteDispatchDomainOpenGraphicsFd(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg, + struct virNetMessageError *rerr, remote_domain_open_graphics_fd_args *args) { virDomainPtr dom = NULL; @@ -5094,10 +5094,10 @@ remoteDispatchDomainOpenGraphicsFd(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainGetInterfaceParameters(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetInterfaceParameters(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_interface_parameters_args *args, remote_domain_get_interface_parameters_ret *ret) { @@ -5138,7 +5138,7 @@ remoteDispatchDomainGetInterfaceParameters(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_INTERFACE_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, flags) < 0) goto cleanup; @@ -5155,10 +5155,10 @@ remoteDispatchDomainGetInterfaceParameters(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetCPUStats(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr hdr G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetCPUStats(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *hdr G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_cpu_stats_args *args, remote_domain_get_cpu_stats_ret *ret) { @@ -5197,7 +5197,7 @@ remoteDispatchDomainGetCPUStats(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, args->nparams * args->ncpus, REMOTE_DOMAIN_GET_CPU_STATS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, args->flags) < 0) goto cleanup; @@ -5223,10 +5223,10 @@ remoteDispatchDomainGetCPUStats(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetDiskErrors(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetDiskErrors(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_disk_errors_args *args, remote_domain_get_disk_errors_ret *ret) { @@ -5280,10 +5280,10 @@ remoteDispatchDomainGetDiskErrors(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchNodeGetSevInfo(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchNodeGetSevInfo(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_node_get_sev_info_args *args, remote_node_get_sev_info_ret *ret) { @@ -5300,7 +5300,7 @@ remoteDispatchNodeGetSevInfo(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, REMOTE_NODE_SEV_INFO_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, args->flags) < 0) goto cleanup; @@ -5316,10 +5316,10 @@ remoteDispatchNodeGetSevInfo(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchNodeGetMemoryParameters(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchNodeGetMemoryParameters(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_node_get_memory_parameters_args *args, remote_node_get_memory_parameters_ret *ret) { @@ -5355,7 +5355,7 @@ remoteDispatchNodeGetMemoryParameters(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, REMOTE_NODE_MEMORY_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, args->flags) < 0) goto cleanup; @@ -5371,10 +5371,10 @@ remoteDispatchNodeGetMemoryParameters(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchNodeGetCPUMap(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchNodeGetCPUMap(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_node_get_cpu_map_args *args, remote_node_get_cpu_map_ret *ret) { @@ -5415,10 +5415,10 @@ remoteDispatchNodeGetCPUMap(virNetServerPtr server G_GNUC_UNUSED, } static int -lxcDispatchDomainOpenNamespace(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +lxcDispatchDomainOpenNamespace(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, lxc_domain_open_namespace_args *args) { int rv = -1; @@ -5462,10 +5462,10 @@ lxcDispatchDomainOpenNamespace(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetJobStats(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetJobStats(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_job_stats_args *args, remote_domain_get_job_stats_ret *ret) { @@ -5487,7 +5487,7 @@ remoteDispatchDomainGetJobStats(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_JOB_STATS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) goto cleanup; @@ -5503,10 +5503,10 @@ remoteDispatchDomainGetJobStats(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainMigrateBegin3Params(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigrateBegin3Params(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_migrate_begin3_params_args *args, remote_domain_migrate_begin3_params_ret *ret) { @@ -5532,7 +5532,7 @@ remoteDispatchDomainMigrateBegin3Params(virNetServerPtr server G_GNUC_UNUSED, if (!(dom = get_nonnull_domain(conn, args->dom))) goto cleanup; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) args->params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) args->params.params_val, args->params.params_len, 0, ¶ms, &nparams) < 0) goto cleanup; @@ -5557,10 +5557,10 @@ remoteDispatchDomainMigrateBegin3Params(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainMigratePrepare3Params(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigratePrepare3Params(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_migrate_prepare3_params_args *args, remote_domain_migrate_prepare3_params_ret *ret) { @@ -5582,7 +5582,7 @@ remoteDispatchDomainMigratePrepare3Params(virNetServerPtr server G_GNUC_UNUSED, goto cleanup; } - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) args->params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) args->params.params_val, args->params.params_len, 0, ¶ms, &nparams) < 0) goto cleanup; @@ -5613,10 +5613,10 @@ remoteDispatchDomainMigratePrepare3Params(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainMigratePrepareTunnel3Params(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigratePrepareTunnel3Params(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg, + struct virNetMessageError *rerr, remote_domain_migrate_prepare_tunnel3_params_args *args, remote_domain_migrate_prepare_tunnel3_params_ret *ret) { @@ -5626,7 +5626,7 @@ remoteDispatchDomainMigratePrepareTunnel3Params(virNetServerPtr server G_GNUC_UN int cookieoutlen = 0; int rv = -1; virStreamPtr st = NULL; - daemonClientStreamPtr stream = NULL; + daemonClientStream *stream = NULL; virConnectPtr conn = remoteGetHypervisorConn(client); if (!conn) @@ -5639,7 +5639,7 @@ remoteDispatchDomainMigratePrepareTunnel3Params(virNetServerPtr server G_GNUC_UN goto cleanup; } - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) args->params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) args->params.params_val, args->params.params_len, 0, ¶ms, &nparams) < 0) goto cleanup; @@ -5680,10 +5680,10 @@ remoteDispatchDomainMigratePrepareTunnel3Params(virNetServerPtr server G_GNUC_UN static int -remoteDispatchDomainMigratePerform3Params(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigratePerform3Params(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_migrate_perform3_params_args *args, remote_domain_migrate_perform3_params_ret *ret) { @@ -5709,7 +5709,7 @@ remoteDispatchDomainMigratePerform3Params(virNetServerPtr server G_GNUC_UNUSED, if (!(dom = get_nonnull_domain(conn, args->dom))) goto cleanup; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) args->params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) args->params.params_val, args->params.params_len, 0, ¶ms, &nparams) < 0) goto cleanup; @@ -5738,10 +5738,10 @@ remoteDispatchDomainMigratePerform3Params(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainMigrateFinish3Params(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigrateFinish3Params(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_migrate_finish3_params_args *args, remote_domain_migrate_finish3_params_ret *ret) { @@ -5763,7 +5763,7 @@ remoteDispatchDomainMigrateFinish3Params(virNetServerPtr server G_GNUC_UNUSED, goto cleanup; } - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) args->params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) args->params.params_val, args->params.params_len, 0, ¶ms, &nparams) < 0) goto cleanup; @@ -5795,10 +5795,10 @@ remoteDispatchDomainMigrateFinish3Params(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainMigrateConfirm3Params(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainMigrateConfirm3Params(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_migrate_confirm3_params_args *args) { virTypedParameterPtr params = NULL; @@ -5820,7 +5820,7 @@ remoteDispatchDomainMigrateConfirm3Params(virNetServerPtr server G_GNUC_UNUSED, if (!(dom = get_nonnull_domain(conn, args->dom))) goto cleanup; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) args->params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) args->params.params_val, args->params.params_len, 0, ¶ms, &nparams) < 0) goto cleanup; @@ -5843,10 +5843,10 @@ remoteDispatchDomainMigrateConfirm3Params(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchConnectGetCPUModelNames(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchConnectGetCPUModelNames(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_connect_get_cpu_model_names_args *args, remote_connect_get_cpu_model_names_ret *ret) { @@ -5891,10 +5891,10 @@ remoteDispatchConnectGetCPUModelNames(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainCreateXMLWithFiles(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainCreateXMLWithFiles(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_create_xml_with_files_args *args, remote_domain_create_xml_with_files_ret *ret) { @@ -5935,10 +5935,10 @@ remoteDispatchDomainCreateXMLWithFiles(virNetServerPtr server G_GNUC_UNUSED, } -static int remoteDispatchDomainCreateWithFiles(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +static int remoteDispatchDomainCreateWithFiles(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_create_with_files_args *args, remote_domain_create_with_files_ret *ret) { @@ -5983,17 +5983,17 @@ static int remoteDispatchDomainCreateWithFiles(virNetServerPtr server G_GNUC_UNU static int -remoteDispatchConnectNetworkEventRegisterAny(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectNetworkEventRegisterAny(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_network_event_register_any_args *args, remote_connect_network_event_register_any_ret *ret) { int callbackID; int rv = -1; - daemonClientEventCallbackPtr callback = NULL; - daemonClientEventCallbackPtr ref; + daemonClientEventCallback *callback = NULL; + daemonClientEventCallback *ref; virNetworkPtr net = NULL; struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); @@ -6059,10 +6059,10 @@ remoteDispatchConnectNetworkEventRegisterAny(virNetServerPtr server G_GNUC_UNUSE static int -remoteDispatchConnectNetworkEventDeregisterAny(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectNetworkEventDeregisterAny(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_network_event_deregister_any_args *args) { int rv = -1; @@ -6103,17 +6103,17 @@ remoteDispatchConnectNetworkEventDeregisterAny(virNetServerPtr server G_GNUC_UNU } static int -remoteDispatchConnectStoragePoolEventRegisterAny(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectStoragePoolEventRegisterAny(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_storage_pool_event_register_any_args *args, remote_connect_storage_pool_event_register_any_ret *ret) { int callbackID; int rv = -1; - daemonClientEventCallbackPtr callback = NULL; - daemonClientEventCallbackPtr ref; + daemonClientEventCallback *callback = NULL; + daemonClientEventCallback *ref; struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); virStoragePoolPtr pool = NULL; @@ -6178,10 +6178,10 @@ remoteDispatchConnectStoragePoolEventRegisterAny(virNetServerPtr server G_GNUC_U } static int -remoteDispatchConnectStoragePoolEventDeregisterAny(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectStoragePoolEventDeregisterAny(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_storage_pool_event_deregister_any_args *args) { int rv = -1; @@ -6222,17 +6222,17 @@ remoteDispatchConnectStoragePoolEventDeregisterAny(virNetServerPtr server G_GNUC } static int -remoteDispatchConnectNodeDeviceEventRegisterAny(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectNodeDeviceEventRegisterAny(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_node_device_event_register_any_args *args, remote_connect_node_device_event_register_any_ret *ret) { int callbackID; int rv = -1; - daemonClientEventCallbackPtr callback = NULL; - daemonClientEventCallbackPtr ref; + daemonClientEventCallback *callback = NULL; + daemonClientEventCallback *ref; struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); virNodeDevicePtr dev = NULL; @@ -6297,10 +6297,10 @@ remoteDispatchConnectNodeDeviceEventRegisterAny(virNetServerPtr server G_GNUC_UN } static int -remoteDispatchConnectNodeDeviceEventDeregisterAny(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectNodeDeviceEventDeregisterAny(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_node_device_event_deregister_any_args *args) { int rv = -1; @@ -6341,17 +6341,17 @@ remoteDispatchConnectNodeDeviceEventDeregisterAny(virNetServerPtr server G_GNUC_ } static int -remoteDispatchConnectSecretEventRegisterAny(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectSecretEventRegisterAny(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_secret_event_register_any_args *args, remote_connect_secret_event_register_any_ret *ret) { int callbackID; int rv = -1; - daemonClientEventCallbackPtr callback = NULL; - daemonClientEventCallbackPtr ref; + daemonClientEventCallback *callback = NULL; + daemonClientEventCallback *ref; struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); virSecretPtr secret = NULL; @@ -6416,10 +6416,10 @@ remoteDispatchConnectSecretEventRegisterAny(virNetServerPtr server G_GNUC_UNUSED } static int -remoteDispatchConnectSecretEventDeregisterAny(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +remoteDispatchConnectSecretEventDeregisterAny(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, remote_connect_secret_event_deregister_any_args *args) { int rv = -1; @@ -6460,17 +6460,17 @@ remoteDispatchConnectSecretEventDeregisterAny(virNetServerPtr server G_GNUC_UNUS } static int -qemuDispatchConnectDomainMonitorEventRegister(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +qemuDispatchConnectDomainMonitorEventRegister(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, qemu_connect_domain_monitor_event_register_args *args, qemu_connect_domain_monitor_event_register_ret *ret) { int callbackID; int rv = -1; - daemonClientEventCallbackPtr callback = NULL; - daemonClientEventCallbackPtr ref; + daemonClientEventCallback *callback = NULL; + daemonClientEventCallback *ref; struct daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); virDomainPtr dom = NULL; @@ -6532,10 +6532,10 @@ qemuDispatchConnectDomainMonitorEventRegister(virNetServerPtr server G_GNUC_UNUS static int -qemuDispatchConnectDomainMonitorEventDeregister(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr G_GNUC_UNUSED, +qemuDispatchConnectDomainMonitorEventDeregister(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr G_GNUC_UNUSED, qemu_connect_domain_monitor_event_deregister_args *args) { int rv = -1; @@ -6577,10 +6577,10 @@ qemuDispatchConnectDomainMonitorEventDeregister(virNetServerPtr server G_GNUC_UN } static int -remoteDispatchDomainGetTime(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetTime(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_time_args *args, remote_domain_get_time_ret *ret) { @@ -6612,10 +6612,10 @@ remoteDispatchDomainGetTime(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchNodeGetFreePages(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchNodeGetFreePages(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_node_get_free_pages_args *args, remote_node_get_free_pages_ret *ret) { @@ -6689,10 +6689,10 @@ remoteSerializeDHCPLease(remote_network_dhcp_lease *lease_dst, virNetworkDHCPLea static int -remoteDispatchNetworkGetDHCPLeases(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchNetworkGetDHCPLeases(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_network_get_dhcp_leases_args *args, remote_network_get_dhcp_leases_ret *ret) { @@ -6753,10 +6753,10 @@ remoteDispatchNetworkGetDHCPLeases(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchConnectGetAllDomainStats(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchConnectGetAllDomainStats(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_connect_get_all_domain_stats_args *args, remote_connect_get_all_domain_stats_ret *ret) { @@ -6811,7 +6811,7 @@ remoteDispatchConnectGetAllDomainStats(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(retStats[i]->params, retStats[i]->nparams, REMOTE_CONNECT_GET_ALL_DOMAIN_STATS_MAX, - (virTypedParameterRemotePtr *) &dst->params.params_val, + (struct _virTypedParameterRemote **) &dst->params.params_val, &dst->params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) goto cleanup; @@ -6838,10 +6838,10 @@ remoteDispatchConnectGetAllDomainStats(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchNodeAllocPages(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchNodeAllocPages(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_node_alloc_pages_args *args, remote_node_alloc_pages_ret *ret) { @@ -6872,10 +6872,10 @@ remoteDispatchNodeAllocPages(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchDomainGetFSInfo(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetFSInfo(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_fsinfo_args *args, remote_domain_get_fsinfo_ret *ret) { @@ -7048,10 +7048,10 @@ remoteSerializeDomainInterface(virDomainInterfacePtr *ifaces, static int -remoteDispatchDomainInterfaceAddresses(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainInterfaceAddresses(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_interface_addresses_args *args, remote_domain_interface_addresses_ret *ret) { @@ -7093,10 +7093,10 @@ remoteDispatchDomainInterfaceAddresses(virNetServerPtr server G_GNUC_UNUSED, static int -remoteDispatchNetworkPortGetParameters(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchNetworkPortGetParameters(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_network_port_get_parameters_args *args, remote_network_port_get_parameters_ret *ret) { @@ -7117,7 +7117,7 @@ remoteDispatchNetworkPortGetParameters(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, REMOTE_NETWORK_PORT_PARAMETERS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, args->flags) < 0) goto cleanup; @@ -7338,10 +7338,10 @@ remoteSerializeDomainDiskErrors(virDomainDiskErrorPtr errors, } static int -remoteDispatchDomainGetGuestInfo(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetGuestInfo(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_guest_info_args *args, remote_domain_get_guest_info_ret *ret) { @@ -7362,7 +7362,7 @@ remoteDispatchDomainGetGuestInfo(virNetServerPtr server G_GNUC_UNUSED, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_GUEST_INFO_PARAMS_MAX, - (virTypedParameterRemotePtr *) &ret->params.params_val, + (struct _virTypedParameterRemote **) &ret->params.params_val, &ret->params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) goto cleanup; @@ -7379,10 +7379,10 @@ remoteDispatchDomainGetGuestInfo(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainAuthorizedSshKeysGet(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainAuthorizedSshKeysGet(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_authorized_ssh_keys_get_args *args, remote_domain_authorized_ssh_keys_get_ret *ret) { @@ -7425,10 +7425,10 @@ remoteDispatchDomainAuthorizedSshKeysGet(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainAuthorizedSshKeysSet(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainAuthorizedSshKeysSet(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_authorized_ssh_keys_set_args *args) { int rv = -1; @@ -7461,10 +7461,10 @@ remoteDispatchDomainAuthorizedSshKeysSet(virNetServerPtr server G_GNUC_UNUSED, } static int -remoteDispatchDomainGetMessages(virNetServerPtr server G_GNUC_UNUSED, - virNetServerClientPtr client, - virNetMessagePtr msg G_GNUC_UNUSED, - virNetMessageErrorPtr rerr, +remoteDispatchDomainGetMessages(virNetServer *server G_GNUC_UNUSED, + virNetServerClient *client, + virNetMessage *msg G_GNUC_UNUSED, + struct virNetMessageError *rerr, remote_domain_get_messages_args *args, remote_domain_get_messages_ret *ret) { diff --git a/src/remote/remote_daemon_dispatch.h b/src/remote/remote_daemon_dispatch.h index 1f70b9e4e9..0d5f243203 100644 --- a/src/remote/remote_daemon_dispatch.h +++ b/src/remote/remote_daemon_dispatch.h @@ -35,5 +35,5 @@ extern virNetServerProgramProc qemuProcs[]; extern size_t qemuNProcs; void remoteClientFree(void *data); -void *remoteClientNew(virNetServerClientPtr client, +void *remoteClientNew(virNetServerClient *client, void *opaque); diff --git a/src/remote/remote_daemon_stream.c b/src/remote/remote_daemon_stream.c index 57816eb10e..007ad73e27 100644 --- a/src/remote/remote_daemon_stream.c +++ b/src/remote/remote_daemon_stream.c @@ -34,10 +34,10 @@ VIR_LOG_INIT("daemon.stream"); struct daemonClientStream { - daemonClientPrivatePtr priv; + daemonClientPrivate *priv; int refs; - virNetServerProgramPtr prog; + virNetServerProgram *prog; virStreamPtr st; int procedure; @@ -48,29 +48,29 @@ struct daemonClientStream { int filterID; - virNetMessagePtr rx; + virNetMessage *rx; bool tx; bool allowSkip; size_t dataLen; /* How much data is there remaining until we see a hole */ - daemonClientStreamPtr next; + daemonClientStream *next; }; static int -daemonStreamHandleWrite(virNetServerClientPtr client, +daemonStreamHandleWrite(virNetServerClient *client, daemonClientStream *stream); static int -daemonStreamHandleRead(virNetServerClientPtr client, +daemonStreamHandleRead(virNetServerClient *client, daemonClientStream *stream); static int -daemonStreamHandleFinish(virNetServerClientPtr client, +daemonStreamHandleFinish(virNetServerClient *client, daemonClientStream *stream, - virNetMessagePtr msg); + virNetMessage *msg); static int -daemonStreamHandleAbort(virNetServerClientPtr client, +daemonStreamHandleAbort(virNetServerClient *client, daemonClientStream *stream, - virNetMessagePtr msg); + virNetMessage *msg); @@ -96,7 +96,7 @@ daemonStreamUpdateEvents(daemonClientStream *stream) * fast stream, but slow client */ static void -daemonStreamMessageFinished(virNetMessagePtr msg, +daemonStreamMessageFinished(virNetMessage *msg, void *opaque) { daemonClientStream *stream = opaque; @@ -116,9 +116,9 @@ daemonStreamMessageFinished(virNetMessagePtr msg, static void daemonStreamEvent(virStreamPtr st, int events, void *opaque) { - virNetServerClientPtr client = opaque; + virNetServerClient *client = opaque; daemonClientStream *stream; - daemonClientPrivatePtr priv = virNetServerClientGetPrivateData(client); + daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); virMutexLock(&priv->lock); @@ -166,7 +166,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque) /* If we have a completion/abort message, always process it */ if (stream->rx) { - virNetMessagePtr msg = stream->rx; + virNetMessage *msg = stream->rx; switch (msg->header.status) { case VIR_NET_CONTINUE: /* nada */ @@ -199,7 +199,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque) */ if (!stream->closed && !stream->recvEOF && (events & VIR_STREAM_EVENT_HANGUP)) { - virNetMessagePtr msg; + virNetMessage *msg; events &= ~(VIR_STREAM_EVENT_HANGUP); stream->tx = false; stream->recvEOF = true; @@ -227,7 +227,7 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque) if (!stream->closed && (events & (VIR_STREAM_EVENT_ERROR | VIR_STREAM_EVENT_HANGUP))) { int ret; - virNetMessagePtr msg; + virNetMessage *msg; virNetMessageError rerr; virErrorPtr origErr; @@ -286,8 +286,8 @@ daemonStreamEvent(virStreamPtr st, int events, void *opaque) * -1 on fatal client error */ static int -daemonStreamFilter(virNetServerClientPtr client, - virNetMessagePtr msg, +daemonStreamFilter(virNetServerClient *client, + virNetMessage *msg, void *opaque) { daemonClientStream *stream = opaque; @@ -350,14 +350,14 @@ daemonStreamFilter(virNetServerClientPtr client, * Returns a new stream object, or NULL upon OOM */ daemonClientStream * -daemonCreateClientStream(virNetServerClientPtr client, +daemonCreateClientStream(virNetServerClient *client, virStreamPtr st, - virNetServerProgramPtr prog, - virNetMessageHeaderPtr header, + virNetServerProgram *prog, + struct virNetMessageHeader *header, bool allowSkip) { daemonClientStream *stream; - daemonClientPrivatePtr priv = virNetServerClientGetPrivateData(client); + daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); VIR_DEBUG("client=%p, proc=%d, serial=%u, st=%p", client, header->proc, header->serial, st); @@ -382,10 +382,10 @@ daemonCreateClientStream(virNetServerClientPtr client, * Frees the memory associated with this inactive client * stream */ -int daemonFreeClientStream(virNetServerClientPtr client, +int daemonFreeClientStream(virNetServerClient *client, daemonClientStream *stream) { - virNetMessagePtr msg; + virNetMessage *msg; int ret = 0; if (!stream) @@ -402,7 +402,7 @@ int daemonFreeClientStream(virNetServerClientPtr client, msg = stream->rx; while (msg) { - virNetMessagePtr tmp = msg->next; + virNetMessage *tmp = msg->next; if (client) { /* Send a dummy reply to free up 'msg' & unblock client rx */ virNetMessageClear(msg); @@ -429,11 +429,11 @@ int daemonFreeClientStream(virNetServerClientPtr client, * @client: a locked client to add the stream to * @stream: a stream to add */ -int daemonAddClientStream(virNetServerClientPtr client, +int daemonAddClientStream(virNetServerClient *client, daemonClientStream *stream, bool transmit) { - daemonClientPrivatePtr priv = virNetServerClientGetPrivateData(client); + daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); VIR_DEBUG("client=%p, proc=%d, serial=%u, st=%p, transmit=%d", client, stream->procedure, stream->serial, stream->st, transmit); @@ -481,10 +481,10 @@ int daemonAddClientStream(virNetServerClientPtr client, * Returns 0 if the stream was removed, -1 if it doesn't exist */ int -daemonRemoveClientStream(virNetServerClientPtr client, +daemonRemoveClientStream(virNetServerClient *client, daemonClientStream *stream) { - daemonClientPrivatePtr priv = virNetServerClientGetPrivateData(client); + daemonClientPrivate *priv = virNetServerClientGetPrivateData(client); daemonClientStream *curr = priv->streams; daemonClientStream *prev = NULL; @@ -548,9 +548,9 @@ daemonRemoveAllClientStreams(daemonClientStream *stream) * 1 if message is still being processed */ static int -daemonStreamHandleWriteData(virNetServerClientPtr client, +daemonStreamHandleWriteData(virNetServerClient *client, daemonClientStream *stream, - virNetMessagePtr msg) + virNetMessage *msg) { int ret; @@ -606,9 +606,9 @@ daemonStreamHandleWriteData(virNetServerClientPtr client, * Returns 0 if successfully sent RPC reply, -1 upon fatal error */ static int -daemonStreamHandleFinish(virNetServerClientPtr client, +daemonStreamHandleFinish(virNetServerClient *client, daemonClientStream *stream, - virNetMessagePtr msg) + virNetMessage *msg) { int ret; @@ -645,9 +645,9 @@ daemonStreamHandleFinish(virNetServerClientPtr client, * Returns 0 if successfully aborted, -1 upon error */ static int -daemonStreamHandleAbort(virNetServerClientPtr client, +daemonStreamHandleAbort(virNetServerClient *client, daemonClientStream *stream, - virNetMessagePtr msg) + virNetMessage *msg) { int ret; bool raise_error = false; @@ -690,9 +690,9 @@ daemonStreamHandleAbort(virNetServerClientPtr client, static int -daemonStreamHandleHole(virNetServerClientPtr client, +daemonStreamHandleHole(virNetServerClient *client, daemonClientStream *stream, - virNetMessagePtr msg) + virNetMessage *msg) { int ret; virNetStreamHole data; @@ -744,13 +744,13 @@ daemonStreamHandleHole(virNetServerClientPtr client, * Returns 0 on success, or -1 upon fatal error */ static int -daemonStreamHandleWrite(virNetServerClientPtr client, +daemonStreamHandleWrite(virNetServerClient *client, daemonClientStream *stream) { VIR_DEBUG("client=%p, stream=%p", client, stream); while (stream->rx && !stream->closed) { - virNetMessagePtr msg = stream->rx; + virNetMessage *msg = stream->rx; int ret; if (msg->header.type == VIR_NET_STREAM_HOLE) { @@ -823,10 +823,10 @@ daemonStreamHandleWrite(virNetServerClientPtr client, * be killed */ static int -daemonStreamHandleRead(virNetServerClientPtr client, +daemonStreamHandleRead(virNetServerClient *client, daemonClientStream *stream) { - virNetMessagePtr msg = NULL; + virNetMessage *msg = NULL; virNetMessageError rerr; char *buffer; size_t bufferLen = VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX; diff --git a/src/remote/remote_daemon_stream.h b/src/remote/remote_daemon_stream.h index a9bed10292..9de1a0ad81 100644 --- a/src/remote/remote_daemon_stream.h +++ b/src/remote/remote_daemon_stream.h @@ -23,21 +23,21 @@ #include "remote_daemon.h" daemonClientStream * -daemonCreateClientStream(virNetServerClientPtr client, +daemonCreateClientStream(virNetServerClient *client, virStreamPtr st, - virNetServerProgramPtr prog, - virNetMessageHeaderPtr hdr, + virNetServerProgram *prog, + struct virNetMessageHeader *hdr, bool allowSkip); -int daemonFreeClientStream(virNetServerClientPtr client, +int daemonFreeClientStream(virNetServerClient *client, daemonClientStream *stream); -int daemonAddClientStream(virNetServerClientPtr client, +int daemonAddClientStream(virNetServerClient *client, daemonClientStream *stream, bool transmit); int -daemonRemoveClientStream(virNetServerClientPtr client, +daemonRemoveClientStream(virNetServerClient *client, daemonClientStream *stream); void diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 82e4fba7a1..0c72d69933 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -79,14 +79,14 @@ static bool inside_daemon; struct private_data { virMutex lock; - virNetClientPtr client; - virNetClientProgramPtr remoteProgram; - virNetClientProgramPtr qemuProgram; - virNetClientProgramPtr lxcProgram; + virNetClient *client; + virNetClientProgram *remoteProgram; + virNetClientProgram *qemuProgram; + virNetClientProgram *lxcProgram; int counter; /* Serial number for RPC */ - virNetTLSContextPtr tls; + virNetTLSContext *tls; int is_secure; /* Secure if TLS or SASL or UNIX sockets */ char *type; /* Cached return from remoteType. */ @@ -96,8 +96,8 @@ struct private_data { bool serverEventFilter; /* Does server support modern event filtering */ bool serverCloseCallback; /* Does server support driver close callback */ - virObjectEventStatePtr eventState; - virConnectCloseCallbackDataPtr closeCallback; + virObjectEventState *eventState; + virConnectCloseCallbackData *closeCallback; }; enum { @@ -182,236 +182,236 @@ remoteStateInitialize(bool privileged G_GNUC_UNUSED, static void -remoteDomainBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static void -remoteDomainBuildEventReboot(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventReboot(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackReboot(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackReboot(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static void -remoteDomainBuildEventRTCChange(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventRTCChange(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackRTCChange(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackRTCChange(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventWatchdog(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventWatchdog(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackWatchdog(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackWatchdog(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventIOError(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventIOError(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackIOError(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackIOError(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventIOErrorReason(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventIOErrorReason(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackIOErrorReason(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackIOErrorReason(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventGraphics(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventGraphics(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackGraphics(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackGraphics(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventControlError(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventControlError(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackControlError(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackControlError(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventBlockJob(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventBlockJob(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackBlockJob(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackBlockJob(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventDiskChange(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventDiskChange(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackDiskChange(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackDiskChange(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventTrayChange(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventTrayChange(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackTrayChange(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackTrayChange(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventPMWakeup(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventPMWakeup(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackPMWakeup(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackPMWakeup(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventPMSuspend(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventPMSuspend(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackPMSuspend(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackPMSuspend(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventBalloonChange(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventBalloonChange(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackBalloonChange(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackBalloonChange(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventPMSuspendDisk(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventPMSuspendDisk(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackPMSuspendDisk(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackPMSuspendDisk(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventDeviceRemoved(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventDeviceRemoved(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackDeviceRemoved(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackDeviceRemoved(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackDeviceAdded(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackDeviceAdded(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackDeviceRemovalFailed(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackDeviceRemovalFailed(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventBlockJob2(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventBlockJob2(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackTunable(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackTunable(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackAgentLifecycle(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackAgentLifecycle(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackMigrationIteration(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackMigrationIteration(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackJobCompleted(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackJobCompleted(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventCallbackMetadataChange(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventCallbackMetadataChange(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteNetworkBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteNetworkBuildEventLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static void -remoteStoragePoolBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteStoragePoolBuildEventLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static void -remoteStoragePoolBuildEventRefresh(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteStoragePoolBuildEventRefresh(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static void -remoteNodeDeviceBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteNodeDeviceBuildEventLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static void -remoteNodeDeviceBuildEventUpdate(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteNodeDeviceBuildEventUpdate(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static void -remoteSecretBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteSecretBuildEventLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static void -remoteSecretBuildEventValueChanged(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteSecretBuildEventValueChanged(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static void -remoteDomainBuildEventBlockThreshold(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventBlockThreshold(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteDomainBuildEventMemoryFailure(virNetClientProgramPtr prog, - virNetClientPtr client, +remoteDomainBuildEventMemoryFailure(virNetClientProgram *prog, + virNetClient *client, void *evdata, void *opaque); static void -remoteConnectNotifyEventConnectionClosed(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteConnectNotifyEventConnectionClosed(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static virNetClientProgramEvent remoteEvents[] = { @@ -627,8 +627,8 @@ static virNetClientProgramEvent remoteEvents[] = { }; static void -remoteConnectNotifyEventConnectionClosed(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteConnectNotifyEventConnectionClosed(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -639,8 +639,8 @@ remoteConnectNotifyEventConnectionClosed(virNetClientProgramPtr prog G_GNUC_UNUS } static void -remoteDomainBuildQemuMonitorEvent(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildQemuMonitorEvent(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque); static virNetClientProgramEvent qemuEvents[] = { @@ -658,11 +658,11 @@ enum virDrvOpenRemoteFlags { static void -remoteClientCloseFunc(virNetClientPtr client G_GNUC_UNUSED, +remoteClientCloseFunc(virNetClient *client G_GNUC_UNUSED, int reason, void *opaque) { - virConnectCloseCallbackDataCall((virConnectCloseCallbackDataPtr)opaque, + virConnectCloseCallbackDataCall((virConnectCloseCallbackData *)opaque, reason); } @@ -749,7 +749,7 @@ doRemoteOpen(virConnectPtr conn, const char *driver_str, remoteDriverTransport transport, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf, + virConf *conf, unsigned int flags) { #ifndef WIN32 @@ -818,7 +818,7 @@ doRemoteOpen(virConnectPtr conn, */ if (conn->uri) { for (i = 0; i < conn->uri->paramsCount; i++) { - virURIParamPtr var = &conn->uri->params[i]; + virURIParam *var = &conn->uri->params[i]; EXTRACT_URI_ARG_STR("name", name); EXTRACT_URI_ARG_STR("command", command); EXTRACT_URI_ARG_STR("socket", sockname); @@ -1233,7 +1233,7 @@ remoteAllocPrivateData(void) static virDrvOpenStatus remoteConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, - virConfPtr conf, + virConf *conf, unsigned int flags) { struct private_data *priv; @@ -1753,7 +1753,7 @@ remoteDomainBlockStatsFlags(virDomainPtr domain, *nparams = ret.params.params_len; /* Deserialize the result. */ - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_DOMAIN_BLOCK_STATS_PARAMETERS_MAX, ¶ms, @@ -1801,7 +1801,7 @@ remoteDomainGetMemoryParameters(virDomainPtr domain, goto cleanup; } - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX, ¶ms, @@ -1849,7 +1849,7 @@ remoteDomainGetNumaParameters(virDomainPtr domain, goto cleanup; } - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_DOMAIN_NUMA_PARAMETERS_MAX, ¶ms, @@ -1888,7 +1888,7 @@ remoteDomainGetLaunchSecurityInfo(virDomainPtr domain, (xdrproc_t) xdr_remote_domain_get_launch_security_info_ret, (char *) &ret) == -1) goto done; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_DOMAIN_LAUNCH_SECURITY_INFO_PARAMS_MAX, params, @@ -1927,7 +1927,7 @@ remoteDomainGetPerfEvents(virDomainPtr domain, (xdrproc_t) xdr_remote_domain_get_perf_events_ret, (char *) &ret) == -1) goto done; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_DOMAIN_PERF_EVENTS_MAX, params, @@ -1975,7 +1975,7 @@ remoteDomainGetBlkioParameters(virDomainPtr domain, goto cleanup; } - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX, ¶ms, @@ -2857,7 +2857,7 @@ static int remoteDomainGetBlockIoTune(virDomainPtr domain, goto cleanup; } - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_DOMAIN_BLOCK_IO_TUNE_PARAMETERS_MAX, ¶ms, @@ -2947,7 +2947,7 @@ static int remoteDomainGetCPUStats(virDomainPtr domain, virTypedParameterPtr cpu_params = ¶ms[cpu * nparams]; remote_typed_param *stride = &ret.params.params_val[cpu * ret.nparams]; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) stride, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) stride, ret.nparams, REMOTE_NODE_CPU_STATS_MAX, &cpu_params, &tmp) < 0) @@ -3847,7 +3847,7 @@ struct remoteAuthInteractState { sasl_interact_t *interact; virConnectCredentialPtr cred; size_t ncred; - virAuthConfigPtr config; + virAuthConfig *config; }; @@ -4005,8 +4005,8 @@ remoteAuthSASL(virConnectPtr conn, struct private_data *priv, sasl_callback_t *saslcb = NULL; int ret = -1; const char *mechlist; - virNetSASLContextPtr saslCtxt; - virNetSASLSessionPtr sasl = NULL; + virNetSASLContext *saslCtxt; + virNetSASLSession *sasl = NULL; struct remoteAuthInteractState state; memset(&state, 0, sizeof(state)); @@ -4355,7 +4355,7 @@ remoteDomainBuildEventLifecycleHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4367,8 +4367,8 @@ remoteDomainBuildEventLifecycleHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4376,8 +4376,8 @@ remoteDomainBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventLifecycleHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4393,7 +4393,7 @@ remoteDomainBuildEventRebootHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4405,8 +4405,8 @@ remoteDomainBuildEventRebootHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventReboot(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventReboot(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4414,8 +4414,8 @@ remoteDomainBuildEventReboot(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventRebootHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackReboot(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackReboot(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4430,7 +4430,7 @@ remoteDomainBuildEventRTCChangeHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4442,8 +4442,8 @@ remoteDomainBuildEventRTCChangeHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventRTCChange(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventRTCChange(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4451,8 +4451,8 @@ remoteDomainBuildEventRTCChange(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventRTCChangeHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackRTCChange(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackRTCChange(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4467,7 +4467,7 @@ remoteDomainBuildEventWatchdogHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4479,8 +4479,8 @@ remoteDomainBuildEventWatchdogHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventWatchdog(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventWatchdog(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4488,8 +4488,8 @@ remoteDomainBuildEventWatchdog(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventWatchdogHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackWatchdog(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackWatchdog(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4504,7 +4504,7 @@ remoteDomainBuildEventIOErrorHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4519,8 +4519,8 @@ remoteDomainBuildEventIOErrorHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventIOError(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventIOError(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4528,8 +4528,8 @@ remoteDomainBuildEventIOError(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventIOErrorHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackIOError(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackIOError(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4544,7 +4544,7 @@ remoteDomainBuildEventIOErrorReasonHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4561,8 +4561,8 @@ remoteDomainBuildEventIOErrorReasonHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventIOErrorReason(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventIOErrorReason(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4570,8 +4570,8 @@ remoteDomainBuildEventIOErrorReason(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventIOErrorReasonHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackIOErrorReason(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackIOErrorReason(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4586,7 +4586,7 @@ remoteDomainBuildEventBlockJobHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4600,8 +4600,8 @@ remoteDomainBuildEventBlockJobHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventBlockJob(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventBlockJob(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4609,8 +4609,8 @@ remoteDomainBuildEventBlockJob(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventBlockJobHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackBlockJob(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackBlockJob(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4618,15 +4618,15 @@ remoteDomainBuildEventCallbackBlockJob(virNetClientProgramPtr prog G_GNUC_UNUSED remoteDomainBuildEventBlockJobHelper(conn, &msg->msg, msg->callbackID); } static void -remoteDomainBuildEventBlockJob2(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventBlockJob2(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; remote_domain_event_block_job_2_msg *msg = evdata; struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4647,7 +4647,7 @@ remoteDomainBuildEventGraphicsHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; virDomainEventGraphicsAddressPtr localAddr = NULL; virDomainEventGraphicsAddressPtr remoteAddr = NULL; virDomainEventGraphicsSubjectPtr subject = NULL; @@ -4688,8 +4688,8 @@ remoteDomainBuildEventGraphicsHelper(virConnectPtr conn, return; } static void -remoteDomainBuildEventGraphics(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventGraphics(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4697,8 +4697,8 @@ remoteDomainBuildEventGraphics(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventGraphicsHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackGraphics(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackGraphics(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4713,7 +4713,7 @@ remoteDomainBuildEventControlErrorHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4726,8 +4726,8 @@ remoteDomainBuildEventControlErrorHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventControlError(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventControlError(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4735,8 +4735,8 @@ remoteDomainBuildEventControlError(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventControlErrorHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackControlError(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackControlError(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4752,7 +4752,7 @@ remoteDomainBuildEventDiskChangeHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4769,8 +4769,8 @@ remoteDomainBuildEventDiskChangeHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventDiskChange(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventDiskChange(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4778,8 +4778,8 @@ remoteDomainBuildEventDiskChange(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventDiskChangeHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackDiskChange(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackDiskChange(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4795,7 +4795,7 @@ remoteDomainBuildEventTrayChangeHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4810,8 +4810,8 @@ remoteDomainBuildEventTrayChangeHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventTrayChange(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventTrayChange(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4819,8 +4819,8 @@ remoteDomainBuildEventTrayChange(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventTrayChangeHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackTrayChange(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackTrayChange(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4836,7 +4836,7 @@ remoteDomainBuildEventPMWakeupHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4849,8 +4849,8 @@ remoteDomainBuildEventPMWakeupHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventPMWakeup(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventPMWakeup(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4858,8 +4858,8 @@ remoteDomainBuildEventPMWakeup(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventPMWakeupHelper(conn, msg, -1, 0); } static void -remoteDomainBuildEventCallbackPMWakeup(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackPMWakeup(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4876,7 +4876,7 @@ remoteDomainBuildEventPMSuspendHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4889,8 +4889,8 @@ remoteDomainBuildEventPMSuspendHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventPMSuspend(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventPMSuspend(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4898,8 +4898,8 @@ remoteDomainBuildEventPMSuspend(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventPMSuspendHelper(conn, msg, -1, 0); } static void -remoteDomainBuildEventCallbackPMSuspend(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackPMSuspend(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4916,7 +4916,7 @@ remoteDomainBuildEventBalloonChangeHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4928,8 +4928,8 @@ remoteDomainBuildEventBalloonChangeHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventBalloonChange(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventBalloonChange(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4937,8 +4937,8 @@ remoteDomainBuildEventBalloonChange(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventBalloonChangeHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackBalloonChange(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackBalloonChange(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4955,7 +4955,7 @@ remoteDomainBuildEventPMSuspendDiskHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -4968,8 +4968,8 @@ remoteDomainBuildEventPMSuspendDiskHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventPMSuspendDisk(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventPMSuspendDisk(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4977,8 +4977,8 @@ remoteDomainBuildEventPMSuspendDisk(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventPMSuspendDiskHelper(conn, msg, -1, 0); } static void -remoteDomainBuildEventCallbackPMSuspendDisk(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackPMSuspendDisk(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -4995,7 +4995,7 @@ remoteDomainBuildEventDeviceRemovedHelper(virConnectPtr conn, { struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -5008,8 +5008,8 @@ remoteDomainBuildEventDeviceRemovedHelper(virConnectPtr conn, virObjectEventStateQueueRemote(priv->eventState, event, callbackID); } static void -remoteDomainBuildEventDeviceRemoved(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventDeviceRemoved(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -5017,8 +5017,8 @@ remoteDomainBuildEventDeviceRemoved(virNetClientProgramPtr prog G_GNUC_UNUSED, remoteDomainBuildEventDeviceRemovedHelper(conn, msg, -1); } static void -remoteDomainBuildEventCallbackDeviceRemoved(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackDeviceRemoved(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -5027,15 +5027,15 @@ remoteDomainBuildEventCallbackDeviceRemoved(virNetClientProgramPtr prog G_GNUC_U } static void -remoteDomainBuildEventCallbackDeviceAdded(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackDeviceAdded(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; remote_domain_event_callback_device_added_msg *msg = evdata; struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -5050,15 +5050,15 @@ remoteDomainBuildEventCallbackDeviceAdded(virNetClientProgramPtr prog G_GNUC_UNU static void -remoteDomainBuildEventCallbackDeviceRemovalFailed(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackDeviceRemovalFailed(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; remote_domain_event_callback_device_removal_failed_msg *msg = evdata; struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(dom = get_nonnull_domain(conn, msg->dom))) return; @@ -5071,8 +5071,8 @@ remoteDomainBuildEventCallbackDeviceRemovalFailed(virNetClientProgramPtr prog G_ } static void -remoteDomainBuildEventCallbackTunable(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackTunable(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; @@ -5081,9 +5081,9 @@ remoteDomainBuildEventCallbackTunable(virNetClientProgramPtr prog G_GNUC_UNUSED, virDomainPtr dom; virTypedParameterPtr params = NULL; int nparams = 0; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) msg->params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) msg->params.params_val, msg->params.params_len, REMOTE_DOMAIN_EVENT_TUNABLE_MAX, ¶ms, &nparams) < 0) @@ -5104,15 +5104,15 @@ remoteDomainBuildEventCallbackTunable(virNetClientProgramPtr prog G_GNUC_UNUSED, static void -remoteDomainBuildEventCallbackAgentLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackAgentLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; remote_domain_event_callback_agent_lifecycle_msg *msg = evdata; struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(dom = get_nonnull_domain(conn, msg->dom))) return; @@ -5127,8 +5127,8 @@ remoteDomainBuildEventCallbackAgentLifecycle(virNetClientProgramPtr prog G_GNUC_ static void -remoteDomainBuildEventCallbackMigrationIteration(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackMigrationIteration(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { @@ -5136,7 +5136,7 @@ remoteDomainBuildEventCallbackMigrationIteration(virNetClientProgramPtr prog G_G remote_domain_event_callback_migration_iteration_msg *msg = evdata; struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(dom = get_nonnull_domain(conn, msg->dom))) return; @@ -5150,8 +5150,8 @@ remoteDomainBuildEventCallbackMigrationIteration(virNetClientProgramPtr prog G_G static void -remoteDomainBuildEventCallbackJobCompleted(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackJobCompleted(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { @@ -5159,11 +5159,11 @@ remoteDomainBuildEventCallbackJobCompleted(virNetClientProgramPtr prog G_GNUC_UN remote_domain_event_callback_job_completed_msg *msg = evdata; struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; virTypedParameterPtr params = NULL; int nparams = 0; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) msg->params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) msg->params.params_val, msg->params.params_len, REMOTE_DOMAIN_JOB_STATS_MAX, ¶ms, &nparams) < 0) @@ -5183,15 +5183,15 @@ remoteDomainBuildEventCallbackJobCompleted(virNetClientProgramPtr prog G_GNUC_UN static void -remoteDomainBuildEventCallbackMetadataChange(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventCallbackMetadataChange(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; remote_domain_event_callback_metadata_change_msg *msg = evdata; struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(dom = get_nonnull_domain(conn, msg->dom))) return; @@ -5205,15 +5205,15 @@ remoteDomainBuildEventCallbackMetadataChange(virNetClientProgramPtr prog G_GNUC_ static void -remoteNetworkBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteNetworkBuildEventLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; struct private_data *priv = conn->privateData; remote_network_event_lifecycle_msg *msg = evdata; virNetworkPtr net; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; net = get_nonnull_network(conn, msg->net); if (!net) @@ -5227,15 +5227,15 @@ remoteNetworkBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, } static void -remoteStoragePoolBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteStoragePoolBuildEventLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; struct private_data *priv = conn->privateData; remote_storage_pool_event_lifecycle_msg *msg = evdata; virStoragePoolPtr pool; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; pool = get_nonnull_storage_pool(conn, msg->pool); if (!pool) @@ -5249,15 +5249,15 @@ remoteStoragePoolBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, } static void -remoteStoragePoolBuildEventRefresh(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteStoragePoolBuildEventRefresh(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; struct private_data *priv = conn->privateData; remote_storage_pool_event_refresh_msg *msg = evdata; virStoragePoolPtr pool; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; pool = get_nonnull_storage_pool(conn, msg->pool); if (!pool) @@ -5270,15 +5270,15 @@ remoteStoragePoolBuildEventRefresh(virNetClientProgramPtr prog G_GNUC_UNUSED, } static void -remoteNodeDeviceBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteNodeDeviceBuildEventLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; struct private_data *priv = conn->privateData; remote_node_device_event_lifecycle_msg *msg = evdata; virNodeDevicePtr dev; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dev = get_nonnull_node_device(conn, msg->dev); if (!dev) @@ -5292,15 +5292,15 @@ remoteNodeDeviceBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, } static void -remoteNodeDeviceBuildEventUpdate(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteNodeDeviceBuildEventUpdate(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; struct private_data *priv = conn->privateData; remote_node_device_event_update_msg *msg = evdata; virNodeDevicePtr dev; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dev = get_nonnull_node_device(conn, msg->dev); if (!dev) @@ -5313,15 +5313,15 @@ remoteNodeDeviceBuildEventUpdate(virNetClientProgramPtr prog G_GNUC_UNUSED, } static void -remoteSecretBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteSecretBuildEventLifecycle(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; struct private_data *priv = conn->privateData; remote_secret_event_lifecycle_msg *msg = evdata; virSecretPtr secret; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; secret = get_nonnull_secret(conn, msg->secret); if (!secret) @@ -5335,15 +5335,15 @@ remoteSecretBuildEventLifecycle(virNetClientProgramPtr prog G_GNUC_UNUSED, } static void -remoteSecretBuildEventValueChanged(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteSecretBuildEventValueChanged(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; struct private_data *priv = conn->privateData; remote_secret_event_value_changed_msg *msg = evdata; virSecretPtr secret; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; secret = get_nonnull_secret(conn, msg->secret); if (!secret) @@ -5356,15 +5356,15 @@ remoteSecretBuildEventValueChanged(virNetClientProgramPtr prog G_GNUC_UNUSED, } static void -remoteDomainBuildQemuMonitorEvent(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildQemuMonitorEvent(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; struct private_data *priv = conn->privateData; qemu_domain_monitor_event_msg *msg = evdata; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; dom = get_nonnull_domain(conn, msg->dom); if (!dom) @@ -5416,15 +5416,15 @@ remoteSecretGetValue(virSecretPtr secret, size_t *value_size, static void -remoteDomainBuildEventBlockThreshold(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventBlockThreshold(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; remote_domain_event_block_threshold_msg *msg = evdata; struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(dom = get_nonnull_domain(conn, msg->dom))) return; @@ -5440,15 +5440,15 @@ remoteDomainBuildEventBlockThreshold(virNetClientProgramPtr prog G_GNUC_UNUSED, static void -remoteDomainBuildEventMemoryFailure(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetClientPtr client G_GNUC_UNUSED, +remoteDomainBuildEventMemoryFailure(virNetClientProgram *prog G_GNUC_UNUSED, + virNetClient *client G_GNUC_UNUSED, void *evdata, void *opaque) { virConnectPtr conn = opaque; remote_domain_event_memory_failure_msg *msg = evdata; struct private_data *priv = conn->privateData; virDomainPtr dom; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(dom = get_nonnull_domain(conn, msg->dom))) return; @@ -5468,7 +5468,7 @@ remoteStreamSend(virStreamPtr st, size_t nbytes) { struct private_data *priv = st->conn->privateData; - virNetClientStreamPtr privst = st->privateData; + virNetClientStream *privst = st->privateData; int rv; VIR_DEBUG("st=%p data=%p nbytes=%zu", st, data, nbytes); @@ -5497,7 +5497,7 @@ remoteStreamRecvFlags(virStreamPtr st, unsigned int flags) { struct private_data *priv = st->conn->privateData; - virNetClientStreamPtr privst = st->privateData; + virNetClientStream *privst = st->privateData; int rv; VIR_DEBUG("st=%p data=%p nbytes=%zu flags=0x%x", @@ -5539,7 +5539,7 @@ remoteStreamSendHole(virStreamPtr st, unsigned int flags) { struct private_data *priv = st->conn->privateData; - virNetClientStreamPtr privst = st->privateData; + virNetClientStream *privst = st->privateData; int rv; VIR_DEBUG("st=%p length=%lld flags=0x%x", @@ -5567,7 +5567,7 @@ remoteStreamRecvHole(virStreamPtr st, unsigned int flags) { struct private_data *priv = st->conn->privateData; - virNetClientStreamPtr privst = st->privateData; + virNetClientStream *privst = st->privateData; int rv; VIR_DEBUG("st=%p length=%p flags=0x%x", @@ -5595,7 +5595,7 @@ struct remoteStreamCallbackData { virFreeCallback ff; }; -static void remoteStreamEventCallback(virNetClientStreamPtr stream G_GNUC_UNUSED, +static void remoteStreamEventCallback(virNetClientStream *stream G_GNUC_UNUSED, int events, void *opaque) { @@ -5625,7 +5625,7 @@ remoteStreamEventAddCallback(virStreamPtr st, virFreeCallback ff) { struct private_data *priv = st->conn->privateData; - virNetClientStreamPtr privst = st->privateData; + virNetClientStream *privst = st->privateData; int ret = -1; struct remoteStreamCallbackData *cbdata; @@ -5659,7 +5659,7 @@ remoteStreamEventUpdateCallback(virStreamPtr st, int events) { struct private_data *priv = st->conn->privateData; - virNetClientStreamPtr privst = st->privateData; + virNetClientStream *privst = st->privateData; int ret = -1; remoteDriverLock(priv); @@ -5675,7 +5675,7 @@ static int remoteStreamEventRemoveCallback(virStreamPtr st) { struct private_data *priv = st->conn->privateData; - virNetClientStreamPtr privst = st->privateData; + virNetClientStream *privst = st->privateData; int ret = -1; remoteDriverLock(priv); @@ -5691,7 +5691,7 @@ static int remoteStreamCloseInt(virStreamPtr st, bool streamAbort) { struct private_data *priv = st->conn->privateData; - virNetClientStreamPtr privst = st->privateData; + virNetClientStream *privst = st->privateData; int ret = -1; remoteDriverLock(priv); @@ -6039,7 +6039,7 @@ remoteDomainMigratePrepareTunnel3(virConnectPtr dconn, int rv = -1; remote_domain_migrate_prepare_tunnel3_args args; remote_domain_migrate_prepare_tunnel3_ret ret; - virNetClientStreamPtr netst; + virNetClientStream *netst; remoteDriverLock(priv); @@ -6507,9 +6507,9 @@ callFull(virConnectPtr conn G_GNUC_UNUSED, xdrproc_t ret_filter, char *ret) { int rv; - virNetClientProgramPtr prog; + virNetClientProgram *prog; int counter = priv->counter++; - virNetClientPtr client = priv->client; + virNetClient *client = priv->client; priv->localUses++; if (flags & REMOTE_CALL_QEMU) @@ -6588,7 +6588,7 @@ remoteDomainGetInterfaceParameters(virDomainPtr domain, goto cleanup; } - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_DOMAIN_INTERFACE_PARAMETERS_MAX, ¶ms, @@ -6637,7 +6637,7 @@ remoteNodeGetMemoryParameters(virConnectPtr conn, goto cleanup; } - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_NODE_MEMORY_PARAMETERS_MAX, ¶ms, @@ -6676,7 +6676,7 @@ remoteNodeGetSEVInfo(virConnectPtr conn, (xdrproc_t) xdr_remote_node_get_sev_info_ret, (char *) &ret) == -1) goto done; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_NODE_SEV_INFO_MAX, params, @@ -6796,7 +6796,7 @@ remoteDomainGetJobStats(virDomainPtr domain, *type = ret.type; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_DOMAIN_JOB_STATS_MAX, params, nparams) < 0) @@ -6836,7 +6836,7 @@ remoteDomainMigrateBegin3Params(virDomainPtr domain, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX, - (virTypedParameterRemotePtr *) &args.params.params_val, + (struct _virTypedParameterRemote **) &args.params.params_val, &args.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { xdr_free((xdrproc_t) xdr_remote_domain_migrate_begin3_params_args, @@ -6864,7 +6864,7 @@ remoteDomainMigrateBegin3Params(virDomainPtr domain, rv = ret.xml; /* caller frees */ cleanup: - virTypedParamsRemoteFree((virTypedParameterRemotePtr) args.params.params_val, + virTypedParamsRemoteFree((struct _virTypedParameterRemote *) args.params.params_val, args.params.params_len); remoteDriverUnlock(priv); return rv; @@ -6898,7 +6898,7 @@ remoteDomainMigratePrepare3Params(virConnectPtr dconn, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX, - (virTypedParameterRemotePtr *) &args.params.params_val, + (struct _virTypedParameterRemote **) &args.params.params_val, &args.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { xdr_free((xdrproc_t) xdr_remote_domain_migrate_prepare3_params_args, @@ -6938,7 +6938,7 @@ remoteDomainMigratePrepare3Params(virConnectPtr dconn, rv = 0; cleanup: - virTypedParamsRemoteFree((virTypedParameterRemotePtr) args.params.params_val, + virTypedParamsRemoteFree((struct _virTypedParameterRemote *) args.params.params_val, args.params.params_len); VIR_FREE(ret.uri_out); remoteDriverUnlock(priv); @@ -6967,7 +6967,7 @@ remoteDomainMigratePrepareTunnel3Params(virConnectPtr dconn, int rv = -1; remote_domain_migrate_prepare_tunnel3_params_args args; remote_domain_migrate_prepare_tunnel3_params_ret ret; - virNetClientStreamPtr netst; + virNetClientStream *netst; remoteDriverLock(priv); @@ -6980,7 +6980,7 @@ remoteDomainMigratePrepareTunnel3Params(virConnectPtr dconn, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX, - (virTypedParameterRemotePtr *) &args.params.params_val, + (struct _virTypedParameterRemote **) &args.params.params_val, &args.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { xdr_free((xdrproc_t) xdr_remote_domain_migrate_prepare_tunnel3_params_args, @@ -7026,7 +7026,7 @@ remoteDomainMigratePrepareTunnel3Params(virConnectPtr dconn, rv = 0; cleanup: - virTypedParamsRemoteFree((virTypedParameterRemotePtr) args.params.params_val, + virTypedParamsRemoteFree((struct _virTypedParameterRemote *) args.params.params_val, args.params.params_len); remoteDriverUnlock(priv); return rv; @@ -7066,7 +7066,7 @@ remoteDomainMigratePerform3Params(virDomainPtr dom, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX, - (virTypedParameterRemotePtr *) &args.params.params_val, + (struct _virTypedParameterRemote **) &args.params.params_val, &args.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { xdr_free((xdrproc_t) xdr_remote_domain_migrate_perform3_params_args, @@ -7094,7 +7094,7 @@ remoteDomainMigratePerform3Params(virDomainPtr dom, rv = 0; cleanup: - virTypedParamsRemoteFree((virTypedParameterRemotePtr) args.params.params_val, + virTypedParamsRemoteFree((struct _virTypedParameterRemote *) args.params.params_val, args.params.params_len); remoteDriverUnlock(priv); return rv; @@ -7133,7 +7133,7 @@ remoteDomainMigrateFinish3Params(virConnectPtr dconn, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX, - (virTypedParameterRemotePtr *) &args.params.params_val, + (struct _virTypedParameterRemote **) &args.params.params_val, &args.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { xdr_free((xdrproc_t) xdr_remote_domain_migrate_finish3_params_args, @@ -7165,7 +7165,7 @@ remoteDomainMigrateFinish3Params(virConnectPtr dconn, (char *) &ret); cleanup: - virTypedParamsRemoteFree((virTypedParameterRemotePtr) args.params.params_val, + virTypedParamsRemoteFree((struct _virTypedParameterRemote *) args.params.params_val, args.params.params_len); remoteDriverUnlock(priv); return rv; @@ -7201,7 +7201,7 @@ remoteDomainMigrateConfirm3Params(virDomainPtr domain, if (virTypedParamsSerialize(params, nparams, REMOTE_DOMAIN_MIGRATE_PARAM_LIST_MAX, - (virTypedParameterRemotePtr *) &args.params.params_val, + (struct _virTypedParameterRemote **) &args.params.params_val, &args.params.params_len, VIR_TYPED_PARAM_STRING_OKAY) < 0) { xdr_free((xdrproc_t) xdr_remote_domain_migrate_confirm3_params_args, @@ -7217,7 +7217,7 @@ remoteDomainMigrateConfirm3Params(virDomainPtr domain, rv = 0; cleanup: - virTypedParamsRemoteFree((virTypedParameterRemotePtr) args.params.params_val, + virTypedParamsRemoteFree((struct _virTypedParameterRemote *) args.params.params_val, args.params.params_len); remoteDriverUnlock(priv); return rv; @@ -7538,7 +7538,7 @@ remoteConnectGetAllDomainStats(virConnectPtr conn, if (!(elem->dom = get_nonnull_domain(conn, rec->dom))) goto cleanup; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) rec->params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) rec->params.params_val, rec->params.params_len, REMOTE_CONNECT_GET_ALL_DOMAIN_STATS_MAX, &elem->params, @@ -7943,7 +7943,7 @@ remoteNetworkPortGetParameters(virNetworkPortPtr port, (xdrproc_t) xdr_remote_network_port_get_parameters_ret, (char *) &ret) == -1) goto done; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_NETWORK_PORT_PARAMETERS_MAX, params, @@ -7985,7 +7985,7 @@ remoteDomainGetGuestInfo(virDomainPtr dom, (xdrproc_t)xdr_remote_domain_get_guest_info_ret, (char *)&ret) == -1) goto done; - if (virTypedParamsDeserialize((virTypedParameterRemotePtr) ret.params.params_val, + if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val, ret.params.params_len, REMOTE_DOMAIN_GUEST_INFO_PARAMS_MAX, params, diff --git a/src/remote/remote_sockets.c b/src/remote/remote_sockets.c index 478c78edc2..43f78023fe 100644 --- a/src/remote/remote_sockets.c +++ b/src/remote/remote_sockets.c @@ -49,7 +49,7 @@ VIR_ENUM_IMPL(remoteDriverMode, int -remoteSplitURIScheme(virURIPtr uri, +remoteSplitURIScheme(virURI *uri, char **driver, remoteDriverTransport *transport) { @@ -221,7 +221,7 @@ remoteGetUNIXSocket(remoteDriverTransport transport, void -remoteGetURIDaemonInfo(virURIPtr uri, +remoteGetURIDaemonInfo(virURI *uri, remoteDriverTransport transport, bool *session, bool *autostart) diff --git a/src/remote/remote_sockets.h b/src/remote/remote_sockets.h index 7526752835..b3e0ce7da4 100644 --- a/src/remote/remote_sockets.h +++ b/src/remote/remote_sockets.h @@ -51,7 +51,7 @@ typedef enum { VIR_ENUM_DECL(remoteDriverMode); int -remoteSplitURIScheme(virURIPtr uri, +remoteSplitURIScheme(virURI *uri, char **driver, remoteDriverTransport *transport); @@ -64,7 +64,7 @@ remoteGetUNIXSocket(remoteDriverTransport transport, char **daemon); void -remoteGetURIDaemonInfo(virURIPtr uri, +remoteGetURIDaemonInfo(virURI *uri, remoteDriverTransport transport, bool *session, bool *autostart); diff --git a/src/remote/remote_ssh_helper.c b/src/remote/remote_ssh_helper.c index 8ed7e64507..7934e14509 100644 --- a/src/remote/remote_ssh_helper.c +++ b/src/remote/remote_ssh_helper.c @@ -43,10 +43,9 @@ struct virRemoteSSHHelperBuffer { }; typedef struct virRemoteSSHHelper virRemoteSSHHelper; -typedef virRemoteSSHHelper *virRemoteSSHHelperPtr; struct virRemoteSSHHelper { bool quit; - virNetSocketPtr sock; + virNetSocket *sock; int sockEvents; int stdinWatch; int stdinEvents; @@ -59,7 +58,7 @@ struct virRemoteSSHHelper { static void -virRemoteSSHHelperShutdown(virRemoteSSHHelperPtr proxy) +virRemoteSSHHelperShutdown(virRemoteSSHHelper *proxy) { if (proxy->sock) { virNetSocketRemoveIOCallback(proxy->sock); @@ -81,7 +80,7 @@ virRemoteSSHHelperShutdown(virRemoteSSHHelperPtr proxy) static void -virRemoteSSHHelperUpdateEvents(virRemoteSSHHelperPtr proxy) +virRemoteSSHHelperUpdateEvents(virRemoteSSHHelper *proxy) { int sockEvents = 0; int stdinEvents = 0; @@ -115,11 +114,11 @@ virRemoteSSHHelperUpdateEvents(virRemoteSSHHelperPtr proxy) } static void -virRemoteSSHHelperEventOnSocket(virNetSocketPtr sock, +virRemoteSSHHelperEventOnSocket(virNetSocket *sock, int events, void *opaque) { - virRemoteSSHHelperPtr proxy = opaque; + virRemoteSSHHelper *proxy = opaque; /* we got late event after proxy was shutdown */ if (!proxy->sock) @@ -189,7 +188,7 @@ virRemoteSSHHelperEventOnStdin(int watch G_GNUC_UNUSED, int events, void *opaque) { - virRemoteSSHHelperPtr proxy = opaque; + virRemoteSSHHelper *proxy = opaque; /* we got late event after console was shutdown */ if (!proxy->sock) @@ -248,7 +247,7 @@ virRemoteSSHHelperEventOnStdout(int watch G_GNUC_UNUSED, int events, void *opaque) { - virRemoteSSHHelperPtr proxy = opaque; + virRemoteSSHHelper *proxy = opaque; /* we got late event after console was shutdown */ if (!proxy->sock) @@ -290,7 +289,7 @@ virRemoteSSHHelperEventOnStdout(int watch G_GNUC_UNUSED, static int -virRemoteSSHHelperRun(virNetSocketPtr sock) +virRemoteSSHHelperRun(virNetSocket *sock) { int ret = -1; virRemoteSSHHelper proxy = { diff --git a/src/rpc/virkeepalive.c b/src/rpc/virkeepalive.c index 119427eb03..9d08c3bcca 100644 --- a/src/rpc/virkeepalive.c +++ b/src/rpc/virkeepalive.c @@ -51,7 +51,7 @@ struct _virKeepAlive { }; -static virClassPtr virKeepAliveClass; +static virClass *virKeepAliveClass; static void virKeepAliveDispose(void *obj); static int virKeepAliveOnceInit(void) @@ -64,10 +64,10 @@ static int virKeepAliveOnceInit(void) VIR_ONCE_GLOBAL_INIT(virKeepAlive); -static virNetMessagePtr -virKeepAliveMessage(virKeepAlivePtr ka, int proc) +static virNetMessage * +virKeepAliveMessage(virKeepAlive *ka, int proc) { - virNetMessagePtr msg; + virNetMessage *msg; const char *procstr = NULL; switch (proc) { @@ -110,8 +110,8 @@ virKeepAliveMessage(virKeepAlivePtr ka, int proc) static bool -virKeepAliveTimerInternal(virKeepAlivePtr ka, - virNetMessagePtr *msg) +virKeepAliveTimerInternal(virKeepAlive *ka, + virNetMessage **msg) { gint64 now = g_get_monotonic_time() / G_USEC_PER_SEC; int timeval; @@ -150,8 +150,8 @@ virKeepAliveTimerInternal(virKeepAlivePtr ka, static void virKeepAliveTimer(int timer G_GNUC_UNUSED, void *opaque) { - virKeepAlivePtr ka = opaque; - virNetMessagePtr msg = NULL; + virKeepAlive *ka = opaque; + virNetMessage *msg = NULL; bool dead; void *client; @@ -178,7 +178,7 @@ virKeepAliveTimer(int timer G_GNUC_UNUSED, void *opaque) } -virKeepAlivePtr +virKeepAlive * virKeepAliveNew(int interval, unsigned int count, void *client, @@ -186,7 +186,7 @@ virKeepAliveNew(int interval, virKeepAliveDeadFunc deadCB, virKeepAliveFreeFunc freeCB) { - virKeepAlivePtr ka; + virKeepAlive *ka; VIR_DEBUG("client=%p, interval=%d, count=%u", client, interval, count); @@ -216,7 +216,7 @@ virKeepAliveNew(int interval, void virKeepAliveDispose(void *obj) { - virKeepAlivePtr ka = obj; + virKeepAlive *ka = obj; PROBE(RPC_KEEPALIVE_DISPOSE, "ka=%p", ka); @@ -226,7 +226,7 @@ virKeepAliveDispose(void *obj) int -virKeepAliveStart(virKeepAlivePtr ka, +virKeepAliveStart(virKeepAlive *ka, int interval, unsigned int count) { @@ -293,7 +293,7 @@ virKeepAliveStart(virKeepAlivePtr ka, void -virKeepAliveStop(virKeepAlivePtr ka) +virKeepAliveStop(virKeepAlive *ka) { virObjectLock(ka); @@ -311,7 +311,7 @@ virKeepAliveStop(virKeepAlivePtr ka) int -virKeepAliveTimeout(virKeepAlivePtr ka) +virKeepAliveTimeout(virKeepAlive *ka) { int timeout; @@ -341,8 +341,8 @@ virKeepAliveTimeout(virKeepAlivePtr ka) bool -virKeepAliveTrigger(virKeepAlivePtr ka, - virNetMessagePtr *msg) +virKeepAliveTrigger(virKeepAlive *ka, + virNetMessage **msg) { bool dead; @@ -359,9 +359,9 @@ virKeepAliveTrigger(virKeepAlivePtr ka, bool -virKeepAliveCheckMessage(virKeepAlivePtr ka, - virNetMessagePtr msg, - virNetMessagePtr *response) +virKeepAliveCheckMessage(virKeepAlive *ka, + virNetMessage *msg, + virNetMessage **response) { bool ret = false; diff --git a/src/rpc/virkeepalive.h b/src/rpc/virkeepalive.h index 41d65d08d0..971d17913e 100644 --- a/src/rpc/virkeepalive.h +++ b/src/rpc/virkeepalive.h @@ -23,15 +23,14 @@ #include "virnetmessage.h" #include "virobject.h" -typedef int (*virKeepAliveSendFunc)(void *client, virNetMessagePtr msg); +typedef int (*virKeepAliveSendFunc)(void *client, virNetMessage *msg); typedef void (*virKeepAliveDeadFunc)(void *client); typedef void (*virKeepAliveFreeFunc)(void *client); typedef struct _virKeepAlive virKeepAlive; -typedef virKeepAlive *virKeepAlivePtr; -virKeepAlivePtr virKeepAliveNew(int interval, +virKeepAlive *virKeepAliveNew(int interval, unsigned int count, void *client, virKeepAliveSendFunc sendCB, @@ -40,14 +39,14 @@ virKeepAlivePtr virKeepAliveNew(int interval, ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6); -int virKeepAliveStart(virKeepAlivePtr ka, +int virKeepAliveStart(virKeepAlive *ka, int interval, unsigned int count); -void virKeepAliveStop(virKeepAlivePtr ka); +void virKeepAliveStop(virKeepAlive *ka); -int virKeepAliveTimeout(virKeepAlivePtr ka); -bool virKeepAliveTrigger(virKeepAlivePtr ka, - virNetMessagePtr *msg); -bool virKeepAliveCheckMessage(virKeepAlivePtr ka, - virNetMessagePtr msg, - virNetMessagePtr *response); +int virKeepAliveTimeout(virKeepAlive *ka); +bool virKeepAliveTrigger(virKeepAlive *ka, + virNetMessage **msg); +bool virKeepAliveCheckMessage(virKeepAlive *ka, + virNetMessage *msg, + virNetMessage **response); diff --git a/src/rpc/virnetclient.c b/src/rpc/virnetclient.c index 9195cb555d..3797a6097b 100644 --- a/src/rpc/virnetclient.c +++ b/src/rpc/virnetclient.c @@ -42,7 +42,6 @@ VIR_LOG_INIT("rpc.netclient"); typedef struct _virNetClientCall virNetClientCall; -typedef virNetClientCall *virNetClientCallPtr; enum { VIR_NET_CLIENT_MODE_WAIT_TX, @@ -57,34 +56,34 @@ VIR_ENUM_IMPL(virNetClientProxy, struct _virNetClientCall { int mode; - virNetMessagePtr msg; + virNetMessage *msg; bool expectReply; bool nonBlock; bool haveThread; virCond cond; - virNetClientCallPtr next; + virNetClientCall *next; }; struct _virNetClient { virObjectLockable parent; - virNetSocketPtr sock; + virNetSocket *sock; bool asyncIO; - virNetTLSSessionPtr tls; + virNetTLSSession *tls; char *hostname; - virNetClientProgramPtr *programs; + virNetClientProgram **programs; size_t nprograms; /* For incoming message packets */ virNetMessage msg; #if WITH_SASL - virNetSASLSessionPtr sasl; + virNetSASLSession *sasl; #endif GMainLoop *eventLoop; @@ -96,14 +95,14 @@ struct _virNetClient { * them, except possibly the first call in the list * which might be a partially sent non-blocking call. */ - virNetClientCallPtr waitDispatch; + virNetClientCall *waitDispatch; /* True if a thread holds the buck */ bool haveTheBuck; size_t nstreams; - virNetClientStreamPtr *streams; + virNetClientStream **streams; - virKeepAlivePtr keepalive; + virKeepAlive *keepalive; bool wantClose; int closeReason; virErrorPtr error; @@ -114,7 +113,7 @@ struct _virNetClient { }; -static virClassPtr virNetClientClass; +static virClass *virNetClientClass; static void virNetClientDispose(void *obj); static int virNetClientOnceInit(void) @@ -127,15 +126,15 @@ static int virNetClientOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNetClient); -static void virNetClientIOEventLoopPassTheBuck(virNetClientPtr client, - virNetClientCallPtr thiscall); -static int virNetClientQueueNonBlocking(virNetClientPtr client, - virNetMessagePtr msg); -static void virNetClientCloseInternal(virNetClientPtr client, +static void virNetClientIOEventLoopPassTheBuck(virNetClient *client, + virNetClientCall *thiscall); +static int virNetClientQueueNonBlocking(virNetClient *client, + virNetMessage *msg); +static void virNetClientCloseInternal(virNetClient *client, int reason); -void virNetClientSetCloseCallback(virNetClientPtr client, +void virNetClientSetCloseCallback(virNetClient *client, virNetClientCloseFunc cb, void *opaque, virFreeCallback ff) @@ -148,15 +147,15 @@ void virNetClientSetCloseCallback(virNetClientPtr client, } -static void virNetClientIncomingEvent(virNetSocketPtr sock, +static void virNetClientIncomingEvent(virNetSocket *sock, int events, void *opaque); /* Append a call to the end of the list */ -static void virNetClientCallQueue(virNetClientCallPtr *head, - virNetClientCallPtr call) +static void virNetClientCallQueue(virNetClientCall **head, + virNetClientCall *call) { - virNetClientCallPtr tmp = *head; + virNetClientCall *tmp = *head; while (tmp && tmp->next) tmp = tmp->next; if (tmp) @@ -168,9 +167,9 @@ static void virNetClientCallQueue(virNetClientCallPtr *head, #if 0 /* Obtain a call from the head of the list */ -static virNetClientCallPtr virNetClientCallServe(virNetClientCallPtr *head) +static virNetClientCall *virNetClientCallServe(virNetClientCall **head) { - virNetClientCallPtr tmp = *head; + virNetClientCall *tmp = *head; if (tmp) *head = tmp->next; else @@ -181,11 +180,11 @@ static virNetClientCallPtr virNetClientCallServe(virNetClientCallPtr *head) #endif /* Remove a call from anywhere in the list */ -static void virNetClientCallRemove(virNetClientCallPtr *head, - virNetClientCallPtr call) +static void virNetClientCallRemove(virNetClientCall **head, + virNetClientCall *call) { - virNetClientCallPtr tmp = *head; - virNetClientCallPtr prev = NULL; + virNetClientCall *tmp = *head; + virNetClientCall *prev = NULL; while (tmp) { if (tmp == call) { if (prev) @@ -200,17 +199,17 @@ static void virNetClientCallRemove(virNetClientCallPtr *head, } /* Predicate returns true if matches */ -typedef bool (*virNetClientCallPredicate)(virNetClientCallPtr call, void *opaque); +typedef bool (*virNetClientCallPredicate)(virNetClientCall *call, void *opaque); /* Remove a list of calls from the list based on a predicate */ -static void virNetClientCallRemovePredicate(virNetClientCallPtr *head, +static void virNetClientCallRemovePredicate(virNetClientCall **head, virNetClientCallPredicate pred, void *opaque) { - virNetClientCallPtr tmp = *head; - virNetClientCallPtr prev = NULL; + virNetClientCall *tmp = *head; + virNetClientCall *prev = NULL; while (tmp) { - virNetClientCallPtr next = tmp->next; + virNetClientCall *next = tmp->next; tmp->next = NULL; /* Temp unlink */ if (pred(tmp, opaque)) { if (prev) @@ -226,11 +225,11 @@ static void virNetClientCallRemovePredicate(virNetClientCallPtr *head, } /* Returns true if the predicate matches at least one call in the list */ -static bool virNetClientCallMatchPredicate(virNetClientCallPtr head, +static bool virNetClientCallMatchPredicate(virNetClientCall *head, virNetClientCallPredicate pred, void *opaque) { - virNetClientCallPtr tmp = head; + virNetClientCall *tmp = head; while (tmp) { if (pred(tmp, opaque)) return true; @@ -241,7 +240,7 @@ static bool virNetClientCallMatchPredicate(virNetClientCallPtr head, bool -virNetClientKeepAliveIsSupported(virNetClientPtr client) +virNetClientKeepAliveIsSupported(virNetClient *client) { bool supported; @@ -253,7 +252,7 @@ virNetClientKeepAliveIsSupported(virNetClientPtr client) } int -virNetClientKeepAliveStart(virNetClientPtr client, +virNetClientKeepAliveStart(virNetClient *client, int interval, unsigned int count) { @@ -267,7 +266,7 @@ virNetClientKeepAliveStart(virNetClientPtr client, } void -virNetClientKeepAliveStop(virNetClientPtr client) +virNetClientKeepAliveStop(virNetClient *client) { virObjectLock(client); virKeepAliveStop(client->keepalive); @@ -282,7 +281,7 @@ virNetClientKeepAliveDeadCB(void *opaque) static int virNetClientKeepAliveSendCB(void *opaque, - virNetMessagePtr msg) + virNetMessage *msg) { int ret; @@ -292,10 +291,10 @@ virNetClientKeepAliveSendCB(void *opaque, return ret; } -static virNetClientPtr virNetClientNew(virNetSocketPtr sock, +static virNetClient *virNetClientNew(virNetSocket *sock, const char *hostname) { - virNetClientPtr client = NULL; + virNetClient *client = NULL; if (virNetClientInitialize() < 0) goto error; @@ -366,11 +365,11 @@ virNetClientFindDefaultSshKey(const char *homedir, char **retPath) } -virNetClientPtr virNetClientNewUNIX(const char *path, +virNetClient *virNetClientNewUNIX(const char *path, bool spawnDaemon, const char *binary) { - virNetSocketPtr sock; + virNetSocket *sock; if (virNetSocketNewConnectUNIX(path, spawnDaemon, binary, &sock) < 0) return NULL; @@ -379,11 +378,11 @@ virNetClientPtr virNetClientNewUNIX(const char *path, } -virNetClientPtr virNetClientNewTCP(const char *nodename, +virNetClient *virNetClientNewTCP(const char *nodename, const char *service, int family) { - virNetSocketPtr sock; + virNetSocket *sock; if (virNetSocketNewConnectTCP(nodename, service, family, @@ -481,7 +480,7 @@ virNetClientSSHHelperCommand(virNetClientProxy proxy, if (!VAR) \ VAR = VAL; -virNetClientPtr virNetClientNewSSH(const char *nodename, +virNetClient *virNetClientNewSSH(const char *nodename, const char *service, const char *binary, const char *username, @@ -494,7 +493,7 @@ virNetClientPtr virNetClientNewSSH(const char *nodename, const char *driverURI, bool readonly) { - virNetSocketPtr sock; + virNetSocket *sock; g_autofree char *command = NULL; if (!(command = virNetClientSSHHelperCommand(proxy, netcatPath, socketPath, @@ -508,7 +507,7 @@ virNetClientPtr virNetClientNewSSH(const char *nodename, return virNetClientNew(sock, NULL); } -virNetClientPtr virNetClientNewLibSSH2(const char *host, +virNetClient *virNetClientNewLibSSH2(const char *host, const char *port, int family, const char *username, @@ -522,9 +521,9 @@ virNetClientPtr virNetClientNewLibSSH2(const char *host, const char *driverURI, bool readonly, virConnectAuthPtr authPtr, - virURIPtr uri) + virURI *uri) { - virNetSocketPtr sock = NULL; + virNetSocket *sock = NULL; g_autofree char *command = NULL; g_autofree char *homedir = NULL; g_autofree char *confdir = NULL; @@ -573,7 +572,7 @@ virNetClientPtr virNetClientNewLibSSH2(const char *host, return virNetClientNew(sock, NULL); } -virNetClientPtr virNetClientNewLibssh(const char *host, +virNetClient *virNetClientNewLibssh(const char *host, const char *port, int family, const char *username, @@ -587,9 +586,9 @@ virNetClientPtr virNetClientNewLibssh(const char *host, const char *driverURI, bool readonly, virConnectAuthPtr authPtr, - virURIPtr uri) + virURI *uri) { - virNetSocketPtr sock = NULL; + virNetSocket *sock = NULL; g_autofree char *command = NULL; g_autofree char *homedir = NULL; g_autofree char *confdir = NULL; @@ -639,9 +638,9 @@ virNetClientPtr virNetClientNewLibssh(const char *host, } #undef DEFAULT_VALUE -virNetClientPtr virNetClientNewExternal(const char **cmdargv) +virNetClient *virNetClientNewExternal(const char **cmdargv) { - virNetSocketPtr sock; + virNetSocket *sock; if (virNetSocketNewConnectExternal(cmdargv, &sock) < 0) return NULL; @@ -650,7 +649,7 @@ virNetClientPtr virNetClientNewExternal(const char **cmdargv) } -int virNetClientRegisterAsyncIO(virNetClientPtr client) +int virNetClientRegisterAsyncIO(virNetClient *client) { if (client->asyncIO) return 0; @@ -673,9 +672,9 @@ int virNetClientRegisterAsyncIO(virNetClientPtr client) } -int virNetClientRegisterKeepAlive(virNetClientPtr client) +int virNetClientRegisterKeepAlive(virNetClient *client) { - virKeepAlivePtr ka; + virKeepAlive *ka; if (client->keepalive) return 0; @@ -702,7 +701,7 @@ int virNetClientRegisterKeepAlive(virNetClientPtr client) } -int virNetClientGetFD(virNetClientPtr client) +int virNetClientGetFD(virNetClient *client) { int fd; virObjectLock(client); @@ -712,7 +711,7 @@ int virNetClientGetFD(virNetClientPtr client) } -int virNetClientDupFD(virNetClientPtr client, bool cloexec) +int virNetClientDupFD(virNetClient *client, bool cloexec) { int fd; virObjectLock(client); @@ -722,7 +721,7 @@ int virNetClientDupFD(virNetClientPtr client, bool cloexec) } -bool virNetClientHasPassFD(virNetClientPtr client) +bool virNetClientHasPassFD(virNetClient *client) { bool hasPassFD; virObjectLock(client); @@ -734,7 +733,7 @@ bool virNetClientHasPassFD(virNetClientPtr client) void virNetClientDispose(void *obj) { - virNetClientPtr client = obj; + virNetClient *client = obj; size_t i; PROBE(RPC_CLIENT_DISPOSE, @@ -765,7 +764,7 @@ void virNetClientDispose(void *obj) static void -virNetClientMarkClose(virNetClientPtr client, +virNetClientMarkClose(virNetClient *client, int reason) { VIR_DEBUG("client=%p, reason=%d", client, reason); @@ -784,9 +783,9 @@ virNetClientMarkClose(virNetClientPtr client, static void -virNetClientCloseLocked(virNetClientPtr client) +virNetClientCloseLocked(virNetClient *client) { - virKeepAlivePtr ka; + virKeepAlive *ka; VIR_DEBUG("client=%p, sock=%p, reason=%d", client, client->sock, client->closeReason); @@ -827,7 +826,7 @@ virNetClientCloseLocked(virNetClientPtr client) } -static void virNetClientCloseInternal(virNetClientPtr client, +static void virNetClientCloseInternal(virNetClient *client, int reason) { VIR_DEBUG("client=%p wantclose=%d", client, client ? client->wantClose : false); @@ -858,15 +857,15 @@ static void virNetClientCloseInternal(virNetClientPtr client, } -void virNetClientClose(virNetClientPtr client) +void virNetClientClose(virNetClient *client) { virNetClientCloseInternal(client, VIR_CONNECT_CLOSE_REASON_CLIENT); } #if WITH_SASL -void virNetClientSetSASLSession(virNetClientPtr client, - virNetSASLSessionPtr sasl) +void virNetClientSetSASLSession(virNetClient *client, + virNetSASLSession *sasl) { virObjectLock(client); client->sasl = virObjectRef(sasl); @@ -882,7 +881,7 @@ virNetClientIOEventTLS(int fd, gpointer opaque); static gboolean -virNetClientTLSHandshake(virNetClientPtr client) +virNetClientTLSHandshake(virNetClient *client) { g_autoptr(GSource) source = NULL; GIOCondition ev; @@ -913,7 +912,7 @@ virNetClientIOEventTLS(int fd G_GNUC_UNUSED, GIOCondition ev G_GNUC_UNUSED, gpointer opaque) { - virNetClientPtr client = opaque; + virNetClient *client = opaque; if (!virNetClientTLSHandshake(client)) g_main_loop_quit(client->eventLoop); @@ -927,7 +926,7 @@ virNetClientIOEventTLSConfirm(int fd G_GNUC_UNUSED, GIOCondition ev G_GNUC_UNUSED, gpointer opaque) { - virNetClientPtr client = opaque; + virNetClient *client = opaque; g_main_loop_quit(client->eventLoop); @@ -935,8 +934,8 @@ virNetClientIOEventTLSConfirm(int fd G_GNUC_UNUSED, } -int virNetClientSetTLSSession(virNetClientPtr client, - virNetTLSContextPtr tls) +int virNetClientSetTLSSession(virNetClient *client, + virNetTLSContext *tls) { int ret; char buf[1]; @@ -1033,7 +1032,7 @@ int virNetClientSetTLSSession(virNetClientPtr client, return -1; } -bool virNetClientIsEncrypted(virNetClientPtr client) +bool virNetClientIsEncrypted(virNetClient *client) { bool ret = false; virObjectLock(client); @@ -1048,7 +1047,7 @@ bool virNetClientIsEncrypted(virNetClientPtr client) } -bool virNetClientIsOpen(virNetClientPtr client) +bool virNetClientIsOpen(virNetClient *client) { bool ret; @@ -1062,8 +1061,8 @@ bool virNetClientIsOpen(virNetClientPtr client) } -int virNetClientAddProgram(virNetClientPtr client, - virNetClientProgramPtr prog) +int virNetClientAddProgram(virNetClient *client, + virNetClientProgram *prog) { virObjectLock(client); @@ -1075,8 +1074,8 @@ int virNetClientAddProgram(virNetClientPtr client, } -int virNetClientAddStream(virNetClientPtr client, - virNetClientStreamPtr st) +int virNetClientAddStream(virNetClient *client, + virNetClientStream *st) { virObjectLock(client); @@ -1088,8 +1087,8 @@ int virNetClientAddStream(virNetClientPtr client, } -void virNetClientRemoveStream(virNetClientPtr client, - virNetClientStreamPtr st) +void virNetClientRemoveStream(virNetClient *client, + virNetClientStream *st) { size_t i; @@ -1110,17 +1109,17 @@ void virNetClientRemoveStream(virNetClientPtr client, } -const char *virNetClientLocalAddrStringSASL(virNetClientPtr client) +const char *virNetClientLocalAddrStringSASL(virNetClient *client) { return virNetSocketLocalAddrStringSASL(client->sock); } -const char *virNetClientRemoteAddrStringSASL(virNetClientPtr client) +const char *virNetClientRemoteAddrStringSASL(virNetClient *client) { return virNetSocketRemoteAddrStringSASL(client->sock); } -int virNetClientGetTLSKeySize(virNetClientPtr client) +int virNetClientGetTLSKeySize(virNetClient *client) { int ret = 0; virObjectLock(client); @@ -1131,9 +1130,9 @@ int virNetClientGetTLSKeySize(virNetClientPtr client) } static int -virNetClientCallDispatchReply(virNetClientPtr client) +virNetClientCallDispatchReply(virNetClient *client) { - virNetClientCallPtr thecall; + virNetClientCall *thecall; /* Ok, definitely got an RPC reply now find out which waiting call is associated with it */ @@ -1167,10 +1166,10 @@ virNetClientCallDispatchReply(virNetClientPtr client) return 0; } -static int virNetClientCallDispatchMessage(virNetClientPtr client) +static int virNetClientCallDispatchMessage(virNetClient *client) { size_t i; - virNetClientProgramPtr prog = NULL; + virNetClientProgram *prog = NULL; for (i = 0; i < client->nprograms; i++) { if (virNetClientProgramMatches(client->programs[i], @@ -1190,9 +1189,9 @@ static int virNetClientCallDispatchMessage(virNetClientPtr client) return 0; } -static void virNetClientCallCompleteAllWaitingReply(virNetClientPtr client) +static void virNetClientCallCompleteAllWaitingReply(virNetClient *client) { - virNetClientCallPtr call; + virNetClientCall *call; for (call = client->waitDispatch; call; call = call->next) { if (call->msg->header.prog == client->msg.header.prog && @@ -1203,11 +1202,11 @@ static void virNetClientCallCompleteAllWaitingReply(virNetClientPtr client) } } -static int virNetClientCallDispatchStream(virNetClientPtr client) +static int virNetClientCallDispatchStream(virNetClient *client) { size_t i; - virNetClientStreamPtr st = NULL; - virNetClientCallPtr thecall; + virNetClientStream *st = NULL; + virNetClientCall *thecall; /* First identify what stream this packet is directed at */ for (i = 0; i < client->nstreams; i++) { @@ -1300,9 +1299,9 @@ static int virNetClientCallDispatchStream(virNetClientPtr client) static int -virNetClientCallDispatch(virNetClientPtr client) +virNetClientCallDispatch(virNetClient *client) { - virNetMessagePtr response = NULL; + virNetMessage *response = NULL; PROBE(RPC_CLIENT_MSG_RX, "client=%p len=%zu prog=%u vers=%u proc=%u type=%u status=%u serial=%u", @@ -1344,8 +1343,8 @@ virNetClientCallDispatch(virNetClientPtr client) static ssize_t -virNetClientIOWriteMessage(virNetClientPtr client, - virNetClientCallPtr thecall) +virNetClientIOWriteMessage(virNetClient *client, + virNetClientCall *thecall) { ssize_t ret = 0; @@ -1381,9 +1380,9 @@ virNetClientIOWriteMessage(virNetClientPtr client, static ssize_t -virNetClientIOHandleOutput(virNetClientPtr client) +virNetClientIOHandleOutput(virNetClient *client) { - virNetClientCallPtr thecall = client->waitDispatch; + virNetClientCall *thecall = client->waitDispatch; while (thecall && thecall->mode != VIR_NET_CLIENT_MODE_WAIT_TX) @@ -1410,7 +1409,7 @@ virNetClientIOHandleOutput(virNetClientPtr client) } static ssize_t -virNetClientIOReadMessage(virNetClientPtr client) +virNetClientIOReadMessage(virNetClient *client) { size_t wantData; ssize_t ret; @@ -1436,7 +1435,7 @@ virNetClientIOReadMessage(virNetClientPtr client) static ssize_t -virNetClientIOHandleInput(virNetClientPtr client) +virNetClientIOHandleInput(virNetClient *client) { /* Read as much data as is available, until we get * EAGAIN @@ -1523,7 +1522,7 @@ virNetClientIOHandleInput(virNetClientPtr client) } -static bool virNetClientIOEventLoopPollEvents(virNetClientCallPtr call, +static bool virNetClientIOEventLoopPollEvents(virNetClientCall *call, void *opaque) { GIOCondition *ev = opaque; @@ -1537,10 +1536,10 @@ static bool virNetClientIOEventLoopPollEvents(virNetClientCallPtr call, } -static bool virNetClientIOEventLoopRemoveDone(virNetClientCallPtr call, +static bool virNetClientIOEventLoopRemoveDone(virNetClientCall *call, void *opaque) { - virNetClientCallPtr thiscall = opaque; + virNetClientCall *thiscall = opaque; if (call == thiscall) return false; @@ -1575,7 +1574,7 @@ static bool virNetClientIOEventLoopRemoveDone(virNetClientCallPtr call, static void -virNetClientIODetachNonBlocking(virNetClientCallPtr call) +virNetClientIODetachNonBlocking(virNetClientCall *call) { VIR_DEBUG("Keeping unfinished non-blocking call %p in the queue", call); call->haveThread = false; @@ -1583,10 +1582,10 @@ virNetClientIODetachNonBlocking(virNetClientCallPtr call) static bool -virNetClientIOEventLoopRemoveAll(virNetClientCallPtr call, +virNetClientIOEventLoopRemoveAll(virNetClientCall *call, void *opaque) { - virNetClientCallPtr thiscall = opaque; + virNetClientCall *thiscall = opaque; if (call == thiscall) return false; @@ -1600,10 +1599,10 @@ virNetClientIOEventLoopRemoveAll(virNetClientCallPtr call, static void -virNetClientIOEventLoopPassTheBuck(virNetClientPtr client, - virNetClientCallPtr thiscall) +virNetClientIOEventLoopPassTheBuck(virNetClient *client, + virNetClientCall *thiscall) { - virNetClientCallPtr tmp = client->waitDispatch; + virNetClientCall *tmp = client->waitDispatch; VIR_DEBUG("Giving up the buck %p", thiscall); @@ -1630,7 +1629,7 @@ virNetClientIOEventLoopPassTheBuck(virNetClientPtr client, struct virNetClientIOEventData { - virNetClientPtr client; + virNetClient *client; GIOCondition rev; }; @@ -1654,8 +1653,8 @@ virNetClientIOEventFD(int fd G_GNUC_UNUSED, * Returns 1 if the call was queued and will be completed later (only * for nonBlock == true), 0 if the call was completed and -1 on error. */ -static int virNetClientIOEventLoop(virNetClientPtr client, - virNetClientCallPtr thiscall) +static int virNetClientIOEventLoop(virNetClient *client, + virNetClientCall *thiscall) { bool error = false; int closeReason; @@ -1665,7 +1664,7 @@ static int virNetClientIOEventLoop(virNetClientPtr client, sigset_t oldmask, blockedsigs; #endif /* !WIN32 */ int timeout = -1; - virNetMessagePtr msg = NULL; + virNetMessage *msg = NULL; g_autoptr(GSource) source = NULL; GIOCondition ev = 0; struct virNetClientIOEventData data = { @@ -1826,7 +1825,7 @@ static int virNetClientIOEventLoop(virNetClientPtr client, static bool -virNetClientIOUpdateEvents(virNetClientCallPtr call, +virNetClientIOUpdateEvents(virNetClientCall *call, void *opaque) { int *events = opaque; @@ -1838,7 +1837,7 @@ virNetClientIOUpdateEvents(virNetClientCallPtr call, } -static void virNetClientIOUpdateCallback(virNetClientPtr client, +static void virNetClientIOUpdateCallback(virNetClient *client, bool enableCallback) { int events = 0; @@ -1914,8 +1913,8 @@ static void virNetClientIOUpdateCallback(virNetClientPtr client, * Returns 1 if the call was queued and will be completed later (only * for nonBlock == true), 0 if the call was completed and -1 on error. */ -static int virNetClientIO(virNetClientPtr client, - virNetClientCallPtr thiscall) +static int virNetClientIO(virNetClient *client, + virNetClientCall *thiscall) { int rv = -1; @@ -2008,11 +2007,11 @@ static int virNetClientIO(virNetClientPtr client, } -void virNetClientIncomingEvent(virNetSocketPtr sock, +void virNetClientIncomingEvent(virNetSocket *sock, int events, void *opaque) { - virNetClientPtr client = opaque; + virNetClient *client = opaque; int closeReason; virObjectLock(client); @@ -2066,12 +2065,12 @@ void virNetClientIncomingEvent(virNetSocketPtr sock, } -static virNetClientCallPtr -virNetClientCallNew(virNetMessagePtr msg, +static virNetClientCall * +virNetClientCallNew(virNetMessage *msg, bool expectReply, bool nonBlock) { - virNetClientCallPtr call = NULL; + virNetClientCall *call = NULL; if (expectReply && (msg->bufferLength != 0) && @@ -2118,10 +2117,10 @@ virNetClientCallNew(virNetMessagePtr msg, static int -virNetClientQueueNonBlocking(virNetClientPtr client, - virNetMessagePtr msg) +virNetClientQueueNonBlocking(virNetClient *client, + virNetMessage *msg) { - virNetClientCallPtr call; + virNetClientCall *call; PROBE(RPC_CLIENT_MSG_TX_QUEUE, "client=%p len=%zu prog=%u vers=%u proc=%u" @@ -2142,12 +2141,12 @@ virNetClientQueueNonBlocking(virNetClientPtr client, * Returns 1 if the call was queued and will be completed later (only * for nonBlock == true), 0 if the call was completed and -1 on error. */ -static int virNetClientSendInternal(virNetClientPtr client, - virNetMessagePtr msg, +static int virNetClientSendInternal(virNetClient *client, + virNetMessage *msg, bool expectReply, bool nonBlock) { - virNetClientCallPtr call; + virNetClientCall *call; int ret = -1; PROBE(RPC_CLIENT_MSG_TX_QUEUE, @@ -2189,8 +2188,8 @@ static int virNetClientSendInternal(virNetClientPtr client, * * Returns 0 on success, -1 on failure */ -int virNetClientSendWithReply(virNetClientPtr client, - virNetMessagePtr msg) +int virNetClientSendWithReply(virNetClient *client, + virNetMessage *msg) { int ret; virObjectLock(client); @@ -2213,8 +2212,8 @@ int virNetClientSendWithReply(virNetClientPtr client, * Returns 1 if the message was queued and will be completed later (only * for nonBlock == true), 0 if the message was completed and -1 on error. */ -int virNetClientSendNonBlock(virNetClientPtr client, - virNetMessagePtr msg) +int virNetClientSendNonBlock(virNetClient *client, + virNetMessage *msg) { int ret; virObjectLock(client); @@ -2234,9 +2233,9 @@ int virNetClientSendNonBlock(virNetClientPtr client, * * Returns 0 on success, -1 on failure */ -int virNetClientSendStream(virNetClientPtr client, - virNetMessagePtr msg, - virNetClientStreamPtr st) +int virNetClientSendStream(virNetClient *client, + virNetMessage *msg, + virNetClientStream *st) { int ret = -1; bool expectReply = !msg->bufferLength || diff --git a/src/rpc/virnetclient.h b/src/rpc/virnetclient.h index 4789316e32..c6ad59cf0d 100644 --- a/src/rpc/virnetclient.h +++ b/src/rpc/virnetclient.h @@ -47,15 +47,15 @@ virNetClientSSHHelperCommand(virNetClientProxy proxy, const char *driverURI, bool readonly); -virNetClientPtr virNetClientNewUNIX(const char *path, +virNetClient *virNetClientNewUNIX(const char *path, bool spawnDaemon, const char *binary); -virNetClientPtr virNetClientNewTCP(const char *nodename, +virNetClient *virNetClientNewTCP(const char *nodename, const char *service, int family); -virNetClientPtr virNetClientNewSSH(const char *nodename, +virNetClient *virNetClientNewSSH(const char *nodename, const char *service, const char *binary, const char *username, @@ -68,7 +68,7 @@ virNetClientPtr virNetClientNewSSH(const char *nodename, const char *driverURI, bool readonly); -virNetClientPtr virNetClientNewLibSSH2(const char *host, +virNetClient *virNetClientNewLibSSH2(const char *host, const char *port, int family, const char *username, @@ -82,9 +82,9 @@ virNetClientPtr virNetClientNewLibSSH2(const char *host, const char *driverURI, bool readonly, virConnectAuthPtr authPtr, - virURIPtr uri); + virURI *uri); -virNetClientPtr virNetClientNewLibssh(const char *host, +virNetClient *virNetClientNewLibssh(const char *host, const char *port, int family, const char *username, @@ -98,67 +98,67 @@ virNetClientPtr virNetClientNewLibssh(const char *host, const char *driverURI, bool readonly, virConnectAuthPtr authPtr, - virURIPtr uri); + virURI *uri); -virNetClientPtr virNetClientNewExternal(const char **cmdargv); +virNetClient *virNetClientNewExternal(const char **cmdargv); -int virNetClientRegisterAsyncIO(virNetClientPtr client); -int virNetClientRegisterKeepAlive(virNetClientPtr client); +int virNetClientRegisterAsyncIO(virNetClient *client); +int virNetClientRegisterKeepAlive(virNetClient *client); -typedef void (*virNetClientCloseFunc)(virNetClientPtr client, +typedef void (*virNetClientCloseFunc)(virNetClient *client, int reason, void *opaque); -void virNetClientSetCloseCallback(virNetClientPtr client, +void virNetClientSetCloseCallback(virNetClient *client, virNetClientCloseFunc cb, void *opaque, virFreeCallback ff); -int virNetClientGetFD(virNetClientPtr client); -int virNetClientDupFD(virNetClientPtr client, bool cloexec); +int virNetClientGetFD(virNetClient *client); +int virNetClientDupFD(virNetClient *client, bool cloexec); -bool virNetClientHasPassFD(virNetClientPtr client); +bool virNetClientHasPassFD(virNetClient *client); -int virNetClientAddProgram(virNetClientPtr client, - virNetClientProgramPtr prog); +int virNetClientAddProgram(virNetClient *client, + virNetClientProgram *prog); -int virNetClientAddStream(virNetClientPtr client, - virNetClientStreamPtr st); +int virNetClientAddStream(virNetClient *client, + virNetClientStream *st); -void virNetClientRemoveStream(virNetClientPtr client, - virNetClientStreamPtr st); +void virNetClientRemoveStream(virNetClient *client, + virNetClientStream *st); -int virNetClientSendWithReply(virNetClientPtr client, - virNetMessagePtr msg); +int virNetClientSendWithReply(virNetClient *client, + virNetMessage *msg); -int virNetClientSendNonBlock(virNetClientPtr client, - virNetMessagePtr msg); +int virNetClientSendNonBlock(virNetClient *client, + virNetMessage *msg); -int virNetClientSendStream(virNetClientPtr client, - virNetMessagePtr msg, - virNetClientStreamPtr st); +int virNetClientSendStream(virNetClient *client, + virNetMessage *msg, + virNetClientStream *st); #ifdef WITH_SASL -void virNetClientSetSASLSession(virNetClientPtr client, - virNetSASLSessionPtr sasl); +void virNetClientSetSASLSession(virNetClient *client, + virNetSASLSession *sasl); #endif -int virNetClientSetTLSSession(virNetClientPtr client, - virNetTLSContextPtr tls); +int virNetClientSetTLSSession(virNetClient *client, + virNetTLSContext *tls); -bool virNetClientIsEncrypted(virNetClientPtr client); -bool virNetClientIsOpen(virNetClientPtr client); +bool virNetClientIsEncrypted(virNetClient *client); +bool virNetClientIsOpen(virNetClient *client); -const char *virNetClientLocalAddrStringSASL(virNetClientPtr client); -const char *virNetClientRemoteAddrStringSASL(virNetClientPtr client); +const char *virNetClientLocalAddrStringSASL(virNetClient *client); +const char *virNetClientRemoteAddrStringSASL(virNetClient *client); -int virNetClientGetTLSKeySize(virNetClientPtr client); +int virNetClientGetTLSKeySize(virNetClient *client); -void virNetClientClose(virNetClientPtr client); +void virNetClientClose(virNetClient *client); -bool virNetClientKeepAliveIsSupported(virNetClientPtr client); -int virNetClientKeepAliveStart(virNetClientPtr client, +bool virNetClientKeepAliveIsSupported(virNetClient *client); +int virNetClientKeepAliveStart(virNetClient *client, int interval, unsigned int count); -void virNetClientKeepAliveStop(virNetClientPtr client); +void virNetClientKeepAliveStop(virNetClient *client); diff --git a/src/rpc/virnetclientprogram.c b/src/rpc/virnetclientprogram.c index 0269f3e6dd..5da118bfd3 100644 --- a/src/rpc/virnetclientprogram.c +++ b/src/rpc/virnetclientprogram.c @@ -42,12 +42,12 @@ struct _virNetClientProgram { unsigned program; unsigned version; - virNetClientProgramEventPtr events; + virNetClientProgramEvent *events; size_t nevents; void *eventOpaque; }; -static virClassPtr virNetClientProgramClass; +static virClass *virNetClientProgramClass; static void virNetClientProgramDispose(void *obj); static int virNetClientProgramOnceInit(void) @@ -61,13 +61,13 @@ static int virNetClientProgramOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNetClientProgram); -virNetClientProgramPtr virNetClientProgramNew(unsigned program, +virNetClientProgram *virNetClientProgramNew(unsigned program, unsigned version, - virNetClientProgramEventPtr events, + virNetClientProgramEvent *events, size_t nevents, void *eventOpaque) { - virNetClientProgramPtr prog; + virNetClientProgram *prog; if (virNetClientProgramInitialize() < 0) return NULL; @@ -90,20 +90,20 @@ void virNetClientProgramDispose(void *obj G_GNUC_UNUSED) } -unsigned virNetClientProgramGetProgram(virNetClientProgramPtr prog) +unsigned virNetClientProgramGetProgram(virNetClientProgram *prog) { return prog->program; } -unsigned virNetClientProgramGetVersion(virNetClientProgramPtr prog) +unsigned virNetClientProgramGetVersion(virNetClientProgram *prog) { return prog->version; } -int virNetClientProgramMatches(virNetClientProgramPtr prog, - virNetMessagePtr msg) +int virNetClientProgramMatches(virNetClientProgram *prog, + virNetMessage *msg) { if (prog->program == msg->header.prog && prog->version == msg->header.vers) @@ -113,8 +113,8 @@ int virNetClientProgramMatches(virNetClientProgramPtr prog, static int -virNetClientProgramDispatchError(virNetClientProgramPtr prog G_GNUC_UNUSED, - virNetMessagePtr msg) +virNetClientProgramDispatchError(virNetClientProgram *prog G_GNUC_UNUSED, + virNetMessage *msg) { virNetMessageError err; int ret = -1; @@ -189,7 +189,7 @@ virNetClientProgramDispatchError(virNetClientProgramPtr prog G_GNUC_UNUSED, } -static virNetClientProgramEventPtr virNetClientProgramGetEvent(virNetClientProgramPtr prog, +static virNetClientProgramEvent *virNetClientProgramGetEvent(virNetClientProgram *prog, int procedure) { size_t i; @@ -203,11 +203,11 @@ static virNetClientProgramEventPtr virNetClientProgramGetEvent(virNetClientProgr } -int virNetClientProgramDispatch(virNetClientProgramPtr prog, - virNetClientPtr client, - virNetMessagePtr msg) +int virNetClientProgramDispatch(virNetClientProgram *prog, + virNetClient *client, + virNetMessage *msg) { - virNetClientProgramEventPtr event; + virNetClientProgramEvent *event; char *evdata; VIR_DEBUG("prog=%d ver=%d type=%d status=%d serial=%d proc=%d", @@ -262,8 +262,8 @@ int virNetClientProgramDispatch(virNetClientProgramPtr prog, } -int virNetClientProgramCall(virNetClientProgramPtr prog, - virNetClientPtr client, +int virNetClientProgramCall(virNetClientProgram *prog, + virNetClient *client, unsigned serial, int proc, size_t noutfds, @@ -273,7 +273,7 @@ int virNetClientProgramCall(virNetClientProgramPtr prog, xdrproc_t args_filter, void *args, xdrproc_t ret_filter, void *ret) { - virNetMessagePtr msg; + virNetMessage *msg; size_t i; if (infds) diff --git a/src/rpc/virnetclientprogram.h b/src/rpc/virnetclientprogram.h index 1ac0f30023..8cd8d4f2c8 100644 --- a/src/rpc/virnetclientprogram.h +++ b/src/rpc/virnetclientprogram.h @@ -27,20 +27,16 @@ #include "virobject.h" typedef struct _virNetClient virNetClient; -typedef virNetClient *virNetClientPtr; typedef struct _virNetClientProgram virNetClientProgram; -typedef virNetClientProgram *virNetClientProgramPtr; typedef struct _virNetClientProgramEvent virNetClientProgramEvent; -typedef virNetClientProgramEvent *virNetClientProgramEventPtr; typedef struct _virNetClientProgramErrorHandler virNetClientProgramErrorHander; -typedef virNetClientProgramErrorHander *virNetClientProgramErrorHanderPtr; -typedef void (*virNetClientProgramDispatchFunc)(virNetClientProgramPtr prog, - virNetClientPtr client, +typedef void (*virNetClientProgramDispatchFunc)(virNetClientProgram *prog, + virNetClient *client, void *msg, void *opaque); @@ -51,24 +47,24 @@ struct _virNetClientProgramEvent { xdrproc_t msg_filter; }; -virNetClientProgramPtr virNetClientProgramNew(unsigned program, +virNetClientProgram *virNetClientProgramNew(unsigned program, unsigned version, - virNetClientProgramEventPtr events, + virNetClientProgramEvent *events, size_t nevents, void *eventOpaque); -unsigned virNetClientProgramGetProgram(virNetClientProgramPtr prog); -unsigned virNetClientProgramGetVersion(virNetClientProgramPtr prog); +unsigned virNetClientProgramGetProgram(virNetClientProgram *prog); +unsigned virNetClientProgramGetVersion(virNetClientProgram *prog); -int virNetClientProgramMatches(virNetClientProgramPtr prog, - virNetMessagePtr msg); +int virNetClientProgramMatches(virNetClientProgram *prog, + virNetMessage *msg); -int virNetClientProgramDispatch(virNetClientProgramPtr prog, - virNetClientPtr client, - virNetMessagePtr msg); +int virNetClientProgramDispatch(virNetClientProgram *prog, + virNetClient *client, + virNetMessage *msg); -int virNetClientProgramCall(virNetClientProgramPtr prog, - virNetClientPtr client, +int virNetClientProgramCall(virNetClientProgram *prog, + virNetClient *client, unsigned serial, int proc, size_t noutfds, diff --git a/src/rpc/virnetclientstream.c b/src/rpc/virnetclientstream.c index 3bc22230b3..1ba6167a1d 100644 --- a/src/rpc/virnetclientstream.c +++ b/src/rpc/virnetclientstream.c @@ -34,7 +34,7 @@ VIR_LOG_INIT("rpc.netclientstream"); struct _virNetClientStream { virObjectLockable parent; - virNetClientProgramPtr prog; + virNetClientProgram *prog; int proc; unsigned serial; @@ -47,7 +47,7 @@ struct _virNetClientStream { * time by stopping consuming any incoming data * off the socket.... */ - virNetMessagePtr rx; + virNetMessage *rx; bool incomingEOF; virNetClientStreamClosed closed; @@ -63,7 +63,7 @@ struct _virNetClientStream { }; -static virClassPtr virNetClientStreamClass; +static virClass *virNetClientStreamClass; static void virNetClientStreamDispose(void *obj); static int virNetClientStreamOnceInit(void) @@ -78,7 +78,7 @@ VIR_ONCE_GLOBAL_INIT(virNetClientStream); static void -virNetClientStreamEventTimerUpdate(virNetClientStreamPtr st) +virNetClientStreamEventTimerUpdate(virNetClientStream *st) { if (!st->cb) return; @@ -100,7 +100,7 @@ virNetClientStreamEventTimerUpdate(virNetClientStreamPtr st) static void virNetClientStreamEventTimer(int timer G_GNUC_UNUSED, void *opaque) { - virNetClientStreamPtr st = opaque; + virNetClientStream *st = opaque; int events = 0; virObjectLock(st); @@ -132,12 +132,12 @@ virNetClientStreamEventTimer(int timer G_GNUC_UNUSED, void *opaque) } -virNetClientStreamPtr virNetClientStreamNew(virNetClientProgramPtr prog, +virNetClientStream *virNetClientStreamNew(virNetClientProgram *prog, int proc, unsigned serial, bool allowSkip) { - virNetClientStreamPtr st; + virNetClientStream *st; if (virNetClientStreamInitialize() < 0) return NULL; @@ -155,19 +155,19 @@ virNetClientStreamPtr virNetClientStreamNew(virNetClientProgramPtr prog, void virNetClientStreamDispose(void *obj) { - virNetClientStreamPtr st = obj; + virNetClientStream *st = obj; virResetError(&st->err); while (st->rx) { - virNetMessagePtr msg = st->rx; + virNetMessage *msg = st->rx; virNetMessageQueueServe(&st->rx); virNetMessageFree(msg); } virObjectUnref(st->prog); } -bool virNetClientStreamMatches(virNetClientStreamPtr st, - virNetMessagePtr msg) +bool virNetClientStreamMatches(virNetClientStream *st, + virNetMessage *msg) { bool match = false; virObjectLock(st); @@ -181,7 +181,7 @@ bool virNetClientStreamMatches(virNetClientStreamPtr st, static -void virNetClientStreamRaiseError(virNetClientStreamPtr st) +void virNetClientStreamRaiseError(virNetClientStream *st) { virRaiseErrorFull(__FILE__, __FUNCTION__, __LINE__, st->err.domain, @@ -197,7 +197,7 @@ void virNetClientStreamRaiseError(virNetClientStreamPtr st) /* MUST be called under stream or client lock */ -int virNetClientStreamCheckState(virNetClientStreamPtr st) +int virNetClientStreamCheckState(virNetClientStream *st) { if (st->err.code != VIR_ERR_OK) { virNetClientStreamRaiseError(st); @@ -216,8 +216,8 @@ int virNetClientStreamCheckState(virNetClientStreamPtr st) /* MUST be called under stream or client lock. This should * be called only for message that expect reply. */ -int virNetClientStreamCheckSendStatus(virNetClientStreamPtr st, - virNetMessagePtr msg) +int virNetClientStreamCheckSendStatus(virNetClientStream *st, + virNetMessage *msg) { if (st->err.code != VIR_ERR_OK) { virNetClientStreamRaiseError(st); @@ -247,7 +247,7 @@ int virNetClientStreamCheckSendStatus(virNetClientStreamPtr st, } -void virNetClientStreamSetClosed(virNetClientStreamPtr st, +void virNetClientStreamSetClosed(virNetClientStream *st, virNetClientStreamClosed closed) { virObjectLock(st); @@ -259,8 +259,8 @@ void virNetClientStreamSetClosed(virNetClientStreamPtr st, } -int virNetClientStreamSetError(virNetClientStreamPtr st, - virNetMessagePtr msg) +int virNetClientStreamSetError(virNetClientStream *st, + virNetMessage *msg) { virNetMessageError err; int ret = -1; @@ -313,10 +313,10 @@ int virNetClientStreamSetError(virNetClientStreamPtr st, } -int virNetClientStreamQueuePacket(virNetClientStreamPtr st, - virNetMessagePtr msg) +int virNetClientStreamQueuePacket(virNetClientStream *st, + virNetMessage *msg) { - virNetMessagePtr tmp_msg; + virNetMessage *tmp_msg; VIR_DEBUG("Incoming stream message: stream=%p message=%p", st, msg); @@ -357,13 +357,13 @@ int virNetClientStreamQueuePacket(virNetClientStreamPtr st, } -int virNetClientStreamSendPacket(virNetClientStreamPtr st, - virNetClientPtr client, +int virNetClientStreamSendPacket(virNetClientStream *st, + virNetClient *client, int status, const char *data, size_t nbytes) { - virNetMessagePtr msg; + virNetMessage *msg; VIR_DEBUG("st=%p status=%d data=%p nbytes=%zu", st, status, data, nbytes); if (!(msg = virNetMessageNew(false))) @@ -408,7 +408,7 @@ int virNetClientStreamSendPacket(virNetClientStreamPtr st, static int -virNetClientStreamSetHole(virNetClientStreamPtr st, +virNetClientStreamSetHole(virNetClientStream *st, long long length, unsigned int flags) { @@ -441,10 +441,10 @@ virNetClientStreamSetHole(virNetClientStreamPtr st, * -1 otherwise. */ static int -virNetClientStreamHandleHole(virNetClientPtr client, - virNetClientStreamPtr st) +virNetClientStreamHandleHole(virNetClient *client, + virNetClientStream *st) { - virNetMessagePtr msg; + virNetMessage *msg; virNetStreamHole data; int ret = -1; @@ -502,8 +502,8 @@ virNetClientStreamHandleHole(virNetClientPtr client, } -int virNetClientStreamRecvPacket(virNetClientStreamPtr st, - virNetClientPtr client, +int virNetClientStreamRecvPacket(virNetClientStream *st, + virNetClient *client, char *data, size_t nbytes, bool nonblock, @@ -524,7 +524,7 @@ int virNetClientStreamRecvPacket(virNetClientStreamPtr st, goto cleanup; if (!st->rx && !st->incomingEOF) { - virNetMessagePtr msg; + virNetMessage *msg; int ret; if (nonblock) { @@ -600,7 +600,7 @@ int virNetClientStreamRecvPacket(virNetClientStreamPtr st, while (want && st->rx && st->rx->header.type == VIR_NET_STREAM) { - virNetMessagePtr msg = st->rx; + virNetMessage *msg = st->rx; size_t len = want; if (len > msg->bufferLength - msg->bufferOffset) @@ -629,12 +629,12 @@ int virNetClientStreamRecvPacket(virNetClientStreamPtr st, int -virNetClientStreamSendHole(virNetClientStreamPtr st, - virNetClientPtr client, +virNetClientStreamSendHole(virNetClientStream *st, + virNetClient *client, long long length, unsigned int flags) { - virNetMessagePtr msg = NULL; + virNetMessage *msg = NULL; virNetStreamHole data; int ret = -1; @@ -683,8 +683,8 @@ virNetClientStreamSendHole(virNetClientStreamPtr st, int -virNetClientStreamRecvHole(virNetClientPtr client G_GNUC_UNUSED, - virNetClientStreamPtr st, +virNetClientStreamRecvHole(virNetClient *client G_GNUC_UNUSED, + virNetClientStream *st, long long *length) { if (!st->allowSkip) { @@ -708,7 +708,7 @@ virNetClientStreamRecvHole(virNetClientPtr client G_GNUC_UNUSED, } -int virNetClientStreamEventAddCallback(virNetClientStreamPtr st, +int virNetClientStreamEventAddCallback(virNetClientStream *st, int events, virNetClientStreamEventCallback cb, void *opaque, @@ -747,7 +747,7 @@ int virNetClientStreamEventAddCallback(virNetClientStreamPtr st, return ret; } -int virNetClientStreamEventUpdateCallback(virNetClientStreamPtr st, +int virNetClientStreamEventUpdateCallback(virNetClientStream *st, int events) { int ret = -1; @@ -770,7 +770,7 @@ int virNetClientStreamEventUpdateCallback(virNetClientStreamPtr st, return ret; } -int virNetClientStreamEventRemoveCallback(virNetClientStreamPtr st) +int virNetClientStreamEventRemoveCallback(virNetClientStream *st) { int ret = -1; @@ -797,7 +797,7 @@ int virNetClientStreamEventRemoveCallback(virNetClientStreamPtr st) return ret; } -bool virNetClientStreamEOF(virNetClientStreamPtr st) +bool virNetClientStreamEOF(virNetClientStream *st) { return st->incomingEOF; } diff --git a/src/rpc/virnetclientstream.h b/src/rpc/virnetclientstream.h index 166adb0b22..e16d6e4a9a 100644 --- a/src/rpc/virnetclientstream.h +++ b/src/rpc/virnetclientstream.h @@ -24,7 +24,6 @@ #include "virobject.h" typedef struct _virNetClientStream virNetClientStream; -typedef virNetClientStream *virNetClientStreamPtr; typedef enum { VIR_NET_CLIENT_STREAM_CLOSED_NOT = 0, @@ -32,62 +31,62 @@ typedef enum { VIR_NET_CLIENT_STREAM_CLOSED_ABORTED, } virNetClientStreamClosed; -typedef void (*virNetClientStreamEventCallback)(virNetClientStreamPtr stream, +typedef void (*virNetClientStreamEventCallback)(virNetClientStream *stream, int events, void *opaque); -virNetClientStreamPtr virNetClientStreamNew(virNetClientProgramPtr prog, +virNetClientStream *virNetClientStreamNew(virNetClientProgram *prog, int proc, unsigned serial, bool allowSkip); -int virNetClientStreamCheckState(virNetClientStreamPtr st); +int virNetClientStreamCheckState(virNetClientStream *st); -int virNetClientStreamCheckSendStatus(virNetClientStreamPtr st, - virNetMessagePtr msg); +int virNetClientStreamCheckSendStatus(virNetClientStream *st, + virNetMessage *msg); -int virNetClientStreamSetError(virNetClientStreamPtr st, - virNetMessagePtr msg); +int virNetClientStreamSetError(virNetClientStream *st, + virNetMessage *msg); -void virNetClientStreamSetClosed(virNetClientStreamPtr st, +void virNetClientStreamSetClosed(virNetClientStream *st, virNetClientStreamClosed closed); -bool virNetClientStreamMatches(virNetClientStreamPtr st, - virNetMessagePtr msg); +bool virNetClientStreamMatches(virNetClientStream *st, + virNetMessage *msg); -int virNetClientStreamQueuePacket(virNetClientStreamPtr st, - virNetMessagePtr msg); +int virNetClientStreamQueuePacket(virNetClientStream *st, + virNetMessage *msg); -int virNetClientStreamSendPacket(virNetClientStreamPtr st, - virNetClientPtr client, +int virNetClientStreamSendPacket(virNetClientStream *st, + virNetClient *client, int status, const char *data, size_t nbytes); -int virNetClientStreamRecvPacket(virNetClientStreamPtr st, - virNetClientPtr client, +int virNetClientStreamRecvPacket(virNetClientStream *st, + virNetClient *client, char *data, size_t nbytes, bool nonblock, unsigned int flags); -int virNetClientStreamSendHole(virNetClientStreamPtr st, - virNetClientPtr client, +int virNetClientStreamSendHole(virNetClientStream *st, + virNetClient *client, long long length, unsigned int flags); -int virNetClientStreamRecvHole(virNetClientPtr client, - virNetClientStreamPtr st, +int virNetClientStreamRecvHole(virNetClient *client, + virNetClientStream *st, long long *length); -int virNetClientStreamEventAddCallback(virNetClientStreamPtr st, +int virNetClientStreamEventAddCallback(virNetClientStream *st, int events, virNetClientStreamEventCallback cb, void *opaque, virFreeCallback ff); -int virNetClientStreamEventUpdateCallback(virNetClientStreamPtr st, +int virNetClientStreamEventUpdateCallback(virNetClientStream *st, int events); -int virNetClientStreamEventRemoveCallback(virNetClientStreamPtr st); +int virNetClientStreamEventRemoveCallback(virNetClientStream *st); -bool virNetClientStreamEOF(virNetClientStreamPtr st) +bool virNetClientStreamEOF(virNetClientStream *st) ATTRIBUTE_NONNULL(1); diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c index 1f4a2db04f..1a17753f42 100644 --- a/src/rpc/virnetdaemon.c +++ b/src/rpc/virnetdaemon.c @@ -43,8 +43,6 @@ VIR_LOG_INIT("rpc.netdaemon"); #ifndef WIN32 typedef struct _virNetDaemonSignal virNetDaemonSignal; -typedef virNetDaemonSignal *virNetDaemonSignalPtr; - struct _virNetDaemonSignal { struct sigaction oldaction; int signum; @@ -60,18 +58,18 @@ struct _virNetDaemon { #ifndef WIN32 size_t nsignals; - virNetDaemonSignalPtr *signals; + virNetDaemonSignal **signals; int sigread; int sigwrite; int sigwatch; #endif /* !WIN32 */ GHashTable *servers; - virJSONValuePtr srvObject; + virJSONValue *srvObject; virNetDaemonShutdownCallback shutdownPrepareCb; virNetDaemonShutdownCallback shutdownWaitCb; - virThreadPtr stateStopThread; + virThread *stateStopThread; int finishTimer; bool quit; bool finished; @@ -84,7 +82,7 @@ struct _virNetDaemon { }; -static virClassPtr virNetDaemonClass; +static virClass *virNetDaemonClass; static int daemonServerClose(void *payload, @@ -94,7 +92,7 @@ daemonServerClose(void *payload, static void virNetDaemonDispose(void *obj) { - virNetDaemonPtr dmn = obj; + virNetDaemon *dmn = obj; #ifndef WIN32 size_t i; @@ -129,10 +127,10 @@ virNetDaemonOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNetDaemon); -virNetDaemonPtr +virNetDaemon * virNetDaemonNew(void) { - virNetDaemonPtr dmn; + virNetDaemon *dmn; #ifndef WIN32 struct sigaction sig_action; #endif /* !WIN32 */ @@ -171,8 +169,8 @@ virNetDaemonNew(void) int -virNetDaemonAddServer(virNetDaemonPtr dmn, - virNetServerPtr srv) +virNetDaemonAddServer(virNetDaemon *dmn, + virNetServer *srv) { int ret = -1; const char *serverName = virNetServerGetName(srv); @@ -191,11 +189,11 @@ virNetDaemonAddServer(virNetDaemonPtr dmn, } -virNetServerPtr -virNetDaemonGetServer(virNetDaemonPtr dmn, +virNetServer * +virNetDaemonGetServer(virNetDaemon *dmn, const char *serverName) { - virNetServerPtr srv = NULL; + virNetServer *srv = NULL; virObjectLock(dmn); srv = virObjectRef(virHashLookup(dmn->servers, serverName)); @@ -210,7 +208,7 @@ virNetDaemonGetServer(virNetDaemonPtr dmn, } bool -virNetDaemonHasServer(virNetDaemonPtr dmn, +virNetDaemonHasServer(virNetDaemon *dmn, const char *serverName) { void *ent; @@ -224,7 +222,7 @@ virNetDaemonHasServer(virNetDaemonPtr dmn, struct collectData { - virNetServerPtr **servers; + virNetServer ***servers; size_t nservers; }; @@ -234,7 +232,7 @@ collectServers(void *payload, const char *name G_GNUC_UNUSED, void *opaque) { - virNetServerPtr srv = virObjectRef(payload); + virNetServer *srv = virObjectRef(payload); struct collectData *data = opaque; if (!srv) @@ -250,8 +248,8 @@ collectServers(void *payload, * but not the items in it (similarly to virHashGetItems). */ ssize_t -virNetDaemonGetServers(virNetDaemonPtr dmn, - virNetServerPtr **servers) +virNetDaemonGetServers(virNetDaemon *dmn, + virNetServer ***servers) { struct collectData data = { servers, 0 }; ssize_t ret = -1; @@ -277,18 +275,18 @@ virNetDaemonGetServers(virNetDaemonPtr dmn, struct virNetDaemonServerData { - virNetDaemonPtr dmn; + virNetDaemon *dmn; virNetDaemonNewServerPostExecRestart cb; void *opaque; }; static int virNetDaemonServerIterator(const char *key, - virJSONValuePtr value, + virJSONValue *value, void *opaque) { struct virNetDaemonServerData *data = opaque; - virNetServerPtr srv; + virNetServer *srv; VIR_DEBUG("Creating server '%s'", key); srv = data->cb(data->dmn, key, value, data->opaque); @@ -302,15 +300,15 @@ virNetDaemonServerIterator(const char *key, } -virNetDaemonPtr -virNetDaemonNewPostExecRestart(virJSONValuePtr object, +virNetDaemon * +virNetDaemonNewPostExecRestart(virJSONValue *object, size_t nDefServerNames, const char **defServerNames, virNetDaemonNewServerPostExecRestart cb, void *opaque) { - virNetDaemonPtr dmn = NULL; - virJSONValuePtr servers = virJSONValueObjectGet(object, "servers"); + virNetDaemon *dmn = NULL; + virJSONValue *servers = virJSONValueObjectGet(object, "servers"); bool new_version = virJSONValueObjectHasKey(object, "servers"); if (!(dmn = virNetDaemonNew())) @@ -323,7 +321,7 @@ virNetDaemonNewPostExecRestart(virJSONValuePtr object, } if (!new_version) { - virNetServerPtr srv; + virNetServer *srv; if (nDefServerNames < 1) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -348,8 +346,8 @@ virNetDaemonNewPostExecRestart(virJSONValuePtr object, } for (i = 0; i < n; i++) { - virNetServerPtr srv; - virJSONValuePtr value = virJSONValueArrayGet(servers, i); + virNetServer *srv; + virJSONValue *value = virJSONValueArrayGet(servers, i); VIR_DEBUG("Creating server '%s'", defServerNames[i]); srv = cb(dmn, defServerNames[i], value, opaque); @@ -381,13 +379,13 @@ virNetDaemonNewPostExecRestart(virJSONValuePtr object, } -virJSONValuePtr -virNetDaemonPreExecRestart(virNetDaemonPtr dmn) +virJSONValue * +virNetDaemonPreExecRestart(virNetDaemon *dmn) { size_t i = 0; g_autoptr(virJSONValue) object = virJSONValueNewObject(); g_autoptr(virJSONValue) srvObj = virJSONValueNewObject(); - g_autofree virHashKeyValuePairPtr srvArray = NULL; + g_autofree virHashKeyValuePair *srvArray = NULL; virObjectLock(dmn); @@ -395,7 +393,7 @@ virNetDaemonPreExecRestart(virNetDaemonPtr dmn) goto error; for (i = 0; srvArray[i].key; i++) { - virNetServerPtr server = virHashLookup(dmn->servers, srvArray[i].key); + virNetServer *server = virHashLookup(dmn->servers, srvArray[i].key); g_autoptr(virJSONValue) srvJSON = NULL; if (!server) @@ -423,7 +421,7 @@ virNetDaemonPreExecRestart(virNetDaemonPtr dmn) bool -virNetDaemonIsPrivileged(virNetDaemonPtr dmn) +virNetDaemonIsPrivileged(virNetDaemon *dmn) { bool priv; virObjectLock(dmn); @@ -434,7 +432,7 @@ virNetDaemonIsPrivileged(virNetDaemonPtr dmn) void -virNetDaemonAutoShutdown(virNetDaemonPtr dmn, +virNetDaemonAutoShutdown(virNetDaemon *dmn, unsigned int timeout) { virObjectLock(dmn); @@ -448,7 +446,7 @@ virNetDaemonAutoShutdown(virNetDaemonPtr dmn, #ifdef G_OS_UNIX /* As per: https://www.freedesktop.org/wiki/Software/systemd/inhibit */ static void -virNetDaemonCallInhibit(virNetDaemonPtr dmn, +virNetDaemonCallInhibit(virNetDaemon *dmn, const char *what, const char *who, const char *why, @@ -506,7 +504,7 @@ virNetDaemonCallInhibit(virNetDaemonPtr dmn, #endif void -virNetDaemonAddShutdownInhibition(virNetDaemonPtr dmn) +virNetDaemonAddShutdownInhibition(virNetDaemon *dmn) { virObjectLock(dmn); dmn->autoShutdownInhibitions++; @@ -527,7 +525,7 @@ virNetDaemonAddShutdownInhibition(virNetDaemonPtr dmn) void -virNetDaemonRemoveShutdownInhibition(virNetDaemonPtr dmn) +virNetDaemonRemoveShutdownInhibition(virNetDaemon *dmn) { virObjectLock(dmn); dmn->autoShutdownInhibitions--; @@ -579,7 +577,7 @@ virNetDaemonSignalEvent(int watch, int events G_GNUC_UNUSED, void *opaque) { - virNetDaemonPtr dmn = opaque; + virNetDaemon *dmn = opaque; siginfo_t siginfo; size_t i; @@ -611,7 +609,7 @@ virNetDaemonSignalEvent(int watch, } static int -virNetDaemonSignalSetup(virNetDaemonPtr dmn) +virNetDaemonSignalSetup(virNetDaemon *dmn) { int fds[2] = { -1, -1 }; @@ -644,12 +642,12 @@ virNetDaemonSignalSetup(virNetDaemonPtr dmn) int -virNetDaemonAddSignalHandler(virNetDaemonPtr dmn, +virNetDaemonAddSignalHandler(virNetDaemon *dmn, int signum, virNetDaemonSignalFunc func, void *opaque) { - virNetDaemonSignalPtr sigdata = NULL; + virNetDaemonSignal *sigdata = NULL; struct sigaction sig_action; virObjectLock(dmn); @@ -686,7 +684,7 @@ virNetDaemonAddSignalHandler(virNetDaemonPtr dmn, #else /* WIN32 */ int -virNetDaemonAddSignalHandler(virNetDaemonPtr dmn G_GNUC_UNUSED, +virNetDaemonAddSignalHandler(virNetDaemon *dmn G_GNUC_UNUSED, int signum G_GNUC_UNUSED, virNetDaemonSignalFunc func G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) @@ -703,7 +701,7 @@ static void virNetDaemonAutoShutdownTimer(int timerid G_GNUC_UNUSED, void *opaque) { - virNetDaemonPtr dmn = opaque; + virNetDaemon *dmn = opaque; virObjectLock(dmn); @@ -721,14 +719,14 @@ daemonServerUpdateServices(void *payload, void *opaque) { bool *enable = opaque; - virNetServerPtr srv = payload; + virNetServer *srv = payload; virNetServerUpdateServices(srv, *enable); return 0; } void -virNetDaemonUpdateServices(virNetDaemonPtr dmn, +virNetDaemonUpdateServices(virNetDaemon *dmn, bool enabled) { virObjectLock(dmn); @@ -741,7 +739,7 @@ daemonServerProcessClients(void *payload, const char *key G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { - virNetServerPtr srv = payload; + virNetServer *srv = payload; virNetServerProcessClients(srv); return 0; @@ -752,7 +750,7 @@ daemonServerShutdownWait(void *payload, const char *key G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { - virNetServerPtr srv = payload; + virNetServer *srv = payload; virNetServerShutdownWait(srv); return 0; @@ -761,7 +759,7 @@ daemonServerShutdownWait(void *payload, static void daemonShutdownWait(void *opaque) { - virNetDaemonPtr dmn = opaque; + virNetDaemon *dmn = opaque; bool graceful = false; virHashForEach(dmn->servers, daemonServerShutdownWait, NULL); @@ -784,7 +782,7 @@ static void virNetDaemonFinishTimer(int timerid G_GNUC_UNUSED, void *opaque) { - virNetDaemonPtr dmn = opaque; + virNetDaemon *dmn = opaque; virObjectLock(dmn); dmn->finished = true; @@ -792,7 +790,7 @@ virNetDaemonFinishTimer(int timerid G_GNUC_UNUSED, } void -virNetDaemonRun(virNetDaemonPtr dmn) +virNetDaemonRun(virNetDaemon *dmn) { int timerid = -1; bool timerActive = false; @@ -894,8 +892,8 @@ virNetDaemonRun(virNetDaemonPtr dmn) void -virNetDaemonSetStateStopWorkerThread(virNetDaemonPtr dmn, - virThreadPtr *thr) +virNetDaemonSetStateStopWorkerThread(virNetDaemon *dmn, + virThread **thr) { virObjectLock(dmn); @@ -906,7 +904,7 @@ virNetDaemonSetStateStopWorkerThread(virNetDaemonPtr dmn, void -virNetDaemonQuit(virNetDaemonPtr dmn) +virNetDaemonQuit(virNetDaemon *dmn) { virObjectLock(dmn); @@ -935,7 +933,7 @@ daemonServerClose(void *payload, const char *key G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { - virNetServerPtr srv = payload; + virNetServer *srv = payload; virNetServerClose(srv); return 0; @@ -947,7 +945,7 @@ daemonServerHasClients(void *payload, void *opaque) { bool *clients = opaque; - virNetServerPtr srv = payload; + virNetServer *srv = payload; if (virNetServerHasClients(srv)) *clients = true; @@ -956,7 +954,7 @@ daemonServerHasClients(void *payload, } bool -virNetDaemonHasClients(virNetDaemonPtr dmn) +virNetDaemonHasClients(virNetDaemon *dmn) { bool ret = false; @@ -966,7 +964,7 @@ virNetDaemonHasClients(virNetDaemonPtr dmn) } void -virNetDaemonSetShutdownCallbacks(virNetDaemonPtr dmn, +virNetDaemonSetShutdownCallbacks(virNetDaemon *dmn, virNetDaemonShutdownCallback prepareCb, virNetDaemonShutdownCallback waitCb) { diff --git a/src/rpc/virnetdaemon.h b/src/rpc/virnetdaemon.h index 7ad5d25b96..f91b59a4fd 100644 --- a/src/rpc/virnetdaemon.h +++ b/src/rpc/virnetdaemon.h @@ -30,63 +30,63 @@ #include "virnetserverservice.h" #include "virnetserver.h" -virNetDaemonPtr virNetDaemonNew(void); +virNetDaemon *virNetDaemonNew(void); -int virNetDaemonAddServer(virNetDaemonPtr dmn, - virNetServerPtr srv); +int virNetDaemonAddServer(virNetDaemon *dmn, + virNetServer *srv); -typedef virNetServerPtr (*virNetDaemonNewServerPostExecRestart)(virNetDaemonPtr dmn, +typedef virNetServer *(*virNetDaemonNewServerPostExecRestart)(virNetDaemon *dmn, const char *name, - virJSONValuePtr object, + virJSONValue *object, void *opaque); -virNetDaemonPtr virNetDaemonNewPostExecRestart(virJSONValuePtr object, +virNetDaemon *virNetDaemonNewPostExecRestart(virJSONValue *object, size_t nDefServerNames, const char **defServerNames, virNetDaemonNewServerPostExecRestart cb, void *opaque); -virJSONValuePtr virNetDaemonPreExecRestart(virNetDaemonPtr dmn); +virJSONValue *virNetDaemonPreExecRestart(virNetDaemon *dmn); -bool virNetDaemonIsPrivileged(virNetDaemonPtr dmn); +bool virNetDaemonIsPrivileged(virNetDaemon *dmn); -void virNetDaemonAutoShutdown(virNetDaemonPtr dmn, +void virNetDaemonAutoShutdown(virNetDaemon *dmn, unsigned int timeout); -void virNetDaemonAddShutdownInhibition(virNetDaemonPtr dmn); -void virNetDaemonRemoveShutdownInhibition(virNetDaemonPtr dmn); +void virNetDaemonAddShutdownInhibition(virNetDaemon *dmn); +void virNetDaemonRemoveShutdownInhibition(virNetDaemon *dmn); #ifdef WIN32 # define siginfo_t void #endif -typedef void (*virNetDaemonSignalFunc)(virNetDaemonPtr dmn, siginfo_t *info, void *opaque); +typedef void (*virNetDaemonSignalFunc)(virNetDaemon *dmn, siginfo_t *info, void *opaque); -int virNetDaemonAddSignalHandler(virNetDaemonPtr dmn, +int virNetDaemonAddSignalHandler(virNetDaemon *dmn, int signum, virNetDaemonSignalFunc func, void *opaque); -void virNetDaemonUpdateServices(virNetDaemonPtr dmn, +void virNetDaemonUpdateServices(virNetDaemon *dmn, bool enabled); -void virNetDaemonSetStateStopWorkerThread(virNetDaemonPtr dmn, - virThreadPtr *thr); +void virNetDaemonSetStateStopWorkerThread(virNetDaemon *dmn, + virThread **thr); -void virNetDaemonRun(virNetDaemonPtr dmn); +void virNetDaemonRun(virNetDaemon *dmn); -void virNetDaemonQuit(virNetDaemonPtr dmn); +void virNetDaemonQuit(virNetDaemon *dmn); void virNetDaemonQuitExecRestart(virNetDaemon *dmn); -bool virNetDaemonHasClients(virNetDaemonPtr dmn); +bool virNetDaemonHasClients(virNetDaemon *dmn); -virNetServerPtr virNetDaemonGetServer(virNetDaemonPtr dmn, +virNetServer *virNetDaemonGetServer(virNetDaemon *dmn, const char *serverName); -ssize_t virNetDaemonGetServers(virNetDaemonPtr dmn, virNetServerPtr **servers); -bool virNetDaemonHasServer(virNetDaemonPtr dmn, +ssize_t virNetDaemonGetServers(virNetDaemon *dmn, virNetServer ***servers); +bool virNetDaemonHasServer(virNetDaemon *dmn, const char *serverName); typedef int (*virNetDaemonShutdownCallback)(void); -void virNetDaemonSetShutdownCallbacks(virNetDaemonPtr dmn, +void virNetDaemonSetShutdownCallbacks(virNetDaemon *dmn, virNetDaemonShutdownCallback prepareCb, virNetDaemonShutdownCallback waitCb); diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c index e08e0c1392..50ace5f41d 100644 --- a/src/rpc/virnetlibsshsession.c +++ b/src/rpc/virnetlibsshsession.c @@ -65,8 +65,6 @@ typedef enum { typedef struct _virNetLibsshAuthMethod virNetLibsshAuthMethod; -typedef virNetLibsshAuthMethod *virNetLibsshAuthMethodPtr; - struct _virNetLibsshAuthMethod { virNetLibsshAuthMethods method; int ssh_flags; /* SSH_AUTH_METHOD_* for this auth method */ @@ -96,7 +94,7 @@ struct _virNetLibsshSession { virConnectAuthPtr cred; char *authPath; size_t nauths; - virNetLibsshAuthMethodPtr *auths; + virNetLibsshAuthMethod **auths; /* channel stuff */ char *channelCommand; @@ -111,7 +109,7 @@ struct _virNetLibsshSession { static void virNetLibsshSessionDispose(void *obj) { - virNetLibsshSessionPtr sess = obj; + virNetLibsshSession *sess = obj; size_t i; VIR_DEBUG("sess=0x%p", sess); @@ -146,7 +144,7 @@ virNetLibsshSessionDispose(void *obj) g_free(sess->username); } -static virClassPtr virNetLibsshSessionClass; +static virClass *virNetLibsshSessionClass; static int virNetLibsshSessionOnceInit(void) { @@ -175,10 +173,10 @@ virNetLibsshSessionOnceInit(void) } VIR_ONCE_GLOBAL_INIT(virNetLibsshSession); -static virNetLibsshAuthMethodPtr -virNetLibsshSessionAuthMethodNew(virNetLibsshSessionPtr sess) +static virNetLibsshAuthMethod * +virNetLibsshSessionAuthMethodNew(virNetLibsshSession *sess) { - virNetLibsshAuthMethodPtr auth; + virNetLibsshAuthMethod *auth; auth = g_new0(virNetLibsshAuthMethod, 1); @@ -190,7 +188,7 @@ virNetLibsshSessionAuthMethodNew(virNetLibsshSessionPtr sess) /* string representation of public key of remote server */ static char * -virLibsshServerKeyAsString(virNetLibsshSessionPtr sess) +virLibsshServerKeyAsString(virNetLibsshSession *sess) { int ret; ssh_key key; @@ -262,7 +260,7 @@ virLengthForPromptString(const char *str) * return value: 0 on success, -1 on error */ static int -virNetLibsshCheckHostKey(virNetLibsshSessionPtr sess) +virNetLibsshCheckHostKey(virNetLibsshSession *sess) { int state; char *keyhashstr; @@ -397,7 +395,7 @@ virNetLibsshAuthenticatePrivkeyCb(const char *prompt, int verify G_GNUC_UNUSED, void *userdata) { - virNetLibsshSessionPtr sess = userdata; + virNetLibsshSession *sess = userdata; virConnectCredential retr_passphrase; int cred_type; g_autofree char *actual_prompt = NULL; @@ -444,8 +442,8 @@ virNetLibsshAuthenticatePrivkeyCb(const char *prompt, } static int -virNetLibsshImportPrivkey(virNetLibsshSessionPtr sess, - virNetLibsshAuthMethodPtr priv, +virNetLibsshImportPrivkey(virNetLibsshSession *sess, + virNetLibsshAuthMethod *priv, ssh_key *ret_key) { int err; @@ -491,8 +489,8 @@ virNetLibsshImportPrivkey(virNetLibsshSessionPtr sess, * returns SSH_AUTH_* values */ static int -virNetLibsshAuthenticatePrivkey(virNetLibsshSessionPtr sess, - virNetLibsshAuthMethodPtr priv) +virNetLibsshAuthenticatePrivkey(virNetLibsshSession *sess, + virNetLibsshAuthMethod *priv) { int err; int ret; @@ -571,8 +569,8 @@ virNetLibsshAuthenticatePrivkey(virNetLibsshSessionPtr sess, * returns SSH_AUTH_* values */ static int -virNetLibsshAuthenticatePassword(virNetLibsshSessionPtr sess, - virNetLibsshAuthMethodPtr priv) +virNetLibsshAuthenticatePassword(virNetLibsshSession *sess, + virNetLibsshAuthMethod *priv) { const char *errmsg; int rc = SSH_AUTH_ERROR; @@ -626,8 +624,8 @@ virNetLibsshAuthenticatePassword(virNetLibsshSessionPtr sess, * returns SSH_AUTH_* values */ static int -virNetLibsshAuthenticateKeyboardInteractive(virNetLibsshSessionPtr sess, - virNetLibsshAuthMethodPtr priv) +virNetLibsshAuthenticateKeyboardInteractive(virNetLibsshSession *sess, + virNetLibsshAuthMethod *priv) { int ret; const char *errmsg; @@ -755,9 +753,9 @@ virNetLibsshAuthenticateKeyboardInteractive(virNetLibsshSessionPtr sess, /* select auth method and authenticate */ static int -virNetLibsshAuthenticate(virNetLibsshSessionPtr sess) +virNetLibsshAuthenticate(virNetLibsshSession *sess) { - virNetLibsshAuthMethodPtr auth; + virNetLibsshAuthMethod *auth; bool no_method = false; bool auth_failed = false; const char *errmsg; @@ -851,7 +849,7 @@ virNetLibsshAuthenticate(virNetLibsshSessionPtr sess) /* open channel */ static int -virNetLibsshOpenChannel(virNetLibsshSessionPtr sess) +virNetLibsshOpenChannel(virNetLibsshSession *sess) { const char *errmsg; @@ -890,7 +888,7 @@ virNetLibsshOpenChannel(virNetLibsshSessionPtr sess) /* validate if all required parameters are configured */ static int -virNetLibsshValidateConfig(virNetLibsshSessionPtr sess) +virNetLibsshValidateConfig(virNetLibsshSession *sess) { size_t i; bool has_auths = false; @@ -928,7 +926,7 @@ virNetLibsshValidateConfig(virNetLibsshSessionPtr sess) /* ### PUBLIC API ### */ int -virNetLibsshSessionAuthSetCallback(virNetLibsshSessionPtr sess, +virNetLibsshSessionAuthSetCallback(virNetLibsshSession *sess, virConnectAuthPtr auth) { virObjectLock(sess); @@ -938,11 +936,11 @@ virNetLibsshSessionAuthSetCallback(virNetLibsshSessionPtr sess, } int -virNetLibsshSessionAuthAddPasswordAuth(virNetLibsshSessionPtr sess, - virURIPtr uri) +virNetLibsshSessionAuthAddPasswordAuth(virNetLibsshSession *sess, + virURI *uri) { int ret; - virNetLibsshAuthMethodPtr auth; + virNetLibsshAuthMethod *auth; if (uri) { VIR_FREE(sess->authPath); @@ -971,10 +969,10 @@ virNetLibsshSessionAuthAddPasswordAuth(virNetLibsshSessionPtr sess, } int -virNetLibsshSessionAuthAddAgentAuth(virNetLibsshSessionPtr sess) +virNetLibsshSessionAuthAddAgentAuth(virNetLibsshSession *sess) { int ret; - virNetLibsshAuthMethodPtr auth; + virNetLibsshAuthMethod *auth; virObjectLock(sess); @@ -994,11 +992,11 @@ virNetLibsshSessionAuthAddAgentAuth(virNetLibsshSessionPtr sess) } int -virNetLibsshSessionAuthAddPrivKeyAuth(virNetLibsshSessionPtr sess, +virNetLibsshSessionAuthAddPrivKeyAuth(virNetLibsshSession *sess, const char *keyfile, const char *password) { - virNetLibsshAuthMethodPtr auth; + virNetLibsshAuthMethod *auth; if (!keyfile) { virReportError(VIR_ERR_LIBSSH, "%s", @@ -1023,11 +1021,11 @@ virNetLibsshSessionAuthAddPrivKeyAuth(virNetLibsshSessionPtr sess, } int -virNetLibsshSessionAuthAddKeyboardAuth(virNetLibsshSessionPtr sess, +virNetLibsshSessionAuthAddKeyboardAuth(virNetLibsshSession *sess, int tries) { int ret; - virNetLibsshAuthMethodPtr auth; + virNetLibsshAuthMethod *auth; virObjectLock(sess); @@ -1049,7 +1047,7 @@ virNetLibsshSessionAuthAddKeyboardAuth(virNetLibsshSessionPtr sess, } void -virNetLibsshSessionSetChannelCommand(virNetLibsshSessionPtr sess, +virNetLibsshSessionSetChannelCommand(virNetLibsshSession *sess, const char *command) { virObjectLock(sess); @@ -1062,7 +1060,7 @@ virNetLibsshSessionSetChannelCommand(virNetLibsshSessionPtr sess, } int -virNetLibsshSessionSetHostKeyVerification(virNetLibsshSessionPtr sess, +virNetLibsshSessionSetHostKeyVerification(virNetLibsshSession *sess, const char *hostname, int port, const char *hostsfile, @@ -1112,9 +1110,9 @@ virNetLibsshSessionSetHostKeyVerification(virNetLibsshSessionPtr sess, } /* allocate and initialize a libssh session object */ -virNetLibsshSessionPtr virNetLibsshSessionNew(const char *username) +virNetLibsshSession *virNetLibsshSessionNew(const char *username) { - virNetLibsshSessionPtr sess = NULL; + virNetLibsshSession *sess = NULL; if (virNetLibsshSessionInitialize() < 0) goto error; @@ -1131,7 +1129,7 @@ virNetLibsshSessionPtr virNetLibsshSessionNew(const char *username) sess->username = g_strdup(username); - VIR_DEBUG("virNetLibsshSessionPtr: %p, ssh_session: %p", + VIR_DEBUG("virNetLibsshSession *: %p, ssh_session: %p", sess, sess->session); /* set blocking mode for libssh until handshake is complete */ @@ -1152,7 +1150,7 @@ virNetLibsshSessionPtr virNetLibsshSessionNew(const char *username) } int -virNetLibsshSessionConnect(virNetLibsshSessionPtr sess, +virNetLibsshSessionConnect(virNetLibsshSession *sess, int sock) { int ret; @@ -1162,7 +1160,7 @@ virNetLibsshSessionConnect(virNetLibsshSessionPtr sess, if (!sess || sess->state != VIR_NET_LIBSSH_STATE_NEW) { virReportError(VIR_ERR_LIBSSH, "%s", - _("Invalid virNetLibsshSessionPtr")); + _("Invalid virNetLibsshSession *")); return -1; } @@ -1219,7 +1217,7 @@ virNetLibsshSessionConnect(virNetLibsshSessionPtr sess, /* do a read from a ssh channel, used instead of normal read on socket */ ssize_t -virNetLibsshChannelRead(virNetLibsshSessionPtr sess, +virNetLibsshChannelRead(virNetLibsshSession *sess, char *buf, size_t len) { @@ -1341,7 +1339,7 @@ virNetLibsshChannelRead(virNetLibsshSessionPtr sess, } ssize_t -virNetLibsshChannelWrite(virNetLibsshSessionPtr sess, +virNetLibsshChannelWrite(virNetLibsshSession *sess, const char *buf, size_t len) { @@ -1398,7 +1396,7 @@ virNetLibsshChannelWrite(virNetLibsshSessionPtr sess, } bool -virNetLibsshSessionHasCachedData(virNetLibsshSessionPtr sess) +virNetLibsshSessionHasCachedData(virNetLibsshSession *sess) { bool ret; diff --git a/src/rpc/virnetlibsshsession.h b/src/rpc/virnetlibsshsession.h index e982bcd2ef..c3b5f3e80d 100644 --- a/src/rpc/virnetlibsshsession.h +++ b/src/rpc/virnetlibsshsession.h @@ -24,10 +24,9 @@ #include "viruri.h" typedef struct _virNetLibsshSession virNetLibsshSession; -typedef virNetLibsshSession *virNetLibsshSessionPtr; -virNetLibsshSessionPtr virNetLibsshSessionNew(const char *username); -void virNetLibsshSessionFree(virNetLibsshSessionPtr sess); +virNetLibsshSession *virNetLibsshSessionNew(const char *username); +void virNetLibsshSessionFree(virNetLibsshSession *sess); typedef enum { VIR_NET_LIBSSH_HOSTKEY_VERIFY_NORMAL, @@ -35,39 +34,39 @@ typedef enum { VIR_NET_LIBSSH_HOSTKEY_VERIFY_IGNORE } virNetLibsshHostkeyVerify; -void virNetLibsshSessionSetChannelCommand(virNetLibsshSessionPtr sess, +void virNetLibsshSessionSetChannelCommand(virNetLibsshSession *sess, const char *command); -int virNetLibsshSessionAuthSetCallback(virNetLibsshSessionPtr sess, +int virNetLibsshSessionAuthSetCallback(virNetLibsshSession *sess, virConnectAuthPtr auth); -int virNetLibsshSessionAuthAddPasswordAuth(virNetLibsshSessionPtr sess, - virURIPtr uri); +int virNetLibsshSessionAuthAddPasswordAuth(virNetLibsshSession *sess, + virURI *uri); -int virNetLibsshSessionAuthAddAgentAuth(virNetLibsshSessionPtr sess); +int virNetLibsshSessionAuthAddAgentAuth(virNetLibsshSession *sess); -int virNetLibsshSessionAuthAddPrivKeyAuth(virNetLibsshSessionPtr sess, +int virNetLibsshSessionAuthAddPrivKeyAuth(virNetLibsshSession *sess, const char *keyfile, const char *password); -int virNetLibsshSessionAuthAddKeyboardAuth(virNetLibsshSessionPtr sess, +int virNetLibsshSessionAuthAddKeyboardAuth(virNetLibsshSession *sess, int tries); -int virNetLibsshSessionSetHostKeyVerification(virNetLibsshSessionPtr sess, +int virNetLibsshSessionSetHostKeyVerification(virNetLibsshSession *sess, const char *hostname, int port, const char *hostsfile, virNetLibsshHostkeyVerify opt); -int virNetLibsshSessionConnect(virNetLibsshSessionPtr sess, +int virNetLibsshSessionConnect(virNetLibsshSession *sess, int sock); -ssize_t virNetLibsshChannelRead(virNetLibsshSessionPtr sess, +ssize_t virNetLibsshChannelRead(virNetLibsshSession *sess, char *buf, size_t len); -ssize_t virNetLibsshChannelWrite(virNetLibsshSessionPtr sess, +ssize_t virNetLibsshChannelWrite(virNetLibsshSession *sess, const char *buf, size_t len); -bool virNetLibsshSessionHasCachedData(virNetLibsshSessionPtr sess); +bool virNetLibsshSessionHasCachedData(virNetLibsshSession *sess); diff --git a/src/rpc/virnetmessage.c b/src/rpc/virnetmessage.c index 3eecc6599d..e0fbd607bf 100644 --- a/src/rpc/virnetmessage.c +++ b/src/rpc/virnetmessage.c @@ -34,9 +34,9 @@ VIR_LOG_INIT("rpc.netmessage"); -virNetMessagePtr virNetMessageNew(bool tracked) +virNetMessage *virNetMessageNew(bool tracked) { - virNetMessagePtr msg; + virNetMessage *msg; msg = g_new0(virNetMessage, 1); @@ -48,7 +48,7 @@ virNetMessagePtr virNetMessageNew(bool tracked) void -virNetMessageClearPayload(virNetMessagePtr msg) +virNetMessageClearPayload(virNetMessage *msg) { size_t i; @@ -65,7 +65,7 @@ virNetMessageClearPayload(virNetMessagePtr msg) } -void virNetMessageClear(virNetMessagePtr msg) +void virNetMessageClear(virNetMessage *msg) { bool tracked = msg->tracked; @@ -77,7 +77,7 @@ void virNetMessageClear(virNetMessagePtr msg) } -void virNetMessageFree(virNetMessagePtr msg) +void virNetMessageFree(virNetMessage *msg) { if (!msg) return; @@ -91,9 +91,9 @@ void virNetMessageFree(virNetMessagePtr msg) g_free(msg); } -void virNetMessageQueuePush(virNetMessagePtr *queue, virNetMessagePtr msg) +void virNetMessageQueuePush(virNetMessage **queue, virNetMessage *msg) { - virNetMessagePtr tmp = *queue; + virNetMessage *tmp = *queue; if (tmp) { while (tmp->next) @@ -105,9 +105,9 @@ void virNetMessageQueuePush(virNetMessagePtr *queue, virNetMessagePtr msg) } -virNetMessagePtr virNetMessageQueueServe(virNetMessagePtr *queue) +virNetMessage *virNetMessageQueueServe(virNetMessage **queue) { - virNetMessagePtr tmp = *queue; + virNetMessage *tmp = *queue; if (tmp) { *queue = g_steal_pointer(&tmp->next); @@ -117,7 +117,7 @@ virNetMessagePtr virNetMessageQueueServe(virNetMessagePtr *queue) } -int virNetMessageDecodeLength(virNetMessagePtr msg) +int virNetMessageDecodeLength(virNetMessage *msg) { XDR xdr; unsigned int len; @@ -175,7 +175,7 @@ int virNetMessageDecodeLength(virNetMessagePtr msg) * * returns 0 if successfully decoded, -1 upon fatal error */ -int virNetMessageDecodeHeader(virNetMessagePtr msg) +int virNetMessageDecodeHeader(virNetMessage *msg) { XDR xdr; int ret = -1; @@ -220,7 +220,7 @@ int virNetMessageDecodeHeader(virNetMessagePtr msg) * * returns 0 if successfully encoded, -1 upon fatal error */ -int virNetMessageEncodeHeader(virNetMessagePtr msg) +int virNetMessageEncodeHeader(virNetMessage *msg) { XDR xdr; int ret = -1; @@ -268,7 +268,7 @@ int virNetMessageEncodeHeader(virNetMessagePtr msg) } -int virNetMessageEncodeNumFDs(virNetMessagePtr msg) +int virNetMessageEncodeNumFDs(virNetMessage *msg) { XDR xdr; unsigned int numFDs = msg->nfds; @@ -300,7 +300,7 @@ int virNetMessageEncodeNumFDs(virNetMessagePtr msg) } -int virNetMessageDecodeNumFDs(virNetMessagePtr msg) +int virNetMessageDecodeNumFDs(virNetMessage *msg) { XDR xdr; unsigned int numFDs; @@ -340,7 +340,7 @@ int virNetMessageDecodeNumFDs(virNetMessagePtr msg) } -int virNetMessageEncodePayload(virNetMessagePtr msg, +int virNetMessageEncodePayload(virNetMessage *msg, xdrproc_t filter, void *data) { @@ -399,7 +399,7 @@ int virNetMessageEncodePayload(virNetMessagePtr msg, } -int virNetMessageDecodePayload(virNetMessagePtr msg, +int virNetMessageDecodePayload(virNetMessage *msg, xdrproc_t filter, void *data) { @@ -427,7 +427,7 @@ int virNetMessageDecodePayload(virNetMessagePtr msg, } -int virNetMessageEncodePayloadRaw(virNetMessagePtr msg, +int virNetMessageEncodePayloadRaw(virNetMessage *msg, const char *data, size_t len) { @@ -478,7 +478,7 @@ int virNetMessageEncodePayloadRaw(virNetMessagePtr msg, } -int virNetMessageEncodePayloadEmpty(virNetMessagePtr msg) +int virNetMessageEncodePayloadEmpty(virNetMessage *msg) { XDR xdr; unsigned int msglen; @@ -503,7 +503,7 @@ int virNetMessageEncodePayloadEmpty(virNetMessagePtr msg) } -void virNetMessageSaveError(virNetMessageErrorPtr rerr) +void virNetMessageSaveError(struct virNetMessageError *rerr) { virErrorPtr verr; @@ -548,7 +548,7 @@ void virNetMessageSaveError(virNetMessageErrorPtr rerr) } -int virNetMessageDupFD(virNetMessagePtr msg, +int virNetMessageDupFD(virNetMessage *msg, size_t slot) { int fd; @@ -575,7 +575,7 @@ int virNetMessageDupFD(virNetMessagePtr msg, return fd; } -int virNetMessageAddFD(virNetMessagePtr msg, +int virNetMessageAddFD(virNetMessage *msg, int fd) { int newfd = -1; diff --git a/src/rpc/virnetmessage.h b/src/rpc/virnetmessage.h index 94c2947974..aadf1b69b0 100644 --- a/src/rpc/virnetmessage.h +++ b/src/rpc/virnetmessage.h @@ -22,13 +22,9 @@ #include "virnetprotocol.h" -typedef struct virNetMessageHeader *virNetMessageHeaderPtr; -typedef struct virNetMessageError *virNetMessageErrorPtr; - typedef struct _virNetMessage virNetMessage; -typedef virNetMessage *virNetMessagePtr; -typedef void (*virNetMessageFreeCallback)(virNetMessagePtr msg, void *opaque); +typedef void (*virNetMessageFreeCallback)(virNetMessage *msg, void *opaque); struct _virNetMessage { bool tracked; @@ -47,55 +43,55 @@ struct _virNetMessage { int *fds; size_t donefds; - virNetMessagePtr next; + virNetMessage *next; }; -virNetMessagePtr virNetMessageNew(bool tracked); +virNetMessage *virNetMessageNew(bool tracked); -void virNetMessageClearPayload(virNetMessagePtr msg); +void virNetMessageClearPayload(virNetMessage *msg); -void virNetMessageClear(virNetMessagePtr); +void virNetMessageClear(virNetMessage *); -void virNetMessageFree(virNetMessagePtr msg); +void virNetMessageFree(virNetMessage *msg); -virNetMessagePtr virNetMessageQueueServe(virNetMessagePtr *queue) +virNetMessage *virNetMessageQueueServe(virNetMessage **queue) ATTRIBUTE_NONNULL(1); -void virNetMessageQueuePush(virNetMessagePtr *queue, - virNetMessagePtr msg) +void virNetMessageQueuePush(virNetMessage **queue, + virNetMessage *msg) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virNetMessageEncodeHeader(virNetMessagePtr msg) +int virNetMessageEncodeHeader(virNetMessage *msg) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -int virNetMessageDecodeLength(virNetMessagePtr msg) +int virNetMessageDecodeLength(virNetMessage *msg) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -int virNetMessageDecodeHeader(virNetMessagePtr msg) +int virNetMessageDecodeHeader(virNetMessage *msg) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -int virNetMessageEncodePayload(virNetMessagePtr msg, +int virNetMessageEncodePayload(virNetMessage *msg, xdrproc_t filter, void *data) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int virNetMessageDecodePayload(virNetMessagePtr msg, +int virNetMessageDecodePayload(virNetMessage *msg, xdrproc_t filter, void *data) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int virNetMessageEncodeNumFDs(virNetMessagePtr msg); -int virNetMessageDecodeNumFDs(virNetMessagePtr msg); +int virNetMessageEncodeNumFDs(virNetMessage *msg); +int virNetMessageDecodeNumFDs(virNetMessage *msg); -int virNetMessageEncodePayloadRaw(virNetMessagePtr msg, +int virNetMessageEncodePayloadRaw(virNetMessage *msg, const char *buf, size_t len) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -int virNetMessageEncodePayloadEmpty(virNetMessagePtr msg) +int virNetMessageEncodePayloadEmpty(virNetMessage *msg) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -void virNetMessageSaveError(virNetMessageErrorPtr rerr) +void virNetMessageSaveError(struct virNetMessageError *rerr) ATTRIBUTE_NONNULL(1); -int virNetMessageDupFD(virNetMessagePtr msg, +int virNetMessageDupFD(virNetMessage *msg, size_t slot); -int virNetMessageAddFD(virNetMessagePtr msg, +int virNetMessageAddFD(virNetMessage *msg, int fd); diff --git a/src/rpc/virnetsaslcontext.c b/src/rpc/virnetsaslcontext.c index 8a6250120d..189e70d01a 100644 --- a/src/rpc/virnetsaslcontext.c +++ b/src/rpc/virnetsaslcontext.c @@ -48,8 +48,8 @@ struct _virNetSASLSession { }; -static virClassPtr virNetSASLContextClass; -static virClassPtr virNetSASLSessionClass; +static virClass *virNetSASLContextClass; +static virClass *virNetSASLSessionClass; static void virNetSASLContextDispose(void *obj); static void virNetSASLSessionDispose(void *obj); @@ -107,9 +107,9 @@ static int virNetSASLContextServerOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNetSASLContextServer); -virNetSASLContextPtr virNetSASLContextNewClient(void) +virNetSASLContext *virNetSASLContextNewClient(void) { - virNetSASLContextPtr ctxt; + virNetSASLContext *ctxt; if (virNetSASLContextInitialize() < 0 || virNetSASLContextClientInitialize() < 0) @@ -121,9 +121,9 @@ virNetSASLContextPtr virNetSASLContextNewClient(void) return ctxt; } -virNetSASLContextPtr virNetSASLContextNewServer(const char *const *usernameACL) +virNetSASLContext *virNetSASLContextNewServer(const char *const *usernameACL) { - virNetSASLContextPtr ctxt; + virNetSASLContext *ctxt; if (virNetSASLContextInitialize() < 0 || virNetSASLContextServerInitialize() < 0) @@ -137,7 +137,7 @@ virNetSASLContextPtr virNetSASLContextNewServer(const char *const *usernameACL) return ctxt; } -int virNetSASLContextCheckIdentity(virNetSASLContextPtr ctxt, +int virNetSASLContextCheckIdentity(virNetSASLContext *ctxt, const char *identity) { const char *const*wildcards; @@ -175,14 +175,14 @@ int virNetSASLContextCheckIdentity(virNetSASLContextPtr ctxt, } -virNetSASLSessionPtr virNetSASLSessionNewClient(virNetSASLContextPtr ctxt G_GNUC_UNUSED, +virNetSASLSession *virNetSASLSessionNewClient(virNetSASLContext *ctxt G_GNUC_UNUSED, const char *service, const char *hostname, const char *localAddr, const char *remoteAddr, sasl_callback_t *cbs) { - virNetSASLSessionPtr sasl = NULL; + virNetSASLSession *sasl = NULL; int err; if (!(sasl = virObjectLockableNew(virNetSASLSessionClass))) @@ -213,12 +213,12 @@ virNetSASLSessionPtr virNetSASLSessionNewClient(virNetSASLContextPtr ctxt G_GNUC return NULL; } -virNetSASLSessionPtr virNetSASLSessionNewServer(virNetSASLContextPtr ctxt G_GNUC_UNUSED, +virNetSASLSession *virNetSASLSessionNewServer(virNetSASLContext *ctxt G_GNUC_UNUSED, const char *service, const char *localAddr, const char *remoteAddr) { - virNetSASLSessionPtr sasl = NULL; + virNetSASLSession *sasl = NULL; int err; if (!(sasl = virObjectLockableNew(virNetSASLSessionClass))) @@ -249,7 +249,7 @@ virNetSASLSessionPtr virNetSASLSessionNewServer(virNetSASLContextPtr ctxt G_GNUC return NULL; } -int virNetSASLSessionExtKeySize(virNetSASLSessionPtr sasl, +int virNetSASLSessionExtKeySize(virNetSASLSession *sasl, int ssf) { int err; @@ -271,7 +271,7 @@ int virNetSASLSessionExtKeySize(virNetSASLSessionPtr sasl, return ret; } -const char *virNetSASLSessionGetIdentity(virNetSASLSessionPtr sasl) +const char *virNetSASLSessionGetIdentity(virNetSASLSession *sasl) { const void *val = NULL; int err; @@ -298,7 +298,7 @@ const char *virNetSASLSessionGetIdentity(virNetSASLSessionPtr sasl) } -int virNetSASLSessionGetKeySize(virNetSASLSessionPtr sasl) +int virNetSASLSessionGetKeySize(virNetSASLSession *sasl) { int err; int ssf; @@ -320,7 +320,7 @@ int virNetSASLSessionGetKeySize(virNetSASLSessionPtr sasl) return ssf; } -int virNetSASLSessionSecProps(virNetSASLSessionPtr sasl, +int virNetSASLSessionSecProps(virNetSASLSession *sasl, int minSSF, int maxSSF, bool allowAnonymous) @@ -357,7 +357,7 @@ int virNetSASLSessionSecProps(virNetSASLSessionPtr sasl, } -static int virNetSASLSessionUpdateBufSize(virNetSASLSessionPtr sasl) +static int virNetSASLSessionUpdateBufSize(virNetSASLSession *sasl) { union { unsigned *maxbufsize; @@ -379,7 +379,7 @@ static int virNetSASLSessionUpdateBufSize(virNetSASLSessionPtr sasl) return 0; } -char *virNetSASLSessionListMechanisms(virNetSASLSessionPtr sasl) +char *virNetSASLSessionListMechanisms(virNetSASLSession *sasl) { const char *mechlist; char *ret = NULL; @@ -414,7 +414,7 @@ char *virNetSASLSessionListMechanisms(virNetSASLSessionPtr sasl) } -int virNetSASLSessionClientStart(virNetSASLSessionPtr sasl, +int virNetSASLSessionClientStart(virNetSASLSession *sasl, const char *mechlist, sasl_interact_t **prompt_need, const char **clientout, @@ -463,7 +463,7 @@ int virNetSASLSessionClientStart(virNetSASLSessionPtr sasl, } -int virNetSASLSessionClientStep(virNetSASLSessionPtr sasl, +int virNetSASLSessionClientStep(virNetSASLSession *sasl, const char *serverin, size_t serverinlen, sasl_interact_t **prompt_need, @@ -511,7 +511,7 @@ int virNetSASLSessionClientStep(virNetSASLSessionPtr sasl, return ret; } -int virNetSASLSessionServerStart(virNetSASLSessionPtr sasl, +int virNetSASLSessionServerStart(virNetSASLSession *sasl, const char *mechname, const char *clientin, size_t clientinlen, @@ -558,7 +558,7 @@ int virNetSASLSessionServerStart(virNetSASLSessionPtr sasl, } -int virNetSASLSessionServerStep(virNetSASLSessionPtr sasl, +int virNetSASLSessionServerStep(virNetSASLSession *sasl, const char *clientin, size_t clientinlen, const char **serverout, @@ -602,7 +602,7 @@ int virNetSASLSessionServerStep(virNetSASLSessionPtr sasl, return ret; } -size_t virNetSASLSessionGetMaxBufSize(virNetSASLSessionPtr sasl) +size_t virNetSASLSessionGetMaxBufSize(virNetSASLSession *sasl) { size_t ret; virObjectLock(sasl); @@ -611,7 +611,7 @@ size_t virNetSASLSessionGetMaxBufSize(virNetSASLSessionPtr sasl) return ret; } -ssize_t virNetSASLSessionEncode(virNetSASLSessionPtr sasl, +ssize_t virNetSASLSessionEncode(virNetSASLSession *sasl, const char *input, size_t inputLen, const char **output, @@ -650,7 +650,7 @@ ssize_t virNetSASLSessionEncode(virNetSASLSessionPtr sasl, return ret; } -ssize_t virNetSASLSessionDecode(virNetSASLSessionPtr sasl, +ssize_t virNetSASLSessionDecode(virNetSASLSession *sasl, const char *input, size_t inputLen, const char **output, @@ -695,7 +695,7 @@ void virNetSASLContextDispose(void *obj G_GNUC_UNUSED) void virNetSASLSessionDispose(void *obj) { - virNetSASLSessionPtr sasl = obj; + virNetSASLSession *sasl = obj; if (sasl->conn) sasl_dispose(&sasl->conn); diff --git a/src/rpc/virnetsaslcontext.h b/src/rpc/virnetsaslcontext.h index 618230f42d..33a75e71a0 100644 --- a/src/rpc/virnetsaslcontext.h +++ b/src/rpc/virnetsaslcontext.h @@ -26,10 +26,8 @@ #include "virobject.h" typedef struct _virNetSASLContext virNetSASLContext; -typedef virNetSASLContext *virNetSASLContextPtr; typedef struct _virNetSASLSession virNetSASLSession; -typedef virNetSASLSession *virNetSASLSessionPtr; enum { VIR_NET_SASL_COMPLETE, @@ -37,73 +35,73 @@ enum { VIR_NET_SASL_INTERACT, }; -virNetSASLContextPtr virNetSASLContextNewClient(void); -virNetSASLContextPtr virNetSASLContextNewServer(const char *const *usernameACL); +virNetSASLContext *virNetSASLContextNewClient(void); +virNetSASLContext *virNetSASLContextNewServer(const char *const *usernameACL); -int virNetSASLContextCheckIdentity(virNetSASLContextPtr ctxt, +int virNetSASLContextCheckIdentity(virNetSASLContext *ctxt, const char *identity); -virNetSASLSessionPtr virNetSASLSessionNewClient(virNetSASLContextPtr ctxt, +virNetSASLSession *virNetSASLSessionNewClient(virNetSASLContext *ctxt, const char *service, const char *hostname, const char *localAddr, const char *remoteAddr, sasl_callback_t *cbs); -virNetSASLSessionPtr virNetSASLSessionNewServer(virNetSASLContextPtr ctxt, +virNetSASLSession *virNetSASLSessionNewServer(virNetSASLContext *ctxt, const char *service, const char *localAddr, const char *remoteAddr); -char *virNetSASLSessionListMechanisms(virNetSASLSessionPtr sasl); +char *virNetSASLSessionListMechanisms(virNetSASLSession *sasl); -int virNetSASLSessionExtKeySize(virNetSASLSessionPtr sasl, +int virNetSASLSessionExtKeySize(virNetSASLSession *sasl, int ssf); -int virNetSASLSessionGetKeySize(virNetSASLSessionPtr sasl); +int virNetSASLSessionGetKeySize(virNetSASLSession *sasl); -const char *virNetSASLSessionGetIdentity(virNetSASLSessionPtr sasl); +const char *virNetSASLSessionGetIdentity(virNetSASLSession *sasl); -int virNetSASLSessionSecProps(virNetSASLSessionPtr sasl, +int virNetSASLSessionSecProps(virNetSASLSession *sasl, int minSSF, int maxSSF, bool allowAnonymous); -int virNetSASLSessionClientStart(virNetSASLSessionPtr sasl, +int virNetSASLSessionClientStart(virNetSASLSession *sasl, const char *mechlist, sasl_interact_t **prompt_need, const char **clientout, size_t *clientoutlen, const char **mech); -int virNetSASLSessionClientStep(virNetSASLSessionPtr sasl, +int virNetSASLSessionClientStep(virNetSASLSession *sasl, const char *serverin, size_t serverinlen, sasl_interact_t **prompt_need, const char **clientout, size_t *clientoutlen); -int virNetSASLSessionServerStart(virNetSASLSessionPtr sasl, +int virNetSASLSessionServerStart(virNetSASLSession *sasl, const char *mechname, const char *clientin, size_t clientinlen, const char **serverout, size_t *serveroutlen); -int virNetSASLSessionServerStep(virNetSASLSessionPtr sasl, +int virNetSASLSessionServerStep(virNetSASLSession *sasl, const char *clientin, size_t clientinlen, const char **serverout, size_t *serveroutlen); -size_t virNetSASLSessionGetMaxBufSize(virNetSASLSessionPtr sasl); +size_t virNetSASLSessionGetMaxBufSize(virNetSASLSession *sasl); -ssize_t virNetSASLSessionEncode(virNetSASLSessionPtr sasl, +ssize_t virNetSASLSessionEncode(virNetSASLSession *sasl, const char *input, size_t inputLen, const char **output, size_t *outputlen); -ssize_t virNetSASLSessionDecode(virNetSASLSessionPtr sasl, +ssize_t virNetSASLSessionDecode(virNetSASLSession *sasl, const char *input, size_t inputLen, const char **output, diff --git a/src/rpc/virnetserver.c b/src/rpc/virnetserver.c index 93d55fa906..42e06fcb59 100644 --- a/src/rpc/virnetserver.c +++ b/src/rpc/virnetserver.c @@ -36,12 +36,10 @@ VIR_LOG_INIT("rpc.netserver"); typedef struct _virNetServerJob virNetServerJob; -typedef virNetServerJob *virNetServerJobPtr; - struct _virNetServerJob { - virNetServerClientPtr client; - virNetMessagePtr msg; - virNetServerProgramPtr prog; + virNetServerClient *client; + virNetMessage *msg; + virNetServerProgram *prog; }; struct _virNetServer { @@ -50,16 +48,16 @@ struct _virNetServer { char *name; /* Immutable pointer, self-locking APIs */ - virThreadPoolPtr workers; + virThreadPool *workers; size_t nservices; - virNetServerServicePtr *services; + virNetServerService **services; size_t nprograms; - virNetServerProgramPtr *programs; + virNetServerProgram **programs; size_t nclients; /* Current clients count */ - virNetServerClientPtr *clients; /* Clients */ + virNetServerClient **clients; /* Clients */ unsigned long long next_client_id; /* next client ID */ size_t nclients_max; /* Max allowed clients count */ size_t nclients_unauth; /* Unauthenticated clients count */ @@ -68,7 +66,7 @@ struct _virNetServer { int keepaliveInterval; unsigned int keepaliveCount; - virNetTLSContextPtr tls; + virNetTLSContext *tls; virNetServerClientPrivNew clientPrivNew; virNetServerClientPrivPreExecRestart clientPrivPreExecRestart; @@ -77,12 +75,12 @@ struct _virNetServer { }; -static virClassPtr virNetServerClass; +static virClass *virNetServerClass; static void virNetServerDispose(void *obj); -static void virNetServerUpdateServicesLocked(virNetServerPtr srv, +static void virNetServerUpdateServicesLocked(virNetServer *srv, bool enabled); -static inline size_t virNetServerTrackPendingAuthLocked(virNetServerPtr srv); -static inline size_t virNetServerTrackCompletedAuthLocked(virNetServerPtr srv); +static inline size_t virNetServerTrackPendingAuthLocked(virNetServer *srv); +static inline size_t virNetServerTrackCompletedAuthLocked(virNetServer *srv); static int virNetServerOnceInit(void) { @@ -94,7 +92,7 @@ static int virNetServerOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNetServer); -unsigned long long virNetServerNextClientID(virNetServerPtr srv) +unsigned long long virNetServerNextClientID(virNetServer *srv) { unsigned long long val; @@ -105,10 +103,10 @@ unsigned long long virNetServerNextClientID(virNetServerPtr srv) return val; } -static int virNetServerProcessMsg(virNetServerPtr srv, - virNetServerClientPtr client, - virNetServerProgramPtr prog, - virNetMessagePtr msg) +static int virNetServerProcessMsg(virNetServer *srv, + virNetServerClient *client, + virNetServerProgram *prog, + virNetMessage *msg) { if (!prog) { /* Only send back an error for type == CALL. Other @@ -145,8 +143,8 @@ static int virNetServerProcessMsg(virNetServerPtr srv, static void virNetServerHandleJob(void *jobOpaque, void *opaque) { - virNetServerPtr srv = opaque; - virNetServerJobPtr job = jobOpaque; + virNetServer *srv = opaque; + virNetServerJob *job = jobOpaque; VIR_DEBUG("server=%p client=%p message=%p prog=%p", srv, job->client, job->msg, job->prog); @@ -176,9 +174,9 @@ static void virNetServerHandleJob(void *jobOpaque, void *opaque) * * Returns a pointer to the server program or NULL if not found. */ -static virNetServerProgramPtr -virNetServerGetProgramLocked(virNetServerPtr srv, - virNetMessagePtr msg) +static virNetServerProgram * +virNetServerGetProgramLocked(virNetServer *srv, + virNetMessage *msg) { size_t i; for (i = 0; i < srv->nprograms; i++) { @@ -189,12 +187,12 @@ virNetServerGetProgramLocked(virNetServerPtr srv, } static void -virNetServerDispatchNewMessage(virNetServerClientPtr client, - virNetMessagePtr msg, +virNetServerDispatchNewMessage(virNetServerClient *client, + virNetMessage *msg, void *opaque) { - virNetServerPtr srv = opaque; - virNetServerProgramPtr prog = NULL; + virNetServer *srv = opaque; + virNetServerProgram *prog = NULL; unsigned int priority = 0; VIR_DEBUG("server=%p client=%p message=%p", @@ -209,7 +207,7 @@ virNetServerDispatchNewMessage(virNetServerClientPtr client, virObjectUnlock(srv); if (virThreadPoolGetMaxWorkers(srv->workers) > 0) { - virNetServerJobPtr job; + virNetServerJob *job; job = g_new0(virNetServerJob, 1); @@ -252,7 +250,7 @@ virNetServerDispatchNewMessage(virNetServerClientPtr client, * The @srv must be locked when this function is called. */ static void -virNetServerCheckLimits(virNetServerPtr srv) +virNetServerCheckLimits(virNetServer *srv) { VIR_DEBUG("Checking client-related limits to re-enable or temporarily " "suspend services: nclients=%zu nclients_max=%zu " @@ -282,8 +280,8 @@ virNetServerCheckLimits(virNetServerPtr srv) } } -int virNetServerAddClient(virNetServerPtr srv, - virNetServerClientPtr client) +int virNetServerAddClient(virNetServer *srv, + virNetServerClient *client) { virObjectLock(srv); @@ -316,12 +314,12 @@ int virNetServerAddClient(virNetServerPtr srv, return -1; } -static int virNetServerDispatchNewClient(virNetServerServicePtr svc, - virNetSocketPtr clientsock, +static int virNetServerDispatchNewClient(virNetServerService *svc, + virNetSocket *clientsock, void *opaque) { - virNetServerPtr srv = opaque; - virNetServerClientPtr client; + virNetServer *srv = opaque; + virNetServerClient *client; if (!(client = virNetServerClientNew(virNetServerNextClientID(srv), clientsock, @@ -345,7 +343,7 @@ static int virNetServerDispatchNewClient(virNetServerServicePtr svc, } -virNetServerPtr virNetServerNew(const char *name, +virNetServer *virNetServerNew(const char *name, unsigned long long next_client_id, size_t min_workers, size_t max_workers, @@ -359,7 +357,7 @@ virNetServerPtr virNetServerNew(const char *name, virFreeCallback clientPrivFree, void *clientPrivOpaque) { - virNetServerPtr srv; + virNetServer *srv; if (virNetServerInitialize() < 0) return NULL; @@ -393,7 +391,7 @@ virNetServerPtr virNetServerNew(const char *name, } -virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, +virNetServer *virNetServerNewPostExecRestart(virJSONValue *object, const char *name, virNetServerClientPrivNew clientPrivNew, virNetServerClientPrivNewPostExecRestart clientPrivNewPostExecRestart, @@ -401,9 +399,9 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, virFreeCallback clientPrivFree, void *clientPrivOpaque) { - virNetServerPtr srv = NULL; - virJSONValuePtr clients; - virJSONValuePtr services; + virNetServer *srv = NULL; + virJSONValue *clients; + virJSONValue *services; size_t i; unsigned int min_workers; unsigned int max_workers; @@ -483,8 +481,8 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, } for (i = 0; i < virJSONValueArraySize(services); i++) { - virNetServerServicePtr service; - virJSONValuePtr child = virJSONValueArrayGet(services, i); + virNetServerService *service; + virJSONValue *child = virJSONValueArrayGet(services, i); if (!child) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing service data in JSON document")); @@ -514,8 +512,8 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, } for (i = 0; i < virJSONValueArraySize(clients); i++) { - virNetServerClientPtr client; - virJSONValuePtr child = virJSONValueArrayGet(clients, i); + virNetServerClient *client; + virJSONValue *child = virJSONValueArrayGet(clients, i); if (!child) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Missing client data in JSON document")); @@ -545,7 +543,7 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, } -virJSONValuePtr virNetServerPreExecRestart(virNetServerPtr srv) +virJSONValue *virNetServerPreExecRestart(virNetServer *srv) { g_autoptr(virJSONValue) object = virJSONValueNewObject(); g_autoptr(virJSONValue) clients = virJSONValueNewArray(); @@ -614,8 +612,8 @@ virJSONValuePtr virNetServerPreExecRestart(virNetServerPtr srv) -int virNetServerAddService(virNetServerPtr srv, - virNetServerServicePtr svc) +int virNetServerAddService(virNetServer *srv, + virNetServerService *svc) { virObjectLock(srv); @@ -632,11 +630,11 @@ int virNetServerAddService(virNetServerPtr srv, static int -virNetServerAddServiceActivation(virNetServerPtr srv, - virSystemdActivationPtr act, +virNetServerAddServiceActivation(virNetServer *srv, + virSystemdActivation *act, const char *actname, int auth, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t max_queued_clients, size_t nrequests_client_max) @@ -650,7 +648,7 @@ virNetServerAddServiceActivation(virNetServerPtr srv, virSystemdActivationClaimFDs(act, actname, &fds, &nfds); if (nfds) { - virNetServerServicePtr svc; + virNetServerService *svc; svc = virNetServerServiceNewFDs(fds, nfds, @@ -679,19 +677,19 @@ virNetServerAddServiceActivation(virNetServerPtr srv, } -int virNetServerAddServiceTCP(virNetServerPtr srv, - virSystemdActivationPtr act, +int virNetServerAddServiceTCP(virNetServer *srv, + virSystemdActivation *act, const char *actname, const char *nodename, const char *service, int family, int auth, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t max_queued_clients, size_t nrequests_client_max) { - virNetServerServicePtr svc = NULL; + virNetServerService *svc = NULL; int ret; ret = virNetServerAddServiceActivation(srv, act, actname, @@ -727,19 +725,19 @@ int virNetServerAddServiceTCP(virNetServerPtr srv, } -int virNetServerAddServiceUNIX(virNetServerPtr srv, - virSystemdActivationPtr act, +int virNetServerAddServiceUNIX(virNetServer *srv, + virSystemdActivation *act, const char *actname, const char *path, mode_t mask, gid_t grp, int auth, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t max_queued_clients, size_t nrequests_client_max) { - virNetServerServicePtr svc = NULL; + virNetServerService *svc = NULL; int ret; ret = virNetServerAddServiceActivation(srv, act, actname, @@ -775,8 +773,8 @@ int virNetServerAddServiceUNIX(virNetServerPtr srv, } -int virNetServerAddProgram(virNetServerPtr srv, - virNetServerProgramPtr prog) +int virNetServerAddProgram(virNetServer *srv, + virNetServerProgram *prog) { virObjectLock(srv); @@ -787,8 +785,8 @@ int virNetServerAddProgram(virNetServerPtr srv, return 0; } -int virNetServerSetTLSContext(virNetServerPtr srv, - virNetTLSContextPtr tls) +int virNetServerSetTLSContext(virNetServer *srv, + virNetTLSContext *tls) { srv->tls = virObjectRef(tls); return 0; @@ -804,8 +802,8 @@ int virNetServerSetTLSContext(virNetServerPtr srv, * update the server tracking. */ static void -virNetServerSetClientAuthCompletedLocked(virNetServerPtr srv, - virNetServerClientPtr client) +virNetServerSetClientAuthCompletedLocked(virNetServer *srv, + virNetServerClient *client) { if (virNetServerClientIsAuthPendingLocked(client)) { virNetServerClientSetAuthPendingLocked(client, false); @@ -824,8 +822,8 @@ virNetServerSetClientAuthCompletedLocked(virNetServerPtr srv, * the limits of @srv. */ void -virNetServerSetClientAuthenticated(virNetServerPtr srv, - virNetServerClientPtr client) +virNetServerSetClientAuthenticated(virNetServer *srv, + virNetServerClient *client) { virObjectLock(srv); virObjectLock(client); @@ -838,7 +836,7 @@ virNetServerSetClientAuthenticated(virNetServerPtr srv, static void -virNetServerUpdateServicesLocked(virNetServerPtr srv, +virNetServerUpdateServicesLocked(virNetServer *srv, bool enabled) { size_t i; @@ -848,7 +846,7 @@ virNetServerUpdateServicesLocked(virNetServerPtr srv, } -void virNetServerUpdateServices(virNetServerPtr srv, +void virNetServerUpdateServices(virNetServer *srv, bool enabled) { virObjectLock(srv); @@ -858,7 +856,7 @@ void virNetServerUpdateServices(virNetServerPtr srv, void virNetServerDispose(void *obj) { - virNetServerPtr srv = obj; + virNetServer *srv = obj; size_t i; g_free(srv->name); @@ -878,7 +876,7 @@ void virNetServerDispose(void *obj) g_free(srv->clients); } -void virNetServerClose(virNetServerPtr srv) +void virNetServerClose(virNetServer *srv) { size_t i; @@ -899,26 +897,26 @@ void virNetServerClose(virNetServerPtr srv) } void -virNetServerShutdownWait(virNetServerPtr srv) +virNetServerShutdownWait(virNetServer *srv) { virThreadPoolDrain(srv->workers); } static inline size_t -virNetServerTrackPendingAuthLocked(virNetServerPtr srv) +virNetServerTrackPendingAuthLocked(virNetServer *srv) { return ++srv->nclients_unauth; } static inline size_t -virNetServerTrackCompletedAuthLocked(virNetServerPtr srv) +virNetServerTrackCompletedAuthLocked(virNetServer *srv) { return --srv->nclients_unauth; } bool -virNetServerHasClients(virNetServerPtr srv) +virNetServerHasClients(virNetServer *srv) { bool ret; @@ -930,10 +928,10 @@ virNetServerHasClients(virNetServerPtr srv) } void -virNetServerProcessClients(virNetServerPtr srv) +virNetServerProcessClients(virNetServer *srv) { size_t i; - virNetServerClientPtr client; + virNetServerClient *client; virObjectLock(srv); @@ -971,13 +969,13 @@ virNetServerProcessClients(virNetServerPtr srv) } const char * -virNetServerGetName(virNetServerPtr srv) +virNetServerGetName(virNetServer *srv) { return srv->name; } int -virNetServerGetThreadPoolParameters(virNetServerPtr srv, +virNetServerGetThreadPoolParameters(virNetServer *srv, size_t *minWorkers, size_t *maxWorkers, size_t *nWorkers, @@ -999,7 +997,7 @@ virNetServerGetThreadPoolParameters(virNetServerPtr srv, } int -virNetServerSetThreadPoolParameters(virNetServerPtr srv, +virNetServerSetThreadPoolParameters(virNetServer *srv, long long int minWorkers, long long int maxWorkers, long long int prioWorkers) @@ -1015,7 +1013,7 @@ virNetServerSetThreadPoolParameters(virNetServerPtr srv, } size_t -virNetServerGetMaxClients(virNetServerPtr srv) +virNetServerGetMaxClients(virNetServer *srv) { size_t ret; @@ -1027,7 +1025,7 @@ virNetServerGetMaxClients(virNetServerPtr srv) } size_t -virNetServerGetCurrentClients(virNetServerPtr srv) +virNetServerGetCurrentClients(virNetServer *srv) { size_t ret; @@ -1039,7 +1037,7 @@ virNetServerGetCurrentClients(virNetServerPtr srv) } size_t -virNetServerGetMaxUnauthClients(virNetServerPtr srv) +virNetServerGetMaxUnauthClients(virNetServer *srv) { size_t ret; @@ -1051,7 +1049,7 @@ virNetServerGetMaxUnauthClients(virNetServerPtr srv) } size_t -virNetServerGetCurrentUnauthClients(virNetServerPtr srv) +virNetServerGetCurrentUnauthClients(virNetServer *srv) { size_t ret; @@ -1063,7 +1061,7 @@ virNetServerGetCurrentUnauthClients(virNetServerPtr srv) } -bool virNetServerNeedsAuth(virNetServerPtr srv, +bool virNetServerNeedsAuth(virNetServer *srv, int auth) { bool ret = false; @@ -1080,18 +1078,18 @@ bool virNetServerNeedsAuth(virNetServerPtr srv, } int -virNetServerGetClients(virNetServerPtr srv, - virNetServerClientPtr **clts) +virNetServerGetClients(virNetServer *srv, + virNetServerClient ***clts) { int ret = -1; size_t i; size_t nclients = 0; - virNetServerClientPtr *list = NULL; + virNetServerClient **list = NULL; virObjectLock(srv); for (i = 0; i < srv->nclients; i++) { - virNetServerClientPtr client = virObjectRef(srv->clients[i]); + virNetServerClient *client = virObjectRef(srv->clients[i]); if (VIR_APPEND_ELEMENT(list, nclients, client) < 0) { virObjectUnref(client); goto cleanup; @@ -1107,17 +1105,17 @@ virNetServerGetClients(virNetServerPtr srv, return ret; } -virNetServerClientPtr -virNetServerGetClient(virNetServerPtr srv, +virNetServerClient * +virNetServerGetClient(virNetServer *srv, unsigned long long id) { size_t i; - virNetServerClientPtr ret = NULL; + virNetServerClient *ret = NULL; virObjectLock(srv); for (i = 0; i < srv->nclients; i++) { - virNetServerClientPtr client = srv->clients[i]; + virNetServerClient *client = srv->clients[i]; if (virNetServerClientGetID(client) == id) ret = virObjectRef(client); } @@ -1131,7 +1129,7 @@ virNetServerGetClient(virNetServerPtr srv, } int -virNetServerSetClientLimits(virNetServerPtr srv, +virNetServerSetClientLimits(virNetServer *srv, long long int maxClients, long long int maxClientsUnauth) { @@ -1166,12 +1164,12 @@ virNetServerSetClientLimits(virNetServerPtr srv, return ret; } -static virNetTLSContextPtr -virNetServerGetTLSContext(virNetServerPtr srv) +static virNetTLSContext * +virNetServerGetTLSContext(virNetServer *srv) { size_t i; - virNetTLSContextPtr ctxt = NULL; - virNetServerServicePtr svc = NULL; + virNetTLSContext *ctxt = NULL; + virNetServerService *svc = NULL; /* find svcTLS from srv, get svcTLS->tls */ for (i = 0; i < srv->nservices; i++) { @@ -1185,10 +1183,10 @@ virNetServerGetTLSContext(virNetServerPtr srv) } int -virNetServerUpdateTlsFiles(virNetServerPtr srv) +virNetServerUpdateTlsFiles(virNetServer *srv) { int ret = -1; - virNetTLSContextPtr ctxt = NULL; + virNetTLSContext *ctxt = NULL; bool privileged = geteuid() == 0; ctxt = virNetServerGetTLSContext(srv); diff --git a/src/rpc/virnetserver.h b/src/rpc/virnetserver.h index 112a51d387..371f2d07cf 100644 --- a/src/rpc/virnetserver.h +++ b/src/rpc/virnetserver.h @@ -30,7 +30,7 @@ #include "virsystemd.h" -virNetServerPtr virNetServerNew(const char *name, +virNetServer *virNetServerNew(const char *name, unsigned long long next_client_id, size_t min_workers, size_t max_workers, @@ -45,7 +45,7 @@ virNetServerPtr virNetServerNew(const char *name, void *clientPrivOpaque) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(10) ATTRIBUTE_NONNULL(12); -virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, +virNetServer *virNetServerNewPostExecRestart(virJSONValue *object, const char *name, virNetServerClientPrivNew clientPrivNew, virNetServerClientPrivNewPostExecRestart clientPrivNewPostExecRestart, @@ -55,54 +55,54 @@ virNetServerPtr virNetServerNewPostExecRestart(virJSONValuePtr object, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6); -void virNetServerClose(virNetServerPtr srv); -void virNetServerShutdownWait(virNetServerPtr srv); +void virNetServerClose(virNetServer *srv); +void virNetServerShutdownWait(virNetServer *srv); -virJSONValuePtr virNetServerPreExecRestart(virNetServerPtr srv); +virJSONValue *virNetServerPreExecRestart(virNetServer *srv); -int virNetServerAddService(virNetServerPtr srv, - virNetServerServicePtr svc); -int virNetServerAddServiceTCP(virNetServerPtr srv, - virSystemdActivationPtr act, +int virNetServerAddService(virNetServer *srv, + virNetServerService *svc); +int virNetServerAddServiceTCP(virNetServer *srv, + virSystemdActivation *act, const char *actname, const char *nodename, const char *service, int family, int auth, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t max_queued_clients, size_t nrequests_client_max); -int virNetServerAddServiceUNIX(virNetServerPtr srv, - virSystemdActivationPtr act, +int virNetServerAddServiceUNIX(virNetServer *srv, + virSystemdActivation *act, const char *actname, const char *path, mode_t mask, gid_t grp, int auth, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t max_queued_clients, size_t nrequests_client_max); -int virNetServerAddProgram(virNetServerPtr srv, - virNetServerProgramPtr prog); +int virNetServerAddProgram(virNetServer *srv, + virNetServerProgram *prog); -int virNetServerSetTLSContext(virNetServerPtr srv, - virNetTLSContextPtr tls); +int virNetServerSetTLSContext(virNetServer *srv, + virNetTLSContext *tls); -int virNetServerAddClient(virNetServerPtr srv, - virNetServerClientPtr client); -bool virNetServerHasClients(virNetServerPtr srv); -void virNetServerProcessClients(virNetServerPtr srv); -void virNetServerSetClientAuthenticated(virNetServerPtr srv, virNetServerClientPtr client); +int virNetServerAddClient(virNetServer *srv, + virNetServerClient *client); +bool virNetServerHasClients(virNetServer *srv); +void virNetServerProcessClients(virNetServer *srv); +void virNetServerSetClientAuthenticated(virNetServer *srv, virNetServerClient *client); -void virNetServerUpdateServices(virNetServerPtr srv, bool enabled); +void virNetServerUpdateServices(virNetServer *srv, bool enabled); -const char *virNetServerGetName(virNetServerPtr srv); +const char *virNetServerGetName(virNetServer *srv); -int virNetServerGetThreadPoolParameters(virNetServerPtr srv, +int virNetServerGetThreadPoolParameters(virNetServer *srv, size_t *minWorkers, size_t *maxWorkers, size_t *nWorkers, @@ -110,29 +110,29 @@ int virNetServerGetThreadPoolParameters(virNetServerPtr srv, size_t *nPrioWorkers, size_t *jobQueueDepth); -int virNetServerSetThreadPoolParameters(virNetServerPtr srv, +int virNetServerSetThreadPoolParameters(virNetServer *srv, long long int minWorkers, long long int maxWorkers, long long int prioWorkers); -unsigned long long virNetServerNextClientID(virNetServerPtr srv); +unsigned long long virNetServerNextClientID(virNetServer *srv); -virNetServerClientPtr virNetServerGetClient(virNetServerPtr srv, +virNetServerClient *virNetServerGetClient(virNetServer *srv, unsigned long long id); -bool virNetServerNeedsAuth(virNetServerPtr srv, +bool virNetServerNeedsAuth(virNetServer *srv, int auth); -int virNetServerGetClients(virNetServerPtr srv, - virNetServerClientPtr **clients); +int virNetServerGetClients(virNetServer *srv, + virNetServerClient ***clients); -size_t virNetServerGetMaxClients(virNetServerPtr srv); -size_t virNetServerGetCurrentClients(virNetServerPtr srv); -size_t virNetServerGetMaxUnauthClients(virNetServerPtr srv); -size_t virNetServerGetCurrentUnauthClients(virNetServerPtr srv); +size_t virNetServerGetMaxClients(virNetServer *srv); +size_t virNetServerGetCurrentClients(virNetServer *srv); +size_t virNetServerGetMaxUnauthClients(virNetServer *srv); +size_t virNetServerGetCurrentUnauthClients(virNetServer *srv); -int virNetServerSetClientLimits(virNetServerPtr srv, +int virNetServerSetClientLimits(virNetServer *srv, long long int maxClients, long long int maxClientsUnauth); -int virNetServerUpdateTlsFiles(virNetServerPtr srv); +int virNetServerUpdateTlsFiles(virNetServer *srv); diff --git a/src/rpc/virnetserverclient.c b/src/rpc/virnetserverclient.c index c443673eab..236702ced6 100644 --- a/src/rpc/virnetserverclient.c +++ b/src/rpc/virnetserverclient.c @@ -49,14 +49,12 @@ VIR_LOG_INIT("rpc.netserverclient"); */ typedef struct _virNetServerClientFilter virNetServerClientFilter; -typedef virNetServerClientFilter *virNetServerClientFilterPtr; - struct _virNetServerClientFilter { int id; virNetServerClientFilterFunc func; void *opaque; - virNetServerClientFilterPtr next; + virNetServerClientFilter *next; }; @@ -67,20 +65,20 @@ struct _virNetServerClient unsigned long long id; bool wantClose; bool delayedClose; - virNetSocketPtr sock; + virNetSocket *sock; int auth; bool auth_pending; bool readonly; - virNetTLSContextPtr tlsCtxt; - virNetTLSSessionPtr tls; + virNetTLSContext *tlsCtxt; + virNetTLSSession *tls; #if WITH_SASL - virNetSASLSessionPtr sasl; + virNetSASLSession *sasl; #endif int sockTimer; /* Timer to be fired upon cached data, * so we jump out from poll() immediately */ - virIdentityPtr identity; + virIdentity *identity; /* Connection timestamp, i.e. when a client connected to the daemon (UTC). * For old clients restored by post-exec-restart, which did not have this @@ -98,14 +96,14 @@ struct _virNetServerClient size_t nrequests_max; /* Zero or one messages being received. Zero if * nrequests >= max_clients and throttling */ - virNetMessagePtr rx; + virNetMessage *rx; /* Zero or many messages waiting for transmit * back to client, including async events */ - virNetMessagePtr tx; + virNetMessage *tx; /* Filters to capture messages that would otherwise * end up on the 'dx' queue */ - virNetServerClientFilterPtr filters; + virNetServerClientFilter *filters; int nextFilterID; virNetServerClientDispatchFunc dispatchFunc; @@ -116,11 +114,11 @@ struct _virNetServerClient virNetServerClientPrivPreExecRestart privateDataPreExecRestart; virNetServerClientCloseFunc privateDataCloseFunc; - virKeepAlivePtr keepalive; + virKeepAlive *keepalive; }; -static virClassPtr virNetServerClientClass; +static virClass *virNetServerClientClass; static void virNetServerClientDispose(void *obj); static int virNetServerClientOnceInit(void) @@ -134,17 +132,17 @@ static int virNetServerClientOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNetServerClient); -static void virNetServerClientDispatchEvent(virNetSocketPtr sock, int events, void *opaque); -static void virNetServerClientUpdateEvent(virNetServerClientPtr client); -static virNetMessagePtr virNetServerClientDispatchRead(virNetServerClientPtr client); -static int virNetServerClientSendMessageLocked(virNetServerClientPtr client, - virNetMessagePtr msg); +static void virNetServerClientDispatchEvent(virNetSocket *sock, int events, void *opaque); +static void virNetServerClientUpdateEvent(virNetServerClient *client); +static virNetMessage *virNetServerClientDispatchRead(virNetServerClient *client); +static int virNetServerClientSendMessageLocked(virNetServerClient *client, + virNetMessage *msg); /* * @client: a locked client object */ static int -virNetServerClientCalculateHandleMode(virNetServerClientPtr client) +virNetServerClientCalculateHandleMode(virNetServerClient *client) { int mode = 0; @@ -192,7 +190,7 @@ virNetServerClientCalculateHandleMode(virNetServerClientPtr client) * @server: a locked or unlocked server object * @client: a locked client object */ -static int virNetServerClientRegisterEvent(virNetServerClientPtr client) +static int virNetServerClientRegisterEvent(virNetServerClient *client) { int mode = virNetServerClientCalculateHandleMode(client); @@ -216,7 +214,7 @@ static int virNetServerClientRegisterEvent(virNetServerClientPtr client) /* * @client: a locked client object */ -static void virNetServerClientUpdateEvent(virNetServerClientPtr client) +static void virNetServerClientUpdateEvent(virNetServerClient *client) { int mode; @@ -232,12 +230,12 @@ static void virNetServerClientUpdateEvent(virNetServerClientPtr client) } -int virNetServerClientAddFilter(virNetServerClientPtr client, +int virNetServerClientAddFilter(virNetServerClient *client, virNetServerClientFilterFunc func, void *opaque) { - virNetServerClientFilterPtr filter; - virNetServerClientFilterPtr *place; + virNetServerClientFilter *filter; + virNetServerClientFilter **place; int ret; filter = g_new0(virNetServerClientFilter, 1); @@ -260,11 +258,11 @@ int virNetServerClientAddFilter(virNetServerClientPtr client, return ret; } -void virNetServerClientRemoveFilter(virNetServerClientPtr client, +void virNetServerClientRemoveFilter(virNetServerClient *client, int filterID) { - virNetServerClientFilterPtr tmp; - virNetServerClientFilterPtr prev; + virNetServerClientFilter *tmp; + virNetServerClientFilter *prev; virObjectLock(client); @@ -290,9 +288,9 @@ void virNetServerClientRemoveFilter(virNetServerClientPtr client, /* Check the client's access. */ static int -virNetServerClientCheckAccess(virNetServerClientPtr client) +virNetServerClientCheckAccess(virNetServerClient *client) { - virNetMessagePtr confirm; + virNetMessage *confirm; /* Verify client certificate. */ if (virNetTLSContextCheckCertificate(client->tlsCtxt, client->tls) < 0) @@ -321,8 +319,8 @@ virNetServerClientCheckAccess(virNetServerClientPtr client) } -static void virNetServerClientDispatchMessage(virNetServerClientPtr client, - virNetMessagePtr msg) +static void virNetServerClientDispatchMessage(virNetServerClient *client, + virNetMessage *msg) { virObjectLock(client); if (!client->dispatchFunc) { @@ -343,8 +341,8 @@ static void virNetServerClientDispatchMessage(virNetServerClientPtr client, static void virNetServerClientSockTimerFunc(int timer, void *opaque) { - virNetServerClientPtr client = opaque; - virNetMessagePtr msg = NULL; + virNetServerClient *client = opaque; + virNetMessage *msg = NULL; virObjectLock(client); virEventUpdateTimeout(timer, -1); /* Although client->rx != NULL when this timer is enabled, it might have @@ -375,17 +373,17 @@ virNetServerClientAuthMethodImpliesAuthenticated(int auth) } -static virNetServerClientPtr +static virNetServerClient * virNetServerClientNewInternal(unsigned long long id, - virNetSocketPtr sock, + virNetSocket *sock, int auth, bool auth_pending, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t nrequests_max, long long timestamp) { - virNetServerClientPtr client; + virNetServerClient *client; if (virNetServerClientInitialize() < 0) return NULL; @@ -426,18 +424,18 @@ virNetServerClientNewInternal(unsigned long long id, } -virNetServerClientPtr virNetServerClientNew(unsigned long long id, - virNetSocketPtr sock, +virNetServerClient *virNetServerClientNew(unsigned long long id, + virNetSocket *sock, int auth, bool readonly, size_t nrequests_max, - virNetTLSContextPtr tls, + virNetTLSContext *tls, virNetServerClientPrivNew privNew, virNetServerClientPrivPreExecRestart privPreExecRestart, virFreeCallback privFree, void *privOpaque) { - virNetServerClientPtr client; + virNetServerClient *client; time_t now; bool auth_pending = !virNetServerClientAuthMethodImpliesAuthenticated(auth); @@ -464,16 +462,16 @@ virNetServerClientPtr virNetServerClientNew(unsigned long long id, } -virNetServerClientPtr virNetServerClientNewPostExecRestart(virNetServerPtr srv, - virJSONValuePtr object, +virNetServerClient *virNetServerClientNewPostExecRestart(virNetServer *srv, + virJSONValue *object, virNetServerClientPrivNewPostExecRestart privNew, virNetServerClientPrivPreExecRestart privPreExecRestart, virFreeCallback privFree, void *privOpaque) { - virJSONValuePtr child; - virNetServerClientPtr client = NULL; - virNetSocketPtr sock; + virJSONValue *child; + virNetServerClient *client = NULL; + virNetSocket *sock; int auth; bool readonly, auth_pending; unsigned int nrequests_max; @@ -584,7 +582,7 @@ virNetServerClientPtr virNetServerClientNewPostExecRestart(virNetServerPtr srv, } -virJSONValuePtr virNetServerClientPreExecRestart(virNetServerClientPtr client) +virJSONValue *virNetServerClientPreExecRestart(virNetServerClient *client) { g_autoptr(virJSONValue) object = virJSONValueNewObject(); g_autoptr(virJSONValue) sock = NULL; @@ -629,7 +627,7 @@ virJSONValuePtr virNetServerClientPreExecRestart(virNetServerClientPtr client) } -int virNetServerClientGetAuth(virNetServerClientPtr client) +int virNetServerClientGetAuth(virNetServerClient *client) { int auth; virObjectLock(client); @@ -640,14 +638,14 @@ int virNetServerClientGetAuth(virNetServerClientPtr client) void -virNetServerClientSetAuthLocked(virNetServerClientPtr client, +virNetServerClientSetAuthLocked(virNetServerClient *client, int auth) { client->auth = auth; } -bool virNetServerClientGetReadonly(virNetServerClientPtr client) +bool virNetServerClientGetReadonly(virNetServerClient *client) { bool readonly; virObjectLock(client); @@ -658,7 +656,7 @@ bool virNetServerClientGetReadonly(virNetServerClientPtr client) void -virNetServerClientSetReadonly(virNetServerClientPtr client, +virNetServerClientSetReadonly(virNetServerClient *client, bool readonly) { virObjectLock(client); @@ -667,17 +665,17 @@ virNetServerClientSetReadonly(virNetServerClientPtr client, } -unsigned long long virNetServerClientGetID(virNetServerClientPtr client) +unsigned long long virNetServerClientGetID(virNetServerClient *client) { return client->id; } -long long virNetServerClientGetTimestamp(virNetServerClientPtr client) +long long virNetServerClientGetTimestamp(virNetServerClient *client) { return client->conn_time; } -bool virNetServerClientHasTLSSession(virNetServerClientPtr client) +bool virNetServerClientHasTLSSession(virNetServerClient *client) { bool has; virObjectLock(client); @@ -687,16 +685,16 @@ bool virNetServerClientHasTLSSession(virNetServerClientPtr client) } -virNetTLSSessionPtr virNetServerClientGetTLSSession(virNetServerClientPtr client) +virNetTLSSession *virNetServerClientGetTLSSession(virNetServerClient *client) { - virNetTLSSessionPtr tls; + virNetTLSSession *tls; virObjectLock(client); tls = client->tls; virObjectUnlock(client); return tls; } -int virNetServerClientGetTLSKeySize(virNetServerClientPtr client) +int virNetServerClientGetTLSKeySize(virNetServerClient *client) { int size = 0; virObjectLock(client); @@ -706,7 +704,7 @@ int virNetServerClientGetTLSKeySize(virNetServerClientPtr client) return size; } -int virNetServerClientGetFD(virNetServerClientPtr client) +int virNetServerClientGetFD(virNetServerClient *client) { int fd = -1; virObjectLock(client); @@ -717,7 +715,7 @@ int virNetServerClientGetFD(virNetServerClientPtr client) } -bool virNetServerClientIsLocal(virNetServerClientPtr client) +bool virNetServerClientIsLocal(virNetServerClient *client) { bool local = false; virObjectLock(client); @@ -728,7 +726,7 @@ bool virNetServerClientIsLocal(virNetServerClientPtr client) } -int virNetServerClientGetUNIXIdentity(virNetServerClientPtr client, +int virNetServerClientGetUNIXIdentity(virNetServerClient *client, uid_t *uid, gid_t *gid, pid_t *pid, unsigned long long *timestamp) { @@ -743,8 +741,8 @@ int virNetServerClientGetUNIXIdentity(virNetServerClientPtr client, } -static virIdentityPtr -virNetServerClientCreateIdentity(virNetServerClientPtr client) +static virIdentity * +virNetServerClientCreateIdentity(virNetServerClient *client) { g_autofree char *username = NULL; g_autofree char *groupname = NULL; @@ -809,9 +807,9 @@ virNetServerClientCreateIdentity(virNetServerClientPtr client) } -virIdentityPtr virNetServerClientGetIdentity(virNetServerClientPtr client) +virIdentity *virNetServerClientGetIdentity(virNetServerClient *client) { - virIdentityPtr ret = NULL; + virIdentity *ret = NULL; virObjectLock(client); if (!client->identity) client->identity = virNetServerClientCreateIdentity(client); @@ -822,8 +820,8 @@ virIdentityPtr virNetServerClientGetIdentity(virNetServerClientPtr client) } -void virNetServerClientSetIdentity(virNetServerClientPtr client, - virIdentityPtr identity) +void virNetServerClientSetIdentity(virNetServerClient *client, + virIdentity *identity) { virObjectLock(client); g_clear_object(&client->identity); @@ -834,7 +832,7 @@ void virNetServerClientSetIdentity(virNetServerClientPtr client, } -int virNetServerClientGetSELinuxContext(virNetServerClientPtr client, +int virNetServerClientGetSELinuxContext(virNetServerClient *client, char **context) { int ret = 0; @@ -847,7 +845,7 @@ int virNetServerClientGetSELinuxContext(virNetServerClientPtr client, } -bool virNetServerClientIsSecure(virNetServerClientPtr client) +bool virNetServerClientIsSecure(virNetServerClient *client) { bool secure = false; virObjectLock(client); @@ -865,8 +863,8 @@ bool virNetServerClientIsSecure(virNetServerClientPtr client) #if WITH_SASL -void virNetServerClientSetSASLSession(virNetServerClientPtr client, - virNetSASLSessionPtr sasl) +void virNetServerClientSetSASLSession(virNetServerClient *client, + virNetSASLSession *sasl) { /* We don't set the sasl session on the socket here * because we need to send out the auth confirmation @@ -879,16 +877,16 @@ void virNetServerClientSetSASLSession(virNetServerClientPtr client, } -virNetSASLSessionPtr virNetServerClientGetSASLSession(virNetServerClientPtr client) +virNetSASLSession *virNetServerClientGetSASLSession(virNetServerClient *client) { - virNetSASLSessionPtr sasl; + virNetSASLSession *sasl; virObjectLock(client); sasl = client->sasl; virObjectUnlock(client); return sasl; } -bool virNetServerClientHasSASLSession(virNetServerClientPtr client) +bool virNetServerClientHasSASLSession(virNetServerClient *client) { bool has = false; virObjectLock(client); @@ -899,7 +897,7 @@ bool virNetServerClientHasSASLSession(virNetServerClientPtr client) #endif -void *virNetServerClientGetPrivateData(virNetServerClientPtr client) +void *virNetServerClientGetPrivateData(virNetServerClient *client) { void *data; virObjectLock(client); @@ -909,7 +907,7 @@ void *virNetServerClientGetPrivateData(virNetServerClientPtr client) } -void virNetServerClientSetCloseHook(virNetServerClientPtr client, +void virNetServerClientSetCloseHook(virNetServerClient *client, virNetServerClientCloseFunc cf) { virObjectLock(client); @@ -918,7 +916,7 @@ void virNetServerClientSetCloseHook(virNetServerClientPtr client, } -void virNetServerClientSetDispatcher(virNetServerClientPtr client, +void virNetServerClientSetDispatcher(virNetServerClient *client, virNetServerClientDispatchFunc func, void *opaque) { @@ -934,7 +932,7 @@ void virNetServerClientSetDispatcher(virNetServerClientPtr client, } -const char *virNetServerClientLocalAddrStringSASL(virNetServerClientPtr client) +const char *virNetServerClientLocalAddrStringSASL(virNetServerClient *client) { if (!client->sock) return NULL; @@ -942,14 +940,14 @@ const char *virNetServerClientLocalAddrStringSASL(virNetServerClientPtr client) } -const char *virNetServerClientRemoteAddrStringSASL(virNetServerClientPtr client) +const char *virNetServerClientRemoteAddrStringSASL(virNetServerClient *client) { if (!client->sock) return NULL; return virNetSocketRemoteAddrStringSASL(client->sock); } -const char *virNetServerClientRemoteAddrStringURI(virNetServerClientPtr client) +const char *virNetServerClientRemoteAddrStringURI(virNetServerClient *client) { if (!client->sock) return NULL; @@ -958,7 +956,7 @@ const char *virNetServerClientRemoteAddrStringURI(virNetServerClientPtr client) void virNetServerClientDispose(void *obj) { - virNetServerClientPtr client = obj; + virNetServerClient *client = obj; PROBE(RPC_SERVER_CLIENT_DISPOSE, "client=%p", client); @@ -988,10 +986,10 @@ void virNetServerClientDispose(void *obj) * where it can be guaranteed it is no longer in use */ void -virNetServerClientCloseLocked(virNetServerClientPtr client) +virNetServerClientCloseLocked(virNetServerClient *client) { virNetServerClientCloseFunc cf; - virKeepAlivePtr ka; + virKeepAlive *ka; VIR_DEBUG("client=%p", client); if (!client->sock) @@ -1029,12 +1027,12 @@ virNetServerClientCloseLocked(virNetServerClientPtr client) client->wantClose = true; while (client->rx) { - virNetMessagePtr msg + virNetMessage *msg = virNetMessageQueueServe(&client->rx); virNetMessageFree(msg); } while (client->tx) { - virNetMessagePtr msg + virNetMessage *msg = virNetMessageQueueServe(&client->tx); virNetMessageFree(msg); } @@ -1047,7 +1045,7 @@ virNetServerClientCloseLocked(virNetServerClientPtr client) void -virNetServerClientClose(virNetServerClientPtr client) +virNetServerClientClose(virNetServerClient *client) { virObjectLock(client); virNetServerClientCloseLocked(client); @@ -1056,20 +1054,20 @@ virNetServerClientClose(virNetServerClientPtr client) bool -virNetServerClientIsClosedLocked(virNetServerClientPtr client) +virNetServerClientIsClosedLocked(virNetServerClient *client) { return client->sock == NULL; } -void virNetServerClientDelayedClose(virNetServerClientPtr client) +void virNetServerClientDelayedClose(virNetServerClient *client) { virObjectLock(client); client->delayedClose = true; virObjectUnlock(client); } -void virNetServerClientImmediateClose(virNetServerClientPtr client) +void virNetServerClientImmediateClose(virNetServerClient *client) { virObjectLock(client); client->wantClose = true; @@ -1078,13 +1076,13 @@ void virNetServerClientImmediateClose(virNetServerClientPtr client) bool -virNetServerClientWantCloseLocked(virNetServerClientPtr client) +virNetServerClientWantCloseLocked(virNetServerClient *client) { return client->wantClose; } -int virNetServerClientInit(virNetServerClientPtr client) +int virNetServerClientInit(virNetServerClient *client) { virObjectLock(client); @@ -1142,7 +1140,7 @@ int virNetServerClientInit(virNetServerClientPtr client) * 0 on EAGAIN * n number of bytes */ -static ssize_t virNetServerClientRead(virNetServerClientPtr client) +static ssize_t virNetServerClientRead(virNetServerClient *client) { ssize_t ret; @@ -1175,7 +1173,7 @@ static ssize_t virNetServerClientRead(virNetServerClientPtr client) * yet available, or an error occurred. On error, the wantClose * flag will be set. */ -static virNetMessagePtr virNetServerClientDispatchRead(virNetServerClientPtr client) +static virNetMessage *virNetServerClientDispatchRead(virNetServerClient *client) { readmore: if (client->rx->nfds == 0) { @@ -1203,9 +1201,9 @@ static virNetMessagePtr virNetServerClientDispatchRead(virNetServerClientPtr cli goto readmore; } else { /* Grab the completed message */ - virNetMessagePtr msg = client->rx; - virNetMessagePtr response = NULL; - virNetServerClientFilterPtr filter; + virNetMessage *msg = client->rx; + virNetMessage *response = NULL; + virNetServerClientFilter *filter; size_t i; /* Decode the header so we can use it for routing decisions */ @@ -1314,7 +1312,7 @@ static virNetMessagePtr virNetServerClientDispatchRead(virNetServerClientPtr cli * 0 on EAGAIN * n number of bytes */ -static ssize_t virNetServerClientWrite(virNetServerClientPtr client) +static ssize_t virNetServerClientWrite(virNetServerClient *client) { ssize_t ret; @@ -1345,7 +1343,7 @@ static ssize_t virNetServerClientWrite(virNetServerClientPtr client) * we would block on I/O */ static void -virNetServerClientDispatchWrite(virNetServerClientPtr client) +virNetServerClientDispatchWrite(virNetServerClient *client) { while (client->tx) { if (client->tx->bufferOffset < client->tx->bufferLength) { @@ -1360,7 +1358,7 @@ virNetServerClientDispatchWrite(virNetServerClientPtr client) } if (client->tx->bufferOffset == client->tx->bufferLength) { - virNetMessagePtr msg; + virNetMessage *msg; size_t i; for (i = client->tx->donefds; i < client->tx->nfds; i++) { @@ -1414,7 +1412,7 @@ virNetServerClientDispatchWrite(virNetServerClientPtr client) static void -virNetServerClientDispatchHandshake(virNetServerClientPtr client) +virNetServerClientDispatchHandshake(virNetServerClient *client) { int ret; /* Continue the handshake. */ @@ -1440,10 +1438,10 @@ virNetServerClientDispatchHandshake(virNetServerClientPtr client) static void -virNetServerClientDispatchEvent(virNetSocketPtr sock, int events, void *opaque) +virNetServerClientDispatchEvent(virNetSocket *sock, int events, void *opaque) { - virNetServerClientPtr client = opaque; - virNetMessagePtr msg = NULL; + virNetServerClient *client = opaque; + virNetMessage *msg = NULL; virObjectLock(client); @@ -1482,8 +1480,8 @@ virNetServerClientDispatchEvent(virNetSocketPtr sock, int events, void *opaque) static int -virNetServerClientSendMessageLocked(virNetServerClientPtr client, - virNetMessagePtr msg) +virNetServerClientSendMessageLocked(virNetServerClient *client, + virNetMessage *msg) { int ret = -1; VIR_DEBUG("msg=%p proc=%d len=%zu offset=%zu", @@ -1506,8 +1504,8 @@ virNetServerClientSendMessageLocked(virNetServerClientPtr client, return ret; } -int virNetServerClientSendMessage(virNetServerClientPtr client, - virNetMessagePtr msg) +int virNetServerClientSendMessage(virNetServerClient *client, + virNetMessage *msg) { int ret; @@ -1520,7 +1518,7 @@ int virNetServerClientSendMessage(virNetServerClientPtr client, bool -virNetServerClientIsAuthenticated(virNetServerClientPtr client) +virNetServerClientIsAuthenticated(virNetServerClient *client) { bool authenticated; virObjectLock(client); @@ -1532,7 +1530,7 @@ virNetServerClientIsAuthenticated(virNetServerClientPtr client) /* The caller must hold the lock for @client */ void -virNetServerClientSetAuthPendingLocked(virNetServerClientPtr client, +virNetServerClientSetAuthPendingLocked(virNetServerClient *client, bool auth_pending) { client->auth_pending = auth_pending; @@ -1541,7 +1539,7 @@ virNetServerClientSetAuthPendingLocked(virNetServerClientPtr client, /* The caller must hold the lock for @client */ bool -virNetServerClientIsAuthPendingLocked(virNetServerClientPtr client) +virNetServerClientIsAuthPendingLocked(virNetServerClient *client) { return client->auth_pending; } @@ -1555,18 +1553,18 @@ virNetServerClientKeepAliveDeadCB(void *opaque) static int virNetServerClientKeepAliveSendCB(void *opaque, - virNetMessagePtr msg) + virNetMessage *msg) { return virNetServerClientSendMessage(opaque, msg); } int -virNetServerClientInitKeepAlive(virNetServerClientPtr client, +virNetServerClientInitKeepAlive(virNetServerClient *client, int interval, unsigned int count) { - virKeepAlivePtr ka; + virKeepAlive *ka; int ret = -1; virObjectLock(client); @@ -1588,7 +1586,7 @@ virNetServerClientInitKeepAlive(virNetServerClientPtr client, } int -virNetServerClientStartKeepAlive(virNetServerClientPtr client) +virNetServerClientStartKeepAlive(virNetServerClient *client) { int ret = -1; @@ -1611,7 +1609,7 @@ virNetServerClientStartKeepAlive(virNetServerClientPtr client) } int -virNetServerClientGetTransport(virNetServerClientPtr client) +virNetServerClientGetTransport(virNetServerClient *client) { int ret = -1; @@ -1631,9 +1629,9 @@ virNetServerClientGetTransport(virNetServerClientPtr client) } int -virNetServerClientGetInfo(virNetServerClientPtr client, +virNetServerClientGetInfo(virNetServerClient *client, bool *readonly, char **sock_addr, - virIdentityPtr *identity) + virIdentity **identity) { int ret = -1; const char *addr; @@ -1671,7 +1669,7 @@ virNetServerClientGetInfo(virNetServerClientPtr client, * socket rather than calling an API to close it. */ void -virNetServerClientSetQuietEOF(virNetServerClientPtr client) +virNetServerClientSetQuietEOF(virNetServerClient *client) { virNetSocketSetQuietEOF(client->sock); } diff --git a/src/rpc/virnetserverclient.h b/src/rpc/virnetserverclient.h index 7a3061d1ae..a9d0afe95a 100644 --- a/src/rpc/virnetserverclient.h +++ b/src/rpc/virnetserverclient.h @@ -28,56 +28,54 @@ #include "virjson.h" typedef struct _virNetServer virNetServer; -typedef virNetServer *virNetServerPtr; typedef struct _virNetServerClient virNetServerClient; -typedef virNetServerClient *virNetServerClientPtr; /* This function owns the "msg" pointer it is passed and * must arrange for virNetMessageFree to be called on it */ -typedef void (*virNetServerClientDispatchFunc)(virNetServerClientPtr client, - virNetMessagePtr msg, +typedef void (*virNetServerClientDispatchFunc)(virNetServerClient *client, + virNetMessage *msg, void *opaque); /* * @client is locked when this callback is called */ -typedef int (*virNetServerClientFilterFunc)(virNetServerClientPtr client, - virNetMessagePtr msg, +typedef int (*virNetServerClientFilterFunc)(virNetServerClient *client, + virNetMessage *msg, void *opaque); /* * @data: value allocated by virNetServerClintPrivNew(PostExecRestart) callback */ -typedef virJSONValuePtr (*virNetServerClientPrivPreExecRestart)(virNetServerClientPtr client, +typedef virJSONValue *(*virNetServerClientPrivPreExecRestart)(virNetServerClient *client, void *data); /* * @opaque: value of @privOpaque from virNetServerClientNewPostExecRestart */ -typedef void *(*virNetServerClientPrivNewPostExecRestart)(virNetServerClientPtr client, - virJSONValuePtr object, +typedef void *(*virNetServerClientPrivNewPostExecRestart)(virNetServerClient *client, + virJSONValue *object, void *opaque); /* * @opaque: value of @privOpaque from virNetServerClientNew */ -typedef void *(*virNetServerClientPrivNew)(virNetServerClientPtr client, +typedef void *(*virNetServerClientPrivNew)(virNetServerClient *client, void *opaque); -virNetServerClientPtr virNetServerClientNew(unsigned long long id, - virNetSocketPtr sock, +virNetServerClient *virNetServerClientNew(unsigned long long id, + virNetSocket *sock, int auth, bool readonly, size_t nrequests_max, - virNetTLSContextPtr tls, + virNetTLSContext *tls, virNetServerClientPrivNew privNew, virNetServerClientPrivPreExecRestart privPreExecRestart, virFreeCallback privFree, void *privOpaque) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(7) ATTRIBUTE_NONNULL(9); -virNetServerClientPtr virNetServerClientNewPostExecRestart(virNetServerPtr srv, - virJSONValuePtr object, +virNetServerClient *virNetServerClientNewPostExecRestart(virNetServer *srv, + virJSONValue *object, virNetServerClientPrivNewPostExecRestart privNew, virNetServerClientPrivPreExecRestart privPreExecRestart, virFreeCallback privFree, @@ -85,91 +83,91 @@ virNetServerClientPtr virNetServerClientNewPostExecRestart(virNetServerPtr srv, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5); -virJSONValuePtr virNetServerClientPreExecRestart(virNetServerClientPtr client); +virJSONValue *virNetServerClientPreExecRestart(virNetServerClient *client); -int virNetServerClientAddFilter(virNetServerClientPtr client, +int virNetServerClientAddFilter(virNetServerClient *client, virNetServerClientFilterFunc func, void *opaque); -void virNetServerClientRemoveFilter(virNetServerClientPtr client, +void virNetServerClientRemoveFilter(virNetServerClient *client, int filterID); -int virNetServerClientGetAuth(virNetServerClientPtr client); -void virNetServerClientSetAuthLocked(virNetServerClientPtr client, int auth); -bool virNetServerClientGetReadonly(virNetServerClientPtr client); -void virNetServerClientSetReadonly(virNetServerClientPtr client, bool readonly); -unsigned long long virNetServerClientGetID(virNetServerClientPtr client); -long long virNetServerClientGetTimestamp(virNetServerClientPtr client); +int virNetServerClientGetAuth(virNetServerClient *client); +void virNetServerClientSetAuthLocked(virNetServerClient *client, int auth); +bool virNetServerClientGetReadonly(virNetServerClient *client); +void virNetServerClientSetReadonly(virNetServerClient *client, bool readonly); +unsigned long long virNetServerClientGetID(virNetServerClient *client); +long long virNetServerClientGetTimestamp(virNetServerClient *client); -bool virNetServerClientHasTLSSession(virNetServerClientPtr client); -virNetTLSSessionPtr virNetServerClientGetTLSSession(virNetServerClientPtr client); -int virNetServerClientGetTLSKeySize(virNetServerClientPtr client); +bool virNetServerClientHasTLSSession(virNetServerClient *client); +virNetTLSSession *virNetServerClientGetTLSSession(virNetServerClient *client); +int virNetServerClientGetTLSKeySize(virNetServerClient *client); #ifdef WITH_SASL -bool virNetServerClientHasSASLSession(virNetServerClientPtr client); -void virNetServerClientSetSASLSession(virNetServerClientPtr client, - virNetSASLSessionPtr sasl); -virNetSASLSessionPtr virNetServerClientGetSASLSession(virNetServerClientPtr client); +bool virNetServerClientHasSASLSession(virNetServerClient *client); +void virNetServerClientSetSASLSession(virNetServerClient *client, + virNetSASLSession *sasl); +virNetSASLSession *virNetServerClientGetSASLSession(virNetServerClient *client); #endif -int virNetServerClientGetFD(virNetServerClientPtr client); +int virNetServerClientGetFD(virNetServerClient *client); -bool virNetServerClientIsSecure(virNetServerClientPtr client); +bool virNetServerClientIsSecure(virNetServerClient *client); -bool virNetServerClientIsLocal(virNetServerClientPtr client); +bool virNetServerClientIsLocal(virNetServerClient *client); -int virNetServerClientGetUNIXIdentity(virNetServerClientPtr client, +int virNetServerClientGetUNIXIdentity(virNetServerClient *client, uid_t *uid, gid_t *gid, pid_t *pid, unsigned long long *timestamp); -int virNetServerClientGetSELinuxContext(virNetServerClientPtr client, +int virNetServerClientGetSELinuxContext(virNetServerClient *client, char **context); -virIdentityPtr virNetServerClientGetIdentity(virNetServerClientPtr client); -void virNetServerClientSetIdentity(virNetServerClientPtr client, - virIdentityPtr identity); +virIdentity *virNetServerClientGetIdentity(virNetServerClient *client); +void virNetServerClientSetIdentity(virNetServerClient *client, + virIdentity *identity); -void *virNetServerClientGetPrivateData(virNetServerClientPtr client); +void *virNetServerClientGetPrivateData(virNetServerClient *client); -typedef void (*virNetServerClientCloseFunc)(virNetServerClientPtr client); +typedef void (*virNetServerClientCloseFunc)(virNetServerClient *client); -void virNetServerClientSetCloseHook(virNetServerClientPtr client, +void virNetServerClientSetCloseHook(virNetServerClient *client, virNetServerClientCloseFunc cf); -void virNetServerClientSetDispatcher(virNetServerClientPtr client, +void virNetServerClientSetDispatcher(virNetServerClient *client, virNetServerClientDispatchFunc func, void *opaque); -void virNetServerClientClose(virNetServerClientPtr client); -void virNetServerClientCloseLocked(virNetServerClientPtr client); -bool virNetServerClientIsClosedLocked(virNetServerClientPtr client); +void virNetServerClientClose(virNetServerClient *client); +void virNetServerClientCloseLocked(virNetServerClient *client); +bool virNetServerClientIsClosedLocked(virNetServerClient *client); -void virNetServerClientDelayedClose(virNetServerClientPtr client); -void virNetServerClientImmediateClose(virNetServerClientPtr client); -bool virNetServerClientWantCloseLocked(virNetServerClientPtr client); +void virNetServerClientDelayedClose(virNetServerClient *client); +void virNetServerClientImmediateClose(virNetServerClient *client); +bool virNetServerClientWantCloseLocked(virNetServerClient *client); -int virNetServerClientInit(virNetServerClientPtr client); +int virNetServerClientInit(virNetServerClient *client); -int virNetServerClientInitKeepAlive(virNetServerClientPtr client, +int virNetServerClientInitKeepAlive(virNetServerClient *client, int interval, unsigned int count); -bool virNetServerClientCheckKeepAlive(virNetServerClientPtr client, - virNetMessagePtr msg); -int virNetServerClientStartKeepAlive(virNetServerClientPtr client); +bool virNetServerClientCheckKeepAlive(virNetServerClient *client, + virNetMessage *msg); +int virNetServerClientStartKeepAlive(virNetServerClient *client); -const char *virNetServerClientLocalAddrStringSASL(virNetServerClientPtr client); -const char *virNetServerClientRemoteAddrStringSASL(virNetServerClientPtr client); -const char *virNetServerClientRemoteAddrStringURI(virNetServerClientPtr client); +const char *virNetServerClientLocalAddrStringSASL(virNetServerClient *client); +const char *virNetServerClientRemoteAddrStringSASL(virNetServerClient *client); +const char *virNetServerClientRemoteAddrStringURI(virNetServerClient *client); -int virNetServerClientSendMessage(virNetServerClientPtr client, - virNetMessagePtr msg); +int virNetServerClientSendMessage(virNetServerClient *client, + virNetMessage *msg); -bool virNetServerClientIsAuthenticated(virNetServerClientPtr client); -bool virNetServerClientIsAuthPendingLocked(virNetServerClientPtr client); -void virNetServerClientSetAuthPendingLocked(virNetServerClientPtr client, bool auth_pending); +bool virNetServerClientIsAuthenticated(virNetServerClient *client); +bool virNetServerClientIsAuthPendingLocked(virNetServerClient *client); +void virNetServerClientSetAuthPendingLocked(virNetServerClient *client, bool auth_pending); -int virNetServerClientGetTransport(virNetServerClientPtr client); -int virNetServerClientGetInfo(virNetServerClientPtr client, +int virNetServerClientGetTransport(virNetServerClient *client); +int virNetServerClientGetInfo(virNetServerClient *client, bool *readonly, char **sock_addr, - virIdentityPtr *identity); + virIdentity **identity); -void virNetServerClientSetQuietEOF(virNetServerClientPtr client); +void virNetServerClientSetQuietEOF(virNetServerClient *client); diff --git a/src/rpc/virnetserverprogram.c b/src/rpc/virnetserverprogram.c index 3884d62fd8..070d76fdd0 100644 --- a/src/rpc/virnetserverprogram.c +++ b/src/rpc/virnetserverprogram.c @@ -39,12 +39,12 @@ struct _virNetServerProgram { unsigned program; unsigned version; - virNetServerProgramProcPtr procs; + virNetServerProgramProc *procs; size_t nprocs; }; -static virClassPtr virNetServerProgramClass; +static virClass *virNetServerProgramClass; static void virNetServerProgramDispose(void *obj); static int virNetServerProgramOnceInit(void) @@ -58,12 +58,12 @@ static int virNetServerProgramOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNetServerProgram); -virNetServerProgramPtr virNetServerProgramNew(unsigned program, +virNetServerProgram *virNetServerProgramNew(unsigned program, unsigned version, - virNetServerProgramProcPtr procs, + virNetServerProgramProc *procs, size_t nprocs) { - virNetServerProgramPtr prog; + virNetServerProgram *prog; if (virNetServerProgramInitialize() < 0) return NULL; @@ -82,20 +82,20 @@ virNetServerProgramPtr virNetServerProgramNew(unsigned program, } -int virNetServerProgramGetID(virNetServerProgramPtr prog) +int virNetServerProgramGetID(virNetServerProgram *prog) { return prog->program; } -int virNetServerProgramGetVersion(virNetServerProgramPtr prog) +int virNetServerProgramGetVersion(virNetServerProgram *prog) { return prog->version; } -int virNetServerProgramMatches(virNetServerProgramPtr prog, - virNetMessagePtr msg) +int virNetServerProgramMatches(virNetServerProgram *prog, + virNetMessage *msg) { if (prog->program == msg->header.prog && prog->version == msg->header.vers) @@ -104,10 +104,10 @@ int virNetServerProgramMatches(virNetServerProgramPtr prog, } -static virNetServerProgramProcPtr virNetServerProgramGetProc(virNetServerProgramPtr prog, +static virNetServerProgramProc *virNetServerProgramGetProc(virNetServerProgram *prog, int procedure) { - virNetServerProgramProcPtr proc; + virNetServerProgramProc *proc; if (procedure < 0) return NULL; @@ -123,10 +123,10 @@ static virNetServerProgramProcPtr virNetServerProgramGetProc(virNetServerProgram } unsigned int -virNetServerProgramGetPriority(virNetServerProgramPtr prog, +virNetServerProgramGetPriority(virNetServerProgram *prog, int procedure) { - virNetServerProgramProcPtr proc = virNetServerProgramGetProc(prog, procedure); + virNetServerProgramProc *proc = virNetServerProgramGetProc(prog, procedure); if (!proc) return 0; @@ -137,9 +137,9 @@ virNetServerProgramGetPriority(virNetServerProgramPtr prog, static int virNetServerProgramSendError(unsigned program, unsigned version, - virNetServerClientPtr client, - virNetMessagePtr msg, - virNetMessageErrorPtr rerr, + virNetServerClient *client, + virNetMessage *msg, + struct virNetMessageError *rerr, int procedure, int type, unsigned int serial) @@ -186,11 +186,11 @@ virNetServerProgramSendError(unsigned program, * Returns 0 if the error was sent, -1 upon fatal error */ int -virNetServerProgramSendReplyError(virNetServerProgramPtr prog, - virNetServerClientPtr client, - virNetMessagePtr msg, - virNetMessageErrorPtr rerr, - virNetMessageHeaderPtr req) +virNetServerProgramSendReplyError(virNetServerProgram *prog, + virNetServerClient *client, + virNetMessage *msg, + struct virNetMessageError *rerr, + struct virNetMessageHeader *req) { /* * For data streams, errors are sent back as data streams @@ -207,10 +207,10 @@ virNetServerProgramSendReplyError(virNetServerProgramPtr prog, } -int virNetServerProgramSendStreamError(virNetServerProgramPtr prog, - virNetServerClientPtr client, - virNetMessagePtr msg, - virNetMessageErrorPtr rerr, +int virNetServerProgramSendStreamError(virNetServerProgram *prog, + virNetServerClient *client, + virNetMessage *msg, + struct virNetMessageError *rerr, int procedure, unsigned int serial) { @@ -225,9 +225,9 @@ int virNetServerProgramSendStreamError(virNetServerProgramPtr prog, } -int virNetServerProgramUnknownError(virNetServerClientPtr client, - virNetMessagePtr msg, - virNetMessageHeaderPtr req) +int virNetServerProgramUnknownError(virNetServerClient *client, + virNetMessage *msg, + struct virNetMessageHeader *req) { virNetMessageError rerr; @@ -247,10 +247,10 @@ int virNetServerProgramUnknownError(virNetServerClientPtr client, static int -virNetServerProgramDispatchCall(virNetServerProgramPtr prog, - virNetServerPtr server, - virNetServerClientPtr client, - virNetMessagePtr msg); +virNetServerProgramDispatchCall(virNetServerProgram *prog, + virNetServer *server, + virNetServerClient *client, + virNetMessage *msg); /* * @server: the unlocked server object @@ -267,10 +267,10 @@ virNetServerProgramDispatchCall(virNetServerProgramPtr prog, * * Returns 0 if the message was dispatched, -1 upon fatal error */ -int virNetServerProgramDispatch(virNetServerProgramPtr prog, - virNetServerPtr server, - virNetServerClientPtr client, - virNetMessagePtr msg) +int virNetServerProgramDispatch(virNetServerProgram *prog, + virNetServer *server, + virNetServerClient *client, + virNetMessage *msg) { int ret = -1; virNetMessageError rerr; @@ -360,15 +360,15 @@ int virNetServerProgramDispatch(virNetServerProgramPtr prog, * Returns 0 if the reply was sent, or -1 upon fatal error */ static int -virNetServerProgramDispatchCall(virNetServerProgramPtr prog, - virNetServerPtr server, - virNetServerClientPtr client, - virNetMessagePtr msg) +virNetServerProgramDispatchCall(virNetServerProgram *prog, + virNetServer *server, + virNetServerClient *client, + virNetMessage *msg) { g_autofree char *arg = NULL; g_autofree char *ret = NULL; int rv = -1; - virNetServerProgramProcPtr dispatcher; + virNetServerProgramProc *dispatcher; virNetMessageError rerr; size_t i; g_autoptr(virIdentity) identity = NULL; @@ -490,9 +490,9 @@ virNetServerProgramDispatchCall(virNetServerProgramPtr prog, } -int virNetServerProgramSendStreamData(virNetServerProgramPtr prog, - virNetServerClientPtr client, - virNetMessagePtr msg, +int virNetServerProgramSendStreamData(virNetServerProgram *prog, + virNetServerClient *client, + virNetMessage *msg, int procedure, unsigned int serial, const char *data, @@ -532,9 +532,9 @@ int virNetServerProgramSendStreamData(virNetServerProgramPtr prog, } -int virNetServerProgramSendStreamHole(virNetServerProgramPtr prog, - virNetServerClientPtr client, - virNetMessagePtr msg, +int virNetServerProgramSendStreamHole(virNetServerProgram *prog, + virNetServerClient *client, + virNetMessage *msg, int procedure, unsigned int serial, long long length, diff --git a/src/rpc/virnetserverprogram.h b/src/rpc/virnetserverprogram.h index 851bbf0183..218287f12f 100644 --- a/src/rpc/virnetserverprogram.h +++ b/src/rpc/virnetserverprogram.h @@ -26,21 +26,17 @@ #include "virobject.h" typedef struct _virNetDaemon virNetDaemon; -typedef virNetDaemon *virNetDaemonPtr; typedef struct _virNetServerService virNetServerService; -typedef virNetServerService *virNetServerServicePtr; typedef struct _virNetServerProgram virNetServerProgram; -typedef virNetServerProgram *virNetServerProgramPtr; typedef struct _virNetServerProgramProc virNetServerProgramProc; -typedef virNetServerProgramProc *virNetServerProgramProcPtr; -typedef int (*virNetServerProgramDispatchFunc)(virNetServerPtr server, - virNetServerClientPtr client, - virNetMessagePtr msg, - virNetMessageErrorPtr rerr, +typedef int (*virNetServerProgramDispatchFunc)(virNetServer *server, + virNetServerClient *client, + virNetMessage *msg, + struct virNetMessageError *rerr, void *args, void *ret); @@ -54,53 +50,53 @@ struct _virNetServerProgramProc { unsigned int priority; }; -virNetServerProgramPtr virNetServerProgramNew(unsigned program, +virNetServerProgram *virNetServerProgramNew(unsigned program, unsigned version, - virNetServerProgramProcPtr procs, + virNetServerProgramProc *procs, size_t nprocs); -int virNetServerProgramGetID(virNetServerProgramPtr prog); -int virNetServerProgramGetVersion(virNetServerProgramPtr prog); +int virNetServerProgramGetID(virNetServerProgram *prog); +int virNetServerProgramGetVersion(virNetServerProgram *prog); -unsigned int virNetServerProgramGetPriority(virNetServerProgramPtr prog, +unsigned int virNetServerProgramGetPriority(virNetServerProgram *prog, int procedure); -int virNetServerProgramMatches(virNetServerProgramPtr prog, - virNetMessagePtr msg); +int virNetServerProgramMatches(virNetServerProgram *prog, + virNetMessage *msg); -int virNetServerProgramDispatch(virNetServerProgramPtr prog, - virNetServerPtr server, - virNetServerClientPtr client, - virNetMessagePtr msg); +int virNetServerProgramDispatch(virNetServerProgram *prog, + virNetServer *server, + virNetServerClient *client, + virNetMessage *msg); -int virNetServerProgramSendReplyError(virNetServerProgramPtr prog, - virNetServerClientPtr client, - virNetMessagePtr msg, - virNetMessageErrorPtr rerr, - virNetMessageHeaderPtr req); +int virNetServerProgramSendReplyError(virNetServerProgram *prog, + virNetServerClient *client, + virNetMessage *msg, + struct virNetMessageError *rerr, + struct virNetMessageHeader *req); -int virNetServerProgramSendStreamError(virNetServerProgramPtr prog, - virNetServerClientPtr client, - virNetMessagePtr msg, - virNetMessageErrorPtr rerr, +int virNetServerProgramSendStreamError(virNetServerProgram *prog, + virNetServerClient *client, + virNetMessage *msg, + struct virNetMessageError *rerr, int procedure, unsigned int serial); -int virNetServerProgramUnknownError(virNetServerClientPtr client, - virNetMessagePtr msg, - virNetMessageHeaderPtr req); +int virNetServerProgramUnknownError(virNetServerClient *client, + virNetMessage *msg, + struct virNetMessageHeader *req); -int virNetServerProgramSendStreamData(virNetServerProgramPtr prog, - virNetServerClientPtr client, - virNetMessagePtr msg, +int virNetServerProgramSendStreamData(virNetServerProgram *prog, + virNetServerClient *client, + virNetMessage *msg, int procedure, unsigned int serial, const char *data, size_t len); -int virNetServerProgramSendStreamHole(virNetServerProgramPtr prog, - virNetServerClientPtr client, - virNetMessagePtr msg, +int virNetServerProgramSendStreamHole(virNetServerProgram *prog, + virNetServerClient *client, + virNetMessage *msg, int procedure, unsigned int serial, long long length, diff --git a/src/rpc/virnetserverservice.c b/src/rpc/virnetserverservice.c index ce2dd4f28b..0c4c437a49 100644 --- a/src/rpc/virnetserverservice.c +++ b/src/rpc/virnetserverservice.c @@ -38,20 +38,20 @@ struct _virNetServerService { virObject parent; size_t nsocks; - virNetSocketPtr *socks; + virNetSocket **socks; int auth; bool readonly; size_t nrequests_client_max; - virNetTLSContextPtr tls; + virNetTLSContext *tls; virNetServerServiceDispatchFunc dispatchFunc; void *dispatchOpaque; }; -static virClassPtr virNetServerServiceClass; +static virClass *virNetServerServiceClass; static void virNetServerServiceDispose(void *obj); static int virNetServerServiceOnceInit(void) @@ -65,12 +65,12 @@ static int virNetServerServiceOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNetServerService); -static void virNetServerServiceAccept(virNetSocketPtr sock, +static void virNetServerServiceAccept(virNetSocket *sock, int events G_GNUC_UNUSED, void *opaque) { - virNetServerServicePtr svc = opaque; - virNetSocketPtr clientsock = NULL; + virNetServerService *svc = opaque; + virNetSocket *clientsock = NULL; if (virNetSocketAccept(sock, &clientsock) < 0) goto cleanup; @@ -88,16 +88,16 @@ static void virNetServerServiceAccept(virNetSocketPtr sock, } -static virNetServerServicePtr -virNetServerServiceNewSocket(virNetSocketPtr *socks, +static virNetServerService * +virNetServerServiceNewSocket(virNetSocket **socks, size_t nsocks, int auth, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t max_queued_clients, size_t nrequests_client_max) { - virNetServerServicePtr svc; + virNetServerService *svc; size_t i; if (virNetServerServiceInitialize() < 0) @@ -106,7 +106,7 @@ virNetServerServiceNewSocket(virNetSocketPtr *socks, if (!(svc = virObjectNew(virNetServerServiceClass))) return NULL; - svc->socks = g_new0(virNetSocketPtr, nsocks); + svc->socks = g_new0(virNetSocket *, nsocks); svc->nsocks = nsocks; for (i = 0; i < svc->nsocks; i++) { svc->socks[i] = socks[i]; @@ -143,18 +143,18 @@ virNetServerServiceNewSocket(virNetSocketPtr *socks, } -virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename, +virNetServerService *virNetServerServiceNewTCP(const char *nodename, const char *service, int family, int auth, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t max_queued_clients, size_t nrequests_client_max) { - virNetServerServicePtr svc; + virNetServerService *svc; size_t i; - virNetSocketPtr *socks; + virNetSocket **socks; size_t nsocks; VIR_DEBUG("Creating new TCP server nodename='%s' service='%s'", @@ -182,17 +182,17 @@ virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename, } -virNetServerServicePtr virNetServerServiceNewUNIX(const char *path, +virNetServerService *virNetServerServiceNewUNIX(const char *path, mode_t mask, gid_t grp, int auth, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t max_queued_clients, size_t nrequests_client_max) { - virNetServerServicePtr svc; - virNetSocketPtr sock; + virNetServerService *svc; + virNetSocket *sock; VIR_DEBUG("Creating new UNIX server path='%s' mask=%o gid=%u", path, mask, grp); @@ -216,20 +216,20 @@ virNetServerServicePtr virNetServerServiceNewUNIX(const char *path, return svc; } -virNetServerServicePtr virNetServerServiceNewFDs(int *fds, +virNetServerService *virNetServerServiceNewFDs(int *fds, size_t nfds, bool unlinkUNIX, int auth, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t max_queued_clients, size_t nrequests_client_max) { - virNetServerServicePtr svc = NULL; - virNetSocketPtr *socks; + virNetServerService *svc = NULL; + virNetSocket **socks; size_t i; - socks = g_new0(virNetSocketPtr, nfds); + socks = g_new0(virNetSocket *, nfds); for (i = 0; i < nfds; i++) { if (virNetSocketNewListenFD(fds[i], @@ -254,10 +254,10 @@ virNetServerServicePtr virNetServerServiceNewFDs(int *fds, } -virNetServerServicePtr virNetServerServiceNewPostExecRestart(virJSONValuePtr object) +virNetServerService *virNetServerServiceNewPostExecRestart(virJSONValue *object) { - virNetServerServicePtr svc; - virJSONValuePtr socks; + virNetServerService *svc; + virJSONValue *socks; size_t i; size_t n; unsigned int max; @@ -299,12 +299,12 @@ virNetServerServicePtr virNetServerServiceNewPostExecRestart(virJSONValuePtr obj } n = virJSONValueArraySize(socks); - svc->socks = g_new0(virNetSocketPtr, n); + svc->socks = g_new0(virNetSocket *, n); svc->nsocks = n; for (i = 0; i < svc->nsocks; i++) { - virJSONValuePtr child = virJSONValueArrayGet(socks, i); - virNetSocketPtr sock; + virJSONValue *child = virJSONValueArrayGet(socks, i); + virNetSocket *sock; if (!(sock = virNetSocketNewPostExecRestart(child))) { virObjectUnref(sock); @@ -334,7 +334,7 @@ virNetServerServicePtr virNetServerServiceNewPostExecRestart(virJSONValuePtr obj } -virJSONValuePtr virNetServerServicePreExecRestart(virNetServerServicePtr svc) +virJSONValue *virNetServerServicePreExecRestart(virNetServerService *svc) { g_autoptr(virJSONValue) object = virJSONValueNewObject(); g_autoptr(virJSONValue) socks = virJSONValueNewArray(); @@ -363,7 +363,7 @@ virJSONValuePtr virNetServerServicePreExecRestart(virNetServerServicePtr svc) } -int virNetServerServiceGetPort(virNetServerServicePtr svc) +int virNetServerServiceGetPort(virNetServerService *svc) { /* We're assuming if there are multiple sockets * for IPv4 & 6, then they are all on same port */ @@ -371,29 +371,29 @@ int virNetServerServiceGetPort(virNetServerServicePtr svc) } -int virNetServerServiceGetAuth(virNetServerServicePtr svc) +int virNetServerServiceGetAuth(virNetServerService *svc) { return svc->auth; } -bool virNetServerServiceIsReadonly(virNetServerServicePtr svc) +bool virNetServerServiceIsReadonly(virNetServerService *svc) { return svc->readonly; } -size_t virNetServerServiceGetMaxRequests(virNetServerServicePtr svc) +size_t virNetServerServiceGetMaxRequests(virNetServerService *svc) { return svc->nrequests_client_max; } -virNetTLSContextPtr virNetServerServiceGetTLSContext(virNetServerServicePtr svc) +virNetTLSContext *virNetServerServiceGetTLSContext(virNetServerService *svc) { return svc->tls; } -void virNetServerServiceSetDispatcher(virNetServerServicePtr svc, +void virNetServerServiceSetDispatcher(virNetServerService *svc, virNetServerServiceDispatchFunc func, void *opaque) { @@ -404,7 +404,7 @@ void virNetServerServiceSetDispatcher(virNetServerServicePtr svc, void virNetServerServiceDispose(void *obj) { - virNetServerServicePtr svc = obj; + virNetServerService *svc = obj; size_t i; for (i = 0; i < svc->nsocks; i++) @@ -414,7 +414,7 @@ void virNetServerServiceDispose(void *obj) virObjectUnref(svc->tls); } -void virNetServerServiceToggle(virNetServerServicePtr svc, +void virNetServerServiceToggle(virNetServerService *svc, bool enabled) { size_t i; @@ -426,7 +426,7 @@ void virNetServerServiceToggle(virNetServerServicePtr svc, 0); } -void virNetServerServiceClose(virNetServerServicePtr svc) +void virNetServerServiceClose(virNetServerService *svc) { size_t i; diff --git a/src/rpc/virnetserverservice.h b/src/rpc/virnetserverservice.h index d58fc43437..ab5798938e 100644 --- a/src/rpc/virnetserverservice.h +++ b/src/rpc/virnetserverservice.h @@ -30,51 +30,51 @@ typedef enum { VIR_NET_SERVER_SERVICE_AUTH_POLKIT, } virNetServerServiceAuthMethods; -typedef int (*virNetServerServiceDispatchFunc)(virNetServerServicePtr svc, - virNetSocketPtr sock, +typedef int (*virNetServerServiceDispatchFunc)(virNetServerService *svc, + virNetSocket *sock, void *opaque); -virNetServerServicePtr virNetServerServiceNewTCP(const char *nodename, +virNetServerService *virNetServerServiceNewTCP(const char *nodename, const char *service, int family, int auth, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t max_queued_clients, size_t nrequests_client_max); -virNetServerServicePtr virNetServerServiceNewUNIX(const char *path, +virNetServerService *virNetServerServiceNewUNIX(const char *path, mode_t mask, gid_t grp, int auth, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t max_queued_clients, size_t nrequests_client_max); -virNetServerServicePtr virNetServerServiceNewFDs(int *fd, +virNetServerService *virNetServerServiceNewFDs(int *fd, size_t nfds, bool unlinkUNIX, int auth, - virNetTLSContextPtr tls, + virNetTLSContext *tls, bool readonly, size_t max_queued_clients, size_t nrequests_client_max); -virNetServerServicePtr virNetServerServiceNewPostExecRestart(virJSONValuePtr object); +virNetServerService *virNetServerServiceNewPostExecRestart(virJSONValue *object); -virJSONValuePtr virNetServerServicePreExecRestart(virNetServerServicePtr service); +virJSONValue *virNetServerServicePreExecRestart(virNetServerService *service); -int virNetServerServiceGetPort(virNetServerServicePtr svc); +int virNetServerServiceGetPort(virNetServerService *svc); -int virNetServerServiceGetAuth(virNetServerServicePtr svc); -bool virNetServerServiceIsReadonly(virNetServerServicePtr svc); -size_t virNetServerServiceGetMaxRequests(virNetServerServicePtr svc); -virNetTLSContextPtr virNetServerServiceGetTLSContext(virNetServerServicePtr svc); +int virNetServerServiceGetAuth(virNetServerService *svc); +bool virNetServerServiceIsReadonly(virNetServerService *svc); +size_t virNetServerServiceGetMaxRequests(virNetServerService *svc); +virNetTLSContext *virNetServerServiceGetTLSContext(virNetServerService *svc); -void virNetServerServiceSetDispatcher(virNetServerServicePtr svc, +void virNetServerServiceSetDispatcher(virNetServerService *svc, virNetServerServiceDispatchFunc func, void *opaque); -void virNetServerServiceToggle(virNetServerServicePtr svc, +void virNetServerServiceToggle(virNetServerService *svc, bool enabled); -void virNetServerServiceClose(virNetServerServicePtr svc); +void virNetServerServiceClose(virNetServerService *svc); diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index b1f47636d1..c762b605a5 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -85,9 +85,9 @@ struct _virNetSocket { char *remoteAddrStrSASL; char *remoteAddrStrURI; - virNetTLSSessionPtr tlsSession; + virNetTLSSession *tlsSession; #if WITH_SASL - virNetSASLSessionPtr saslSession; + virNetSASLSession *saslSession; const char *saslDecoded; size_t saslDecodedLength; @@ -99,15 +99,15 @@ struct _virNetSocket { size_t saslEncodedOffset; #endif #if WITH_SSH2 - virNetSSHSessionPtr sshSession; + virNetSSHSession *sshSession; #endif #if WITH_LIBSSH - virNetLibsshSessionPtr libsshSession; + virNetLibsshSession *libsshSession; #endif }; -static virClassPtr virNetSocketClass; +static virClass *virNetSocketClass; static void virNetSocketDispose(void *obj); static int virNetSocketOnceInit(void) @@ -125,7 +125,7 @@ VIR_ONCE_GLOBAL_INIT(virNetSocket); static int virNetSocketForkDaemon(const char *binary) { int ret; - virCommandPtr cmd = virCommandNewArgList(binary, + virCommand *cmd = virCommandNewArgList(binary, "--timeout=120", NULL); @@ -225,16 +225,16 @@ int virNetSocketCheckProtocols(bool *hasIPv4, } -static virNetSocketPtr -virNetSocketNew(virSocketAddrPtr localAddr, - virSocketAddrPtr remoteAddr, +static virNetSocket * +virNetSocketNew(virSocketAddr *localAddr, + virSocketAddr *remoteAddr, bool isClient, int fd, int errfd, pid_t pid, bool unlinkUNIX) { - virNetSocketPtr sock; + virNetSocket *sock; int no_slow_start = 1; if (virNetSocketInitialize() < 0) @@ -312,10 +312,10 @@ virNetSocketNew(virSocketAddrPtr localAddr, int virNetSocketNewListenTCP(const char *nodename, const char *service, int family, - virNetSocketPtr **retsocks, + virNetSocket ***retsocks, size_t *nretsocks) { - virNetSocketPtr *socks = NULL; + virNetSocket **socks = NULL; size_t nsocks = 0; struct addrinfo *ai = NULL; struct addrinfo hints; @@ -480,7 +480,7 @@ int virNetSocketNewListenUNIX(const char *path, mode_t mask, uid_t user, gid_t grp, - virNetSocketPtr *retsock) + virNetSocket **retsock) { virSocketAddr addr; mode_t oldmask; @@ -546,7 +546,7 @@ int virNetSocketNewListenUNIX(const char *path G_GNUC_UNUSED, mode_t mask G_GNUC_UNUSED, uid_t user G_GNUC_UNUSED, gid_t grp G_GNUC_UNUSED, - virNetSocketPtr *retsock G_GNUC_UNUSED) + virNetSocket **retsock G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("UNIX sockets are not supported on this platform")); @@ -556,7 +556,7 @@ int virNetSocketNewListenUNIX(const char *path G_GNUC_UNUSED, int virNetSocketNewListenFD(int fd, bool unlinkUNIX, - virNetSocketPtr *retsock) + virNetSocket **retsock) { virSocketAddr addr; *retsock = NULL; @@ -579,7 +579,7 @@ int virNetSocketNewListenFD(int fd, int virNetSocketNewConnectTCP(const char *nodename, const char *service, int family, - virNetSocketPtr *retsock) + virNetSocket **retsock) { struct addrinfo *ai = NULL; struct addrinfo hints; @@ -666,7 +666,7 @@ int virNetSocketNewConnectTCP(const char *nodename, int virNetSocketNewConnectUNIX(const char *path, bool spawnDaemon, const char *binary, - virNetSocketPtr *retsock) + virNetSocket **retsock) { char *lockpath = NULL; int lockfd = -1; @@ -787,7 +787,7 @@ int virNetSocketNewConnectUNIX(const char *path, int virNetSocketNewConnectUNIX(const char *path G_GNUC_UNUSED, bool spawnDaemon G_GNUC_UNUSED, const char *binary G_GNUC_UNUSED, - virNetSocketPtr *retsock G_GNUC_UNUSED) + virNetSocket **retsock G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("UNIX sockets are not supported on this platform")); @@ -797,8 +797,8 @@ int virNetSocketNewConnectUNIX(const char *path G_GNUC_UNUSED, #ifndef WIN32 -int virNetSocketNewConnectCommand(virCommandPtr cmd, - virNetSocketPtr *retsock) +int virNetSocketNewConnectCommand(virCommand *cmd, + virNetSocket **retsock) { pid_t pid = 0; int sv[2] = { -1, -1 }; @@ -849,8 +849,8 @@ int virNetSocketNewConnectCommand(virCommandPtr cmd, return -1; } #else -int virNetSocketNewConnectCommand(virCommandPtr cmd G_GNUC_UNUSED, - virNetSocketPtr *retsock G_GNUC_UNUSED) +int virNetSocketNewConnectCommand(virCommand *cmd G_GNUC_UNUSED, + virNetSocket **retsock G_GNUC_UNUSED) { virReportSystemError(errno, "%s", _("Tunnelling sockets not supported on this platform")); @@ -866,9 +866,9 @@ int virNetSocketNewConnectSSH(const char *nodename, bool noVerify, const char *keyfile, const char *command, - virNetSocketPtr *retsock) + virNetSocket **retsock) { - virCommandPtr cmd; + virCommand *cmd; *retsock = NULL; @@ -910,11 +910,11 @@ virNetSocketNewConnectLibSSH2(const char *host, const char *authMethods, const char *command, virConnectAuthPtr auth, - virURIPtr uri, - virNetSocketPtr *retsock) + virURI *uri, + virNetSocket **retsock) { - virNetSocketPtr sock = NULL; - virNetSSHSessionPtr sess = NULL; + virNetSocket *sock = NULL; + virNetSSHSession *sess = NULL; unsigned int verify; int ret = -1; int portN; @@ -1021,8 +1021,8 @@ virNetSocketNewConnectLibSSH2(const char *host G_GNUC_UNUSED, const char *authMethods G_GNUC_UNUSED, const char *command G_GNUC_UNUSED, virConnectAuthPtr auth G_GNUC_UNUSED, - virURIPtr uri G_GNUC_UNUSED, - virNetSocketPtr *retsock G_GNUC_UNUSED) + virURI *uri G_GNUC_UNUSED, + virNetSocket **retsock G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("libssh2 transport support was not enabled")); @@ -1042,11 +1042,11 @@ virNetSocketNewConnectLibssh(const char *host, const char *authMethods, const char *command, virConnectAuthPtr auth, - virURIPtr uri, - virNetSocketPtr *retsock) + virURI *uri, + virNetSocket **retsock) { - virNetSocketPtr sock = NULL; - virNetLibsshSessionPtr sess = NULL; + virNetSocket *sock = NULL; + virNetLibsshSession *sess = NULL; unsigned int verify; int ret = -1; int portN; @@ -1154,8 +1154,8 @@ virNetSocketNewConnectLibssh(const char *host G_GNUC_UNUSED, const char *authMethods G_GNUC_UNUSED, const char *command G_GNUC_UNUSED, virConnectAuthPtr auth G_GNUC_UNUSED, - virURIPtr uri G_GNUC_UNUSED, - virNetSocketPtr *retsock G_GNUC_UNUSED) + virURI *uri G_GNUC_UNUSED, + virNetSocket **retsock G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("libssh transport support was not enabled")); @@ -1164,9 +1164,9 @@ virNetSocketNewConnectLibssh(const char *host G_GNUC_UNUSED, #endif /* WITH_LIBSSH */ int virNetSocketNewConnectExternal(const char **cmdargv, - virNetSocketPtr *retsock) + virNetSocket **retsock) { - virCommandPtr cmd; + virCommand *cmd; *retsock = NULL; @@ -1179,7 +1179,7 @@ int virNetSocketNewConnectExternal(const char **cmdargv, int virNetSocketNewConnectSockFD(int sockfd, - virNetSocketPtr *retsock) + virNetSocket **retsock) { virSocketAddr localAddr; @@ -1196,7 +1196,7 @@ int virNetSocketNewConnectSockFD(int sockfd, } -virNetSocketPtr virNetSocketNewPostExecRestart(virJSONValuePtr object) +virNetSocket *virNetSocketNewPostExecRestart(virJSONValue *object) { virSocketAddr localAddr; virSocketAddr remoteAddr; @@ -1251,9 +1251,9 @@ virNetSocketPtr virNetSocketNewPostExecRestart(virJSONValuePtr object) } -virJSONValuePtr virNetSocketPreExecRestart(virNetSocketPtr sock) +virJSONValue *virNetSocketPreExecRestart(virNetSocket *sock) { - virJSONValuePtr object = NULL; + virJSONValue *object = NULL; virObjectLock(sock); @@ -1313,7 +1313,7 @@ virJSONValuePtr virNetSocketPreExecRestart(virNetSocketPtr sock) void virNetSocketDispose(void *obj) { - virNetSocketPtr sock = obj; + virNetSocket *sock = obj; PROBE(RPC_SOCKET_DISPOSE, "sock=%p", sock); @@ -1361,7 +1361,7 @@ void virNetSocketDispose(void *obj) } -int virNetSocketGetFD(virNetSocketPtr sock) +int virNetSocketGetFD(virNetSocket *sock) { int fd; virObjectLock(sock); @@ -1370,7 +1370,7 @@ int virNetSocketGetFD(virNetSocketPtr sock) return fd; } -int virNetSocketDupFD(virNetSocketPtr sock, bool cloexec) +int virNetSocketDupFD(virNetSocket *sock, bool cloexec) { int fd; @@ -1399,7 +1399,7 @@ int virNetSocketDupFD(virNetSocketPtr sock, bool cloexec) } -bool virNetSocketIsLocal(virNetSocketPtr sock) +bool virNetSocketIsLocal(virNetSocket *sock) { bool isLocal = false; virObjectLock(sock); @@ -1410,7 +1410,7 @@ bool virNetSocketIsLocal(virNetSocketPtr sock) } -bool virNetSocketHasPassFD(virNetSocketPtr sock) +bool virNetSocketHasPassFD(virNetSocket *sock) { bool hasPassFD = false; virObjectLock(sock); @@ -1420,7 +1420,7 @@ bool virNetSocketHasPassFD(virNetSocketPtr sock) return hasPassFD; } -char *virNetSocketGetPath(virNetSocketPtr sock) +char *virNetSocketGetPath(virNetSocket *sock) { char *path = NULL; virObjectLock(sock); @@ -1429,7 +1429,7 @@ char *virNetSocketGetPath(virNetSocketPtr sock) return path; } -int virNetSocketGetPort(virNetSocketPtr sock) +int virNetSocketGetPort(virNetSocket *sock) { int port; virObjectLock(sock); @@ -1440,7 +1440,7 @@ int virNetSocketGetPort(virNetSocketPtr sock) #if defined(SO_PEERCRED) -int virNetSocketGetUNIXIdentity(virNetSocketPtr sock, +int virNetSocketGetUNIXIdentity(virNetSocket *sock, uid_t *uid, gid_t *gid, pid_t *pid, @@ -1497,7 +1497,7 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock, # define VIR_SOL_PEERCRED 0 # endif -int virNetSocketGetUNIXIdentity(virNetSocketPtr sock, +int virNetSocketGetUNIXIdentity(virNetSocket *sock, uid_t *uid, gid_t *gid, pid_t *pid, @@ -1565,7 +1565,7 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock, return ret; } #else -int virNetSocketGetUNIXIdentity(virNetSocketPtr sock G_GNUC_UNUSED, +int virNetSocketGetUNIXIdentity(virNetSocket *sock G_GNUC_UNUSED, uid_t *uid G_GNUC_UNUSED, gid_t *gid G_GNUC_UNUSED, pid_t *pid G_GNUC_UNUSED, @@ -1579,7 +1579,7 @@ int virNetSocketGetUNIXIdentity(virNetSocketPtr sock G_GNUC_UNUSED, #endif #ifdef WITH_SELINUX -int virNetSocketGetSELinuxContext(virNetSocketPtr sock, +int virNetSocketGetSELinuxContext(virNetSocket *sock, char **context) { char *seccon = NULL; @@ -1607,7 +1607,7 @@ int virNetSocketGetSELinuxContext(virNetSocketPtr sock, return ret; } #else -int virNetSocketGetSELinuxContext(virNetSocketPtr sock G_GNUC_UNUSED, +int virNetSocketGetSELinuxContext(virNetSocket *sock G_GNUC_UNUSED, char **context) { *context = NULL; @@ -1616,7 +1616,7 @@ int virNetSocketGetSELinuxContext(virNetSocketPtr sock G_GNUC_UNUSED, #endif -int virNetSocketSetBlocking(virNetSocketPtr sock, +int virNetSocketSetBlocking(virNetSocket *sock, bool blocking) { int ret; @@ -1627,17 +1627,17 @@ int virNetSocketSetBlocking(virNetSocketPtr sock, } -const char *virNetSocketLocalAddrStringSASL(virNetSocketPtr sock) +const char *virNetSocketLocalAddrStringSASL(virNetSocket *sock) { return sock->localAddrStrSASL; } -const char *virNetSocketRemoteAddrStringSASL(virNetSocketPtr sock) +const char *virNetSocketRemoteAddrStringSASL(virNetSocket *sock) { return sock->remoteAddrStrSASL; } -const char *virNetSocketRemoteAddrStringURI(virNetSocketPtr sock) +const char *virNetSocketRemoteAddrStringURI(virNetSocket *sock) { return sock->remoteAddrStrURI; } @@ -1646,7 +1646,7 @@ static ssize_t virNetSocketTLSSessionWrite(const char *buf, size_t len, void *opaque) { - virNetSocketPtr sock = opaque; + virNetSocket *sock = opaque; return write(sock->fd, buf, len); } @@ -1655,13 +1655,13 @@ static ssize_t virNetSocketTLSSessionRead(char *buf, size_t len, void *opaque) { - virNetSocketPtr sock = opaque; + virNetSocket *sock = opaque; return read(sock->fd, buf, len); } -void virNetSocketSetTLSSession(virNetSocketPtr sock, - virNetTLSSessionPtr sess) +void virNetSocketSetTLSSession(virNetSocket *sock, + virNetTLSSession *sess) { virObjectLock(sock); virObjectUnref(sock->tlsSession); @@ -1674,8 +1674,8 @@ void virNetSocketSetTLSSession(virNetSocketPtr sock, } #if WITH_SASL -void virNetSocketSetSASLSession(virNetSocketPtr sock, - virNetSASLSessionPtr sess) +void virNetSocketSetSASLSession(virNetSocket *sock, + virNetSASLSession *sess) { virObjectLock(sock); virObjectUnref(sock->saslSession); @@ -1685,7 +1685,7 @@ void virNetSocketSetSASLSession(virNetSocketPtr sock, #endif -bool virNetSocketHasCachedData(virNetSocketPtr sock G_GNUC_UNUSED) +bool virNetSocketHasCachedData(virNetSocket *sock G_GNUC_UNUSED) { bool hasCached = false; virObjectLock(sock); @@ -1709,14 +1709,14 @@ bool virNetSocketHasCachedData(virNetSocketPtr sock G_GNUC_UNUSED) } #if WITH_SSH2 -static ssize_t virNetSocketLibSSH2Read(virNetSocketPtr sock, +static ssize_t virNetSocketLibSSH2Read(virNetSocket *sock, char *buf, size_t len) { return virNetSSHChannelRead(sock->sshSession, buf, len); } -static ssize_t virNetSocketLibSSH2Write(virNetSocketPtr sock, +static ssize_t virNetSocketLibSSH2Write(virNetSocket *sock, const char *buf, size_t len) { @@ -1725,14 +1725,14 @@ static ssize_t virNetSocketLibSSH2Write(virNetSocketPtr sock, #endif #if WITH_LIBSSH -static ssize_t virNetSocketLibsshRead(virNetSocketPtr sock, +static ssize_t virNetSocketLibsshRead(virNetSocket *sock, char *buf, size_t len) { return virNetLibsshChannelRead(sock->libsshSession, buf, len); } -static ssize_t virNetSocketLibsshWrite(virNetSocketPtr sock, +static ssize_t virNetSocketLibsshWrite(virNetSocket *sock, const char *buf, size_t len) { @@ -1740,7 +1740,7 @@ static ssize_t virNetSocketLibsshWrite(virNetSocketPtr sock, } #endif -bool virNetSocketHasPendingData(virNetSocketPtr sock G_GNUC_UNUSED) +bool virNetSocketHasPendingData(virNetSocket *sock G_GNUC_UNUSED) { bool hasPending = false; virObjectLock(sock); @@ -1753,7 +1753,7 @@ bool virNetSocketHasPendingData(virNetSocketPtr sock G_GNUC_UNUSED) } -static ssize_t virNetSocketReadWire(virNetSocketPtr sock, char *buf, size_t len) +static ssize_t virNetSocketReadWire(virNetSocket *sock, char *buf, size_t len) { char *errout = NULL; ssize_t ret; @@ -1823,7 +1823,7 @@ static ssize_t virNetSocketReadWire(virNetSocketPtr sock, char *buf, size_t len) return ret; } -static ssize_t virNetSocketWriteWire(virNetSocketPtr sock, const char *buf, size_t len) +static ssize_t virNetSocketWriteWire(virNetSocket *sock, const char *buf, size_t len) { ssize_t ret; @@ -1867,7 +1867,7 @@ static ssize_t virNetSocketWriteWire(virNetSocketPtr sock, const char *buf, size #if WITH_SASL -static ssize_t virNetSocketReadSASL(virNetSocketPtr sock, char *buf, size_t len) +static ssize_t virNetSocketReadSASL(virNetSocket *sock, char *buf, size_t len) { ssize_t got; @@ -1912,7 +1912,7 @@ static ssize_t virNetSocketReadSASL(virNetSocketPtr sock, char *buf, size_t len) } -static ssize_t virNetSocketWriteSASL(virNetSocketPtr sock, const char *buf, size_t len) +static ssize_t virNetSocketWriteSASL(virNetSocket *sock, const char *buf, size_t len) { int ret; size_t tosend = virNetSASLSessionGetMaxBufSize(sock->saslSession); @@ -1972,7 +1972,7 @@ static ssize_t virNetSocketWriteSASL(virNetSocketPtr sock, const char *buf, size } #endif -ssize_t virNetSocketRead(virNetSocketPtr sock, char *buf, size_t len) +ssize_t virNetSocketRead(virNetSocket *sock, char *buf, size_t len) { ssize_t ret; virObjectLock(sock); @@ -1986,7 +1986,7 @@ ssize_t virNetSocketRead(virNetSocketPtr sock, char *buf, size_t len) return ret; } -ssize_t virNetSocketWrite(virNetSocketPtr sock, const char *buf, size_t len) +ssize_t virNetSocketWrite(virNetSocket *sock, const char *buf, size_t len) { ssize_t ret; @@ -2005,7 +2005,7 @@ ssize_t virNetSocketWrite(virNetSocketPtr sock, const char *buf, size_t len) /* * Returns 1 if an FD was sent, 0 if it would block, -1 on error */ -int virNetSocketSendFD(virNetSocketPtr sock, int fd) +int virNetSocketSendFD(virNetSocket *sock, int fd) { int ret = -1; if (!virNetSocketHasPassFD(sock)) { @@ -2036,7 +2036,7 @@ int virNetSocketSendFD(virNetSocketPtr sock, int fd) /* * Returns 1 if an FD was read, 0 if it would block, -1 on error */ -int virNetSocketRecvFD(virNetSocketPtr sock, int *fd) +int virNetSocketRecvFD(virNetSocket *sock, int *fd) { int ret = -1; @@ -2067,7 +2067,7 @@ int virNetSocketRecvFD(virNetSocketPtr sock, int *fd) } -int virNetSocketListen(virNetSocketPtr sock, int backlog) +int virNetSocketListen(virNetSocket *sock, int backlog) { virObjectLock(sock); if (listen(sock->fd, backlog > 0 ? backlog : 30) < 0) { @@ -2079,7 +2079,7 @@ int virNetSocketListen(virNetSocketPtr sock, int backlog) return 0; } -int virNetSocketAccept(virNetSocketPtr sock, virNetSocketPtr *clientsock) +int virNetSocketAccept(virNetSocket *sock, virNetSocket **clientsock) { int fd = -1; virSocketAddr localAddr; @@ -2135,7 +2135,7 @@ static void virNetSocketEventHandle(int watch G_GNUC_UNUSED, int events, void *opaque) { - virNetSocketPtr sock = opaque; + virNetSocket *sock = opaque; virNetSocketIOFunc func; void *eopaque; @@ -2151,7 +2151,7 @@ static void virNetSocketEventHandle(int watch G_GNUC_UNUSED, static void virNetSocketEventFree(void *opaque) { - virNetSocketPtr sock = opaque; + virNetSocket *sock = opaque; virFreeCallback ff; void *eopaque; @@ -2168,7 +2168,7 @@ static void virNetSocketEventFree(void *opaque) virObjectUnref(sock); } -int virNetSocketAddIOCallback(virNetSocketPtr sock, +int virNetSocketAddIOCallback(virNetSocket *sock, int events, virNetSocketIOFunc func, void *opaque, @@ -2204,7 +2204,7 @@ int virNetSocketAddIOCallback(virNetSocketPtr sock, return ret; } -void virNetSocketUpdateIOCallback(virNetSocketPtr sock, +void virNetSocketUpdateIOCallback(virNetSocket *sock, int events) { virObjectLock(sock); @@ -2219,7 +2219,7 @@ void virNetSocketUpdateIOCallback(virNetSocketPtr sock, virObjectUnlock(sock); } -void virNetSocketRemoveIOCallback(virNetSocketPtr sock) +void virNetSocketRemoveIOCallback(virNetSocket *sock) { virObjectLock(sock); @@ -2236,7 +2236,7 @@ void virNetSocketRemoveIOCallback(virNetSocketPtr sock) virObjectUnlock(sock); } -void virNetSocketClose(virNetSocketPtr sock) +void virNetSocketClose(virNetSocket *sock) { if (!sock) return; @@ -2270,7 +2270,7 @@ void virNetSocketClose(virNetSocketPtr sock) * reading data. */ void -virNetSocketSetQuietEOF(virNetSocketPtr sock) +virNetSocketSetQuietEOF(virNetSocket *sock) { sock->quietEOF = true; } diff --git a/src/rpc/virnetsocket.h b/src/rpc/virnetsocket.h index 3996d264fb..2dc4d06f42 100644 --- a/src/rpc/virnetsocket.h +++ b/src/rpc/virnetsocket.h @@ -32,11 +32,10 @@ #include "viruri.h" typedef struct _virNetSocket virNetSocket; -typedef virNetSocket *virNetSocketPtr; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetSocket, virObjectUnref); -typedef void (*virNetSocketIOFunc)(virNetSocketPtr sock, +typedef void (*virNetSocketIOFunc)(virNetSocket *sock, int events, void *opaque); @@ -47,31 +46,31 @@ int virNetSocketCheckProtocols(bool *hasIPv4, int virNetSocketNewListenTCP(const char *nodename, const char *service, int family, - virNetSocketPtr **addrs, + virNetSocket ***addrs, size_t *naddrs); int virNetSocketNewListenUNIX(const char *path, mode_t mask, uid_t user, gid_t grp, - virNetSocketPtr *addr); + virNetSocket **addr); int virNetSocketNewListenFD(int fd, bool unlinkUNIX, - virNetSocketPtr *addr); + virNetSocket **addr); int virNetSocketNewConnectTCP(const char *nodename, const char *service, int family, - virNetSocketPtr *addr); + virNetSocket **addr); int virNetSocketNewConnectUNIX(const char *path, bool spawnDaemon, const char *binary, - virNetSocketPtr *addr); + virNetSocket **addr); -int virNetSocketNewConnectCommand(virCommandPtr cmd, - virNetSocketPtr *retsock); +int virNetSocketNewConnectCommand(virCommand *cmd, + virNetSocket **retsock); int virNetSocketNewConnectSSH(const char *nodename, const char *service, @@ -81,7 +80,7 @@ int virNetSocketNewConnectSSH(const char *nodename, bool noVerify, const char *keyfile, const char *command, - virNetSocketPtr *addr); + virNetSocket **addr); int virNetSocketNewConnectLibSSH2(const char *host, const char *port, @@ -93,8 +92,8 @@ int virNetSocketNewConnectLibSSH2(const char *host, const char *authMethods, const char *command, virConnectAuthPtr auth, - virURIPtr uri, - virNetSocketPtr *retsock); + virURI *uri, + virNetSocket **retsock); int virNetSocketNewConnectLibssh(const char *host, const char *port, @@ -106,77 +105,77 @@ int virNetSocketNewConnectLibssh(const char *host, const char *authMethods, const char *command, virConnectAuthPtr auth, - virURIPtr uri, - virNetSocketPtr *retsock); + virURI *uri, + virNetSocket **retsock); int virNetSocketNewConnectExternal(const char **cmdargv, - virNetSocketPtr *addr); + virNetSocket **addr); int virNetSocketNewConnectSockFD(int sockfd, - virNetSocketPtr *retsock); + virNetSocket **retsock); -virNetSocketPtr virNetSocketNewPostExecRestart(virJSONValuePtr object); +virNetSocket *virNetSocketNewPostExecRestart(virJSONValue *object); -virJSONValuePtr virNetSocketPreExecRestart(virNetSocketPtr sock); +virJSONValue *virNetSocketPreExecRestart(virNetSocket *sock); -int virNetSocketGetFD(virNetSocketPtr sock); -int virNetSocketDupFD(virNetSocketPtr sock, bool cloexec); +int virNetSocketGetFD(virNetSocket *sock); +int virNetSocketDupFD(virNetSocket *sock, bool cloexec); -bool virNetSocketIsLocal(virNetSocketPtr sock); +bool virNetSocketIsLocal(virNetSocket *sock); -bool virNetSocketHasPassFD(virNetSocketPtr sock); +bool virNetSocketHasPassFD(virNetSocket *sock); -char *virNetSocketGetPath(virNetSocketPtr sock); -int virNetSocketGetPort(virNetSocketPtr sock); +char *virNetSocketGetPath(virNetSocket *sock); +int virNetSocketGetPort(virNetSocket *sock); -int virNetSocketGetUNIXIdentity(virNetSocketPtr sock, +int virNetSocketGetUNIXIdentity(virNetSocket *sock, uid_t *uid, gid_t *gid, pid_t *pid, unsigned long long *timestamp) G_GNUC_NO_INLINE; -int virNetSocketGetSELinuxContext(virNetSocketPtr sock, +int virNetSocketGetSELinuxContext(virNetSocket *sock, char **context) G_GNUC_NO_INLINE; -int virNetSocketSetBlocking(virNetSocketPtr sock, +int virNetSocketSetBlocking(virNetSocket *sock, bool blocking); -void virNetSocketSetQuietEOF(virNetSocketPtr sock); +void virNetSocketSetQuietEOF(virNetSocket *sock); -ssize_t virNetSocketRead(virNetSocketPtr sock, char *buf, size_t len); -ssize_t virNetSocketWrite(virNetSocketPtr sock, const char *buf, size_t len); +ssize_t virNetSocketRead(virNetSocket *sock, char *buf, size_t len); +ssize_t virNetSocketWrite(virNetSocket *sock, const char *buf, size_t len); -int virNetSocketSendFD(virNetSocketPtr sock, int fd); -int virNetSocketRecvFD(virNetSocketPtr sock, int *fd); +int virNetSocketSendFD(virNetSocket *sock, int fd); +int virNetSocketRecvFD(virNetSocket *sock, int *fd); -void virNetSocketSetTLSSession(virNetSocketPtr sock, - virNetTLSSessionPtr sess); +void virNetSocketSetTLSSession(virNetSocket *sock, + virNetTLSSession *sess); #ifdef WITH_SASL -void virNetSocketSetSASLSession(virNetSocketPtr sock, - virNetSASLSessionPtr sess); +void virNetSocketSetSASLSession(virNetSocket *sock, + virNetSASLSession *sess); #endif -bool virNetSocketHasCachedData(virNetSocketPtr sock); -bool virNetSocketHasPendingData(virNetSocketPtr sock); +bool virNetSocketHasCachedData(virNetSocket *sock); +bool virNetSocketHasPendingData(virNetSocket *sock); -const char *virNetSocketLocalAddrStringSASL(virNetSocketPtr sock); -const char *virNetSocketRemoteAddrStringSASL(virNetSocketPtr sock); -const char *virNetSocketRemoteAddrStringURI(virNetSocketPtr sock); +const char *virNetSocketLocalAddrStringSASL(virNetSocket *sock); +const char *virNetSocketRemoteAddrStringSASL(virNetSocket *sock); +const char *virNetSocketRemoteAddrStringURI(virNetSocket *sock); -int virNetSocketListen(virNetSocketPtr sock, int backlog); -int virNetSocketAccept(virNetSocketPtr sock, - virNetSocketPtr *clientsock); +int virNetSocketListen(virNetSocket *sock, int backlog); +int virNetSocketAccept(virNetSocket *sock, + virNetSocket **clientsock); -int virNetSocketAddIOCallback(virNetSocketPtr sock, +int virNetSocketAddIOCallback(virNetSocket *sock, int events, virNetSocketIOFunc func, void *opaque, virFreeCallback ff); -void virNetSocketUpdateIOCallback(virNetSocketPtr sock, +void virNetSocketUpdateIOCallback(virNetSocket *sock, int events); -void virNetSocketRemoveIOCallback(virNetSocketPtr sock); +void virNetSocketRemoveIOCallback(virNetSocket *sock); -void virNetSocketClose(virNetSocketPtr sock); +void virNetSocketClose(virNetSocket *sock); diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c index fe77594f65..07110446d8 100644 --- a/src/rpc/virnetsshsession.c +++ b/src/rpc/virnetsshsession.c @@ -68,7 +68,6 @@ typedef enum { typedef struct _virNetSSHAuthMethod virNetSSHAuthMethod; -typedef virNetSSHAuthMethod *virNetSSHAuthMethodPtr; struct _virNetSSHAuthMethod { virNetSSHAuthMethods method; @@ -100,7 +99,7 @@ struct _virNetSSHSession { char *authPath; virNetSSHAuthCallbackError authCbErr; size_t nauths; - virNetSSHAuthMethodPtr *auths; + virNetSSHAuthMethod **auths; /* channel stuff */ char *channelCommand; @@ -113,7 +112,7 @@ struct _virNetSSHSession { }; static void -virNetSSHSessionAuthMethodsClear(virNetSSHSessionPtr sess) +virNetSSHSessionAuthMethodsClear(virNetSSHSession *sess) { size_t i; @@ -131,7 +130,7 @@ virNetSSHSessionAuthMethodsClear(virNetSSHSessionPtr sess) static void virNetSSHSessionDispose(void *obj) { - virNetSSHSessionPtr sess = obj; + virNetSSHSession *sess = obj; VIR_DEBUG("sess=0x%p", sess); if (sess->channel) { @@ -157,7 +156,7 @@ virNetSSHSessionDispose(void *obj) g_free(sess->authPath); } -static virClassPtr virNetSSHSessionClass; +static virClass *virNetSSHSessionClass; static int virNetSSHSessionOnceInit(void) { @@ -168,10 +167,10 @@ virNetSSHSessionOnceInit(void) } VIR_ONCE_GLOBAL_INIT(virNetSSHSession); -static virNetSSHAuthMethodPtr -virNetSSHSessionAuthMethodNew(virNetSSHSessionPtr sess) +static virNetSSHAuthMethod * +virNetSSHSessionAuthMethodNew(virNetSSHSession *sess) { - virNetSSHAuthMethodPtr auth; + virNetSSHAuthMethod *auth; auth = g_new0(virNetSSHAuthMethod, 1); @@ -192,7 +191,7 @@ virNetSSHKbIntCb(const char *name G_GNUC_UNUSED, LIBSSH2_USERAUTH_KBDINT_RESPONSE *responses, void **opaque) { - virNetSSHSessionPtr priv = *opaque; + virNetSSHSession *priv = *opaque; virConnectCredentialPtr askcred = NULL; size_t i; int credtype_echo = -1; @@ -266,7 +265,7 @@ virNetSSHKbIntCb(const char *name G_GNUC_UNUSED, * return value: 0 on success, -1 on error */ static int -virNetSSHCheckHostKey(virNetSSHSessionPtr sess) +virNetSSHCheckHostKey(virNetSSHSession *sess) { int ret; const char *key; @@ -478,8 +477,8 @@ virNetSSHCheckHostKey(virNetSSHSessionPtr sess) * -1 on error */ static int -virNetSSHAuthenticateAgent(virNetSSHSessionPtr sess, - virNetSSHAuthMethodPtr priv) +virNetSSHAuthenticateAgent(virNetSSHSession *sess, + virNetSSHAuthMethod *priv) { struct libssh2_agent_publickey *agent_identity = NULL; bool no_identity = true; @@ -552,8 +551,8 @@ virNetSSHAuthenticateAgent(virNetSSHSessionPtr sess, * -1 on error */ static int -virNetSSHAuthenticatePrivkey(virNetSSHSessionPtr sess, - virNetSSHAuthMethodPtr priv) +virNetSSHAuthenticatePrivkey(virNetSSHSession *sess, + virNetSSHAuthMethod *priv) { virConnectCredential retr_passphrase; size_t i; @@ -659,8 +658,8 @@ virNetSSHAuthenticatePrivkey(virNetSSHSessionPtr sess, * -1 on error */ static int -virNetSSHAuthenticatePassword(virNetSSHSessionPtr sess, - virNetSSHAuthMethodPtr priv) +virNetSSHAuthenticatePassword(virNetSSHSession *sess, + virNetSSHAuthMethod *priv) { char *password = NULL; char *errmsg; @@ -733,8 +732,8 @@ virNetSSHAuthenticatePassword(virNetSSHSessionPtr sess, * -1 on error */ static int -virNetSSHAuthenticateKeyboardInteractive(virNetSSHSessionPtr sess, - virNetSSHAuthMethodPtr priv) +virNetSSHAuthenticateKeyboardInteractive(virNetSSHSession *sess, + virNetSSHAuthMethod *priv) { char *errmsg; int ret; @@ -798,9 +797,9 @@ virNetSSHAuthenticateKeyboardInteractive(virNetSSHSessionPtr sess, /* select auth method and authenticate */ static int -virNetSSHAuthenticate(virNetSSHSessionPtr sess) +virNetSSHAuthenticate(virNetSSHSession *sess) { - virNetSSHAuthMethodPtr auth; + virNetSSHAuthMethod *auth; bool no_method = false; bool auth_failed = false; char *auth_list; @@ -891,7 +890,7 @@ virNetSSHAuthenticate(virNetSSHSessionPtr sess) /* open channel */ static int -virNetSSHOpenChannel(virNetSSHSessionPtr sess) +virNetSSHOpenChannel(virNetSSHSession *sess) { char *errmsg; @@ -922,7 +921,7 @@ virNetSSHOpenChannel(virNetSSHSessionPtr sess) /* validate if all required parameters are configured */ static int -virNetSSHValidateConfig(virNetSSHSessionPtr sess) +virNetSSHValidateConfig(virNetSSHSession *sess) { if (sess->nauths == 0) { virReportError(VIR_ERR_SSH, "%s", @@ -951,7 +950,7 @@ virNetSSHValidateConfig(virNetSSHSessionPtr sess) /* ### PUBLIC API ### */ int -virNetSSHSessionAuthSetCallback(virNetSSHSessionPtr sess, +virNetSSHSessionAuthSetCallback(virNetSSHSession *sess, virConnectAuthPtr auth) { virObjectLock(sess); @@ -961,7 +960,7 @@ virNetSSHSessionAuthSetCallback(virNetSSHSessionPtr sess, } void -virNetSSHSessionAuthReset(virNetSSHSessionPtr sess) +virNetSSHSessionAuthReset(virNetSSHSession *sess) { virObjectLock(sess); virNetSSHSessionAuthMethodsClear(sess); @@ -969,11 +968,11 @@ virNetSSHSessionAuthReset(virNetSSHSessionPtr sess) } int -virNetSSHSessionAuthAddPasswordAuth(virNetSSHSessionPtr sess, - virURIPtr uri, +virNetSSHSessionAuthAddPasswordAuth(virNetSSHSession *sess, + virURI *uri, const char *username) { - virNetSSHAuthMethodPtr auth; + virNetSSHAuthMethod *auth; char *user = NULL; if (uri) { @@ -1009,10 +1008,10 @@ virNetSSHSessionAuthAddPasswordAuth(virNetSSHSessionPtr sess, } int -virNetSSHSessionAuthAddAgentAuth(virNetSSHSessionPtr sess, +virNetSSHSessionAuthAddAgentAuth(virNetSSHSession *sess, const char *username) { - virNetSSHAuthMethodPtr auth; + virNetSSHAuthMethod *auth; char *user = NULL; if (!username) { @@ -1042,12 +1041,12 @@ virNetSSHSessionAuthAddAgentAuth(virNetSSHSessionPtr sess, } int -virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSessionPtr sess, +virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSession *sess, const char *username, const char *keyfile, const char *password) { - virNetSSHAuthMethodPtr auth; + virNetSSHAuthMethod *auth; char *user = NULL; char *pass = NULL; @@ -1086,11 +1085,11 @@ virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSessionPtr sess, } int -virNetSSHSessionAuthAddKeyboardAuth(virNetSSHSessionPtr sess, +virNetSSHSessionAuthAddKeyboardAuth(virNetSSHSession *sess, const char *username, int tries) { - virNetSSHAuthMethodPtr auth; + virNetSSHAuthMethod *auth; char *user = NULL; if (!username) { @@ -1122,7 +1121,7 @@ virNetSSHSessionAuthAddKeyboardAuth(virNetSSHSessionPtr sess, } void -virNetSSHSessionSetChannelCommand(virNetSSHSessionPtr sess, +virNetSSHSessionSetChannelCommand(virNetSSHSession *sess, const char *command) { virObjectLock(sess); @@ -1135,7 +1134,7 @@ virNetSSHSessionSetChannelCommand(virNetSSHSessionPtr sess, } int -virNetSSHSessionSetHostKeyVerification(virNetSSHSessionPtr sess, +virNetSSHSessionSetHostKeyVerification(virNetSSHSession *sess, const char *hostname, int port, const char *hostsfile, @@ -1188,9 +1187,9 @@ virNetSSHSessionSetHostKeyVerification(virNetSSHSessionPtr sess, } /* allocate and initialize a ssh session object */ -virNetSSHSessionPtr virNetSSHSessionNew(void) +virNetSSHSession *virNetSSHSessionNew(void) { - virNetSSHSessionPtr sess = NULL; + virNetSSHSession *sess = NULL; if (virNetSSHSessionInitialize() < 0) goto error; @@ -1221,7 +1220,7 @@ virNetSSHSessionPtr virNetSSHSessionNew(void) goto error; } - VIR_DEBUG("virNetSSHSessionPtr: %p, LIBSSH2_SESSION: %p", + VIR_DEBUG("virNetSSHSession *: %p, LIBSSH2_SESSION: %p", sess, sess->session); /* set blocking mode for libssh2 until handshake is complete */ @@ -1239,7 +1238,7 @@ virNetSSHSessionPtr virNetSSHSessionNew(void) } int -virNetSSHSessionConnect(virNetSSHSessionPtr sess, +virNetSSHSessionConnect(virNetSSHSession *sess, int sock) { int ret; @@ -1249,7 +1248,7 @@ virNetSSHSessionConnect(virNetSSHSessionPtr sess, if (!sess || sess->state != VIR_NET_SSH_STATE_NEW) { virReportError(VIR_ERR_SSH, "%s", - _("Invalid virNetSSHSessionPtr")); + _("Invalid virNetSSHSession *")); return -1; } @@ -1298,7 +1297,7 @@ virNetSSHSessionConnect(virNetSSHSessionPtr sess, /* do a read from a ssh channel, used instead of normal read on socket */ ssize_t -virNetSSHChannelRead(virNetSSHSessionPtr sess, +virNetSSHChannelRead(virNetSSHSession *sess, char *buf, size_t len) { @@ -1410,7 +1409,7 @@ virNetSSHChannelRead(virNetSSHSessionPtr sess, } ssize_t -virNetSSHChannelWrite(virNetSSHSessionPtr sess, +virNetSSHChannelWrite(virNetSSHSession *sess, const char *buf, size_t len) { @@ -1467,7 +1466,7 @@ virNetSSHChannelWrite(virNetSSHSessionPtr sess, } bool -virNetSSHSessionHasCachedData(virNetSSHSessionPtr sess) +virNetSSHSessionHasCachedData(virNetSSHSession *sess) { bool ret; diff --git a/src/rpc/virnetsshsession.h b/src/rpc/virnetsshsession.h index 4d639da453..7a056df37f 100644 --- a/src/rpc/virnetsshsession.h +++ b/src/rpc/virnetsshsession.h @@ -24,10 +24,9 @@ #include "viruri.h" typedef struct _virNetSSHSession virNetSSHSession; -typedef virNetSSHSession *virNetSSHSessionPtr; -virNetSSHSessionPtr virNetSSHSessionNew(void); -void virNetSSHSessionFree(virNetSSHSessionPtr sess); +virNetSSHSession *virNetSSHSessionNew(void); +void virNetSSHSessionFree(virNetSSHSession *sess); typedef enum { VIR_NET_SSH_HOSTKEY_VERIFY_NORMAL, @@ -40,46 +39,46 @@ typedef enum { VIR_NET_SSH_HOSTKEY_FILE_CREATE = 1 << 1, } virNetSSHHostKeyFileFlags; -void virNetSSHSessionSetChannelCommand(virNetSSHSessionPtr sess, +void virNetSSHSessionSetChannelCommand(virNetSSHSession *sess, const char *command); -void virNetSSHSessionAuthReset(virNetSSHSessionPtr sess); +void virNetSSHSessionAuthReset(virNetSSHSession *sess); -int virNetSSHSessionAuthSetCallback(virNetSSHSessionPtr sess, +int virNetSSHSessionAuthSetCallback(virNetSSHSession *sess, virConnectAuthPtr auth); -int virNetSSHSessionAuthAddPasswordAuth(virNetSSHSessionPtr sess, - virURIPtr uri, +int virNetSSHSessionAuthAddPasswordAuth(virNetSSHSession *sess, + virURI *uri, const char *username); -int virNetSSHSessionAuthAddAgentAuth(virNetSSHSessionPtr sess, +int virNetSSHSessionAuthAddAgentAuth(virNetSSHSession *sess, const char *username); -int virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSessionPtr sess, +int virNetSSHSessionAuthAddPrivKeyAuth(virNetSSHSession *sess, const char *username, const char *keyfile, const char *password); -int virNetSSHSessionAuthAddKeyboardAuth(virNetSSHSessionPtr sess, +int virNetSSHSessionAuthAddKeyboardAuth(virNetSSHSession *sess, const char *username, int tries); -int virNetSSHSessionSetHostKeyVerification(virNetSSHSessionPtr sess, +int virNetSSHSessionSetHostKeyVerification(virNetSSHSession *sess, const char *hostname, int port, const char *hostsfile, virNetSSHHostkeyVerify opt, unsigned int flags); -int virNetSSHSessionConnect(virNetSSHSessionPtr sess, +int virNetSSHSessionConnect(virNetSSHSession *sess, int sock); -ssize_t virNetSSHChannelRead(virNetSSHSessionPtr sess, +ssize_t virNetSSHChannelRead(virNetSSHSession *sess, char *buf, size_t len); -ssize_t virNetSSHChannelWrite(virNetSSHSessionPtr sess, +ssize_t virNetSSHChannelWrite(virNetSSHSession *sess, const char *buf, size_t len); -bool virNetSSHSessionHasCachedData(virNetSSHSessionPtr sess); +bool virNetSSHSessionHasCachedData(virNetSSHSession *sess); diff --git a/src/rpc/virnettlscontext.c b/src/rpc/virnettlscontext.c index c1d8cdeaae..1340faa224 100644 --- a/src/rpc/virnettlscontext.c +++ b/src/rpc/virnettlscontext.c @@ -78,8 +78,8 @@ struct _virNetTLSSession { char *x509dname; }; -static virClassPtr virNetTLSContextClass; -static virClassPtr virNetTLSSessionClass; +static virClass *virNetTLSContextClass; +static virClass *virNetTLSSessionClass; static void virNetTLSContextDispose(void *obj); static void virNetTLSSessionDispose(void *obj); @@ -593,7 +593,7 @@ static int virNetTLSContextSanityCheckCredentials(bool isServer, } -static int virNetTLSContextLoadCredentials(virNetTLSContextPtr ctxt, +static int virNetTLSContextLoadCredentials(virNetTLSContext *ctxt, bool isServer, const char *cacert, const char *cacrl, @@ -669,7 +669,7 @@ static int virNetTLSContextLoadCredentials(virNetTLSContextPtr ctxt, } -static virNetTLSContextPtr virNetTLSContextNew(const char *cacert, +static virNetTLSContext *virNetTLSContextNew(const char *cacert, const char *cacrl, const char *cert, const char *key, @@ -679,7 +679,7 @@ static virNetTLSContextPtr virNetTLSContextNew(const char *cacert, bool requireValidCert, bool isServer) { - virNetTLSContextPtr ctxt; + virNetTLSContext *ctxt; int err; if (virNetTLSContextInitialize() < 0) @@ -851,7 +851,7 @@ static int virNetTLSContextLocateCredentials(const char *pkipath, } -static virNetTLSContextPtr virNetTLSContextNewPath(const char *pkipath, +static virNetTLSContext *virNetTLSContextNewPath(const char *pkipath, bool tryUserPkiPath, const char *const *x509dnACL, const char *priority, @@ -860,7 +860,7 @@ static virNetTLSContextPtr virNetTLSContextNewPath(const char *pkipath, bool isServer) { char *cacert = NULL, *cacrl = NULL, *key = NULL, *cert = NULL; - virNetTLSContextPtr ctxt = NULL; + virNetTLSContext *ctxt = NULL; if (virNetTLSContextLocateCredentials(pkipath, tryUserPkiPath, isServer, &cacert, &cacrl, &cert, &key) < 0) @@ -878,7 +878,7 @@ static virNetTLSContextPtr virNetTLSContextNewPath(const char *pkipath, return ctxt; } -virNetTLSContextPtr virNetTLSContextNewServerPath(const char *pkipath, +virNetTLSContext *virNetTLSContextNewServerPath(const char *pkipath, bool tryUserPkiPath, const char *const *x509dnACL, const char *priority, @@ -889,7 +889,7 @@ virNetTLSContextPtr virNetTLSContextNewServerPath(const char *pkipath, sanityCheckCert, requireValidCert, true); } -virNetTLSContextPtr virNetTLSContextNewClientPath(const char *pkipath, +virNetTLSContext *virNetTLSContextNewClientPath(const char *pkipath, bool tryUserPkiPath, const char *priority, bool sanityCheckCert, @@ -900,7 +900,7 @@ virNetTLSContextPtr virNetTLSContextNewClientPath(const char *pkipath, } -virNetTLSContextPtr virNetTLSContextNewServer(const char *cacert, +virNetTLSContext *virNetTLSContextNewServer(const char *cacert, const char *cacrl, const char *cert, const char *key, @@ -914,7 +914,7 @@ virNetTLSContextPtr virNetTLSContextNewServer(const char *cacert, } -int virNetTLSContextReloadForServer(virNetTLSContextPtr ctxt, +int virNetTLSContextReloadForServer(virNetTLSContext *ctxt, bool tryUserPkiPath) { gnutls_certificate_credentials_t x509credBak; @@ -959,7 +959,7 @@ int virNetTLSContextReloadForServer(virNetTLSContextPtr ctxt, } -virNetTLSContextPtr virNetTLSContextNewClient(const char *cacert, +virNetTLSContext *virNetTLSContextNewClient(const char *cacert, const char *cacrl, const char *cert, const char *key, @@ -972,8 +972,8 @@ virNetTLSContextPtr virNetTLSContextNewClient(const char *cacert, } -static int virNetTLSContextValidCertificate(virNetTLSContextPtr ctxt, - virNetTLSSessionPtr sess) +static int virNetTLSContextValidCertificate(virNetTLSContext *ctxt, + virNetTLSSession *sess) { int ret; unsigned int status; @@ -1111,8 +1111,8 @@ static int virNetTLSContextValidCertificate(virNetTLSContextPtr ctxt, return -1; } -int virNetTLSContextCheckCertificate(virNetTLSContextPtr ctxt, - virNetTLSSessionPtr sess) +int virNetTLSContextCheckCertificate(virNetTLSContext *ctxt, + virNetTLSSession *sess) { int ret = -1; @@ -1140,7 +1140,7 @@ int virNetTLSContextCheckCertificate(virNetTLSContextPtr ctxt, void virNetTLSContextDispose(void *obj) { - virNetTLSContextPtr ctxt = obj; + virNetTLSContext *ctxt = obj; PROBE(RPC_TLS_CONTEXT_DISPOSE, "ctxt=%p", ctxt); @@ -1154,7 +1154,7 @@ void virNetTLSContextDispose(void *obj) static ssize_t virNetTLSSessionPush(void *opaque, const void *buf, size_t len) { - virNetTLSSessionPtr sess = opaque; + virNetTLSSession *sess = opaque; if (!sess->writeFunc) { VIR_WARN("TLS session push with missing write function"); errno = EIO; @@ -1168,7 +1168,7 @@ virNetTLSSessionPush(void *opaque, const void *buf, size_t len) static ssize_t virNetTLSSessionPull(void *opaque, void *buf, size_t len) { - virNetTLSSessionPtr sess = opaque; + virNetTLSSession *sess = opaque; if (!sess->readFunc) { VIR_WARN("TLS session pull with missing read function"); errno = EIO; @@ -1179,10 +1179,10 @@ virNetTLSSessionPull(void *opaque, void *buf, size_t len) } -virNetTLSSessionPtr virNetTLSSessionNew(virNetTLSContextPtr ctxt, +virNetTLSSession *virNetTLSSessionNew(virNetTLSContext *ctxt, const char *hostname) { - virNetTLSSessionPtr sess; + virNetTLSSession *sess; int err; const char *priority; @@ -1253,7 +1253,7 @@ virNetTLSSessionPtr virNetTLSSessionNew(virNetTLSContextPtr ctxt, } -void virNetTLSSessionSetIOCallbacks(virNetTLSSessionPtr sess, +void virNetTLSSessionSetIOCallbacks(virNetTLSSession *sess, virNetTLSSessionWriteFunc writeFunc, virNetTLSSessionReadFunc readFunc, void *opaque) @@ -1266,7 +1266,7 @@ void virNetTLSSessionSetIOCallbacks(virNetTLSSessionPtr sess, } -ssize_t virNetTLSSessionWrite(virNetTLSSessionPtr sess, +ssize_t virNetTLSSessionWrite(virNetTLSSession *sess, const char *buf, size_t len) { ssize_t ret; @@ -1299,7 +1299,7 @@ ssize_t virNetTLSSessionWrite(virNetTLSSessionPtr sess, return ret; } -ssize_t virNetTLSSessionRead(virNetTLSSessionPtr sess, +ssize_t virNetTLSSessionRead(virNetTLSSession *sess, char *buf, size_t len) { ssize_t ret; @@ -1329,7 +1329,7 @@ ssize_t virNetTLSSessionRead(virNetTLSSessionPtr sess, return ret; } -int virNetTLSSessionHandshake(virNetTLSSessionPtr sess) +int virNetTLSSessionHandshake(virNetTLSSession *sess) { int ret; VIR_DEBUG("sess=%p", sess); @@ -1362,7 +1362,7 @@ int virNetTLSSessionHandshake(virNetTLSSessionPtr sess) } virNetTLSSessionHandshakeStatus -virNetTLSSessionGetHandshakeStatus(virNetTLSSessionPtr sess) +virNetTLSSessionGetHandshakeStatus(virNetTLSSession *sess) { virNetTLSSessionHandshakeStatus ret; virObjectLock(sess); @@ -1376,7 +1376,7 @@ virNetTLSSessionGetHandshakeStatus(virNetTLSSessionPtr sess) return ret; } -int virNetTLSSessionGetKeySize(virNetTLSSessionPtr sess) +int virNetTLSSessionGetKeySize(virNetTLSSession *sess) { gnutls_cipher_algorithm_t cipher; int ssf; @@ -1394,7 +1394,7 @@ int virNetTLSSessionGetKeySize(virNetTLSSessionPtr sess) return ssf; } -const char *virNetTLSSessionGetX509DName(virNetTLSSessionPtr sess) +const char *virNetTLSSessionGetX509DName(virNetTLSSession *sess) { const char *ret = NULL; @@ -1409,7 +1409,7 @@ const char *virNetTLSSessionGetX509DName(virNetTLSSessionPtr sess) void virNetTLSSessionDispose(void *obj) { - virNetTLSSessionPtr sess = obj; + virNetTLSSession *sess = obj; PROBE(RPC_TLS_SESSION_DISPOSE, "sess=%p", sess); diff --git a/src/rpc/virnettlscontext.h b/src/rpc/virnettlscontext.h index 8ac84027b2..11c954ce4b 100644 --- a/src/rpc/virnettlscontext.h +++ b/src/rpc/virnettlscontext.h @@ -24,28 +24,26 @@ #include "virobject.h" typedef struct _virNetTLSContext virNetTLSContext; -typedef virNetTLSContext *virNetTLSContextPtr; typedef struct _virNetTLSSession virNetTLSSession; -typedef virNetTLSSession *virNetTLSSessionPtr; void virNetTLSInit(void); -virNetTLSContextPtr virNetTLSContextNewServerPath(const char *pkipath, +virNetTLSContext *virNetTLSContextNewServerPath(const char *pkipath, bool tryUserPkiPath, const char *const *x509dnACL, const char *priority, bool sanityCheckCert, bool requireValidCert); -virNetTLSContextPtr virNetTLSContextNewClientPath(const char *pkipath, +virNetTLSContext *virNetTLSContextNewClientPath(const char *pkipath, bool tryUserPkiPath, const char *priority, bool sanityCheckCert, bool requireValidCert); -virNetTLSContextPtr virNetTLSContextNewServer(const char *cacert, +virNetTLSContext *virNetTLSContextNewServer(const char *cacert, const char *cacrl, const char *cert, const char *key, @@ -54,7 +52,7 @@ virNetTLSContextPtr virNetTLSContextNewServer(const char *cacert, bool sanityCheckCert, bool requireValidCert); -virNetTLSContextPtr virNetTLSContextNewClient(const char *cacert, +virNetTLSContext *virNetTLSContextNewClient(const char *cacert, const char *cacrl, const char *cert, const char *key, @@ -62,11 +60,11 @@ virNetTLSContextPtr virNetTLSContextNewClient(const char *cacert, bool sanityCheckCert, bool requireValidCert); -int virNetTLSContextReloadForServer(virNetTLSContextPtr ctxt, +int virNetTLSContextReloadForServer(virNetTLSContext *ctxt, bool tryUserPkiPath); -int virNetTLSContextCheckCertificate(virNetTLSContextPtr ctxt, - virNetTLSSessionPtr sess); +int virNetTLSContextCheckCertificate(virNetTLSContext *ctxt, + virNetTLSSession *sess); typedef ssize_t (*virNetTLSSessionWriteFunc)(const char *buf, size_t len, @@ -74,20 +72,20 @@ typedef ssize_t (*virNetTLSSessionWriteFunc)(const char *buf, size_t len, typedef ssize_t (*virNetTLSSessionReadFunc)(char *buf, size_t len, void *opaque); -virNetTLSSessionPtr virNetTLSSessionNew(virNetTLSContextPtr ctxt, +virNetTLSSession *virNetTLSSessionNew(virNetTLSContext *ctxt, const char *hostname); -void virNetTLSSessionSetIOCallbacks(virNetTLSSessionPtr sess, +void virNetTLSSessionSetIOCallbacks(virNetTLSSession *sess, virNetTLSSessionWriteFunc writeFunc, virNetTLSSessionReadFunc readFunc, void *opaque); -ssize_t virNetTLSSessionWrite(virNetTLSSessionPtr sess, +ssize_t virNetTLSSessionWrite(virNetTLSSession *sess, const char *buf, size_t len); -ssize_t virNetTLSSessionRead(virNetTLSSessionPtr sess, +ssize_t virNetTLSSessionRead(virNetTLSSession *sess, char *buf, size_t len); -int virNetTLSSessionHandshake(virNetTLSSessionPtr sess); +int virNetTLSSessionHandshake(virNetTLSSession *sess); typedef enum { VIR_NET_TLS_HANDSHAKE_COMPLETE, @@ -96,8 +94,8 @@ typedef enum { } virNetTLSSessionHandshakeStatus; virNetTLSSessionHandshakeStatus -virNetTLSSessionGetHandshakeStatus(virNetTLSSessionPtr sess); +virNetTLSSessionGetHandshakeStatus(virNetTLSSession *sess); -int virNetTLSSessionGetKeySize(virNetTLSSessionPtr sess); +int virNetTLSSessionGetKeySize(virNetTLSSession *sess); -const char *virNetTLSSessionGetX509DName(virNetTLSSessionPtr sess); +const char *virNetTLSSessionGetX509DName(virNetTLSSession *sess); diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c index c24aedbe1b..6ea8cc8ce9 100644 --- a/src/secret/secret_driver.c +++ b/src/secret/secret_driver.c @@ -52,13 +52,12 @@ enum { SECRET_MAX_XML_FILE = 10*1024*1024 }; /* Internal driver state */ typedef struct _virSecretDriverState virSecretDriverState; -typedef virSecretDriverState *virSecretDriverStatePtr; struct _virSecretDriverState { virMutex lock; bool privileged; /* readonly */ char *embeddedRoot; /* readonly */ int embeddedRefs; - virSecretObjListPtr secrets; + virSecretObjList *secrets; char *stateDir; char *configDir; @@ -66,10 +65,10 @@ struct _virSecretDriverState { int lockFD; /* Immutable pointer, self-locking APIs */ - virObjectEventStatePtr secretEventState; + virObjectEventState *secretEventState; }; -static virSecretDriverStatePtr driver; +static virSecretDriverState *driver; static void secretDriverLock(void) @@ -85,10 +84,10 @@ secretDriverUnlock(void) } -static virSecretObjPtr +static virSecretObj * secretObjFromSecret(virSecretPtr secret) { - virSecretObjPtr obj; + virSecretObj *obj; char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(secret->uuid, uuidstr); @@ -151,8 +150,8 @@ secretLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { virSecretPtr ret = NULL; - virSecretObjPtr obj; - virSecretDefPtr def; + virSecretObj *obj; + virSecretDef *def; char uuidstr[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(uuid, uuidstr); @@ -183,8 +182,8 @@ secretLookupByUsage(virConnectPtr conn, const char *usageID) { virSecretPtr ret = NULL; - virSecretObjPtr obj; - virSecretDefPtr def; + virSecretObj *obj; + virSecretDef *def; if (!(obj = virSecretObjListFindByUsage(driver->secrets, usageType, usageID))) { @@ -214,11 +213,11 @@ secretDefineXML(virConnectPtr conn, unsigned int flags) { virSecretPtr ret = NULL; - virSecretObjPtr obj = NULL; - virSecretDefPtr objDef; - virSecretDefPtr backup = NULL; - virSecretDefPtr def; - virObjectEventPtr event = NULL; + virSecretObj *obj = NULL; + virSecretDef *objDef; + virSecretDef *backup = NULL; + virSecretDef *def; + virObjectEvent *event = NULL; virCheckFlags(0, NULL); @@ -293,8 +292,8 @@ secretGetXMLDesc(virSecretPtr secret, unsigned int flags) { char *ret = NULL; - virSecretObjPtr obj; - virSecretDefPtr def; + virSecretObj *obj; + virSecretDef *def; virCheckFlags(0, NULL); @@ -321,9 +320,9 @@ secretSetValue(virSecretPtr secret, unsigned int flags) { int ret = -1; - virSecretObjPtr obj; - virSecretDefPtr def; - virObjectEventPtr event = NULL; + virSecretObj *obj; + virSecretDef *def; + virObjectEvent *event = NULL; virCheckFlags(0, -1); @@ -357,8 +356,8 @@ secretGetValue(virSecretPtr secret, unsigned int internalFlags) { unsigned char *ret = NULL; - virSecretObjPtr obj; - virSecretDefPtr def; + virSecretObj *obj; + virSecretDef *def; virCheckFlags(0, NULL); @@ -392,9 +391,9 @@ static int secretUndefine(virSecretPtr secret) { int ret = -1; - virSecretObjPtr obj; - virSecretDefPtr def; - virObjectEventPtr event = NULL; + virSecretObj *obj; + virSecretDef *def; + virObjectEvent *event = NULL; if (!(obj = secretObjFromSecret(secret))) goto cleanup; @@ -539,7 +538,7 @@ secretStateReload(void) static virDrvOpenStatus secretConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c index e6ecb513b1..a2a8435fe4 100644 --- a/src/security/security_apparmor.c +++ b/src/security/security_apparmor.c @@ -56,8 +56,8 @@ VIR_LOG_INIT("security.security_apparmor"); /* Data structure to pass to *FileIterate so we have everything we need */ struct SDPDOP { - virSecurityManagerPtr mgr; - virDomainDefPtr def; + virSecurityManager *mgr; + virDomainDef *def; }; /* @@ -157,16 +157,16 @@ profile_status_file(const char *str) * load (add) a profile. Will create one if necessary */ static int -load_profile(virSecurityManagerPtr mgr G_GNUC_UNUSED, +load_profile(virSecurityManager *mgr G_GNUC_UNUSED, const char *profile, - virDomainDefPtr def, + virDomainDef *def, const char *fn, bool append) { int rc = -1; bool create = true; char *xml = NULL; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; xml = virDomainDefFormat(def, NULL, VIR_DOMAIN_DEF_FORMAT_SECURE); if (!xml) @@ -210,7 +210,7 @@ remove_profile(const char *profile) } static char * -get_profile_name(virDomainDefPtr def) +get_profile_name(virDomainDef *def) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -262,12 +262,12 @@ use_apparmor(void) * NULL. */ static int -reload_profile(virSecurityManagerPtr mgr, - virDomainDefPtr def, +reload_profile(virSecurityManager *mgr, + virDomainDef *def, const char *fn, bool append) { - virSecurityLabelDefPtr secdef = virDomainDefGetSecurityLabelDef( + virSecurityLabelDef *secdef = virDomainDefGetSecurityLabelDef( def, SECURITY_APPARMOR_NAME); if (!secdef || !secdef->relabel) @@ -290,34 +290,34 @@ static int AppArmorSetSecurityHostdevLabelHelper(const char *file, void *opaque) { struct SDPDOP *ptr = opaque; - virDomainDefPtr def = ptr->def; + virDomainDef *def = ptr->def; return reload_profile(ptr->mgr, def, file, true); } static int -AppArmorSetSecurityUSBLabel(virUSBDevicePtr dev G_GNUC_UNUSED, +AppArmorSetSecurityUSBLabel(virUSBDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { return AppArmorSetSecurityHostdevLabelHelper(file, opaque); } static int -AppArmorSetSecurityPCILabel(virPCIDevicePtr dev G_GNUC_UNUSED, +AppArmorSetSecurityPCILabel(virPCIDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { return AppArmorSetSecurityHostdevLabelHelper(file, opaque); } static int -AppArmorSetSecuritySCSILabel(virSCSIDevicePtr dev G_GNUC_UNUSED, +AppArmorSetSecuritySCSILabel(virSCSIDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { return AppArmorSetSecurityHostdevLabelHelper(file, opaque); } static int -AppArmorSetSecurityHostLabel(virSCSIVHostDevicePtr dev G_GNUC_UNUSED, +AppArmorSetSecurityHostLabel(virSCSIVHostDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { return AppArmorSetSecurityHostdevLabelHelper(file, opaque); @@ -361,25 +361,25 @@ AppArmorSecurityManagerProbe(const char *virtDriver G_GNUC_UNUSED) * currently not used. */ static int -AppArmorSecurityManagerOpen(virSecurityManagerPtr mgr G_GNUC_UNUSED) +AppArmorSecurityManagerOpen(virSecurityManager *mgr G_GNUC_UNUSED) { return 0; } static int -AppArmorSecurityManagerClose(virSecurityManagerPtr mgr G_GNUC_UNUSED) +AppArmorSecurityManagerClose(virSecurityManager *mgr G_GNUC_UNUSED) { return 0; } static const char * -AppArmorSecurityManagerGetModel(virSecurityManagerPtr mgr G_GNUC_UNUSED) +AppArmorSecurityManagerGetModel(virSecurityManager *mgr G_GNUC_UNUSED) { return SECURITY_APPARMOR_NAME; } static const char * -AppArmorSecurityManagerGetDOI(virSecurityManagerPtr mgr G_GNUC_UNUSED) +AppArmorSecurityManagerGetDOI(virSecurityManager *mgr G_GNUC_UNUSED) { return SECURITY_APPARMOR_VOID_DOI; } @@ -391,12 +391,12 @@ AppArmorSecurityManagerGetDOI(virSecurityManagerPtr mgr G_GNUC_UNUSED) * called on shutdown. */ static int -AppArmorGenSecurityLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def) +AppArmorGenSecurityLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def) { int rc = -1; char *profile_name = NULL; - virSecurityLabelDefPtr secdef = virDomainDefGetSecurityLabelDef(def, + virSecurityLabelDef *secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); if (!secdef) @@ -453,13 +453,13 @@ AppArmorGenSecurityLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -AppArmorSetSecurityAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +AppArmorSetSecurityAllLabel(virSecurityManager *mgr, + virDomainDef *def, const char *incomingPath, bool chardevStdioLogd G_GNUC_UNUSED, bool migrated G_GNUC_UNUSED) { - virSecurityLabelDefPtr secdef = virDomainDefGetSecurityLabelDef(def, + virSecurityLabelDef *secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); if (!secdef || !secdef->relabel) return 0; @@ -476,8 +476,8 @@ AppArmorSetSecurityAllLabel(virSecurityManagerPtr mgr, * running. */ static int -AppArmorGetSecurityProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def, +AppArmorGetSecurityProcessLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def, pid_t pid G_GNUC_UNUSED, virSecurityLabelPtr sec) { @@ -516,10 +516,10 @@ AppArmorGetSecurityProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, * more details. Currently called via qemudShutdownVMDaemon. */ static int -AppArmorReleaseSecurityLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def) +AppArmorReleaseSecurityLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def) { - virSecurityLabelDefPtr secdef = virDomainDefGetSecurityLabelDef(def, + virSecurityLabelDef *secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); if (secdef) { VIR_FREE(secdef->model); @@ -532,13 +532,13 @@ AppArmorReleaseSecurityLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, static int -AppArmorRestoreSecurityAllLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def, +AppArmorRestoreSecurityAllLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def, bool migrated G_GNUC_UNUSED, bool chardevStdioLogd G_GNUC_UNUSED) { int rc = 0; - virSecurityLabelDefPtr secdef = + virSecurityLabelDef *secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); if (!secdef) @@ -558,12 +558,12 @@ AppArmorRestoreSecurityAllLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, * LOCALSTATEDIR/log/libvirt/qemu/.log */ static int -AppArmorSetSecurityProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def) +AppArmorSetSecurityProcessLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def) { int rc = -1; char *profile_name = NULL; - virSecurityLabelDefPtr secdef = + virSecurityLabelDef *secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); if (!secdef || !secdef->label) @@ -602,14 +602,14 @@ AppArmorSetSecurityProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, * process*. */ static int -AppArmorSetSecurityChildProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def, - virCommandPtr cmd) +AppArmorSetSecurityChildProcessLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def, + virCommand *cmd) { int rc = -1; char *profile_name = NULL; char *cmd_str = NULL; - virSecurityLabelDefPtr secdef = + virSecurityLabelDef *secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); if (!secdef || !secdef->label) @@ -640,22 +640,22 @@ AppArmorSetSecurityChildProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -AppArmorSetSecurityDaemonSocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED) +AppArmorSetSecurityDaemonSocketLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED) { return 0; } static int -AppArmorSetSecuritySocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED) +AppArmorSetSecuritySocketLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED) { return 0; } static int -AppArmorClearSecuritySocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED) +AppArmorClearSecuritySocketLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED) { return 0; } @@ -663,9 +663,9 @@ AppArmorClearSecuritySocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, /* Called when hotplugging */ static int -AppArmorRestoreSecurityImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, +AppArmorRestoreSecurityImageLabel(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, virSecurityDomainImageLabelFlags flags G_GNUC_UNUSED) { if (!virStorageSourceIsLocalStorage(src)) @@ -677,9 +677,9 @@ AppArmorRestoreSecurityImageLabel(virSecurityManagerPtr mgr, /* Called when hotplugging */ static int -AppArmorSetMemoryLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainMemoryDefPtr mem) +AppArmorSetMemoryLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainMemoryDef *mem) { switch (mem->model) { case VIR_DOMAIN_MEMORY_MODEL_NVDIMM: @@ -702,18 +702,18 @@ AppArmorSetMemoryLabel(virSecurityManagerPtr mgr, static int -AppArmorRestoreMemoryLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainMemoryDefPtr mem G_GNUC_UNUSED) +AppArmorRestoreMemoryLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainMemoryDef *mem G_GNUC_UNUSED) { return reload_profile(mgr, def, NULL, false); } /* Called when hotplugging */ static int -AppArmorSetInputLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainInputDefPtr input) +AppArmorSetInputLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainInputDef *input) { if (input == NULL) return 0; @@ -747,18 +747,18 @@ AppArmorSetInputLabel(virSecurityManagerPtr mgr, static int -AppArmorRestoreInputLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainInputDefPtr input G_GNUC_UNUSED) +AppArmorRestoreInputLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainInputDef *input G_GNUC_UNUSED) { return reload_profile(mgr, def, NULL, false); } /* Called when hotplugging */ static int -AppArmorSetSecurityImageLabelInternal(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src) +AppArmorSetSecurityImageLabelInternal(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src) { g_autofree char *vfioGroupDev = NULL; const char *path; @@ -789,13 +789,13 @@ AppArmorSetSecurityImageLabelInternal(virSecurityManagerPtr mgr, } static int -AppArmorSetSecurityImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, +AppArmorSetSecurityImageLabel(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, virSecurityDomainImageLabelFlags flags G_GNUC_UNUSED) { - virSecurityLabelDefPtr secdef; - virStorageSourcePtr n; + virSecurityLabelDef *secdef; + virStorageSource *n; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); if (!secdef || !secdef->relabel) @@ -813,10 +813,10 @@ AppArmorSetSecurityImageLabel(virSecurityManagerPtr mgr, } static int -AppArmorSecurityVerify(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def) +AppArmorSecurityVerify(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def) { - virSecurityLabelDefPtr secdef = + virSecurityLabelDef *secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); if (!secdef) @@ -834,8 +834,8 @@ AppArmorSecurityVerify(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -AppArmorReserveSecurityLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, +AppArmorReserveSecurityLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, pid_t pid G_GNUC_UNUSED) { /* NOOP. Nothing to reserve with AppArmor */ @@ -843,20 +843,20 @@ AppArmorReserveSecurityLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainHostdevDefPtr dev, +AppArmorSetSecurityHostdevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainHostdevDef *dev, const char *vroot) { struct SDPDOP *ptr; int ret = -1; - virSecurityLabelDefPtr secdef = + virSecurityLabelDef *secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); - virDomainHostdevSubsysUSBPtr usbsrc = &dev->source.subsys.u.usb; - virDomainHostdevSubsysPCIPtr pcisrc = &dev->source.subsys.u.pci; - virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIVHostPtr hostsrc = &dev->source.subsys.u.scsi_host; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev; + virDomainHostdevSubsysUSB *usbsrc = &dev->source.subsys.u.usb; + virDomainHostdevSubsysPCI *pcisrc = &dev->source.subsys.u.pci; + virDomainHostdevSubsysSCSI *scsisrc = &dev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIVHost *hostsrc = &dev->source.subsys.u.scsi_host; + virDomainHostdevSubsysMediatedDev *mdevsrc = &dev->source.subsys.u.mdev; if (!secdef || !secdef->relabel) return 0; @@ -880,7 +880,7 @@ AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr, switch ((virDomainHostdevSubsysType)dev->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: { - virUSBDevicePtr usb = + virUSBDevice *usb = virUSBDeviceNew(usbsrc->bus, usbsrc->device, vroot); if (!usb) goto done; @@ -891,7 +891,7 @@ AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr, } case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: { - virPCIDevicePtr pci = + virPCIDevice *pci = virPCIDeviceNew(&pcisrc->addr); if (!pci) @@ -914,8 +914,8 @@ AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr, } case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; - virSCSIDevicePtr scsi = + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; + virSCSIDevice *scsi = virSCSIDeviceNew(NULL, scsihostsrc->adapter, scsihostsrc->bus, scsihostsrc->target, scsihostsrc->unit, @@ -931,7 +931,7 @@ AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr, } case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI_HOST: { - virSCSIVHostDevicePtr host = virSCSIVHostDeviceNew(hostsrc->wwpn); + virSCSIVHostDevice *host = virSCSIVHostDeviceNew(hostsrc->wwpn); if (!host) goto done; @@ -967,13 +967,13 @@ AppArmorSetSecurityHostdevLabel(virSecurityManagerPtr mgr, static int -AppArmorRestoreSecurityHostdevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainHostdevDefPtr dev G_GNUC_UNUSED, +AppArmorRestoreSecurityHostdevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainHostdevDef *dev G_GNUC_UNUSED, const char *vroot G_GNUC_UNUSED) { - virSecurityLabelDefPtr secdef = + virSecurityLabelDef *secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); if (!secdef || !secdef->relabel) @@ -983,14 +983,14 @@ AppArmorRestoreSecurityHostdevLabel(virSecurityManagerPtr mgr, } static int -AppArmorSetChardevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +AppArmorSetChardevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd G_GNUC_UNUSED) { char *in = NULL, *out = NULL; int ret = -1; - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); if (!secdef) @@ -1038,12 +1038,12 @@ AppArmorSetChardevLabel(virSecurityManagerPtr mgr, } static int -AppArmorRestoreChardevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source G_GNUC_UNUSED, +AppArmorRestoreChardevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source G_GNUC_UNUSED, bool chardevStdioLogd G_GNUC_UNUSED) { - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); if (!secdef) @@ -1053,8 +1053,8 @@ AppArmorRestoreChardevLabel(virSecurityManagerPtr mgr, } static int -AppArmorSetPathLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +AppArmorSetPathLabel(virSecurityManager *mgr, + virDomainDef *def, const char *path, bool allowSubtree) { @@ -1073,22 +1073,22 @@ AppArmorSetPathLabel(virSecurityManagerPtr mgr, } static int -AppArmorRestorePathLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +AppArmorRestorePathLabel(virSecurityManager *mgr, + virDomainDef *def, const char *path G_GNUC_UNUSED) { return reload_profile(mgr, def, NULL, false); } static int -AppArmorSetFDLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +AppArmorSetFDLabel(virSecurityManager *mgr, + virDomainDef *def, int fd) { char *proc = NULL; char *fd_path = NULL; - virSecurityLabelDefPtr secdef = + virSecurityLabelDef *secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_APPARMOR_NAME); if (!secdef || !secdef->imagelabel) @@ -1106,8 +1106,8 @@ AppArmorSetFDLabel(virSecurityManagerPtr mgr, } static char * -AppArmorGetMountOptions(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED) +AppArmorGetMountOptions(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED) { char *opts; @@ -1116,7 +1116,7 @@ AppArmorGetMountOptions(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static const char * -AppArmorGetBaseLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, +AppArmorGetBaseLabel(virSecurityManager *mgr G_GNUC_UNUSED, int virtType G_GNUC_UNUSED) { return NULL; diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 4b7eda2e68..e973964735 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -51,8 +51,6 @@ VIR_LOG_INIT("security.security_dac"); #define DEV_SEV "/dev/sev" typedef struct _virSecurityDACData virSecurityDACData; -typedef virSecurityDACData *virSecurityDACDataPtr; - struct _virSecurityDACData { uid_t user; gid_t group; @@ -65,15 +63,12 @@ struct _virSecurityDACData { }; typedef struct _virSecurityDACCallbackData virSecurityDACCallbackData; -typedef virSecurityDACCallbackData *virSecurityDACCallbackDataPtr; - struct _virSecurityDACCallbackData { - virSecurityManagerPtr manager; - virSecurityLabelDefPtr secdef; + virSecurityManager *manager; + virSecurityLabelDef *secdef; }; typedef struct _virSecurityDACChownItem virSecurityDACChownItem; -typedef virSecurityDACChownItem *virSecurityDACChownItemPtr; struct _virSecurityDACChownItem { char *path; const virStorageSource *src; @@ -84,10 +79,9 @@ struct _virSecurityDACChownItem { }; typedef struct _virSecurityDACChownList virSecurityDACChownList; -typedef virSecurityDACChownList *virSecurityDACChownListPtr; struct _virSecurityDACChownList { - virSecurityManagerPtr manager; - virSecurityDACChownItemPtr *items; + virSecurityManager *manager; + virSecurityDACChownItem **items; size_t nItems; bool lock; }; @@ -96,7 +90,7 @@ struct _virSecurityDACChownList { virThreadLocal chownList; static int -virSecurityDACChownListAppend(virSecurityDACChownListPtr list, +virSecurityDACChownListAppend(virSecurityDACChownList *list, const char *path, const virStorageSource *src, uid_t uid, @@ -106,7 +100,7 @@ virSecurityDACChownListAppend(virSecurityDACChownListPtr list, { int ret = -1; char *tmp = NULL; - virSecurityDACChownItemPtr item = NULL; + virSecurityDACChownItem *item = NULL; item = g_new0(virSecurityDACChownItem, 1); @@ -132,7 +126,7 @@ virSecurityDACChownListAppend(virSecurityDACChownListPtr list, static void virSecurityDACChownListFree(void *opaque) { - virSecurityDACChownListPtr list = opaque; + virSecurityDACChownList *list = opaque; size_t i; if (!list) @@ -175,7 +169,7 @@ virSecurityDACTransactionAppend(const char *path, bool remember, bool restore) { - virSecurityDACChownListPtr list = virThreadLocalGet(&chownList); + virSecurityDACChownList *list = virThreadLocalGet(&chownList); if (!list) return 0; @@ -187,14 +181,14 @@ virSecurityDACTransactionAppend(const char *path, } -static int virSecurityDACSetOwnership(virSecurityManagerPtr mgr, +static int virSecurityDACSetOwnership(virSecurityManager *mgr, const virStorageSource *src, const char *path, uid_t uid, gid_t gid, bool remember); -static int virSecurityDACRestoreFileLabelInternal(virSecurityManagerPtr mgr, +static int virSecurityDACRestoreFileLabelInternal(virSecurityManager *mgr, const virStorageSource *src, const char *path, bool recall); @@ -215,8 +209,8 @@ static int virSecurityDACTransactionRun(pid_t pid G_GNUC_UNUSED, void *opaque) { - virSecurityDACChownListPtr list = opaque; - virSecurityManagerMetadataLockStatePtr state; + virSecurityDACChownList *list = opaque; + virSecurityManagerMetadataLockState *state; const char **paths = NULL; size_t npaths = 0; size_t i; @@ -227,7 +221,7 @@ virSecurityDACTransactionRun(pid_t pid G_GNUC_UNUSED, paths = g_new0(const char *, list->nItems); for (i = 0; i < list->nItems; i++) { - virSecurityDACChownItemPtr item = list->items[i]; + virSecurityDACChownItem *item = list->items[i]; const char *p = item->path; if (item->remember) @@ -238,7 +232,7 @@ virSecurityDACTransactionRun(pid_t pid G_GNUC_UNUSED, goto cleanup; for (i = 0; i < list->nItems; i++) { - virSecurityDACChownItemPtr item = list->items[i]; + virSecurityDACChownItem *item = list->items[i]; size_t j; for (j = 0; j < state->nfds; j++) { @@ -253,7 +247,7 @@ virSecurityDACTransactionRun(pid_t pid G_GNUC_UNUSED, } for (i = 0; i < list->nItems; i++) { - virSecurityDACChownItemPtr item = list->items[i]; + virSecurityDACChownItem *item = list->items[i]; const bool remember = item->remember && list->lock; if (!item->restore) { @@ -275,7 +269,7 @@ virSecurityDACTransactionRun(pid_t pid G_GNUC_UNUSED, } for (; rv < 0 && i > 0; i--) { - virSecurityDACChownItemPtr item = list->items[i - 1]; + virSecurityDACChownItem *item = list->items[i - 1]; const bool remember = item->remember && list->lock; if (!item->restore) { @@ -304,11 +298,11 @@ virSecurityDACTransactionRun(pid_t pid G_GNUC_UNUSED, /* returns -1 on error, 0 on success */ int -virSecurityDACSetUserAndGroup(virSecurityManagerPtr mgr, +virSecurityDACSetUserAndGroup(virSecurityManager *mgr, uid_t user, gid_t group) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); priv->user = user; priv->group = group; @@ -319,34 +313,34 @@ virSecurityDACSetUserAndGroup(virSecurityManagerPtr mgr, } void -virSecurityDACSetDynamicOwnership(virSecurityManagerPtr mgr, +virSecurityDACSetDynamicOwnership(virSecurityManager *mgr, bool dynamicOwnership) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); priv->dynamicOwnership = dynamicOwnership; } void -virSecurityDACSetMountNamespace(virSecurityManagerPtr mgr, +virSecurityDACSetMountNamespace(virSecurityManager *mgr, bool mountNamespace) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); priv->mountNamespace = mountNamespace; } void -virSecurityDACSetChownCallback(virSecurityManagerPtr mgr, +virSecurityDACSetChownCallback(virSecurityManager *mgr, virSecurityManagerDACChownCallback chownCallback) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); priv->chownCallback = chownCallback; } /* returns 1 if label isn't found, 0 on success, -1 on error */ static int ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) -virSecurityDACParseIds(virSecurityLabelDefPtr seclabel, +virSecurityDACParseIds(virSecurityLabelDef *seclabel, uid_t *uidPtr, gid_t *gidPtr) { if (!seclabel || !seclabel->label) @@ -360,8 +354,8 @@ virSecurityDACParseIds(virSecurityLabelDefPtr seclabel, static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) -virSecurityDACGetIds(virSecurityLabelDefPtr seclabel, - virSecurityDACDataPtr priv, +virSecurityDACGetIds(virSecurityLabelDef *seclabel, + virSecurityDACData *priv, uid_t *uidPtr, gid_t *gidPtr, gid_t **groups, int *ngroups) { @@ -391,7 +385,7 @@ virSecurityDACGetIds(virSecurityLabelDefPtr seclabel, /* returns 1 if label isn't found, 0 on success, -1 on error */ static int ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) -virSecurityDACParseImageIds(virSecurityLabelDefPtr seclabel, +virSecurityDACParseImageIds(virSecurityLabelDef *seclabel, uid_t *uidPtr, gid_t *gidPtr) { if (!seclabel || !seclabel->imagelabel) @@ -405,8 +399,8 @@ virSecurityDACParseImageIds(virSecurityLabelDefPtr seclabel, static int ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) -virSecurityDACGetImageIds(virSecurityLabelDefPtr seclabel, - virSecurityDACDataPtr priv, +virSecurityDACGetImageIds(virSecurityLabelDef *seclabel, + virSecurityDACData *priv, uid_t *uidPtr, gid_t *gidPtr) { int ret; @@ -439,7 +433,7 @@ virSecurityDACGetImageIds(virSecurityLabelDefPtr seclabel, * -1 on failure */ static int -virSecurityDACRememberLabel(virSecurityDACDataPtr priv G_GNUC_UNUSED, +virSecurityDACRememberLabel(virSecurityDACData *priv G_GNUC_UNUSED, const char *path, uid_t uid, gid_t gid) @@ -470,7 +464,7 @@ virSecurityDACRememberLabel(virSecurityDACDataPtr priv G_GNUC_UNUSED, * -1 on failure (@uid and @gid not touched) */ static int -virSecurityDACRecallLabel(virSecurityDACDataPtr priv G_GNUC_UNUSED, +virSecurityDACRecallLabel(virSecurityDACData *priv G_GNUC_UNUSED, const char *path, uid_t *uid, gid_t *gid) @@ -502,7 +496,7 @@ virSecurityDACProbe(const char *virtDriver G_GNUC_UNUSED) } static int -virSecurityDACOpen(virSecurityManagerPtr mgr G_GNUC_UNUSED) +virSecurityDACOpen(virSecurityManager *mgr G_GNUC_UNUSED) { if (virThreadLocalInit(&chownList, virSecurityDACChownListFree) < 0) { @@ -515,9 +509,9 @@ virSecurityDACOpen(virSecurityManagerPtr mgr G_GNUC_UNUSED) } static int -virSecurityDACClose(virSecurityManagerPtr mgr) +virSecurityDACClose(virSecurityManager *mgr) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); VIR_FREE(priv->groups); VIR_FREE(priv->baselabel); return 0; @@ -525,21 +519,21 @@ virSecurityDACClose(virSecurityManagerPtr mgr) static const char * -virSecurityDACGetModel(virSecurityManagerPtr mgr G_GNUC_UNUSED) +virSecurityDACGetModel(virSecurityManager *mgr G_GNUC_UNUSED) { return SECURITY_DAC_NAME; } static const char * -virSecurityDACGetDOI(virSecurityManagerPtr mgr G_GNUC_UNUSED) +virSecurityDACGetDOI(virSecurityManager *mgr G_GNUC_UNUSED) { return "0"; } static int -virSecurityDACPreFork(virSecurityManagerPtr mgr) +virSecurityDACPreFork(virSecurityManager *mgr) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); int ngroups; VIR_FREE(priv->groups); @@ -565,9 +559,9 @@ virSecurityDACPreFork(virSecurityManagerPtr mgr) * -1 otherwise. */ static int -virSecurityDACTransactionStart(virSecurityManagerPtr mgr) +virSecurityDACTransactionStart(virSecurityManager *mgr) { - virSecurityDACChownListPtr list; + virSecurityDACChownList *list; list = virThreadLocalGet(&chownList); if (list) { @@ -612,11 +606,11 @@ virSecurityDACTransactionStart(virSecurityManagerPtr mgr) * -1 otherwise. */ static int -virSecurityDACTransactionCommit(virSecurityManagerPtr mgr G_GNUC_UNUSED, +virSecurityDACTransactionCommit(virSecurityManager *mgr G_GNUC_UNUSED, pid_t pid, bool lock) { - virSecurityDACChownListPtr list; + virSecurityDACChownList *list; int rc; int ret = -1; @@ -670,9 +664,9 @@ virSecurityDACTransactionCommit(virSecurityManagerPtr mgr G_GNUC_UNUSED, * Cancels and frees any out standing transaction. */ static void -virSecurityDACTransactionAbort(virSecurityManagerPtr mgr G_GNUC_UNUSED) +virSecurityDACTransactionAbort(virSecurityManager *mgr G_GNUC_UNUSED) { - virSecurityDACChownListPtr list; + virSecurityDACChownList *list; list = virThreadLocalGet(&chownList); if (!list) @@ -760,14 +754,14 @@ virSecurityDACSetOwnershipInternal(const virSecurityDACData *priv, static int -virSecurityDACSetOwnership(virSecurityManagerPtr mgr, +virSecurityDACSetOwnership(virSecurityManager *mgr, const virStorageSource *src, const char *path, uid_t uid, gid_t gid, bool remember) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); virErrorPtr origerr; struct stat sb; int refcount; @@ -840,12 +834,12 @@ virSecurityDACSetOwnership(virSecurityManagerPtr mgr, static int -virSecurityDACRestoreFileLabelInternal(virSecurityManagerPtr mgr, +virSecurityDACRestoreFileLabelInternal(virSecurityManager *mgr, const virStorageSource *src, const char *path, bool recall) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); int rv; uid_t uid = 0; /* By default return to root:root */ gid_t gid = 0; @@ -881,7 +875,7 @@ virSecurityDACRestoreFileLabelInternal(virSecurityManagerPtr mgr, static int -virSecurityDACRestoreFileLabel(virSecurityManagerPtr mgr, +virSecurityDACRestoreFileLabel(virSecurityManager *mgr, const char *path) { return virSecurityDACRestoreFileLabelInternal(mgr, NULL, path, true); @@ -889,16 +883,16 @@ virSecurityDACRestoreFileLabel(virSecurityManagerPtr mgr, static int -virSecurityDACSetImageLabelInternal(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, - virStorageSourcePtr parent, +virSecurityDACSetImageLabelInternal(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, + virStorageSource *parent, bool isChainTop) { - virSecurityLabelDefPtr secdef; - virSecurityDeviceLabelDefPtr disk_seclabel; - virSecurityDeviceLabelDefPtr parent_seclabel = NULL; - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; + virSecurityDeviceLabelDef *disk_seclabel; + virSecurityDeviceLabelDef *parent_seclabel = NULL; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); bool remember; uid_t user; gid_t group; @@ -964,13 +958,13 @@ virSecurityDACSetImageLabelInternal(virSecurityManagerPtr mgr, static int -virSecurityDACSetImageLabelRelative(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, - virStorageSourcePtr parent, +virSecurityDACSetImageLabelRelative(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, + virStorageSource *parent, virSecurityDomainImageLabelFlags flags) { - virStorageSourcePtr n; + virStorageSource *n; for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) { const bool isChainTop = flags & VIR_SECURITY_DOMAIN_IMAGE_PARENT_CHAIN_TOP; @@ -988,23 +982,23 @@ virSecurityDACSetImageLabelRelative(virSecurityManagerPtr mgr, } static int -virSecurityDACSetImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, +virSecurityDACSetImageLabel(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, virSecurityDomainImageLabelFlags flags) { return virSecurityDACSetImageLabelRelative(mgr, def, src, src, flags); } static int -virSecurityDACRestoreImageLabelSingle(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, +virSecurityDACRestoreImageLabelSingle(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, bool migrated) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr secdef; - virSecurityDeviceLabelDefPtr disk_seclabel; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; + virSecurityDeviceLabelDef *disk_seclabel; if (!priv->dynamicOwnership) return 0; @@ -1069,9 +1063,9 @@ virSecurityDACRestoreImageLabelSingle(virSecurityManagerPtr mgr, static int -virSecurityDACRestoreImageLabelInt(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, +virSecurityDACRestoreImageLabelInt(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, bool migrated) { if (virSecurityDACRestoreImageLabelSingle(mgr, def, src, migrated) < 0) @@ -1082,9 +1076,9 @@ virSecurityDACRestoreImageLabelInt(virSecurityManagerPtr mgr, static int -virSecurityDACRestoreImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, +virSecurityDACRestoreImageLabel(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, virSecurityDomainImageLabelFlags flags G_GNUC_UNUSED) { return virSecurityDACRestoreImageLabelInt(mgr, def, src, false); @@ -1092,7 +1086,7 @@ virSecurityDACRestoreImageLabel(virSecurityManagerPtr mgr, struct virSecurityDACMoveImageMetadataData { - virSecurityManagerPtr mgr; + virSecurityManager *mgr; const char *src; const char *dst; }; @@ -1104,7 +1098,7 @@ virSecurityDACMoveImageMetadataHelper(pid_t pid G_GNUC_UNUSED, { struct virSecurityDACMoveImageMetadataData *data = opaque; const char *paths[2] = { data->src, data->dst }; - virSecurityManagerMetadataLockStatePtr state; + virSecurityManagerMetadataLockState *state; int ret; if (!(state = virSecurityManagerMetadataLock(data->mgr, paths, G_N_ELEMENTS(paths)))) @@ -1123,12 +1117,12 @@ virSecurityDACMoveImageMetadataHelper(pid_t pid G_GNUC_UNUSED, static int -virSecurityDACMoveImageMetadata(virSecurityManagerPtr mgr, +virSecurityDACMoveImageMetadata(virSecurityManager *mgr, pid_t pid, - virStorageSourcePtr src, - virStorageSourcePtr dst) + virStorageSource *src, + virStorageSource *dst) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); struct virSecurityDACMoveImageMetadataData data = { .mgr = mgr, 0 }; int rc; @@ -1163,10 +1157,10 @@ virSecurityDACSetHostdevLabelHelper(const char *file, bool remember, void *opaque) { - virSecurityDACCallbackDataPtr cbdata = opaque; - virSecurityManagerPtr mgr = cbdata->manager; - virSecurityLabelDefPtr secdef = cbdata->secdef; - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityDACCallbackData *cbdata = opaque; + virSecurityManager *mgr = cbdata->manager; + virSecurityLabelDef *secdef = cbdata->secdef; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); uid_t user; gid_t group; @@ -1178,7 +1172,7 @@ virSecurityDACSetHostdevLabelHelper(const char *file, static int -virSecurityDACSetPCILabel(virPCIDevicePtr dev G_GNUC_UNUSED, +virSecurityDACSetPCILabel(virPCIDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { @@ -1187,7 +1181,7 @@ virSecurityDACSetPCILabel(virPCIDevicePtr dev G_GNUC_UNUSED, static int -virSecurityDACSetUSBLabel(virUSBDevicePtr dev G_GNUC_UNUSED, +virSecurityDACSetUSBLabel(virUSBDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { @@ -1196,7 +1190,7 @@ virSecurityDACSetUSBLabel(virUSBDevicePtr dev G_GNUC_UNUSED, static int -virSecurityDACSetSCSILabel(virSCSIDevicePtr dev G_GNUC_UNUSED, +virSecurityDACSetSCSILabel(virSCSIDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { @@ -1205,7 +1199,7 @@ virSecurityDACSetSCSILabel(virSCSIDevicePtr dev G_GNUC_UNUSED, static int -virSecurityDACSetHostLabel(virSCSIVHostDevicePtr dev G_GNUC_UNUSED, +virSecurityDACSetHostLabel(virSCSIVHostDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { @@ -1214,18 +1208,18 @@ virSecurityDACSetHostLabel(virSCSIVHostDevicePtr dev G_GNUC_UNUSED, static int -virSecurityDACSetHostdevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainHostdevDefPtr dev, +virSecurityDACSetHostdevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainHostdevDef *dev, const char *vroot) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); virSecurityDACCallbackData cbdata; - virDomainHostdevSubsysUSBPtr usbsrc = &dev->source.subsys.u.usb; - virDomainHostdevSubsysPCIPtr pcisrc = &dev->source.subsys.u.pci; - virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIVHostPtr hostsrc = &dev->source.subsys.u.scsi_host; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev; + virDomainHostdevSubsysUSB *usbsrc = &dev->source.subsys.u.usb; + virDomainHostdevSubsysPCI *pcisrc = &dev->source.subsys.u.pci; + virDomainHostdevSubsysSCSI *scsisrc = &dev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIVHost *hostsrc = &dev->source.subsys.u.scsi_host; + virDomainHostdevSubsysMediatedDev *mdevsrc = &dev->source.subsys.u.mdev; int ret = -1; if (!priv->dynamicOwnership) @@ -1292,7 +1286,7 @@ virSecurityDACSetHostdevLabel(virSecurityManagerPtr mgr, } case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; g_autoptr(virSCSIDevice) scsi = virSCSIDeviceNew(NULL, scsihostsrc->adapter, scsihostsrc->bus, @@ -1340,59 +1334,59 @@ virSecurityDACSetHostdevLabel(virSecurityManagerPtr mgr, static int -virSecurityDACRestorePCILabel(virPCIDevicePtr dev G_GNUC_UNUSED, +virSecurityDACRestorePCILabel(virPCIDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { - virSecurityManagerPtr mgr = opaque; + virSecurityManager *mgr = opaque; return virSecurityDACRestoreFileLabel(mgr, file); } static int -virSecurityDACRestoreUSBLabel(virUSBDevicePtr dev G_GNUC_UNUSED, +virSecurityDACRestoreUSBLabel(virUSBDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { - virSecurityManagerPtr mgr = opaque; + virSecurityManager *mgr = opaque; return virSecurityDACRestoreFileLabel(mgr, file); } static int -virSecurityDACRestoreSCSILabel(virSCSIDevicePtr dev G_GNUC_UNUSED, +virSecurityDACRestoreSCSILabel(virSCSIDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { - virSecurityManagerPtr mgr = opaque; + virSecurityManager *mgr = opaque; return virSecurityDACRestoreFileLabel(mgr, file); } static int -virSecurityDACRestoreHostLabel(virSCSIVHostDevicePtr dev G_GNUC_UNUSED, +virSecurityDACRestoreHostLabel(virSCSIVHostDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { - virSecurityManagerPtr mgr = opaque; + virSecurityManager *mgr = opaque; return virSecurityDACRestoreFileLabel(mgr, file); } static int -virSecurityDACRestoreHostdevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainHostdevDefPtr dev, +virSecurityDACRestoreHostdevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainHostdevDef *dev, const char *vroot) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr secdef; - virDomainHostdevSubsysUSBPtr usbsrc = &dev->source.subsys.u.usb; - virDomainHostdevSubsysPCIPtr pcisrc = &dev->source.subsys.u.pci; - virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIVHostPtr hostsrc = &dev->source.subsys.u.scsi_host; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; + virDomainHostdevSubsysUSB *usbsrc = &dev->source.subsys.u.usb; + virDomainHostdevSubsysPCI *pcisrc = &dev->source.subsys.u.pci; + virDomainHostdevSubsysSCSI *scsisrc = &dev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIVHost *hostsrc = &dev->source.subsys.u.scsi_host; + virDomainHostdevSubsysMediatedDev *mdevsrc = &dev->source.subsys.u.mdev; int ret = -1; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_DAC_NAME); @@ -1450,7 +1444,7 @@ virSecurityDACRestoreHostdevLabel(virSecurityManagerPtr mgr, } case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; g_autoptr(virSCSIDevice) scsi = virSCSIDeviceNew(NULL, scsihostsrc->adapter, scsihostsrc->bus, @@ -1496,16 +1490,16 @@ virSecurityDACRestoreHostdevLabel(virSecurityManagerPtr mgr, static int -virSecurityDACSetChardevLabelHelper(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +virSecurityDACSetChardevLabelHelper(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd, bool remember) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr seclabel; - virSecurityDeviceLabelDefPtr chr_seclabel = NULL; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *seclabel; + virSecurityDeviceLabelDef *chr_seclabel = NULL; char *in = NULL, *out = NULL; int ret = -1; uid_t user; @@ -1592,9 +1586,9 @@ virSecurityDACSetChardevLabelHelper(virSecurityManagerPtr mgr, static int -virSecurityDACSetChardevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +virSecurityDACSetChardevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd) { return virSecurityDACSetChardevLabelHelper(mgr, def, dev_source, @@ -1603,13 +1597,13 @@ virSecurityDACSetChardevLabel(virSecurityManagerPtr mgr, static int -virSecurityDACRestoreChardevLabelHelper(virSecurityManagerPtr mgr, - virDomainDefPtr def G_GNUC_UNUSED, - virDomainChrSourceDefPtr dev_source, +virSecurityDACRestoreChardevLabelHelper(virSecurityManager *mgr, + virDomainDef *def G_GNUC_UNUSED, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd, bool recall) { - virSecurityDeviceLabelDefPtr chr_seclabel = NULL; + virSecurityDeviceLabelDef *chr_seclabel = NULL; char *in = NULL, *out = NULL; int ret = -1; @@ -1679,9 +1673,9 @@ virSecurityDACRestoreChardevLabelHelper(virSecurityManagerPtr mgr, static int -virSecurityDACRestoreChardevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +virSecurityDACRestoreChardevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd) { return virSecurityDACRestoreChardevLabelHelper(mgr, def, dev_source, @@ -1690,14 +1684,14 @@ virSecurityDACRestoreChardevLabel(virSecurityManagerPtr mgr, struct _virSecuritySELinuxChardevCallbackData { - virSecurityManagerPtr mgr; + virSecurityManager *mgr; bool chardevStdioLogd; }; static int -virSecurityDACRestoreChardevCallback(virDomainDefPtr def, - virDomainChrDefPtr dev G_GNUC_UNUSED, +virSecurityDACRestoreChardevCallback(virDomainDef *def, + virDomainChrDef *dev G_GNUC_UNUSED, void *opaque) { struct _virSecuritySELinuxChardevCallbackData *data = opaque; @@ -1708,9 +1702,9 @@ virSecurityDACRestoreChardevCallback(virDomainDefPtr def, static int -virSecurityDACSetTPMFileLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainTPMDefPtr tpm) +virSecurityDACSetTPMFileLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainTPMDef *tpm) { int ret = 0; @@ -1734,9 +1728,9 @@ virSecurityDACSetTPMFileLabel(virSecurityManagerPtr mgr, static int -virSecurityDACRestoreTPMFileLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainTPMDefPtr tpm) +virSecurityDACRestoreTPMFileLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainTPMDef *tpm) { int ret = 0; @@ -1757,14 +1751,14 @@ virSecurityDACRestoreTPMFileLabel(virSecurityManagerPtr mgr, static int -virSecurityDACSetGraphicsLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainGraphicsDefPtr gfx) +virSecurityDACSetGraphicsLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainGraphicsDef *gfx) { const char *rendernode = virDomainGraphicsGetRenderNode(gfx); - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr seclabel; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *seclabel; uid_t user; gid_t group; @@ -1791,9 +1785,9 @@ virSecurityDACSetGraphicsLabel(virSecurityManagerPtr mgr, static int -virSecurityDACRestoreGraphicsLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, - virDomainGraphicsDefPtr gfx G_GNUC_UNUSED) +virSecurityDACRestoreGraphicsLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, + virDomainGraphicsDef *gfx G_GNUC_UNUSED) { /* The only graphics labelling we do is dependent on mountNamespaces, @@ -1804,13 +1798,13 @@ virSecurityDACRestoreGraphicsLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, static int -virSecurityDACSetInputLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainInputDefPtr input) +virSecurityDACSetInputLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainInputDef *input) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr seclabel; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *seclabel; int ret = -1; uid_t user; gid_t group; @@ -1841,9 +1835,9 @@ virSecurityDACSetInputLabel(virSecurityManagerPtr mgr, } static int -virSecurityDACRestoreInputLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def G_GNUC_UNUSED, - virDomainInputDefPtr input) +virSecurityDACRestoreInputLabel(virSecurityManager *mgr, + virDomainDef *def G_GNUC_UNUSED, + virDomainInputDef *input) { int ret = -1; @@ -1865,9 +1859,9 @@ virSecurityDACRestoreInputLabel(virSecurityManagerPtr mgr, static int -virSecurityDACRestoreMemoryLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def G_GNUC_UNUSED, - virDomainMemoryDefPtr mem) +virSecurityDACRestoreMemoryLabel(virSecurityManager *mgr, + virDomainDef *def G_GNUC_UNUSED, + virDomainMemoryDef *mem) { int ret = -1; @@ -1889,8 +1883,8 @@ virSecurityDACRestoreMemoryLabel(virSecurityManagerPtr mgr, static int -virSecurityDACRestoreSEVLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED) +virSecurityDACRestoreSEVLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED) { /* we only label /dev/sev when running with namespaces, so we don't need to * restore anything */ @@ -1899,13 +1893,13 @@ virSecurityDACRestoreSEVLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, static int -virSecurityDACRestoreSysinfoLabel(virSecurityManagerPtr mgr, - virSysinfoDefPtr def) +virSecurityDACRestoreSysinfoLabel(virSecurityManager *mgr, + virSysinfoDef *def) { size_t i; for (i = 0; i < def->nfw_cfgs; i++) { - virSysinfoFWCfgDefPtr f = &def->fw_cfgs[i]; + virSysinfoFWCfgDef *f = &def->fw_cfgs[i]; if (f->file && virSecurityDACRestoreFileLabel(mgr, f->file) < 0) @@ -1917,13 +1911,13 @@ virSecurityDACRestoreSysinfoLabel(virSecurityManagerPtr mgr, static int -virSecurityDACRestoreAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +virSecurityDACRestoreAllLabel(virSecurityManager *mgr, + virDomainDef *def, bool migrated, bool chardevStdioLogd) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr secdef; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; size_t i; int rc = 0; @@ -2022,8 +2016,8 @@ virSecurityDACRestoreAllLabel(virSecurityManagerPtr mgr, static int -virSecurityDACSetChardevCallback(virDomainDefPtr def, - virDomainChrDefPtr dev G_GNUC_UNUSED, +virSecurityDACSetChardevCallback(virDomainDef *def, + virDomainChrDef *dev G_GNUC_UNUSED, void *opaque) { struct _virSecuritySELinuxChardevCallbackData *data = opaque; @@ -2034,13 +2028,13 @@ virSecurityDACSetChardevCallback(virDomainDefPtr def, static int -virSecurityDACSetMemoryLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainMemoryDefPtr mem) +virSecurityDACSetMemoryLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainMemoryDef *mem) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr seclabel; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *seclabel; int ret = -1; uid_t user; gid_t group; @@ -2072,11 +2066,11 @@ virSecurityDACSetMemoryLabel(virSecurityManagerPtr mgr, static int -virSecurityDACSetSEVLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def) +virSecurityDACSetSEVLabel(virSecurityManager *mgr, + virDomainDef *def) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr seclabel; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *seclabel; uid_t user; gid_t group; @@ -2102,15 +2096,15 @@ virSecurityDACSetSEVLabel(virSecurityManagerPtr mgr, static int -virSecurityDACSetSysinfoLabel(virSecurityManagerPtr mgr, +virSecurityDACSetSysinfoLabel(virSecurityManager *mgr, uid_t user, gid_t group, - virSysinfoDefPtr def) + virSysinfoDef *def) { size_t i; for (i = 0; i < def->nfw_cfgs; i++) { - virSysinfoFWCfgDefPtr f = &def->fw_cfgs[i]; + virSysinfoFWCfgDef *f = &def->fw_cfgs[i]; if (f->file && virSecurityDACSetOwnership(mgr, NULL, f->file, @@ -2123,14 +2117,14 @@ virSecurityDACSetSysinfoLabel(virSecurityManagerPtr mgr, static int -virSecurityDACSetAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +virSecurityDACSetAllLabel(virSecurityManager *mgr, + virDomainDef *def, const char *incomingPath G_GNUC_UNUSED, bool chardevStdioLogd, bool migrated G_GNUC_UNUSED) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr secdef; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; size_t i; uid_t user; gid_t group; @@ -2241,11 +2235,11 @@ virSecurityDACSetAllLabel(virSecurityManagerPtr mgr, static int -virSecurityDACSetProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def) +virSecurityDACSetProcessLabel(virSecurityManager *mgr, + virDomainDef *def) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr secdef; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; uid_t user; gid_t group; gid_t *groups; @@ -2267,12 +2261,12 @@ virSecurityDACSetProcessLabel(virSecurityManagerPtr mgr, static int -virSecurityDACSetChildProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virCommandPtr cmd) +virSecurityDACSetChildProcessLabel(virSecurityManager *mgr, + virDomainDef *def, + virCommand *cmd) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr secdef; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; uid_t user; gid_t group; @@ -2291,19 +2285,19 @@ virSecurityDACSetChildProcessLabel(virSecurityManagerPtr mgr, static int -virSecurityDACVerify(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED) +virSecurityDACVerify(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED) { return 0; } static int -virSecurityDACGenLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def) +virSecurityDACGenLabel(virSecurityManager *mgr, + virDomainDef *def) { int rc = -1; - virSecurityLabelDefPtr seclabel; - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *seclabel; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); seclabel = virDomainDefGetSecurityLabelDef(def, SECURITY_DAC_NAME); if (seclabel == NULL) @@ -2362,15 +2356,15 @@ virSecurityDACGenLabel(virSecurityManagerPtr mgr, } static int -virSecurityDACReleaseLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED) +virSecurityDACReleaseLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED) { return 0; } static int -virSecurityDACReserveLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, +virSecurityDACReserveLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, pid_t pid G_GNUC_UNUSED) { return 0; @@ -2442,12 +2436,12 @@ virSecurityDACGetProcessLabelInternal(pid_t pid G_GNUC_UNUSED, #endif static int -virSecurityDACGetProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def, +virSecurityDACGetProcessLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def, pid_t pid, virSecurityLabelPtr seclabel) { - virSecurityLabelDefPtr secdef = + virSecurityLabelDef *secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_DAC_NAME); if (secdef == NULL) { @@ -2467,67 +2461,67 @@ virSecurityDACGetProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -virSecurityDACSetDaemonSocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED) +virSecurityDACSetDaemonSocketLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED) { return 0; } static int -virSecurityDACSetSocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED) +virSecurityDACSetSocketLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED) { return 0; } static int -virSecurityDACClearSocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED) +virSecurityDACClearSocketLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED) { return 0; } static int -virSecurityDACSetImageFDLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, +virSecurityDACSetImageFDLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, int fd G_GNUC_UNUSED) { return 0; } static int -virSecurityDACSetTapFDLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, +virSecurityDACSetTapFDLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, int fd G_GNUC_UNUSED) { return 0; } static char * -virSecurityDACGetMountOptions(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED) +virSecurityDACGetMountOptions(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED) { return NULL; } static const char * -virSecurityDACGetBaseLabel(virSecurityManagerPtr mgr, +virSecurityDACGetBaseLabel(virSecurityManager *mgr, int virt G_GNUC_UNUSED) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); return priv->baselabel; } static int -virSecurityDACDomainSetPathLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +virSecurityDACDomainSetPathLabel(virSecurityManager *mgr, + virDomainDef *def, const char *path, bool allowSubtree G_GNUC_UNUSED) { - virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr seclabel; + virSecurityDACData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *seclabel; uid_t user; gid_t group; @@ -2540,8 +2534,8 @@ virSecurityDACDomainSetPathLabel(virSecurityManagerPtr mgr, } static int -virSecurityDACDomainRestorePathLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def G_GNUC_UNUSED, +virSecurityDACDomainRestorePathLabel(virSecurityManager *mgr, + virDomainDef *def G_GNUC_UNUSED, const char *path) { return virSecurityDACRestoreFileLabel(mgr, path); diff --git a/src/security/security_dac.h b/src/security/security_dac.h index 444e5dcf89..203c297189 100644 --- a/src/security/security_dac.h +++ b/src/security/security_dac.h @@ -24,15 +24,15 @@ extern virSecurityDriver virSecurityDriverDAC; -int virSecurityDACSetUserAndGroup(virSecurityManagerPtr mgr, +int virSecurityDACSetUserAndGroup(virSecurityManager *mgr, uid_t user, gid_t group); -void virSecurityDACSetDynamicOwnership(virSecurityManagerPtr mgr, +void virSecurityDACSetDynamicOwnership(virSecurityManager *mgr, bool dynamic); -void virSecurityDACSetMountNamespace(virSecurityManagerPtr mgr, +void virSecurityDACSetMountNamespace(virSecurityManager *mgr, bool mountNamespace); -void virSecurityDACSetChownCallback(virSecurityManagerPtr mgr, +void virSecurityDACSetChownCallback(virSecurityManager *mgr, virSecurityManagerDACChownCallback chownCallback); diff --git a/src/security/security_driver.c b/src/security/security_driver.c index da3b8c1491..b663b53244 100644 --- a/src/security/security_driver.c +++ b/src/security/security_driver.c @@ -35,7 +35,7 @@ VIR_LOG_INIT("security.security_driver"); -static virSecurityDriverPtr security_drivers[] = { +static virSecurityDriver *security_drivers[] = { #ifdef WITH_SECDRIVER_SELINUX &virSecurityDriverSELinux, #endif @@ -45,16 +45,16 @@ static virSecurityDriverPtr security_drivers[] = { &virSecurityDriverNop, /* Must always be last, since it will always probe */ }; -virSecurityDriverPtr virSecurityDriverLookup(const char *name, +virSecurityDriver *virSecurityDriverLookup(const char *name, const char *virtDriver) { - virSecurityDriverPtr drv = NULL; + virSecurityDriver *drv = NULL; size_t i; VIR_DEBUG("name=%s", NULLSTR(name)); for (i = 0; i < G_N_ELEMENTS(security_drivers) && !drv; i++) { - virSecurityDriverPtr tmp = security_drivers[i]; + virSecurityDriver *tmp = security_drivers[i]; if (name && STRNEQ(tmp->name, name)) diff --git a/src/security/security_driver.h b/src/security/security_driver.h index 08cdf94598..07f8def3d3 100644 --- a/src/security/security_driver.h +++ b/src/security/security_driver.h @@ -34,130 +34,129 @@ typedef enum { } virSecurityDriverStatus; typedef struct _virSecurityDriver virSecurityDriver; -typedef virSecurityDriver *virSecurityDriverPtr; typedef virSecurityDriverStatus (*virSecurityDriverProbe) (const char *virtDriver); -typedef int (*virSecurityDriverOpen) (virSecurityManagerPtr mgr); -typedef int (*virSecurityDriverClose) (virSecurityManagerPtr mgr); +typedef int (*virSecurityDriverOpen) (virSecurityManager *mgr); +typedef int (*virSecurityDriverClose) (virSecurityManager *mgr); -typedef const char *(*virSecurityDriverGetModel) (virSecurityManagerPtr mgr); -typedef const char *(*virSecurityDriverGetDOI) (virSecurityManagerPtr mgr); -typedef const char *(*virSecurityDriverGetBaseLabel) (virSecurityManagerPtr mgr, +typedef const char *(*virSecurityDriverGetModel) (virSecurityManager *mgr); +typedef const char *(*virSecurityDriverGetDOI) (virSecurityManager *mgr); +typedef const char *(*virSecurityDriverGetBaseLabel) (virSecurityManager *mgr, int virtType); -typedef int (*virSecurityDriverPreFork) (virSecurityManagerPtr mgr); +typedef int (*virSecurityDriverPreFork) (virSecurityManager *mgr); -typedef int (*virSecurityDriverTransactionStart) (virSecurityManagerPtr mgr); -typedef int (*virSecurityDriverTransactionCommit) (virSecurityManagerPtr mgr, +typedef int (*virSecurityDriverTransactionStart) (virSecurityManager *mgr); +typedef int (*virSecurityDriverTransactionCommit) (virSecurityManager *mgr, pid_t pid, bool lock); -typedef void (*virSecurityDriverTransactionAbort) (virSecurityManagerPtr mgr); +typedef void (*virSecurityDriverTransactionAbort) (virSecurityManager *mgr); -typedef int (*virSecurityDomainSetDaemonSocketLabel)(virSecurityManagerPtr mgr, - virDomainDefPtr vm); -typedef int (*virSecurityDomainSetSocketLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def); -typedef int (*virSecurityDomainClearSocketLabel)(virSecurityManagerPtr mgr, - virDomainDefPtr def); -typedef int (*virSecurityDomainRestoreHostdevLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainHostdevDefPtr dev, +typedef int (*virSecurityDomainSetDaemonSocketLabel)(virSecurityManager *mgr, + virDomainDef *vm); +typedef int (*virSecurityDomainSetSocketLabel) (virSecurityManager *mgr, + virDomainDef *def); +typedef int (*virSecurityDomainClearSocketLabel)(virSecurityManager *mgr, + virDomainDef *def); +typedef int (*virSecurityDomainRestoreHostdevLabel) (virSecurityManager *mgr, + virDomainDef *def, + virDomainHostdevDef *dev, const char *vroot); -typedef int (*virSecurityDomainSetHostdevLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainHostdevDefPtr dev, +typedef int (*virSecurityDomainSetHostdevLabel) (virSecurityManager *mgr, + virDomainDef *def, + virDomainHostdevDef *dev, const char *vroot); -typedef int (*virSecurityDomainSetSavedStateLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, +typedef int (*virSecurityDomainSetSavedStateLabel) (virSecurityManager *mgr, + virDomainDef *def, const char *savefile); -typedef int (*virSecurityDomainRestoreSavedStateLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, +typedef int (*virSecurityDomainRestoreSavedStateLabel) (virSecurityManager *mgr, + virDomainDef *def, const char *savefile); -typedef int (*virSecurityDomainGenLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr sec); -typedef int (*virSecurityDomainReserveLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr sec, +typedef int (*virSecurityDomainGenLabel) (virSecurityManager *mgr, + virDomainDef *sec); +typedef int (*virSecurityDomainReserveLabel) (virSecurityManager *mgr, + virDomainDef *sec, pid_t pid); -typedef int (*virSecurityDomainReleaseLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr sec); -typedef int (*virSecurityDomainSetAllLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr sec, +typedef int (*virSecurityDomainReleaseLabel) (virSecurityManager *mgr, + virDomainDef *sec); +typedef int (*virSecurityDomainSetAllLabel) (virSecurityManager *mgr, + virDomainDef *sec, const char *incomingPath, bool chardevStdioLogd, bool migrated); -typedef int (*virSecurityDomainRestoreAllLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, +typedef int (*virSecurityDomainRestoreAllLabel) (virSecurityManager *mgr, + virDomainDef *def, bool migrated, bool chardevStdioLogd); -typedef int (*virSecurityDomainGetProcessLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, +typedef int (*virSecurityDomainGetProcessLabel) (virSecurityManager *mgr, + virDomainDef *def, pid_t pid, virSecurityLabelPtr sec); -typedef int (*virSecurityDomainSetProcessLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def); -typedef int (*virSecurityDomainSetChildProcessLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, - virCommandPtr cmd); -typedef int (*virSecurityDomainSecurityVerify) (virSecurityManagerPtr mgr, - virDomainDefPtr def); -typedef int (*virSecurityDomainSetImageFDLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, +typedef int (*virSecurityDomainSetProcessLabel) (virSecurityManager *mgr, + virDomainDef *def); +typedef int (*virSecurityDomainSetChildProcessLabel) (virSecurityManager *mgr, + virDomainDef *def, + virCommand *cmd); +typedef int (*virSecurityDomainSecurityVerify) (virSecurityManager *mgr, + virDomainDef *def); +typedef int (*virSecurityDomainSetImageFDLabel) (virSecurityManager *mgr, + virDomainDef *def, int fd); -typedef int (*virSecurityDomainSetTapFDLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, +typedef int (*virSecurityDomainSetTapFDLabel) (virSecurityManager *mgr, + virDomainDef *def, int fd); -typedef char *(*virSecurityDomainGetMountOptions) (virSecurityManagerPtr mgr, - virDomainDefPtr def); -typedef int (*virSecurityDomainSetHugepages) (virSecurityManagerPtr mgr, - virDomainDefPtr def, +typedef char *(*virSecurityDomainGetMountOptions) (virSecurityManager *mgr, + virDomainDef *def); +typedef int (*virSecurityDomainSetHugepages) (virSecurityManager *mgr, + virDomainDef *def, const char *path); -typedef int (*virSecurityDomainSetImageLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, +typedef int (*virSecurityDomainSetImageLabel) (virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, virSecurityDomainImageLabelFlags flags); -typedef int (*virSecurityDomainRestoreImageLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, +typedef int (*virSecurityDomainRestoreImageLabel) (virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, virSecurityDomainImageLabelFlags flags); -typedef int (*virSecurityDomainMoveImageMetadata) (virSecurityManagerPtr mgr, +typedef int (*virSecurityDomainMoveImageMetadata) (virSecurityManager *mgr, pid_t pid, - virStorageSourcePtr src, - virStorageSourcePtr dst); -typedef int (*virSecurityDomainSetMemoryLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainMemoryDefPtr mem); -typedef int (*virSecurityDomainRestoreMemoryLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainMemoryDefPtr mem); -typedef int (*virSecurityDomainSetInputLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainInputDefPtr input); -typedef int (*virSecurityDomainRestoreInputLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainInputDefPtr input); -typedef int (*virSecurityDomainSetPathLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, + virStorageSource *src, + virStorageSource *dst); +typedef int (*virSecurityDomainSetMemoryLabel) (virSecurityManager *mgr, + virDomainDef *def, + virDomainMemoryDef *mem); +typedef int (*virSecurityDomainRestoreMemoryLabel) (virSecurityManager *mgr, + virDomainDef *def, + virDomainMemoryDef *mem); +typedef int (*virSecurityDomainSetInputLabel) (virSecurityManager *mgr, + virDomainDef *def, + virDomainInputDef *input); +typedef int (*virSecurityDomainRestoreInputLabel) (virSecurityManager *mgr, + virDomainDef *def, + virDomainInputDef *input); +typedef int (*virSecurityDomainSetPathLabel) (virSecurityManager *mgr, + virDomainDef *def, const char *path, bool allowSubtree); -typedef int (*virSecurityDomainSetPathLabelRO) (virSecurityManagerPtr mgr, - virDomainDefPtr def, +typedef int (*virSecurityDomainSetPathLabelRO) (virSecurityManager *mgr, + virDomainDef *def, const char *path); -typedef int (*virSecurityDomainRestorePathLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, +typedef int (*virSecurityDomainRestorePathLabel) (virSecurityManager *mgr, + virDomainDef *def, const char *path); -typedef int (*virSecurityDomainSetChardevLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +typedef int (*virSecurityDomainSetChardevLabel) (virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd); -typedef int (*virSecurityDomainRestoreChardevLabel) (virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +typedef int (*virSecurityDomainRestoreChardevLabel) (virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd); -typedef int (*virSecurityDomainSetTPMLabels) (virSecurityManagerPtr mgr, - virDomainDefPtr def); -typedef int (*virSecurityDomainRestoreTPMLabels) (virSecurityManagerPtr mgr, - virDomainDefPtr def); +typedef int (*virSecurityDomainSetTPMLabels) (virSecurityManager *mgr, + virDomainDef *def); +typedef int (*virSecurityDomainRestoreTPMLabels) (virSecurityManager *mgr, + virDomainDef *def); struct _virSecurityDriver { @@ -227,5 +226,5 @@ struct _virSecurityDriver { virSecurityDomainRestoreTPMLabels domainRestoreSecurityTPMLabels; }; -virSecurityDriverPtr virSecurityDriverLookup(const char *name, +virSecurityDriver *virSecurityDriverLookup(const char *name, const char *virtDriver); diff --git a/src/security/security_manager.c b/src/security/security_manager.c index 67ede11981..d8b84e2861 100644 --- a/src/security/security_manager.c +++ b/src/security/security_manager.c @@ -39,19 +39,19 @@ VIR_LOG_INIT("security.security_manager"); struct _virSecurityManager { virObjectLockable parent; - virSecurityDriverPtr drv; + virSecurityDriver *drv; unsigned int flags; const char *virtDriver; void *privateData; }; -static virClassPtr virSecurityManagerClass; +static virClass *virSecurityManagerClass; static void virSecurityManagerDispose(void *obj) { - virSecurityManagerPtr mgr = obj; + virSecurityManager *mgr = obj; if (mgr->drv->close) mgr->drv->close(mgr); @@ -71,12 +71,12 @@ virSecurityManagerOnceInit(void) VIR_ONCE_GLOBAL_INIT(virSecurityManager); -static virSecurityManagerPtr -virSecurityManagerNewDriver(virSecurityDriverPtr drv, +static virSecurityManager * +virSecurityManagerNewDriver(virSecurityDriver *drv, const char *virtDriver, unsigned int flags) { - virSecurityManagerPtr mgr = NULL; + virSecurityManager *mgr = NULL; char *privateData = NULL; if (virSecurityManagerInitialize() < 0) @@ -108,10 +108,10 @@ virSecurityManagerNewDriver(virSecurityDriverPtr drv, } -virSecurityManagerPtr -virSecurityManagerNewStack(virSecurityManagerPtr primary) +virSecurityManager * +virSecurityManagerNewStack(virSecurityManager *primary) { - virSecurityManagerPtr mgr = + virSecurityManager *mgr = virSecurityManagerNewDriver(&virSecurityDriverStack, virSecurityManagerGetVirtDriver(primary), primary->flags); @@ -130,8 +130,8 @@ virSecurityManagerNewStack(virSecurityManagerPtr primary) int -virSecurityManagerStackAddNested(virSecurityManagerPtr stack, - virSecurityManagerPtr nested) +virSecurityManagerStackAddNested(virSecurityManager *stack, + virSecurityManager *nested) { if (STRNEQ("stack", stack->drv->name)) return -1; @@ -139,14 +139,14 @@ virSecurityManagerStackAddNested(virSecurityManagerPtr stack, } -virSecurityManagerPtr +virSecurityManager * virSecurityManagerNewDAC(const char *virtDriver, uid_t user, gid_t group, unsigned int flags, virSecurityManagerDACChownCallback chownCallback) { - virSecurityManagerPtr mgr; + virSecurityManager *mgr; virCheckFlags(VIR_SECURITY_MANAGER_NEW_MASK | VIR_SECURITY_MANAGER_DYNAMIC_OWNERSHIP | @@ -172,12 +172,12 @@ virSecurityManagerNewDAC(const char *virtDriver, } -virSecurityManagerPtr +virSecurityManager * virSecurityManagerNew(const char *name, const char *virtDriver, unsigned int flags) { - virSecurityDriverPtr drv = virSecurityDriverLookup(name, virtDriver); + virSecurityDriver *drv = virSecurityDriverLookup(name, virtDriver); if (!drv) return NULL; @@ -215,7 +215,7 @@ virSecurityManagerNew(const char *name, * parent and child. */ int -virSecurityManagerPreFork(virSecurityManagerPtr mgr) +virSecurityManagerPreFork(virSecurityManager *mgr) { int ret = 0; @@ -235,7 +235,7 @@ virSecurityManagerPreFork(virSecurityManagerPtr mgr) * to ensure mutex state is sane for the child to use */ void -virSecurityManagerPostFork(virSecurityManagerPtr mgr) +virSecurityManagerPostFork(virSecurityManager *mgr) { virObjectUnlock(mgr); } @@ -252,7 +252,7 @@ virSecurityManagerPostFork(virSecurityManagerPtr mgr) * -1 otherwise. */ int -virSecurityManagerTransactionStart(virSecurityManagerPtr mgr) +virSecurityManagerTransactionStart(virSecurityManager *mgr) { int ret = 0; @@ -287,7 +287,7 @@ virSecurityManagerTransactionStart(virSecurityManagerPtr mgr) * -1 otherwise. */ int -virSecurityManagerTransactionCommit(virSecurityManagerPtr mgr, +virSecurityManagerTransactionCommit(virSecurityManager *mgr, pid_t pid, bool lock) { @@ -308,7 +308,7 @@ virSecurityManagerTransactionCommit(virSecurityManagerPtr mgr, * Cancels and frees any out standing transaction. */ void -virSecurityManagerTransactionAbort(virSecurityManagerPtr mgr) +virSecurityManagerTransactionAbort(virSecurityManager *mgr) { virObjectLock(mgr); if (mgr->drv->transactionAbort) @@ -318,28 +318,28 @@ virSecurityManagerTransactionAbort(virSecurityManagerPtr mgr) void * -virSecurityManagerGetPrivateData(virSecurityManagerPtr mgr) +virSecurityManagerGetPrivateData(virSecurityManager *mgr) { return mgr->privateData; } const char * -virSecurityManagerGetVirtDriver(virSecurityManagerPtr mgr) +virSecurityManagerGetVirtDriver(virSecurityManager *mgr) { return mgr->virtDriver; } const char * -virSecurityManagerGetDriver(virSecurityManagerPtr mgr) +virSecurityManagerGetDriver(virSecurityManager *mgr) { return mgr->drv->name; } const char * -virSecurityManagerGetDOI(virSecurityManagerPtr mgr) +virSecurityManagerGetDOI(virSecurityManager *mgr) { if (mgr->drv->getDOI) { const char *ret; @@ -355,7 +355,7 @@ virSecurityManagerGetDOI(virSecurityManagerPtr mgr) const char * -virSecurityManagerGetModel(virSecurityManagerPtr mgr) +virSecurityManagerGetModel(virSecurityManager *mgr) { if (mgr->drv->getModel) { const char *ret; @@ -372,7 +372,7 @@ virSecurityManagerGetModel(virSecurityManagerPtr mgr) /* return NULL if a base label is not present */ const char * -virSecurityManagerGetBaseLabel(virSecurityManagerPtr mgr, +virSecurityManagerGetBaseLabel(virSecurityManager *mgr, int virtType) { if (mgr->drv->getBaseLabel) { @@ -388,21 +388,21 @@ virSecurityManagerGetBaseLabel(virSecurityManagerPtr mgr, bool -virSecurityManagerGetDefaultConfined(virSecurityManagerPtr mgr) +virSecurityManagerGetDefaultConfined(virSecurityManager *mgr) { return mgr->flags & VIR_SECURITY_MANAGER_DEFAULT_CONFINED; } bool -virSecurityManagerGetRequireConfined(virSecurityManagerPtr mgr) +virSecurityManagerGetRequireConfined(virSecurityManager *mgr) { return mgr->flags & VIR_SECURITY_MANAGER_REQUIRE_CONFINED; } bool -virSecurityManagerGetPrivileged(virSecurityManagerPtr mgr) +virSecurityManagerGetPrivileged(virSecurityManager *mgr) { return mgr->flags & VIR_SECURITY_MANAGER_PRIVILEGED; } @@ -420,9 +420,9 @@ virSecurityManagerGetPrivileged(virSecurityManagerPtr mgr) * Returns: 0 on success, -1 on error. */ int -virSecurityManagerRestoreImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virStorageSourcePtr src, +virSecurityManagerRestoreImageLabel(virSecurityManager *mgr, + virDomainDef *vm, + virStorageSource *src, virSecurityDomainImageLabelFlags flags) { if (mgr->drv->domainRestoreSecurityImageLabel) { @@ -459,10 +459,10 @@ virSecurityManagerRestoreImageLabel(virSecurityManagerPtr mgr, * -1 otherwise. */ int -virSecurityManagerMoveImageMetadata(virSecurityManagerPtr mgr, +virSecurityManagerMoveImageMetadata(virSecurityManager *mgr, pid_t pid, - virStorageSourcePtr src, - virStorageSourcePtr dst) + virStorageSource *src, + virStorageSource *dst) { if (mgr->drv->domainMoveImageMetadata) { int ret; @@ -477,8 +477,8 @@ virSecurityManagerMoveImageMetadata(virSecurityManagerPtr mgr, int -virSecurityManagerSetDaemonSocketLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityManagerSetDaemonSocketLabel(virSecurityManager *mgr, + virDomainDef *vm) { if (mgr->drv->domainSetSecurityDaemonSocketLabel) { int ret; @@ -494,8 +494,8 @@ virSecurityManagerSetDaemonSocketLabel(virSecurityManagerPtr mgr, int -virSecurityManagerSetSocketLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityManagerSetSocketLabel(virSecurityManager *mgr, + virDomainDef *vm) { if (mgr->drv->domainSetSecuritySocketLabel) { int ret; @@ -511,8 +511,8 @@ virSecurityManagerSetSocketLabel(virSecurityManagerPtr mgr, int -virSecurityManagerClearSocketLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityManagerClearSocketLabel(virSecurityManager *mgr, + virDomainDef *vm) { if (mgr->drv->domainClearSecuritySocketLabel) { int ret; @@ -539,9 +539,9 @@ virSecurityManagerClearSocketLabel(virSecurityManagerPtr mgr, * Returns: 0 on success, -1 on error. */ int -virSecurityManagerSetImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virStorageSourcePtr src, +virSecurityManagerSetImageLabel(virSecurityManager *mgr, + virDomainDef *vm, + virStorageSource *src, virSecurityDomainImageLabelFlags flags) { if (mgr->drv->domainSetSecurityImageLabel) { @@ -558,9 +558,9 @@ virSecurityManagerSetImageLabel(virSecurityManagerPtr mgr, int -virSecurityManagerRestoreHostdevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainHostdevDefPtr dev, +virSecurityManagerRestoreHostdevLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainHostdevDef *dev, const char *vroot) { if (mgr->drv->domainRestoreSecurityHostdevLabel) { @@ -577,9 +577,9 @@ virSecurityManagerRestoreHostdevLabel(virSecurityManagerPtr mgr, int -virSecurityManagerSetHostdevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainHostdevDefPtr dev, +virSecurityManagerSetHostdevLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainHostdevDef *dev, const char *vroot) { if (mgr->drv->domainSetSecurityHostdevLabel) { @@ -596,8 +596,8 @@ virSecurityManagerSetHostdevLabel(virSecurityManagerPtr mgr, int -virSecurityManagerSetSavedStateLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityManagerSetSavedStateLabel(virSecurityManager *mgr, + virDomainDef *vm, const char *savefile) { if (mgr->drv->domainSetSavedStateLabel) { @@ -613,8 +613,8 @@ virSecurityManagerSetSavedStateLabel(virSecurityManagerPtr mgr, int -virSecurityManagerRestoreSavedStateLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityManagerRestoreSavedStateLabel(virSecurityManager *mgr, + virDomainDef *vm, const char *savefile) { if (mgr->drv->domainRestoreSavedStateLabel) { @@ -630,13 +630,13 @@ virSecurityManagerRestoreSavedStateLabel(virSecurityManagerPtr mgr, int -virSecurityManagerGenLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityManagerGenLabel(virSecurityManager *mgr, + virDomainDef *vm) { int ret = -1; size_t i; - virSecurityManagerPtr* sec_managers = NULL; - virSecurityLabelDefPtr seclabel; + virSecurityManager ** sec_managers = NULL; + virSecurityLabelDef *seclabel; bool generated = false; if ((sec_managers = virSecurityManagerGetNested(mgr)) == NULL) @@ -711,8 +711,8 @@ virSecurityManagerGenLabel(virSecurityManagerPtr mgr, int -virSecurityManagerReserveLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityManagerReserveLabel(virSecurityManager *mgr, + virDomainDef *vm, pid_t pid) { if (mgr->drv->domainReserveSecurityLabel) { @@ -729,8 +729,8 @@ virSecurityManagerReserveLabel(virSecurityManagerPtr mgr, int -virSecurityManagerReleaseLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityManagerReleaseLabel(virSecurityManager *mgr, + virDomainDef *vm) { if (mgr->drv->domainReleaseSecurityLabel) { int ret; @@ -745,12 +745,12 @@ virSecurityManagerReleaseLabel(virSecurityManagerPtr mgr, } -static int virSecurityManagerCheckModel(virSecurityManagerPtr mgr, +static int virSecurityManagerCheckModel(virSecurityManager *mgr, char *secmodel) { int ret = -1; size_t i; - virSecurityManagerPtr *sec_managers = NULL; + virSecurityManager **sec_managers = NULL; if (STREQ_NULLABLE(secmodel, "none")) return 0; @@ -775,8 +775,8 @@ static int virSecurityManagerCheckModel(virSecurityManagerPtr mgr, static int -virSecurityManagerCheckDomainLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def) +virSecurityManagerCheckDomainLabel(virSecurityManager *mgr, + virDomainDef *def) { size_t i; @@ -790,8 +790,8 @@ virSecurityManagerCheckDomainLabel(virSecurityManagerPtr mgr, static int -virSecurityManagerCheckDiskLabel(virSecurityManagerPtr mgr, - virDomainDiskDefPtr disk) +virSecurityManagerCheckDiskLabel(virSecurityManager *mgr, + virDomainDiskDef *disk) { size_t i; @@ -805,8 +805,8 @@ virSecurityManagerCheckDiskLabel(virSecurityManagerPtr mgr, static int -virSecurityManagerCheckChardevLabel(virSecurityManagerPtr mgr, - virDomainChrDefPtr dev) +virSecurityManagerCheckChardevLabel(virSecurityManager *mgr, + virDomainChrDef *dev) { size_t i; @@ -820,17 +820,17 @@ virSecurityManagerCheckChardevLabel(virSecurityManagerPtr mgr, static int -virSecurityManagerCheckChardevCallback(virDomainDefPtr def G_GNUC_UNUSED, - virDomainChrDefPtr dev, +virSecurityManagerCheckChardevCallback(virDomainDef *def G_GNUC_UNUSED, + virDomainChrDef *dev, void *opaque) { - virSecurityManagerPtr mgr = opaque; + virSecurityManager *mgr = opaque; return virSecurityManagerCheckChardevLabel(mgr, dev); } -int virSecurityManagerCheckAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +int virSecurityManagerCheckAllLabel(virSecurityManager *mgr, + virDomainDef *vm) { size_t i; @@ -853,8 +853,8 @@ int virSecurityManagerCheckAllLabel(virSecurityManagerPtr mgr, int -virSecurityManagerSetAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityManagerSetAllLabel(virSecurityManager *mgr, + virDomainDef *vm, const char *incomingPath, bool chardevStdioLogd, bool migrated) @@ -875,8 +875,8 @@ virSecurityManagerSetAllLabel(virSecurityManagerPtr mgr, int -virSecurityManagerRestoreAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityManagerRestoreAllLabel(virSecurityManager *mgr, + virDomainDef *vm, bool migrated, bool chardevStdioLogd) { @@ -894,8 +894,8 @@ virSecurityManagerRestoreAllLabel(virSecurityManagerPtr mgr, } int -virSecurityManagerGetProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityManagerGetProcessLabel(virSecurityManager *mgr, + virDomainDef *vm, pid_t pid, virSecurityLabelPtr sec) { @@ -913,8 +913,8 @@ virSecurityManagerGetProcessLabel(virSecurityManagerPtr mgr, int -virSecurityManagerSetProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityManagerSetProcessLabel(virSecurityManager *mgr, + virDomainDef *vm) { if (mgr->drv->domainSetSecurityProcessLabel) { int ret; @@ -930,9 +930,9 @@ virSecurityManagerSetProcessLabel(virSecurityManagerPtr mgr, int -virSecurityManagerSetChildProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virCommandPtr cmd) +virSecurityManagerSetChildProcessLabel(virSecurityManager *mgr, + virDomainDef *vm, + virCommand *cmd) { if (mgr->drv->domainSetSecurityChildProcessLabel) return mgr->drv->domainSetSecurityChildProcessLabel(mgr, vm, cmd); @@ -943,10 +943,10 @@ virSecurityManagerSetChildProcessLabel(virSecurityManagerPtr mgr, int -virSecurityManagerVerify(virSecurityManagerPtr mgr, - virDomainDefPtr def) +virSecurityManagerVerify(virSecurityManager *mgr, + virDomainDef *def) { - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; if (mgr == NULL || mgr->drv == NULL) return 0; @@ -973,8 +973,8 @@ virSecurityManagerVerify(virSecurityManagerPtr mgr, int -virSecurityManagerSetImageFDLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityManagerSetImageFDLabel(virSecurityManager *mgr, + virDomainDef *vm, int fd) { if (mgr->drv->domainSetSecurityImageFDLabel) { @@ -991,8 +991,8 @@ virSecurityManagerSetImageFDLabel(virSecurityManagerPtr mgr, int -virSecurityManagerSetTapFDLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityManagerSetTapFDLabel(virSecurityManager *mgr, + virDomainDef *vm, int fd) { if (mgr->drv->domainSetSecurityTapFDLabel) { @@ -1009,8 +1009,8 @@ virSecurityManagerSetTapFDLabel(virSecurityManagerPtr mgr, char * -virSecurityManagerGetMountOptions(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityManagerGetMountOptions(virSecurityManager *mgr, + virDomainDef *vm) { if (mgr->drv->domainGetSecurityMountOptions) { char *ret; @@ -1025,15 +1025,15 @@ virSecurityManagerGetMountOptions(virSecurityManagerPtr mgr, } -virSecurityManagerPtr* -virSecurityManagerGetNested(virSecurityManagerPtr mgr) +virSecurityManager ** +virSecurityManagerGetNested(virSecurityManager *mgr) { - virSecurityManagerPtr* list = NULL; + virSecurityManager ** list = NULL; if (STREQ("stack", mgr->drv->name)) return virSecurityStackGetNested(mgr); - list = g_new0(virSecurityManagerPtr, 2); + list = g_new0(virSecurityManager *, 2); list[0] = mgr; list[1] = NULL; @@ -1056,8 +1056,8 @@ virSecurityManagerGetNested(virSecurityManagerPtr mgr) * Returns: 0 on success, -1 on error. */ int -virSecurityManagerDomainSetPathLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityManagerDomainSetPathLabel(virSecurityManager *mgr, + virDomainDef *vm, const char *path, bool allowSubtree) { @@ -1086,8 +1086,8 @@ virSecurityManagerDomainSetPathLabel(virSecurityManagerPtr mgr, * Returns: 0 on success, -1 on error. */ int -virSecurityManagerDomainSetPathLabelRO(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityManagerDomainSetPathLabelRO(virSecurityManager *mgr, + virDomainDef *vm, const char *path) { if (mgr->drv->domainSetPathLabelRO) { @@ -1113,8 +1113,8 @@ virSecurityManagerDomainSetPathLabelRO(virSecurityManagerPtr mgr, * Returns: 0 on success, -1 on error. */ int -virSecurityManagerDomainRestorePathLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityManagerDomainRestorePathLabel(virSecurityManager *mgr, + virDomainDef *vm, const char *path) { if (mgr->drv->domainRestorePathLabel) { @@ -1141,9 +1141,9 @@ virSecurityManagerDomainRestorePathLabel(virSecurityManagerPtr mgr, * Returns: 0 on success, -1 on error. */ int -virSecurityManagerSetMemoryLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainMemoryDefPtr mem) +virSecurityManagerSetMemoryLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainMemoryDef *mem) { if (mgr->drv->domainSetSecurityMemoryLabel) { int ret; @@ -1169,9 +1169,9 @@ virSecurityManagerSetMemoryLabel(virSecurityManagerPtr mgr, * Returns: 0 on success, -1 on error. */ int -virSecurityManagerRestoreMemoryLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainMemoryDefPtr mem) +virSecurityManagerRestoreMemoryLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainMemoryDef *mem) { if (mgr->drv->domainRestoreSecurityMemoryLabel) { int ret; @@ -1187,9 +1187,9 @@ virSecurityManagerRestoreMemoryLabel(virSecurityManagerPtr mgr, int -virSecurityManagerSetInputLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainInputDefPtr input) +virSecurityManagerSetInputLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainInputDef *input) { if (mgr->drv->domainSetSecurityInputLabel) { int ret; @@ -1205,9 +1205,9 @@ virSecurityManagerSetInputLabel(virSecurityManagerPtr mgr, int -virSecurityManagerRestoreInputLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainInputDefPtr input) +virSecurityManagerRestoreInputLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainInputDef *input) { if (mgr->drv->domainRestoreSecurityInputLabel) { int ret; @@ -1223,9 +1223,9 @@ virSecurityManagerRestoreInputLabel(virSecurityManagerPtr mgr, int -virSecurityManagerSetChardevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +virSecurityManagerSetChardevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd) { if (mgr->drv->domainSetSecurityChardevLabel) { @@ -1243,9 +1243,9 @@ virSecurityManagerSetChardevLabel(virSecurityManagerPtr mgr, int -virSecurityManagerRestoreChardevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +virSecurityManagerRestoreChardevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd) { if (mgr->drv->domainRestoreSecurityChardevLabel) { @@ -1263,8 +1263,8 @@ virSecurityManagerRestoreChardevLabel(virSecurityManagerPtr mgr, int -virSecurityManagerSetTPMLabels(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityManagerSetTPMLabels(virSecurityManager *mgr, + virDomainDef *vm) { int ret; @@ -1281,8 +1281,8 @@ virSecurityManagerSetTPMLabels(virSecurityManagerPtr mgr, int -virSecurityManagerRestoreTPMLabels(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityManagerRestoreTPMLabels(virSecurityManager *mgr, + virDomainDef *vm) { int ret; @@ -1333,8 +1333,8 @@ cmpstringp(const void *p1, const void *p2) * Returns: state on success, * NULL on failure. */ -virSecurityManagerMetadataLockStatePtr -virSecurityManagerMetadataLock(virSecurityManagerPtr mgr G_GNUC_UNUSED, +virSecurityManagerMetadataLockState * +virSecurityManagerMetadataLock(virSecurityManager *mgr G_GNUC_UNUSED, const char **paths, size_t npaths) { @@ -1342,7 +1342,7 @@ virSecurityManagerMetadataLock(virSecurityManagerPtr mgr G_GNUC_UNUSED, size_t nfds = 0; int *fds = NULL; const char **locked_paths = NULL; - virSecurityManagerMetadataLockStatePtr ret = NULL; + virSecurityManagerMetadataLockState *ret = NULL; fds = g_new0(int, npaths); locked_paths = g_new0(const char *, npaths); @@ -1455,8 +1455,8 @@ virSecurityManagerMetadataLock(virSecurityManagerPtr mgr G_GNUC_UNUSED, void -virSecurityManagerMetadataUnlock(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virSecurityManagerMetadataLockStatePtr *state) +virSecurityManagerMetadataUnlock(virSecurityManager *mgr G_GNUC_UNUSED, + virSecurityManagerMetadataLockState **state) { size_t i; diff --git a/src/security/security_manager.h b/src/security/security_manager.h index 1c9e166174..b5c81e9d98 100644 --- a/src/security/security_manager.h +++ b/src/security/security_manager.h @@ -25,7 +25,6 @@ #include "virstoragefile.h" typedef struct _virSecurityManager virSecurityManager; -typedef virSecurityManager *virSecurityManagerPtr; typedef enum { VIR_SECURITY_MANAGER_DEFAULT_CONFINED = 1 << 1, @@ -40,13 +39,13 @@ typedef enum { VIR_SECURITY_MANAGER_REQUIRE_CONFINED | \ VIR_SECURITY_MANAGER_PRIVILEGED) -virSecurityManagerPtr virSecurityManagerNew(const char *name, +virSecurityManager *virSecurityManagerNew(const char *name, const char *virtDriver, unsigned int flags); -virSecurityManagerPtr virSecurityManagerNewStack(virSecurityManagerPtr primary); -int virSecurityManagerStackAddNested(virSecurityManagerPtr stack, - virSecurityManagerPtr nested); +virSecurityManager *virSecurityManagerNewStack(virSecurityManager *primary); +int virSecurityManagerStackAddNested(virSecurityManager *stack, + virSecurityManager *nested); /** * virSecurityManagerDACChownCallback: @@ -63,91 +62,91 @@ typedef int gid_t gid); -virSecurityManagerPtr virSecurityManagerNewDAC(const char *virtDriver, +virSecurityManager *virSecurityManagerNewDAC(const char *virtDriver, uid_t user, gid_t group, unsigned int flags, virSecurityManagerDACChownCallback chownCallback); -int virSecurityManagerPreFork(virSecurityManagerPtr mgr); -void virSecurityManagerPostFork(virSecurityManagerPtr mgr); +int virSecurityManagerPreFork(virSecurityManager *mgr); +void virSecurityManagerPostFork(virSecurityManager *mgr); -int virSecurityManagerTransactionStart(virSecurityManagerPtr mgr); -int virSecurityManagerTransactionCommit(virSecurityManagerPtr mgr, +int virSecurityManagerTransactionStart(virSecurityManager *mgr); +int virSecurityManagerTransactionCommit(virSecurityManager *mgr, pid_t pid, bool lock); -void virSecurityManagerTransactionAbort(virSecurityManagerPtr mgr); +void virSecurityManagerTransactionAbort(virSecurityManager *mgr); -void *virSecurityManagerGetPrivateData(virSecurityManagerPtr mgr); +void *virSecurityManagerGetPrivateData(virSecurityManager *mgr); -const char *virSecurityManagerGetDriver(virSecurityManagerPtr mgr); -const char *virSecurityManagerGetVirtDriver(virSecurityManagerPtr mgr); -const char *virSecurityManagerGetDOI(virSecurityManagerPtr mgr); -const char *virSecurityManagerGetModel(virSecurityManagerPtr mgr); -const char *virSecurityManagerGetBaseLabel(virSecurityManagerPtr mgr, int virtType); +const char *virSecurityManagerGetDriver(virSecurityManager *mgr); +const char *virSecurityManagerGetVirtDriver(virSecurityManager *mgr); +const char *virSecurityManagerGetDOI(virSecurityManager *mgr); +const char *virSecurityManagerGetModel(virSecurityManager *mgr); +const char *virSecurityManagerGetBaseLabel(virSecurityManager *mgr, int virtType); -bool virSecurityManagerGetDefaultConfined(virSecurityManagerPtr mgr); -bool virSecurityManagerGetRequireConfined(virSecurityManagerPtr mgr); -bool virSecurityManagerGetPrivileged(virSecurityManagerPtr mgr); +bool virSecurityManagerGetDefaultConfined(virSecurityManager *mgr); +bool virSecurityManagerGetRequireConfined(virSecurityManager *mgr); +bool virSecurityManagerGetPrivileged(virSecurityManager *mgr); -int virSecurityManagerSetDaemonSocketLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm); -int virSecurityManagerSetSocketLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def); -int virSecurityManagerClearSocketLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def); -int virSecurityManagerRestoreHostdevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainHostdevDefPtr dev, +int virSecurityManagerSetDaemonSocketLabel(virSecurityManager *mgr, + virDomainDef *vm); +int virSecurityManagerSetSocketLabel(virSecurityManager *mgr, + virDomainDef *def); +int virSecurityManagerClearSocketLabel(virSecurityManager *mgr, + virDomainDef *def); +int virSecurityManagerRestoreHostdevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainHostdevDef *dev, const char *vroot); -int virSecurityManagerSetHostdevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainHostdevDefPtr dev, +int virSecurityManagerSetHostdevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainHostdevDef *dev, const char *vroot); -int virSecurityManagerSetSavedStateLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +int virSecurityManagerSetSavedStateLabel(virSecurityManager *mgr, + virDomainDef *def, const char *savefile); -int virSecurityManagerRestoreSavedStateLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +int virSecurityManagerRestoreSavedStateLabel(virSecurityManager *mgr, + virDomainDef *def, const char *savefile); -int virSecurityManagerGenLabel(virSecurityManagerPtr mgr, - virDomainDefPtr sec); -int virSecurityManagerReserveLabel(virSecurityManagerPtr mgr, - virDomainDefPtr sec, +int virSecurityManagerGenLabel(virSecurityManager *mgr, + virDomainDef *sec); +int virSecurityManagerReserveLabel(virSecurityManager *mgr, + virDomainDef *sec, pid_t pid); -int virSecurityManagerReleaseLabel(virSecurityManagerPtr mgr, - virDomainDefPtr sec); -int virSecurityManagerCheckAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr sec); -int virSecurityManagerSetAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr sec, +int virSecurityManagerReleaseLabel(virSecurityManager *mgr, + virDomainDef *sec); +int virSecurityManagerCheckAllLabel(virSecurityManager *mgr, + virDomainDef *sec); +int virSecurityManagerSetAllLabel(virSecurityManager *mgr, + virDomainDef *sec, const char *incomingPath, bool chardevStdioLogd, bool migrated); -int virSecurityManagerRestoreAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +int virSecurityManagerRestoreAllLabel(virSecurityManager *mgr, + virDomainDef *def, bool migrated, bool chardevStdioLogd); -int virSecurityManagerGetProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +int virSecurityManagerGetProcessLabel(virSecurityManager *mgr, + virDomainDef *def, pid_t pid, virSecurityLabelPtr sec); -int virSecurityManagerSetProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def); -int virSecurityManagerSetChildProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virCommandPtr cmd); -int virSecurityManagerVerify(virSecurityManagerPtr mgr, - virDomainDefPtr def); -int virSecurityManagerSetImageFDLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +int virSecurityManagerSetProcessLabel(virSecurityManager *mgr, + virDomainDef *def); +int virSecurityManagerSetChildProcessLabel(virSecurityManager *mgr, + virDomainDef *def, + virCommand *cmd); +int virSecurityManagerVerify(virSecurityManager *mgr, + virDomainDef *def); +int virSecurityManagerSetImageFDLabel(virSecurityManager *mgr, + virDomainDef *def, int fd); -int virSecurityManagerSetTapFDLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +int virSecurityManagerSetTapFDLabel(virSecurityManager *mgr, + virDomainDef *vm, int fd); -char *virSecurityManagerGetMountOptions(virSecurityManagerPtr mgr, - virDomainDefPtr vm); -virSecurityManagerPtr* virSecurityManagerGetNested(virSecurityManagerPtr mgr); +char *virSecurityManagerGetMountOptions(virSecurityManager *mgr, + virDomainDef *vm); +virSecurityManager ** virSecurityManagerGetNested(virSecurityManager *mgr); typedef enum { VIR_SECURITY_DOMAIN_IMAGE_LABEL_BACKING_CHAIN = 1 << 0, @@ -157,65 +156,64 @@ typedef enum { VIR_SECURITY_DOMAIN_IMAGE_PARENT_CHAIN_TOP = 1 << 1, } virSecurityDomainImageLabelFlags; -int virSecurityManagerSetImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virStorageSourcePtr src, +int virSecurityManagerSetImageLabel(virSecurityManager *mgr, + virDomainDef *vm, + virStorageSource *src, virSecurityDomainImageLabelFlags flags); -int virSecurityManagerRestoreImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virStorageSourcePtr src, +int virSecurityManagerRestoreImageLabel(virSecurityManager *mgr, + virDomainDef *vm, + virStorageSource *src, virSecurityDomainImageLabelFlags flags); -int virSecurityManagerMoveImageMetadata(virSecurityManagerPtr mgr, +int virSecurityManagerMoveImageMetadata(virSecurityManager *mgr, pid_t pid, - virStorageSourcePtr src, - virStorageSourcePtr dst); + virStorageSource *src, + virStorageSource *dst); -int virSecurityManagerSetMemoryLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainMemoryDefPtr mem); -int virSecurityManagerRestoreMemoryLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainMemoryDefPtr mem); +int virSecurityManagerSetMemoryLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainMemoryDef *mem); +int virSecurityManagerRestoreMemoryLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainMemoryDef *mem); -int virSecurityManagerSetInputLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainInputDefPtr input); -int virSecurityManagerRestoreInputLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainInputDefPtr input); +int virSecurityManagerSetInputLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainInputDef *input); +int virSecurityManagerRestoreInputLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainInputDef *input); -int virSecurityManagerDomainSetPathLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +int virSecurityManagerDomainSetPathLabel(virSecurityManager *mgr, + virDomainDef *vm, const char *path, bool allowSubtree); -int virSecurityManagerDomainSetPathLabelRO(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +int virSecurityManagerDomainSetPathLabelRO(virSecurityManager *mgr, + virDomainDef *vm, const char *path); -int virSecurityManagerDomainRestorePathLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +int virSecurityManagerDomainRestorePathLabel(virSecurityManager *mgr, + virDomainDef *def, const char *path); -int virSecurityManagerSetChardevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +int virSecurityManagerSetChardevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd); -int virSecurityManagerRestoreChardevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +int virSecurityManagerRestoreChardevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd); -int virSecurityManagerSetTPMLabels(virSecurityManagerPtr mgr, - virDomainDefPtr vm); +int virSecurityManagerSetTPMLabels(virSecurityManager *mgr, + virDomainDef *vm); -int virSecurityManagerRestoreTPMLabels(virSecurityManagerPtr mgr, - virDomainDefPtr vm); +int virSecurityManagerRestoreTPMLabels(virSecurityManager *mgr, + virDomainDef *vm); typedef struct _virSecurityManagerMetadataLockState virSecurityManagerMetadataLockState; -typedef virSecurityManagerMetadataLockState *virSecurityManagerMetadataLockStatePtr; struct _virSecurityManagerMetadataLockState { size_t nfds; /* Captures size of both @fds and @paths */ int *fds; @@ -223,11 +221,11 @@ struct _virSecurityManagerMetadataLockState { }; -virSecurityManagerMetadataLockStatePtr -virSecurityManagerMetadataLock(virSecurityManagerPtr mgr, +virSecurityManagerMetadataLockState * +virSecurityManagerMetadataLock(virSecurityManager *mgr, const char **paths, size_t npaths); void -virSecurityManagerMetadataUnlock(virSecurityManagerPtr mgr, - virSecurityManagerMetadataLockStatePtr *state); +virSecurityManagerMetadataUnlock(virSecurityManager *mgr, + virSecurityManagerMetadataLockState **state); diff --git a/src/security/security_nop.c b/src/security/security_nop.c index 385a747f5b..a634e7f3fe 100644 --- a/src/security/security_nop.c +++ b/src/security/security_nop.c @@ -32,93 +32,93 @@ virSecurityDriverProbeNop(const char *virtDriver G_GNUC_UNUSED) } static int -virSecurityDriverOpenNop(virSecurityManagerPtr mgr G_GNUC_UNUSED) +virSecurityDriverOpenNop(virSecurityManager *mgr G_GNUC_UNUSED) { return 0; } static int -virSecurityDriverCloseNop(virSecurityManagerPtr mgr G_GNUC_UNUSED) +virSecurityDriverCloseNop(virSecurityManager *mgr G_GNUC_UNUSED) { return 0; } static const char * -virSecurityDriverGetModelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED) +virSecurityDriverGetModelNop(virSecurityManager *mgr G_GNUC_UNUSED) { return "none"; } static const char * -virSecurityDriverGetDOINop(virSecurityManagerPtr mgr G_GNUC_UNUSED) +virSecurityDriverGetDOINop(virSecurityManager *mgr G_GNUC_UNUSED) { return "0"; } static int -virSecurityDomainSetDaemonSocketLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED) +virSecurityDomainSetDaemonSocketLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainSetSocketLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED) +virSecurityDomainSetSocketLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainClearSocketLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED) +virSecurityDomainClearSocketLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainRestoreHostdevLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED, - virDomainHostdevDefPtr dev G_GNUC_UNUSED, +virSecurityDomainRestoreHostdevLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED, + virDomainHostdevDef *dev G_GNUC_UNUSED, const char *vroot G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainSetHostdevLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED, - virDomainHostdevDefPtr dev G_GNUC_UNUSED, +virSecurityDomainSetHostdevLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED, + virDomainHostdevDef *dev G_GNUC_UNUSED, const char *vroot G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainGenLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr sec G_GNUC_UNUSED) +virSecurityDomainGenLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *sec G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainReserveLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr sec G_GNUC_UNUSED, +virSecurityDomainReserveLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *sec G_GNUC_UNUSED, pid_t pid G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainReleaseLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr sec G_GNUC_UNUSED) +virSecurityDomainReleaseLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *sec G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainSetAllLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr sec G_GNUC_UNUSED, +virSecurityDomainSetAllLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *sec G_GNUC_UNUSED, const char *incomingPath G_GNUC_UNUSED, bool chardevStdioLogd G_GNUC_UNUSED, bool migrated G_GNUC_UNUSED) @@ -127,8 +127,8 @@ virSecurityDomainSetAllLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -virSecurityDomainRestoreAllLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED, +virSecurityDomainRestoreAllLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED, bool migrated G_GNUC_UNUSED, bool chardevStdioLogd G_GNUC_UNUSED) { @@ -136,8 +136,8 @@ virSecurityDomainRestoreAllLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -virSecurityDomainGetProcessLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED, +virSecurityDomainGetProcessLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED, pid_t pid G_GNUC_UNUSED, virSecurityLabelPtr sec G_GNUC_UNUSED) { @@ -145,38 +145,38 @@ virSecurityDomainGetProcessLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -virSecurityDomainSetProcessLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED) +virSecurityDomainSetProcessLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainSetChildProcessLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED, - virCommandPtr cmd G_GNUC_UNUSED) +virSecurityDomainSetChildProcessLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED, + virCommand *cmd G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainVerifyNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED) +virSecurityDomainVerifyNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainSetFDLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr sec G_GNUC_UNUSED, +virSecurityDomainSetFDLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *sec G_GNUC_UNUSED, int fd G_GNUC_UNUSED) { return 0; } static char * -virSecurityDomainGetMountOptionsNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED) +virSecurityDomainGetMountOptionsNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED) { char *opts; @@ -185,76 +185,76 @@ virSecurityDomainGetMountOptionsNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static const char * -virSecurityGetBaseLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, +virSecurityGetBaseLabel(virSecurityManager *mgr G_GNUC_UNUSED, int virtType G_GNUC_UNUSED) { return NULL; } static int -virSecurityDomainRestoreImageLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, - virStorageSourcePtr src G_GNUC_UNUSED, +virSecurityDomainRestoreImageLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, + virStorageSource *src G_GNUC_UNUSED, virSecurityDomainImageLabelFlags flags G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainSetImageLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, - virStorageSourcePtr src G_GNUC_UNUSED, +virSecurityDomainSetImageLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, + virStorageSource *src G_GNUC_UNUSED, virSecurityDomainImageLabelFlags flags G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainMoveImageMetadataNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, +virSecurityDomainMoveImageMetadataNop(virSecurityManager *mgr G_GNUC_UNUSED, pid_t pid G_GNUC_UNUSED, - virStorageSourcePtr src G_GNUC_UNUSED, - virStorageSourcePtr dst G_GNUC_UNUSED) + virStorageSource *src G_GNUC_UNUSED, + virStorageSource *dst G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainSetMemoryLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, - virDomainMemoryDefPtr mem G_GNUC_UNUSED) +virSecurityDomainSetMemoryLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, + virDomainMemoryDef *mem G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainRestoreMemoryLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, - virDomainMemoryDefPtr mem G_GNUC_UNUSED) +virSecurityDomainRestoreMemoryLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, + virDomainMemoryDef *mem G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainInputLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, - virDomainInputDefPtr input G_GNUC_UNUSED) +virSecurityDomainInputLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, + virDomainInputDef *input G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainSetChardevLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, - virDomainChrSourceDefPtr dev_source G_GNUC_UNUSED, +virSecurityDomainSetChardevLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, + virDomainChrSourceDef *dev_source G_GNUC_UNUSED, bool chardevStdioLogd G_GNUC_UNUSED) { return 0; } static int -virSecurityDomainRestoreChardevLabelNop(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, - virDomainChrSourceDefPtr dev_source G_GNUC_UNUSED, +virSecurityDomainRestoreChardevLabelNop(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, + virDomainChrSourceDef *dev_source G_GNUC_UNUSED, bool chardevStdioLogd G_GNUC_UNUSED) { return 0; diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index 9da4e96fa6..29628d8953 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -51,8 +51,6 @@ VIR_LOG_INIT("security.security_selinux"); #define MAX_CONTEXT 1024 typedef struct _virSecuritySELinuxData virSecuritySELinuxData; -typedef virSecuritySELinuxData *virSecuritySELinuxDataPtr; - struct _virSecuritySELinuxData { char *domain_context; char *alt_domain_context; @@ -65,15 +63,12 @@ struct _virSecuritySELinuxData { /* Data structure to pass to various callbacks so we have everything we need */ typedef struct _virSecuritySELinuxCallbackData virSecuritySELinuxCallbackData; -typedef virSecuritySELinuxCallbackData *virSecuritySELinuxCallbackDataPtr; - struct _virSecuritySELinuxCallbackData { - virSecurityManagerPtr mgr; - virDomainDefPtr def; + virSecurityManager *mgr; + virDomainDef *def; }; typedef struct _virSecuritySELinuxContextItem virSecuritySELinuxContextItem; -typedef virSecuritySELinuxContextItem *virSecuritySELinuxContextItemPtr; struct _virSecuritySELinuxContextItem { char *path; char *tcon; @@ -82,10 +77,9 @@ struct _virSecuritySELinuxContextItem { }; typedef struct _virSecuritySELinuxContextList virSecuritySELinuxContextList; -typedef virSecuritySELinuxContextList *virSecuritySELinuxContextListPtr; struct _virSecuritySELinuxContextList { - virSecurityManagerPtr manager; - virSecuritySELinuxContextItemPtr *items; + virSecurityManager *manager; + virSecuritySELinuxContextItem **items; size_t nItems; bool lock; }; @@ -94,16 +88,16 @@ struct _virSecuritySELinuxContextList { #define SECURITY_SELINUX_NAME "selinux" static int -virSecuritySELinuxRestoreTPMFileLabelInt(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainTPMDefPtr tpm); +virSecuritySELinuxRestoreTPMFileLabelInt(virSecurityManager *mgr, + virDomainDef *def, + virDomainTPMDef *tpm); virThreadLocal contextList; static void -virSecuritySELinuxContextItemFree(virSecuritySELinuxContextItemPtr item) +virSecuritySELinuxContextItemFree(virSecuritySELinuxContextItem *item) { if (!item) return; @@ -114,14 +108,14 @@ virSecuritySELinuxContextItemFree(virSecuritySELinuxContextItemPtr item) } static int -virSecuritySELinuxContextListAppend(virSecuritySELinuxContextListPtr list, +virSecuritySELinuxContextListAppend(virSecuritySELinuxContextList *list, const char *path, const char *tcon, bool remember, bool restore) { int ret = -1; - virSecuritySELinuxContextItemPtr item = NULL; + virSecuritySELinuxContextItem *item = NULL; item = g_new0(virSecuritySELinuxContextItem, 1); @@ -143,7 +137,7 @@ virSecuritySELinuxContextListAppend(virSecuritySELinuxContextListPtr list, static void virSecuritySELinuxContextListFree(void *opaque) { - virSecuritySELinuxContextListPtr list = opaque; + virSecuritySELinuxContextList *list = opaque; size_t i; if (!list) @@ -181,7 +175,7 @@ virSecuritySELinuxTransactionAppend(const char *path, bool remember, bool restore) { - virSecuritySELinuxContextListPtr list; + virSecuritySELinuxContextList *list; list = virThreadLocalGet(&contextList); if (!list) @@ -221,13 +215,13 @@ virSecuritySELinuxRecallLabel(const char *path, } -static int virSecuritySELinuxSetFilecon(virSecurityManagerPtr mgr, +static int virSecuritySELinuxSetFilecon(virSecurityManager *mgr, const char *path, const char *tcon, bool remember); -static int virSecuritySELinuxRestoreFileLabel(virSecurityManagerPtr mgr, +static int virSecuritySELinuxRestoreFileLabel(virSecurityManager *mgr, const char *path, bool recall); @@ -248,8 +242,8 @@ static int virSecuritySELinuxTransactionRun(pid_t pid G_GNUC_UNUSED, void *opaque) { - virSecuritySELinuxContextListPtr list = opaque; - virSecurityManagerMetadataLockStatePtr state; + virSecuritySELinuxContextList *list = opaque; + virSecurityManagerMetadataLockState *state; const char **paths = NULL; size_t npaths = 0; size_t i; @@ -260,7 +254,7 @@ virSecuritySELinuxTransactionRun(pid_t pid G_GNUC_UNUSED, paths = g_new0(const char *, list->nItems); for (i = 0; i < list->nItems; i++) { - virSecuritySELinuxContextItemPtr item = list->items[i]; + virSecuritySELinuxContextItem *item = list->items[i]; const char *p = item->path; if (item->remember) @@ -271,7 +265,7 @@ virSecuritySELinuxTransactionRun(pid_t pid G_GNUC_UNUSED, goto cleanup; for (i = 0; i < list->nItems; i++) { - virSecuritySELinuxContextItemPtr item = list->items[i]; + virSecuritySELinuxContextItem *item = list->items[i]; size_t j; for (j = 0; j < state->nfds; j++) { @@ -287,7 +281,7 @@ virSecuritySELinuxTransactionRun(pid_t pid G_GNUC_UNUSED, rv = 0; for (i = 0; i < list->nItems; i++) { - virSecuritySELinuxContextItemPtr item = list->items[i]; + virSecuritySELinuxContextItem *item = list->items[i]; const bool remember = item->remember && list->lock; if (!item->restore) { @@ -306,7 +300,7 @@ virSecuritySELinuxTransactionRun(pid_t pid G_GNUC_UNUSED, } for (; rv < 0 && i > 0; i--) { - virSecuritySELinuxContextItemPtr item = list->items[i - 1]; + virSecuritySELinuxContextItem *item = list->items[i - 1]; const bool remember = item->remember && list->lock; if (!item->restore) { @@ -335,10 +329,10 @@ virSecuritySELinuxTransactionRun(pid_t pid G_GNUC_UNUSED, * Returns 0 on success, 1 if already reserved, or -1 on fatal error */ static int -virSecuritySELinuxMCSAdd(virSecurityManagerPtr mgr, +virSecuritySELinuxMCSAdd(virSecurityManager *mgr, const char *mcs) { - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); if (virHashLookup(data->mcs, mcs)) return 1; @@ -350,22 +344,22 @@ virSecuritySELinuxMCSAdd(virSecurityManagerPtr mgr, } static void -virSecuritySELinuxMCSRemove(virSecurityManagerPtr mgr, +virSecuritySELinuxMCSRemove(virSecurityManager *mgr, const char *mcs) { - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); virHashRemoveEntry(data->mcs, mcs); } static char * -virSecuritySELinuxMCSFind(virSecurityManagerPtr mgr, +virSecuritySELinuxMCSFind(virSecurityManager *mgr, const char *sens, int catMin, int catMax) { - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); int catRange; char *mcs = NULL; @@ -638,10 +632,10 @@ virSecuritySELinuxGenNewContext(const char *basecontext, static int -virSecuritySELinuxLXCInitialize(virSecurityManagerPtr mgr) +virSecuritySELinuxLXCInitialize(virSecurityManager *mgr) { g_autoptr(virConf) selinux_conf = NULL; - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); data->skipAllLabel = true; @@ -702,10 +696,10 @@ virSecuritySELinuxLXCInitialize(virSecurityManagerPtr mgr) static int -virSecuritySELinuxQEMUInitialize(virSecurityManagerPtr mgr) +virSecuritySELinuxQEMUInitialize(virSecurityManager *mgr) { char *ptr; - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); data->skipAllLabel = false; @@ -775,7 +769,7 @@ virSecuritySELinuxQEMUInitialize(virSecurityManagerPtr mgr) static int -virSecuritySELinuxInitialize(virSecurityManagerPtr mgr) +virSecuritySELinuxInitialize(virSecurityManager *mgr) { VIR_DEBUG("SELinuxInitialize %s", virSecurityManagerGetVirtDriver(mgr)); @@ -795,15 +789,15 @@ virSecuritySELinuxInitialize(virSecurityManagerPtr mgr) static int -virSecuritySELinuxGenLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def) +virSecuritySELinuxGenLabel(virSecurityManager *mgr, + virDomainDef *def) { int rc = -1; char *mcs = NULL; context_t ctx = NULL; const char *range; - virSecurityLabelDefPtr seclabel; - virSecuritySELinuxDataPtr data; + virSecurityLabelDef *seclabel; + virSecuritySELinuxData *data; const char *baselabel; char *sens = NULL; int catMin, catMax; @@ -949,15 +943,15 @@ virSecuritySELinuxGenLabel(virSecurityManagerPtr mgr, } static int -virSecuritySELinuxReserveLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +virSecuritySELinuxReserveLabel(virSecurityManager *mgr, + virDomainDef *def, pid_t pid) { char *pctx; context_t ctx = NULL; const char *mcs; int rv; - virSecurityLabelDefPtr seclabel; + virSecurityLabelDef *seclabel; seclabel = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (!seclabel || @@ -1016,16 +1010,16 @@ virSecuritySELinuxDriverProbe(const char *virtDriver) static int -virSecuritySELinuxDriverOpen(virSecurityManagerPtr mgr) +virSecuritySELinuxDriverOpen(virSecurityManager *mgr) { return virSecuritySELinuxInitialize(mgr); } static int -virSecuritySELinuxDriverClose(virSecurityManagerPtr mgr) +virSecuritySELinuxDriverClose(virSecurityManager *mgr) { - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); if (!data) return 0; @@ -1045,13 +1039,13 @@ virSecuritySELinuxDriverClose(virSecurityManagerPtr mgr) static const char * -virSecuritySELinuxGetModel(virSecurityManagerPtr mgr G_GNUC_UNUSED) +virSecuritySELinuxGetModel(virSecurityManager *mgr G_GNUC_UNUSED) { return SECURITY_SELINUX_NAME; } static const char * -virSecuritySELinuxGetDOI(virSecurityManagerPtr mgr G_GNUC_UNUSED) +virSecuritySELinuxGetDOI(virSecurityManager *mgr G_GNUC_UNUSED) { /* * Where will the DOI come from? SELinux configuration, or qemu @@ -1075,9 +1069,9 @@ virSecuritySELinuxGetDOI(virSecurityManagerPtr mgr G_GNUC_UNUSED) * -1 otherwise. */ static int -virSecuritySELinuxTransactionStart(virSecurityManagerPtr mgr) +virSecuritySELinuxTransactionStart(virSecurityManager *mgr) { - virSecuritySELinuxContextListPtr list; + virSecuritySELinuxContextList *list; list = virThreadLocalGet(&contextList); if (list) { @@ -1123,11 +1117,11 @@ virSecuritySELinuxTransactionStart(virSecurityManagerPtr mgr) * -1 otherwise. */ static int -virSecuritySELinuxTransactionCommit(virSecurityManagerPtr mgr G_GNUC_UNUSED, +virSecuritySELinuxTransactionCommit(virSecurityManager *mgr G_GNUC_UNUSED, pid_t pid, bool lock) { - virSecuritySELinuxContextListPtr list; + virSecuritySELinuxContextList *list; int rc; int ret = -1; @@ -1181,9 +1175,9 @@ virSecuritySELinuxTransactionCommit(virSecurityManagerPtr mgr G_GNUC_UNUSED, * Cancels and frees any out standing transaction. */ static void -virSecuritySELinuxTransactionAbort(virSecurityManagerPtr mgr G_GNUC_UNUSED) +virSecuritySELinuxTransactionAbort(virSecurityManager *mgr G_GNUC_UNUSED) { - virSecuritySELinuxContextListPtr list; + virSecuritySELinuxContextList *list; list = virThreadLocalGet(&contextList); if (!list) @@ -1195,8 +1189,8 @@ virSecuritySELinuxTransactionAbort(virSecurityManagerPtr mgr G_GNUC_UNUSED) } static int -virSecuritySELinuxGetProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def G_GNUC_UNUSED, +virSecuritySELinuxGetProcessLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def G_GNUC_UNUSED, pid_t pid, virSecurityLabelPtr sec) { @@ -1306,7 +1300,7 @@ virSecuritySELinuxSetFileconImpl(const char *path, static int -virSecuritySELinuxSetFilecon(virSecurityManagerPtr mgr, +virSecuritySELinuxSetFilecon(virSecurityManager *mgr, const char *path, const char *tcon, bool remember) @@ -1421,10 +1415,10 @@ virSecuritySELinuxFSetFilecon(int fd, char *tcon) /* Set fcon to the appropriate label for path and mode, or return -1. */ static int -getContext(virSecurityManagerPtr mgr G_GNUC_UNUSED, +getContext(virSecurityManager *mgr G_GNUC_UNUSED, const char *newpath, mode_t mode, char **fcon) { - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); return selabel_lookup_raw(data->label_handle, fcon, newpath, mode); } @@ -1433,7 +1427,7 @@ getContext(virSecurityManagerPtr mgr G_GNUC_UNUSED, /* This method shouldn't raise errors, since they'll overwrite * errors that the caller(s) are already dealing with */ static int -virSecuritySELinuxRestoreFileLabel(virSecurityManagerPtr mgr, +virSecuritySELinuxRestoreFileLabel(virSecurityManager *mgr, const char *path, bool recall) { @@ -1507,11 +1501,11 @@ virSecuritySELinuxRestoreFileLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxSetInputLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainInputDefPtr input) +virSecuritySELinuxSetInputLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainInputDef *input) { - virSecurityLabelDefPtr seclabel; + virSecurityLabelDef *seclabel; seclabel = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (seclabel == NULL) @@ -1536,12 +1530,12 @@ virSecuritySELinuxSetInputLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxRestoreInputLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainInputDefPtr input) +virSecuritySELinuxRestoreInputLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainInputDef *input) { int rc = 0; - virSecurityLabelDefPtr seclabel; + virSecurityLabelDef *seclabel; seclabel = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (seclabel == NULL) @@ -1564,11 +1558,11 @@ virSecuritySELinuxRestoreInputLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxSetMemoryLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainMemoryDefPtr mem) +virSecuritySELinuxSetMemoryLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainMemoryDef *mem) { - virSecurityLabelDefPtr seclabel; + virSecurityLabelDef *seclabel; switch (mem->model) { case VIR_DOMAIN_MEMORY_MODEL_NVDIMM: @@ -1593,12 +1587,12 @@ virSecuritySELinuxSetMemoryLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxRestoreMemoryLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainMemoryDefPtr mem) +virSecuritySELinuxRestoreMemoryLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainMemoryDef *mem) { int ret = -1; - virSecurityLabelDefPtr seclabel; + virSecurityLabelDef *seclabel; switch (mem->model) { case VIR_DOMAIN_MEMORY_MODEL_NVDIMM: @@ -1622,12 +1616,12 @@ virSecuritySELinuxRestoreMemoryLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxSetTPMFileLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainTPMDefPtr tpm) +virSecuritySELinuxSetTPMFileLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainTPMDef *tpm) { int rc; - virSecurityLabelDefPtr seclabel; + virSecurityLabelDef *seclabel; char *cancel_path; const char *tpmdev; @@ -1670,12 +1664,12 @@ virSecuritySELinuxSetTPMFileLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxRestoreTPMFileLabelInt(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainTPMDefPtr tpm) +virSecuritySELinuxRestoreTPMFileLabelInt(virSecurityManager *mgr, + virDomainDef *def, + virDomainTPMDef *tpm) { int rc = 0; - virSecurityLabelDefPtr seclabel; + virSecurityLabelDef *seclabel; char *cancel_path; const char *tpmdev; @@ -1705,13 +1699,13 @@ virSecuritySELinuxRestoreTPMFileLabelInt(virSecurityManagerPtr mgr, static int -virSecuritySELinuxRestoreImageLabelSingle(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, +virSecuritySELinuxRestoreImageLabelSingle(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, bool migrated) { - virSecurityLabelDefPtr seclabel; - virSecurityDeviceLabelDefPtr disk_seclabel; + virSecurityLabelDef *seclabel; + virSecurityDeviceLabelDef *disk_seclabel; g_autofree char *vfioGroupDev = NULL; const char *path = src->path; @@ -1782,9 +1776,9 @@ virSecuritySELinuxRestoreImageLabelSingle(virSecurityManagerPtr mgr, static int -virSecuritySELinuxRestoreImageLabelInt(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, +virSecuritySELinuxRestoreImageLabelInt(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, bool migrated) { if (virSecuritySELinuxRestoreImageLabelSingle(mgr, def, src, migrated) < 0) @@ -1795,9 +1789,9 @@ virSecuritySELinuxRestoreImageLabelInt(virSecurityManagerPtr mgr, static int -virSecuritySELinuxRestoreImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, +virSecuritySELinuxRestoreImageLabel(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, virSecurityDomainImageLabelFlags flags G_GNUC_UNUSED) { return virSecuritySELinuxRestoreImageLabelInt(mgr, def, src, false); @@ -1805,16 +1799,16 @@ virSecuritySELinuxRestoreImageLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxSetImageLabelInternal(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, - virStorageSourcePtr parent, +virSecuritySELinuxSetImageLabelInternal(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, + virStorageSource *parent, bool isChainTop) { - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr secdef; - virSecurityDeviceLabelDefPtr disk_seclabel; - virSecurityDeviceLabelDefPtr parent_seclabel = NULL; + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; + virSecurityDeviceLabelDef *disk_seclabel; + virSecurityDeviceLabelDef *parent_seclabel = NULL; char *use_label = NULL; bool remember; g_autofree char *vfioGroupDev = NULL; @@ -1905,13 +1899,13 @@ virSecuritySELinuxSetImageLabelInternal(virSecurityManagerPtr mgr, static int -virSecuritySELinuxSetImageLabelRelative(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, - virStorageSourcePtr parent, +virSecuritySELinuxSetImageLabelRelative(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, + virStorageSource *parent, virSecurityDomainImageLabelFlags flags) { - virStorageSourcePtr n; + virStorageSource *n; for (n = src; virStorageSourceIsBacking(n); n = n->backingStore) { const bool isChainTop = flags & VIR_SECURITY_DOMAIN_IMAGE_PARENT_CHAIN_TOP; @@ -1930,16 +1924,16 @@ virSecuritySELinuxSetImageLabelRelative(virSecurityManagerPtr mgr, static int -virSecuritySELinuxSetImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, +virSecuritySELinuxSetImageLabel(virSecurityManager *mgr, + virDomainDef *def, + virStorageSource *src, virSecurityDomainImageLabelFlags flags) { return virSecuritySELinuxSetImageLabelRelative(mgr, def, src, src, flags); } struct virSecuritySELinuxMoveImageMetadataData { - virSecurityManagerPtr mgr; + virSecurityManager *mgr; const char *src; const char *dst; }; @@ -1951,7 +1945,7 @@ virSecuritySELinuxMoveImageMetadataHelper(pid_t pid G_GNUC_UNUSED, { struct virSecuritySELinuxMoveImageMetadataData *data = opaque; const char *paths[2] = { data->src, data->dst }; - virSecurityManagerMetadataLockStatePtr state; + virSecurityManagerMetadataLockState *state; int ret; if (!(state = virSecurityManagerMetadataLock(data->mgr, paths, G_N_ELEMENTS(paths)))) @@ -1970,10 +1964,10 @@ virSecuritySELinuxMoveImageMetadataHelper(pid_t pid G_GNUC_UNUSED, static int -virSecuritySELinuxMoveImageMetadata(virSecurityManagerPtr mgr, +virSecuritySELinuxMoveImageMetadata(virSecurityManager *mgr, pid_t pid, - virStorageSourcePtr src, - virStorageSourcePtr dst) + virStorageSource *src, + virStorageSource *dst) { struct virSecuritySELinuxMoveImageMetadataData data = { .mgr = mgr, 0 }; int rc; @@ -2005,10 +1999,10 @@ virSecuritySELinuxSetHostdevLabelHelper(const char *file, bool remember, void *opaque) { - virSecurityLabelDefPtr secdef; - virSecuritySELinuxCallbackDataPtr data = opaque; - virSecurityManagerPtr mgr = data->mgr; - virDomainDefPtr def = data->def; + virSecurityLabelDef *secdef; + virSecuritySELinuxCallbackData *data = opaque; + virSecurityManager *mgr = data->mgr; + virDomainDef *def = data->def; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (secdef == NULL) @@ -2017,27 +2011,27 @@ virSecuritySELinuxSetHostdevLabelHelper(const char *file, } static int -virSecuritySELinuxSetPCILabel(virPCIDevicePtr dev G_GNUC_UNUSED, +virSecuritySELinuxSetPCILabel(virPCIDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { return virSecuritySELinuxSetHostdevLabelHelper(file, true, opaque); } static int -virSecuritySELinuxSetUSBLabel(virUSBDevicePtr dev G_GNUC_UNUSED, +virSecuritySELinuxSetUSBLabel(virUSBDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { return virSecuritySELinuxSetHostdevLabelHelper(file, true, opaque); } static int -virSecuritySELinuxSetSCSILabel(virSCSIDevicePtr dev, +virSecuritySELinuxSetSCSILabel(virSCSIDevice *dev, const char *file, void *opaque) { - virSecurityLabelDefPtr secdef; - virSecuritySELinuxCallbackDataPtr ptr = opaque; - virSecurityManagerPtr mgr = ptr->mgr; - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; + virSecuritySELinuxCallbackData *ptr = opaque; + virSecurityManager *mgr = ptr->mgr; + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); secdef = virDomainDefGetSecurityLabelDef(ptr->def, SECURITY_SELINUX_NAME); if (secdef == NULL) @@ -2055,7 +2049,7 @@ virSecuritySELinuxSetSCSILabel(virSCSIDevicePtr dev, } static int -virSecuritySELinuxSetHostLabel(virSCSIVHostDevicePtr dev G_GNUC_UNUSED, +virSecuritySELinuxSetHostLabel(virSCSIVHostDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { return virSecuritySELinuxSetHostdevLabelHelper(file, true, opaque); @@ -2063,17 +2057,17 @@ virSecuritySELinuxSetHostLabel(virSCSIVHostDevicePtr dev G_GNUC_UNUSED, static int -virSecuritySELinuxSetHostdevSubsysLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainHostdevDefPtr dev, +virSecuritySELinuxSetHostdevSubsysLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainHostdevDef *dev, const char *vroot) { - virDomainHostdevSubsysUSBPtr usbsrc = &dev->source.subsys.u.usb; - virDomainHostdevSubsysPCIPtr pcisrc = &dev->source.subsys.u.pci; - virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIVHostPtr hostsrc = &dev->source.subsys.u.scsi_host; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev; + virDomainHostdevSubsysUSB *usbsrc = &dev->source.subsys.u.usb; + virDomainHostdevSubsysPCI *pcisrc = &dev->source.subsys.u.pci; + virDomainHostdevSubsysSCSI *scsisrc = &dev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIVHost *hostsrc = &dev->source.subsys.u.scsi_host; + virDomainHostdevSubsysMediatedDev *mdevsrc = &dev->source.subsys.u.mdev; virSecuritySELinuxCallbackData data = {.mgr = mgr, .def = def}; int ret = -1; @@ -2129,7 +2123,7 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityManagerPtr mgr, } case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; g_autoptr(virSCSIDevice) scsi = virSCSIDeviceNew(NULL, @@ -2178,13 +2172,13 @@ virSecuritySELinuxSetHostdevSubsysLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxSetHostdevCapsLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainHostdevDefPtr dev, +virSecuritySELinuxSetHostdevCapsLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainHostdevDef *dev, const char *vroot) { int ret = -1; - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; char *path; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); @@ -2226,13 +2220,13 @@ virSecuritySELinuxSetHostdevCapsLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxSetHostdevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainHostdevDefPtr dev, +virSecuritySELinuxSetHostdevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainHostdevDef *dev, const char *vroot) { - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (!secdef || !secdef->relabel) @@ -2251,32 +2245,32 @@ virSecuritySELinuxSetHostdevLabel(virSecurityManagerPtr mgr, } static int -virSecuritySELinuxRestorePCILabel(virPCIDevicePtr dev G_GNUC_UNUSED, +virSecuritySELinuxRestorePCILabel(virPCIDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { - virSecurityManagerPtr mgr = opaque; + virSecurityManager *mgr = opaque; return virSecuritySELinuxRestoreFileLabel(mgr, file, true); } static int -virSecuritySELinuxRestoreUSBLabel(virUSBDevicePtr dev G_GNUC_UNUSED, +virSecuritySELinuxRestoreUSBLabel(virUSBDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { - virSecurityManagerPtr mgr = opaque; + virSecurityManager *mgr = opaque; return virSecuritySELinuxRestoreFileLabel(mgr, file, true); } static int -virSecuritySELinuxRestoreSCSILabel(virSCSIDevicePtr dev, +virSecuritySELinuxRestoreSCSILabel(virSCSIDevice *dev, const char *file, void *opaque) { - virSecurityManagerPtr mgr = opaque; + virSecurityManager *mgr = opaque; /* Don't restore labels on a shareable or readonly hostdev, because * other VMs may still be accessing. @@ -2288,27 +2282,27 @@ virSecuritySELinuxRestoreSCSILabel(virSCSIDevicePtr dev, } static int -virSecuritySELinuxRestoreHostLabel(virSCSIVHostDevicePtr dev G_GNUC_UNUSED, +virSecuritySELinuxRestoreHostLabel(virSCSIVHostDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { - virSecurityManagerPtr mgr = opaque; + virSecurityManager *mgr = opaque; return virSecuritySELinuxRestoreFileLabel(mgr, file, true); } static int -virSecuritySELinuxRestoreHostdevSubsysLabel(virSecurityManagerPtr mgr, - virDomainHostdevDefPtr dev, +virSecuritySELinuxRestoreHostdevSubsysLabel(virSecurityManager *mgr, + virDomainHostdevDef *dev, const char *vroot) { - virDomainHostdevSubsysUSBPtr usbsrc = &dev->source.subsys.u.usb; - virDomainHostdevSubsysPCIPtr pcisrc = &dev->source.subsys.u.pci; - virDomainHostdevSubsysSCSIPtr scsisrc = &dev->source.subsys.u.scsi; - virDomainHostdevSubsysSCSIVHostPtr hostsrc = &dev->source.subsys.u.scsi_host; - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev; + virDomainHostdevSubsysUSB *usbsrc = &dev->source.subsys.u.usb; + virDomainHostdevSubsysPCI *pcisrc = &dev->source.subsys.u.pci; + virDomainHostdevSubsysSCSI *scsisrc = &dev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSIVHost *hostsrc = &dev->source.subsys.u.scsi_host; + virDomainHostdevSubsysMediatedDev *mdevsrc = &dev->source.subsys.u.mdev; int ret = -1; /* Like virSecuritySELinuxRestoreImageLabelInt() for a networked @@ -2360,7 +2354,7 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecurityManagerPtr mgr, } case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI: { - virDomainHostdevSubsysSCSIHostPtr scsihostsrc = &scsisrc->u.host; + virDomainHostdevSubsysSCSIHost *scsihostsrc = &scsisrc->u.host; g_autoptr(virSCSIDevice) scsi = virSCSIDeviceNew(NULL, scsihostsrc->adapter, scsihostsrc->bus, @@ -2406,8 +2400,8 @@ virSecuritySELinuxRestoreHostdevSubsysLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxRestoreHostdevCapsLabel(virSecurityManagerPtr mgr, - virDomainHostdevDefPtr dev, +virSecuritySELinuxRestoreHostdevCapsLabel(virSecurityManager *mgr, + virDomainHostdevDef *dev, const char *vroot) { int ret = -1; @@ -2448,13 +2442,13 @@ virSecuritySELinuxRestoreHostdevCapsLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxRestoreHostdevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainHostdevDefPtr dev, +virSecuritySELinuxRestoreHostdevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainHostdevDef *dev, const char *vroot) { - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (!secdef || !secdef->relabel) @@ -2474,12 +2468,12 @@ virSecuritySELinuxRestoreHostdevLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxSetSavedStateLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +virSecuritySELinuxSetSavedStateLabel(virSecurityManager *mgr, + virDomainDef *def, const char *savefile) { - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr secdef; + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); @@ -2491,11 +2485,11 @@ virSecuritySELinuxSetSavedStateLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxRestoreSavedStateLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +virSecuritySELinuxRestoreSavedStateLabel(virSecurityManager *mgr, + virDomainDef *def, const char *savefile) { - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (!secdef || !secdef->relabel) @@ -2506,14 +2500,14 @@ virSecuritySELinuxRestoreSavedStateLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxSetChardevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +virSecuritySELinuxSetChardevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd) { - virSecurityLabelDefPtr seclabel; - virSecurityDeviceLabelDefPtr chr_seclabel = NULL; + virSecurityLabelDef *seclabel; + virSecurityDeviceLabelDef *chr_seclabel = NULL; char *imagelabel = NULL; char *in = NULL, *out = NULL; int ret = -1; @@ -2587,14 +2581,14 @@ virSecuritySELinuxSetChardevLabel(virSecurityManagerPtr mgr, } static int -virSecuritySELinuxRestoreChardevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +virSecuritySELinuxRestoreChardevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd) { - virSecurityLabelDefPtr seclabel; - virSecurityDeviceLabelDefPtr chr_seclabel = NULL; + virSecurityLabelDef *seclabel; + virSecurityDeviceLabelDef *chr_seclabel = NULL; char *in = NULL, *out = NULL; int ret = -1; @@ -2661,14 +2655,14 @@ virSecuritySELinuxRestoreChardevLabel(virSecurityManagerPtr mgr, struct _virSecuritySELinuxChardevCallbackData { - virSecurityManagerPtr mgr; + virSecurityManager *mgr; bool chardevStdioLogd; }; static int -virSecuritySELinuxRestoreSecurityChardevCallback(virDomainDefPtr def, - virDomainChrDefPtr dev G_GNUC_UNUSED, +virSecuritySELinuxRestoreSecurityChardevCallback(virDomainDef *def, + virDomainChrDef *dev G_GNUC_UNUSED, void *opaque) { struct _virSecuritySELinuxChardevCallbackData *data = opaque; @@ -2679,11 +2673,11 @@ virSecuritySELinuxRestoreSecurityChardevCallback(virDomainDefPtr def, static int -virSecuritySELinuxRestoreSecuritySmartcardCallback(virDomainDefPtr def, - virDomainSmartcardDefPtr dev, +virSecuritySELinuxRestoreSecuritySmartcardCallback(virDomainDef *def, + virDomainSmartcardDef *dev, void *opaque) { - virSecurityManagerPtr mgr = opaque; + virSecurityManager *mgr = opaque; const char *database; switch (dev->type) { @@ -2712,9 +2706,9 @@ virSecuritySELinuxRestoreSecuritySmartcardCallback(virDomainDefPtr def, static const char * -virSecuritySELinuxGetBaseLabel(virSecurityManagerPtr mgr, int virtType) +virSecuritySELinuxGetBaseLabel(virSecurityManager *mgr, int virtType) { - virSecuritySELinuxDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecuritySELinuxData *priv = virSecurityManagerGetPrivateData(mgr); if (virtType == VIR_DOMAIN_VIRT_QEMU && priv->alt_domain_context) return priv->alt_domain_context; else @@ -2723,13 +2717,13 @@ virSecuritySELinuxGetBaseLabel(virSecurityManagerPtr mgr, int virtType) static int -virSecuritySELinuxRestoreSysinfoLabel(virSecurityManagerPtr mgr, - virSysinfoDefPtr def) +virSecuritySELinuxRestoreSysinfoLabel(virSecurityManager *mgr, + virSysinfoDef *def) { size_t i; for (i = 0; i < def->nfw_cfgs; i++) { - virSysinfoFWCfgDefPtr f = &def->fw_cfgs[i]; + virSysinfoFWCfgDef *f = &def->fw_cfgs[i]; if (f->file && virSecuritySELinuxRestoreFileLabel(mgr, f->file, true) < 0) @@ -2741,13 +2735,13 @@ virSecuritySELinuxRestoreSysinfoLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxRestoreAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +virSecuritySELinuxRestoreAllLabel(virSecurityManager *mgr, + virDomainDef *def, bool migrated, bool chardevStdioLogd) { - virSecurityLabelDefPtr secdef; - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); size_t i; int rc = 0; @@ -2764,7 +2758,7 @@ virSecuritySELinuxRestoreAllLabel(virSecurityManagerPtr mgr, return 0; for (i = 0; i < def->ndisks; i++) { - virDomainDiskDefPtr disk = def->disks[i]; + virDomainDiskDef *disk = def->disks[i]; if (virSecuritySELinuxRestoreImageLabelInt(mgr, def, disk->src, migrated) < 0) @@ -2835,10 +2829,10 @@ virSecuritySELinuxRestoreAllLabel(virSecurityManagerPtr mgr, } static int -virSecuritySELinuxReleaseLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def) +virSecuritySELinuxReleaseLabel(virSecurityManager *mgr, + virDomainDef *def) { - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (secdef == NULL) @@ -2863,10 +2857,10 @@ virSecuritySELinuxReleaseLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxVerify(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def) +virSecuritySELinuxVerify(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def) { - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (secdef == NULL) @@ -2892,11 +2886,11 @@ virSecuritySELinuxVerify(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -virSecuritySELinuxSetProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def) +virSecuritySELinuxSetProcessLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def) { /* TODO: verify DOI */ - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (!secdef || !secdef->label) @@ -2925,12 +2919,12 @@ virSecuritySELinuxSetProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -virSecuritySELinuxSetChildProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def, - virCommandPtr cmd) +virSecuritySELinuxSetChildProcessLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def, + virCommand *cmd) { /* TODO: verify DOI */ - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (!secdef || !secdef->label) @@ -2953,11 +2947,11 @@ virSecuritySELinuxSetChildProcessLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -virSecuritySELinuxSetDaemonSocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def) +virSecuritySELinuxSetDaemonSocketLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def) { /* TODO: verify DOI */ - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; char *scon = NULL; char *str = NULL; int rc = -1; @@ -3003,10 +2997,10 @@ virSecuritySELinuxSetDaemonSocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -virSecuritySELinuxSetSocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm) +virSecuritySELinuxSetSocketLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm) { - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; int rc = -1; secdef = virDomainDefGetSecurityLabelDef(vm, SECURITY_SELINUX_NAME); @@ -3041,11 +3035,11 @@ virSecuritySELinuxSetSocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -virSecuritySELinuxClearSocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def) +virSecuritySELinuxClearSocketLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def) { /* TODO: verify DOI */ - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (!secdef || !secdef->label) @@ -3073,8 +3067,8 @@ virSecuritySELinuxClearSocketLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, static int -virSecuritySELinuxSetSecurityChardevCallback(virDomainDefPtr def, - virDomainChrDefPtr dev G_GNUC_UNUSED, +virSecuritySELinuxSetSecurityChardevCallback(virDomainDef *def, + virDomainChrDef *dev G_GNUC_UNUSED, void *opaque) { struct _virSecuritySELinuxChardevCallbackData *data = opaque; @@ -3085,13 +3079,13 @@ virSecuritySELinuxSetSecurityChardevCallback(virDomainDefPtr def, static int -virSecuritySELinuxSetSecuritySmartcardCallback(virDomainDefPtr def, - virDomainSmartcardDefPtr dev, +virSecuritySELinuxSetSecuritySmartcardCallback(virDomainDef *def, + virDomainSmartcardDef *dev, void *opaque) { const char *database; - virSecurityManagerPtr mgr = opaque; - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); + virSecurityManager *mgr = opaque; + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); switch (dev->type) { case VIR_DOMAIN_SMARTCARD_TYPE_HOST: @@ -3119,14 +3113,14 @@ virSecuritySELinuxSetSecuritySmartcardCallback(virDomainDefPtr def, static int -virSecuritySELinuxSetSysinfoLabel(virSecurityManagerPtr mgr, - virSysinfoDefPtr def, - virSecuritySELinuxDataPtr data) +virSecuritySELinuxSetSysinfoLabel(virSecurityManager *mgr, + virSysinfoDef *def, + virSecuritySELinuxData *data) { size_t i; for (i = 0; i < def->nfw_cfgs; i++) { - virSysinfoFWCfgDefPtr f = &def->fw_cfgs[i]; + virSysinfoFWCfgDef *f = &def->fw_cfgs[i]; if (f->file && virSecuritySELinuxSetFilecon(mgr, f->file, @@ -3139,15 +3133,15 @@ virSecuritySELinuxSetSysinfoLabel(virSecurityManagerPtr mgr, static int -virSecuritySELinuxSetAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +virSecuritySELinuxSetAllLabel(virSecurityManager *mgr, + virDomainDef *def, const char *incomingPath G_GNUC_UNUSED, bool chardevStdioLogd, bool migrated G_GNUC_UNUSED) { size_t i; - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr secdef; + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; struct _virSecuritySELinuxChardevCallbackData chardevData = { .mgr = mgr, @@ -3248,11 +3242,11 @@ virSecuritySELinuxSetAllLabel(virSecurityManagerPtr mgr, } static int -virSecuritySELinuxSetImageFDLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr def, +virSecuritySELinuxSetImageFDLabel(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *def, int fd) { - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (!secdef || !secdef->imagelabel) @@ -3262,13 +3256,13 @@ virSecuritySELinuxSetImageFDLabel(virSecurityManagerPtr mgr G_GNUC_UNUSED, } static int -virSecuritySELinuxSetTapFDLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +virSecuritySELinuxSetTapFDLabel(virSecurityManager *mgr, + virDomainDef *def, int fd) { struct stat buf; char *fcon = NULL; - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; char *str = NULL, *proc = NULL, *fd_path = NULL; int rc = -1; @@ -3324,11 +3318,11 @@ virSecuritySELinuxSetTapFDLabel(virSecurityManagerPtr mgr, } static char * -virSecuritySELinuxGenImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def) +virSecuritySELinuxGenImageLabel(virSecurityManager *mgr, + virDomainDef *def) { - virSecurityLabelDefPtr secdef; - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); const char *range; context_t ctx = NULL; char *label = NULL; @@ -3361,11 +3355,11 @@ virSecuritySELinuxGenImageLabel(virSecurityManagerPtr mgr, } static char * -virSecuritySELinuxGetSecurityMountOptions(virSecurityManagerPtr mgr, - virDomainDefPtr def) +virSecuritySELinuxGetSecurityMountOptions(virSecurityManager *mgr, + virDomainDef *def) { char *opts = NULL; - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; if ((secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME))) { if (!secdef->imagelabel) @@ -3387,12 +3381,12 @@ virSecuritySELinuxGetSecurityMountOptions(virSecurityManagerPtr mgr, } static int -virSecuritySELinuxDomainSetPathLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +virSecuritySELinuxDomainSetPathLabel(virSecurityManager *mgr, + virDomainDef *def, const char *path, bool allowSubtree G_GNUC_UNUSED) { - virSecurityLabelDefPtr seclabel; + virSecurityLabelDef *seclabel; seclabel = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (!seclabel || !seclabel->relabel) @@ -3402,12 +3396,12 @@ virSecuritySELinuxDomainSetPathLabel(virSecurityManagerPtr mgr, } static int -virSecuritySELinuxDomainSetPathLabelRO(virSecurityManagerPtr mgr, - virDomainDefPtr def, +virSecuritySELinuxDomainSetPathLabelRO(virSecurityManager *mgr, + virDomainDef *def, const char *path) { - virSecuritySELinuxDataPtr data = virSecurityManagerGetPrivateData(mgr); - virSecurityLabelDefPtr secdef; + virSecuritySELinuxData *data = virSecurityManagerGetPrivateData(mgr); + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); @@ -3418,11 +3412,11 @@ virSecuritySELinuxDomainSetPathLabelRO(virSecurityManagerPtr mgr, } static int -virSecuritySELinuxDomainRestorePathLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, +virSecuritySELinuxDomainRestorePathLabel(virSecurityManager *mgr, + virDomainDef *def, const char *path) { - virSecurityLabelDefPtr secdef; + virSecurityLabelDef *secdef; secdef = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (!secdef || !secdef->relabel) @@ -3444,9 +3438,9 @@ virSecuritySELinuxDomainRestorePathLabel(virSecurityManagerPtr mgr, * otherwise we just label the file. */ static int -virSecuritySELinuxSetFileLabels(virSecurityManagerPtr mgr, +virSecuritySELinuxSetFileLabels(virSecurityManager *mgr, const char *path, - virSecurityLabelDefPtr seclabel) + virSecurityLabelDef *seclabel) { int ret = 0; struct dirent *ent; @@ -3489,7 +3483,7 @@ virSecuritySELinuxSetFileLabels(virSecurityManagerPtr mgr, * directory itself, otherwise we just restore the label on the file. */ static int -virSecuritySELinuxRestoreFileLabels(virSecurityManagerPtr mgr, +virSecuritySELinuxRestoreFileLabels(virSecurityManager *mgr, const char *path) { int ret = 0; @@ -3522,12 +3516,12 @@ virSecuritySELinuxRestoreFileLabels(virSecurityManagerPtr mgr, static int -virSecuritySELinuxSetTPMLabels(virSecurityManagerPtr mgr, - virDomainDefPtr def) +virSecuritySELinuxSetTPMLabels(virSecurityManager *mgr, + virDomainDef *def) { int ret = 0; size_t i; - virSecurityLabelDefPtr seclabel; + virSecurityLabelDef *seclabel; seclabel = virDomainDefGetSecurityLabelDef(def, SECURITY_SELINUX_NAME); if (seclabel == NULL) @@ -3551,8 +3545,8 @@ virSecuritySELinuxSetTPMLabels(virSecurityManagerPtr mgr, static int -virSecuritySELinuxRestoreTPMLabels(virSecurityManagerPtr mgr, - virDomainDefPtr def) +virSecuritySELinuxRestoreTPMLabels(virSecurityManager *mgr, + virDomainDef *def) { int ret = 0; size_t i; diff --git a/src/security/security_stack.c b/src/security/security_stack.c index 2fd7d2e825..f7a9ed1e33 100644 --- a/src/security/security_stack.c +++ b/src/security/security_stack.c @@ -30,27 +30,25 @@ VIR_LOG_INIT("security.security_stack"); typedef struct _virSecurityStackData virSecurityStackData; -typedef virSecurityStackData *virSecurityStackDataPtr; typedef struct _virSecurityStackItem virSecurityStackItem; -typedef virSecurityStackItem *virSecurityStackItemPtr; struct _virSecurityStackItem { - virSecurityManagerPtr securityManager; - virSecurityStackItemPtr next; - virSecurityStackItemPtr prev; + virSecurityManager *securityManager; + virSecurityStackItem *next; + virSecurityStackItem *prev; }; struct _virSecurityStackData { - virSecurityStackItemPtr itemsHead; + virSecurityStackItem *itemsHead; }; int -virSecurityStackAddNested(virSecurityManagerPtr mgr, - virSecurityManagerPtr nested) +virSecurityStackAddNested(virSecurityManager *mgr, + virSecurityManager *nested) { - virSecurityStackItemPtr item = NULL; - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr tmp; + virSecurityStackItem *item = NULL; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *tmp; tmp = priv->itemsHead; while (tmp && tmp->next) @@ -67,10 +65,10 @@ virSecurityStackAddNested(virSecurityManagerPtr mgr, return 0; } -virSecurityManagerPtr -virSecurityStackGetPrimary(virSecurityManagerPtr mgr) +virSecurityManager * +virSecurityStackGetPrimary(virSecurityManager *mgr) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); return priv->itemsHead->securityManager; } @@ -81,17 +79,17 @@ virSecurityStackProbe(const char *virtDriver G_GNUC_UNUSED) } static int -virSecurityStackOpen(virSecurityManagerPtr mgr G_GNUC_UNUSED) +virSecurityStackOpen(virSecurityManager *mgr G_GNUC_UNUSED) { return 0; } static int -virSecurityStackClose(virSecurityManagerPtr mgr) +virSecurityStackClose(virSecurityManager *mgr) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; - virSecurityStackItemPtr next; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; + virSecurityStackItem *next; while (item) { next = item->next; @@ -104,22 +102,22 @@ virSecurityStackClose(virSecurityManagerPtr mgr) } static const char * -virSecurityStackGetModel(virSecurityManagerPtr mgr) +virSecurityStackGetModel(virSecurityManager *mgr) { return virSecurityManagerGetModel(virSecurityStackGetPrimary(mgr)); } static const char * -virSecurityStackGetDOI(virSecurityManagerPtr mgr) +virSecurityStackGetDOI(virSecurityManager *mgr) { return virSecurityManagerGetDOI(virSecurityStackGetPrimary(mgr)); } static int -virSecurityStackPreFork(virSecurityManagerPtr mgr) +virSecurityStackPreFork(virSecurityManager *mgr) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; /* XXX For now, we rely on no driver having any state that requires @@ -143,10 +141,10 @@ virSecurityStackPreFork(virSecurityManagerPtr mgr) static int -virSecurityStackTransactionStart(virSecurityManagerPtr mgr) +virSecurityStackTransactionStart(virSecurityManager *mgr) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) { if (virSecurityManagerTransactionStart(item->securityManager) < 0) @@ -163,12 +161,12 @@ virSecurityStackTransactionStart(virSecurityManagerPtr mgr) static int -virSecurityStackTransactionCommit(virSecurityManagerPtr mgr, +virSecurityStackTransactionCommit(virSecurityManager *mgr, pid_t pid, bool lock) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) { if (virSecurityManagerTransactionCommit(item->securityManager, pid, lock) < 0) @@ -185,10 +183,10 @@ virSecurityStackTransactionCommit(virSecurityManagerPtr mgr, static void -virSecurityStackTransactionAbort(virSecurityManagerPtr mgr) +virSecurityStackTransactionAbort(virSecurityManager *mgr) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) virSecurityManagerTransactionAbort(item->securityManager); @@ -196,11 +194,11 @@ virSecurityStackTransactionAbort(virSecurityManagerPtr mgr) static int -virSecurityStackVerify(virSecurityManagerPtr mgr, - virDomainDefPtr def) +virSecurityStackVerify(virSecurityManager *mgr, + virDomainDef *def) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -215,8 +213,8 @@ virSecurityStackVerify(virSecurityManagerPtr mgr, static int -virSecurityStackGenLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityStackGenLabel(virSecurityManager *mgr, + virDomainDef *vm) { int rc = 0; @@ -240,8 +238,8 @@ virSecurityStackGenLabel(virSecurityManagerPtr mgr, static int -virSecurityStackReleaseLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityStackReleaseLabel(virSecurityManager *mgr, + virDomainDef *vm) { int rc = 0; @@ -260,8 +258,8 @@ virSecurityStackReleaseLabel(virSecurityManagerPtr mgr, static int -virSecurityStackReserveLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityStackReserveLabel(virSecurityManager *mgr, + virDomainDef *vm, pid_t pid) { int rc = 0; @@ -280,14 +278,14 @@ virSecurityStackReserveLabel(virSecurityManagerPtr mgr, static int -virSecurityStackSetHostdevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainHostdevDefPtr dev, +virSecurityStackSetHostdevLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainHostdevDef *dev, const char *vroot) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) { if (virSecurityManagerSetHostdevLabel(item->securityManager, @@ -317,13 +315,13 @@ virSecurityStackSetHostdevLabel(virSecurityManagerPtr mgr, static int -virSecurityStackRestoreHostdevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainHostdevDefPtr dev, +virSecurityStackRestoreHostdevLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainHostdevDef *dev, const char *vroot) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -339,14 +337,14 @@ virSecurityStackRestoreHostdevLabel(virSecurityManagerPtr mgr, static int -virSecurityStackSetAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityStackSetAllLabel(virSecurityManager *mgr, + virDomainDef *vm, const char *incomingPath, bool chardevStdioLogd, bool migrated) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) { if (virSecurityManagerSetAllLabel(item->securityManager, vm, @@ -375,13 +373,13 @@ virSecurityStackSetAllLabel(virSecurityManagerPtr mgr, static int -virSecurityStackRestoreAllLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityStackRestoreAllLabel(virSecurityManager *mgr, + virDomainDef *vm, bool migrated, bool chardevStdioLogd) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -395,12 +393,12 @@ virSecurityStackRestoreAllLabel(virSecurityManagerPtr mgr, static int -virSecurityStackSetSavedStateLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityStackSetSavedStateLabel(virSecurityManager *mgr, + virDomainDef *vm, const char *savefile) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) { if (virSecurityManagerSetSavedStateLabel(item->securityManager, vm, savefile) < 0) @@ -426,12 +424,12 @@ virSecurityStackSetSavedStateLabel(virSecurityManagerPtr mgr, static int -virSecurityStackRestoreSavedStateLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityStackRestoreSavedStateLabel(virSecurityManager *mgr, + virDomainDef *vm, const char *savefile) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -443,11 +441,11 @@ virSecurityStackRestoreSavedStateLabel(virSecurityManagerPtr mgr, } static int -virSecurityStackSetProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityStackSetProcessLabel(virSecurityManager *mgr, + virDomainDef *vm) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -459,12 +457,12 @@ virSecurityStackSetProcessLabel(virSecurityManagerPtr mgr, } static int -virSecurityStackSetChildProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virCommandPtr cmd) +virSecurityStackSetChildProcessLabel(virSecurityManager *mgr, + virDomainDef *vm, + virCommand *cmd) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -476,8 +474,8 @@ virSecurityStackSetChildProcessLabel(virSecurityManagerPtr mgr, } static int -virSecurityStackGetProcessLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityStackGetProcessLabel(virSecurityManager *mgr, + virDomainDef *vm, pid_t pid, virSecurityLabelPtr seclabel) { @@ -496,11 +494,11 @@ virSecurityStackGetProcessLabel(virSecurityManagerPtr mgr, static int -virSecurityStackSetDaemonSocketLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityStackSetDaemonSocketLabel(virSecurityManager *mgr, + virDomainDef *vm) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) { if (virSecurityManagerSetDaemonSocketLabel(item->securityManager, vm) < 0) @@ -524,11 +522,11 @@ virSecurityStackSetDaemonSocketLabel(virSecurityManagerPtr mgr, static int -virSecurityStackSetSocketLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityStackSetSocketLabel(virSecurityManager *mgr, + virDomainDef *vm) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) { if (virSecurityManagerSetSocketLabel(item->securityManager, vm) < 0) @@ -552,11 +550,11 @@ virSecurityStackSetSocketLabel(virSecurityManagerPtr mgr, static int -virSecurityStackClearSocketLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityStackClearSocketLabel(virSecurityManager *mgr, + virDomainDef *vm) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -568,12 +566,12 @@ virSecurityStackClearSocketLabel(virSecurityManagerPtr mgr, } static int -virSecurityStackSetImageFDLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityStackSetImageFDLabel(virSecurityManager *mgr, + virDomainDef *vm, int fd) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -585,12 +583,12 @@ virSecurityStackSetImageFDLabel(virSecurityManagerPtr mgr, } static int -virSecurityStackSetTapFDLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityStackSetTapFDLabel(virSecurityManager *mgr, + virDomainDef *vm, int fd) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -602,25 +600,25 @@ virSecurityStackSetTapFDLabel(virSecurityManagerPtr mgr, } static char * -virSecurityStackGetMountOptions(virSecurityManagerPtr mgr G_GNUC_UNUSED, - virDomainDefPtr vm G_GNUC_UNUSED) +virSecurityStackGetMountOptions(virSecurityManager *mgr G_GNUC_UNUSED, + virDomainDef *vm G_GNUC_UNUSED) { return NULL; } -virSecurityManagerPtr* -virSecurityStackGetNested(virSecurityManagerPtr mgr) +virSecurityManager ** +virSecurityStackGetNested(virSecurityManager *mgr) { - virSecurityManagerPtr *list = NULL; - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item; + virSecurityManager **list = NULL; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item; int len = 0; size_t i; for (item = priv->itemsHead; item; item = item->next) len++; - list = g_new0(virSecurityManagerPtr, len + 1); + list = g_new0(virSecurityManager *, len + 1); for (i = 0, item = priv->itemsHead; item; item = item->next, i++) list[i] = item->securityManager; @@ -630,20 +628,20 @@ virSecurityStackGetNested(virSecurityManagerPtr mgr) } static const char * -virSecurityStackGetBaseLabel(virSecurityManagerPtr mgr, int virtType) +virSecurityStackGetBaseLabel(virSecurityManager *mgr, int virtType) { return virSecurityManagerGetBaseLabel(virSecurityStackGetPrimary(mgr), virtType); } static int -virSecurityStackSetImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virStorageSourcePtr src, +virSecurityStackSetImageLabel(virSecurityManager *mgr, + virDomainDef *vm, + virStorageSource *src, virSecurityDomainImageLabelFlags flags) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) { if (virSecurityManagerSetImageLabel(item->securityManager, vm, src, @@ -671,13 +669,13 @@ virSecurityStackSetImageLabel(virSecurityManagerPtr mgr, } static int -virSecurityStackRestoreImageLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virStorageSourcePtr src, +virSecurityStackRestoreImageLabel(virSecurityManager *mgr, + virDomainDef *vm, + virStorageSource *src, virSecurityDomainImageLabelFlags flags) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -690,13 +688,13 @@ virSecurityStackRestoreImageLabel(virSecurityManagerPtr mgr, } static int -virSecurityStackMoveImageMetadata(virSecurityManagerPtr mgr, +virSecurityStackMoveImageMetadata(virSecurityManager *mgr, pid_t pid, - virStorageSourcePtr src, - virStorageSourcePtr dst) + virStorageSource *src, + virStorageSource *dst) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -709,12 +707,12 @@ virSecurityStackMoveImageMetadata(virSecurityManagerPtr mgr, } static int -virSecurityStackSetMemoryLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainMemoryDefPtr mem) +virSecurityStackSetMemoryLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainMemoryDef *mem) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) { if (virSecurityManagerSetMemoryLabel(item->securityManager, vm, mem) < 0) @@ -739,12 +737,12 @@ virSecurityStackSetMemoryLabel(virSecurityManagerPtr mgr, } static int -virSecurityStackRestoreMemoryLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainMemoryDefPtr mem) +virSecurityStackRestoreMemoryLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainMemoryDef *mem) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -757,12 +755,12 @@ virSecurityStackRestoreMemoryLabel(virSecurityManagerPtr mgr, } static int -virSecurityStackSetInputLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainInputDefPtr input) +virSecurityStackSetInputLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainInputDef *input) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) { if (virSecurityManagerSetInputLabel(item->securityManager, vm, input) < 0) @@ -787,12 +785,12 @@ virSecurityStackSetInputLabel(virSecurityManagerPtr mgr, } static int -virSecurityStackRestoreInputLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, - virDomainInputDefPtr input) +virSecurityStackRestoreInputLabel(virSecurityManager *mgr, + virDomainDef *vm, + virDomainInputDef *input) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -805,13 +803,13 @@ virSecurityStackRestoreInputLabel(virSecurityManagerPtr mgr, } static int -virSecurityStackDomainSetPathLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityStackDomainSetPathLabel(virSecurityManager *mgr, + virDomainDef *vm, const char *path, bool allowSubtree) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -825,12 +823,12 @@ virSecurityStackDomainSetPathLabel(virSecurityManagerPtr mgr, static int -virSecurityStackDomainSetPathLabelRO(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityStackDomainSetPathLabelRO(virSecurityManager *mgr, + virDomainDef *vm, const char *path) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -844,12 +842,12 @@ virSecurityStackDomainSetPathLabelRO(virSecurityManagerPtr mgr, static int -virSecurityStackDomainRestorePathLabel(virSecurityManagerPtr mgr, - virDomainDefPtr vm, +virSecurityStackDomainRestorePathLabel(virSecurityManager *mgr, + virDomainDef *vm, const char *path) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -863,13 +861,13 @@ virSecurityStackDomainRestorePathLabel(virSecurityManagerPtr mgr, static int -virSecurityStackDomainSetChardevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +virSecurityStackDomainSetChardevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) { if (virSecurityManagerSetChardevLabel(item->securityManager, @@ -897,13 +895,13 @@ virSecurityStackDomainSetChardevLabel(virSecurityManagerPtr mgr, } static int -virSecurityStackDomainRestoreChardevLabel(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virDomainChrSourceDefPtr dev_source, +virSecurityStackDomainRestoreChardevLabel(virSecurityManager *mgr, + virDomainDef *def, + virDomainChrSourceDef *dev_source, bool chardevStdioLogd) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { @@ -918,11 +916,11 @@ virSecurityStackDomainRestoreChardevLabel(virSecurityManagerPtr mgr, static int -virSecurityStackSetTPMLabels(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityStackSetTPMLabels(virSecurityManager *mgr, + virDomainDef *vm) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; for (; item; item = item->next) { if (virSecurityManagerSetTPMLabels(item->securityManager, @@ -948,11 +946,11 @@ virSecurityStackSetTPMLabels(virSecurityManagerPtr mgr, static int -virSecurityStackRestoreTPMLabels(virSecurityManagerPtr mgr, - virDomainDefPtr vm) +virSecurityStackRestoreTPMLabels(virSecurityManager *mgr, + virDomainDef *vm) { - virSecurityStackDataPtr priv = virSecurityManagerGetPrivateData(mgr); - virSecurityStackItemPtr item = priv->itemsHead; + virSecurityStackData *priv = virSecurityManagerGetPrivateData(mgr); + virSecurityStackItem *item = priv->itemsHead; int rc = 0; for (; item; item = item->next) { diff --git a/src/security/security_stack.h b/src/security/security_stack.h index e35f149bed..6f18ea13d6 100644 --- a/src/security/security_stack.h +++ b/src/security/security_stack.h @@ -26,10 +26,10 @@ extern virSecurityDriver virSecurityDriverStack; int -virSecurityStackAddNested(virSecurityManagerPtr mgr, - virSecurityManagerPtr nested); -virSecurityManagerPtr -virSecurityStackGetPrimary(virSecurityManagerPtr mgr); +virSecurityStackAddNested(virSecurityManager *mgr, + virSecurityManager *nested); +virSecurityManager * +virSecurityStackGetPrimary(virSecurityManager *mgr); -virSecurityManagerPtr* -virSecurityStackGetNested(virSecurityManagerPtr mgr); +virSecurityManager ** +virSecurityStackGetNested(virSecurityManager *mgr); diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index 7e29e43c2e..68ac817f47 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -63,9 +63,9 @@ typedef struct { * 'r' replace * 'R' remove */ char *files; /* list of files */ - virDomainDefPtr def; /* VM definition */ - virCapsPtr caps; /* VM capabilities */ - virDomainXMLOptionPtr xmlopt; /* XML parser data */ + virDomainDef *def; /* VM definition */ + virCaps *caps; /* VM capabilities */ + virDomainXMLOption *xmlopt; /* XML parser data */ char *virtType; /* type of hypervisor (eg qemu, xen, lxc) */ char *os; /* type of os (eg hvm, xen, exe) */ virArch arch; /* machine architecture */ @@ -562,7 +562,7 @@ verify_xpath_context(xmlXPathContextPtr ctxt) * ctl->os * ctl->arch * - * These are suitable for setting up a virCapsPtr + * These are suitable for setting up a virCaps * */ static int caps_mockup(vahControl * ctl, const char *xmlStr) @@ -624,7 +624,7 @@ static int get_definition(vahControl * ctl, const char *xmlStr) { int ostype, virtType; - virCapsGuestPtr guest; /* this is freed when caps is freed */ + virCapsGuest *guest; /* this is freed when caps is freed */ /* * mock up some capabilities. We don't currently use these explicitly, @@ -703,7 +703,7 @@ get_definition(vahControl * ctl, const char *xmlStr) * read with no explicit deny rule. */ static int -vah_add_path(virBufferPtr buf, const char *path, const char *perms, bool recursive) +vah_add_path(virBuffer *buf, const char *path, const char *perms, bool recursive) { char *tmp = NULL; int rc = -1; @@ -802,13 +802,13 @@ vah_add_path(virBufferPtr buf, const char *path, const char *perms, bool recursi } static int -vah_add_file(virBufferPtr buf, const char *path, const char *perms) +vah_add_file(virBuffer *buf, const char *path, const char *perms) { return vah_add_path(buf, path, perms, false); } static int -vah_add_file_chardev(virBufferPtr buf, +vah_add_file_chardev(virBuffer *buf, const char *path, const char *perms, const int type) @@ -846,25 +846,25 @@ vah_add_file_chardev(virBufferPtr buf, } static int -file_iterate_hostdev_cb(virUSBDevicePtr dev G_GNUC_UNUSED, +file_iterate_hostdev_cb(virUSBDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { - virBufferPtr buf = opaque; + virBuffer *buf = opaque; return vah_add_file(buf, file, "rw"); } static int -file_iterate_pci_cb(virPCIDevicePtr dev G_GNUC_UNUSED, +file_iterate_pci_cb(virPCIDevice *dev G_GNUC_UNUSED, const char *file, void *opaque) { - virBufferPtr buf = opaque; + virBuffer *buf = opaque; return vah_add_file(buf, file, "rw"); } static int -add_file_path(virStorageSourcePtr src, +add_file_path(virStorageSource *src, size_t depth, - virBufferPtr buf) + virBuffer *buf) { int ret; @@ -889,11 +889,11 @@ add_file_path(virStorageSourcePtr src, static int -storage_source_add_files(virStorageSourcePtr src, - virBufferPtr buf, +storage_source_add_files(virStorageSource *src, + virBuffer *buf, size_t depth) { - virStorageSourcePtr tmp; + virStorageSource *tmp; for (tmp = src; virStorageSourceIsBacking(tmp); tmp = tmp->backingStore) { if (add_file_path(tmp, depth, buf) < 0) @@ -931,7 +931,7 @@ get_files(vahControl * ctl) #endif for (i = 0; i < ctl->def->ndisks; i++) { - virDomainDiskDefPtr disk = ctl->def->disks[i]; + virDomainDiskDef *disk = ctl->def->disks[i]; if (virStorageSourceIsEmpty(disk->src)) continue; @@ -1033,7 +1033,7 @@ get_files(vahControl * ctl) goto cleanup; for (i = 0; i < ctl->def->ngraphics; i++) { - virDomainGraphicsDefPtr graphics = ctl->def->graphics[i]; + virDomainGraphicsDef *graphics = ctl->def->graphics[i]; size_t n; const char *rendernode = virDomainGraphicsGetRenderNode(graphics); @@ -1070,11 +1070,11 @@ get_files(vahControl * ctl) for (i = 0; i < ctl->def->nhostdevs; i++) if (ctl->def->hostdevs[i]) { - virDomainHostdevDefPtr dev = ctl->def->hostdevs[i]; - virDomainHostdevSubsysUSBPtr usbsrc = &dev->source.subsys.u.usb; + virDomainHostdevDef *dev = ctl->def->hostdevs[i]; + virDomainHostdevSubsysUSB *usbsrc = &dev->source.subsys.u.usb; switch (dev->source.subsys.type) { case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB: { - virUSBDevicePtr usb = + virUSBDevice *usb = virUSBDeviceNew(usbsrc->bus, usbsrc->device, NULL); if (usb == NULL) @@ -1091,7 +1091,7 @@ get_files(vahControl * ctl) } case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_MDEV: { - virDomainHostdevSubsysMediatedDevPtr mdevsrc = &dev->source.subsys.u.mdev; + virDomainHostdevSubsysMediatedDev *mdevsrc = &dev->source.subsys.u.mdev; switch ((virMediatedDeviceModelType) mdevsrc->model) { case VIR_MDEV_MODEL_TYPE_VFIO_PCI: case VIR_MDEV_MODEL_TYPE_VFIO_AP: @@ -1108,7 +1108,7 @@ get_files(vahControl * ctl) } case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: { - virPCIDevicePtr pci = virPCIDeviceNew(&dev->source.subsys.u.pci.addr); + virPCIDevice *pci = virPCIDeviceNew(&dev->source.subsys.u.pci.addr); virDomainHostdevSubsysPCIBackendType backend = dev->source.subsys.u.pci.backend; if (backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO || @@ -1137,7 +1137,7 @@ get_files(vahControl * ctl) (ctl->def->fss[i]->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_PATH || ctl->def->fss[i]->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_DEFAULT) && ctl->def->fss[i]->src) { - virDomainFSDefPtr fs = ctl->def->fss[i]; + virDomainFSDef *fs = ctl->def->fss[i]; /* We don't need to add deny rw rules for readonly mounts, * this can only lead to troubles when mounting / readonly. @@ -1159,7 +1159,7 @@ get_files(vahControl * ctl) if (ctl->def->nets[i] && ctl->def->nets[i]->type == VIR_DOMAIN_NET_TYPE_VHOSTUSER && ctl->def->nets[i]->data.vhostuser) { - virDomainChrSourceDefPtr vhu = ctl->def->nets[i]->data.vhostuser; + virDomainChrSourceDef *vhu = ctl->def->nets[i]->data.vhostuser; if (vah_add_file_chardev(&buf, vhu->data.nix.path, "rw", vhu->type) != 0) @@ -1179,7 +1179,7 @@ get_files(vahControl * ctl) size_t j; for (j = 0; j < ctl->def->sysinfo[i]->nfw_cfgs; j++) { - virSysinfoFWCfgDefPtr f = &ctl->def->sysinfo[i]->fw_cfgs[j]; + virSysinfoFWCfgDef *f = &ctl->def->sysinfo[i]->fw_cfgs[j]; if (f->file && vah_add_file(&buf, f->file, "r") != 0) @@ -1262,7 +1262,7 @@ get_files(vahControl * ctl) } for (i = 0; i < ctl->def->nsmartcards; i++) { - virDomainSmartcardDefPtr sc = ctl->def->smartcards[i]; + virDomainSmartcardDef *sc = ctl->def->smartcards[i]; virDomainSmartcardType sc_type = sc->type; char *sc_db = (char *)VIR_DOMAIN_SMARTCARD_DEFAULT_DATABASE; if (sc->data.cert.database) @@ -1296,7 +1296,7 @@ get_files(vahControl * ctl) if (ctl->def->virtType == VIR_DOMAIN_VIRT_KVM) { for (i = 0; i < ctl->def->nnets; i++) { - virDomainNetDefPtr net = ctl->def->nets[i]; + virDomainNetDef *net = ctl->def->nets[i]; if (net && virDomainNetGetModelString(net)) { if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_QEMU) continue; diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index 83a4b8602a..c5b36801ba 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -77,7 +77,7 @@ VIR_LOG_INIT("storage.storage_backend"); #define VIR_STORAGE_BACKENDS_MAX 20 -static virStorageBackendPtr virStorageBackends[VIR_STORAGE_BACKENDS_MAX]; +static virStorageBackend *virStorageBackends[VIR_STORAGE_BACKENDS_MAX]; static size_t virStorageBackendsCount; #define STORAGE_BACKEND_MODULE_DIR LIBDIR "/libvirt/storage-backend" @@ -151,7 +151,7 @@ virStorageBackendDriversRegister(bool allbackends G_GNUC_UNUSED) int -virStorageBackendRegister(virStorageBackendPtr backend) +virStorageBackendRegister(virStorageBackend *backend) { VIR_DEBUG("Registering storage backend '%s'", virStoragePoolTypeToString(backend->type)); @@ -169,7 +169,7 @@ virStorageBackendRegister(virStorageBackendPtr backend) } -virStorageBackendPtr +virStorageBackend * virStorageBackendForType(int type) { size_t i; @@ -184,10 +184,10 @@ virStorageBackendForType(int type) } -virCapsPtr +virCaps * virStorageBackendGetCapabilities(void) { - virCapsPtr caps; + virCaps *caps; size_t i; if (!(caps = virCapabilitiesNew(VIR_ARCH_NONE, false, false))) diff --git a/src/storage/storage_backend.h b/src/storage/storage_backend.h index 86763a9e30..75b5220a7b 100644 --- a/src/storage/storage_backend.h +++ b/src/storage/storage_backend.h @@ -26,14 +26,14 @@ typedef char * (*virStorageBackendFindPoolSources)(const char *srcSpec, unsigned int flags); -typedef int (*virStorageBackendCheckPool)(virStoragePoolObjPtr pool, +typedef int (*virStorageBackendCheckPool)(virStoragePoolObj *pool, bool *active); -typedef int (*virStorageBackendStartPool)(virStoragePoolObjPtr pool); -typedef int (*virStorageBackendBuildPool)(virStoragePoolObjPtr pool, +typedef int (*virStorageBackendStartPool)(virStoragePoolObj *pool); +typedef int (*virStorageBackendBuildPool)(virStoragePoolObj *pool, unsigned int flags); -typedef int (*virStorageBackendRefreshPool)(virStoragePoolObjPtr pool); -typedef int (*virStorageBackendStopPool)(virStoragePoolObjPtr pool); -typedef int (*virStorageBackendDeletePool)(virStoragePoolObjPtr pool, +typedef int (*virStorageBackendRefreshPool)(virStoragePoolObj *pool); +typedef int (*virStorageBackendStopPool)(virStoragePoolObj *pool); +typedef int (*virStorageBackendDeletePool)(virStoragePoolObj *pool, unsigned int flags); /* A 'buildVol' backend must remove any volume created on error since @@ -45,30 +45,30 @@ typedef int (*virStorageBackendDeletePool)(virStoragePoolObjPtr pool, * was not aware of between checking the pool and the create attempt. It * also avoids extra round trips to just delete a file. */ -typedef int (*virStorageBackendBuildVol)(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +typedef int (*virStorageBackendBuildVol)(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int flags); -typedef int (*virStorageBackendCreateVol)(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol); -typedef int (*virStorageBackendRefreshVol)(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol); -typedef int (*virStorageBackendDeleteVol)(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +typedef int (*virStorageBackendCreateVol)(virStoragePoolObj *pool, + virStorageVolDef *vol); +typedef int (*virStorageBackendRefreshVol)(virStoragePoolObj *pool, + virStorageVolDef *vol); +typedef int (*virStorageBackendDeleteVol)(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int flags); -typedef int (*virStorageBackendBuildVolFrom)(virStoragePoolObjPtr pool, - virStorageVolDefPtr origvol, - virStorageVolDefPtr newvol, +typedef int (*virStorageBackendBuildVolFrom)(virStoragePoolObj *pool, + virStorageVolDef *origvol, + virStorageVolDef *newvol, unsigned int flags); -typedef int (*virStorageBackendVolumeResize)(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +typedef int (*virStorageBackendVolumeResize)(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned long long capacity, unsigned int flags); /* Upon entering this callback passed @obj is unlocked. However, * the pool's asyncjobs counter has been incremented and volume's * in_use has been adjusted to ensure singular usage. */ -typedef int (*virStorageBackendVolumeDownload)(virStoragePoolObjPtr obj, - virStorageVolDefPtr vol, +typedef int (*virStorageBackendVolumeDownload)(virStoragePoolObj *obj, + virStorageVolDef *vol, virStreamPtr stream, unsigned long long offset, unsigned long long length, @@ -77,8 +77,8 @@ typedef int (*virStorageBackendVolumeDownload)(virStoragePoolObjPtr obj, /* Upon entering this callback passed @obj is unlocked. However, * the pool's asyncjobs counter has been incremented and volume's * in_use has been adjusted to ensure singular usage. */ -typedef int (*virStorageBackendVolumeUpload)(virStoragePoolObjPtr obj, - virStorageVolDefPtr vol, +typedef int (*virStorageBackendVolumeUpload)(virStoragePoolObj *obj, + virStorageVolDef *vol, virStreamPtr stream, unsigned long long offset, unsigned long long len, @@ -87,13 +87,12 @@ typedef int (*virStorageBackendVolumeUpload)(virStoragePoolObjPtr obj, /* Upon entering this callback passed @obj is unlocked. However, * the pool's asyncjobs counter has been incremented and volume's * in_use has been adjusted to ensure singular usage. */ -typedef int (*virStorageBackendVolumeWipe)(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +typedef int (*virStorageBackendVolumeWipe)(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int algorithm, unsigned int flags); typedef struct _virStorageBackend virStorageBackend; -typedef virStorageBackend *virStorageBackendPtr; /* Callbacks are optional unless documented otherwise; but adding more * callbacks provides better pool support. */ @@ -119,11 +118,11 @@ struct _virStorageBackend { virStorageBackendVolumeWipe wipeVol; }; -virStorageBackendPtr virStorageBackendForType(int type); +virStorageBackend *virStorageBackendForType(int type); int virStorageBackendDriversRegister(bool allmodules); -int virStorageBackendRegister(virStorageBackendPtr backend); +int virStorageBackendRegister(virStorageBackend *backend); -virCapsPtr +virCaps * virStorageBackendGetCapabilities(void); diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c index 49747cb7c9..97554e2576 100644 --- a/src/storage/storage_backend_disk.c +++ b/src/storage/storage_backend_disk.c @@ -41,7 +41,7 @@ VIR_LOG_INIT("storage.storage_backend_disk"); #define SECTOR_SIZE 512 static bool -virStorageVolPartFindExtended(virStorageVolDefPtr def, +virStorageVolPartFindExtended(virStorageVolDef *def, const void *opaque G_GNUC_UNUSED) { if (def->source.partType == VIR_STORAGE_VOL_DISK_TYPE_EXTENDED) @@ -52,11 +52,11 @@ virStorageVolPartFindExtended(virStorageVolDefPtr def, static int -virStorageBackendDiskMakeDataVol(virStoragePoolObjPtr pool, +virStorageBackendDiskMakeDataVol(virStoragePoolObj *pool, char **const groups, - virStorageVolDefPtr vol) + virStorageVolDef *vol) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); char *tmp, *partname; bool addVol = false; g_autofree char *devpath = NULL; @@ -206,7 +206,7 @@ virStorageBackendDiskMakeDataVol(virStoragePoolObjPtr pool, /* Find the extended partition and increase the allocation value */ if (vol->source.partType == VIR_STORAGE_VOL_DISK_TYPE_LOGICAL) { - virStorageVolDefPtr voldef; + virStorageVolDef *voldef; voldef = virStoragePoolObjSearchVolume(pool, virStorageVolPartFindExtended, @@ -229,11 +229,11 @@ virStorageBackendDiskMakeDataVol(virStoragePoolObjPtr pool, } static int -virStorageBackendDiskMakeFreeExtent(virStoragePoolObjPtr pool, +virStorageBackendDiskMakeFreeExtent(virStoragePoolObj *pool, char **const groups) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); - virStoragePoolSourceDevicePtr dev = &def->source.devices[0]; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); + virStoragePoolSourceDevice *dev = &def->source.devices[0]; VIR_REALLOC_N(dev->freeExtents, dev->nfreeExtent + 1); @@ -273,8 +273,8 @@ virStorageBackendDiskMakeFreeExtent(virStoragePoolObjPtr pool, struct virStorageBackendDiskPoolVolData { - virStoragePoolObjPtr pool; - virStorageVolDefPtr vol; + virStoragePoolObj *pool; + virStorageVolDef *vol; }; static int @@ -283,7 +283,7 @@ virStorageBackendDiskMakeVol(size_t ntok G_GNUC_UNUSED, void *opaque) { struct virStorageBackendDiskPoolVolData *data = opaque; - virStoragePoolObjPtr pool = data->pool; + virStoragePoolObj *pool = data->pool; /* * Ignore normal+metadata, and logical+metadata partitions * since they're basically internal book-keeping regions @@ -299,7 +299,7 @@ virStorageBackendDiskMakeVol(size_t ntok G_GNUC_UNUSED, /* Remaining data / metadata parts get turn into volumes... */ if (STREQ(groups[2], "metadata") || STREQ(groups[2], "data")) { - virStorageVolDefPtr vol = data->vol; + virStorageVolDef *vol = data->vol; if (vol) { /* We're searching for a specific vol only */ @@ -335,8 +335,8 @@ virStorageBackendDiskMakeVol(size_t ntok G_GNUC_UNUSED, * and we can even ensure the output is friendly. */ static int -virStorageBackendDiskReadPartitions(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol) +virStorageBackendDiskReadPartitions(virStoragePoolObj *pool, + virStorageVolDef *vol) { /* * # libvirt_parthelper DEVICE @@ -346,7 +346,7 @@ virStorageBackendDiskReadPartitions(virStoragePoolObjPtr pool, * */ - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); struct virStorageBackendDiskPoolVolData cbdata = { .pool = pool, .vol = vol, @@ -387,9 +387,9 @@ virStorageBackendDiskMakePoolGeometry(size_t ntok G_GNUC_UNUSED, char **const groups, void *data) { - virStoragePoolObjPtr pool = data; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); - virStoragePoolSourceDevicePtr device = &(def->source.devices[0]); + virStoragePoolObj *pool = data; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); + virStoragePoolSourceDevice *device = &(def->source.devices[0]); if (virStrToLong_i(groups[0], NULL, 0, &device->geometry.cylinders) < 0 || virStrToLong_i(groups[1], NULL, 0, &device->geometry.heads) < 0 || virStrToLong_i(groups[2], NULL, 0, &device->geometry.sectors) < 0) { @@ -402,9 +402,9 @@ virStorageBackendDiskMakePoolGeometry(size_t ntok G_GNUC_UNUSED, } static int -virStorageBackendDiskReadGeometry(virStoragePoolObjPtr pool) +virStorageBackendDiskReadGeometry(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autofree char *parthelper_path = NULL; g_autoptr(virCommand) cmd = NULL; @@ -423,9 +423,9 @@ virStorageBackendDiskReadGeometry(virStoragePoolObjPtr pool) } static int -virStorageBackendDiskRefreshPool(virStoragePoolObjPtr pool) +virStorageBackendDiskRefreshPool(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); VIR_FREE(def->source.devices[0].freeExtents); def->source.devices[0].nfreeExtent = 0; @@ -447,9 +447,9 @@ virStorageBackendDiskRefreshPool(virStoragePoolObjPtr pool) static int -virStorageBackendDiskStartPool(virStoragePoolObjPtr pool) +virStorageBackendDiskStartPool(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); const char *format; const char *path = def->source.devices[0].path; @@ -478,10 +478,10 @@ virStorageBackendDiskStartPool(virStoragePoolObjPtr pool) * Write a new partition table header */ static int -virStorageBackendDiskBuildPool(virStoragePoolObjPtr pool, +virStorageBackendDiskBuildPool(virStoragePoolObj *pool, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); int format = def->source.format; const char *fmt; g_autoptr(virCommand) cmd = NULL; @@ -532,10 +532,10 @@ virStorageBackendDiskBuildPool(virStoragePoolObjPtr pool, * Wipe the existing partition table */ static int -virStorageBackendDiskDeletePool(virStoragePoolObjPtr pool, +virStorageBackendDiskDeletePool(virStoragePoolObj *pool, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); virCheckFlags(0, -1); @@ -552,7 +552,7 @@ struct virStorageVolNumData { }; static int -virStorageVolNumOfPartTypes(virStorageVolDefPtr def, +virStorageVolNumOfPartTypes(virStorageVolDef *def, const void *opaque) { struct virStorageVolNumData *data = (struct virStorageVolNumData *)opaque; @@ -570,9 +570,9 @@ virStorageVolNumOfPartTypes(virStorageVolDefPtr def, * Important when the partition table is of msdos type */ static int -virStorageBackendDiskPartTypeToCreate(virStoragePoolObjPtr pool) +virStorageBackendDiskPartTypeToCreate(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); struct virStorageVolNumData data = { .count = 0 }; if (def->source.format == VIR_STORAGE_POOL_DISK_DOS) { @@ -590,11 +590,11 @@ virStorageBackendDiskPartTypeToCreate(virStoragePoolObjPtr pool) } static int -virStorageBackendDiskPartFormat(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendDiskPartFormat(virStoragePoolObj *pool, + virStorageVolDef *vol, char** partFormat) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); if (def->source.format == VIR_STORAGE_POOL_DISK_DOS) { const char *partedFormat; @@ -655,7 +655,7 @@ virStorageBackendDiskPartFormat(virStoragePoolObjPtr pool, * partitions */ static int -virStorageBackendDiskPartBoundaries(virStoragePoolObjPtr pool, +virStorageBackendDiskPartBoundaries(virStoragePoolObj *pool, unsigned long long *start, unsigned long long *end, unsigned long long allocation) @@ -665,8 +665,8 @@ virStorageBackendDiskPartBoundaries(virStoragePoolObjPtr pool, unsigned long long smallestSize = 0; unsigned long long extraBytes = 0; unsigned long long alignedAllocation = allocation; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); - virStoragePoolSourceDevicePtr dev = &def->source.devices[0]; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); + virStoragePoolSourceDevice *dev = &def->source.devices[0]; unsigned long long cylinderSize = (unsigned long long)dev->geometry.heads * dev->geometry.sectors * SECTOR_SIZE; int partType = virStorageBackendDiskPartTypeToCreate(pool); @@ -769,13 +769,13 @@ virStorageBackendDiskPartBoundaries(virStoragePoolObjPtr pool, * Returns 0 on success, -1 on failure with error message set. */ static int -virStorageBackendDiskDeleteVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendDiskDeleteVol(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int flags) { char *part_num = NULL; g_autofree char *dev_name = NULL; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); char *src_path = def->source.devices[0].path; g_autofree char *srcname = g_path_get_basename(src_path); bool isDevMapperDevice; @@ -855,11 +855,11 @@ virStorageBackendDiskDeleteVol(virStoragePoolObjPtr pool, static int -virStorageBackendDiskCreateVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol) +virStorageBackendDiskCreateVol(virStoragePoolObj *pool, + virStorageVolDef *vol) { unsigned long long startOffset = 0, endOffset = 0; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); virErrorPtr save_err; g_autofree char *partFormat = NULL; g_autoptr(virCommand) cmd = NULL; @@ -932,9 +932,9 @@ virStorageBackendDiskCreateVol(virStoragePoolObjPtr pool, static int -virStorageBackendDiskBuildVolFrom(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +virStorageBackendDiskBuildVolFrom(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags) { virStorageBackendBuildVolFrom build_func; @@ -948,8 +948,8 @@ virStorageBackendDiskBuildVolFrom(virStoragePoolObjPtr pool, static int -virStorageBackendDiskVolWipe(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendDiskVolWipe(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int algorithm, unsigned int flags) { diff --git a/src/storage/storage_backend_fs.c b/src/storage/storage_backend_fs.c index 48924167eb..bb93d64bbe 100644 --- a/src/storage/storage_backend_fs.c +++ b/src/storage/storage_backend_fs.c @@ -193,9 +193,9 @@ virStorageBackendFileSystemNetFindPoolSources(const char *srcSpec, * Return 0 if everything's OK, -1 on error */ static int -virStorageBackendFileSystemIsValid(virStoragePoolObjPtr pool) +virStorageBackendFileSystemIsValid(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); if (def->type == VIR_STORAGE_POOL_NETFS) { if (def->source.nhost != 1) { @@ -237,10 +237,10 @@ virStorageBackendFileSystemIsValid(virStoragePoolObjPtr pool) * Return 0 if not mounted, 1 if mounted, -1 on error */ static int -virStorageBackendFileSystemIsMounted(virStoragePoolObjPtr pool) +virStorageBackendFileSystemIsMounted(virStoragePoolObj *pool) { int ret = -1; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); FILE *mtab; struct mntent ent; char buf[1024]; @@ -284,9 +284,9 @@ virStorageBackendFileSystemIsMounted(virStoragePoolObjPtr pool) * Returns 0 if successfully mounted, -1 on error */ static int -virStorageBackendFileSystemMount(virStoragePoolObjPtr pool) +virStorageBackendFileSystemMount(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); int rc; g_autofree char *src = NULL; g_autoptr(virCommand) cmd = NULL; @@ -327,9 +327,9 @@ virStorageBackendFileSystemMount(virStoragePoolObjPtr pool) * Returns 0 on success, -1 on error */ static int -virStorageBackendFileSystemStart(virStoragePoolObjPtr pool) +virStorageBackendFileSystemStart(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); if (def->type != VIR_STORAGE_POOL_DIR && virStorageBackendFileSystemMount(pool) < 0) @@ -351,9 +351,9 @@ virStorageBackendFileSystemStart(virStoragePoolObjPtr pool) * Returns 0 if successfully unmounted, -1 on error */ static int -virStorageBackendFileSystemStop(virStoragePoolObjPtr pool) +virStorageBackendFileSystemStop(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); int rc; g_autoptr(virCommand) cmd = NULL; @@ -371,10 +371,10 @@ virStorageBackendFileSystemStop(virStoragePoolObjPtr pool) static int -virStorageBackendFileSystemCheck(virStoragePoolObjPtr pool, +virStorageBackendFileSystemCheck(virStoragePoolObj *pool, bool *isActive) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); if (def->type == VIR_STORAGE_POOL_DIR) { *isActive = virFileExists(def->target.path); @@ -441,10 +441,10 @@ virStorageBackendExecuteMKFS(const char *device G_GNUC_UNUSED, #endif /* #ifdef MKFS */ static int -virStorageBackendMakeFileSystem(virStoragePoolObjPtr pool, +virStorageBackendMakeFileSystem(virStoragePoolObj *pool, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); const char *device = NULL, *format = NULL; bool ok_to_mkfs = false; int ret = -1; @@ -505,7 +505,7 @@ virStorageBackendMakeFileSystem(virStoragePoolObjPtr pool, * Returns 0 on success, -1 on error */ static int -virStorageBackendFileSystemBuild(virStoragePoolObjPtr pool, +virStorageBackendFileSystemBuild(virStoragePoolObj *pool, unsigned int flags) { virCheckFlags(VIR_STORAGE_POOL_BUILD_OVERWRITE | @@ -544,7 +544,7 @@ virStorageBackendFileSystemBuild(virStoragePoolObjPtr pool, static void virStoragePoolDefFSNamespaceFree(void *nsdata) { - virStoragePoolFSMountOptionsDefPtr cmdopts = nsdata; + virStoragePoolFSMountOptionsDef *cmdopts = nsdata; size_t i; if (!cmdopts) @@ -562,7 +562,7 @@ static int virStoragePoolDefFSNamespaceParse(xmlXPathContextPtr ctxt, void **data) { - virStoragePoolFSMountOptionsDefPtr cmdopts = NULL; + virStoragePoolFSMountOptionsDef *cmdopts = NULL; int nnodes; size_t i; int ret = -1; @@ -598,11 +598,11 @@ virStoragePoolDefFSNamespaceParse(xmlXPathContextPtr ctxt, static int -virStoragePoolDefFSNamespaceFormatXML(virBufferPtr buf, +virStoragePoolDefFSNamespaceFormatXML(virBuffer *buf, void *nsdata) { size_t i; - virStoragePoolFSMountOptionsDefPtr def = nsdata; + virStoragePoolFSMountOptionsDef *def = nsdata; if (!def) return 0; diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_backend_gluster.c index e673922df6..aacc23663e 100644 --- a/src/storage/storage_backend_gluster.c +++ b/src/storage/storage_backend_gluster.c @@ -50,10 +50,9 @@ struct _virStorageBackendGlusterState { }; typedef struct _virStorageBackendGlusterState virStorageBackendGlusterState; -typedef virStorageBackendGlusterState *virStorageBackendGlusterStatePtr; static void -virStorageBackendGlusterClose(virStorageBackendGlusterStatePtr state) +virStorageBackendGlusterClose(virStorageBackendGlusterState *state) { if (!state) return; @@ -71,11 +70,11 @@ virStorageBackendGlusterClose(virStorageBackendGlusterStatePtr state) VIR_FREE(state); } -static virStorageBackendGlusterStatePtr -virStorageBackendGlusterOpen(virStoragePoolObjPtr pool) +static virStorageBackendGlusterState * +virStorageBackendGlusterOpen(virStoragePoolObj *pool) { - virStorageBackendGlusterStatePtr ret = NULL; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStorageBackendGlusterState *ret = NULL; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); const char *name = def->source.name; const char *dir = def->source.dir; bool trailing_slash = true; @@ -175,8 +174,8 @@ virStorageBackendGlusterRead(glfs_fd_t *fd, static int -virStorageBackendGlusterSetMetadata(virStorageBackendGlusterStatePtr state, - virStorageVolDefPtr vol, +virStorageBackendGlusterSetMetadata(virStorageBackendGlusterState *state, + virStorageVolDef *vol, const char *name) { char *tmp; @@ -216,10 +215,10 @@ virStorageBackendGlusterSetMetadata(virStorageBackendGlusterStatePtr state, * it NULL if the entry should be skipped (such as "."). Return 0 on * success, -1 on failure. */ static int -virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state, +virStorageBackendGlusterRefreshVol(virStorageBackendGlusterState *state, const char *name, struct stat *st, - virStorageVolDefPtr *volptr) + virStorageVolDef **volptr) { int ret = -1; glfs_fd_t *fd = NULL; @@ -308,11 +307,11 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state, } static int -virStorageBackendGlusterRefreshPool(virStoragePoolObjPtr pool) +virStorageBackendGlusterRefreshPool(virStoragePoolObj *pool) { int ret = -1; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); - virStorageBackendGlusterStatePtr state = NULL; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); + virStorageBackendGlusterState *state = NULL; struct { struct dirent ent; /* See comment below about readdir_r needing padding */ @@ -348,7 +347,7 @@ virStorageBackendGlusterRefreshPool(virStoragePoolObjPtr pool) goto cleanup; } while (!(errno = glfs_readdirplus_r(dir, &st, &de.ent, &ent)) && ent) { - virStorageVolDefPtr vol; + virStorageVolDef *vol; int okay = virStorageBackendGlusterRefreshVol(state, ent->d_name, &st, &vol); @@ -386,11 +385,11 @@ virStorageBackendGlusterRefreshPool(virStoragePoolObjPtr pool) static int -virStorageBackendGlusterVolDelete(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendGlusterVolDelete(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int flags) { - virStorageBackendGlusterStatePtr state = NULL; + virStorageBackendGlusterState *state = NULL; int ret = -1; virCheckFlags(0, -1); @@ -502,7 +501,7 @@ virStorageBackendGlusterFindPoolSources(const char *srcSpec, static int -virStorageBackendGlusterCheckPool(virStoragePoolObjPtr pool, +virStorageBackendGlusterCheckPool(virStoragePoolObj *pool, bool *active) { /* Return previous state remembered by the status XML. If the pool is not diff --git a/src/storage/storage_backend_iscsi.c b/src/storage/storage_backend_iscsi.c index 9127d663b1..67e59e856c 100644 --- a/src/storage/storage_backend_iscsi.c +++ b/src/storage/storage_backend_iscsi.c @@ -50,7 +50,7 @@ VIR_LOG_INIT("storage.storage_backend_iscsi"); #define ISCSI_DEFAULT_TARGET_PORT 3260 static char * -virStorageBackendISCSIPortal(virStoragePoolSourcePtr source) +virStorageBackendISCSIPortal(virStoragePoolSource *source) { char *portal = NULL; @@ -78,10 +78,10 @@ virStorageBackendISCSIPortal(virStoragePoolSourcePtr source) static char * -virStorageBackendISCSISession(virStoragePoolObjPtr pool, +virStorageBackendISCSISession(virStoragePoolObj *pool, bool probe) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); return virISCSIGetSession(def->source.devices[0].path, probe); } @@ -127,7 +127,7 @@ virStorageBackendISCSIGetHostNumber(const char *sysfs_path, } static int -virStorageBackendISCSIFindLUs(virStoragePoolObjPtr pool, +virStorageBackendISCSIFindLUs(virStoragePoolObj *pool, const char *session) { uint32_t host; @@ -220,10 +220,10 @@ virStorageBackendISCSIFindPoolSources(const char *srcSpec, } static int -virStorageBackendISCSICheckPool(virStoragePoolObjPtr pool, +virStorageBackendISCSICheckPool(virStoragePoolObj *pool, bool *isActive) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autofree char *session = NULL; *isActive = false; @@ -255,12 +255,12 @@ virStorageBackendISCSICheckPool(virStoragePoolObjPtr pool, static int virStorageBackendISCSISetAuth(const char *portal, - virStoragePoolSourcePtr source) + virStoragePoolSource *source) { g_autofree unsigned char *secret_value = NULL; size_t secret_size; g_autofree char *secret_str = NULL; - virStorageAuthDefPtr authdef = source->auth; + virStorageAuthDef *authdef = source->auth; int ret = -1; virConnectPtr conn = NULL; @@ -312,9 +312,9 @@ virStorageBackendISCSISetAuth(const char *portal, } static int -virStorageBackendISCSIStartPool(virStoragePoolObjPtr pool) +virStorageBackendISCSIStartPool(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autofree char *portal = NULL; g_autofree char *session = NULL; @@ -358,9 +358,9 @@ virStorageBackendISCSIStartPool(virStoragePoolObjPtr pool) } static int -virStorageBackendISCSIRefreshPool(virStoragePoolObjPtr pool) +virStorageBackendISCSIRefreshPool(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autofree char *session = NULL; def->allocation = def->capacity = def->available = 0; @@ -377,9 +377,9 @@ virStorageBackendISCSIRefreshPool(virStoragePoolObjPtr pool) static int -virStorageBackendISCSIStopPool(virStoragePoolObjPtr pool) +virStorageBackendISCSIStopPool(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autofree char *portal = NULL; g_autofree char *session = NULL; diff --git a/src/storage/storage_backend_iscsi_direct.c b/src/storage/storage_backend_iscsi_direct.c index 3511f39214..cb5b39baf4 100644 --- a/src/storage/storage_backend_iscsi_direct.c +++ b/src/storage/storage_backend_iscsi_direct.c @@ -59,7 +59,7 @@ virISCSIDirectCreateContext(const char* initiator_iqn) } static char * -virStorageBackendISCSIDirectPortal(virStoragePoolSourcePtr source) +virStorageBackendISCSIDirectPortal(virStoragePoolSource *source) { char *portal = NULL; @@ -86,12 +86,12 @@ virStorageBackendISCSIDirectPortal(virStoragePoolSourcePtr source) static int virStorageBackendISCSIDirectSetAuth(struct iscsi_context *iscsi, - virStoragePoolSourcePtr source) + virStoragePoolSource *source) { g_autofree unsigned char *secret_value = NULL; size_t secret_size; g_autofree char *secret_str = NULL; - virStorageAuthDefPtr authdef = source->auth; + virStorageAuthDef *authdef = source->auth; int ret = -1; virConnectPtr conn = NULL; @@ -224,12 +224,12 @@ virISCSIDirectTestUnitReady(struct iscsi_context *iscsi, } static int -virISCSIDirectSetVolumeAttributes(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virISCSIDirectSetVolumeAttributes(virStoragePoolObj *pool, + virStorageVolDef *vol, int lun, char *portal) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); vol->name = g_strdup_printf("%s%u", VOL_NAME_PREFIX, lun); vol->key = g_strdup_printf("ip-%s-iscsi-%s-lun-%u", portal, @@ -297,12 +297,12 @@ virISCSIDirectGetVolumeCapacity(struct iscsi_context *iscsi, } static int -virISCSIDirectRefreshVol(virStoragePoolObjPtr pool, +virISCSIDirectRefreshVol(virStoragePoolObj *pool, struct iscsi_context *iscsi, int lun, char *portal) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); uint32_t block_size = 0; uint64_t nb_block = 0; g_autoptr(virStorageVolDef) vol = NULL; @@ -333,11 +333,11 @@ virISCSIDirectRefreshVol(virStoragePoolObjPtr pool, } static int -virISCSIDirectReportLuns(virStoragePoolObjPtr pool, +virISCSIDirectReportLuns(virStoragePoolObj *pool, struct iscsi_context *iscsi, char *portal) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); struct scsi_task *task = NULL; struct scsi_reportluns_list *list = NULL; int full_size; @@ -466,7 +466,7 @@ virISCSIDirectScanTargets(char *initiator_iqn, } static int -virStorageBackendISCSIDirectCheckPool(virStoragePoolObjPtr pool, +virStorageBackendISCSIDirectCheckPool(virStoragePoolObj *pool, bool *isActive) { *isActive = virStoragePoolObjIsActive(pool); @@ -549,10 +549,10 @@ virStorageBackendISCSIDirectFindPoolSources(const char *srcSpec, } static struct iscsi_context * -virStorageBackendISCSIDirectSetConnection(virStoragePoolObjPtr pool, +virStorageBackendISCSIDirectSetConnection(virStoragePoolObj *pool, char **portalRet) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); struct iscsi_context *iscsi = NULL; g_autofree char *portal = NULL; @@ -578,7 +578,7 @@ virStorageBackendISCSIDirectSetConnection(virStoragePoolObjPtr pool, } static int -virStorageBackendISCSIDirectRefreshPool(virStoragePoolObjPtr pool) +virStorageBackendISCSIDirectRefreshPool(virStoragePoolObj *pool) { struct iscsi_context *iscsi = NULL; int ret = -1; @@ -593,7 +593,7 @@ virStorageBackendISCSIDirectRefreshPool(virStoragePoolObjPtr pool) } static int -virStorageBackendISCSIDirectGetLun(virStorageVolDefPtr vol, +virStorageBackendISCSIDirectGetLun(virStorageVolDef *vol, int *lun) { const char *name; @@ -609,7 +609,7 @@ virStorageBackendISCSIDirectGetLun(virStorageVolDefPtr vol, } static int -virStorageBackendISCSIDirectVolWipeZero(virStorageVolDefPtr vol, +virStorageBackendISCSIDirectVolWipeZero(virStorageVolDef *vol, struct iscsi_context *iscsi) { uint64_t lba = 0; @@ -652,8 +652,8 @@ virStorageBackendISCSIDirectVolWipeZero(virStorageVolDefPtr vol, } static int -virStorageBackenISCSIDirectWipeVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackenISCSIDirectWipeVol(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int algorithm, unsigned int flags) { diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c index 3e65318188..ed8e47d880 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -42,10 +42,10 @@ VIR_LOG_INIT("storage.storage_backend_logical"); static int -virStorageBackendLogicalSetActive(virStoragePoolObjPtr pool, +virStorageBackendLogicalSetActive(virStoragePoolObj *pool, bool on) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autoptr(virCommand) cmd = NULL; int ret; @@ -110,12 +110,12 @@ virStorageBackendLogicalInitializeDevice(const char *path) #define VIR_STORAGE_VOL_LOGICAL_SEGTYPE_RAID "raid" struct virStorageBackendLogicalPoolVolData { - virStoragePoolObjPtr pool; - virStorageVolDefPtr vol; + virStoragePoolObj *pool; + virStorageVolDef *vol; }; static int -virStorageBackendLogicalParseVolExtents(virStorageVolDefPtr vol, +virStorageBackendLogicalParseVolExtents(virStorageVolDef *vol, char **const groups) { g_autoptr(GRegex) re = NULL; @@ -219,9 +219,9 @@ virStorageBackendLogicalMakeVol(char **const groups, void *opaque) { struct virStorageBackendLogicalPoolVolData *data = opaque; - virStoragePoolObjPtr pool = data->pool; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); - virStorageVolDefPtr vol = NULL; + virStoragePoolObj *pool = data->pool; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); + virStorageVolDef *vol = NULL; bool is_new_vol = false; int ret = -1; const char *attrs = groups[9]; @@ -345,8 +345,8 @@ virStorageBackendLogicalMakeVol(char **const groups, VIR_STORAGE_VOL_LOGICAL_SUFFIX_REGEX static int -virStorageBackendLogicalFindLVs(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol) +virStorageBackendLogicalFindLVs(virStoragePoolObj *pool, + virStorageVolDef *vol) { /* * # lvs --separator # --noheadings --units b --unbuffered --nosuffix --options \ @@ -379,7 +379,7 @@ virStorageBackendLogicalFindLVs(virStoragePoolObjPtr pool, int vars[] = { VIR_STORAGE_VOL_LOGICAL_REGEX_COUNT }; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); struct virStorageBackendLogicalPoolVolData cbdata = { .pool = pool, .vol = vol, @@ -405,8 +405,8 @@ static int virStorageBackendLogicalRefreshPoolFunc(char **const groups, void *data) { - virStoragePoolObjPtr pool = data; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolObj *pool = data; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); if (virStrToLong_ull(groups[0], NULL, 10, &def->capacity) < 0) return -1; @@ -422,9 +422,9 @@ static int virStorageBackendLogicalFindPoolSourcesFunc(char **const groups, void *data) { - virStoragePoolSourceListPtr sourceList = data; + virStoragePoolSourceList *sourceList = data; size_t i; - virStoragePoolSourceDevicePtr dev; + virStoragePoolSourceDevice *dev; virStoragePoolSource *thisSource; g_autofree char *pvname = NULL; g_autofree char *vgname = NULL; @@ -468,7 +468,7 @@ virStorageBackendLogicalFindPoolSourcesFunc(char **const groups, * Returns 0 if successful, -1 and sets error on failure */ static int -virStorageBackendLogicalGetPoolSources(virStoragePoolSourceListPtr sourceList) +virStorageBackendLogicalGetPoolSources(virStoragePoolSourceList *sourceList) { /* * # pvs --noheadings -o pv_name,vg_name @@ -550,9 +550,9 @@ virStorageBackendLogicalFindPoolSources(const char *srcSpec G_GNUC_UNUSED, * the any device list members. */ static bool -virStorageBackendLogicalMatchPoolSource(virStoragePoolObjPtr pool) +virStorageBackendLogicalMatchPoolSource(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); virStoragePoolSourceList sourceList; virStoragePoolSource *thisSource = NULL; size_t i, j; @@ -629,10 +629,10 @@ virStorageBackendLogicalMatchPoolSource(virStoragePoolObjPtr pool) static int -virStorageBackendLogicalCheckPool(virStoragePoolObjPtr pool, +virStorageBackendLogicalCheckPool(virStoragePoolObj *pool, bool *isActive) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); /* If we can find the target.path as well as ensure that the * pool's def source @@ -643,7 +643,7 @@ virStorageBackendLogicalCheckPool(virStoragePoolObjPtr pool, } static int -virStorageBackendLogicalStartPool(virStoragePoolObjPtr pool) +virStorageBackendLogicalStartPool(virStoragePoolObj *pool) { /* Let's make sure that the pool's name matches the pvs output and * that the pool's source devices match the pvs output. @@ -657,10 +657,10 @@ virStorageBackendLogicalStartPool(virStoragePoolObjPtr pool) static int -virStorageBackendLogicalBuildPool(virStoragePoolObjPtr pool, +virStorageBackendLogicalBuildPool(virStoragePoolObj *pool, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); int ret = -1; size_t i = 0; g_autoptr(virCommand) vgcmd = NULL; @@ -709,7 +709,7 @@ virStorageBackendLogicalBuildPool(virStoragePoolObjPtr pool, static int -virStorageBackendLogicalRefreshPool(virStoragePoolObjPtr pool) +virStorageBackendLogicalRefreshPool(virStoragePoolObj *pool) { /* * # vgs --separator : --noheadings --units b --unbuffered --nosuffix --options "vg_size,vg_free" VGNAME @@ -725,7 +725,7 @@ virStorageBackendLogicalRefreshPool(virStoragePoolObjPtr pool) int vars[] = { 2 }; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autoptr(virCommand) cmd = NULL; virWaitForDevices(); @@ -764,7 +764,7 @@ virStorageBackendLogicalRefreshPool(virStoragePoolObjPtr pool) * "Can't deactivate volume group "VolGroup00" with 3 open logical volume(s)" */ static int -virStorageBackendLogicalStopPool(virStoragePoolObjPtr pool) +virStorageBackendLogicalStopPool(virStoragePoolObj *pool) { if (virStorageBackendLogicalSetActive(pool, false) < 0) return -1; @@ -773,10 +773,10 @@ virStorageBackendLogicalStopPool(virStoragePoolObjPtr pool) } static int -virStorageBackendLogicalDeletePool(virStoragePoolObjPtr pool, +virStorageBackendLogicalDeletePool(virStoragePoolObj *pool, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); size_t i; g_autoptr(virCommand) cmd = NULL; @@ -798,8 +798,8 @@ virStorageBackendLogicalDeletePool(virStoragePoolObjPtr pool, static int -virStorageBackendLogicalDeleteVol(virStoragePoolObjPtr pool G_GNUC_UNUSED, - virStorageVolDefPtr vol, +virStorageBackendLogicalDeleteVol(virStoragePoolObj *pool G_GNUC_UNUSED, + virStorageVolDef *vol, unsigned int flags) { g_autoptr(virCommand) lvchange_cmd = NULL; @@ -826,8 +826,8 @@ virStorageBackendLogicalDeleteVol(virStoragePoolObjPtr pool G_GNUC_UNUSED, static int -virStorageBackendLogicalLVCreate(virStorageVolDefPtr vol, - virStoragePoolDefPtr def) +virStorageBackendLogicalLVCreate(virStorageVolDef *vol, + virStoragePoolDef *def) { unsigned long long capacity = vol->target.capacity; g_autoptr(virCommand) cmd = NULL; @@ -868,10 +868,10 @@ virStorageBackendLogicalLVCreate(virStorageVolDefPtr vol, static int -virStorageBackendLogicalCreateVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol) +virStorageBackendLogicalCreateVol(virStoragePoolObj *pool, + virStorageVolDef *vol) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); virErrorPtr err; struct stat sb; VIR_AUTOCLOSE fd = -1; @@ -935,9 +935,9 @@ virStorageBackendLogicalCreateVol(virStoragePoolObjPtr pool, } static int -virStorageBackendLogicalBuildVolFrom(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +virStorageBackendLogicalBuildVolFrom(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags) { virStorageBackendBuildVolFrom build_func; @@ -950,8 +950,8 @@ virStorageBackendLogicalBuildVolFrom(virStoragePoolObjPtr pool, } static int -virStorageBackendLogicalVolWipe(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendLogicalVolWipe(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int algorithm, unsigned int flags) { diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c index 20e9b34bbf..ac90a38fa3 100644 --- a/src/storage/storage_backend_mpath.c +++ b/src/storage/storage_backend_mpath.c @@ -42,11 +42,11 @@ VIR_LOG_INIT("storage.storage_backend_mpath"); static int -virStorageBackendMpathNewVol(virStoragePoolObjPtr pool, +virStorageBackendMpathNewVol(virStoragePoolObj *pool, const int devnum, const char *dev) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autoptr(virStorageVolDef) vol = NULL; vol = g_new0(virStorageVolDef, 1); @@ -147,7 +147,7 @@ virStorageBackendGetMinorNumber(const char *dev_name, uint32_t *minor) static int -virStorageBackendCreateVols(virStoragePoolObjPtr pool, +virStorageBackendCreateVols(virStoragePoolObj *pool, struct dm_names *names) { uint32_t minor = -1; @@ -191,7 +191,7 @@ virStorageBackendCreateVols(virStoragePoolObjPtr pool, static int -virStorageBackendGetMaps(virStoragePoolObjPtr pool) +virStorageBackendGetMaps(virStoragePoolObj *pool) { int retval = 0; struct dm_task *dmt = NULL; @@ -228,7 +228,7 @@ virStorageBackendGetMaps(virStoragePoolObjPtr pool) } static int -virStorageBackendMpathCheckPool(virStoragePoolObjPtr pool G_GNUC_UNUSED, +virStorageBackendMpathCheckPool(virStoragePoolObj *pool G_GNUC_UNUSED, bool *isActive) { *isActive = virFileExists("/dev/mapper") || @@ -239,9 +239,9 @@ virStorageBackendMpathCheckPool(virStoragePoolObjPtr pool G_GNUC_UNUSED, static int -virStorageBackendMpathRefreshPool(virStoragePoolObjPtr pool) +virStorageBackendMpathRefreshPool(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); VIR_DEBUG("pool=%p", pool); diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c index 871304d0d3..9fbb2464d1 100644 --- a/src/storage/storage_backend_rbd.c +++ b/src/storage/storage_backend_rbd.c @@ -48,10 +48,8 @@ struct _virStorageBackendRBDState { }; typedef struct _virStorageBackendRBDState virStorageBackendRBDState; -typedef virStorageBackendRBDState *virStorageBackendRBDStatePtr; typedef struct _virStoragePoolRBDConfigOptionsDef virStoragePoolRBDConfigOptionsDef; -typedef virStoragePoolRBDConfigOptionsDef *virStoragePoolRBDConfigOptionsDefPtr; struct _virStoragePoolRBDConfigOptionsDef { size_t noptions; char **names; @@ -61,7 +59,7 @@ struct _virStoragePoolRBDConfigOptionsDef { static void virStoragePoolDefRBDNamespaceFree(void *nsdata) { - virStoragePoolRBDConfigOptionsDefPtr cmdopts = nsdata; + virStoragePoolRBDConfigOptionsDef *cmdopts = nsdata; size_t i; if (!cmdopts) @@ -82,7 +80,7 @@ static int virStoragePoolDefRBDNamespaceParse(xmlXPathContextPtr ctxt, void **data) { - virStoragePoolRBDConfigOptionsDefPtr cmdopts = NULL; + virStoragePoolRBDConfigOptionsDef *cmdopts = NULL; int nnodes; size_t i; int ret = -1; @@ -138,11 +136,11 @@ virStoragePoolDefRBDNamespaceParse(xmlXPathContextPtr ctxt, static int -virStoragePoolDefRBDNamespaceFormatXML(virBufferPtr buf, +virStoragePoolDefRBDNamespaceFormatXML(virBuffer *buf, void *nsdata) { size_t i; - virStoragePoolRBDConfigOptionsDefPtr def = nsdata; + virStoragePoolRBDConfigOptionsDef *def = nsdata; if (!def) return 0; @@ -180,12 +178,12 @@ virStorageBackendRBDRADOSConfSet(rados_t cluster, } static int -virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr, - virStoragePoolDefPtr def) +virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDState *ptr, + virStoragePoolDef *def) { int ret = -1; - virStoragePoolSourcePtr source = &def->source; - virStorageAuthDefPtr authdef = source->auth; + virStoragePoolSource *source = &def->source; + virStorageAuthDef *authdef = source->auth; g_autofree unsigned char *secret_value = NULL; size_t secret_value_size = 0; g_auto(virBuffer) mon_host = VIR_BUFFER_INITIALIZER; @@ -306,7 +304,7 @@ virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr, goto cleanup; if (def->namespaceData) { - virStoragePoolRBDConfigOptionsDefPtr cmdopts = def->namespaceData; + virStoragePoolRBDConfigOptionsDef *cmdopts = def->namespaceData; char uuidstr[VIR_UUID_STRING_BUFLEN]; for (i = 0; i < cmdopts->noptions; i++) { @@ -336,10 +334,10 @@ virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr, } static int -virStorageBackendRBDOpenIoCTX(virStorageBackendRBDStatePtr ptr, - virStoragePoolObjPtr pool) +virStorageBackendRBDOpenIoCTX(virStorageBackendRBDState *ptr, + virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); int rc = rados_ioctx_create(ptr->cluster, def->source.name, &ptr->ioctx); if (rc < 0) { virReportSystemError(errno, _("failed to create the RBD IoCTX. Does the pool '%s' exist?"), @@ -349,7 +347,7 @@ virStorageBackendRBDOpenIoCTX(virStorageBackendRBDStatePtr ptr, } static void -virStorageBackendRBDCloseRADOSConn(virStorageBackendRBDStatePtr ptr) +virStorageBackendRBDCloseRADOSConn(virStorageBackendRBDState *ptr) { if (ptr->ioctx != NULL) { VIR_DEBUG("Closing RADOS IoCTX"); @@ -369,7 +367,7 @@ virStorageBackendRBDCloseRADOSConn(virStorageBackendRBDStatePtr ptr) static void -virStorageBackendRBDFreeState(virStorageBackendRBDStatePtr *ptr) +virStorageBackendRBDFreeState(virStorageBackendRBDState **ptr) { if (!*ptr) return; @@ -380,11 +378,11 @@ virStorageBackendRBDFreeState(virStorageBackendRBDStatePtr *ptr) } -static virStorageBackendRBDStatePtr -virStorageBackendRBDNewState(virStoragePoolObjPtr pool) +static virStorageBackendRBDState * +virStorageBackendRBDNewState(virStoragePoolObj *pool) { - virStorageBackendRBDStatePtr ptr; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStorageBackendRBDState *ptr; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); ptr = g_new0(virStorageBackendRBDState, 1); @@ -457,7 +455,7 @@ virStorageBackendRBDRefreshVolInfoCb(uint64_t offset G_GNUC_UNUSED, } static int -virStorageBackendRBDSetAllocation(virStorageVolDefPtr vol, +virStorageBackendRBDSetAllocation(virStorageVolDef *vol, rbd_image_t *image, rbd_image_info_t *info) { @@ -498,7 +496,7 @@ volStorageBackendRBDUseFastDiff(uint64_t features G_GNUC_UNUSED, } static int -virStorageBackendRBDSetAllocation(virStorageVolDefPtr vol G_GNUC_UNUSED, +virStorageBackendRBDSetAllocation(virStorageVolDef *vol G_GNUC_UNUSED, rbd_image_t *image G_GNUC_UNUSED, rbd_image_info_t *info G_GNUC_UNUSED) { @@ -507,12 +505,12 @@ virStorageBackendRBDSetAllocation(virStorageVolDefPtr vol G_GNUC_UNUSED, #endif static int -volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol, - virStoragePoolObjPtr pool, - virStorageBackendRBDStatePtr ptr) +volStorageBackendRBDRefreshVolInfo(virStorageVolDef *vol, + virStoragePoolObj *pool, + virStorageBackendRBDState *ptr) { int ret = -1; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); rbd_image_t image = NULL; rbd_image_info_t info; uint64_t features; @@ -573,7 +571,7 @@ volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol, #ifdef WITH_RBD_LIST2 static char ** -virStorageBackendRBDGetVolNames(virStorageBackendRBDStatePtr ptr) +virStorageBackendRBDGetVolNames(virStorageBackendRBDState *ptr) { char **names = NULL; size_t nnames = 0; @@ -612,7 +610,7 @@ virStorageBackendRBDGetVolNames(virStorageBackendRBDStatePtr ptr) #else /* ! WITH_RBD_LIST2 */ static char ** -virStorageBackendRBDGetVolNames(virStorageBackendRBDStatePtr ptr) +virStorageBackendRBDGetVolNames(virStorageBackendRBDState *ptr) { char **names = NULL; size_t nnames = 0; @@ -660,11 +658,11 @@ virStorageBackendRBDGetVolNames(virStorageBackendRBDStatePtr ptr) static int -virStorageBackendRBDRefreshPool(virStoragePoolObjPtr pool) +virStorageBackendRBDRefreshPool(virStoragePoolObj *pool) { int rc, ret = -1; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); - virStorageBackendRBDStatePtr ptr = NULL; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); + virStorageBackendRBDState *ptr = NULL; struct rados_cluster_stat_t clusterstat; struct rados_pool_stat_t poolstat; char **names = NULL; @@ -739,8 +737,8 @@ virStorageBackendRBDRefreshPool(virStoragePoolObjPtr pool) static int virStorageBackendRBDCleanupSnapshots(rados_ioctx_t ioctx, - virStoragePoolSourcePtr source, - virStorageVolDefPtr vol) + virStoragePoolSource *source, + virStorageVolDef *vol) { int ret = -1; int max_snaps = 128; @@ -812,13 +810,13 @@ virStorageBackendRBDCleanupSnapshots(rados_ioctx_t ioctx, } static int -virStorageBackendRBDDeleteVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendRBDDeleteVol(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int flags) { int rc, ret = -1; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); - virStorageBackendRBDStatePtr ptr = NULL; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); + virStorageBackendRBDState *ptr = NULL; virCheckFlags(VIR_STORAGE_VOL_DELETE_ZEROED | VIR_STORAGE_VOL_DELETE_WITH_SNAPSHOTS, -1); @@ -855,10 +853,10 @@ virStorageBackendRBDDeleteVol(virStoragePoolObjPtr pool, static int -virStorageBackendRBDCreateVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol) +virStorageBackendRBDCreateVol(virStoragePoolObj *pool, + virStorageVolDef *vol) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); vol->type = VIR_STORAGE_VOL_NETWORK; @@ -885,12 +883,12 @@ static int virStorageBackendRBDCreateImage(rados_ioctx_t io, } static int -virStorageBackendRBDBuildVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendRBDBuildVol(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); - virStorageBackendRBDStatePtr ptr = NULL; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); + virStorageBackendRBDState *ptr = NULL; int ret = -1; VIR_DEBUG("Creating RBD image %s/%s with size %llu", @@ -996,7 +994,7 @@ virStorageBackendRBDIterateCb(uint64_t offset G_GNUC_UNUSED, static int virStorageBackendRBDSnapshotFindNoDiff(rbd_image_t image, char *imgname, - virBufferPtr snapname) + virBuffer *snapname) { int ret = -1; int snap_count; @@ -1210,13 +1208,13 @@ virStorageBackendRBDCloneImage(rados_ioctx_t io, } static int -virStorageBackendRBDBuildVolFrom(virStoragePoolObjPtr pool, - virStorageVolDefPtr newvol, - virStorageVolDefPtr origvol, +virStorageBackendRBDBuildVolFrom(virStoragePoolObj *pool, + virStorageVolDef *newvol, + virStorageVolDef *origvol, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); - virStorageBackendRBDStatePtr ptr = NULL; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); + virStorageBackendRBDState *ptr = NULL; int ret = -1; VIR_DEBUG("Creating clone of RBD image %s/%s with name %s", @@ -1239,10 +1237,10 @@ virStorageBackendRBDBuildVolFrom(virStoragePoolObjPtr pool, } static int -virStorageBackendRBDRefreshVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol) +virStorageBackendRBDRefreshVol(virStoragePoolObj *pool, + virStorageVolDef *vol) { - virStorageBackendRBDStatePtr ptr = NULL; + virStorageBackendRBDState *ptr = NULL; int ret = -1; if (!(ptr = virStorageBackendRBDNewState(pool))) @@ -1259,12 +1257,12 @@ virStorageBackendRBDRefreshVol(virStoragePoolObjPtr pool, } static int -virStorageBackendRBDResizeVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendRBDResizeVol(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned long long capacity, unsigned int flags) { - virStorageBackendRBDStatePtr ptr = NULL; + virStorageBackendRBDState *ptr = NULL; rbd_image_t image = NULL; int ret = -1; @@ -1356,13 +1354,13 @@ virStorageBackendRBDVolWipeDiscard(rbd_image_t image, } static int -virStorageBackendRBDVolWipe(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendRBDVolWipe(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int algorithm, unsigned int flags) { - virStorageBackendRBDStatePtr ptr = NULL; - virStoragePoolDefPtr def; + virStorageBackendRBDState *ptr = NULL; + virStoragePoolDef *def; rbd_image_t image = NULL; rbd_image_info_t info; uint64_t stripe_count; diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c index 9474c60c72..fc99e0414a 100644 --- a/src/storage/storage_backend_scsi.c +++ b/src/storage/storage_backend_scsi.c @@ -44,7 +44,6 @@ VIR_LOG_INIT("storage.storage_backend_scsi"); #define LINUX_SYSFS_SCSI_HOST_SCAN_STRING "- - -" typedef struct _virStoragePoolFCRefreshInfo virStoragePoolFCRefreshInfo; -typedef virStoragePoolFCRefreshInfo *virStoragePoolFCRefreshInfoPtr; struct _virStoragePoolFCRefreshInfo { char *fchost_name; unsigned char pool_uuid[VIR_UUID_BUFLEN]; @@ -93,7 +92,7 @@ virStorageBackendSCSITriggerRescan(uint32_t host) static void virStoragePoolFCRefreshDataFree(void *opaque) { - virStoragePoolFCRefreshInfoPtr cbdata = opaque; + virStoragePoolFCRefreshInfo *cbdata = opaque; g_free(cbdata->fchost_name); g_free(cbdata); @@ -122,11 +121,11 @@ virStoragePoolFCRefreshDataFree(void *opaque) static void virStoragePoolFCRefreshThread(void *opaque) { - virStoragePoolFCRefreshInfoPtr cbdata = opaque; + virStoragePoolFCRefreshInfo *cbdata = opaque; const char *fchost_name = cbdata->fchost_name; const unsigned char *pool_uuid = cbdata->pool_uuid; - virStoragePoolObjPtr pool = NULL; - virStoragePoolDefPtr def; + virStoragePoolObj *pool = NULL; + virStoragePoolDef *def; unsigned int host; int found = 0; int tries = 2; @@ -163,15 +162,15 @@ virStoragePoolFCRefreshThread(void *opaque) } static char * -getAdapterName(virStorageAdapterPtr adapter) +getAdapterName(virStorageAdapter *adapter) { char *name = NULL; if (adapter->type == VIR_STORAGE_ADAPTER_TYPE_SCSI_HOST) { - virStorageAdapterSCSIHostPtr scsi_host = &adapter->data.scsi_host; + virStorageAdapterSCSIHost *scsi_host = &adapter->data.scsi_host; if (scsi_host->has_parent) { - virPCIDeviceAddressPtr addr = &scsi_host->parentaddr; + virPCIDeviceAddress *addr = &scsi_host->parentaddr; unsigned int unique_id = scsi_host->unique_id; if (!(name = virSCSIHostGetNameByParentaddr(addr->domain, @@ -184,7 +183,7 @@ getAdapterName(virStorageAdapterPtr adapter) name = g_strdup(scsi_host->name); } } else if (adapter->type == VIR_STORAGE_ADAPTER_TYPE_FC_HOST) { - virStorageAdapterFCHostPtr fchost = &adapter->data.fchost; + virStorageAdapterFCHost *fchost = &adapter->data.fchost; if (!(name = virVHBAGetHostByWWN(NULL, fchost->wwnn, fchost->wwpn))) { virReportError(VIR_ERR_XML_ERROR, @@ -280,11 +279,11 @@ checkParent(const char *name, static int -createVport(virStoragePoolDefPtr def, +createVport(virStoragePoolDef *def, const char *configFile, - virStorageAdapterFCHostPtr fchost) + virStorageAdapterFCHost *fchost) { - virStoragePoolFCRefreshInfoPtr cbdata = NULL; + virStoragePoolFCRefreshInfo *cbdata = NULL; virThread thread; g_autofree char *name = NULL; @@ -345,10 +344,10 @@ createVport(virStoragePoolDefPtr def, static int -virStorageBackendSCSICheckPool(virStoragePoolObjPtr pool, +virStorageBackendSCSICheckPool(virStoragePoolObj *pool, bool *isActive) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); unsigned int host; g_autofree char *path = NULL; g_autofree char *name = NULL; @@ -379,9 +378,9 @@ virStorageBackendSCSICheckPool(virStoragePoolObjPtr pool, } static int -virStorageBackendSCSIRefreshPool(virStoragePoolObjPtr pool) +virStorageBackendSCSIRefreshPool(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); unsigned int host; g_autofree char *name = NULL; @@ -406,9 +405,9 @@ virStorageBackendSCSIRefreshPool(virStoragePoolObjPtr pool) static int -virStorageBackendSCSIStartPool(virStoragePoolObjPtr pool) +virStorageBackendSCSIStartPool(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); const char *configFile = virStoragePoolObjGetConfigFile(pool); if (def->source.adapter.type == VIR_STORAGE_ADAPTER_TYPE_FC_HOST) @@ -420,9 +419,9 @@ virStorageBackendSCSIStartPool(virStoragePoolObjPtr pool) static int -virStorageBackendSCSIStopPool(virStoragePoolObjPtr pool) +virStorageBackendSCSIStopPool(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); if (def->source.adapter.type == VIR_STORAGE_ADAPTER_TYPE_FC_HOST) { virConnectPtr conn; diff --git a/src/storage/storage_backend_sheepdog.c b/src/storage/storage_backend_sheepdog.c index 8c37947308..6490dfae52 100644 --- a/src/storage/storage_backend_sheepdog.c +++ b/src/storage/storage_backend_sheepdog.c @@ -35,14 +35,14 @@ #define VIR_FROM_THIS VIR_FROM_STORAGE -static int virStorageBackendSheepdogRefreshVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol); +static int virStorageBackendSheepdogRefreshVol(virStoragePoolObj *pool, + virStorageVolDef *vol); -void virStorageBackendSheepdogAddHostArg(virCommandPtr cmd, - virStoragePoolObjPtr pool); +void virStorageBackendSheepdogAddHostArg(virCommand *cmd, + virStoragePoolObj *pool); int -virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool, +virStorageBackendSheepdogParseNodeInfo(virStoragePoolDef *pool, char *output) { /* fields: @@ -89,10 +89,10 @@ virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool, } void -virStorageBackendSheepdogAddHostArg(virCommandPtr cmd, - virStoragePoolObjPtr pool) +virStorageBackendSheepdogAddHostArg(virCommand *cmd, + virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); const char *address = "localhost"; int port = 7000; if (def->source.nhost > 0) { @@ -108,7 +108,7 @@ virStorageBackendSheepdogAddHostArg(virCommandPtr cmd, } static int -virStorageBackendSheepdogAddVolume(virStoragePoolObjPtr pool, const char *diskInfo) +virStorageBackendSheepdogAddVolume(virStoragePoolObj *pool, const char *diskInfo) { g_autoptr(virStorageVolDef) vol = NULL; @@ -135,7 +135,7 @@ virStorageBackendSheepdogAddVolume(virStoragePoolObjPtr pool, const char *diskIn } static int -virStorageBackendSheepdogRefreshAllVol(virStoragePoolObjPtr pool) +virStorageBackendSheepdogRefreshAllVol(virStoragePoolObj *pool) { size_t i; g_autofree char *output = NULL; @@ -168,7 +168,7 @@ virStorageBackendSheepdogRefreshAllVol(virStoragePoolObjPtr pool) static int -virStorageBackendSheepdogRefreshPool(virStoragePoolObjPtr pool) +virStorageBackendSheepdogRefreshPool(virStoragePoolObj *pool) { g_autofree char *output = NULL; g_autoptr(virCommand) cmd = NULL; @@ -188,8 +188,8 @@ virStorageBackendSheepdogRefreshPool(virStoragePoolObjPtr pool) static int -virStorageBackendSheepdogDeleteVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendSheepdogDeleteVol(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int flags) { g_autoptr(virCommand) cmd = NULL; @@ -203,10 +203,10 @@ virStorageBackendSheepdogDeleteVol(virStoragePoolObjPtr pool, static int -virStorageBackendSheepdogCreateVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol) +virStorageBackendSheepdogCreateVol(virStoragePoolObj *pool, + virStorageVolDef *vol) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); if (vol->target.encryption != NULL) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -228,8 +228,8 @@ virStorageBackendSheepdogCreateVol(virStoragePoolObjPtr pool, static int -virStorageBackendSheepdogBuildVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendSheepdogBuildVol(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int flags) { g_autoptr(virCommand) cmd = NULL; @@ -250,7 +250,7 @@ virStorageBackendSheepdogBuildVol(virStoragePoolObjPtr pool, int -virStorageBackendSheepdogParseVdiList(virStorageVolDefPtr vol, +virStorageBackendSheepdogParseVdiList(virStorageVolDef *vol, char *output) { /* fields: @@ -311,11 +311,11 @@ virStorageBackendSheepdogParseVdiList(virStorageVolDefPtr vol, } static int -virStorageBackendSheepdogRefreshVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol) +virStorageBackendSheepdogRefreshVol(virStoragePoolObj *pool, + virStorageVolDef *vol) { char *output = NULL; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autoptr(virCommand) cmd = NULL; cmd = virCommandNewArgList(SHEEPDOGCLI, "vdi", "list", vol->name, "-r", NULL); @@ -340,8 +340,8 @@ virStorageBackendSheepdogRefreshVol(virStoragePoolObjPtr pool, static int -virStorageBackendSheepdogResizeVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendSheepdogResizeVol(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned long long capacity, unsigned int flags) { diff --git a/src/storage/storage_backend_sheepdog_priv.h b/src/storage/storage_backend_sheepdog_priv.h index 07a35d1d70..a8cadb5542 100644 --- a/src/storage/storage_backend_sheepdog_priv.h +++ b/src/storage/storage_backend_sheepdog_priv.h @@ -24,7 +24,7 @@ #include "conf/storage_conf.h" -int virStorageBackendSheepdogParseNodeInfo(virStoragePoolDefPtr pool, +int virStorageBackendSheepdogParseNodeInfo(virStoragePoolDef *pool, char *output); -int virStorageBackendSheepdogParseVdiList(virStorageVolDefPtr vol, +int virStorageBackendSheepdogParseVdiList(virStorageVolDef *vol, char *output); diff --git a/src/storage/storage_backend_vstorage.c b/src/storage/storage_backend_vstorage.c index 7c67407bce..52e9895234 100644 --- a/src/storage/storage_backend_vstorage.c +++ b/src/storage/storage_backend_vstorage.c @@ -28,7 +28,7 @@ VIR_LOG_INIT("storage.storage_backend_vstorage"); * Returns 0 on success, -1 on error */ static int -virStorageBackendVzPoolBuild(virStoragePoolObjPtr pool, +virStorageBackendVzPoolBuild(virStoragePoolObj *pool, unsigned int flags) { virCheckFlags(0, -1); @@ -38,9 +38,9 @@ virStorageBackendVzPoolBuild(virStoragePoolObjPtr pool, static int -virStorageBackendVzPoolStart(virStoragePoolObjPtr pool) +virStorageBackendVzPoolStart(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autofree char *grp_name = NULL; g_autofree char *usr_name = NULL; g_autofree char *mode = NULL; @@ -83,10 +83,10 @@ virStorageBackendVzPoolStart(virStoragePoolObjPtr pool) static int -virStorageBackendVzIsMounted(virStoragePoolObjPtr pool) +virStorageBackendVzIsMounted(virStoragePoolObj *pool) { int ret = -1; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); FILE *mtab; struct mntent ent; char buf[1024]; @@ -119,9 +119,9 @@ virStorageBackendVzIsMounted(virStoragePoolObjPtr pool) static int -virStorageBackendVzPoolStop(virStoragePoolObjPtr pool) +virStorageBackendVzPoolStop(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); int rc; g_autoptr(virCommand) cmd = NULL; @@ -138,7 +138,7 @@ virStorageBackendVzPoolStop(virStoragePoolObjPtr pool) * Check whether the cluster is mounted */ static int -virStorageBackendVzCheck(virStoragePoolObjPtr pool, +virStorageBackendVzCheck(virStoragePoolObj *pool, bool *isActive) { int ret = -1; diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backend_zfs.c index c36deb9dac..6fabeade11 100644 --- a/src/storage/storage_backend_zfs.c +++ b/src/storage/storage_backend_zfs.c @@ -78,10 +78,10 @@ virStorageBackendZFSVolModeNeeded(void) } static int -virStorageBackendZFSCheckPool(virStoragePoolObjPtr pool G_GNUC_UNUSED, +virStorageBackendZFSCheckPool(virStoragePoolObj *pool G_GNUC_UNUSED, bool *isActive) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autofree char *devpath = NULL; devpath = g_strdup_printf("/dev/zvol/%s", def->source.name); @@ -91,15 +91,15 @@ virStorageBackendZFSCheckPool(virStoragePoolObjPtr pool G_GNUC_UNUSED, } static int -virStorageBackendZFSParseVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendZFSParseVol(virStoragePoolObj *pool, + virStorageVolDef *vol, const char *volume_string) { int ret = -1; char *vol_name; bool is_new_vol = false; - virStorageVolDefPtr volume = NULL; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStorageVolDef *volume = NULL; + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_auto(GStrv) tokens = NULL; char *tmp; @@ -162,10 +162,10 @@ virStorageBackendZFSParseVol(virStoragePoolObjPtr pool, } static int -virStorageBackendZFSFindVols(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol) +virStorageBackendZFSFindVols(virStoragePoolObj *pool, + virStorageVolDef *vol) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); size_t i; g_auto(GStrv) lines = NULL; g_autoptr(virCommand) cmd = NULL; @@ -208,9 +208,9 @@ virStorageBackendZFSFindVols(virStoragePoolObjPtr pool, } static int -virStorageBackendZFSRefreshPool(virStoragePoolObjPtr pool G_GNUC_UNUSED) +virStorageBackendZFSRefreshPool(virStoragePoolObj *pool G_GNUC_UNUSED) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); char *zpool_props = NULL; size_t i; g_autoptr(virCommand) cmd = NULL; @@ -284,10 +284,10 @@ virStorageBackendZFSRefreshPool(virStoragePoolObjPtr pool G_GNUC_UNUSED) } static int -virStorageBackendZFSCreateVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol) +virStorageBackendZFSCreateVol(virStoragePoolObj *pool, + virStorageVolDef *vol) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); int volmode_needed = -1; g_autoptr(virCommand) cmd = NULL; @@ -347,11 +347,11 @@ virStorageBackendZFSCreateVol(virStoragePoolObjPtr pool, } static int -virStorageBackendZFSDeleteVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendZFSDeleteVol(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autoptr(virCommand) destroy_cmd = NULL; virCheckFlags(0, -1); @@ -365,10 +365,10 @@ virStorageBackendZFSDeleteVol(virStoragePoolObjPtr pool, } static int -virStorageBackendZFSBuildPool(virStoragePoolObjPtr pool, +virStorageBackendZFSBuildPool(virStoragePoolObj *pool, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); size_t i; g_autoptr(virCommand) cmd = NULL; int ret = -1; @@ -402,10 +402,10 @@ virStorageBackendZFSBuildPool(virStoragePoolObjPtr pool, } static int -virStorageBackendZFSDeletePool(virStoragePoolObjPtr pool, +virStorageBackendZFSDeletePool(virStoragePoolObj *pool, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autoptr(virCommand) cmd = NULL; char *tmp; diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index ecb5b86b4f..c2ff4b8d06 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -55,12 +55,11 @@ VIR_LOG_INIT("storage.storage_driver"); -static virStorageDriverStatePtr driver; +static virStorageDriverState *driver; static int storageStateCleanup(void); typedef struct _virStorageVolStreamInfo virStorageVolStreamInfo; -typedef virStorageVolStreamInfo *virStorageVolStreamInfoPtr; struct _virStorageVolStreamInfo { char *pool_name; char *vol_path; @@ -77,8 +76,8 @@ static void storageDriverUnlock(void) static void -storagePoolRefreshFailCleanup(virStorageBackendPtr backend, - virStoragePoolObjPtr obj, +storagePoolRefreshFailCleanup(virStorageBackend *backend, + virStoragePoolObj *obj, const char *stateFile) { virErrorPtr orig_err; @@ -95,8 +94,8 @@ storagePoolRefreshFailCleanup(virStorageBackendPtr backend, static int -storagePoolRefreshImpl(virStorageBackendPtr backend, - virStoragePoolObjPtr obj, +storagePoolRefreshImpl(virStorageBackend *backend, + virStoragePoolObj *obj, const char *stateFile) { virStoragePoolObjClearVols(obj); @@ -118,7 +117,7 @@ storagePoolRefreshImpl(virStorageBackendPtr backend, * pools are removed. */ static void -virStoragePoolUpdateInactive(virStoragePoolObjPtr obj) +virStoragePoolUpdateInactive(virStoragePoolObj *obj) { if (!virStoragePoolObjGetConfigFile(obj)) { virStoragePoolObjRemove(driver->pools, obj); @@ -129,12 +128,12 @@ virStoragePoolUpdateInactive(virStoragePoolObjPtr obj) static void -storagePoolUpdateStateCallback(virStoragePoolObjPtr obj, +storagePoolUpdateStateCallback(virStoragePoolObj *obj, const void *opaque G_GNUC_UNUSED) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(obj); + virStoragePoolDef *def = virStoragePoolObjGetDef(obj); bool active = false; - virStorageBackendPtr backend; + virStorageBackend *backend; g_autofree char *stateFile = NULL; if ((backend = virStorageBackendForType(def->type)) == NULL) { @@ -188,11 +187,11 @@ storagePoolUpdateAllState(void) static void -storageDriverAutostartCallback(virStoragePoolObjPtr obj, +storageDriverAutostartCallback(virStoragePoolObj *obj, const void *opaque G_GNUC_UNUSED) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(obj); - virStorageBackendPtr backend; + virStoragePoolDef *def = virStoragePoolObjGetDef(obj); + virStorageBackend *backend; bool started = false; if (!(backend = virStorageBackendForType(def->type))) @@ -399,7 +398,7 @@ storageStateCleanup(void) static virDrvOpenStatus storageConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -447,11 +446,11 @@ static int storageConnectIsAlive(virConnectPtr conn G_GNUC_UNUSED) } -static virStoragePoolObjPtr +static virStoragePoolObj * storagePoolObjFindByUUID(const unsigned char *uuid, const char *name) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (!(obj = virStoragePoolObjFindByUUID(driver->pools, uuid))) { @@ -470,17 +469,17 @@ storagePoolObjFindByUUID(const unsigned char *uuid, } -static virStoragePoolObjPtr +static virStoragePoolObj * virStoragePoolObjFromStoragePool(virStoragePoolPtr pool) { return storagePoolObjFindByUUID(pool->uuid, pool->name); } -static virStoragePoolObjPtr +static virStoragePoolObj * storagePoolObjFindByName(const char *name) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; if (!(obj = virStoragePoolObjFindByName(driver->pools, name))) virReportError(VIR_ERR_NO_STORAGE_POOL, @@ -493,8 +492,8 @@ static virStoragePoolPtr storagePoolLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; virStoragePoolPtr pool = NULL; obj = storagePoolObjFindByUUID(uuid, NULL); @@ -516,8 +515,8 @@ static virStoragePoolPtr storagePoolLookupByName(virConnectPtr conn, const char *name) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; virStoragePoolPtr pool = NULL; if (!(obj = storagePoolObjFindByName(name))) @@ -537,8 +536,8 @@ storagePoolLookupByName(virConnectPtr conn, static virStoragePoolPtr storagePoolLookupByVolume(virStorageVolPtr vol) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; virStoragePoolPtr pool = NULL; if (!(obj = storagePoolObjFindByName(vol->pool))) @@ -624,7 +623,7 @@ storageConnectFindStoragePoolSources(virConnectPtr conn, unsigned int flags) { int backend_type; - virStorageBackendPtr backend; + virStorageBackend *backend; if (virConnectFindStoragePoolSourcesEnsureACL(conn) < 0) return NULL; @@ -655,7 +654,7 @@ static char * storageConnectGetStoragePoolCapabilities(virConnectPtr conn, unsigned int flags) { - virStoragePoolCapsPtr caps = NULL; + virStoragePoolCaps *caps = NULL; char *ret; virCheckFlags(0, NULL); @@ -676,8 +675,8 @@ storageConnectGetStoragePoolCapabilities(virConnectPtr conn, static int storagePoolIsActive(virStoragePoolPtr pool) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; int ret = -1; if (!(obj = virStoragePoolObjFromStoragePool(pool))) @@ -698,8 +697,8 @@ storagePoolIsActive(virStoragePoolPtr pool) static int storagePoolIsPersistent(virStoragePoolPtr pool) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; int ret = -1; if (!(obj = virStoragePoolObjFromStoragePool(pool))) @@ -722,11 +721,11 @@ storagePoolCreateXML(virConnectPtr conn, const char *xml, unsigned int flags) { - virStoragePoolObjPtr obj = NULL; - virStoragePoolDefPtr def; + virStoragePoolObj *obj = NULL; + virStoragePoolDef *def; virStoragePoolPtr pool = NULL; - virStorageBackendPtr backend; - virObjectEventPtr event = NULL; + virStorageBackend *backend; + virObjectEvent *event = NULL; unsigned int build_flags = 0; g_autoptr(virStoragePoolDef) newDef = NULL; g_autofree char *stateFile = NULL; @@ -811,10 +810,10 @@ storagePoolDefineXML(virConnectPtr conn, const char *xml, unsigned int flags) { - virStoragePoolObjPtr obj = NULL; - virStoragePoolDefPtr def; + virStoragePoolObj *obj = NULL; + virStoragePoolDef *def; virStoragePoolPtr pool = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; g_autoptr(virStoragePoolDef) newDef = NULL; virCheckFlags(0, NULL); @@ -859,10 +858,10 @@ storagePoolDefineXML(virConnectPtr conn, static int storagePoolUndefine(virStoragePoolPtr pool) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; const char *autostartLink; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; int ret = -1; if (!(obj = storagePoolObjFindByUUID(pool->uuid, pool->name))) @@ -922,10 +921,10 @@ static int storagePoolCreate(virStoragePoolPtr pool, unsigned int flags) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStorageBackendPtr backend; - virObjectEventPtr event = NULL; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStorageBackend *backend; + virObjectEvent *event = NULL; int ret = -1; unsigned int build_flags = 0; g_autofree char *stateFile = NULL; @@ -1015,10 +1014,10 @@ static int storagePoolBuild(virStoragePoolPtr pool, unsigned int flags) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStorageBackendPtr backend; - virObjectEventPtr event = NULL; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStorageBackend *backend; + virObjectEvent *event = NULL; bool restoreStarting = false; int ret = -1; @@ -1075,10 +1074,10 @@ storagePoolBuild(virStoragePoolPtr pool, static int storagePoolDestroy(virStoragePoolPtr pool) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStorageBackendPtr backend; - virObjectEventPtr event = NULL; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStorageBackend *backend; + virObjectEvent *event = NULL; int ret = -1; g_autofree char *stateFile = NULL; @@ -1146,10 +1145,10 @@ static int storagePoolDelete(virStoragePoolPtr pool, unsigned int flags) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStorageBackendPtr backend; - virObjectEventPtr event = NULL; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStorageBackend *backend; + virObjectEvent *event = NULL; int ret = -1; g_autofree char *stateFile = NULL; @@ -1217,12 +1216,12 @@ static int storagePoolRefresh(virStoragePoolPtr pool, unsigned int flags) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStorageBackendPtr backend; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStorageBackend *backend; g_autofree char *stateFile = NULL; int ret = -1; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; virCheckFlags(0, -1); @@ -1284,8 +1283,8 @@ static int storagePoolGetInfo(virStoragePoolPtr pool, virStoragePoolInfoPtr info) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; int ret = -1; if (!(obj = virStoragePoolObjFromStoragePool(pool))) @@ -1317,10 +1316,10 @@ static char * storagePoolGetXMLDesc(virStoragePoolPtr pool, unsigned int flags) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStoragePoolDefPtr newDef; - virStoragePoolDefPtr curDef; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStoragePoolDef *newDef; + virStoragePoolDef *curDef; char *ret = NULL; virCheckFlags(VIR_STORAGE_XML_INACTIVE, NULL); @@ -1349,7 +1348,7 @@ static int storagePoolGetAutostart(virStoragePoolPtr pool, int *autostart) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; int ret = -1; if (!(obj = virStoragePoolObjFromStoragePool(pool))) @@ -1372,7 +1371,7 @@ static int storagePoolSetAutostart(virStoragePoolPtr pool, int autostart) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; const char *configFile; const char *autostartLink; bool new_autostart; @@ -1434,8 +1433,8 @@ storagePoolSetAutostart(virStoragePoolPtr pool, static int storagePoolNumOfVolumes(virStoragePoolPtr pool) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; int ret = -1; if (!(obj = virStoragePoolObjFromStoragePool(pool))) @@ -1465,8 +1464,8 @@ storagePoolListVolumes(virStoragePoolPtr pool, char **const names, int maxnames) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; int n = -1; if (!(obj = virStoragePoolObjFromStoragePool(pool))) @@ -1496,8 +1495,8 @@ storagePoolListAllVolumes(virStoragePoolPtr pool, virStorageVolPtr **vols, unsigned int flags) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; int ret = -1; virCheckFlags(0, -1); @@ -1529,9 +1528,9 @@ static virStorageVolPtr storageVolLookupByName(virStoragePoolPtr pool, const char *name) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStorageVolDefPtr voldef; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStorageVolDef *voldef; virStorageVolPtr vol = NULL; if (!(obj = virStoragePoolObjFromStoragePool(pool))) @@ -1569,11 +1568,11 @@ struct storageVolLookupData { const char *key; char *cleanpath; const char *path; - virStorageVolDefPtr voldef; + virStorageVolDef *voldef; }; static bool -storageVolLookupByKeyCallback(virStoragePoolObjPtr obj, +storageVolLookupByKeyCallback(virStoragePoolObj *obj, const void *opaque) { struct storageVolLookupData *data = (struct storageVolLookupData *)opaque; @@ -1589,8 +1588,8 @@ static virStorageVolPtr storageVolLookupByKey(virConnectPtr conn, const char *key) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; struct storageVolLookupData data = { .key = key, .voldef = NULL }; virStorageVolPtr vol = NULL; @@ -1616,11 +1615,11 @@ storageVolLookupByKey(virConnectPtr conn, static bool -storageVolLookupByPathCallback(virStoragePoolObjPtr obj, +storageVolLookupByPathCallback(virStoragePoolObj *obj, const void *opaque) { struct storageVolLookupData *data = (struct storageVolLookupData *)opaque; - virStoragePoolDefPtr def; + virStoragePoolDef *def; g_autofree char *stable_path = NULL; if (!virStoragePoolObjIsActive(obj)) @@ -1669,8 +1668,8 @@ static virStorageVolPtr storageVolLookupByPath(virConnectPtr conn, const char *path) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; struct storageVolLookupData data = { .path = path, .voldef = NULL }; virStorageVolPtr vol = NULL; @@ -1708,11 +1707,11 @@ storageVolLookupByPath(virConnectPtr conn, static bool -storagePoolLookupByTargetPathCallback(virStoragePoolObjPtr obj, +storagePoolLookupByTargetPathCallback(virStoragePoolObj *obj, const void *opaque) { const char *path = opaque; - virStoragePoolDefPtr def; + virStoragePoolDef *def; if (!virStoragePoolObjIsActive(obj)) return false; @@ -1726,8 +1725,8 @@ virStoragePoolPtr storagePoolLookupByTargetPath(virConnectPtr conn, const char *path) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + virStoragePoolObj *obj; + virStoragePoolDef *def; virStoragePoolPtr pool = NULL; g_autofree char *cleanpath = NULL; @@ -1763,13 +1762,13 @@ storagePoolLookupByTargetPath(virConnectPtr conn, static int -storageVolDeleteInternal(virStorageBackendPtr backend, - virStoragePoolObjPtr obj, - virStorageVolDefPtr voldef, +storageVolDeleteInternal(virStorageBackend *backend, + virStoragePoolObj *obj, + virStorageVolDef *voldef, unsigned int flags, bool updateMeta) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(obj); + virStoragePoolDef *def = virStoragePoolObjGetDef(obj); if (!backend->deleteVol) { virReportError(VIR_ERR_NO_SUPPORT, @@ -1802,13 +1801,13 @@ storageVolDeleteInternal(virStorageBackendPtr backend, } -static virStorageVolDefPtr +static virStorageVolDef * virStorageVolDefFromVol(virStorageVolPtr vol, - virStoragePoolObjPtr *obj, - virStorageBackendPtr *backend) + virStoragePoolObj **obj, + virStorageBackend **backend) { - virStorageVolDefPtr voldef = NULL; - virStoragePoolDefPtr def; + virStorageVolDef *voldef = NULL; + virStoragePoolDef *def; if (!(*obj = storagePoolObjFindByName(vol->pool))) return NULL; @@ -1846,9 +1845,9 @@ static int storageVolDelete(virStorageVolPtr vol, unsigned int flags) { - virStoragePoolObjPtr obj; - virStorageBackendPtr backend; - virStorageVolDefPtr voldef = NULL; + virStoragePoolObj *obj; + virStorageBackend *backend; + virStorageVolDef *voldef = NULL; int ret = -1; if (!(voldef = virStorageVolDefFromVol(vol, &obj, &backend))) @@ -1888,9 +1887,9 @@ storageVolCreateXML(virStoragePoolPtr pool, const char *xmldesc, unsigned int flags) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStorageBackendPtr backend; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStorageBackend *backend; virStorageVolPtr vol = NULL, newvol = NULL; g_autoptr(virStorageVolDef) voldef = NULL; @@ -1953,7 +1952,7 @@ storageVolCreateXML(virStoragePoolPtr pool, if (backend->buildVol) { int buildret; - virStorageVolDefPtr buildvoldef = NULL; + virStorageVolDef *buildvoldef = NULL; buildvoldef = g_new0(virStorageVolDef, 1); @@ -2019,12 +2018,12 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool, virStorageVolPtr volsrc, unsigned int flags) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStoragePoolObjPtr objsrc = NULL; - virStorageBackendPtr backend; - virStorageVolDefPtr voldefsrc = NULL; - virStorageVolDefPtr shadowvol = NULL; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStoragePoolObj *objsrc = NULL; + virStorageBackend *backend; + virStorageVolDef *voldefsrc = NULL; + virStorageVolDef *shadowvol = NULL; virStorageVolPtr newvol = NULL; virStorageVolPtr vol = NULL; int buildret; @@ -2064,7 +2063,7 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool, } if (objsrc && !virStoragePoolObjIsActive(objsrc)) { - virStoragePoolDefPtr objsrcdef = virStoragePoolObjGetDef(objsrc); + virStoragePoolDef *objsrcdef = virStoragePoolObjGetDef(objsrc); virReportError(VIR_ERR_OPERATION_INVALID, _("storage pool '%s' is not active"), objsrcdef->name); @@ -2214,9 +2213,9 @@ storageVolDownload(virStorageVolPtr vol, unsigned long long length, unsigned int flags) { - virStorageBackendPtr backend; - virStoragePoolObjPtr obj = NULL; - virStorageVolDefPtr voldef = NULL; + virStorageBackend *backend; + virStoragePoolObj *obj = NULL; + virStorageVolDef *voldef = NULL; int ret = -1; virCheckFlags(VIR_STORAGE_VOL_DOWNLOAD_SPARSE_STREAM, -1); @@ -2266,7 +2265,7 @@ storageVolDownload(virStorageVolPtr vol, static void virStorageVolPoolRefreshDataFree(void *opaque) { - virStorageVolStreamInfoPtr cbdata = opaque; + virStorageVolStreamInfo *cbdata = opaque; g_free(cbdata->pool_name); g_free(cbdata); @@ -2312,11 +2311,11 @@ virStorageBackendPloopRestoreDesc(char *path) static void virStorageVolPoolRefreshThread(void *opaque) { - virStorageVolStreamInfoPtr cbdata = opaque; - virStoragePoolObjPtr obj = NULL; - virStoragePoolDefPtr def; - virStorageBackendPtr backend; - virObjectEventPtr event = NULL; + virStorageVolStreamInfo *cbdata = opaque; + virStoragePoolObj *obj = NULL; + virStoragePoolDef *def; + virStorageBackend *backend; + virObjectEvent *event = NULL; if (cbdata->vol_path) { if (virStorageBackendPloopRestoreDesc(cbdata->vol_path) < 0) @@ -2380,11 +2379,11 @@ storageVolUpload(virStorageVolPtr vol, unsigned long long length, unsigned int flags) { - virStorageBackendPtr backend; - virStoragePoolObjPtr obj = NULL; - virStoragePoolDefPtr def; - virStorageVolDefPtr voldef = NULL; - virStorageVolStreamInfoPtr cbdata = NULL; + virStorageBackend *backend; + virStoragePoolObj *obj = NULL; + virStoragePoolDef *def; + virStorageVolDef *voldef = NULL; + virStorageVolStreamInfo *cbdata = NULL; int rc; int ret = -1; @@ -2462,10 +2461,10 @@ storageVolResize(virStorageVolPtr vol, unsigned long long capacity, unsigned int flags) { - virStorageBackendPtr backend; - virStoragePoolObjPtr obj = NULL; - virStoragePoolDefPtr def; - virStorageVolDefPtr voldef = NULL; + virStorageBackend *backend; + virStoragePoolObj *obj = NULL; + virStoragePoolDef *def; + virStorageVolDef *voldef = NULL; unsigned long long abs_capacity, delta = 0; int ret = -1; @@ -2563,9 +2562,9 @@ storageVolWipePattern(virStorageVolPtr vol, unsigned int algorithm, unsigned int flags) { - virStorageBackendPtr backend; - virStoragePoolObjPtr obj = NULL; - virStorageVolDefPtr voldef = NULL; + virStorageBackend *backend; + virStoragePoolObj *obj = NULL; + virStorageVolDef *voldef = NULL; int rc; int ret = -1; @@ -2652,9 +2651,9 @@ storageVolGetInfoFlags(virStorageVolPtr vol, virStorageVolInfoPtr info, unsigned int flags) { - virStoragePoolObjPtr obj; - virStorageBackendPtr backend; - virStorageVolDefPtr voldef; + virStoragePoolObj *obj; + virStorageBackend *backend; + virStorageVolDef *voldef; int ret = -1; virCheckFlags(VIR_STORAGE_VOL_GET_PHYSICAL, -1); @@ -2698,10 +2697,10 @@ static char * storageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags) { - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStorageBackendPtr backend; - virStorageVolDefPtr voldef; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStorageBackend *backend; + virStorageVolDef *voldef; char *ret = NULL; virCheckFlags(0, NULL); @@ -2728,8 +2727,8 @@ storageVolGetXMLDesc(virStorageVolPtr vol, static char * storageVolGetPath(virStorageVolPtr vol) { - virStoragePoolObjPtr obj; - virStorageVolDefPtr voldef; + virStoragePoolObj *obj; + virStorageVolDef *voldef; char *ret = NULL; if (!(voldef = virStorageVolDefFromVol(vol, &obj, NULL))) @@ -2809,7 +2808,7 @@ storageConnectStoragePoolEventDeregisterAny(virConnectPtr conn, * * Returns NULL if pool is not found or a locked pool object pointer */ -virStoragePoolObjPtr +virStoragePoolObj * virStoragePoolObjFindPoolByUUID(const unsigned char *uuid) { return virStoragePoolObjFindByUUID(driver->pools, uuid); @@ -2828,11 +2827,11 @@ virStoragePoolObjFindPoolByUUID(const unsigned char *uuid) * Returns a string pointer on success, NULL on failure */ char * -virStoragePoolObjBuildTempFilePath(virStoragePoolObjPtr obj, - virStorageVolDefPtr voldef) +virStoragePoolObjBuildTempFilePath(virStoragePoolObj *obj, + virStorageVolDef *voldef) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(obj); + virStoragePoolDef *def = virStoragePoolObjGetDef(obj); return g_strdup_printf("%s/%s.%s.secret.XXXXXX", driver->stateDir, def->name, voldef->name); } diff --git a/src/storage/storage_driver.h b/src/storage/storage_driver.h index 7d82871852..4c1f596e44 100644 --- a/src/storage/storage_driver.h +++ b/src/storage/storage_driver.h @@ -26,7 +26,7 @@ #include "domain_conf.h" #include "virstorageobj.h" -virStoragePoolObjPtr virStoragePoolObjFindPoolByUUID(const unsigned char *uuid) +virStoragePoolObj *virStoragePoolObjFindPoolByUUID(const unsigned char *uuid) ATTRIBUTE_NONNULL(1); virStoragePoolPtr @@ -34,8 +34,8 @@ storagePoolLookupByTargetPath(virConnectPtr conn, const char *path) ATTRIBUTE_NONNULL(2); -char *virStoragePoolObjBuildTempFilePath(virStoragePoolObjPtr obj, - virStorageVolDefPtr voldef) +char *virStoragePoolObjBuildTempFilePath(virStoragePoolObj *obj, + virStorageVolDef *voldef) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int storageRegister(void); diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 6cf6753ef3..7efadc2197 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -93,7 +93,7 @@ VIR_LOG_INIT("storage.storage_util"); */ int virStorageBackendNamespaceInit(int poolType, - virXMLNamespacePtr xmlns) + virXMLNamespace *xmlns) { return virStoragePoolOptionsPoolTypeSetXMLNamespace(poolType, xmlns); } @@ -124,8 +124,8 @@ reflinkCloneFile(int dest_fd G_GNUC_UNUSED, static int ATTRIBUTE_NONNULL(2) -virStorageBackendCopyToFD(virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +virStorageBackendCopyToFD(virStorageVolDef *vol, + virStorageVolDef *inputvol, int fd, unsigned long long *total, bool want_sparse, @@ -227,9 +227,9 @@ virStorageBackendCopyToFD(virStorageVolDefPtr vol, } static int -storageBackendCreateBlockFrom(virStoragePoolObjPtr pool G_GNUC_UNUSED, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +storageBackendCreateBlockFrom(virStoragePoolObj *pool G_GNUC_UNUSED, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags) { unsigned long long remain; @@ -306,8 +306,8 @@ storageBackendCreateBlockFrom(virStoragePoolObjPtr pool G_GNUC_UNUSED, } static int -createRawFile(int fd, virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +createRawFile(int fd, virStorageVolDef *vol, + virStorageVolDef *inputvol, bool reflink_copy) { bool need_alloc = true; @@ -382,12 +382,12 @@ createRawFile(int fd, virStorageVolDefPtr vol, } static int -storageBackendCreateRaw(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +storageBackendCreateRaw(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); int operation_flags; bool reflink_copy = false; mode_t open_mode = VIR_STORAGE_DEFAULT_VOL_PERM_MODE; @@ -461,11 +461,11 @@ storageBackendCreateRaw(virStoragePoolObjPtr pool, static int -virStorageBackendCreateExecCommand(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virCommandPtr cmd) +virStorageBackendCreateExecCommand(virStoragePoolObj *pool, + virStorageVolDef *vol, + virCommand *cmd) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); struct stat st; gid_t gid; uid_t uid; @@ -561,9 +561,9 @@ virStorageBackendCreateExecCommand(virStoragePoolObjPtr pool, /* Create ploop directory with ploop image and DiskDescriptor.xml * if function fails to create image file the directory will be deleted.*/ static int -storageBackendCreatePloop(virStoragePoolObjPtr pool G_GNUC_UNUSED, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +storageBackendCreatePloop(virStoragePoolObj *pool G_GNUC_UNUSED, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags) { int ret = -1; @@ -631,7 +631,7 @@ storageBackendCreatePloop(virStoragePoolObjPtr pool G_GNUC_UNUSED, static int -storagePloopResize(virStorageVolDefPtr vol, +storagePloopResize(virStorageVolDef *vol, unsigned long long capacity) { g_autoptr(virCommand) cmd = NULL; @@ -666,7 +666,7 @@ struct _virStorageBackendQemuImgInfo { bool encryption; bool preallocate; const char *compat; - virBitmapPtr features; + virBitmap *features; bool nocow; const char *backingPath; @@ -701,9 +701,9 @@ struct _virStorageBackendQemuImgInfo { * */ static void -storageBackendBuildQemuImgEncriptionOpts(virBufferPtr buf, +storageBackendBuildQemuImgEncriptionOpts(virBuffer *buf, int format, - virStorageEncryptionInfoDefPtr encinfo, + virStorageEncryptionInfoDef *encinfo, const char *alias) { const char *encprefix; @@ -749,7 +749,7 @@ storageBackendBuildQemuImgEncriptionOpts(virBufferPtr buf, static int -storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDefPtr encinfo, +storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDef *encinfo, char **opts, struct _virStorageBackendQemuImgInfo *info) { @@ -812,9 +812,9 @@ storageBackendCreateQemuImgOpts(virStorageEncryptionInfoDefPtr encinfo, static int storageBackendCreateQemuImgCheckEncryption(int format, const char *type, - virStorageVolDefPtr vol) + virStorageVolDef *vol) { - virStorageEncryptionPtr enc = vol->target.encryption; + virStorageEncryption *enc = vol->target.encryption; if (format == VIR_STORAGE_FILE_RAW || format == VIR_STORAGE_FILE_QCOW2) { @@ -851,7 +851,7 @@ storageBackendCreateQemuImgCheckEncryption(int format, static int -storageBackendCreateQemuImgSetInput(virStorageVolDefPtr inputvol, +storageBackendCreateQemuImgSetInput(virStorageVolDef *inputvol, virStorageVolEncryptConvertStep convertStep, struct _virStorageBackendQemuImgInfo *info) { @@ -881,12 +881,12 @@ storageBackendCreateQemuImgSetInput(virStorageVolDefPtr inputvol, static int -storageBackendCreateQemuImgSetBacking(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +storageBackendCreateQemuImgSetBacking(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, struct _virStorageBackendQemuImgInfo *info) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); int accessRetCode = -1; g_autofree char *absolutePath = NULL; @@ -944,8 +944,8 @@ storageBackendCreateQemuImgSetBacking(virStoragePoolObjPtr pool, static int -storageBackendCreateQemuImgSetOptions(virCommandPtr cmd, - virStorageEncryptionInfoDefPtr encinfo, +storageBackendCreateQemuImgSetOptions(virCommand *cmd, + virStorageEncryptionInfoDef *encinfo, struct _virStorageBackendQemuImgInfo *info) { g_autofree char *opts = NULL; @@ -965,7 +965,7 @@ storageBackendCreateQemuImgSetOptions(virCommandPtr cmd, * NB: format=raw is assumed */ static int -storageBackendCreateQemuImgSecretObject(virCommandPtr cmd, +storageBackendCreateQemuImgSecretObject(virCommand *cmd, const char *secretPath, const char *secretAlias) { @@ -991,7 +991,7 @@ storageBackendCreateQemuImgSecretObject(virCommandPtr cmd, * */ static int -storageBackendResizeQemuImgImageOpts(virCommandPtr cmd, +storageBackendResizeQemuImgImageOpts(virCommand *cmd, int format, const char *path, const char *secretAlias) @@ -1022,9 +1022,9 @@ storageBackendResizeQemuImgImageOpts(virCommandPtr cmd, static int -virStorageBackendCreateQemuImgSetInfo(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +virStorageBackendCreateQemuImgSetInfo(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, virStorageVolEncryptConvertStep convertStep, struct _virStorageBackendQemuImgInfo *info) { @@ -1107,17 +1107,17 @@ virStorageBackendCreateQemuImgSetInfo(virStoragePoolObjPtr pool, /* Create a qemu-img virCommand from the supplied arguments */ -virCommandPtr -virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +virCommand * +virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags, const char *create_tool, const char *secretPath, const char *inputSecretPath, virStorageVolEncryptConvertStep convertStep) { - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; struct _virStorageBackendQemuImgInfo info = { .format = vol->target.format, .type = NULL, @@ -1131,9 +1131,9 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool, .nocow = vol->target.nocow, .secretAlias = NULL, }; - virStorageEncryptionPtr enc = vol->target.encryption; - virStorageEncryptionPtr inputenc = inputvol ? inputvol->target.encryption : NULL; - virStorageEncryptionInfoDefPtr encinfo = NULL; + virStorageEncryption *enc = vol->target.encryption; + virStorageEncryption *inputenc = inputvol ? inputvol->target.encryption : NULL; + virStorageEncryptionInfoDef *encinfo = NULL; g_autofree char *inputSecretAlias = NULL; const char *encprefix; const char *inputencprefix; @@ -1256,10 +1256,10 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool, static char * -storageBackendCreateQemuImgSecretPath(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol) +storageBackendCreateQemuImgSecretPath(virStoragePoolObj *pool, + virStorageVolDef *vol) { - virStorageEncryptionPtr enc = vol->target.encryption; + virStorageEncryption *enc = vol->target.encryption; char *secretPath = NULL; uint8_t *secret = NULL; size_t secretlen = 0; @@ -1328,9 +1328,9 @@ storageBackendCreateQemuImgSecretPath(virStoragePoolObjPtr pool, static int -storageBackendDoCreateQemuImg(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +storageBackendDoCreateQemuImg(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags, const char *create_tool, const char *secretPath, @@ -1351,9 +1351,9 @@ storageBackendDoCreateQemuImg(virStoragePoolObjPtr pool, static int -storageBackendCreateQemuImg(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +storageBackendCreateQemuImg(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags) { int ret = -1; @@ -1433,9 +1433,9 @@ storageBackendCreateQemuImg(virStoragePoolObjPtr pool, * Returns: 0 on success, -1 on failure. */ int -virStorageBackendCreateVolUsingQemuImg(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +virStorageBackendCreateVolUsingQemuImg(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags) { int ret = -1; @@ -1456,8 +1456,8 @@ virStorageBackendCreateVolUsingQemuImg(virStoragePoolObjPtr pool, virStorageBackendBuildVolFrom -virStorageBackendGetBuildVolFromFunction(virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol) +virStorageBackendGetBuildVolFromFunction(virStorageVolDef *vol, + virStorageVolDef *inputvol) { if (!inputvol) return NULL; @@ -1528,7 +1528,7 @@ static struct diskType const disk_types[] = { * VIR_WARN of the issue). */ static int -virStorageBackendDetectBlockVolFormatFD(virStorageSourcePtr target, +virStorageBackendDetectBlockVolFormatFD(virStorageSource *target, int fd, unsigned int readflags) { @@ -1751,7 +1751,7 @@ storageBackendIsPloopDir(char *path) * virStorageBackendUpdateVolTargetFd once again. */ static int -storageBackendRedoPloopUpdate(virStorageSourcePtr target, struct stat *sb, +storageBackendRedoPloopUpdate(virStorageSource *target, struct stat *sb, int *fd, unsigned int flags) { g_autofree char *path = NULL; @@ -1779,7 +1779,7 @@ storageBackendRedoPloopUpdate(virStorageSourcePtr target, struct stat *sb, */ static int storageBackendUpdateVolTargetInfo(virStorageVolType voltype, - virStorageSourcePtr target, + virStorageSource *target, bool withBlockVolFormat, unsigned int openflags, unsigned int readflags) @@ -1850,7 +1850,7 @@ storageBackendUpdateVolTargetInfo(virStorageVolType voltype, * open error occurred. It is up to the caller to handle. */ int -virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol, +virStorageBackendUpdateVolInfo(virStorageVolDef *vol, bool withBlockVolFormat, unsigned int openflags, unsigned int readflags) @@ -1884,7 +1884,7 @@ virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol, * Returns 0 for success, -1 on a legitimate error condition. */ int -virStorageBackendUpdateVolTargetInfoFD(virStorageSourcePtr target, +virStorageBackendUpdateVolTargetInfoFD(virStorageSource *target, int fd, struct stat *sb) { @@ -1973,11 +1973,11 @@ virStorageBackendPoolPathIsStable(const char *path) * a change to appear. */ char * -virStorageBackendStablePath(virStoragePoolObjPtr pool, +virStorageBackendStablePath(virStoragePoolObj *pool, const char *devpath, bool loop) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autoptr(DIR) dh = NULL; struct dirent *dent; char *stablepath; @@ -2044,12 +2044,12 @@ virStorageBackendStablePath(virStoragePoolObjPtr pool, /* Common/Local File System/Directory Volume API's */ static int -createFileDir(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +createFileDir(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); mode_t permmode = VIR_STORAGE_DEFAULT_VOL_PERM_MODE; unsigned int createflags = 0; @@ -2093,10 +2093,10 @@ createFileDir(virStoragePoolObjPtr pool, * function), and can drop the parent pool lock during the (slow) allocation. */ int -virStorageBackendVolCreateLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol) +virStorageBackendVolCreateLocal(virStoragePoolObj *pool, + virStorageVolDef *vol) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); if (vol->target.format == VIR_STORAGE_FILE_DIR) vol->type = VIR_STORAGE_VOL_DIR; @@ -2130,9 +2130,9 @@ virStorageBackendVolCreateLocal(virStoragePoolObjPtr pool, static int -storageBackendVolBuildLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +storageBackendVolBuildLocal(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags) { virStorageBackendBuildVolFrom create_func; @@ -2164,8 +2164,8 @@ storageBackendVolBuildLocal(virStoragePoolObjPtr pool, * special kinds of files */ int -virStorageBackendVolBuildLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendVolBuildLocal(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int flags) { return storageBackendVolBuildLocal(pool, vol, NULL, flags); @@ -2176,9 +2176,9 @@ virStorageBackendVolBuildLocal(virStoragePoolObjPtr pool, * Create a storage vol using 'inputvol' as input */ int -virStorageBackendVolBuildFromLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +virStorageBackendVolBuildFromLocal(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags) { return storageBackendVolBuildLocal(pool, vol, inputvol, flags); @@ -2189,8 +2189,8 @@ virStorageBackendVolBuildFromLocal(virStoragePoolObjPtr pool, * Remove a volume - no support for BLOCK and NETWORK yet */ int -virStorageBackendVolDeleteLocal(virStoragePoolObjPtr pool G_GNUC_UNUSED, - virStorageVolDefPtr vol, +virStorageBackendVolDeleteLocal(virStoragePoolObj *pool G_GNUC_UNUSED, + virStorageVolDef *vol, unsigned int flags) { virCheckFlags(0, -1); @@ -2241,10 +2241,10 @@ virStorageBackendVolDeleteLocal(virStoragePoolObjPtr pool G_GNUC_UNUSED, * -1 on failures w/ error message set */ static int -storageBackendLoadDefaultSecrets(virStorageVolDefPtr vol) +storageBackendLoadDefaultSecrets(virStorageVolDef *vol) { virSecretPtr sec; - virStorageEncryptionSecretPtr encsec = NULL; + virStorageEncryptionSecret *encsec = NULL; virConnectPtr conn = NULL; if (!vol->target.encryption || vol->target.encryption->nsecrets != 0) @@ -2267,7 +2267,7 @@ storageBackendLoadDefaultSecrets(virStorageVolDefPtr vol) if (!sec) return 0; - vol->target.encryption->secrets = g_new0(virStorageEncryptionSecretPtr, 1); + vol->target.encryption->secrets = g_new0(virStorageEncryptionSecret *, 1); encsec = g_new0(virStorageEncryptionSecret, 1); vol->target.encryption->nsecrets = 1; @@ -2286,8 +2286,8 @@ storageBackendLoadDefaultSecrets(virStorageVolDefPtr vol) * Update info about a volume's capacity/allocation */ int -virStorageBackendVolRefreshLocal(virStoragePoolObjPtr pool G_GNUC_UNUSED, - virStorageVolDefPtr vol) +virStorageBackendVolRefreshLocal(virStoragePoolObj *pool G_GNUC_UNUSED, + virStorageVolDef *vol) { int ret; @@ -2303,13 +2303,13 @@ virStorageBackendVolRefreshLocal(virStoragePoolObjPtr pool G_GNUC_UNUSED, static int -storageBackendResizeQemuImg(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +storageBackendResizeQemuImg(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned long long capacity) { int ret = -1; const char *type; - virStorageEncryptionPtr enc = vol->target.encryption; + virStorageEncryption *enc = vol->target.encryption; g_autoptr(virCommand) cmd = NULL; g_autofree char *img_tool = NULL; g_autofree char *secretPath = NULL; @@ -2385,8 +2385,8 @@ storageBackendResizeQemuImg(virStoragePoolObjPtr pool, * Resize a volume */ int -virStorageBackendVolResizeLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +virStorageBackendVolResizeLocal(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned long long capacity, unsigned int flags) { @@ -2457,8 +2457,8 @@ storageBackendPloopHasSnapshots(char *path) int -virStorageBackendVolUploadLocal(virStoragePoolObjPtr pool G_GNUC_UNUSED, - virStorageVolDefPtr vol, +virStorageBackendVolUploadLocal(virStoragePoolObj *pool G_GNUC_UNUSED, + virStorageVolDef *vol, virStreamPtr stream, unsigned long long offset, unsigned long long len, @@ -2496,8 +2496,8 @@ virStorageBackendVolUploadLocal(virStoragePoolObjPtr pool G_GNUC_UNUSED, } int -virStorageBackendVolDownloadLocal(virStoragePoolObjPtr pool G_GNUC_UNUSED, - virStorageVolDefPtr vol, +virStorageBackendVolDownloadLocal(virStoragePoolObj *pool G_GNUC_UNUSED, + virStorageVolDef *vol, virStreamPtr stream, unsigned long long offset, unsigned long long len, @@ -2712,7 +2712,7 @@ storageBackendVolWipeLocalFile(const char *path, static int -storageBackendVolWipePloop(virStorageVolDefPtr vol, +storageBackendVolWipePloop(virStorageVolDef *vol, unsigned int algorithm) { g_autoptr(virCommand) cmd = NULL; @@ -2757,8 +2757,8 @@ storageBackendVolWipePloop(virStorageVolDefPtr vol, int -virStorageBackendVolWipeLocal(virStoragePoolObjPtr pool G_GNUC_UNUSED, - virStorageVolDefPtr vol, +virStorageBackendVolWipeLocal(virStoragePoolObj *pool G_GNUC_UNUSED, + virStorageVolDef *vol, unsigned int algorithm, unsigned int flags) { @@ -2789,9 +2789,9 @@ virStorageBackendVolWipeLocal(virStoragePoolObjPtr pool G_GNUC_UNUSED, * Returns 0 on success, -1 on failure */ int -virStorageBackendBuildLocal(virStoragePoolObjPtr pool) +virStorageBackendBuildLocal(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); char *p = NULL; mode_t mode; bool needs_create_as_uid; @@ -2856,10 +2856,10 @@ virStorageBackendBuildLocal(virStoragePoolObjPtr pool) * Returns 0 on success, -1 on error */ int -virStorageBackendDeleteLocal(virStoragePoolObjPtr pool, +virStorageBackendDeleteLocal(virStoragePoolObj *pool, unsigned int flags) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); virCheckFlags(0, -1); @@ -2879,7 +2879,7 @@ virStorageBackendDeleteLocal(virStoragePoolObjPtr pool, int virStorageUtilGlusterExtractPoolSources(const char *host, const char *xml, - virStoragePoolSourceListPtr list, + virStoragePoolSourceList *list, virStoragePoolType pooltype) { xmlDocPtr doc = NULL; @@ -2955,7 +2955,7 @@ virStorageUtilGlusterExtractPoolSources(const char *host, int virStorageBackendFindGlusterPoolSources(const char *host, virStoragePoolType pooltype, - virStoragePoolSourceListPtr list, + virStoragePoolSourceList *list, bool report) { int rc; @@ -3399,8 +3399,8 @@ virStorageBackendDeviceIsEmpty(const char *devpath, static int -storageBackendProbeTarget(virStorageSourcePtr target, - virStorageEncryptionPtr *encryption) +storageBackendProbeTarget(virStorageSource *target, + virStorageEncryption **encryption) { int rc; struct stat sb; @@ -3508,7 +3508,7 @@ storageBackendProbeTarget(virStorageSourcePtr target, * Returns 0 on success, -2 to ignore failure, -1 on failure */ int -virStorageBackendRefreshVolTargetUpdate(virStorageVolDefPtr vol) +virStorageBackendRefreshVolTargetUpdate(virStorageVolDef *vol) { int err; @@ -3556,9 +3556,9 @@ virStorageBackendRefreshVolTargetUpdate(virStorageVolDefPtr vol) * within it. This is non-recursive. */ int -virStorageBackendRefreshLocal(virStoragePoolObjPtr pool) +virStorageBackendRefreshLocal(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); g_autoptr(DIR) dir = NULL; struct dirent *ent; struct statvfs sb; @@ -3683,14 +3683,14 @@ virStorageBackendSCSISerial(const char *dev, * -2 => Failure to find a stable path, not fatal, caller can try another */ static int -virStorageBackendSCSINewLun(virStoragePoolObjPtr pool, +virStorageBackendSCSINewLun(virStoragePoolObj *pool, uint32_t host G_GNUC_UNUSED, uint32_t bus, uint32_t target, uint32_t lun, const char *dev) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); int retval = -1; g_autoptr(virStorageVolDef) vol = NULL; g_autofree char *devpath = NULL; @@ -3949,7 +3949,7 @@ getDeviceType(uint32_t host, * -2 => non-fatal error or a non-disk entry */ static int -processLU(virStoragePoolObjPtr pool, +processLU(virStoragePoolObj *pool, uint32_t host, uint32_t bus, uint32_t target, @@ -4000,10 +4000,10 @@ processLU(virStoragePoolObjPtr pool, int -virStorageBackendSCSIFindLUs(virStoragePoolObjPtr pool, +virStorageBackendSCSIFindLUs(virStoragePoolObj *pool, uint32_t scanhost) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); int retval = 0; uint32_t bus, target, lun; const char *device_path = "/sys/bus/scsi/devices"; @@ -4079,9 +4079,9 @@ virStorageBackendZeroPartitionTable(const char *path, * It is up to the caller to VIR_FREE the allocated string */ char * -virStorageBackendFileSystemGetPoolSource(virStoragePoolObjPtr pool) +virStorageBackendFileSystemGetPoolSource(virStoragePoolObj *pool) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(pool); + virStoragePoolDef *def = virStoragePoolObjGetDef(pool); char *src = NULL; if (def->type == VIR_STORAGE_POOL_NETFS) { @@ -4100,8 +4100,8 @@ virStorageBackendFileSystemGetPoolSource(virStoragePoolObjPtr pool) static void -virStorageBackendFileSystemMountAddOptions(virCommandPtr cmd, - virStoragePoolDefPtr def, +virStorageBackendFileSystemMountAddOptions(virCommand *cmd, + virStoragePoolDef *def, const char *providedOpts) { g_autofree char *mountOpts = NULL; @@ -4115,7 +4115,7 @@ virStorageBackendFileSystemMountAddOptions(virCommandPtr cmd, if (def->namespaceData) { size_t i; - virStoragePoolFSMountOptionsDefPtr opts = def->namespaceData; + virStoragePoolFSMountOptionsDef *opts = def->namespaceData; char uuidstr[VIR_UUID_STRING_BUFLEN]; for (i = 0; i < opts->noptions; i++) @@ -4135,9 +4135,9 @@ virStorageBackendFileSystemMountAddOptions(virCommandPtr cmd, static void -virStorageBackendFileSystemMountNFSArgs(virCommandPtr cmd, +virStorageBackendFileSystemMountNFSArgs(virCommand *cmd, const char *src, - virStoragePoolDefPtr def, + virStoragePoolDef *def, const char *nfsVers) { virStorageBackendFileSystemMountAddOptions(cmd, def, nfsVers); @@ -4146,9 +4146,9 @@ virStorageBackendFileSystemMountNFSArgs(virCommandPtr cmd, static void -virStorageBackendFileSystemMountGlusterArgs(virCommandPtr cmd, +virStorageBackendFileSystemMountGlusterArgs(virCommand *cmd, const char *src, - virStoragePoolDefPtr def) + virStoragePoolDef *def) { const char *fmt; @@ -4159,9 +4159,9 @@ virStorageBackendFileSystemMountGlusterArgs(virCommandPtr cmd, static void -virStorageBackendFileSystemMountCIFSArgs(virCommandPtr cmd, +virStorageBackendFileSystemMountCIFSArgs(virCommand *cmd, const char *src, - virStoragePoolDefPtr def) + virStoragePoolDef *def) { const char *fmt; @@ -4172,9 +4172,9 @@ virStorageBackendFileSystemMountCIFSArgs(virCommandPtr cmd, static void -virStorageBackendFileSystemMountDefaultArgs(virCommandPtr cmd, +virStorageBackendFileSystemMountDefaultArgs(virCommand *cmd, const char *src, - virStoragePoolDefPtr def, + virStoragePoolDef *def, const char *nfsVers) { const char *fmt; @@ -4188,9 +4188,9 @@ virStorageBackendFileSystemMountDefaultArgs(virCommandPtr cmd, } -virCommandPtr +virCommand * virStorageBackendFileSystemMountCmd(const char *cmdstr, - virStoragePoolDefPtr def, + virStoragePoolDef *def, const char *src) { /* 'mount -t auto' doesn't seem to auto determine nfs (or cifs), @@ -4202,7 +4202,7 @@ virStorageBackendFileSystemMountCmd(const char *cmdstr, def->source.format == VIR_STORAGE_POOL_NETFS_GLUSTERFS); bool cifsfs = (def->type == VIR_STORAGE_POOL_NETFS && def->source.format == VIR_STORAGE_POOL_NETFS_CIFS); - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; g_autofree char *nfsVers = NULL; if (def->type == VIR_STORAGE_POOL_NETFS && def->source.protocolVer > 0) @@ -4221,9 +4221,9 @@ virStorageBackendFileSystemMountCmd(const char *cmdstr, } -virCommandPtr +virCommand * virStorageBackendLogicalChangeCmd(const char *cmdstr, - virStoragePoolDefPtr def, + virStoragePoolDef *def, bool on) { return virCommandNewArgList(cmdstr, diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h index 18c4cf85f3..aa3c25e9fc 100644 --- a/src/storage/storage_util.h +++ b/src/storage/storage_util.h @@ -28,7 +28,6 @@ /* Storage Pool Namespace options to share w/ storage_backend_fs.c and * the virStorageBackendFileSystemMountCmd method */ typedef struct _virStoragePoolFSMountOptionsDef virStoragePoolFSMountOptionsDef; -typedef virStoragePoolFSMountOptionsDef *virStoragePoolFSMountOptionsDefPtr; struct _virStoragePoolFSMountOptionsDef { size_t noptions; char **options; @@ -36,82 +35,82 @@ struct _virStoragePoolFSMountOptionsDef { int virStorageBackendNamespaceInit(int poolType, - virXMLNamespacePtr xmlns); + virXMLNamespace *xmlns); /* File creation/cloning functions used for cloning between backends */ int -virStorageBackendCreateVolUsingQemuImg(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +virStorageBackendCreateVolUsingQemuImg(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags); virStorageBackendBuildVolFrom -virStorageBackendGetBuildVolFromFunction(virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol); +virStorageBackendGetBuildVolFromFunction(virStorageVolDef *vol, + virStorageVolDef *inputvol); -int virStorageBackendVolCreateLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol); +int virStorageBackendVolCreateLocal(virStoragePoolObj *pool, + virStorageVolDef *vol); -int virStorageBackendVolBuildLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +int virStorageBackendVolBuildLocal(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int flags); -int virStorageBackendVolBuildFromLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +int virStorageBackendVolBuildFromLocal(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags); -int virStorageBackendVolDeleteLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +int virStorageBackendVolDeleteLocal(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int flags); -int virStorageBackendVolRefreshLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol); +int virStorageBackendVolRefreshLocal(virStoragePoolObj *pool, + virStorageVolDef *vol); -int virStorageBackendVolResizeLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +int virStorageBackendVolResizeLocal(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned long long capacity, unsigned int flags); -int virStorageBackendVolUploadLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +int virStorageBackendVolUploadLocal(virStoragePoolObj *pool, + virStorageVolDef *vol, virStreamPtr stream, unsigned long long offset, unsigned long long len, unsigned int flags); -int virStorageBackendVolDownloadLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +int virStorageBackendVolDownloadLocal(virStoragePoolObj *pool, + virStorageVolDef *vol, virStreamPtr stream, unsigned long long offset, unsigned long long len, unsigned int flags); -int virStorageBackendVolWipeLocal(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, +int virStorageBackendVolWipeLocal(virStoragePoolObj *pool, + virStorageVolDef *vol, unsigned int algorithm, unsigned int flags); /* Local/Common Storage Pool Backend APIs */ -int virStorageBackendBuildLocal(virStoragePoolObjPtr pool); +int virStorageBackendBuildLocal(virStoragePoolObj *pool); -int virStorageBackendDeleteLocal(virStoragePoolObjPtr pool, +int virStorageBackendDeleteLocal(virStoragePoolObj *pool, unsigned int flags); int -virStorageBackendRefreshVolTargetUpdate(virStorageVolDefPtr vol); +virStorageBackendRefreshVolTargetUpdate(virStorageVolDef *vol); -int virStorageBackendRefreshLocal(virStoragePoolObjPtr pool); +int virStorageBackendRefreshLocal(virStoragePoolObj *pool); int virStorageUtilGlusterExtractPoolSources(const char *host, const char *xml, - virStoragePoolSourceListPtr list, + virStoragePoolSourceList *list, virStoragePoolType pooltype); int virStorageBackendFindGlusterPoolSources(const char *host, virStoragePoolType pooltype, - virStoragePoolSourceListPtr list, + virStoragePoolSourceList *list, bool report); bool virStorageBackendDeviceIsEmpty(const char *devpath, @@ -153,16 +152,16 @@ int virStorageBackendVolOpen(const char *path, struct stat *sb, #define VIR_STORAGE_DEFAULT_POOL_PERM_MODE 0711 #define VIR_STORAGE_DEFAULT_VOL_PERM_MODE 0600 -int virStorageBackendUpdateVolInfo(virStorageVolDefPtr vol, +int virStorageBackendUpdateVolInfo(virStorageVolDef *vol, bool withBlockVolFormat, unsigned int openflags, unsigned int readflags); -int virStorageBackendUpdateVolTargetInfoFD(virStorageSourcePtr target, +int virStorageBackendUpdateVolTargetInfoFD(virStorageSource *target, int fd, struct stat *sb); bool virStorageBackendPoolPathIsStable(const char *path); -char *virStorageBackendStablePath(virStoragePoolObjPtr pool, +char *virStorageBackendStablePath(virStoragePoolObj *pool, const char *devpath, bool loop); @@ -173,17 +172,17 @@ typedef enum { VIR_STORAGE_VOL_ENCRYPT_DONE, } virStorageVolEncryptConvertStep; -virCommandPtr -virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool, - virStorageVolDefPtr vol, - virStorageVolDefPtr inputvol, +virCommand * +virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObj *pool, + virStorageVolDef *vol, + virStorageVolDef *inputvol, unsigned int flags, const char *create_tool, const char *secretPath, const char *inputSecretPath, virStorageVolEncryptConvertStep convertStep); -int virStorageBackendSCSIFindLUs(virStoragePoolObjPtr pool, +int virStorageBackendSCSIFindLUs(virStoragePoolObj *pool, uint32_t scanhost); int @@ -191,14 +190,14 @@ virStorageBackendZeroPartitionTable(const char *path, unsigned long long size); char * -virStorageBackendFileSystemGetPoolSource(virStoragePoolObjPtr pool); +virStorageBackendFileSystemGetPoolSource(virStoragePoolObj *pool); -virCommandPtr +virCommand * virStorageBackendFileSystemMountCmd(const char *cmdstr, - virStoragePoolDefPtr def, + virStoragePoolDef *def, const char *src); -virCommandPtr +virCommand * virStorageBackendLogicalChangeCmd(const char *cmdstr, - virStoragePoolDefPtr def, + virStoragePoolDef *def, bool on); diff --git a/src/storage_file/storage_file_backend.c b/src/storage_file/storage_file_backend.c index 6e4b2f408b..d63b6a7502 100644 --- a/src/storage_file/storage_file_backend.c +++ b/src/storage_file/storage_file_backend.c @@ -39,7 +39,7 @@ VIR_LOG_INIT("storage.storage_source_backend"); #define VIR_STORAGE_BACKENDS_MAX 20 -static virStorageFileBackendPtr virStorageFileBackends[VIR_STORAGE_BACKENDS_MAX]; +static virStorageFileBackend *virStorageFileBackends[VIR_STORAGE_BACKENDS_MAX]; static size_t virStorageFileBackendsCount; #if WITH_STORAGE_DIR || WITH_STORAGE_FS || WITH_STORAGE_GLUSTER @@ -84,7 +84,7 @@ static int virStorageFileBackendOnceInit(void) VIR_ONCE_GLOBAL_INIT(virStorageFileBackend); int -virStorageFileBackendRegister(virStorageFileBackendPtr backend) +virStorageFileBackendRegister(virStorageFileBackend *backend) { VIR_DEBUG("Registering storage file backend '%s' protocol '%s'", virStorageTypeToString(backend->type), @@ -107,7 +107,7 @@ int virStorageFileBackendForType(int type, int protocol, bool required, - virStorageFileBackendPtr *backend) + virStorageFileBackend **backend) { size_t i; diff --git a/src/storage_file/storage_file_backend.h b/src/storage_file/storage_file_backend.h index 8ad579a8db..0d54956082 100644 --- a/src/storage_file/storage_file_backend.h +++ b/src/storage_file/storage_file_backend.h @@ -26,12 +26,10 @@ /* ------- virStorageFile backends ------------ */ typedef struct _virStorageFileBackend virStorageFileBackend; -typedef virStorageFileBackend *virStorageFileBackendPtr; typedef struct _virStorageDriverData virStorageDriverData; -typedef virStorageDriverData *virStorageDriverDataPtr; struct _virStorageDriverData { - virStorageFileBackendPtr backend; + virStorageFileBackend *backend; void *priv; uid_t uid; @@ -39,29 +37,29 @@ struct _virStorageDriverData { }; typedef int -(*virStorageFileBackendInit)(virStorageSourcePtr src); +(*virStorageFileBackendInit)(virStorageSource *src); typedef void -(*virStorageFileBackendDeinit)(virStorageSourcePtr src); +(*virStorageFileBackendDeinit)(virStorageSource *src); typedef int -(*virStorageFileBackendCreate)(virStorageSourcePtr src); +(*virStorageFileBackendCreate)(virStorageSource *src); typedef int -(*virStorageFileBackendUnlink)(virStorageSourcePtr src); +(*virStorageFileBackendUnlink)(virStorageSource *src); typedef int -(*virStorageFileBackendStat)(virStorageSourcePtr src, +(*virStorageFileBackendStat)(virStorageSource *src, struct stat *st); typedef ssize_t -(*virStorageFileBackendRead)(virStorageSourcePtr src, +(*virStorageFileBackendRead)(virStorageSource *src, size_t offset, size_t len, char **buf); typedef int -(*virStorageFileBackendAccess)(virStorageSourcePtr src, +(*virStorageFileBackendAccess)(virStorageSource *src, int mode); typedef int @@ -72,7 +70,7 @@ typedef int int virStorageFileBackendForType(int type, int protocol, bool required, - virStorageFileBackendPtr *backend); + virStorageFileBackend **backend); struct _virStorageFileBackend { int type; @@ -95,4 +93,4 @@ struct _virStorageFileBackend { virStorageFileBackendChown storageFileChown; }; -int virStorageFileBackendRegister(virStorageFileBackendPtr backend); +int virStorageFileBackendRegister(virStorageFileBackend *backend); diff --git a/src/storage_file/storage_file_backend_fs.c b/src/storage_file/storage_file_backend_fs.c index 8422543057..581261f1cc 100644 --- a/src/storage_file/storage_file_backend_fs.c +++ b/src/storage_file/storage_file_backend_fs.c @@ -41,7 +41,7 @@ VIR_LOG_INIT("storage.storage_backend_fs"); static void -virStorageFileBackendFileDeinit(virStorageSourcePtr src) +virStorageFileBackendFileDeinit(virStorageSource *src) { VIR_DEBUG("deinitializing FS storage file %p (%s:%s)", src, virStorageTypeToString(virStorageSourceGetActualType(src)), @@ -50,9 +50,9 @@ virStorageFileBackendFileDeinit(virStorageSourcePtr src) static int -virStorageFileBackendFileInit(virStorageSourcePtr src) +virStorageFileBackendFileInit(virStorageSource *src) { - virStorageDriverDataPtr drv = src->drv; + virStorageDriverData *drv = src->drv; VIR_DEBUG("initializing FS storage file %p (%s:%s)[%u:%u]", src, virStorageTypeToString(virStorageSourceGetActualType(src)), @@ -64,9 +64,9 @@ virStorageFileBackendFileInit(virStorageSourcePtr src) static int -virStorageFileBackendFileCreate(virStorageSourcePtr src) +virStorageFileBackendFileCreate(virStorageSource *src) { - virStorageDriverDataPtr drv = src->drv; + virStorageDriverData *drv = src->drv; VIR_AUTOCLOSE fd = -1; if ((fd = virFileOpenAs(src->path, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR, @@ -80,14 +80,14 @@ virStorageFileBackendFileCreate(virStorageSourcePtr src) static int -virStorageFileBackendFileUnlink(virStorageSourcePtr src) +virStorageFileBackendFileUnlink(virStorageSource *src) { return unlink(src->path); } static int -virStorageFileBackendFileStat(virStorageSourcePtr src, +virStorageFileBackendFileStat(virStorageSource *src, struct stat *st) { return stat(src->path, st); @@ -95,12 +95,12 @@ virStorageFileBackendFileStat(virStorageSourcePtr src, static ssize_t -virStorageFileBackendFileRead(virStorageSourcePtr src, +virStorageFileBackendFileRead(virStorageSource *src, size_t offset, size_t len, char **buf) { - virStorageDriverDataPtr drv = src->drv; + virStorageDriverData *drv = src->drv; ssize_t ret = -1; VIR_AUTOCLOSE fd = -1; @@ -128,10 +128,10 @@ virStorageFileBackendFileRead(virStorageSourcePtr src, static int -virStorageFileBackendFileAccess(virStorageSourcePtr src, +virStorageFileBackendFileAccess(virStorageSource *src, int mode) { - virStorageDriverDataPtr drv = src->drv; + virStorageDriverData *drv = src->drv; return virFileAccessibleAs(src->path, mode, drv->uid, drv->gid); diff --git a/src/storage_file/storage_file_backend_gluster.c b/src/storage_file/storage_file_backend_gluster.c index 0cd4cf9f62..2aee61bf33 100644 --- a/src/storage_file/storage_file_backend_gluster.c +++ b/src/storage_file/storage_file_backend_gluster.c @@ -37,17 +37,15 @@ VIR_LOG_INIT("storage.storage_file_gluster"); typedef struct _virStorageFileBackendGlusterPriv virStorageFileBackendGlusterPriv; -typedef virStorageFileBackendGlusterPriv *virStorageFileBackendGlusterPrivPtr; - struct _virStorageFileBackendGlusterPriv { glfs_t *vol; }; static void -virStorageFileBackendGlusterDeinit(virStorageSourcePtr src) +virStorageFileBackendGlusterDeinit(virStorageSource *src) { - virStorageDriverDataPtr drv = src->drv; - virStorageFileBackendGlusterPrivPtr priv = drv->priv; + virStorageDriverData *drv = src->drv; + virStorageFileBackendGlusterPriv *priv = drv->priv; VIR_DEBUG("deinitializing gluster storage file %p (gluster://%s:%u/%s%s)", src, src->hosts->name, src->hosts->port, src->volume, src->path); @@ -60,8 +58,8 @@ virStorageFileBackendGlusterDeinit(virStorageSourcePtr src) } static int -virStorageFileBackendGlusterInitServer(virStorageFileBackendGlusterPrivPtr priv, - virStorageNetHostDefPtr host) +virStorageFileBackendGlusterInitServer(virStorageFileBackendGlusterPriv *priv, + virStorageNetHostDef *host) { const char *transport = virStorageNetHostTransportTypeToString(host->transport); const char *hoststr = NULL; @@ -97,10 +95,10 @@ virStorageFileBackendGlusterInitServer(virStorageFileBackendGlusterPrivPtr priv, static int -virStorageFileBackendGlusterInit(virStorageSourcePtr src) +virStorageFileBackendGlusterInit(virStorageSource *src) { - virStorageDriverDataPtr drv = src->drv; - virStorageFileBackendGlusterPrivPtr priv = NULL; + virStorageDriverData *drv = src->drv; + virStorageFileBackendGlusterPriv *priv = NULL; size_t i; if (!src->volume) { @@ -149,10 +147,10 @@ virStorageFileBackendGlusterInit(virStorageSourcePtr src) static int -virStorageFileBackendGlusterCreate(virStorageSourcePtr src) +virStorageFileBackendGlusterCreate(virStorageSource *src) { - virStorageDriverDataPtr drv = src->drv; - virStorageFileBackendGlusterPrivPtr priv = drv->priv; + virStorageDriverData *drv = src->drv; + virStorageFileBackendGlusterPriv *priv = drv->priv; glfs_fd_t *fd = NULL; if (!(fd = glfs_creat(priv->vol, src->path, @@ -165,34 +163,34 @@ virStorageFileBackendGlusterCreate(virStorageSourcePtr src) static int -virStorageFileBackendGlusterUnlink(virStorageSourcePtr src) +virStorageFileBackendGlusterUnlink(virStorageSource *src) { - virStorageDriverDataPtr drv = src->drv; - virStorageFileBackendGlusterPrivPtr priv = drv->priv; + virStorageDriverData *drv = src->drv; + virStorageFileBackendGlusterPriv *priv = drv->priv; return glfs_unlink(priv->vol, src->path); } static int -virStorageFileBackendGlusterStat(virStorageSourcePtr src, +virStorageFileBackendGlusterStat(virStorageSource *src, struct stat *st) { - virStorageDriverDataPtr drv = src->drv; - virStorageFileBackendGlusterPrivPtr priv = drv->priv; + virStorageDriverData *drv = src->drv; + virStorageFileBackendGlusterPriv *priv = drv->priv; return glfs_stat(priv->vol, src->path, st); } static ssize_t -virStorageFileBackendGlusterRead(virStorageSourcePtr src, +virStorageFileBackendGlusterRead(virStorageSource *src, size_t offset, size_t len, char **buf) { - virStorageDriverDataPtr drv = src->drv; - virStorageFileBackendGlusterPrivPtr priv = drv->priv; + virStorageDriverData *drv = src->drv; + virStorageFileBackendGlusterPriv *priv = drv->priv; glfs_fd_t *fd = NULL; ssize_t ret = -1; char *s; @@ -244,11 +242,11 @@ virStorageFileBackendGlusterRead(virStorageSourcePtr src, static int -virStorageFileBackendGlusterAccess(virStorageSourcePtr src, +virStorageFileBackendGlusterAccess(virStorageSource *src, int mode) { - virStorageDriverDataPtr drv = src->drv; - virStorageFileBackendGlusterPrivPtr priv = drv->priv; + virStorageDriverData *drv = src->drv; + virStorageFileBackendGlusterPriv *priv = drv->priv; return glfs_access(priv->vol, src->path, mode); } @@ -258,8 +256,8 @@ virStorageFileBackendGlusterChown(const virStorageSource *src, uid_t uid, gid_t gid) { - virStorageDriverDataPtr drv = src->drv; - virStorageFileBackendGlusterPrivPtr priv = drv->priv; + virStorageDriverData *drv = src->drv; + virStorageFileBackendGlusterPriv *priv = drv->priv; return glfs_chown(priv->vol, src->path, uid, gid); } diff --git a/src/storage_file/storage_file_probe.c b/src/storage_file/storage_file_probe.c index 29baa0596f..afe64da02e 100644 --- a/src/storage_file/storage_file_probe.c +++ b/src/storage_file/storage_file_probe.c @@ -97,7 +97,7 @@ struct FileTypeInfo { const struct FileEncryptionInfo *cryptInfo; /* Encryption info */ int (*getBackingStore)(char **res, int *format, const char *buf, size_t buf_size); - int (*getFeatures)(virBitmapPtr *features, int format, + int (*getFeatures)(virBitmap **features, int format, char *buf, ssize_t len); }; @@ -106,7 +106,7 @@ static int cowGetBackingStore(char **, int *, const char *, size_t); static int qcowXGetBackingStore(char **, int *, const char *, size_t); -static int qcow2GetFeatures(virBitmapPtr *features, int format, +static int qcow2GetFeatures(virBitmap **features, int format, char *buf, ssize_t len); static int vmdk4GetBackingStore(char **, int *, const char *, size_t); @@ -724,13 +724,13 @@ virStorageFileProbeFormatFromBuf(const char *path, static int -qcow2GetFeatures(virBitmapPtr *features, +qcow2GetFeatures(virBitmap **features, int format, char *buf, ssize_t len) { int version = -1; - virBitmapPtr feat = NULL; + virBitmap *feat = NULL; uint64_t bits; size_t i; @@ -823,7 +823,7 @@ virStorageFileGetEncryptionPayloadOffset(const struct FileEncryptionInfo *info, * clean up any existing allocated memory which would be overwritten. */ int -virStorageFileProbeGetMetadata(virStorageSourcePtr meta, +virStorageFileProbeGetMetadata(virStorageSource *meta, char *buf, size_t len) { diff --git a/src/storage_file/storage_file_probe.h b/src/storage_file/storage_file_probe.h index 0d0ac38185..b1f533afd6 100644 --- a/src/storage_file/storage_file_probe.h +++ b/src/storage_file/storage_file_probe.h @@ -34,7 +34,7 @@ #define VIR_STORAGE_MAX_HEADER 0x8200 int -virStorageFileProbeGetMetadata(virStorageSourcePtr meta, +virStorageFileProbeGetMetadata(virStorageSource *meta, char *buf, size_t len); diff --git a/src/storage_file/storage_source.c b/src/storage_file/storage_source.c index 746a3446d8..4246ede04b 100644 --- a/src/storage_file/storage_source.c +++ b/src/storage_file/storage_source.c @@ -78,7 +78,7 @@ virStorageSourceBackinStoreStringIsRelative(const char *backing) } -static virStorageSourcePtr +static virStorageSource * virStorageSourceMetadataNew(const char *path, int format) { @@ -115,13 +115,13 @@ virStorageSourceMetadataNew(const char *path, * * Caller MUST free the result after use via virObjectUnref. */ -virStorageSourcePtr +virStorageSource * virStorageSourceGetMetadataFromBuf(const char *path, char *buf, size_t len, int format) { - virStorageSourcePtr ret = NULL; + virStorageSource *ret = NULL; if (!(ret = virStorageSourceMetadataNew(path, format))) return NULL; @@ -148,7 +148,7 @@ virStorageSourceGetMetadataFromBuf(const char *path, * * Caller MUST free the result after use via virObjectUnref. */ -virStorageSourcePtr +virStorageSource * virStorageSourceGetMetadataFromFD(const char *path, int fd, int format) @@ -218,14 +218,14 @@ virStorageSourceGetMetadataFromFD(const char *path, * - "/path/to/file": Literal path is matched. Symlink resolution is attempted * if the filename doesn't string-match with the path. */ -virStorageSourcePtr -virStorageSourceChainLookup(virStorageSourcePtr chain, - virStorageSourcePtr startFrom, +virStorageSource * +virStorageSourceChainLookup(virStorageSource *chain, + virStorageSource *startFrom, const char *name, const char *diskTarget, - virStorageSourcePtr *parent) + virStorageSource **parent) { - virStorageSourcePtr prev; + virStorageSource *prev; const char *start = chain->path; bool nameIsFile = virStorageSourceBackinStoreStringIsFile(name); g_autofree char *target = NULL; @@ -324,8 +324,8 @@ virStorageSourceChainLookup(virStorageSourcePtr chain, } -static virStorageSourcePtr -virStorageSourceNewFromBackingRelative(virStorageSourcePtr parent, +static virStorageSource * +virStorageSourceNewFromBackingRelative(virStorageSource *parent, const char *rel) { g_autofree char *dirname = NULL; @@ -377,7 +377,7 @@ virStorageSourceNewFromBackingRelative(virStorageSourcePtr parent, */ int virStorageSourceNewFromBackingAbsolute(const char *path, - virStorageSourcePtr *src) + virStorageSource **src) { const char *json; const char *dirpath; @@ -448,9 +448,9 @@ virStorageSourceNewFromBackingAbsolute(const char *path, * error is reported. */ static int -virStorageSourceNewFromChild(virStorageSourcePtr parent, +virStorageSourceNewFromChild(virStorageSource *parent, const char *parentRaw, - virStorageSourcePtr *child) + virStorageSource **child) { struct stat st; g_autoptr(virStorageSource) def = NULL; @@ -490,8 +490,8 @@ virStorageSourceNewFromChild(virStorageSourcePtr parent, int -virStorageSourceNewFromBacking(virStorageSourcePtr parent, - virStorageSourcePtr *backing) +virStorageSourceNewFromBacking(virStorageSource *parent, + virStorageSource **backing) { int rc; @@ -518,7 +518,7 @@ virStorageSourceNewFromBacking(virStorageSourcePtr parent, * Returns 0 on success, -1 on error. No libvirt errors are reported. */ int -virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src, +virStorageSourceUpdatePhysicalSize(virStorageSource *src, int fd, struct stat const *sb) { @@ -567,7 +567,7 @@ virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src, * Returns 0 on success, -1 on error. */ int -virStorageSourceUpdateBackingSizes(virStorageSourcePtr src, +virStorageSourceUpdateBackingSizes(virStorageSource *src, int fd, struct stat const *sb) { @@ -630,7 +630,7 @@ virStorageSourceUpdateBackingSizes(virStorageSourcePtr src, * Returns 0 on success, -1 on error. */ int -virStorageSourceUpdateCapacity(virStorageSourcePtr src, +virStorageSourceUpdateCapacity(virStorageSource *src, char *buf, ssize_t len) { @@ -696,11 +696,11 @@ virStorageSourceRemoveLastPathComponent(const char *path) * Returns 0 on success; 1 if backing chain isn't relative and -1 on error. */ int -virStorageSourceGetRelativeBackingPath(virStorageSourcePtr top, - virStorageSourcePtr base, +virStorageSourceGetRelativeBackingPath(virStorageSource *top, + virStorageSource *base, char **relpath) { - virStorageSourcePtr next; + virStorageSource *next; g_autofree char *tmp = NULL; g_autofree char *path = NULL; @@ -747,7 +747,7 @@ virStorageSourceGetRelativeBackingPath(virStorageSourcePtr top, * path between two images. */ int -virStorageSourceFetchRelativeBackingPath(virStorageSourcePtr src, +virStorageSourceFetchRelativeBackingPath(virStorageSource *src, char **relPath) { ssize_t headerLen; @@ -806,7 +806,7 @@ virStorageSourceIsInitialized(const virStorageSource *src) */ static int virStorageSourceGetBackendForSupportCheck(const virStorageSource *src, - virStorageFileBackendPtr *backend) + virStorageFileBackend **backend) { int actualType; @@ -817,7 +817,7 @@ virStorageSourceGetBackendForSupportCheck(const virStorageSource *src, } if (src->drv) { - virStorageDriverDataPtr drv = src->drv; + virStorageDriverData *drv = src->drv; *backend = drv->backend; return 1; } @@ -837,7 +837,7 @@ virStorageSourceGetBackendForSupportCheck(const virStorageSource *src, int virStorageSourceSupportsBackingChainTraversal(const virStorageSource *src) { - virStorageFileBackendPtr backend; + virStorageFileBackend *backend; int rv; if ((rv = virStorageSourceGetBackendForSupportCheck(src, &backend)) < 1) @@ -859,7 +859,7 @@ virStorageSourceSupportsBackingChainTraversal(const virStorageSource *src) int virStorageSourceSupportsSecurityDriver(const virStorageSource *src) { - virStorageFileBackendPtr backend; + virStorageFileBackend *backend; int rv; if ((rv = virStorageSourceGetBackendForSupportCheck(src, &backend)) < 1) @@ -880,7 +880,7 @@ virStorageSourceSupportsSecurityDriver(const virStorageSource *src) int virStorageSourceSupportsAccess(const virStorageSource *src) { - virStorageFileBackendPtr backend; + virStorageFileBackend *backend; int rv; if ((rv = virStorageSourceGetBackendForSupportCheck(src, &backend)) < 1) @@ -900,7 +900,7 @@ virStorageSourceSupportsAccess(const virStorageSource *src) int virStorageSourceSupportsCreate(const virStorageSource *src) { - virStorageFileBackendPtr backend; + virStorageFileBackend *backend; int rv; if ((rv = virStorageSourceGetBackendForSupportCheck(src, &backend)) < 1) @@ -911,9 +911,9 @@ virStorageSourceSupportsCreate(const virStorageSource *src) void -virStorageSourceDeinit(virStorageSourcePtr src) +virStorageSourceDeinit(virStorageSource *src) { - virStorageDriverDataPtr drv = NULL; + virStorageDriverData *drv = NULL; if (!virStorageSourceIsInitialized(src)) return; @@ -942,11 +942,11 @@ virStorageSourceDeinit(virStorageSourcePtr src) * initialization failed. Libvirt error is reported. */ int -virStorageSourceInitAs(virStorageSourcePtr src, +virStorageSourceInitAs(virStorageSource *src, uid_t uid, gid_t gid) { int actualType = virStorageSourceGetActualType(src); - virStorageDriverDataPtr drv = g_new0(virStorageDriverData, 1); + virStorageDriverData *drv = g_new0(virStorageDriverData, 1); src->drv = drv; @@ -985,7 +985,7 @@ virStorageSourceInitAs(virStorageSourcePtr src, * current user. */ int -virStorageSourceInit(virStorageSourcePtr src) +virStorageSourceInit(virStorageSource *src) { return virStorageSourceInitAs(src, -1, -1); } @@ -1000,9 +1000,9 @@ virStorageSourceInit(virStorageSourcePtr src) * -1 on other failure. Errno is set in case of failure. */ int -virStorageSourceCreate(virStorageSourcePtr src) +virStorageSourceCreate(virStorageSource *src) { - virStorageDriverDataPtr drv = NULL; + virStorageDriverData *drv = NULL; int ret; if (!virStorageSourceIsInitialized(src)) { @@ -1037,9 +1037,9 @@ virStorageSourceCreate(virStorageSourcePtr src) * -1 on other failure. Errno is set in case of failure. */ int -virStorageSourceUnlink(virStorageSourcePtr src) +virStorageSourceUnlink(virStorageSource *src) { - virStorageDriverDataPtr drv = NULL; + virStorageDriverData *drv = NULL; int ret; if (!virStorageSourceIsInitialized(src)) { @@ -1073,10 +1073,10 @@ virStorageSourceUnlink(virStorageSourcePtr src) * -1 on other failure. Errno is set in case of failure. */ int -virStorageSourceStat(virStorageSourcePtr src, +virStorageSourceStat(virStorageSource *src, struct stat *st) { - virStorageDriverDataPtr drv = NULL; + virStorageDriverData *drv = NULL; int ret; if (!virStorageSourceIsInitialized(src)) { @@ -1113,12 +1113,12 @@ virStorageSourceStat(virStorageSourcePtr src, * Libvirt error is reported on failure. */ ssize_t -virStorageSourceRead(virStorageSourcePtr src, +virStorageSourceRead(virStorageSource *src, size_t offset, size_t len, char **buf) { - virStorageDriverDataPtr drv = NULL; + virStorageDriverData *drv = NULL; ssize_t ret; if (!virStorageSourceIsInitialized(src)) { @@ -1152,10 +1152,10 @@ virStorageSourceRead(virStorageSourcePtr src, * by libvirt storage backend. */ int -virStorageSourceAccess(virStorageSourcePtr src, +virStorageSourceAccess(virStorageSource *src, int mode) { - virStorageDriverDataPtr drv = NULL; + virStorageDriverData *drv = NULL; if (!virStorageSourceIsInitialized(src)) { errno = ENOSYS; @@ -1189,7 +1189,7 @@ virStorageSourceChown(const virStorageSource *src, uid_t uid, gid_t gid) { - virStorageDriverDataPtr drv = NULL; + virStorageDriverData *drv = NULL; if (!virStorageSourceIsInitialized(src)) { errno = ENOSYS; @@ -1222,11 +1222,11 @@ virStorageSourceChown(const virStorageSource *src, */ void virStorageSourceReportBrokenChain(int errcode, - virStorageSourcePtr src, - virStorageSourcePtr parent) + virStorageSource *src, + virStorageSource *parent) { if (src->drv) { - virStorageDriverDataPtr drv = src->drv; + virStorageDriverData *drv = src->drv; unsigned int access_user = drv->uid; unsigned int access_group = drv->gid; @@ -1257,8 +1257,8 @@ virStorageSourceReportBrokenChain(int errcode, static int -virStorageSourceGetMetadataRecurseReadHeader(virStorageSourcePtr src, - virStorageSourcePtr parent, +virStorageSourceGetMetadataRecurseReadHeader(virStorageSource *src, + virStorageSource *parent, uid_t uid, gid_t gid, char **buf, @@ -1289,8 +1289,8 @@ virStorageSourceGetMetadataRecurseReadHeader(virStorageSourcePtr src, /* Recursive workhorse for virStorageSourceGetMetadata. */ static int -virStorageSourceGetMetadataRecurse(virStorageSourcePtr src, - virStorageSourcePtr parent, +virStorageSourceGetMetadataRecurse(virStorageSource *src, + virStorageSource *parent, uid_t uid, gid_t gid, bool report_broken, size_t max_depth, @@ -1400,7 +1400,7 @@ virStorageSourceGetMetadataRecurse(virStorageSourcePtr src, * Caller MUST free result after use via virObjectUnref. */ int -virStorageSourceGetMetadata(virStorageSourcePtr src, +virStorageSourceGetMetadata(virStorageSource *src, uid_t uid, gid_t gid, size_t max_depth, bool report_broken) diff --git a/src/storage_file/storage_source.h b/src/storage_file/storage_source.h index 0e243f0116..5aaf4c356a 100644 --- a/src/storage_file/storage_source.h +++ b/src/storage_file/storage_source.h @@ -27,88 +27,88 @@ # define DEV_BSIZE 512 #endif -virStorageSourcePtr +virStorageSource * virStorageSourceGetMetadataFromFD(const char *path, int fd, int format); -virStorageSourcePtr +virStorageSource * virStorageSourceGetMetadataFromBuf(const char *path, char *buf, size_t len, int format) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -virStorageSourcePtr -virStorageSourceChainLookup(virStorageSourcePtr chain, - virStorageSourcePtr startFrom, +virStorageSource * +virStorageSourceChainLookup(virStorageSource *chain, + virStorageSource *startFrom, const char *name, const char *diskTarget, - virStorageSourcePtr *parent) + virStorageSource **parent) ATTRIBUTE_NONNULL(1); int -virStorageSourceUpdatePhysicalSize(virStorageSourcePtr src, +virStorageSourceUpdatePhysicalSize(virStorageSource *src, int fd, struct stat const *sb); int -virStorageSourceUpdateBackingSizes(virStorageSourcePtr src, +virStorageSourceUpdateBackingSizes(virStorageSource *src, int fd, struct stat const *sb); int -virStorageSourceUpdateCapacity(virStorageSourcePtr src, +virStorageSourceUpdateCapacity(virStorageSource *src, char *buf, ssize_t len); int -virStorageSourceNewFromBacking(virStorageSourcePtr parent, - virStorageSourcePtr *backing); +virStorageSourceNewFromBacking(virStorageSource *parent, + virStorageSource **backing); int virStorageSourceParseRBDColonString(const char *rbdstr, - virStorageSourcePtr src) + virStorageSource *src) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int -virStorageSourceGetRelativeBackingPath(virStorageSourcePtr top, - virStorageSourcePtr base, +virStorageSourceGetRelativeBackingPath(virStorageSource *top, + virStorageSource *base, char **relpath) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); int virStorageSourceNewFromBackingAbsolute(const char *path, - virStorageSourcePtr *src); + virStorageSource **src); int -virStorageSourceInit(virStorageSourcePtr src); +virStorageSourceInit(virStorageSource *src); int -virStorageSourceInitAs(virStorageSourcePtr src, +virStorageSourceInitAs(virStorageSource *src, uid_t uid, gid_t gid); void -virStorageSourceDeinit(virStorageSourcePtr src); +virStorageSourceDeinit(virStorageSource *src); int -virStorageSourceCreate(virStorageSourcePtr src); +virStorageSourceCreate(virStorageSource *src); int -virStorageSourceUnlink(virStorageSourcePtr src); +virStorageSourceUnlink(virStorageSource *src); int -virStorageSourceStat(virStorageSourcePtr src, +virStorageSourceStat(virStorageSource *src, struct stat *st); ssize_t -virStorageSourceRead(virStorageSourcePtr src, +virStorageSourceRead(virStorageSource *src, size_t offset, size_t len, char **buf); int -virStorageSourceAccess(virStorageSourcePtr src, +virStorageSourceAccess(virStorageSource *src, int mode); int @@ -129,18 +129,18 @@ int virStorageSourceSupportsBackingChainTraversal(const virStorageSource *src); int -virStorageSourceGetMetadata(virStorageSourcePtr src, +virStorageSourceGetMetadata(virStorageSource *src, uid_t uid, gid_t gid, size_t max_depth, bool report_broken) ATTRIBUTE_NONNULL(1); int -virStorageSourceFetchRelativeBackingPath(virStorageSourcePtr src, +virStorageSourceFetchRelativeBackingPath(virStorageSource *src, char **relPath) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); void virStorageSourceReportBrokenChain(int errcode, - virStorageSourcePtr src, - virStorageSourcePtr parent); + virStorageSource *src, + virStorageSource *parent); diff --git a/src/storage_file/storage_source_backingstore.c b/src/storage_file/storage_source_backingstore.c index 9a67d64fd6..9021b9da0c 100644 --- a/src/storage_file/storage_source_backingstore.c +++ b/src/storage_file/storage_source_backingstore.c @@ -37,7 +37,7 @@ VIR_LOG_INIT("storage_source_backingstore"); int -virStorageSourceParseBackingURI(virStorageSourcePtr src, +virStorageSourceParseBackingURI(virStorageSource *src, const char *uristr) { g_autoptr(virURI) uri = NULL; @@ -139,7 +139,7 @@ virStorageSourceParseBackingURI(virStorageSourcePtr src, static int -virStorageSourceRBDAddHost(virStorageSourcePtr src, +virStorageSourceRBDAddHost(virStorageSource *src, char *hostport) { char *port; @@ -182,7 +182,7 @@ virStorageSourceRBDAddHost(virStorageSourcePtr src, int virStorageSourceParseRBDColonString(const char *rbdstr, - virStorageSourcePtr src) + virStorageSource *src) { char *p, *e, *next; g_autofree char *options = NULL; @@ -286,7 +286,7 @@ virStorageSourceParseRBDColonString(const char *rbdstr, static int virStorageSourceParseNBDColonString(const char *nbdstr, - virStorageSourcePtr src) + virStorageSource *src) { g_autofree char *nbd = g_strdup(nbdstr); char *export_name; @@ -363,7 +363,7 @@ virStorageSourceParseNBDColonString(const char *nbdstr, int -virStorageSourceParseBackingColon(virStorageSourcePtr src, +virStorageSourceParseBackingColon(virStorageSource *src, const char *path) { const char *p; @@ -425,15 +425,15 @@ virStorageSourceParseBackingColon(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONInternal(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONInternal(virStorageSource *src, + virJSONValue *json, const char *jsonstr, bool allowformat); static int -virStorageSourceParseBackingJSONPath(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONPath(virStorageSource *src, + virJSONValue *json, const char *jsonstr G_GNUC_UNUSED, int type) { @@ -454,7 +454,7 @@ virStorageSourceParseBackingJSONPath(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONUriStr(virStorageSourcePtr src, +virStorageSourceParseBackingJSONUriStr(virStorageSource *src, const char *uri, int protocol) { @@ -477,8 +477,8 @@ virStorageSourceParseBackingJSONUriStr(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONUriCookies(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONUriCookies(virStorageSource *src, + virJSONValue *json, const char *jsonstr) { const char *cookiestr; @@ -499,7 +499,7 @@ virStorageSourceParseBackingJSONUriCookies(virStorageSourcePtr src, return -1; src->ncookies = g_strv_length(cookies); - src->cookies = g_new0(virStorageNetCookieDefPtr, src->ncookies); + src->cookies = g_new0(virStorageNetCookieDef *, src->ncookies); for (i = 0; i < src->ncookies; i++) { char *cookiename = cookies[i]; @@ -527,8 +527,8 @@ virStorageSourceParseBackingJSONUriCookies(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONUri(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONUri(virStorageSource *src, + virJSONValue *json, const char *jsonstr, int protocol) { @@ -590,8 +590,8 @@ virStorageSourceParseBackingJSONUri(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONInetSocketAddress(virStorageNetHostDefPtr host, - virJSONValuePtr json) +virStorageSourceParseBackingJSONInetSocketAddress(virStorageNetHostDef *host, + virJSONValue *json) { const char *hostname; const char *port; @@ -624,8 +624,8 @@ virStorageSourceParseBackingJSONInetSocketAddress(virStorageNetHostDefPtr host, static int -virStorageSourceParseBackingJSONSocketAddress(virStorageNetHostDefPtr host, - virJSONValuePtr json) +virStorageSourceParseBackingJSONSocketAddress(virStorageNetHostDef *host, + virJSONValue *json) { const char *type; const char *socket; @@ -676,15 +676,15 @@ virStorageSourceParseBackingJSONSocketAddress(virStorageNetHostDefPtr host, static int -virStorageSourceParseBackingJSONGluster(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONGluster(virStorageSource *src, + virJSONValue *json, const char *jsonstr G_GNUC_UNUSED, int opaque G_GNUC_UNUSED) { const char *uri = virJSONValueObjectGetString(json, "filename"); const char *volume = virJSONValueObjectGetString(json, "volume"); const char *path = virJSONValueObjectGetString(json, "path"); - virJSONValuePtr server = virJSONValueObjectGetArray(json, "server"); + virJSONValue *server = virJSONValueObjectGetArray(json, "server"); size_t nservers; size_t i; @@ -729,8 +729,8 @@ virStorageSourceParseBackingJSONGluster(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONiSCSI(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONiSCSI(virStorageSource *src, + virJSONValue *json, const char *jsonstr G_GNUC_UNUSED, int opaque G_GNUC_UNUSED) { @@ -797,8 +797,8 @@ virStorageSourceParseBackingJSONiSCSI(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONNbd(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONNbd(virStorageSource *src, + virJSONValue *json, const char *jsonstr G_GNUC_UNUSED, int opaque G_GNUC_UNUSED) { @@ -806,7 +806,7 @@ virStorageSourceParseBackingJSONNbd(virStorageSourcePtr src, const char *host = virJSONValueObjectGetString(json, "host"); const char *port = virJSONValueObjectGetString(json, "port"); const char *export = virJSONValueObjectGetString(json, "export"); - virJSONValuePtr server = virJSONValueObjectGetObject(json, "server"); + virJSONValue *server = virJSONValueObjectGetObject(json, "server"); if (!path && !host && !server) { virReportError(VIR_ERR_INVALID_ARG, "%s", @@ -844,14 +844,14 @@ virStorageSourceParseBackingJSONNbd(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONSheepdog(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONSheepdog(virStorageSource *src, + virJSONValue *json, const char *jsonstr G_GNUC_UNUSED, int opaque G_GNUC_UNUSED) { const char *filename; const char *vdi = virJSONValueObjectGetString(json, "vdi"); - virJSONValuePtr server = virJSONValueObjectGetObject(json, "server"); + virJSONValue *server = virJSONValueObjectGetObject(json, "server"); /* legacy URI based syntax passed via 'filename' option */ if ((filename = virJSONValueObjectGetString(json, "filename"))) { @@ -886,8 +886,8 @@ virStorageSourceParseBackingJSONSheepdog(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONSSH(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONSSH(virStorageSource *src, + virJSONValue *json, const char *jsonstr G_GNUC_UNUSED, int opaque G_GNUC_UNUSED) { @@ -896,7 +896,7 @@ virStorageSourceParseBackingJSONSSH(virStorageSourcePtr src, const char *port = virJSONValueObjectGetString(json, "port"); const char *user = virJSONValueObjectGetString(json, "user"); const char *host_key_check = virJSONValueObjectGetString(json, "host_key_check"); - virJSONValuePtr server = virJSONValueObjectGetObject(json, "server"); + virJSONValue *server = virJSONValueObjectGetObject(json, "server"); if (!(host || server) || !path) { virReportError(VIR_ERR_INVALID_ARG, "%s", @@ -935,8 +935,8 @@ virStorageSourceParseBackingJSONSSH(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONRBD(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONRBD(virStorageSource *src, + virJSONValue *json, const char *jsonstr G_GNUC_UNUSED, int opaque G_GNUC_UNUSED) { @@ -945,7 +945,7 @@ virStorageSourceParseBackingJSONRBD(virStorageSourcePtr src, const char *image = virJSONValueObjectGetString(json, "image"); const char *conf = virJSONValueObjectGetString(json, "conf"); const char *snapshot = virJSONValueObjectGetString(json, "snapshot"); - virJSONValuePtr servers = virJSONValueObjectGetArray(json, "server"); + virJSONValue *servers = virJSONValueObjectGetArray(json, "server"); size_t nservers; size_t i; @@ -985,14 +985,14 @@ virStorageSourceParseBackingJSONRBD(virStorageSourcePtr src, } static int -virStorageSourceParseBackingJSONRaw(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONRaw(virStorageSource *src, + virJSONValue *json, const char *jsonstr, int opaque G_GNUC_UNUSED) { bool has_offset = virJSONValueObjectHasKey(json, "offset"); bool has_size = virJSONValueObjectHasKey(json, "size"); - virJSONValuePtr file; + virJSONValue *file; if (has_offset || has_size) { src->sliceStorage = g_new0(virStorageSourceSlice, 1); @@ -1025,13 +1025,13 @@ virStorageSourceParseBackingJSONRaw(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONVxHS(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONVxHS(virStorageSource *src, + virJSONValue *json, const char *jsonstr G_GNUC_UNUSED, int opaque G_GNUC_UNUSED) { const char *vdisk_id = virJSONValueObjectGetString(json, "vdisk-id"); - virJSONValuePtr server = virJSONValueObjectGetObject(json, "server"); + virJSONValue *server = virJSONValueObjectGetObject(json, "server"); if (!vdisk_id || !server) { virReportError(VIR_ERR_INVALID_ARG, "%s", @@ -1057,12 +1057,12 @@ virStorageSourceParseBackingJSONVxHS(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONNFS(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONNFS(virStorageSource *src, + virJSONValue *json, const char *jsonstr G_GNUC_UNUSED, int opaque G_GNUC_UNUSED) { - virJSONValuePtr server = virJSONValueObjectGetObject(json, "server"); + virJSONValue *server = virJSONValueObjectGetObject(json, "server"); int uidStore = -1; int gidStore = -1; int gotUID = virJSONValueObjectGetNumberInt(json, "user", &uidStore); @@ -1105,8 +1105,8 @@ virStorageSourceParseBackingJSONNFS(virStorageSourcePtr src, static int -virStorageSourceParseBackingJSONNVMe(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONNVMe(virStorageSource *src, + virJSONValue *json, const char *jsonstr G_GNUC_UNUSED, int opaque G_GNUC_UNUSED) { @@ -1143,7 +1143,7 @@ struct virStorageSourceJSONDriverParser { * can't be converted to libvirt's configuration (e.g. inline authentication * credentials are present). */ - int (*func)(virStorageSourcePtr src, virJSONValuePtr json, const char *jsonstr, int opaque); + int (*func)(virStorageSource *src, virJSONValue *json, const char *jsonstr, int opaque); int opaque; }; @@ -1171,8 +1171,8 @@ static const struct virStorageSourceJSONDriverParser jsonParsers[] = { static int -virStorageSourceParseBackingJSONInternal(virStorageSourcePtr src, - virJSONValuePtr json, +virStorageSourceParseBackingJSONInternal(virStorageSource *src, + virJSONValue *json, const char *jsonstr, bool allowformat) { @@ -1208,12 +1208,12 @@ virStorageSourceParseBackingJSONInternal(virStorageSourcePtr src, int -virStorageSourceParseBackingJSON(virStorageSourcePtr src, +virStorageSourceParseBackingJSON(virStorageSource *src, const char *json) { g_autoptr(virJSONValue) root = NULL; g_autoptr(virJSONValue) deflattened = NULL; - virJSONValuePtr file = NULL; + virJSONValue *file = NULL; if (!(root = virJSONValueFromString(json))) return -1; diff --git a/src/storage_file/storage_source_backingstore.h b/src/storage_file/storage_source_backingstore.h index e51063e9e2..f5ec8e9154 100644 --- a/src/storage_file/storage_source_backingstore.h +++ b/src/storage_file/storage_source_backingstore.h @@ -24,17 +24,17 @@ #include "storage_source_conf.h" int -virStorageSourceParseBackingURI(virStorageSourcePtr src, +virStorageSourceParseBackingURI(virStorageSource *src, const char *uristr); int virStorageSourceParseRBDColonString(const char *rbdstr, - virStorageSourcePtr src); + virStorageSource *src); int -virStorageSourceParseBackingColon(virStorageSourcePtr src, +virStorageSourceParseBackingColon(virStorageSource *src, const char *path); int -virStorageSourceParseBackingJSON(virStorageSourcePtr src, +virStorageSourceParseBackingJSON(virStorageSource *src, const char *json); diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 3531011a81..15e9018803 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -81,51 +81,48 @@ struct _testCell { virCapsHostNUMACellCPU cpus[MAX_CPUS]; }; typedef struct _testCell testCell; -typedef struct _testCell *testCellPtr; struct _testAuth { char *username; char *password; }; typedef struct _testAuth testAuth; -typedef struct _testAuth *testAuthPtr; struct _testDriver { virObjectLockable parent; virNodeInfo nodeInfo; - virInterfaceObjListPtr ifaces; + virInterfaceObjList *ifaces; bool transaction_running; - virInterfaceObjListPtr backupIfaces; - virStoragePoolObjListPtr pools; - virNodeDeviceObjListPtr devs; + virInterfaceObjList *backupIfaces; + virStoragePoolObjList *pools; + virNodeDeviceObjList *devs; int numCells; testCell *cells; size_t numAuths; - testAuthPtr auths; + struct _testAuth *auths; /* g_atomic access only */ volatile int nextDomID; /* immutable pointer, immutable object after being initialized with * testBuildCapabilities */ - virCapsPtr caps; + virCaps *caps; /* immutable pointer, immutable object */ - virDomainXMLOptionPtr xmlopt; + virDomainXMLOption *xmlopt; /* immutable pointer, self-locking APIs */ - virDomainObjListPtr domains; - virNetworkObjListPtr networks; - virObjectEventStatePtr eventState; + virDomainObjList *domains; + virNetworkObjList *networks; + virObjectEventState *eventState; }; typedef struct _testDriver testDriver; -typedef testDriver *testDriverPtr; -static testDriverPtr defaultPrivconn; +static testDriver *defaultPrivconn; static virMutex defaultLock = VIR_MUTEX_INITIALIZER; -static virClassPtr testDriverClass; +static virClass *testDriverClass; static __thread bool testDriverDisposed; static void testDriverDispose(void *obj); static int testDriverOnceInit(void) @@ -154,7 +151,7 @@ static const virNodeInfo defaultNodeInfo = { static void testDriverDispose(void *obj) { - testDriverPtr driver = obj; + testDriver *driver = obj; size_t i; virObjectUnref(driver->caps); @@ -176,7 +173,6 @@ testDriverDispose(void *obj) } typedef struct _testDomainNamespaceDef testDomainNamespaceDef; -typedef testDomainNamespaceDef *testDomainNamespaceDefPtr; struct _testDomainNamespaceDef { int runstate; bool transient; @@ -189,7 +185,7 @@ struct _testDomainNamespaceDef { static void testDomainDefNamespaceFree(void *data) { - testDomainNamespaceDefPtr nsdata = data; + testDomainNamespaceDef *nsdata = data; size_t i; if (!nsdata) @@ -206,7 +202,7 @@ static int testDomainDefNamespaceParse(xmlXPathContextPtr ctxt, void **data) { - testDomainNamespaceDefPtr nsdata = NULL; + testDomainNamespaceDef *nsdata = NULL; int tmp, n; size_t i; unsigned int tmpuint; @@ -282,12 +278,12 @@ testDomainDefNamespaceParse(xmlXPathContextPtr ctxt, return -1; } -static virCapsPtr +static virCaps * testBuildCapabilities(virConnectPtr conn) { - testDriverPtr privconn = conn->privateData; - virCapsPtr caps; - virCapsGuestPtr guest; + testDriver *privconn = conn->privateData; + virCaps *caps; + virCapsGuest *guest; int guest_types[] = { VIR_DOMAIN_OSTYPE_HVM, VIR_DOMAIN_OSTYPE_XEN }; size_t i, j; @@ -311,8 +307,8 @@ testBuildCapabilities(virConnectPtr conn) caps->host.numa = virCapabilitiesHostNUMANew(); for (i = 0; i < privconn->numCells; i++) { - virCapsHostNUMACellCPUPtr cpu_cells; - virCapsHostNUMACellPageInfoPtr pages; + virCapsHostNUMACellCPU *cpu_cells; + virCapsHostNUMACellPageInfo *pages; size_t nPages = caps->host.nPagesSize - 1; cpu_cells = g_new0(virCapsHostNUMACellCPU, privconn->cells[i].numCpus); @@ -374,9 +370,8 @@ testBuildCapabilities(virConnectPtr conn) typedef struct _testDomainObjPrivate testDomainObjPrivate; -typedef testDomainObjPrivate *testDomainObjPrivatePtr; struct _testDomainObjPrivate { - testDriverPtr driver; + testDriver *driver; bool frozen[2]; /* used by file system related calls */ @@ -389,7 +384,7 @@ struct _testDomainObjPrivate { static void * testDomainObjPrivateAlloc(void *opaque) { - testDomainObjPrivatePtr priv; + testDomainObjPrivate *priv; priv = g_new0(testDomainObjPrivate, 1); @@ -404,7 +399,7 @@ testDomainObjPrivateAlloc(void *opaque) static int -testDomainDevicesDefPostParse(virDomainDeviceDefPtr dev G_GNUC_UNUSED, +testDomainDevicesDefPostParse(virDomainDeviceDef *dev G_GNUC_UNUSED, const virDomainDef *def G_GNUC_UNUSED, unsigned int parseFlags G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED, @@ -428,12 +423,12 @@ testDomainDevicesDefPostParse(virDomainDeviceDefPtr dev G_GNUC_UNUSED, static void testDomainObjPrivateFree(void *data) { - testDomainObjPrivatePtr priv = data; + testDomainObjPrivate *priv = data; g_free(priv); } -static testDriverPtr +static testDriver * testDriverNew(void) { virXMLNamespace ns = { @@ -456,7 +451,7 @@ testDriverNew(void) .alloc = testDomainObjPrivateAlloc, .free = testDomainObjPrivateFree, }; - testDriverPtr ret; + testDriver *ret; if (testDriverInitialize() < 0) return NULL; @@ -633,15 +628,15 @@ static const char *defaultPoolSourcesNetFSXML = static const unsigned long long defaultPoolCap = (100 * 1024 * 1024 * 1024ull); static const unsigned long long defaultPoolAlloc; -static int testStoragePoolObjSetDefaults(virStoragePoolObjPtr obj); +static int testStoragePoolObjSetDefaults(virStoragePoolObj *obj); static int testNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info); -static virNetworkObjPtr testNetworkObjFindByName(testDriverPtr privconn, const char *name); +static virNetworkObj *testNetworkObjFindByName(testDriver *privconn, const char *name); -static virDomainObjPtr +static virDomainObj * testDomObjFromDomain(virDomainPtr domain) { - virDomainObjPtr vm; - testDriverPtr driver = domain->conn->privateData; + virDomainObj *vm; + testDriver *driver = domain->conn->privateData; char uuidstr[VIR_UUID_STRING_BUFLEN]; vm = virDomainObjListFindByUUID(driver->domains, domain->uuid); @@ -656,13 +651,13 @@ testDomObjFromDomain(virDomainPtr domain) } static char * -testDomainGenerateIfname(virDomainDefPtr domdef) +testDomainGenerateIfname(virDomainDef *domdef) { int maxif = 1024; int ifctr; for (ifctr = 0; ifctr < maxif; ++ifctr) { - virDomainNetDefPtr net = NULL; + virDomainNetDef *net = NULL; char *ifname; ifname = g_strdup_printf("testnet%d", ifctr); @@ -679,7 +674,7 @@ testDomainGenerateIfname(virDomainDefPtr domdef) } static int -testDomainGenerateIfnames(virDomainDefPtr domdef) +testDomainGenerateIfnames(virDomainDef *domdef) { size_t i = 0; @@ -701,7 +696,7 @@ testDomainGenerateIfnames(virDomainDefPtr domdef) static void testDomainShutdownState(virDomainPtr domain, - virDomainObjPtr privdom, + virDomainObj *privdom, virDomainShutoffReason reason) { virDomainObjRemoveTransientDef(privdom); @@ -713,8 +708,8 @@ testDomainShutdownState(virDomainPtr domain, /* Set up domain runtime state */ static int -testDomainStartState(testDriverPtr privconn, - virDomainObjPtr dom, +testDomainStartState(testDriver *privconn, + virDomainObj *dom, virDomainRunningReason reason) { int ret = -1; @@ -865,19 +860,19 @@ testParseNodeInfo(virNodeInfoPtr nodeInfo, xmlXPathContextPtr ctxt) } static int -testParseDomainSnapshots(testDriverPtr privconn, - virDomainObjPtr domobj, +testParseDomainSnapshots(testDriver *privconn, + virDomainObj *domobj, const char *file, xmlXPathContextPtr ctxt) { size_t i; - testDomainNamespaceDefPtr nsdata = domobj->def->namespaceData; + testDomainNamespaceDef *nsdata = domobj->def->namespaceData; xmlNodePtr *nodes = nsdata->snap_nodes; bool cur; for (i = 0; i < nsdata->num_snap_nodes; i++) { - virDomainMomentObjPtr snap; - virDomainSnapshotDefPtr def; + virDomainMomentObj *snap; + virDomainSnapshotDef *def; xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file, "domainsnapshot"); if (!node) @@ -920,13 +915,13 @@ testParseDomainSnapshots(testDriverPtr privconn, } static int -testParseDomains(testDriverPtr privconn, +testParseDomains(testDriver *privconn, const char *file, xmlXPathContextPtr ctxt) { int num, ret = -1; size_t i; - virDomainObjPtr obj = NULL; + virDomainObj *obj = NULL; g_autofree xmlNodePtr *nodes = NULL; num = virXPathNodeSet("/node/domain", ctxt, &nodes); @@ -934,8 +929,8 @@ testParseDomains(testDriverPtr privconn, return -1; for (i = 0; i < num; i++) { - virDomainDefPtr def; - testDomainNamespaceDefPtr nsdata; + virDomainDef *def; + testDomainNamespaceDef *nsdata; xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file, "domain"); if (!node) goto error; @@ -982,13 +977,13 @@ testParseDomains(testDriverPtr privconn, static int -testParseNetworks(testDriverPtr privconn, +testParseNetworks(testDriver *privconn, const char *file, xmlXPathContextPtr ctxt) { int num; size_t i; - virNetworkObjPtr obj; + virNetworkObj *obj; g_autofree xmlNodePtr *nodes = NULL; num = virXPathNodeSet("/node/network", ctxt, &nodes); @@ -996,7 +991,7 @@ testParseNetworks(testDriverPtr privconn, return -1; for (i = 0; i < num; i++) { - virNetworkDefPtr def; + virNetworkDef *def; xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file, "network"); if (!node) return -1; @@ -1019,13 +1014,13 @@ testParseNetworks(testDriverPtr privconn, static int -testParseInterfaces(testDriverPtr privconn, +testParseInterfaces(testDriver *privconn, const char *file, xmlXPathContextPtr ctxt) { int num; size_t i; - virInterfaceObjPtr obj; + virInterfaceObj *obj; g_autofree xmlNodePtr *nodes = NULL; num = virXPathNodeSet("/node/interface", ctxt, &nodes); @@ -1033,7 +1028,7 @@ testParseInterfaces(testDriverPtr privconn, return -1; for (i = 0; i < num; i++) { - virInterfaceDefPtr def; + virInterfaceDef *def; xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file, "interface"); if (!node) @@ -1059,10 +1054,10 @@ testParseInterfaces(testDriverPtr privconn, static int testOpenVolumesForPool(const char *file, xmlXPathContextPtr ctxt, - virStoragePoolObjPtr obj, + virStoragePoolObj *obj, int objidx) { - virStoragePoolDefPtr def = virStoragePoolObjGetDef(obj); + virStoragePoolDef *def = virStoragePoolObjGetDef(obj); size_t i; int num; g_autofree char *vol_xpath = NULL; @@ -1106,13 +1101,13 @@ testOpenVolumesForPool(const char *file, static int -testParseStorage(testDriverPtr privconn, +testParseStorage(testDriver *privconn, const char *file, xmlXPathContextPtr ctxt) { int num; size_t i; - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; g_autofree xmlNodePtr *nodes = NULL; num = virXPathNodeSet("/node/pool", ctxt, &nodes); @@ -1120,7 +1115,7 @@ testParseStorage(testDriverPtr privconn, return -1; for (i = 0; i < num; i++) { - virStoragePoolDefPtr def; + virStoragePoolDef *def; xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file, "pool"); if (!node) @@ -1155,13 +1150,13 @@ testParseStorage(testDriverPtr privconn, static int -testParseNodedevs(testDriverPtr privconn, +testParseNodedevs(testDriver *privconn, const char *file, xmlXPathContextPtr ctxt) { int num; size_t i; - virNodeDeviceObjPtr obj; + virNodeDeviceObj *obj; g_autofree xmlNodePtr *nodes = NULL; num = virXPathNodeSet("/node/device", ctxt, &nodes); @@ -1169,7 +1164,7 @@ testParseNodedevs(testDriverPtr privconn, return -1; for (i = 0; i < num; i++) { - virNodeDeviceDefPtr def; + virNodeDeviceDef *def; xmlNodePtr node = testParseXMLDocFromFile(nodes[i], file, "nodedev"); if (!node) @@ -1192,7 +1187,7 @@ testParseNodedevs(testDriverPtr privconn, } static int -testParseAuthUsers(testDriverPtr privconn, +testParseAuthUsers(testDriver *privconn, xmlXPathContextPtr ctxt) { int num; @@ -1226,7 +1221,7 @@ testParseAuthUsers(testDriverPtr privconn, } static int -testOpenParse(testDriverPtr privconn, +testOpenParse(testDriver *privconn, const char *file, xmlXPathContextPtr ctxt) { @@ -1261,7 +1256,7 @@ testOpenFromFile(virConnectPtr conn, const char *file) { xmlDocPtr doc = NULL; xmlXPathContextPtr ctxt = NULL; - testDriverPtr privconn; + testDriver *privconn; if (!(privconn = testDriverNew())) return VIR_DRV_OPEN_ERROR; @@ -1302,7 +1297,7 @@ static int testOpenDefault(virConnectPtr conn) { int ret = VIR_DRV_OPEN_ERROR; - testDriverPtr privconn = NULL; + testDriver *privconn = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr ctxt = NULL; size_t i; @@ -1330,7 +1325,7 @@ testOpenDefault(virConnectPtr conn) privconn->cells[i].freeMem = (i + 1) * 1024 * 1024; } for (i = 0; i < 16; i++) { - virBitmapPtr siblings = virBitmapNew(16); + virBitmap *siblings = virBitmapNew(16); ignore_value(virBitmapSetBit(siblings, i)); privconn->cells[i / 8].cpus[(i % 8)].id = i; privconn->cells[i / 8].cpus[(i % 8)].socket_id = i / 8; @@ -1366,7 +1361,7 @@ static int testConnectAuthenticate(virConnectPtr conn, virConnectAuthPtr auth) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int ret = -1; ssize_t i; g_autofree char *username = NULL; @@ -1415,7 +1410,7 @@ testConnectAuthenticate(virConnectPtr conn, static void -testDriverCloseInternal(testDriverPtr driver) +testDriverCloseInternal(testDriver *driver) { virMutexLock(&defaultLock); testDriverDisposed = false; @@ -1429,7 +1424,7 @@ testDriverCloseInternal(testDriverPtr driver) static virDrvOpenStatus testConnectOpen(virConnectPtr conn, virConnectAuthPtr auth, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { int ret; @@ -1512,8 +1507,8 @@ testConnectBaselineCPU(virConnectPtr conn G_GNUC_UNUSED, unsigned int ncpus, unsigned int flags) { - virCPUDefPtr *cpus = NULL; - virCPUDefPtr cpu = NULL; + virCPUDef **cpus = NULL; + virCPUDef *cpu = NULL; char *cpustr = NULL; virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, NULL); @@ -1540,7 +1535,7 @@ testConnectBaselineCPU(virConnectPtr conn G_GNUC_UNUSED, static int testNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; virObjectLock(privconn); memcpy(info, &privconn->nodeInfo, sizeof(virNodeInfo)); virObjectUnlock(privconn); @@ -1549,7 +1544,7 @@ static int testNodeGetInfo(virConnectPtr conn, static char *testConnectGetCapabilities(virConnectPtr conn) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; char *xml; virObjectLock(privconn); xml = virCapabilitiesFormatXML(privconn->caps); @@ -1614,7 +1609,7 @@ testConnectSupportsFeature(virConnectPtr conn G_GNUC_UNUSED, static int testConnectNumOfDomains(virConnectPtr conn) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int count; virObjectLock(privconn); @@ -1626,7 +1621,7 @@ static int testConnectNumOfDomains(virConnectPtr conn) static int testDomainIsActive(virDomainPtr dom) { - virDomainObjPtr obj; + virDomainObj *obj; int ret; if (!(obj = testDomObjFromDomain(dom))) @@ -1639,7 +1634,7 @@ static int testDomainIsActive(virDomainPtr dom) static int testDomainIsPersistent(virDomainPtr dom) { - virDomainObjPtr obj; + virDomainObj *obj; int ret; if (!(obj = testDomObjFromDomain(dom))) @@ -1660,11 +1655,11 @@ static virDomainPtr testDomainCreateXML(virConnectPtr conn, const char *xml, unsigned int flags) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; virDomainPtr ret = NULL; - virDomainDefPtr def; - virDomainObjPtr dom = NULL; - virObjectEventPtr event = NULL; + virDomainDef *def; + virDomainObj *dom = NULL; + virObjectEvent *event = NULL; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; virCheckFlags(VIR_DOMAIN_START_VALIDATE, NULL); @@ -1723,9 +1718,9 @@ testDomainCreateXMLWithFiles(virConnectPtr conn, static virDomainPtr testDomainLookupByID(virConnectPtr conn, int id) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; virDomainPtr ret = NULL; - virDomainObjPtr dom; + virDomainObj *dom; if (!(dom = virDomainObjListFindByID(privconn->domains, id))) { virReportError(VIR_ERR_NO_DOMAIN, NULL); @@ -1741,9 +1736,9 @@ static virDomainPtr testDomainLookupByID(virConnectPtr conn, static virDomainPtr testDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; virDomainPtr ret = NULL; - virDomainObjPtr dom; + virDomainObj *dom; if (!(dom = virDomainObjListFindByUUID(privconn->domains, uuid))) { virReportError(VIR_ERR_NO_DOMAIN, NULL); @@ -1759,9 +1754,9 @@ static virDomainPtr testDomainLookupByUUID(virConnectPtr conn, static virDomainPtr testDomainLookupByName(virConnectPtr conn, const char *name) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; virDomainPtr ret = NULL; - virDomainObjPtr dom; + virDomainObj *dom; if (!(dom = virDomainObjListFindByName(privconn->domains, name))) { virReportError(VIR_ERR_NO_DOMAIN, NULL); @@ -1779,7 +1774,7 @@ static int testConnectListDomains(virConnectPtr conn, int *ids, int maxids) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; return virDomainObjListGetActiveIDs(privconn->domains, ids, maxids, NULL, NULL); @@ -1788,9 +1783,9 @@ static int testConnectListDomains(virConnectPtr conn, static int testDomainDestroyFlags(virDomainPtr domain, unsigned int flags) { - testDriverPtr privconn = domain->conn->privateData; - virDomainObjPtr privdom; - virObjectEventPtr event = NULL; + testDriver *privconn = domain->conn->privateData; + virDomainObj *privdom; + virObjectEvent *event = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_DESTROY_GRACEFUL, -1); @@ -1823,9 +1818,9 @@ static int testDomainDestroy(virDomainPtr domain) static int testDomainResume(virDomainPtr domain) { - testDriverPtr privconn = domain->conn->privateData; - virDomainObjPtr privdom; - virObjectEventPtr event = NULL; + testDriver *privconn = domain->conn->privateData; + virDomainObj *privdom; + virObjectEvent *event = NULL; int ret = -1; if (!(privdom = testDomObjFromDomain(domain))) @@ -1852,9 +1847,9 @@ static int testDomainResume(virDomainPtr domain) static int testDomainSuspend(virDomainPtr domain) { - testDriverPtr privconn = domain->conn->privateData; - virDomainObjPtr privdom; - virObjectEventPtr event = NULL; + testDriver *privconn = domain->conn->privateData; + virDomainObj *privdom; + virObjectEvent *event = NULL; int ret = -1; int state; @@ -1882,7 +1877,7 @@ static int testDomainSuspend(virDomainPtr domain) static void -testDomainActionSetState(virDomainObjPtr dom, +testDomainActionSetState(virDomainObj *dom, int lifecycle_type) { switch (lifecycle_type) { @@ -1917,9 +1912,9 @@ testDomainActionSetState(virDomainObjPtr dom, static int testDomainShutdownFlags(virDomainPtr domain, unsigned int flags) { - testDriverPtr privconn = domain->conn->privateData; - virDomainObjPtr privdom; - virObjectEventPtr event = NULL; + testDriver *privconn = domain->conn->privateData; + virDomainObj *privdom; + virObjectEvent *event = NULL; int ret = -1; virCheckFlags(0, -1); @@ -1962,9 +1957,9 @@ static int testDomainShutdown(virDomainPtr domain) static int testDomainReboot(virDomainPtr domain, unsigned int flags) { - testDriverPtr privconn = domain->conn->privateData; - virDomainObjPtr privdom; - virObjectEventPtr event = NULL; + testDriver *privconn = domain->conn->privateData; + virDomainObj *privdom; + virObjectEvent *event = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_REBOOT_DEFAULT | @@ -2004,7 +1999,7 @@ static int testDomainReset(virDomainPtr dom, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -2027,7 +2022,7 @@ testDomainGetHostname(virDomainPtr domain, unsigned int flags) { char *ret = NULL; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; virCheckFlags(0, NULL); @@ -2048,7 +2043,7 @@ testDomainGetHostname(virDomainPtr domain, static int testDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) { - virDomainObjPtr privdom; + virDomainObj *privdom; if (!(privdom = testDomObjFromDomain(domain))) return -1; @@ -2069,7 +2064,7 @@ testDomainGetState(virDomainPtr domain, int *reason, unsigned int flags) { - virDomainObjPtr privdom; + virDomainObj *privdom; virCheckFlags(0, -1); @@ -2089,8 +2084,8 @@ testDomainGetTime(virDomainPtr dom, unsigned int *nseconds, unsigned int flags) { - virDomainObjPtr vm = NULL; - testDomainObjPrivatePtr priv; + virDomainObj *vm = NULL; + testDomainObjPrivate *priv; int ret = -1; virCheckFlags(0, -1); @@ -2121,8 +2116,8 @@ testDomainSetTime(virDomainPtr dom, unsigned int nseconds, unsigned int flags) { - virDomainObjPtr vm = NULL; - testDomainObjPrivatePtr priv; + virDomainObj *vm = NULL; + testDomainObjPrivate *priv; int ret = -1; virCheckFlags(VIR_DOMAIN_TIME_SYNC, ret); @@ -2155,9 +2150,9 @@ testDomainSetTime(virDomainPtr dom, * Returns true on success, else false. */ static bool -testDomainSaveImageWrite(testDriverPtr driver, +testDomainSaveImageWrite(testDriver *driver, const char *path, - virDomainDefPtr def) + virDomainDef *def) { int len; int fd = -1; @@ -2232,14 +2227,14 @@ testDomainSaveImageWrite(testDriverPtr driver, * Returns -1, on error. */ static int ATTRIBUTE_NONNULL(3) -testDomainSaveImageOpen(testDriverPtr driver, +testDomainSaveImageOpen(testDriver *driver, const char *path, - virDomainDefPtr *ret_def) + virDomainDef **ret_def) { char magic[15]; int fd = -1; int len; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; g_autofree char *xml = NULL; if ((fd = open(path, O_RDONLY)) < 0) { @@ -2297,9 +2292,9 @@ static int testDomainSaveFlags(virDomainPtr domain, const char *path, const char *dxml, unsigned int flags) { - testDriverPtr privconn = domain->conn->privateData; - virDomainObjPtr privdom; - virObjectEventPtr event = NULL; + testDriver *privconn = domain->conn->privateData; + virDomainObj *privdom; + virObjectEvent *event = NULL; int ret = -1; virCheckFlags(0, -1); @@ -2347,11 +2342,11 @@ testDomainRestoreFlags(virConnectPtr conn, const char *dxml, unsigned int flags) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int fd = -1; - virDomainDefPtr def = NULL; - virDomainObjPtr dom = NULL; - virObjectEventPtr event = NULL; + virDomainDef *def = NULL; + virDomainObj *dom = NULL; + virObjectEvent *event = NULL; int ret = -1; virCheckFlags(0, -1); @@ -2410,9 +2405,9 @@ testDomainSaveImageDefineXML(virConnectPtr conn, { int ret = -1; int fd = -1; - virDomainDefPtr def = NULL; - virDomainDefPtr newdef = NULL; - testDriverPtr privconn = conn->privateData; + virDomainDef *def = NULL; + virDomainDef *newdef = NULL; + testDriver *privconn = conn->privateData; virCheckFlags(VIR_DOMAIN_SAVE_RUNNING | VIR_DOMAIN_SAVE_PAUSED, -1); @@ -2444,8 +2439,8 @@ testDomainSaveImageGetXMLDesc(virConnectPtr conn, { int fd = -1; char *ret = NULL; - virDomainDefPtr def = NULL; - testDriverPtr privconn = conn->privateData; + virDomainDef *def = NULL; + testDriver *privconn = conn->privateData; virCheckFlags(VIR_DOMAIN_SAVE_IMAGE_XML_SECURE, NULL); @@ -2467,10 +2462,10 @@ static int testDomainCoreDumpWithFormat(virDomainPtr domain, unsigned int dumpformat, unsigned int flags) { - testDriverPtr privconn = domain->conn->privateData; + testDriver *privconn = domain->conn->privateData; int fd = -1; - virDomainObjPtr privdom; - virObjectEventPtr event = NULL; + virDomainObj *privdom; + virObjectEvent *event = NULL; int ret = -1; virCheckFlags(VIR_DUMP_CRASH, -1); @@ -2562,7 +2557,7 @@ testDomainGetLaunchSecurityInfo(virDomainPtr domain G_GNUC_UNUSED, static unsigned long long testDomainGetMaxMemory(virDomainPtr domain) { - virDomainObjPtr privdom; + virDomainObj *privdom; unsigned long long ret = 0; if (!(privdom = testDomObjFromDomain(domain))) @@ -2580,8 +2575,8 @@ static int testDomainSetMemoryStatsPeriod(virDomainPtr dom, int period, unsigned int flags) { - virDomainObjPtr vm; - virDomainDefPtr def; + virDomainObj *vm; + virDomainDef *def; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -2613,8 +2608,8 @@ static int testDomainSetMemoryFlags(virDomainPtr domain, unsigned long memory, unsigned int flags) { - virDomainObjPtr vm; - virDomainDefPtr def; + virDomainObj *vm; + virDomainDef *def; int ret = -1; bool live = false; @@ -2690,9 +2685,9 @@ testDomainPinEmulator(virDomainPtr dom, int maplen, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virBitmapPtr pcpumap = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virBitmap *pcpumap = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -2730,11 +2725,11 @@ testDomainGetEmulatorPinInfo(virDomainPtr dom, int maplen, unsigned int flags) { - testDriverPtr driver = dom->conn->privateData; - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virBitmapPtr cpumask = NULL; - virBitmapPtr bitmap = NULL; + testDriver *driver = dom->conn->privateData; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virBitmap *cpumask = NULL; + virBitmap *bitmap = NULL; int hostcpus; int ret = -1; @@ -2772,8 +2767,8 @@ testDomainGetEmulatorPinInfo(virDomainPtr dom, static int testDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr vm; - virDomainDefPtr def; + virDomainObj *vm; + virDomainDef *def; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -2807,10 +2802,10 @@ static int testDomainSetVcpusFlags(virDomainPtr domain, unsigned int nrCpus, unsigned int flags) { - testDriverPtr driver = domain->conn->privateData; - virDomainObjPtr privdom = NULL; - virDomainDefPtr def; - virDomainDefPtr persistentDef; + testDriver *driver = domain->conn->privateData; + virDomainObj *privdom = NULL; + virDomainDef *def; + virDomainDef *persistentDef; int ret = -1, maxvcpus; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -2879,7 +2874,7 @@ testDomainSetUserPassword(virDomainPtr dom, unsigned int flags) { int ret = -1; - virDomainObjPtr vm; + virDomainObj *vm; virCheckFlags(VIR_DOMAIN_PASSWORD_ENCRYPTED, -1); @@ -2908,14 +2903,14 @@ static int testDomainGetVcpus(virDomainPtr domain, unsigned char *cpumaps, int maplen) { - testDriverPtr privconn = domain->conn->privateData; - virDomainObjPtr privdom; - virDomainDefPtr def; + testDriver *privconn = domain->conn->privateData; + virDomainObj *privdom; + virDomainDef *def; size_t i; int hostcpus; int ret = -1; unsigned long long statbase; - virBitmapPtr allcpumap = NULL; + virBitmap *allcpumap = NULL; if (!(privdom = testDomObjFromDomain(domain))) return -1; @@ -2942,8 +2937,8 @@ static int testDomainGetVcpus(virDomainPtr domain, memset(cpumaps, 0, maxinfo * maplen); for (i = 0; i < maxinfo; i++) { - virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(def, i); - virBitmapPtr bitmap = NULL; + virDomainVcpuDef *vcpu = virDomainDefGetVcpu(def, i); + virBitmap *bitmap = NULL; if (!vcpu->online) continue; @@ -2979,9 +2974,9 @@ static int testDomainPinVcpuFlags(virDomainPtr domain, int maplen, unsigned int flags) { - virDomainVcpuDefPtr vcpuinfo; - virDomainObjPtr privdom; - virDomainDefPtr def; + virDomainVcpuDef *vcpuinfo; + virDomainObj *privdom; + virDomainDef *def; int ret = -1; virCheckFlags(0, -1); @@ -3032,9 +3027,9 @@ testDomainGetVcpuPinInfo(virDomainPtr dom, int maplen, unsigned int flags) { - testDriverPtr driver = dom->conn->privateData; - virDomainObjPtr privdom; - virDomainDefPtr def; + testDriver *driver = dom->conn->privateData; + virDomainObj *privdom; + virDomainDef *def; g_autoptr(virBitmap) hostcpus = NULL; int ret = -1; @@ -3056,14 +3051,14 @@ testDomainGetVcpuPinInfo(virDomainPtr dom, } static int -testDomainRenameCallback(virDomainObjPtr privdom, +testDomainRenameCallback(virDomainObj *privdom, const char *new_name, unsigned int flags, void *opaque) { - testDriverPtr driver = opaque; - virObjectEventPtr event_new = NULL; - virObjectEventPtr event_old = NULL; + testDriver *driver = opaque; + virObjectEvent *event_new = NULL; + virObjectEvent *event_old = NULL; int ret = -1; g_autofree char *new_dom_name = NULL; @@ -3100,8 +3095,8 @@ testDomainRename(virDomainPtr dom, const char *new_name, unsigned int flags) { - testDriverPtr driver = dom->conn->privateData; - virDomainObjPtr privdom = NULL; + testDriver *driver = dom->conn->privateData; + virDomainObj *privdom = NULL; int ret = -1; virCheckFlags(0, ret); @@ -3141,9 +3136,9 @@ testDomainRename(virDomainPtr dom, static char *testDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) { - testDriverPtr privconn = domain->conn->privateData; - virDomainDefPtr def; - virDomainObjPtr privdom; + testDriver *privconn = domain->conn->privateData; + virDomainDef *def; + virDomainObj *privdom; char *ret = NULL; virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS, NULL); @@ -3174,8 +3169,8 @@ testDomainSetMemoryParameters(virDomainPtr dom, int nparams, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; unsigned long long swap_hard_limit = 0; unsigned long long hard_limit = 0; unsigned long long soft_limit = 0; @@ -3258,8 +3253,8 @@ testDomainGetMemoryParameters(virDomainPtr dom, unsigned int flags) { int ret = -1; - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | VIR_DOMAIN_AFFECT_CONFIG | @@ -3296,9 +3291,9 @@ testDomainSetNumaParameters(virDomainPtr dom, int nparams, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virBitmapPtr nodeset = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virBitmap *nodeset = NULL; virDomainNumatuneMemMode config_mode; bool live; size_t i; @@ -3377,8 +3372,8 @@ testDomainGetNumaParameters(virDomainPtr dom, int *nparams, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; virDomainNumatuneMemMode mode = VIR_DOMAIN_NUMATUNE_MEM_STRICT; g_autofree char *nodeset = NULL; int ret = -1; @@ -3423,9 +3418,9 @@ testDomainSetInterfaceParameters(virDomainPtr dom, int nparams, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def; - virDomainNetDefPtr net = NULL; + virDomainObj *vm = NULL; + virDomainDef *def; + virDomainNetDef *net = NULL; g_autoptr(virNetDevBandwidth) bandwidth = NULL; bool inboundSpecified = false; bool outboundSpecified = false; @@ -3530,9 +3525,9 @@ testDomainGetInterfaceParameters(virDomainPtr dom, { virNetDevBandwidthRate in = {0}; virNetDevBandwidthRate out = {0}; - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virDomainNetDefPtr net = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virDomainNetDef *net = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -3587,10 +3582,10 @@ testDomainSetBlockIoTune(virDomainPtr dom, int nparams, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; virDomainBlockIoTuneInfo info = {0}; - virDomainDiskDefPtr conf_disk = NULL; + virDomainDiskDef *conf_disk = NULL; virTypedParameterPtr eventParams = NULL; int eventNparams = 0; int eventMaxparams = 0; @@ -3831,9 +3826,9 @@ testDomainGetBlockIoTune(virDomainPtr dom, int *nparams, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virDomainDiskDefPtr disk; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virDomainDiskDef *disk; virDomainBlockIoTuneInfo reply = {0}; int ret = -1; @@ -3927,7 +3922,7 @@ testDomainGetBlockIoTune(virDomainPtr dom, static int testConnectNumOfDefinedDomains(virConnectPtr conn) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; return virDomainObjListNumOfDomains(privconn->domains, false, NULL, NULL); } @@ -3936,7 +3931,7 @@ static int testConnectListDefinedDomains(virConnectPtr conn, char **const names, int maxnames) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; memset(names, 0, sizeof(*names)*maxnames); return virDomainObjListGetInactiveNames(privconn->domains, names, maxnames, @@ -3947,12 +3942,12 @@ static virDomainPtr testDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; virDomainPtr ret = NULL; - virDomainDefPtr def; - virDomainObjPtr dom = NULL; - virObjectEventPtr event = NULL; - virDomainDefPtr oldDef = NULL; + virDomainDef *def; + virDomainObj *dom = NULL; + virObjectEvent *event = NULL; + virDomainDef *oldDef = NULL; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; virCheckFlags(VIR_DOMAIN_DEFINE_VALIDATE, NULL); @@ -4005,7 +4000,7 @@ static char *testDomainGetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - virDomainObjPtr privdom; + virDomainObj *privdom; char *ret; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -4027,8 +4022,8 @@ static int testDomainSetMetadata(virDomainPtr dom, const char *uri, unsigned int flags) { - testDriverPtr privconn = dom->conn->privateData; - virDomainObjPtr privdom; + testDriver *privconn = dom->conn->privateData; + virDomainObj *privdom; int ret; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -4042,7 +4037,7 @@ static int testDomainSetMetadata(virDomainPtr dom, NULL, NULL, flags); if (ret == 0) { - virObjectEventPtr ev = NULL; + virObjectEvent *ev = NULL; ev = virDomainEventMetadataChangeNewFromObj(privdom, type, uri); virObjectEventStateQueue(privconn->eventState, ev); } @@ -4154,8 +4149,8 @@ testDomainGetCPUStats(virDomainPtr dom, unsigned int ncpus, unsigned int flags) { - virDomainObjPtr vm = NULL; - testDriverPtr privconn = dom->conn->privateData; + virDomainObj *vm = NULL; + testDriver *privconn = dom->conn->privateData; int ret = -1; virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); @@ -4185,7 +4180,7 @@ testDomainSendProcessSignal(virDomainPtr dom, unsigned int flags) { int ret = -1; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; virCheckFlags(0, -1); @@ -4217,7 +4212,7 @@ static int testNodeGetCellsFreeMemory(virConnectPtr conn, unsigned long long *freemems, int startCell, int maxCells) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int cell; size_t i; int ret = -1; @@ -4291,7 +4286,7 @@ testNodeGetCPUStats(virConnectPtr conn G_GNUC_UNUSED, static unsigned long long testNodeGetFreeMemory(virConnectPtr conn) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; unsigned int freeMem = 0; size_t i; @@ -4330,9 +4325,9 @@ testNodeGetFreePages(virConnectPtr conn G_GNUC_UNUSED, static int testDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) { - testDriverPtr privconn = domain->conn->privateData; - virDomainObjPtr privdom; - virObjectEventPtr event = NULL; + testDriver *privconn = domain->conn->privateData; + virDomainObj *privdom; + virObjectEvent *event = NULL; int ret = -1; virCheckFlags(0, -1); @@ -4383,9 +4378,9 @@ static int testDomainCreateWithFiles(virDomainPtr domain, static int testDomainUndefineFlags(virDomainPtr domain, unsigned int flags) { - testDriverPtr privconn = domain->conn->privateData; - virDomainObjPtr privdom; - virObjectEventPtr event = NULL; + testDriver *privconn = domain->conn->privateData; + virDomainObj *privdom; + virObjectEvent *event = NULL; int nsnapshots; int ret = -1; @@ -4452,8 +4447,8 @@ testDomainFSFreeze(virDomainPtr dom, unsigned int nmountpoints, unsigned int flags) { - virDomainObjPtr vm; - testDomainObjPrivatePtr priv; + virDomainObj *vm; + testDomainObjPrivate *priv; size_t i; int ret = -1; @@ -4512,8 +4507,8 @@ testDomainFSThaw(virDomainPtr dom, unsigned int nmountpoints, unsigned int flags) { - virDomainObjPtr vm; - testDomainObjPrivatePtr priv; + virDomainObj *vm; + testDomainObjPrivate *priv; size_t i; int ret = -1; @@ -4572,7 +4567,7 @@ testDomainFSTrim(virDomainPtr dom, unsigned long long minimum G_GNUC_UNUSED, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -4600,7 +4595,7 @@ testDomainFSTrim(virDomainPtr dom, static int testDomainGetAutostart(virDomainPtr domain, int *autostart) { - virDomainObjPtr privdom; + virDomainObj *privdom; if (!(privdom = testDomObjFromDomain(domain))) return -1; @@ -4615,7 +4610,7 @@ static int testDomainGetAutostart(virDomainPtr domain, static int testDomainSetAutostart(virDomainPtr domain, int autostart) { - virDomainObjPtr privdom; + virDomainObj *privdom; if (!(privdom = testDomObjFromDomain(domain))) return -1; @@ -4631,7 +4626,7 @@ static int testDomainGetDiskErrors(virDomainPtr dom, unsigned int maxerrors, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; size_t i; size_t nerrors = 0; @@ -4676,7 +4671,7 @@ testDomainGetFSInfo(virDomainPtr dom, unsigned int flags) { size_t i; - virDomainObjPtr vm; + virDomainObj *vm; virDomainFSInfoPtr *info_ret = NULL; int ret = -1; @@ -4740,8 +4735,8 @@ testDomainSetPerfEvents(virDomainPtr dom, int nparams, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; size_t i; int ret = -1; @@ -4803,8 +4798,8 @@ testDomainGetPerfEvents(virDomainPtr dom, int *nparams, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; virTypedParameterPtr par = NULL; size_t i; int maxpar = 0; @@ -4855,7 +4850,7 @@ testDomainGetSchedulerParametersFlags(virDomainPtr domain, int *nparams, unsigned int flags) { - virDomainObjPtr privdom; + virDomainObj *privdom; int ret = -1; virCheckFlags(0, -1); @@ -4891,7 +4886,7 @@ testDomainSetSchedulerParametersFlags(virDomainPtr domain, int nparams, unsigned int flags) { - virDomainObjPtr privdom; + virDomainObj *privdom; int ret = -1; size_t i; @@ -4930,7 +4925,7 @@ static int testDomainBlockStats(virDomainPtr domain, const char *path, virDomainBlockStatsPtr stats) { - virDomainObjPtr privdom; + virDomainObj *privdom; unsigned long long statbase; int ret = -1; @@ -4968,14 +4963,14 @@ static int testDomainBlockStats(virDomainPtr domain, static int -testDomainInterfaceAddressFromNet(testDriverPtr driver, +testDomainInterfaceAddressFromNet(testDriver *driver, const virDomainNetDef *net, size_t addr_offset, virDomainInterfacePtr iface) { virSocketAddr addr; - virNetworkObjPtr net_obj = NULL; - virNetworkDefPtr net_def = NULL; + virNetworkObj *net_obj = NULL; + virNetworkDef *net_def = NULL; int ret = -1; if (!(net_obj = testNetworkObjFindByName(driver, net->data.network.name))) @@ -5021,7 +5016,7 @@ testDomainInterfaceAddresses(virDomainPtr dom, size_t ifaces_count = 0; int ret = -1; char macaddr[VIR_MAC_STRING_BUFLEN]; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; virDomainInterfacePtr iface = NULL; virDomainInterfacePtr *ifaces_ret = NULL; @@ -5093,9 +5088,9 @@ testDomainInterfaceStats(virDomainPtr domain, const char *device, virDomainInterfaceStatsPtr stats) { - virDomainObjPtr privdom; + virDomainObj *privdom; unsigned long long statbase; - virDomainNetDefPtr net = NULL; + virDomainNetDef *net = NULL; int ret = -1; @@ -5126,11 +5121,11 @@ testDomainInterfaceStats(virDomainPtr domain, } -static virNetworkObjPtr -testNetworkObjFindByUUID(testDriverPtr privconn, +static virNetworkObj * +testNetworkObjFindByUUID(testDriver *privconn, const unsigned char *uuid) { - virNetworkObjPtr obj; + virNetworkObj *obj; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (!(obj = virNetworkObjFindByUUID(privconn->networks, uuid))) { @@ -5148,9 +5143,9 @@ static virNetworkPtr testNetworkLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - testDriverPtr privconn = conn->privateData; - virNetworkObjPtr obj; - virNetworkDefPtr def; + testDriver *privconn = conn->privateData; + virNetworkObj *obj; + virNetworkDef *def; virNetworkPtr net = NULL; if (!(obj = testNetworkObjFindByUUID(privconn, uuid))) @@ -5165,11 +5160,11 @@ testNetworkLookupByUUID(virConnectPtr conn, } -static virNetworkObjPtr -testNetworkObjFindByName(testDriverPtr privconn, +static virNetworkObj * +testNetworkObjFindByName(testDriver *privconn, const char *name) { - virNetworkObjPtr obj; + virNetworkObj *obj; if (!(obj = virNetworkObjFindByName(privconn->networks, name))) virReportError(VIR_ERR_NO_NETWORK, @@ -5184,9 +5179,9 @@ static virNetworkPtr testNetworkLookupByName(virConnectPtr conn, const char *name) { - testDriverPtr privconn = conn->privateData; - virNetworkObjPtr obj; - virNetworkDefPtr def; + testDriver *privconn = conn->privateData; + virNetworkObj *obj; + virNetworkDef *def; virNetworkPtr net = NULL; if (!(obj = testNetworkObjFindByName(privconn, name))) @@ -5204,7 +5199,7 @@ testNetworkLookupByName(virConnectPtr conn, static int testConnectNumOfNetworks(virConnectPtr conn) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; return virNetworkObjListNumOfNetworks(privconn->networks, true, NULL, conn); } @@ -5215,7 +5210,7 @@ testConnectListNetworks(virConnectPtr conn, char **const names, int maxnames) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; return virNetworkObjListGetNames(privconn->networks, true, names, maxnames, NULL, conn); } @@ -5224,7 +5219,7 @@ testConnectListNetworks(virConnectPtr conn, static int testConnectNumOfDefinedNetworks(virConnectPtr conn) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; return virNetworkObjListNumOfNetworks(privconn->networks, false, NULL, conn); } @@ -5235,7 +5230,7 @@ testConnectListDefinedNetworks(virConnectPtr conn, char **const names, int maxnames) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; return virNetworkObjListGetNames(privconn->networks, false, names, maxnames, NULL, conn); } @@ -5246,7 +5241,7 @@ testConnectListAllNetworks(virConnectPtr conn, virNetworkPtr **nets, unsigned int flags) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; virCheckFlags(VIR_CONNECT_LIST_NETWORKS_FILTERS_ALL, -1); @@ -5257,8 +5252,8 @@ testConnectListAllNetworks(virConnectPtr conn, static int testNetworkIsActive(virNetworkPtr net) { - testDriverPtr privconn = net->conn->privateData; - virNetworkObjPtr obj; + testDriver *privconn = net->conn->privateData; + virNetworkObj *obj; int ret = -1; if (!(obj = testNetworkObjFindByUUID(privconn, net->uuid))) @@ -5275,8 +5270,8 @@ testNetworkIsActive(virNetworkPtr net) static int testNetworkIsPersistent(virNetworkPtr net) { - testDriverPtr privconn = net->conn->privateData; - virNetworkObjPtr obj; + testDriver *privconn = net->conn->privateData; + virNetworkObj *obj; int ret = -1; if (!(obj = testNetworkObjFindByUUID(privconn, net->uuid))) @@ -5293,12 +5288,12 @@ testNetworkIsPersistent(virNetworkPtr net) static virNetworkPtr testNetworkCreateXML(virConnectPtr conn, const char *xml) { - testDriverPtr privconn = conn->privateData; - virNetworkDefPtr newDef; - virNetworkObjPtr obj = NULL; - virNetworkDefPtr def; + testDriver *privconn = conn->privateData; + virNetworkDef *newDef; + virNetworkObj *obj = NULL; + virNetworkDef *def; virNetworkPtr net = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if ((newDef = virNetworkDefParseString(xml, NULL)) == NULL) goto cleanup; @@ -5329,12 +5324,12 @@ static virNetworkPtr testNetworkDefineXML(virConnectPtr conn, const char *xml) { - testDriverPtr privconn = conn->privateData; - virNetworkDefPtr newDef; - virNetworkObjPtr obj = NULL; - virNetworkDefPtr def; + testDriver *privconn = conn->privateData; + virNetworkDef *newDef; + virNetworkObj *obj = NULL; + virNetworkDef *def; virNetworkPtr net = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if ((newDef = virNetworkDefParseString(xml, NULL)) == NULL) goto cleanup; @@ -5361,10 +5356,10 @@ testNetworkDefineXML(virConnectPtr conn, static int testNetworkUndefine(virNetworkPtr net) { - testDriverPtr privconn = net->conn->privateData; - virNetworkObjPtr obj; + testDriver *privconn = net->conn->privateData; + virNetworkObj *obj; int ret = -1; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(obj = testNetworkObjFindByName(privconn, net->name))) goto cleanup; @@ -5397,8 +5392,8 @@ testNetworkUpdate(virNetworkPtr net, const char *xml, unsigned int flags) { - testDriverPtr privconn = net->conn->privateData; - virNetworkObjPtr obj = NULL; + testDriver *privconn = net->conn->privateData; + virNetworkObj *obj = NULL; int isActive, ret = -1; virCheckFlags(VIR_NETWORK_UPDATE_AFFECT_LIVE | @@ -5436,11 +5431,11 @@ testNetworkUpdate(virNetworkPtr net, static int testNetworkCreate(virNetworkPtr net) { - testDriverPtr privconn = net->conn->privateData; - virNetworkObjPtr obj; - virNetworkDefPtr def; + testDriver *privconn = net->conn->privateData; + virNetworkObj *obj; + virNetworkDef *def; int ret = -1; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(obj = testNetworkObjFindByName(privconn, net->name))) goto cleanup; @@ -5468,11 +5463,11 @@ testNetworkCreate(virNetworkPtr net) static int testNetworkDestroy(virNetworkPtr net) { - testDriverPtr privconn = net->conn->privateData; - virNetworkObjPtr obj; - virNetworkDefPtr def; + testDriver *privconn = net->conn->privateData; + virNetworkObj *obj; + virNetworkDef *def; int ret = -1; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(obj = testNetworkObjFindByName(privconn, net->name))) goto cleanup; @@ -5498,8 +5493,8 @@ static char * testNetworkGetXMLDesc(virNetworkPtr net, unsigned int flags) { - testDriverPtr privconn = net->conn->privateData; - virNetworkObjPtr obj; + testDriver *privconn = net->conn->privateData; + virNetworkObj *obj; char *ret = NULL; virCheckFlags(0, NULL); @@ -5518,10 +5513,10 @@ testNetworkGetXMLDesc(virNetworkPtr net, static char * testNetworkGetBridgeName(virNetworkPtr net) { - testDriverPtr privconn = net->conn->privateData; + testDriver *privconn = net->conn->privateData; char *bridge = NULL; - virNetworkObjPtr obj; - virNetworkDefPtr def; + virNetworkObj *obj; + virNetworkDef *def; if (!(obj = testNetworkObjFindByName(privconn, net->name))) goto cleanup; @@ -5546,8 +5541,8 @@ static int testNetworkGetAutostart(virNetworkPtr net, int *autostart) { - testDriverPtr privconn = net->conn->privateData; - virNetworkObjPtr obj; + testDriver *privconn = net->conn->privateData; + virNetworkObj *obj; int ret = -1; if (!(obj = testNetworkObjFindByName(privconn, net->name))) @@ -5566,8 +5561,8 @@ static int testNetworkSetAutostart(virNetworkPtr net, int autostart) { - testDriverPtr privconn = net->conn->privateData; - virNetworkObjPtr obj; + testDriver *privconn = net->conn->privateData; + virNetworkObj *obj; bool new_autostart = (autostart != 0); int ret = -1; @@ -5589,11 +5584,11 @@ testNetworkSetAutostart(virNetworkPtr net, */ -static virInterfaceObjPtr -testInterfaceObjFindByName(testDriverPtr privconn, +static virInterfaceObj * +testInterfaceObjFindByName(testDriver *privconn, const char *name) { - virInterfaceObjPtr obj; + virInterfaceObj *obj; virObjectLock(privconn); obj = virInterfaceObjListFindByName(privconn->ifaces, name); @@ -5611,7 +5606,7 @@ testInterfaceObjFindByName(testDriverPtr privconn, static int testConnectNumOfInterfaces(virConnectPtr conn) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int ninterfaces; virObjectLock(privconn); @@ -5626,7 +5621,7 @@ testConnectListInterfaces(virConnectPtr conn, char **const names, int maxnames) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int nnames; virObjectLock(privconn); @@ -5641,7 +5636,7 @@ testConnectListInterfaces(virConnectPtr conn, static int testConnectNumOfDefinedInterfaces(virConnectPtr conn) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int ninterfaces; virObjectLock(privconn); @@ -5656,7 +5651,7 @@ testConnectListDefinedInterfaces(virConnectPtr conn, char **const names, int maxnames) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int nnames; virObjectLock(privconn); @@ -5673,7 +5668,7 @@ testConnectListAllInterfaces(virConnectPtr conn, virInterfacePtr **ifaces, unsigned int flags) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; virCheckFlags(VIR_CONNECT_LIST_INTERFACES_FILTERS_ACTIVE, -1); @@ -5686,9 +5681,9 @@ static virInterfacePtr testInterfaceLookupByName(virConnectPtr conn, const char *name) { - testDriverPtr privconn = conn->privateData; - virInterfaceObjPtr obj; - virInterfaceDefPtr def; + testDriver *privconn = conn->privateData; + virInterfaceObj *obj; + virInterfaceDef *def; virInterfacePtr ret = NULL; if (!(obj = testInterfaceObjFindByName(privconn, name))) @@ -5706,7 +5701,7 @@ static virInterfacePtr testInterfaceLookupByMACString(virConnectPtr conn, const char *mac) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int ifacect; char *ifacenames[] = { NULL, NULL }; virInterfacePtr ret = NULL; @@ -5739,8 +5734,8 @@ testInterfaceLookupByMACString(virConnectPtr conn, static int testInterfaceIsActive(virInterfacePtr iface) { - testDriverPtr privconn = iface->conn->privateData; - virInterfaceObjPtr obj; + testDriver *privconn = iface->conn->privateData; + virInterfaceObj *obj; int ret = -1; if (!(obj = testInterfaceObjFindByName(privconn, iface->name))) @@ -5757,7 +5752,7 @@ static int testInterfaceChangeBegin(virConnectPtr conn, unsigned int flags) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int ret = -1; virCheckFlags(0, -1); @@ -5785,7 +5780,7 @@ static int testInterfaceChangeCommit(virConnectPtr conn, unsigned int flags) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int ret = -1; virCheckFlags(0, -1); @@ -5815,7 +5810,7 @@ static int testInterfaceChangeRollback(virConnectPtr conn, unsigned int flags) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int ret = -1; virCheckFlags(0, -1); @@ -5846,9 +5841,9 @@ static char * testInterfaceGetXMLDesc(virInterfacePtr iface, unsigned int flags) { - testDriverPtr privconn = iface->conn->privateData; - virInterfaceObjPtr obj; - virInterfaceDefPtr def; + testDriver *privconn = iface->conn->privateData; + virInterfaceObj *obj; + virInterfaceDef *def; char *ret = NULL; virCheckFlags(0, NULL); @@ -5869,10 +5864,10 @@ testInterfaceDefineXML(virConnectPtr conn, const char *xmlStr, unsigned int flags) { - testDriverPtr privconn = conn->privateData; - virInterfaceDefPtr def; - virInterfaceObjPtr obj = NULL; - virInterfaceDefPtr objdef; + testDriver *privconn = conn->privateData; + virInterfaceDef *def; + virInterfaceObj *obj = NULL; + virInterfaceDef *objdef; virInterfacePtr ret = NULL; virCheckFlags(0, NULL); @@ -5899,8 +5894,8 @@ testInterfaceDefineXML(virConnectPtr conn, static int testInterfaceUndefine(virInterfacePtr iface) { - testDriverPtr privconn = iface->conn->privateData; - virInterfaceObjPtr obj; + testDriver *privconn = iface->conn->privateData; + virInterfaceObj *obj; if (!(obj = testInterfaceObjFindByName(privconn, iface->name))) return -1; @@ -5916,8 +5911,8 @@ static int testInterfaceCreate(virInterfacePtr iface, unsigned int flags) { - testDriverPtr privconn = iface->conn->privateData; - virInterfaceObjPtr obj; + testDriver *privconn = iface->conn->privateData; + virInterfaceObj *obj; int ret = -1; virCheckFlags(0, -1); @@ -5943,8 +5938,8 @@ static int testInterfaceDestroy(virInterfacePtr iface, unsigned int flags) { - testDriverPtr privconn = iface->conn->privateData; - virInterfaceObjPtr obj; + testDriver *privconn = iface->conn->privateData; + virInterfaceObj *obj; int ret = -1; virCheckFlags(0, -1); @@ -5972,10 +5967,10 @@ testInterfaceDestroy(virInterfacePtr iface, */ static int -testStoragePoolObjSetDefaults(virStoragePoolObjPtr obj) +testStoragePoolObjSetDefaults(virStoragePoolObj *obj) { char *configFile; - virStoragePoolDefPtr def = virStoragePoolObjGetDef(obj); + virStoragePoolDef *def = virStoragePoolObjGetDef(obj); def->capacity = defaultPoolCap; def->allocation = defaultPoolAlloc; @@ -5988,11 +5983,11 @@ testStoragePoolObjSetDefaults(virStoragePoolObjPtr obj) } -static virStoragePoolObjPtr -testStoragePoolObjFindByName(testDriverPtr privconn, +static virStoragePoolObj * +testStoragePoolObjFindByName(testDriver *privconn, const char *name) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; virObjectLock(privconn); obj = virStoragePoolObjFindByName(privconn->pools, name); @@ -6007,11 +6002,11 @@ testStoragePoolObjFindByName(testDriverPtr privconn, } -static virStoragePoolObjPtr -testStoragePoolObjFindActiveByName(testDriverPtr privconn, +static virStoragePoolObj * +testStoragePoolObjFindActiveByName(testDriver *privconn, const char *name) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; if (!(obj = testStoragePoolObjFindByName(privconn, name))) return NULL; @@ -6027,11 +6022,11 @@ testStoragePoolObjFindActiveByName(testDriverPtr privconn, } -static virStoragePoolObjPtr -testStoragePoolObjFindInactiveByName(testDriverPtr privconn, +static virStoragePoolObj * +testStoragePoolObjFindInactiveByName(testDriver *privconn, const char *name) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; if (!(obj = testStoragePoolObjFindByName(privconn, name))) return NULL; @@ -6047,11 +6042,11 @@ testStoragePoolObjFindInactiveByName(testDriverPtr privconn, } -static virStoragePoolObjPtr -testStoragePoolObjFindByUUID(testDriverPtr privconn, +static virStoragePoolObj * +testStoragePoolObjFindByUUID(testDriver *privconn, const unsigned char *uuid) { - virStoragePoolObjPtr obj; + virStoragePoolObj *obj; char uuidstr[VIR_UUID_STRING_BUFLEN]; virObjectLock(privconn); @@ -6073,9 +6068,9 @@ static virStoragePoolPtr testStoragePoolLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - testDriverPtr privconn = conn->privateData; - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + testDriver *privconn = conn->privateData; + virStoragePoolObj *obj; + virStoragePoolDef *def; virStoragePoolPtr pool = NULL; if (!(obj = testStoragePoolObjFindByUUID(privconn, uuid))) @@ -6093,9 +6088,9 @@ static virStoragePoolPtr testStoragePoolLookupByName(virConnectPtr conn, const char *name) { - testDriverPtr privconn = conn->privateData; - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + testDriver *privconn = conn->privateData; + virStoragePoolObj *obj; + virStoragePoolDef *def; virStoragePoolPtr pool = NULL; if (!(obj = testStoragePoolObjFindByName(privconn, name))) @@ -6119,7 +6114,7 @@ testStoragePoolLookupByVolume(virStorageVolPtr vol) static int testConnectNumOfStoragePools(virConnectPtr conn) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int numActive = 0; virObjectLock(privconn); @@ -6136,7 +6131,7 @@ testConnectListStoragePools(virConnectPtr conn, char **const names, int maxnames) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int n = 0; virObjectLock(privconn); @@ -6151,7 +6146,7 @@ testConnectListStoragePools(virConnectPtr conn, static int testConnectNumOfDefinedStoragePools(virConnectPtr conn) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int numInactive = 0; virObjectLock(privconn); @@ -6168,7 +6163,7 @@ testConnectListDefinedStoragePools(virConnectPtr conn, char **const names, int maxnames) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int n = 0; virObjectLock(privconn); @@ -6185,7 +6180,7 @@ testConnectListAllStoragePools(virConnectPtr conn, virStoragePoolPtr **pools, unsigned int flags) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; int ret = -1; virCheckFlags(VIR_CONNECT_LIST_STORAGE_POOLS_FILTERS_ALL, -1); @@ -6202,8 +6197,8 @@ testConnectListAllStoragePools(virConnectPtr conn, static int testStoragePoolIsActive(virStoragePoolPtr pool) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; int ret = -1; if (!(obj = testStoragePoolObjFindByUUID(privconn, pool->uuid))) @@ -6221,8 +6216,8 @@ testStoragePoolIsActive(virStoragePoolPtr pool) static int testStoragePoolIsPersistent(virStoragePoolPtr pool) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; int ret = -1; if (!(obj = testStoragePoolObjFindByUUID(privconn, pool->uuid))) @@ -6239,9 +6234,9 @@ static int testStoragePoolCreate(virStoragePoolPtr pool, unsigned int flags) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; - virObjectEventPtr event = NULL; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; + virObjectEvent *event = NULL; virCheckFlags(0, -1); @@ -6310,16 +6305,16 @@ testConnectFindStoragePoolSources(virConnectPtr conn G_GNUC_UNUSED, } -static virNodeDeviceObjPtr -testNodeDeviceMockCreateVport(testDriverPtr driver, +static virNodeDeviceObj * +testNodeDeviceMockCreateVport(testDriver *driver, const char *wwnn, const char *wwpn); static int -testCreateVport(testDriverPtr driver, +testCreateVport(testDriver *driver, const char *wwnn, const char *wwpn) { - virNodeDeviceObjPtr obj = NULL; + virNodeDeviceObj *obj = NULL; /* The storage_backend_scsi createVport() will use the input adapter * fields parent name, parent_wwnn/parent_wwpn, or parent_fabric_wwn * in order to determine whether the provided parent can be used to @@ -6343,11 +6338,11 @@ testStoragePoolCreateXML(virConnectPtr conn, const char *xml, unsigned int flags) { - testDriverPtr privconn = conn->privateData; - virStoragePoolObjPtr obj = NULL; - virStoragePoolDefPtr def; + testDriver *privconn = conn->privateData; + virStoragePoolObj *obj = NULL; + virStoragePoolDef *def; virStoragePoolPtr pool = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; g_autoptr(virStoragePoolDef) newDef = NULL; virCheckFlags(0, NULL); @@ -6406,11 +6401,11 @@ testStoragePoolDefineXML(virConnectPtr conn, const char *xml, unsigned int flags) { - testDriverPtr privconn = conn->privateData; - virStoragePoolObjPtr obj = NULL; - virStoragePoolDefPtr def; + testDriver *privconn = conn->privateData; + virStoragePoolObj *obj = NULL; + virStoragePoolDef *def; virStoragePoolPtr pool = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; g_autoptr(virStoragePoolDef) newDef = NULL; virCheckFlags(0, NULL); @@ -6450,9 +6445,9 @@ testStoragePoolDefineXML(virConnectPtr conn, static int testStoragePoolUndefine(virStoragePoolPtr pool) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; - virObjectEventPtr event = NULL; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; + virObjectEvent *event = NULL; if (!(obj = testStoragePoolObjFindInactiveByName(privconn, pool->name))) return -1; @@ -6473,9 +6468,9 @@ static int testStoragePoolBuild(virStoragePoolPtr pool, unsigned int flags) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; - virObjectEventPtr event = NULL; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; + virObjectEvent *event = NULL; virCheckFlags(0, -1); @@ -6494,12 +6489,12 @@ testStoragePoolBuild(virStoragePoolPtr pool, static int -testDestroyVport(testDriverPtr privconn, +testDestroyVport(testDriver *privconn, const char *wwnn G_GNUC_UNUSED, const char *wwpn G_GNUC_UNUSED) { - virNodeDeviceObjPtr obj = NULL; - virObjectEventPtr event = NULL; + virNodeDeviceObj *obj = NULL; + virObjectEvent *event = NULL; /* NB: Cannot use virVHBAGetHostByWWN (yet) like the storage_backend_scsi * deleteVport() helper since that traverses the file system looking for @@ -6530,11 +6525,11 @@ testDestroyVport(testDriverPtr privconn, static int testStoragePoolDestroy(virStoragePoolPtr pool) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; + virStoragePoolDef *def; int ret = -1; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; if (!(obj = testStoragePoolObjFindActiveByName(privconn, pool->name))) return -1; @@ -6570,9 +6565,9 @@ static int testStoragePoolDelete(virStoragePoolPtr pool, unsigned int flags) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; - virObjectEventPtr event = NULL; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; + virObjectEvent *event = NULL; virCheckFlags(0, -1); @@ -6594,9 +6589,9 @@ static int testStoragePoolRefresh(virStoragePoolPtr pool, unsigned int flags) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; - virObjectEventPtr event = NULL; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; + virObjectEvent *event = NULL; virCheckFlags(0, -1); @@ -6615,9 +6610,9 @@ static int testStoragePoolGetInfo(virStoragePoolPtr pool, virStoragePoolInfoPtr info) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; + virStoragePoolDef *def; if (!(obj = testStoragePoolObjFindByName(privconn, pool->name))) return -1; @@ -6641,8 +6636,8 @@ static char * testStoragePoolGetXMLDesc(virStoragePoolPtr pool, unsigned int flags) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; char *ret = NULL; virCheckFlags(0, NULL); @@ -6661,8 +6656,8 @@ static int testStoragePoolGetAutostart(virStoragePoolPtr pool, int *autostart) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; if (!(obj = testStoragePoolObjFindByName(privconn, pool->name))) return -1; @@ -6681,8 +6676,8 @@ static int testStoragePoolSetAutostart(virStoragePoolPtr pool, int autostart) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; bool new_autostart = (autostart != 0); int ret = -1; @@ -6707,8 +6702,8 @@ testStoragePoolSetAutostart(virStoragePoolPtr pool, static int testStoragePoolNumOfVolumes(virStoragePoolPtr pool) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; int ret = -1; if (!(obj = testStoragePoolObjFindActiveByName(privconn, pool->name))) @@ -6726,8 +6721,8 @@ testStoragePoolListVolumes(virStoragePoolPtr pool, char **const names, int maxnames) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; int n = -1; if (!(obj = testStoragePoolObjFindActiveByName(privconn, pool->name))) @@ -6745,8 +6740,8 @@ testStoragePoolListAllVolumes(virStoragePoolPtr pool, virStorageVolPtr **vols, unsigned int flags) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; int ret = -1; virCheckFlags(0, -1); @@ -6769,11 +6764,11 @@ testStoragePoolListAllVolumes(virStoragePoolPtr pool, } -static virStorageVolDefPtr -testStorageVolDefFindByName(virStoragePoolObjPtr obj, +static virStorageVolDef * +testStorageVolDefFindByName(virStoragePoolObj *obj, const char *name) { - virStorageVolDefPtr privvol; + virStorageVolDef *privvol; if (!(privvol = virStorageVolDefFindByName(obj, name))) { virReportError(VIR_ERR_NO_STORAGE_VOL, @@ -6788,10 +6783,10 @@ static virStorageVolPtr testStorageVolLookupByName(virStoragePoolPtr pool, const char *name) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStorageVolDefPtr privvol; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStorageVolDef *privvol; virStorageVolPtr ret = NULL; if (!(obj = testStoragePoolObjFindActiveByName(privconn, pool->name))) @@ -6814,11 +6809,11 @@ testStorageVolLookupByName(virStoragePoolPtr pool, struct storageVolLookupData { const char *key; const char *path; - virStorageVolDefPtr voldef; + virStorageVolDef *voldef; }; static bool -testStorageVolLookupByKeyCallback(virStoragePoolObjPtr obj, +testStorageVolLookupByKeyCallback(virStoragePoolObj *obj, const void *opaque) { struct storageVolLookupData *data = (struct storageVolLookupData *)opaque; @@ -6834,9 +6829,9 @@ static virStorageVolPtr testStorageVolLookupByKey(virConnectPtr conn, const char *key) { - testDriverPtr privconn = conn->privateData; - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + testDriver *privconn = conn->privateData; + virStoragePoolObj *obj; + virStoragePoolDef *def; struct storageVolLookupData data = { .key = key, .voldef = NULL }; virStorageVolPtr vol = NULL; @@ -6862,7 +6857,7 @@ testStorageVolLookupByKey(virConnectPtr conn, static bool -testStorageVolLookupByPathCallback(virStoragePoolObjPtr obj, +testStorageVolLookupByPathCallback(virStoragePoolObj *obj, const void *opaque) { struct storageVolLookupData *data = (struct storageVolLookupData *)opaque; @@ -6878,9 +6873,9 @@ static virStorageVolPtr testStorageVolLookupByPath(virConnectPtr conn, const char *path) { - testDriverPtr privconn = conn->privateData; - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + testDriver *privconn = conn->privateData; + virStoragePoolObj *obj; + virStoragePoolDef *def; struct storageVolLookupData data = { .path = path, .voldef = NULL }; virStorageVolPtr vol = NULL; @@ -6910,9 +6905,9 @@ testStorageVolCreateXML(virStoragePoolPtr pool, const char *xmldesc, unsigned int flags) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; + virStoragePoolDef *def; virStorageVolPtr ret = NULL; g_autoptr(virStorageVolDef) privvol = NULL; @@ -6968,10 +6963,10 @@ testStorageVolCreateXMLFrom(virStoragePoolPtr pool, virStorageVolPtr clonevol, unsigned int flags) { - testDriverPtr privconn = pool->conn->privateData; - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStorageVolDefPtr origvol = NULL; + testDriver *privconn = pool->conn->privateData; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStorageVolDef *origvol = NULL; virStorageVolPtr ret = NULL; g_autoptr(virStorageVolDef) privvol = NULL; @@ -7033,10 +7028,10 @@ static int testStorageVolDelete(virStorageVolPtr vol, unsigned int flags) { - testDriverPtr privconn = vol->conn->privateData; - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStorageVolDefPtr privvol; + testDriver *privconn = vol->conn->privateData; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStorageVolDef *privvol; int ret = -1; virCheckFlags(0, -1); @@ -7094,10 +7089,10 @@ static int testStorageVolGetInfo(virStorageVolPtr vol, virStorageVolInfoPtr info) { - testDriverPtr privconn = vol->conn->privateData; - virStoragePoolObjPtr obj; - virStoragePoolDefPtr def; - virStorageVolDefPtr privvol; + testDriver *privconn = vol->conn->privateData; + virStoragePoolObj *obj; + virStoragePoolDef *def; + virStorageVolDef *privvol; int ret = -1; if (!(obj = testStoragePoolObjFindActiveByName(privconn, vol->pool))) @@ -7124,9 +7119,9 @@ static char * testStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags) { - testDriverPtr privconn = vol->conn->privateData; - virStoragePoolObjPtr obj; - virStorageVolDefPtr privvol; + testDriver *privconn = vol->conn->privateData; + virStoragePoolObj *obj; + virStorageVolDef *privvol; char *ret = NULL; virCheckFlags(0, NULL); @@ -7148,9 +7143,9 @@ testStorageVolGetXMLDesc(virStorageVolPtr vol, static char * testStorageVolGetPath(virStorageVolPtr vol) { - testDriverPtr privconn = vol->conn->privateData; - virStoragePoolObjPtr obj; - virStorageVolDefPtr privvol; + testDriver *privconn = vol->conn->privateData; + virStoragePoolObj *obj; + virStorageVolDef *privvol; char *ret = NULL; if (!(obj = testStoragePoolObjFindActiveByName(privconn, vol->pool))) @@ -7169,11 +7164,11 @@ testStorageVolGetPath(virStorageVolPtr vol) /* Node device implementations */ -static virNodeDeviceObjPtr -testNodeDeviceObjFindByName(testDriverPtr driver, +static virNodeDeviceObj * +testNodeDeviceObjFindByName(testDriver *driver, const char *name) { - virNodeDeviceObjPtr obj; + virNodeDeviceObj *obj; if (!(obj = virNodeDeviceObjListFindByName(driver->devs, name))) virReportError(VIR_ERR_NO_NODE_DEVICE, @@ -7189,7 +7184,7 @@ testNodeNumOfDevices(virConnectPtr conn, const char *cap, unsigned int flags) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; virCheckFlags(0, -1); @@ -7204,7 +7199,7 @@ testNodeListDevices(virConnectPtr conn, int maxnames, unsigned int flags) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; virCheckFlags(0, -1); @@ -7217,7 +7212,7 @@ testConnectListAllNodeDevices(virConnectPtr conn, virNodeDevicePtr **devices, unsigned int flags) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; virCheckFlags(VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_CAP, -1); @@ -7228,9 +7223,9 @@ testConnectListAllNodeDevices(virConnectPtr conn, static virNodeDevicePtr testNodeDeviceLookupByName(virConnectPtr conn, const char *name) { - testDriverPtr driver = conn->privateData; - virNodeDeviceObjPtr obj; - virNodeDeviceDefPtr def; + testDriver *driver = conn->privateData; + virNodeDeviceObj *obj; + virNodeDeviceDef *def; virNodeDevicePtr ret = NULL; if (!(obj = testNodeDeviceObjFindByName(driver, name))) @@ -7248,8 +7243,8 @@ static char * testNodeDeviceGetXMLDesc(virNodeDevicePtr dev, unsigned int flags) { - testDriverPtr driver = dev->conn->privateData; - virNodeDeviceObjPtr obj; + testDriver *driver = dev->conn->privateData; + virNodeDeviceObj *obj; char *ret = NULL; virCheckFlags(0, NULL); @@ -7266,9 +7261,9 @@ testNodeDeviceGetXMLDesc(virNodeDevicePtr dev, static char * testNodeDeviceGetParent(virNodeDevicePtr dev) { - testDriverPtr driver = dev->conn->privateData; - virNodeDeviceObjPtr obj; - virNodeDeviceDefPtr def; + testDriver *driver = dev->conn->privateData; + virNodeDeviceObj *obj; + virNodeDeviceDef *def; char *ret = NULL; if (!(obj = testNodeDeviceObjFindByName(driver, dev->name))) @@ -7290,10 +7285,10 @@ testNodeDeviceGetParent(virNodeDevicePtr dev) static int testNodeDeviceNumOfCaps(virNodeDevicePtr dev) { - testDriverPtr driver = dev->conn->privateData; - virNodeDeviceObjPtr obj; - virNodeDeviceDefPtr def; - virNodeDevCapsDefPtr caps; + testDriver *driver = dev->conn->privateData; + virNodeDeviceObj *obj; + virNodeDeviceDef *def; + virNodeDevCapsDef *caps; int ncaps = 0; if (!(obj = testNodeDeviceObjFindByName(driver, dev->name))) @@ -7311,10 +7306,10 @@ testNodeDeviceNumOfCaps(virNodeDevicePtr dev) static int testNodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames) { - testDriverPtr driver = dev->conn->privateData; - virNodeDeviceObjPtr obj; - virNodeDeviceDefPtr def; - virNodeDevCapsDefPtr caps; + testDriver *driver = dev->conn->privateData; + virNodeDeviceObj *obj; + virNodeDeviceDef *def; + virNodeDevCapsDef *caps; int ncaps = 0; if (!(obj = testNodeDeviceObjFindByName(driver, dev->name))) @@ -7331,17 +7326,17 @@ testNodeDeviceListCaps(virNodeDevicePtr dev, char **const names, int maxnames) } -static virNodeDeviceObjPtr -testNodeDeviceMockCreateVport(testDriverPtr driver, +static virNodeDeviceObj * +testNodeDeviceMockCreateVport(testDriver *driver, const char *wwnn, const char *wwpn) { - virNodeDeviceDefPtr def = NULL; - virNodeDevCapsDefPtr caps; - virNodeDeviceObjPtr obj = NULL; - virNodeDeviceObjPtr objcopy = NULL; - virNodeDeviceDefPtr objdef; - virObjectEventPtr event = NULL; + virNodeDeviceDef *def = NULL; + virNodeDevCapsDef *caps; + virNodeDeviceObj *obj = NULL; + virNodeDeviceObj *objcopy = NULL; + virNodeDeviceDef *objdef; + virObjectEvent *event = NULL; g_autofree char *xml = NULL; /* In the real code, we'd call virVHBAManageVport which would take the @@ -7414,11 +7409,11 @@ testNodeDeviceCreateXML(virConnectPtr conn, const char *xmlDesc, unsigned int flags) { - testDriverPtr driver = conn->privateData; - virNodeDeviceDefPtr def = NULL; + testDriver *driver = conn->privateData; + virNodeDeviceDef *def = NULL; virNodeDevicePtr dev = NULL, ret = NULL; - virNodeDeviceObjPtr obj = NULL; - virNodeDeviceDefPtr objdef; + virNodeDeviceObj *obj = NULL; + virNodeDeviceDef *objdef; g_autofree char *wwnn = NULL; g_autofree char *wwpn = NULL; @@ -7467,11 +7462,11 @@ static int testNodeDeviceDestroy(virNodeDevicePtr dev) { int ret = 0; - testDriverPtr driver = dev->conn->privateData; - virNodeDeviceObjPtr obj = NULL; - virNodeDeviceObjPtr parentobj = NULL; - virNodeDeviceDefPtr def; - virObjectEventPtr event = NULL; + testDriver *driver = dev->conn->privateData; + virNodeDeviceObj *obj = NULL; + virNodeDeviceObj *parentobj = NULL; + virNodeDeviceDef *def; + virObjectEvent *event = NULL; g_autofree char *wwnn = NULL; g_autofree char *wwpn = NULL; @@ -7522,7 +7517,7 @@ testConnectDomainEventRegister(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; int ret = 0; if (virDomainEventStateRegister(conn, driver->eventState, @@ -7537,7 +7532,7 @@ static int testConnectDomainEventDeregister(virConnectPtr conn, virConnectDomainEventCallback callback) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; int ret = 0; if (virDomainEventStateDeregister(conn, driver->eventState, @@ -7556,7 +7551,7 @@ testConnectDomainEventRegisterAny(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; int ret; if (virDomainEventStateRegisterID(conn, driver->eventState, @@ -7571,7 +7566,7 @@ static int testConnectDomainEventDeregisterAny(virConnectPtr conn, int callbackID) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; int ret = 0; if (virObjectEventStateDeregisterID(conn, driver->eventState, @@ -7590,7 +7585,7 @@ testConnectNetworkEventRegisterAny(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; int ret; if (virNetworkEventStateRegisterID(conn, driver->eventState, @@ -7605,7 +7600,7 @@ static int testConnectNetworkEventDeregisterAny(virConnectPtr conn, int callbackID) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; int ret = 0; if (virObjectEventStateDeregisterID(conn, driver->eventState, @@ -7623,7 +7618,7 @@ testConnectStoragePoolEventRegisterAny(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; int ret; if (virStoragePoolEventStateRegisterID(conn, driver->eventState, @@ -7638,7 +7633,7 @@ static int testConnectStoragePoolEventDeregisterAny(virConnectPtr conn, int callbackID) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; int ret = 0; if (virObjectEventStateDeregisterID(conn, driver->eventState, @@ -7656,7 +7651,7 @@ testConnectNodeDeviceEventRegisterAny(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; int ret; if (virNodeDeviceEventStateRegisterID(conn, driver->eventState, @@ -7671,7 +7666,7 @@ static int testConnectNodeDeviceEventDeregisterAny(virConnectPtr conn, int callbackID) { - testDriverPtr driver = conn->privateData; + testDriver *driver = conn->privateData; int ret = 0; if (virObjectEventStateDeregisterID(conn, driver->eventState, @@ -7685,7 +7680,7 @@ static int testConnectListAllDomains(virConnectPtr conn, virDomainPtr **domains, unsigned int flags) { - testDriverPtr privconn = conn->privateData; + testDriver *privconn = conn->privateData; virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1); @@ -7735,7 +7730,7 @@ static int testDomainInjectNMI(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; virCheckFlags(0, -1); @@ -7764,7 +7759,7 @@ testDomainSendKey(virDomainPtr domain, { int ret = -1; size_t i; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; virCheckFlags(0, -1); @@ -7815,9 +7810,9 @@ testConnectGetCPUModelNames(virConnectPtr conn G_GNUC_UNUSED, static int testDomainManagedSave(virDomainPtr dom, unsigned int flags) { - testDriverPtr privconn = dom->conn->privateData; - virDomainObjPtr vm = NULL; - virObjectEventPtr event = NULL; + testDriver *privconn = dom->conn->privateData; + virDomainObj *vm = NULL; + virObjectEvent *event = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_SAVE_BYPASS_CACHE | @@ -7854,7 +7849,7 @@ testDomainManagedSave(virDomainPtr dom, unsigned int flags) static int testDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret; virCheckFlags(0, -1); @@ -7871,7 +7866,7 @@ testDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) static int testDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; virCheckFlags(0, -1); @@ -7891,7 +7886,7 @@ testDomainMemoryStats(virDomainPtr dom, unsigned int nr_stats, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int cur_memory; int ret = -1; @@ -7947,7 +7942,7 @@ testDomainMemoryPeek(virDomainPtr dom, int ret = -1; size_t i; unsigned char b = start; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; virCheckFlags(VIR_MEMORY_VIRTUAL | VIR_MEMORY_PHYSICAL, -1); @@ -7980,8 +7975,8 @@ testDomainGetBlockInfo(virDomainPtr dom, virDomainBlockInfoPtr info, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDiskDefPtr disk; + virDomainObj *vm = NULL; + virDomainDiskDef *disk; int ret = -1; virCheckFlags(0, -1); @@ -8014,7 +8009,7 @@ testDomainGetBlockInfo(virDomainPtr dom, static void -testDomainModifyLifecycleAction(virDomainDefPtr def, +testDomainModifyLifecycleAction(virDomainDef *def, virDomainLifecycle type, virDomainLifecycleAction action) { @@ -8040,9 +8035,9 @@ testDomainSetLifecycleAction(virDomainPtr dom, unsigned int action, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainDefPtr def = NULL; - virDomainDefPtr persistentDef = NULL; + virDomainObj *vm = NULL; + virDomainDef *def = NULL; + virDomainDef *persistentDef = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -8074,11 +8069,11 @@ testDomainSetLifecycleAction(virDomainPtr dom, * Snapshot APIs */ -static virDomainMomentObjPtr -testSnapObjFromName(virDomainObjPtr vm, +static virDomainMomentObj * +testSnapObjFromName(virDomainObj *vm, const char *name) { - virDomainMomentObjPtr snap = NULL; + virDomainMomentObj *snap = NULL; snap = virDomainSnapshotFindByName(vm->snapshots, name); if (!snap) virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, @@ -8087,14 +8082,14 @@ testSnapObjFromName(virDomainObjPtr vm, return snap; } -static virDomainMomentObjPtr -testSnapObjFromSnapshot(virDomainObjPtr vm, +static virDomainMomentObj * +testSnapObjFromSnapshot(virDomainObj *vm, virDomainSnapshotPtr snapshot) { return testSnapObjFromName(vm, snapshot->name); } -static virDomainObjPtr +static virDomainObj * testDomObjFromSnapshot(virDomainSnapshotPtr snapshot) { return testDomObjFromDomain(snapshot->domain); @@ -8103,7 +8098,7 @@ testDomObjFromSnapshot(virDomainSnapshotPtr snapshot) static int testDomainSnapshotNum(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int n; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS | @@ -8125,7 +8120,7 @@ testDomainSnapshotListNames(virDomainPtr domain, int nameslen, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int n; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS | @@ -8147,7 +8142,7 @@ testDomainListAllSnapshots(virDomainPtr domain, virDomainSnapshotPtr **snaps, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int n; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS | @@ -8169,8 +8164,8 @@ testDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot, int nameslen, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainMomentObjPtr snap = NULL; + virDomainObj *vm = NULL; + virDomainMomentObj *snap = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | @@ -8195,8 +8190,8 @@ static int testDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainMomentObjPtr snap = NULL; + virDomainObj *vm = NULL; + virDomainMomentObj *snap = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | @@ -8221,8 +8216,8 @@ testDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot, virDomainSnapshotPtr **snaps, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainMomentObjPtr snap = NULL; + virDomainObj *vm = NULL; + virDomainMomentObj *snap = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | @@ -8248,8 +8243,8 @@ testDomainSnapshotLookupByName(virDomainPtr domain, const char *name, unsigned int flags) { - virDomainObjPtr vm; - virDomainMomentObjPtr snap = NULL; + virDomainObj *vm; + virDomainMomentObj *snap = NULL; virDomainSnapshotPtr snapshot = NULL; virCheckFlags(0, NULL); @@ -8271,7 +8266,7 @@ static int testDomainHasCurrentSnapshot(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; int ret; virCheckFlags(0, -1); @@ -8289,8 +8284,8 @@ static virDomainSnapshotPtr testDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr vm; - virDomainMomentObjPtr snap = NULL; + virDomainObj *vm; + virDomainMomentObj *snap = NULL; virDomainSnapshotPtr parent = NULL; virCheckFlags(0, NULL); @@ -8319,9 +8314,9 @@ static virDomainSnapshotPtr testDomainSnapshotCurrent(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr vm; + virDomainObj *vm; virDomainSnapshotPtr snapshot = NULL; - virDomainMomentObjPtr current; + virDomainMomentObj *current; virCheckFlags(0, NULL); @@ -8346,11 +8341,11 @@ static char * testDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; char *xml = NULL; - virDomainMomentObjPtr snap = NULL; + virDomainMomentObj *snap = NULL; char uuidstr[VIR_UUID_STRING_BUFLEN]; - testDriverPtr privconn = snapshot->domain->conn->privateData; + testDriver *privconn = snapshot->domain->conn->privateData; virCheckFlags(VIR_DOMAIN_SNAPSHOT_XML_SECURE, NULL); @@ -8375,9 +8370,9 @@ static int testDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; - virDomainMomentObjPtr snap = NULL; + virDomainMomentObj *snap = NULL; virCheckFlags(0, -1); @@ -8399,7 +8394,7 @@ static int testDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; virCheckFlags(0, -1); @@ -8418,8 +8413,8 @@ testDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot, } static int -testDomainSnapshotAlignDisks(virDomainObjPtr vm, - virDomainSnapshotDefPtr def, +testDomainSnapshotAlignDisks(virDomainObj *vm, + virDomainSnapshotDef *def, unsigned int flags) { int align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL; @@ -8452,11 +8447,11 @@ testDomainSnapshotCreateXML(virDomainPtr domain, const char *xmlDesc, unsigned int flags) { - testDriverPtr privconn = domain->conn->privateData; - virDomainObjPtr vm = NULL; - virDomainMomentObjPtr snap = NULL; + testDriver *privconn = domain->conn->privateData; + virDomainObj *vm = NULL; + virDomainMomentObj *snap = NULL; virDomainSnapshotPtr snapshot = NULL; - virObjectEventPtr event = NULL; + virObjectEvent *event = NULL; bool update_current = true; bool redefine = flags & VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE; unsigned int parse_flags = VIR_DOMAIN_SNAPSHOT_PARSE_DISKS; @@ -8562,9 +8557,8 @@ testDomainSnapshotCreateXML(virDomainPtr domain, typedef struct _testMomentRemoveData testMomentRemoveData; -typedef testMomentRemoveData *testMomentRemoveDataPtr; struct _testMomentRemoveData { - virDomainObjPtr vm; + virDomainObj *vm; bool current; }; @@ -8573,18 +8567,17 @@ testDomainSnapshotDiscardAll(void *payload, const char *name G_GNUC_UNUSED, void *data) { - virDomainMomentObjPtr snap = payload; - testMomentRemoveDataPtr curr = data; + virDomainMomentObj *snap = payload; + testMomentRemoveData *curr = data; curr->current |= virDomainSnapshotObjListRemove(curr->vm->snapshots, snap); return 0; } typedef struct _testMomentReparentData testMomentReparentData; -typedef testMomentReparentData *testMomentReparentDataPtr; struct _testMomentReparentData { - virDomainMomentObjPtr parent; - virDomainObjPtr vm; + virDomainMomentObj *parent; + virDomainObj *vm; int err; }; @@ -8593,8 +8586,8 @@ testDomainMomentReparentChildren(void *payload, const char *name G_GNUC_UNUSED, void *data) { - virDomainMomentObjPtr moment = payload; - testMomentReparentDataPtr rep = data; + virDomainMomentObj *moment = payload; + testMomentReparentData *rep = data; if (rep->err < 0) return 0; @@ -8611,9 +8604,9 @@ static int testDomainSnapshotDelete(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainMomentObjPtr snap = NULL; - virDomainMomentObjPtr parentsnap = NULL; + virDomainObj *vm = NULL; + virDomainMomentObj *snap = NULL; + virDomainMomentObj *parentsnap = NULL; int ret = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN | @@ -8676,13 +8669,13 @@ static int testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, unsigned int flags) { - testDriverPtr privconn = snapshot->domain->conn->privateData; - virDomainObjPtr vm = NULL; - virDomainMomentObjPtr snap = NULL; - virObjectEventPtr event = NULL; - virObjectEventPtr event2 = NULL; - virDomainDefPtr config = NULL; - virDomainSnapshotDefPtr snapdef; + testDriver *privconn = snapshot->domain->conn->privateData; + virDomainObj *vm = NULL; + virDomainMomentObj *snap = NULL; + virObjectEvent *event = NULL; + virObjectEvent *event2 = NULL; + virDomainDef *config = NULL; + virDomainSnapshotDef *snapdef; int ret = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING | @@ -8887,25 +8880,25 @@ testDomainCheckpointDiscardAll(void *payload, const char *name G_GNUC_UNUSED, void *data) { - virDomainMomentObjPtr chk = payload; - testMomentRemoveDataPtr curr = data; + virDomainMomentObj *chk = payload; + testMomentRemoveData *curr = data; curr->current |= virDomainCheckpointObjListRemove(curr->vm->checkpoints, chk); return 0; } -static virDomainObjPtr +static virDomainObj * testDomObjFromCheckpoint(virDomainCheckpointPtr checkpoint) { return testDomObjFromDomain(checkpoint->domain); } -static virDomainMomentObjPtr -testCheckpointObjFromName(virDomainObjPtr vm, +static virDomainMomentObj * +testCheckpointObjFromName(virDomainObj *vm, const char *name) { - virDomainMomentObjPtr chk = NULL; + virDomainMomentObj *chk = NULL; chk = virDomainCheckpointFindByName(vm->checkpoints, name); if (!chk) @@ -8916,8 +8909,8 @@ testCheckpointObjFromName(virDomainObjPtr vm, return chk; } -static virDomainMomentObjPtr -testCheckpointObjFromCheckpoint(virDomainObjPtr vm, +static virDomainMomentObj * +testCheckpointObjFromCheckpoint(virDomainObj *vm, virDomainCheckpointPtr checkpoint) { return testCheckpointObjFromName(vm, checkpoint->name); @@ -8928,11 +8921,11 @@ testDomainCheckpointCreateXML(virDomainPtr domain, const char *xmlDesc, unsigned int flags) { - testDriverPtr privconn = domain->conn->privateData; - virDomainObjPtr vm = NULL; - virDomainMomentObjPtr chk = NULL; + testDriver *privconn = domain->conn->privateData; + virDomainObj *vm = NULL; + virDomainMomentObj *chk = NULL; virDomainCheckpointPtr checkpoint = NULL; - virDomainMomentObjPtr current = NULL; + virDomainMomentObj *current = NULL; bool update_current = true; bool redefine = flags & VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE; unsigned int parse_flags = 0; @@ -9024,7 +9017,7 @@ testDomainListAllCheckpoints(virDomainPtr domain, virDomainCheckpointPtr **chks, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_CHECKPOINT_LIST_ROOTS | @@ -9046,8 +9039,8 @@ testDomainCheckpointListAllChildren(virDomainCheckpointPtr checkpoint, virDomainCheckpointPtr **chks, unsigned int flags) { - virDomainObjPtr vm = NULL; - virDomainMomentObjPtr chk = NULL; + virDomainObj *vm = NULL; + virDomainMomentObj *chk = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_CHECKPOINT_LIST_DESCENDANTS | @@ -9074,8 +9067,8 @@ testDomainCheckpointLookupByName(virDomainPtr domain, const char *name, unsigned int flags) { - virDomainObjPtr vm; - virDomainMomentObjPtr chk = NULL; + virDomainObj *vm; + virDomainMomentObj *chk = NULL; virDomainCheckpointPtr checkpoint = NULL; virCheckFlags(0, NULL); @@ -9098,8 +9091,8 @@ static virDomainCheckpointPtr testDomainCheckpointGetParent(virDomainCheckpointPtr checkpoint, unsigned int flags) { - virDomainObjPtr vm; - virDomainMomentObjPtr chk = NULL; + virDomainObj *vm; + virDomainMomentObj *chk = NULL; virDomainCheckpointPtr parent = NULL; virCheckFlags(0, NULL); @@ -9129,12 +9122,12 @@ static char * testDomainCheckpointGetXMLDesc(virDomainCheckpointPtr checkpoint, unsigned int flags) { - testDriverPtr privconn = checkpoint->domain->conn->privateData; - virDomainObjPtr vm = NULL; + testDriver *privconn = checkpoint->domain->conn->privateData; + virDomainObj *vm = NULL; char *xml = NULL; - virDomainMomentObjPtr chk = NULL; + virDomainMomentObj *chk = NULL; size_t i; - virDomainCheckpointDefPtr chkdef; + virDomainCheckpointDef *chkdef; unsigned int format_flags; virCheckFlags(VIR_DOMAIN_CHECKPOINT_XML_SECURE | @@ -9153,7 +9146,7 @@ testDomainCheckpointGetXMLDesc(virDomainCheckpointPtr checkpoint, goto cleanup; for (i = 0; i < chkdef->ndisks; i++) { - virDomainCheckpointDiskDefPtr disk = &chkdef->disks[i]; + virDomainCheckpointDiskDef *disk = &chkdef->disks[i]; if (disk->type != VIR_DOMAIN_CHECKPOINT_TYPE_BITMAP) continue; @@ -9175,10 +9168,10 @@ static int testDomainCheckpointDelete(virDomainCheckpointPtr checkpoint, unsigned int flags) { - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; int ret = -1; - virDomainMomentObjPtr chk = NULL; - virDomainMomentObjPtr parentchk = NULL; + virDomainMomentObj *chk = NULL; + virDomainMomentObj *parentchk = NULL; virCheckFlags(VIR_DOMAIN_CHECKPOINT_DELETE_CHILDREN | VIR_DOMAIN_CHECKPOINT_DELETE_METADATA_ONLY | diff --git a/src/util/virarptable.c b/src/util/virarptable.c index 6abf5b454a..3b9ece3d9b 100644 --- a/src/util/virarptable.c +++ b/src/util/virarptable.c @@ -61,13 +61,13 @@ parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len) } -virArpTablePtr +virArpTable * virArpTableGet(void) { int num = 0; int msglen; g_autofree void *nlData = NULL; - virArpTablePtr table = NULL; + virArpTable *table = NULL; struct nlmsghdr* nh; struct rtattr * tb[NDA_MAX+1]; @@ -152,7 +152,7 @@ virArpTableGet(void) #else -virArpTablePtr +virArpTable * virArpTableGet(void) { virReportError(VIR_ERR_NO_SUPPORT, "%s", @@ -163,7 +163,7 @@ virArpTableGet(void) #endif /* __linux__ */ void -virArpTableFree(virArpTablePtr table) +virArpTableFree(virArpTable *table) { size_t i; diff --git a/src/util/virarptable.h b/src/util/virarptable.h index 812524d721..825c7966b7 100644 --- a/src/util/virarptable.h +++ b/src/util/virarptable.h @@ -23,9 +23,7 @@ #include "internal.h" typedef struct _virArpTableEntry virArpTableEntry; -typedef virArpTableEntry *virArpTableEntryPtr; typedef struct _virArpTable virArpTable; -typedef virArpTable *virArpTablePtr; struct _virArpTableEntry{ char *ipaddr; @@ -34,8 +32,8 @@ struct _virArpTableEntry{ struct _virArpTable { int n; - virArpTableEntryPtr t; + virArpTableEntry *t; }; -virArpTablePtr virArpTableGet(void); -void virArpTableFree(virArpTablePtr table); +virArpTable *virArpTableGet(void); +void virArpTableFree(virArpTable *table); diff --git a/src/util/viraudit.c b/src/util/viraudit.c index 6729790a26..bbd2462897 100644 --- a/src/util/viraudit.c +++ b/src/util/viraudit.c @@ -72,7 +72,7 @@ void virAuditLog(bool logging) } -void virAuditSend(virLogSourcePtr source, +void virAuditSend(virLogSource *source, const char *filename, size_t linenr, const char *funcname, diff --git a/src/util/viraudit.h b/src/util/viraudit.h index a36cc77ca6..bc2325da58 100644 --- a/src/util/viraudit.h +++ b/src/util/viraudit.h @@ -34,7 +34,7 @@ int virAuditOpen(unsigned int audit_level); void virAuditLog(bool enabled); -void virAuditSend(virLogSourcePtr source, +void virAuditSend(virLogSource *source, const char *filename, size_t linenr, const char *funcname, const char *clienttty, const char *clientaddr, virAuditRecordType type, bool success, diff --git a/src/util/virauth.c b/src/util/virauth.c index 105fca16eb..e7fe8c97dd 100644 --- a/src/util/virauth.c +++ b/src/util/virauth.c @@ -38,7 +38,7 @@ VIR_LOG_INIT("util.auth"); int -virAuthGetConfigFilePathURI(virURIPtr uri, +virAuthGetConfigFilePathURI(virURI *uri, char **path) { size_t i; diff --git a/src/util/virauth.h b/src/util/virauth.h index d91a545ed2..a0fd84962b 100644 --- a/src/util/virauth.h +++ b/src/util/virauth.h @@ -28,7 +28,7 @@ int virAuthGetConfigFilePath(virConnectPtr conn, char **path); -int virAuthGetConfigFilePathURI(virURIPtr uri, +int virAuthGetConfigFilePathURI(virURI *uri, char **path); diff --git a/src/util/virauthconfig.c b/src/util/virauthconfig.c index 0fc1b5c589..63d9cebdf7 100644 --- a/src/util/virauthconfig.c +++ b/src/util/virauthconfig.c @@ -36,9 +36,9 @@ struct _virAuthConfig { VIR_LOG_INIT("util.authconfig"); -virAuthConfigPtr virAuthConfigNew(const char *path) +virAuthConfig *virAuthConfigNew(const char *path) { - virAuthConfigPtr auth; + virAuthConfig *auth; auth = g_new0(virAuthConfig, 1); @@ -58,11 +58,11 @@ virAuthConfigPtr virAuthConfigNew(const char *path) } -virAuthConfigPtr virAuthConfigNewData(const char *path, +virAuthConfig *virAuthConfigNewData(const char *path, const char *data, size_t len) { - virAuthConfigPtr auth; + virAuthConfig *auth; auth = g_new0(virAuthConfig, 1); @@ -82,7 +82,7 @@ virAuthConfigPtr virAuthConfigNewData(const char *path, } -void virAuthConfigFree(virAuthConfigPtr auth) +void virAuthConfigFree(virAuthConfig *auth) { if (!auth) return; @@ -93,7 +93,7 @@ void virAuthConfigFree(virAuthConfigPtr auth) } -int virAuthConfigLookup(virAuthConfigPtr auth, +int virAuthConfigLookup(virAuthConfig *auth, const char *service, const char *hostname, const char *credname, diff --git a/src/util/virauthconfig.h b/src/util/virauthconfig.h index b6f5b5c110..4929f138fe 100644 --- a/src/util/virauthconfig.h +++ b/src/util/virauthconfig.h @@ -23,17 +23,15 @@ #include "internal.h" typedef struct _virAuthConfig virAuthConfig; -typedef virAuthConfig *virAuthConfigPtr; - -virAuthConfigPtr virAuthConfigNew(const char *path); -virAuthConfigPtr virAuthConfigNewData(const char *path, +virAuthConfig *virAuthConfigNew(const char *path); +virAuthConfig *virAuthConfigNewData(const char *path, const char *data, size_t len); -void virAuthConfigFree(virAuthConfigPtr auth); +void virAuthConfigFree(virAuthConfig *auth); -int virAuthConfigLookup(virAuthConfigPtr auth, +int virAuthConfigLookup(virAuthConfig *auth, const char *service, const char *hostname, const char *credname, diff --git a/src/util/virbitmap.c b/src/util/virbitmap.c index 9242af6fb5..ee76fec8cd 100644 --- a/src/util/virbitmap.c +++ b/src/util/virbitmap.c @@ -57,10 +57,10 @@ struct _virBitmap { * * Returns a pointer to the allocated bitmap. */ -virBitmapPtr +virBitmap * virBitmapNew(size_t size) { - virBitmapPtr bitmap; + virBitmap *bitmap; size_t sz; if (SIZE_MAX - VIR_BITMAP_BITS_PER_UNIT < size) { @@ -91,7 +91,7 @@ virBitmapNew(size_t size) * Free @bitmap previously allocated by virBitmapNew. */ void -virBitmapFree(virBitmapPtr bitmap) +virBitmapFree(virBitmap *bitmap) { if (bitmap) { g_free(bitmap->map); @@ -110,7 +110,7 @@ virBitmapFree(virBitmapPtr bitmap) * Returns 0 on if bit is successfully set, -1 on error. */ int -virBitmapSetBit(virBitmapPtr bitmap, +virBitmapSetBit(virBitmap *bitmap, size_t b) { if (bitmap->nbits <= b) @@ -132,7 +132,7 @@ virBitmapSetBit(virBitmapPtr bitmap, * Returns 0 on success, -1 on error. */ static int -virBitmapExpand(virBitmapPtr map, +virBitmapExpand(virBitmap *map, size_t b) { size_t new_len = VIR_DIV_UP(b + 1, VIR_BITMAP_BITS_PER_UNIT); @@ -161,7 +161,7 @@ virBitmapExpand(virBitmapPtr map, * Returns 0 on if bit is successfully set, -1 on error. */ int -virBitmapSetBitExpand(virBitmapPtr bitmap, +virBitmapSetBitExpand(virBitmap *bitmap, size_t b) { if (bitmap->nbits <= b && virBitmapExpand(bitmap, b) < 0) @@ -182,7 +182,7 @@ virBitmapSetBitExpand(virBitmapPtr bitmap, * Returns 0 on if bit is successfully clear, -1 on error. */ int -virBitmapClearBit(virBitmapPtr bitmap, +virBitmapClearBit(virBitmap *bitmap, size_t b) { if (bitmap->nbits <= b) @@ -204,7 +204,7 @@ virBitmapClearBit(virBitmapPtr bitmap, * Returns 0 on if bit is successfully cleared, -1 on error. */ int -virBitmapClearBitExpand(virBitmapPtr bitmap, +virBitmapClearBitExpand(virBitmap *bitmap, size_t b) { if (bitmap->nbits <= b) { @@ -220,7 +220,7 @@ virBitmapClearBitExpand(virBitmapPtr bitmap, /* Helper function. caller must ensure b < bitmap->nbits */ static bool -virBitmapIsSet(virBitmapPtr bitmap, size_t b) +virBitmapIsSet(virBitmap *bitmap, size_t b) { return !!(bitmap->map[VIR_BITMAP_UNIT_OFFSET(b)] & VIR_BITMAP_BIT(b)); } @@ -237,7 +237,7 @@ virBitmapIsSet(virBitmapPtr bitmap, size_t b) * Otherwise false is returned. */ bool -virBitmapIsBitSet(virBitmapPtr bitmap, +virBitmapIsBitSet(virBitmap *bitmap, size_t b) { if (bitmap->nbits <= b) @@ -259,7 +259,7 @@ virBitmapIsBitSet(virBitmapPtr bitmap, * returned. On failure, -1 is returned and @result is unchanged. */ int -virBitmapGetBit(virBitmapPtr bitmap, +virBitmapGetBit(virBitmap *bitmap, size_t b, bool *result) { @@ -282,7 +282,7 @@ virBitmapGetBit(virBitmapPtr bitmap, * Returns pointer to the string or NULL on error. */ char * -virBitmapToString(virBitmapPtr bitmap) +virBitmapToString(virBitmap *bitmap) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t sz; @@ -335,7 +335,7 @@ virBitmapToString(virBitmapPtr bitmap) * VIR_FREE to free the string. */ char * -virBitmapFormat(virBitmapPtr bitmap) +virBitmapFormat(virBitmap *bitmap) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; bool first = true; @@ -400,7 +400,7 @@ virBitmapFormat(virBitmapPtr bitmap) int virBitmapParseSeparator(const char *str, char terminator, - virBitmapPtr *bitmap, + virBitmap **bitmap, size_t bitmapSize) { bool neg = false; @@ -512,7 +512,7 @@ virBitmapParseSeparator(const char *str, */ int virBitmapParse(const char *str, - virBitmapPtr *bitmap, + virBitmap **bitmap, size_t bitmapSize) { return virBitmapParseSeparator(str, '\0', bitmap, bitmapSize); @@ -534,10 +534,10 @@ virBitmapParse(const char *str, * * Returns @bitmap on success, or NULL in case of error */ -virBitmapPtr +virBitmap * virBitmapParseUnlimited(const char *str) { - virBitmapPtr bitmap = virBitmapNew(0); + virBitmap *bitmap = virBitmapNew(0); bool neg = false; const char *cur = str; char *tmp; @@ -633,10 +633,10 @@ virBitmapParseUnlimited(const char *str) * * Returns a copy of bitmap @src. */ -virBitmapPtr -virBitmapNewCopy(virBitmapPtr src) +virBitmap * +virBitmapNewCopy(virBitmap *src) { - virBitmapPtr dst = virBitmapNew(src->nbits); + virBitmap *dst = virBitmapNew(src->nbits); memcpy(dst->map, src->map, src->map_len * sizeof(src->map[0])); @@ -655,11 +655,11 @@ virBitmapNewCopy(virBitmapPtr src) * Returns a pointer to the allocated bitmap or NULL if * memory cannot be allocated. */ -virBitmapPtr +virBitmap * virBitmapNewData(const void *data, int len) { - virBitmapPtr bitmap; + virBitmap *bitmap; size_t i, j; unsigned long *p; const unsigned char *bytes = data; @@ -692,7 +692,7 @@ virBitmapNewData(const void *data, * Returns 0 on success, -1 otherwise. */ int -virBitmapToData(virBitmapPtr bitmap, +virBitmapToData(virBitmap *bitmap, unsigned char **data, int *dataLen) { @@ -722,7 +722,7 @@ virBitmapToData(virBitmapPtr bitmap, * lower bits. */ void -virBitmapToDataBuf(virBitmapPtr bitmap, +virBitmapToDataBuf(virBitmap *bitmap, unsigned char *bytes, size_t len) { @@ -758,10 +758,10 @@ virBitmapToDataBuf(virBitmapPtr bitmap, * otherwise false. */ bool -virBitmapEqual(virBitmapPtr b1, - virBitmapPtr b2) +virBitmapEqual(virBitmap *b1, + virBitmap *b2) { - virBitmapPtr tmp; + virBitmap *tmp; size_t i; if (!b1 && !b2) @@ -799,7 +799,7 @@ virBitmapEqual(virBitmapPtr b1, * Returns number of bits @bitmap can store. */ size_t -virBitmapSize(virBitmapPtr bitmap) +virBitmapSize(virBitmap *bitmap) { return bitmap->nbits; } @@ -811,7 +811,7 @@ virBitmapSize(virBitmapPtr bitmap) * * set all bits in @bitmap. */ -void virBitmapSetAll(virBitmapPtr bitmap) +void virBitmapSetAll(virBitmap *bitmap) { int tail = bitmap->nbits % VIR_BITMAP_BITS_PER_UNIT; @@ -832,7 +832,7 @@ void virBitmapSetAll(virBitmapPtr bitmap) * clear all bits in @bitmap. */ void -virBitmapClearAll(virBitmapPtr bitmap) +virBitmapClearAll(virBitmap *bitmap) { memset(bitmap->map, 0, bitmap->map_len * (VIR_BITMAP_BITS_PER_UNIT / CHAR_BIT)); @@ -846,7 +846,7 @@ virBitmapClearAll(virBitmapPtr bitmap) * check if all bits in @bitmap are set. */ bool -virBitmapIsAllSet(virBitmapPtr bitmap) +virBitmapIsAllSet(virBitmap *bitmap) { size_t i; int unusedBits; @@ -879,7 +879,7 @@ virBitmapIsAllSet(virBitmapPtr bitmap) * check if all bits in @bitmap are clear */ bool -virBitmapIsAllClear(virBitmapPtr bitmap) +virBitmapIsAllClear(virBitmap *bitmap) { size_t i; @@ -903,7 +903,7 @@ virBitmapIsAllClear(virBitmapPtr bitmap) * Returns the position of the found bit, or -1 if no bit found. */ ssize_t -virBitmapNextSetBit(virBitmapPtr bitmap, +virBitmapNextSetBit(virBitmap *bitmap, ssize_t pos) { size_t nl; @@ -942,7 +942,7 @@ virBitmapNextSetBit(virBitmapPtr bitmap, * Returns the position of the found bit, or -1 if no bit is set. */ ssize_t -virBitmapLastSetBit(virBitmapPtr bitmap) +virBitmapLastSetBit(virBitmap *bitmap) { ssize_t i; int unusedBits; @@ -995,7 +995,7 @@ virBitmapLastSetBit(virBitmapPtr bitmap) * Returns the position of the found bit, or -1 if no bit found. */ ssize_t -virBitmapNextClearBit(virBitmapPtr bitmap, +virBitmapNextClearBit(virBitmap *bitmap, ssize_t pos) { size_t nl; @@ -1039,7 +1039,7 @@ virBitmapNextClearBit(virBitmapPtr bitmap, * Return the number of bits currently set in @bitmap. */ size_t -virBitmapCountBits(virBitmapPtr bitmap) +virBitmapCountBits(virBitmap *bitmap) { size_t i; size_t ret = 0; @@ -1064,10 +1064,10 @@ virBitmapCountBits(virBitmapPtr bitmap) * Returns a pointer to the allocated bitmap or NULL and reports an error if * @string can't be converted. */ -virBitmapPtr +virBitmap * virBitmapNewString(const char *string) { - virBitmapPtr bitmap; + virBitmap *bitmap; size_t i = 0; size_t len = strlen(string); @@ -1121,13 +1121,13 @@ virBitmapDataFormat(const void *data, * @b2. */ bool -virBitmapOverlaps(virBitmapPtr b1, - virBitmapPtr b2) +virBitmapOverlaps(virBitmap *b1, + virBitmap *b2) { size_t i; if (b1->nbits > b2->nbits) { - virBitmapPtr tmp = b1; + virBitmap *tmp = b1; b1 = b2; b2 = tmp; } @@ -1149,8 +1149,8 @@ virBitmapOverlaps(virBitmapPtr b1, * Performs intersection of two bitmaps: a = intersect(a, b) */ void -virBitmapIntersect(virBitmapPtr a, - virBitmapPtr b) +virBitmapIntersect(virBitmap *a, + virBitmap *b) { size_t i; size_t max = a->map_len; @@ -1173,7 +1173,7 @@ virBitmapIntersect(virBitmapPtr a, * Returns 0 on success, <0 on failure. */ int -virBitmapUnion(virBitmapPtr a, +virBitmapUnion(virBitmap *a, const virBitmap *b) { size_t i; @@ -1198,8 +1198,8 @@ virBitmapUnion(virBitmapPtr a, * Performs subtraction of two bitmaps: a = a - b */ void -virBitmapSubtract(virBitmapPtr a, - virBitmapPtr b) +virBitmapSubtract(virBitmap *a, + virBitmap *b) { size_t i; size_t max = a->map_len; @@ -1221,7 +1221,7 @@ virBitmapSubtract(virBitmapPtr a, * smaller than or equal to @b. */ void -virBitmapShrink(virBitmapPtr map, +virBitmapShrink(virBitmap *map, size_t b) { size_t toremove; diff --git a/src/util/virbitmap.h b/src/util/virbitmap.h index 67a433672d..026659544e 100644 --- a/src/util/virbitmap.h +++ b/src/util/virbitmap.h @@ -27,125 +27,124 @@ typedef struct _virBitmap virBitmap; -typedef virBitmap *virBitmapPtr; /* * Allocate a bitmap capable of containing @size bits. */ -virBitmapPtr virBitmapNew(size_t size); +virBitmap *virBitmapNew(size_t size); /* * Free previously allocated bitmap */ -void virBitmapFree(virBitmapPtr bitmap); +void virBitmapFree(virBitmap *bitmap); /* * Set bit position @b in @bitmap */ -int virBitmapSetBit(virBitmapPtr bitmap, size_t b) +int virBitmapSetBit(virBitmap *bitmap, size_t b) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -int virBitmapSetBitExpand(virBitmapPtr bitmap, size_t b) +int virBitmapSetBitExpand(virBitmap *bitmap, size_t b) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; /* * Clear bit position @b in @bitmap */ -int virBitmapClearBit(virBitmapPtr bitmap, size_t b) +int virBitmapClearBit(virBitmap *bitmap, size_t b) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -int virBitmapClearBitExpand(virBitmapPtr bitmap, size_t b) +int virBitmapClearBitExpand(virBitmap *bitmap, size_t b) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; /* * Get bit @b in @bitmap. Returns false if b is out of range. */ -bool virBitmapIsBitSet(virBitmapPtr bitmap, size_t b) +bool virBitmapIsBitSet(virBitmap *bitmap, size_t b) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; /* * Get setting of bit position @b in @bitmap and store in @result */ -int virBitmapGetBit(virBitmapPtr bitmap, size_t b, bool *result) +int virBitmapGetBit(virBitmap *bitmap, size_t b, bool *result) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) G_GNUC_WARN_UNUSED_RESULT; -virBitmapPtr +virBitmap * virBitmapNewString(const char *string) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -char *virBitmapToString(virBitmapPtr bitmap) +char *virBitmapToString(virBitmap *bitmap) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -char *virBitmapFormat(virBitmapPtr bitmap); +char *virBitmapFormat(virBitmap *bitmap); int virBitmapParse(const char *str, - virBitmapPtr *bitmap, + virBitmap **bitmap, size_t bitmapSize) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int virBitmapParseSeparator(const char *str, char terminator, - virBitmapPtr *bitmap, + virBitmap **bitmap, size_t bitmapSize); -virBitmapPtr +virBitmap * virBitmapParseUnlimited(const char *str); -virBitmapPtr virBitmapNewCopy(virBitmapPtr src) ATTRIBUTE_NONNULL(1); +virBitmap *virBitmapNewCopy(virBitmap *src) ATTRIBUTE_NONNULL(1); -virBitmapPtr virBitmapNewData(const void *data, int len) ATTRIBUTE_NONNULL(1); +virBitmap *virBitmapNewData(const void *data, int len) ATTRIBUTE_NONNULL(1); -int virBitmapToData(virBitmapPtr bitmap, unsigned char **data, int *dataLen) +int virBitmapToData(virBitmap *bitmap, unsigned char **data, int *dataLen) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); -void virBitmapToDataBuf(virBitmapPtr bitmap, unsigned char *data, size_t len) +void virBitmapToDataBuf(virBitmap *bitmap, unsigned char *data, size_t len) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -bool virBitmapEqual(virBitmapPtr b1, virBitmapPtr b2); +bool virBitmapEqual(virBitmap *b1, virBitmap *b2); -size_t virBitmapSize(virBitmapPtr bitmap) +size_t virBitmapSize(virBitmap *bitmap) ATTRIBUTE_NONNULL(1); -void virBitmapSetAll(virBitmapPtr bitmap) +void virBitmapSetAll(virBitmap *bitmap) ATTRIBUTE_NONNULL(1); -void virBitmapClearAll(virBitmapPtr bitmap) +void virBitmapClearAll(virBitmap *bitmap) ATTRIBUTE_NONNULL(1); -bool virBitmapIsAllSet(virBitmapPtr bitmap) +bool virBitmapIsAllSet(virBitmap *bitmap) ATTRIBUTE_NONNULL(1); -bool virBitmapIsAllClear(virBitmapPtr bitmap) +bool virBitmapIsAllClear(virBitmap *bitmap) ATTRIBUTE_NONNULL(1); -ssize_t virBitmapNextSetBit(virBitmapPtr bitmap, ssize_t pos) +ssize_t virBitmapNextSetBit(virBitmap *bitmap, ssize_t pos) ATTRIBUTE_NONNULL(1); -ssize_t virBitmapLastSetBit(virBitmapPtr bitmap) +ssize_t virBitmapLastSetBit(virBitmap *bitmap) ATTRIBUTE_NONNULL(1); -ssize_t virBitmapNextClearBit(virBitmapPtr bitmap, ssize_t pos) +ssize_t virBitmapNextClearBit(virBitmap *bitmap, ssize_t pos) ATTRIBUTE_NONNULL(1); -size_t virBitmapCountBits(virBitmapPtr bitmap) +size_t virBitmapCountBits(virBitmap *bitmap) ATTRIBUTE_NONNULL(1); char *virBitmapDataFormat(const void *data, int len) ATTRIBUTE_NONNULL(1); -bool virBitmapOverlaps(virBitmapPtr b1, - virBitmapPtr b2) +bool virBitmapOverlaps(virBitmap *b1, + virBitmap *b2) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void virBitmapIntersect(virBitmapPtr a, virBitmapPtr b) +void virBitmapIntersect(virBitmap *a, virBitmap *b) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virBitmapUnion(virBitmapPtr a, +int virBitmapUnion(virBitmap *a, const virBitmap *b) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void virBitmapSubtract(virBitmapPtr a, virBitmapPtr b) +void virBitmapSubtract(virBitmap *a, virBitmap *b) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -void virBitmapShrink(virBitmapPtr map, size_t b); +void virBitmapShrink(virBitmap *map, size_t b); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virBitmap, virBitmapFree); diff --git a/src/util/virbuffer.c b/src/util/virbuffer.c index b9ddf1f5c9..8f9cd57e06 100644 --- a/src/util/virbuffer.c +++ b/src/util/virbuffer.c @@ -41,7 +41,7 @@ * indentation level is truncated. */ void -virBufferAdjustIndent(virBufferPtr buf, int indent) +virBufferAdjustIndent(virBuffer *buf, int indent) { if (!buf) return; @@ -71,7 +71,7 @@ virBufferAdjustIndent(virBufferPtr buf, int indent) * indentation is applied. */ void -virBufferSetIndent(virBufferPtr buf, int indent) +virBufferSetIndent(virBuffer *buf, int indent) { if (!buf) return; @@ -117,7 +117,7 @@ virBufferGetEffectiveIndent(const virBuffer *buf) * Ensures that the internal GString container is allocated. */ static void -virBufferInitialize(virBufferPtr buf) +virBufferInitialize(virBuffer *buf) { if (!buf->str) buf->str = g_string_new(NULL); @@ -125,7 +125,7 @@ virBufferInitialize(virBufferPtr buf) static void -virBufferApplyIndent(virBufferPtr buf) +virBufferApplyIndent(virBuffer *buf) { const char space[] = " "; size_t spacesz = sizeof(space) - 1; @@ -154,7 +154,7 @@ virBufferApplyIndent(virBufferPtr buf) * */ void -virBufferAdd(virBufferPtr buf, const char *str, int len) +virBufferAdd(virBuffer *buf, const char *str, int len) { if (!str || !buf) return; @@ -180,7 +180,7 @@ virBufferAdd(virBufferPtr buf, const char *str, int len) * The @toadd virBuffer is consumed and cleared. */ void -virBufferAddBuffer(virBufferPtr buf, virBufferPtr toadd) +virBufferAddBuffer(virBuffer *buf, virBuffer *toadd) { if (!toadd || !toadd->str) return; @@ -204,7 +204,7 @@ virBufferAddBuffer(virBufferPtr buf, virBufferPtr toadd) * */ void -virBufferAddChar(virBufferPtr buf, char c) +virBufferAddChar(virBuffer *buf, char c) { virBufferAdd(buf, &c, 1); } @@ -220,7 +220,7 @@ virBufferAddChar(virBufferPtr buf, char c) * Returns the buffer content or NULL in case of error. */ const char * -virBufferCurrentContent(virBufferPtr buf) +virBufferCurrentContent(virBuffer *buf) { if (!buf) return NULL; @@ -245,7 +245,7 @@ virBufferCurrentContent(virBufferPtr buf) * Returns the buffer content or NULL in case of error. */ char * -virBufferContentAndReset(virBufferPtr buf) +virBufferContentAndReset(virBuffer *buf) { char *str = NULL; @@ -265,7 +265,7 @@ virBufferContentAndReset(virBufferPtr buf) * * Frees the buffer content and resets the buffer structure. */ -void virBufferFreeAndReset(virBufferPtr buf) +void virBufferFreeAndReset(virBuffer *buf) { if (!buf) return; @@ -300,7 +300,7 @@ virBufferUse(const virBuffer *buf) * Do a formatted print to an XML buffer. Auto indentation may be applied. */ void -virBufferAsprintf(virBufferPtr buf, const char *format, ...) +virBufferAsprintf(virBuffer *buf, const char *format, ...) { va_list argptr; va_start(argptr, format); @@ -317,7 +317,7 @@ virBufferAsprintf(virBufferPtr buf, const char *format, ...) * Do a formatted print to an XML buffer. Auto indentation may be applied. */ void -virBufferVasprintf(virBufferPtr buf, const char *format, va_list argptr) +virBufferVasprintf(virBuffer *buf, const char *format, va_list argptr) { if ((format == NULL) || (buf == NULL)) return; @@ -341,7 +341,7 @@ virBufferVasprintf(virBufferPtr buf, const char *format, va_list argptr) * applied. */ void -virBufferEscapeString(virBufferPtr buf, const char *format, const char *str) +virBufferEscapeString(virBuffer *buf, const char *format, const char *str) { int len; g_autofree char *escaped = NULL; @@ -429,7 +429,7 @@ virBufferEscapeString(virBufferPtr buf, const char *format, const char *str) * to work. Auto indentation may be applied. */ void -virBufferEscapeSexpr(virBufferPtr buf, +virBufferEscapeSexpr(virBuffer *buf, const char *format, const char *str) { @@ -448,7 +448,7 @@ virBufferEscapeSexpr(virBufferPtr buf, * indentation may be applied. */ void -virBufferEscapeRegex(virBufferPtr buf, +virBufferEscapeRegex(virBuffer *buf, const char *format, const char *str) { @@ -467,7 +467,7 @@ virBufferEscapeRegex(virBufferPtr buf, * Auto indentation may be applied. */ void -virBufferEscapeSQL(virBufferPtr buf, +virBufferEscapeSQL(virBuffer *buf, const char *format, const char *str) { @@ -489,7 +489,7 @@ virBufferEscapeSQL(virBufferPtr buf, * Auto indentation may be applied. */ void -virBufferEscape(virBufferPtr buf, char escape, const char *toescape, +virBufferEscape(virBuffer *buf, char escape, const char *toescape, const char *format, const char *str) { int len; @@ -532,7 +532,7 @@ virBufferEscape(virBufferPtr buf, char escape, const char *toescape, * with '%xx' hex sequences). Auto indentation may be applied. */ void -virBufferURIEncodeString(virBufferPtr buf, const char *str) +virBufferURIEncodeString(virBuffer *buf, const char *str) { if ((buf == NULL) || (str == NULL)) return; @@ -552,7 +552,7 @@ virBufferURIEncodeString(virBufferPtr buf, const char *str) * quoted string to mean str. Auto indentation may be applied. */ void -virBufferEscapeShell(virBufferPtr buf, const char *str) +virBufferEscapeShell(virBuffer *buf, const char *str) { int len; g_autofree char *escaped = NULL; @@ -604,7 +604,7 @@ virBufferEscapeShell(virBufferPtr buf, const char *str) * See virBufferStrcat. */ void -virBufferStrcatVArgs(virBufferPtr buf, +virBufferStrcatVArgs(virBuffer *buf, va_list ap) { char *str; @@ -622,7 +622,7 @@ virBufferStrcatVArgs(virBufferPtr buf, * after each string argument. */ void -virBufferStrcat(virBufferPtr buf, ...) +virBufferStrcat(virBuffer *buf, ...) { va_list ap; @@ -642,7 +642,7 @@ virBufferStrcat(virBufferPtr buf, ...) * Trim the supplied string from the tail of the buffer. */ void -virBufferTrim(virBufferPtr buf, const char *str) +virBufferTrim(virBuffer *buf, const char *str) { size_t len = 0; @@ -670,7 +670,7 @@ virBufferTrim(virBufferPtr buf, const char *str) * the characters from @trim is trimmed. */ void -virBufferTrimChars(virBufferPtr buf, const char *trim) +virBufferTrimChars(virBuffer *buf, const char *trim) { ssize_t i; @@ -696,7 +696,7 @@ virBufferTrimChars(virBufferPtr buf, const char *trim) * Trim the tail of a buffer. */ void -virBufferTrimLen(virBufferPtr buf, int len) +virBufferTrimLen(virBuffer *buf, int len) { if (!buf || !buf->str) return; @@ -716,7 +716,7 @@ virBufferTrimLen(virBufferPtr buf, int len) * @str. */ void -virBufferAddStr(virBufferPtr buf, +virBufferAddStr(virBuffer *buf, const char *str) { const char *end; diff --git a/src/util/virbuffer.h b/src/util/virbuffer.h index e035135c1c..0e72d078a6 100644 --- a/src/util/virbuffer.h +++ b/src/util/virbuffer.h @@ -31,7 +31,6 @@ * A buffer structure. */ typedef struct _virBuffer virBuffer; -typedef virBuffer *virBufferPtr; #define VIR_BUFFER_INITIALIZER { NULL, 0 } @@ -49,49 +48,49 @@ struct _virBuffer { int indent; }; -const char *virBufferCurrentContent(virBufferPtr buf); -char *virBufferContentAndReset(virBufferPtr buf); -void virBufferFreeAndReset(virBufferPtr buf); +const char *virBufferCurrentContent(virBuffer *buf); +char *virBufferContentAndReset(virBuffer *buf); +void virBufferFreeAndReset(virBuffer *buf); G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virBuffer, virBufferFreeAndReset); size_t virBufferUse(const virBuffer *buf); -void virBufferAdd(virBufferPtr buf, const char *str, int len); -void virBufferAddBuffer(virBufferPtr buf, virBufferPtr toadd); -void virBufferAddChar(virBufferPtr buf, char c); -void virBufferAsprintf(virBufferPtr buf, const char *format, ...) +void virBufferAdd(virBuffer *buf, const char *str, int len); +void virBufferAddBuffer(virBuffer *buf, virBuffer *toadd); +void virBufferAddChar(virBuffer *buf, char c); +void virBufferAsprintf(virBuffer *buf, const char *format, ...) G_GNUC_PRINTF(2, 3); -void virBufferVasprintf(virBufferPtr buf, const char *format, va_list ap) +void virBufferVasprintf(virBuffer *buf, const char *format, va_list ap) G_GNUC_PRINTF(2, 0); -void virBufferStrcat(virBufferPtr buf, ...) +void virBufferStrcat(virBuffer *buf, ...) G_GNUC_NULL_TERMINATED; -void virBufferStrcatVArgs(virBufferPtr buf, va_list ap); +void virBufferStrcatVArgs(virBuffer *buf, va_list ap); -void virBufferEscape(virBufferPtr buf, char escape, const char *toescape, +void virBufferEscape(virBuffer *buf, char escape, const char *toescape, const char *format, const char *str); -void virBufferEscapeString(virBufferPtr buf, const char *format, +void virBufferEscapeString(virBuffer *buf, const char *format, const char *str); -void virBufferEscapeSexpr(virBufferPtr buf, const char *format, +void virBufferEscapeSexpr(virBuffer *buf, const char *format, const char *str); -void virBufferEscapeRegex(virBufferPtr buf, +void virBufferEscapeRegex(virBuffer *buf, const char *format, const char *str); -void virBufferEscapeSQL(virBufferPtr buf, +void virBufferEscapeSQL(virBuffer *buf, const char *format, const char *str); -void virBufferEscapeShell(virBufferPtr buf, const char *str); -void virBufferURIEncodeString(virBufferPtr buf, const char *str); +void virBufferEscapeShell(virBuffer *buf, const char *str); +void virBufferURIEncodeString(virBuffer *buf, const char *str); #define virBufferAddLit(buf_, literal_string_) \ virBufferAdd(buf_, "" literal_string_ "", sizeof(literal_string_) - 1) -void virBufferAdjustIndent(virBufferPtr buf, int indent); -void virBufferSetIndent(virBufferPtr, int indent); +void virBufferAdjustIndent(virBuffer *buf, int indent); +void virBufferSetIndent(virBuffer *, int indent); size_t virBufferGetIndent(const virBuffer *buf); size_t virBufferGetEffectiveIndent(const virBuffer *buf); -void virBufferTrim(virBufferPtr buf, const char *trim); -void virBufferTrimChars(virBufferPtr buf, const char *trim); -void virBufferTrimLen(virBufferPtr buf, int len); -void virBufferAddStr(virBufferPtr buf, const char *str); +void virBufferTrim(virBuffer *buf, const char *trim); +void virBufferTrimChars(virBuffer *buf, const char *trim); +void virBufferTrimLen(virBuffer *buf, int len); +void virBufferAddStr(virBuffer *buf, const char *str); diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c index 5b6097c335..e7a94c47e4 100644 --- a/src/util/vircgroup.c +++ b/src/util/vircgroup.c @@ -107,7 +107,7 @@ bool virCgroupAvailable(void) { size_t i; - virCgroupBackendPtr *backends = virCgroupBackendGetAll(); + virCgroupBackend **backends = virCgroupBackendGetAll(); if (!backends) return false; @@ -214,9 +214,9 @@ virCgroupPartitionEscape(char **path) static int -virCgroupSetBackends(virCgroupPtr group) +virCgroupSetBackends(virCgroup *group) { - virCgroupBackendPtr *backends = virCgroupBackendGetAll(); + virCgroupBackend **backends = virCgroupBackendGetAll(); bool backendAvailable = false; size_t i; @@ -241,8 +241,8 @@ virCgroupSetBackends(virCgroupPtr group) static int -virCgroupCopyMounts(virCgroupPtr group, - virCgroupPtr parent) +virCgroupCopyMounts(virCgroup *group, + virCgroup *parent) { size_t i; @@ -262,7 +262,7 @@ virCgroupCopyMounts(virCgroupPtr group, * mounted and where */ static int -virCgroupDetectMounts(virCgroupPtr group) +virCgroupDetectMounts(virCgroup *group) { FILE *mounts = NULL; struct mntent entry; @@ -296,9 +296,9 @@ virCgroupDetectMounts(virCgroupPtr group) static int -virCgroupCopyPlacement(virCgroupPtr group, +virCgroupCopyPlacement(virCgroup *group, const char *path, - virCgroupPtr parent) + virCgroup *parent) { size_t i; @@ -336,7 +336,7 @@ virCgroupCopyPlacement(virCgroupPtr group, * It then appends @path to each detected path. */ static int -virCgroupDetectPlacement(virCgroupPtr group, +virCgroupDetectPlacement(virCgroup *group, pid_t pid, const char *path) { @@ -395,7 +395,7 @@ virCgroupDetectPlacement(virCgroupPtr group, static int -virCgroupSetPlacement(virCgroupPtr group, +virCgroupSetPlacement(virCgroup *group, const char *path) { size_t i; @@ -412,7 +412,7 @@ virCgroupSetPlacement(virCgroupPtr group, static int -virCgroupValidatePlacement(virCgroupPtr group, +virCgroupValidatePlacement(virCgroup *group, pid_t pid) { size_t i; @@ -429,9 +429,9 @@ virCgroupValidatePlacement(virCgroupPtr group, static int -virCgroupDetectControllers(virCgroupPtr group, +virCgroupDetectControllers(virCgroup *group, int controllers, - virCgroupPtr parent) + virCgroup *parent) { size_t i; int controllersAvailable = 0; @@ -565,7 +565,7 @@ virCgroupGetValueRaw(const char *path, int -virCgroupSetValueStr(virCgroupPtr group, +virCgroupSetValueStr(virCgroup *group, int controller, const char *key, const char *value) @@ -580,7 +580,7 @@ virCgroupSetValueStr(virCgroupPtr group, int -virCgroupGetValueStr(virCgroupPtr group, +virCgroupGetValueStr(virCgroup *group, int controller, const char *key, char **value) @@ -619,7 +619,7 @@ virCgroupGetValueForBlkDev(const char *str, int -virCgroupSetValueU64(virCgroupPtr group, +virCgroupSetValueU64(virCgroup *group, int controller, const char *key, unsigned long long int value) @@ -633,7 +633,7 @@ virCgroupSetValueU64(virCgroupPtr group, int -virCgroupSetValueI64(virCgroupPtr group, +virCgroupSetValueI64(virCgroup *group, int controller, const char *key, long long int value) @@ -647,7 +647,7 @@ virCgroupSetValueI64(virCgroupPtr group, int -virCgroupGetValueI64(virCgroupPtr group, +virCgroupGetValueI64(virCgroup *group, int controller, const char *key, long long int *value) @@ -669,7 +669,7 @@ virCgroupGetValueI64(virCgroupPtr group, int -virCgroupGetValueU64(virCgroupPtr group, +virCgroupGetValueU64(virCgroup *group, int controller, const char *key, unsigned long long int *value) @@ -691,8 +691,8 @@ virCgroupGetValueU64(virCgroupPtr group, static int -virCgroupMakeGroup(virCgroupPtr parent, - virCgroupPtr group, +virCgroupMakeGroup(virCgroup *parent, + virCgroup *group, bool create, pid_t pid, unsigned int flags) @@ -712,7 +712,7 @@ virCgroupMakeGroup(virCgroupPtr parent, static bool -virCgroupExists(virCgroupPtr group) +virCgroupExists(virCgroup *group) { size_t i; @@ -739,7 +739,7 @@ virCgroupExists(virCgroupPtr group) int virCgroupNew(const char *path, int controllers, - virCgroupPtr *group) + virCgroup **group) { g_autoptr(virCgroup) newGroup = NULL; @@ -775,12 +775,12 @@ virCgroupNew(const char *path, static int -virCgroupAddTaskInternal(virCgroupPtr group, +virCgroupAddTaskInternal(virCgroup *group, pid_t pid, unsigned int flags) { size_t i; - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); for (i = 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) { if (parent->backends[i] && @@ -805,7 +805,7 @@ virCgroupAddTaskInternal(virCgroupPtr group, * Returns: 0 on success, -1 on error */ int -virCgroupAddProcess(virCgroupPtr group, pid_t pid) +virCgroupAddProcess(virCgroup *group, pid_t pid) { return virCgroupAddTaskInternal(group, pid, VIR_CGROUP_TASK_PROCESS); } @@ -822,7 +822,7 @@ virCgroupAddProcess(virCgroupPtr group, pid_t pid) * Returns: 0 on success, -1 on error */ int -virCgroupAddMachineProcess(virCgroupPtr group, pid_t pid) +virCgroupAddMachineProcess(virCgroup *group, pid_t pid) { return virCgroupAddTaskInternal(group, pid, VIR_CGROUP_TASK_PROCESS | @@ -841,7 +841,7 @@ virCgroupAddMachineProcess(virCgroupPtr group, pid_t pid) * Returns: 0 on success, -1 on error */ int -virCgroupAddThread(virCgroupPtr group, +virCgroupAddThread(virCgroup *group, pid_t pid) { return virCgroupAddTaskInternal(group, pid, VIR_CGROUP_TASK_THREAD); @@ -893,10 +893,10 @@ virCgroupSetPartitionSuffix(const char *path, char **res) static int -virCgroupNewFromParent(virCgroupPtr parent, +virCgroupNewFromParent(virCgroup *parent, const char *path, int controllers, - virCgroupPtr *group) + virCgroup **group) { g_autoptr(virCgroup) new = g_new0(virCgroup, 1); @@ -941,7 +941,7 @@ int virCgroupNewPartition(const char *path, bool create, int controllers, - virCgroupPtr *group) + virCgroup **group) { g_autofree char *newPath = NULL; g_autoptr(virCgroup) parent = NULL; @@ -998,11 +998,11 @@ virCgroupNewPartition(const char *path, static int -virCgroupNewNested(virCgroupPtr parent, +virCgroupNewNested(virCgroup *parent, int controllers, bool create, pid_t pid, - virCgroupPtr *nested) + virCgroup **nested) { g_autoptr(virCgroup) new = NULL; @@ -1022,7 +1022,7 @@ virCgroupNewNested(virCgroupPtr parent, /** * virCgroupNewSelf: * -* @group: Pointer to returned virCgroupPtr +* @group: Pointer to returned virCgroup * * * Obtain a cgroup representing the config of the * current process @@ -1030,7 +1030,7 @@ virCgroupNewNested(virCgroupPtr parent, * Returns 0 on success, or -1 on error */ int -virCgroupNewSelf(virCgroupPtr *group) +virCgroupNewSelf(virCgroup **group) { return virCgroupNewDetect(-1, -1, group); } @@ -1042,15 +1042,15 @@ virCgroupNewSelf(virCgroupPtr *group) * @partition: partition holding the domain * @driver: name of the driver * @name: name of the domain - * @group: Pointer to returned virCgroupPtr + * @group: Pointer to returned virCgroup * * * Returns 0 on success, or -1 on error */ int -virCgroupNewDomainPartition(virCgroupPtr partition, +virCgroupNewDomainPartition(virCgroup *partition, const char *driver, const char *name, - virCgroupPtr *group) + virCgroup **group) { g_autofree char *grpname = NULL; g_autoptr(virCgroup) newGroup = NULL; @@ -1090,20 +1090,20 @@ virCgroupNewDomainPartition(virCgroupPtr partition, * @name: enum to generate the name for the new thread * @id: id of the vcpu or iothread * @create: true to create if not already existing - * @group: Pointer to returned virCgroupPtr + * @group: Pointer to returned virCgroup * * * Returns 0 on success, or -1 on error */ int -virCgroupNewThread(virCgroupPtr domain, +virCgroupNewThread(virCgroup *domain, virCgroupThreadName nameval, int id, bool create, - virCgroupPtr *group) + virCgroup **group) { g_autofree char *name = NULL; g_autoptr(virCgroup) newGroup = NULL; - virCgroupPtr parent = NULL; + virCgroup *parent = NULL; int controllers; *group = NULL; @@ -1144,7 +1144,7 @@ virCgroupNewThread(virCgroupPtr domain, int virCgroupNewDetect(pid_t pid, int controllers, - virCgroupPtr *group) + virCgroup **group) { g_autoptr(virCgroup) new = g_new0(virCgroup, 1); @@ -1180,7 +1180,7 @@ virCgroupNewDetectMachine(const char *name, pid_t pid, int controllers, char *machinename, - virCgroupPtr *group) + virCgroup **group) { size_t i; g_autoptr(virCgroup) newGroup = NULL; @@ -1223,7 +1223,7 @@ virCgroupNewDetectMachine(const char *name, static int virCgroupEnableMissingControllers(char *path, int controllers, - virCgroupPtr *group) + virCgroup **group) { g_autoptr(virCgroup) parent = NULL; g_auto(GStrv) tokens = g_strsplit(path, "/", 0); @@ -1269,7 +1269,7 @@ virCgroupNewMachineSystemd(const char *name, const char *partition, int controllers, unsigned int maxthreads, - virCgroupPtr *group) + virCgroup **group) { int rv; g_autoptr(virCgroup) init = NULL; @@ -1354,7 +1354,7 @@ virCgroupNewMachineManual(const char *name, pid_t pidleader, const char *partition, int controllers, - virCgroupPtr *group) + virCgroup **group) { g_autoptr(virCgroup) parent = NULL; g_autoptr(virCgroup) newGroup = NULL; @@ -1401,7 +1401,7 @@ virCgroupNewMachine(const char *name, const char *partition, int controllers, unsigned int maxthreads, - virCgroupPtr *group) + virCgroup **group) { int rv; @@ -1457,7 +1457,7 @@ virCgroupNewIgnoreError(void) * with this cgroup object. */ bool -virCgroupHasController(virCgroupPtr cgroup, int controller) +virCgroupHasController(virCgroup *cgroup, int controller) { size_t i; @@ -1478,7 +1478,7 @@ virCgroupHasController(virCgroupPtr cgroup, int controller) int -virCgroupPathOfController(virCgroupPtr group, +virCgroupPathOfController(virCgroup *group, unsigned int controller, const char *key, char **path) @@ -1506,13 +1506,13 @@ virCgroupPathOfController(virCgroupPtr group, * Returns: 0 on success, -1 on error */ int -virCgroupGetBlkioIoServiced(virCgroupPtr group, +virCgroupGetBlkioIoServiced(virCgroup *group, long long *bytes_read, long long *bytes_write, long long *requests_read, long long *requests_write) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_BLKIO, getBlkioIoServiced, -1, @@ -1534,14 +1534,14 @@ virCgroupGetBlkioIoServiced(virCgroupPtr group, * Returns: 0 on success, -1 on error */ int -virCgroupGetBlkioIoDeviceServiced(virCgroupPtr group, +virCgroupGetBlkioIoDeviceServiced(virCgroup *group, const char *path, long long *bytes_read, long long *bytes_write, long long *requests_read, long long *requests_write) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_BLKIO, getBlkioIoDeviceServiced, -1, @@ -1559,7 +1559,7 @@ virCgroupGetBlkioIoDeviceServiced(virCgroupPtr group, * Returns: 0 on success, -1 on error */ int -virCgroupSetBlkioWeight(virCgroupPtr group, unsigned int weight) +virCgroupSetBlkioWeight(virCgroup *group, unsigned int weight) { VIR_CGROUP_BACKEND_CALL(group, VIR_CGROUP_CONTROLLER_BLKIO, setBlkioWeight, -1, weight); @@ -1575,7 +1575,7 @@ virCgroupSetBlkioWeight(virCgroupPtr group, unsigned int weight) * Returns: 0 on success, -1 on error */ int -virCgroupGetBlkioWeight(virCgroupPtr group, unsigned int *weight) +virCgroupGetBlkioWeight(virCgroup *group, unsigned int *weight) { VIR_CGROUP_BACKEND_CALL(group, VIR_CGROUP_CONTROLLER_BLKIO, getBlkioWeight, -1, weight); @@ -1590,11 +1590,11 @@ virCgroupGetBlkioWeight(virCgroupPtr group, unsigned int *weight) * Returns: 0 on success, -1 on error */ static int -virCgroupSetBlkioDeviceReadIops(virCgroupPtr group, +virCgroupSetBlkioDeviceReadIops(virCgroup *group, const char *path, unsigned int riops) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_BLKIO, setBlkioDeviceReadIops, -1, path, riops); @@ -1610,11 +1610,11 @@ virCgroupSetBlkioDeviceReadIops(virCgroupPtr group, * Returns: 0 on success, -1 on error */ static int -virCgroupSetBlkioDeviceWriteIops(virCgroupPtr group, +virCgroupSetBlkioDeviceWriteIops(virCgroup *group, const char *path, unsigned int wiops) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_BLKIO, setBlkioDeviceWriteIops, -1, path, wiops); @@ -1630,11 +1630,11 @@ virCgroupSetBlkioDeviceWriteIops(virCgroupPtr group, * Returns: 0 on success, -1 on error */ static int -virCgroupSetBlkioDeviceReadBps(virCgroupPtr group, +virCgroupSetBlkioDeviceReadBps(virCgroup *group, const char *path, unsigned long long rbps) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_BLKIO, setBlkioDeviceReadBps, -1, path, rbps); @@ -1649,11 +1649,11 @@ virCgroupSetBlkioDeviceReadBps(virCgroupPtr group, * Returns: 0 on success, -1 on error */ static int -virCgroupSetBlkioDeviceWriteBps(virCgroupPtr group, +virCgroupSetBlkioDeviceWriteBps(virCgroup *group, const char *path, unsigned long long wbps) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_BLKIO, setBlkioDeviceWriteBps, -1, path, wbps); @@ -1670,7 +1670,7 @@ virCgroupSetBlkioDeviceWriteBps(virCgroupPtr group, * Returns: 0 on success, -1 on error */ static int -virCgroupSetBlkioDeviceWeight(virCgroupPtr group, +virCgroupSetBlkioDeviceWeight(virCgroup *group, const char *path, unsigned int weight) { @@ -1687,11 +1687,11 @@ virCgroupSetBlkioDeviceWeight(virCgroupPtr group, * Returns: 0 on success, -1 on error */ static int -virCgroupGetBlkioDeviceReadIops(virCgroupPtr group, +virCgroupGetBlkioDeviceReadIops(virCgroup *group, const char *path, unsigned int *riops) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_BLKIO, getBlkioDeviceReadIops, -1, path, riops); @@ -1706,11 +1706,11 @@ virCgroupGetBlkioDeviceReadIops(virCgroupPtr group, * Returns: 0 on success, -1 on error */ static int -virCgroupGetBlkioDeviceWriteIops(virCgroupPtr group, +virCgroupGetBlkioDeviceWriteIops(virCgroup *group, const char *path, unsigned int *wiops) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_BLKIO, getBlkioDeviceWriteIops, -1, path, wiops); @@ -1725,11 +1725,11 @@ virCgroupGetBlkioDeviceWriteIops(virCgroupPtr group, * Returns: 0 on success, -1 on error */ static int -virCgroupGetBlkioDeviceReadBps(virCgroupPtr group, +virCgroupGetBlkioDeviceReadBps(virCgroup *group, const char *path, unsigned long long *rbps) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_BLKIO, getBlkioDeviceReadBps, -1, path, rbps); @@ -1744,11 +1744,11 @@ virCgroupGetBlkioDeviceReadBps(virCgroupPtr group, * Returns: 0 on success, -1 on error */ static int -virCgroupGetBlkioDeviceWriteBps(virCgroupPtr group, +virCgroupGetBlkioDeviceWriteBps(virCgroup *group, const char *path, unsigned long long *wbps) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_BLKIO, getBlkioDeviceWriteBps, -1, path, wbps); @@ -1763,7 +1763,7 @@ virCgroupGetBlkioDeviceWriteBps(virCgroupPtr group, * Returns: 0 on success, -1 on error */ static int -virCgroupGetBlkioDeviceWeight(virCgroupPtr group, +virCgroupGetBlkioDeviceWeight(virCgroup *group, const char *path, unsigned int *weight) { @@ -1781,9 +1781,9 @@ virCgroupGetBlkioDeviceWeight(virCgroupPtr group, * Returns: 0 on success */ int -virCgroupSetMemory(virCgroupPtr group, unsigned long long kb) +virCgroupSetMemory(virCgroup *group, unsigned long long kb) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_MEMORY, setMemory, -1, kb); @@ -1804,7 +1804,7 @@ virCgroupSetMemory(virCgroupPtr group, unsigned long long kb) * Returns: 0 on success, -1 on error */ int -virCgroupGetMemoryStat(virCgroupPtr group, +virCgroupGetMemoryStat(virCgroup *group, unsigned long long *cache, unsigned long long *activeAnon, unsigned long long *inactiveAnon, @@ -1812,7 +1812,7 @@ virCgroupGetMemoryStat(virCgroupPtr group, unsigned long long *inactiveFile, unsigned long long *unevictable) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_MEMORY, getMemoryStat, -1, cache, @@ -1831,9 +1831,9 @@ virCgroupGetMemoryStat(virCgroupPtr group, * Returns: 0 on success */ int -virCgroupGetMemoryUsage(virCgroupPtr group, unsigned long *kb) +virCgroupGetMemoryUsage(virCgroup *group, unsigned long *kb) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_MEMORY, getMemoryUsage, -1, kb); @@ -1849,9 +1849,9 @@ virCgroupGetMemoryUsage(virCgroupPtr group, unsigned long *kb) * Returns: 0 on success */ int -virCgroupSetMemoryHardLimit(virCgroupPtr group, unsigned long long kb) +virCgroupSetMemoryHardLimit(virCgroup *group, unsigned long long kb) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_MEMORY, setMemoryHardLimit, -1, kb); @@ -1867,9 +1867,9 @@ virCgroupSetMemoryHardLimit(virCgroupPtr group, unsigned long long kb) * Returns: 0 on success */ int -virCgroupGetMemoryHardLimit(virCgroupPtr group, unsigned long long *kb) +virCgroupGetMemoryHardLimit(virCgroup *group, unsigned long long *kb) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_MEMORY, getMemoryHardLimit, -1, kb); @@ -1885,9 +1885,9 @@ virCgroupGetMemoryHardLimit(virCgroupPtr group, unsigned long long *kb) * Returns: 0 on success */ int -virCgroupSetMemorySoftLimit(virCgroupPtr group, unsigned long long kb) +virCgroupSetMemorySoftLimit(virCgroup *group, unsigned long long kb) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_MEMORY, setMemorySoftLimit, -1, kb); @@ -1903,9 +1903,9 @@ virCgroupSetMemorySoftLimit(virCgroupPtr group, unsigned long long kb) * Returns: 0 on success */ int -virCgroupGetMemorySoftLimit(virCgroupPtr group, unsigned long long *kb) +virCgroupGetMemorySoftLimit(virCgroup *group, unsigned long long *kb) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_MEMORY, getMemorySoftLimit, -1, kb); @@ -1921,9 +1921,9 @@ virCgroupGetMemorySoftLimit(virCgroupPtr group, unsigned long long *kb) * Returns: 0 on success */ int -virCgroupSetMemSwapHardLimit(virCgroupPtr group, unsigned long long kb) +virCgroupSetMemSwapHardLimit(virCgroup *group, unsigned long long kb) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_MEMORY, setMemSwapHardLimit, -1, kb); @@ -1939,9 +1939,9 @@ virCgroupSetMemSwapHardLimit(virCgroupPtr group, unsigned long long kb) * Returns: 0 on success */ int -virCgroupGetMemSwapHardLimit(virCgroupPtr group, unsigned long long *kb) +virCgroupGetMemSwapHardLimit(virCgroup *group, unsigned long long *kb) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_MEMORY, getMemSwapHardLimit, -1, kb); @@ -1957,9 +1957,9 @@ virCgroupGetMemSwapHardLimit(virCgroupPtr group, unsigned long long *kb) * Returns: 0 on success */ int -virCgroupGetMemSwapUsage(virCgroupPtr group, unsigned long long *kb) +virCgroupGetMemSwapUsage(virCgroup *group, unsigned long long *kb) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_MEMORY, getMemSwapUsage, -1, kb); @@ -1975,9 +1975,9 @@ virCgroupGetMemSwapUsage(virCgroupPtr group, unsigned long long *kb) * Returns: 0 on success */ int -virCgroupSetCpusetMems(virCgroupPtr group, const char *mems) +virCgroupSetCpusetMems(virCgroup *group, const char *mems) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPUSET, setCpusetMems, -1, mems); @@ -1993,9 +1993,9 @@ virCgroupSetCpusetMems(virCgroupPtr group, const char *mems) * Returns: 0 on success */ int -virCgroupGetCpusetMems(virCgroupPtr group, char **mems) +virCgroupGetCpusetMems(virCgroup *group, char **mems) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPUSET, getCpusetMems, -1, mems); @@ -2011,9 +2011,9 @@ virCgroupGetCpusetMems(virCgroupPtr group, char **mems) * Returns: 0 on success */ int -virCgroupSetCpusetMemoryMigrate(virCgroupPtr group, bool migrate) +virCgroupSetCpusetMemoryMigrate(virCgroup *group, bool migrate) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPUSET, setCpusetMemoryMigrate, -1, migrate); @@ -2029,9 +2029,9 @@ virCgroupSetCpusetMemoryMigrate(virCgroupPtr group, bool migrate) * Returns: 0 on success */ int -virCgroupGetCpusetMemoryMigrate(virCgroupPtr group, bool *migrate) +virCgroupGetCpusetMemoryMigrate(virCgroup *group, bool *migrate) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPUSET, getCpusetMemoryMigrate, -1, migrate); @@ -2047,9 +2047,9 @@ virCgroupGetCpusetMemoryMigrate(virCgroupPtr group, bool *migrate) * Returns: 0 on success */ int -virCgroupSetCpusetCpus(virCgroupPtr group, const char *cpus) +virCgroupSetCpusetCpus(virCgroup *group, const char *cpus) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPUSET, setCpusetCpus, -1, cpus); @@ -2065,9 +2065,9 @@ virCgroupSetCpusetCpus(virCgroupPtr group, const char *cpus) * Returns: 0 on success */ int -virCgroupGetCpusetCpus(virCgroupPtr group, char **cpus) +virCgroupGetCpusetCpus(virCgroup *group, char **cpus) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPUSET, getCpusetCpus, -1, cpus); @@ -2082,9 +2082,9 @@ virCgroupGetCpusetCpus(virCgroupPtr group, char **cpus) * Returns: 0 on success */ int -virCgroupDenyAllDevices(virCgroupPtr group) +virCgroupDenyAllDevices(virCgroup *group) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_DEVICES, denyAllDevices, -1); @@ -2105,9 +2105,9 @@ virCgroupDenyAllDevices(virCgroupPtr group) * Returns: 0 on success */ int -virCgroupAllowAllDevices(virCgroupPtr group, int perms) +virCgroupAllowAllDevices(virCgroup *group, int perms) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_DEVICES, allowAllDevices, -1, perms); @@ -2126,10 +2126,10 @@ virCgroupAllowAllDevices(virCgroupPtr group, int perms) * Returns: 0 on success */ int -virCgroupAllowDevice(virCgroupPtr group, char type, int major, int minor, +virCgroupAllowDevice(virCgroup *group, char type, int major, int minor, int perms) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_DEVICES, allowDevice, -1, type, major, minor, perms); @@ -2151,13 +2151,13 @@ virCgroupAllowDevice(virCgroupPtr group, char type, int major, int minor, * accessible, or * -1 on error */ int -virCgroupAllowDevicePath(virCgroupPtr group, +virCgroupAllowDevicePath(virCgroup *group, const char *path, int perms, bool ignoreEacces) { struct stat sb; - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); if (stat(path, &sb) < 0) { if (errno == EACCES && ignoreEacces) @@ -2193,10 +2193,10 @@ virCgroupAllowDevicePath(virCgroupPtr group, * Returns: 0 on success */ int -virCgroupDenyDevice(virCgroupPtr group, char type, int major, int minor, +virCgroupDenyDevice(virCgroup *group, char type, int major, int minor, int perms) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_DEVICES, denyDevice, -1, type, major, minor, perms); @@ -2218,13 +2218,13 @@ virCgroupDenyDevice(virCgroupPtr group, char type, int major, int minor, * accessible, or -1 on error. */ int -virCgroupDenyDevicePath(virCgroupPtr group, +virCgroupDenyDevicePath(virCgroup *group, const char *path, int perms, bool ignoreEacces) { struct stat sb; - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); if (stat(path, &sb) < 0) { if (errno == EACCES && ignoreEacces) @@ -2263,11 +2263,11 @@ virCgroupDenyDevicePath(virCgroupPtr group, * s3 = t03 + t13 */ static int -virCgroupGetPercpuVcpuSum(virCgroupPtr group, - virBitmapPtr guestvcpus, +virCgroupGetPercpuVcpuSum(virCgroup *group, + virBitmap *guestvcpus, unsigned long long *sum_cpu_time, size_t nsum, - virBitmapPtr cpumap) + virBitmap *cpumap) { ssize_t i = -1; @@ -2323,12 +2323,12 @@ virCgroupGetPercpuVcpuSum(virCgroupPtr group, * Please DON'T use this function anywhere else. */ int -virCgroupGetPercpuStats(virCgroupPtr group, +virCgroupGetPercpuStats(virCgroup *group, virTypedParameterPtr params, unsigned int nparams, int start_cpu, unsigned int ncpus, - virBitmapPtr guestvcpus) + virBitmap *guestvcpus) { int ret = -1; size_t i; @@ -2339,7 +2339,7 @@ virCgroupGetPercpuStats(virCgroupPtr group, virTypedParameterPtr ent; int param_idx; unsigned long long cpu_time; - virBitmapPtr cpumap = NULL; + virBitmap *cpumap = NULL; /* return the number of supported params */ if (nparams == 0 && ncpus != 0) { @@ -2425,7 +2425,7 @@ virCgroupGetPercpuStats(virCgroupPtr group, int -virCgroupGetDomainTotalCpuStats(virCgroupPtr group, +virCgroupGetDomainTotalCpuStats(virCgroup *group, virTypedParameterPtr params, int nparams) { @@ -2474,7 +2474,7 @@ virCgroupGetDomainTotalCpuStats(virCgroupPtr group, int -virCgroupSetCpuShares(virCgroupPtr group, unsigned long long shares) +virCgroupSetCpuShares(virCgroup *group, unsigned long long shares) { VIR_CGROUP_BACKEND_CALL(group, VIR_CGROUP_CONTROLLER_CPU, setCpuShares, -1, shares); @@ -2482,7 +2482,7 @@ virCgroupSetCpuShares(virCgroupPtr group, unsigned long long shares) int -virCgroupGetCpuShares(virCgroupPtr group, unsigned long long *shares) +virCgroupGetCpuShares(virCgroup *group, unsigned long long *shares) { VIR_CGROUP_BACKEND_CALL(group, VIR_CGROUP_CONTROLLER_CPU, getCpuShares, -1, shares); @@ -2498,9 +2498,9 @@ virCgroupGetCpuShares(virCgroupPtr group, unsigned long long *shares) * Returns: 0 on success */ int -virCgroupSetCpuCfsPeriod(virCgroupPtr group, unsigned long long cfs_period) +virCgroupSetCpuCfsPeriod(virCgroup *group, unsigned long long cfs_period) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPU, setCpuCfsPeriod, -1, cfs_period); @@ -2516,9 +2516,9 @@ virCgroupSetCpuCfsPeriod(virCgroupPtr group, unsigned long long cfs_period) * Returns: 0 on success */ int -virCgroupGetCpuCfsPeriod(virCgroupPtr group, unsigned long long *cfs_period) +virCgroupGetCpuCfsPeriod(virCgroup *group, unsigned long long *cfs_period) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPU, getCpuCfsPeriod, -1, cfs_period); @@ -2535,9 +2535,9 @@ virCgroupGetCpuCfsPeriod(virCgroupPtr group, unsigned long long *cfs_period) * Returns: 0 on success */ int -virCgroupSetCpuCfsQuota(virCgroupPtr group, long long cfs_quota) +virCgroupSetCpuCfsQuota(virCgroup *group, long long cfs_quota) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPU, setCpuCfsQuota, -1, cfs_quota); @@ -2545,9 +2545,9 @@ virCgroupSetCpuCfsQuota(virCgroupPtr group, long long cfs_quota) int -virCgroupGetCpuacctPercpuUsage(virCgroupPtr group, char **usage) +virCgroupGetCpuacctPercpuUsage(virCgroup *group, char **usage) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPUACCT, getCpuacctPercpuUsage, -1, usage); @@ -2611,7 +2611,7 @@ virCgroupRemoveRecursively(char *grppath) * Returns: 0 on success */ int -virCgroupRemove(virCgroupPtr group) +virCgroupRemove(virCgroup *group) { size_t i; @@ -2631,7 +2631,7 @@ virCgroupRemove(virCgroupPtr group) * Returns 1 if some PIDs are killed, 0 if none are killed, or -1 on error */ static int -virCgroupKillInternal(virCgroupPtr group, +virCgroupKillInternal(virCgroup *group, int signum, GHashTable *pids, int controller, @@ -2712,7 +2712,7 @@ virCgroupKillInternal(virCgroupPtr group, int -virCgroupKillRecursiveInternal(virCgroupPtr group, +virCgroupKillRecursiveInternal(virCgroup *group, int signum, GHashTable *pids, int controller, @@ -2777,13 +2777,13 @@ virCgroupKillRecursiveInternal(virCgroupPtr group, int -virCgroupKillRecursive(virCgroupPtr group, int signum) +virCgroupKillRecursive(virCgroup *group, int signum) { int rc; bool success = false; size_t i; bool backendAvailable = false; - virCgroupBackendPtr *backends = virCgroupBackendGetAll(); + virCgroupBackend **backends = virCgroupBackendGetAll(); g_autoptr(GHashTable) pids = g_hash_table_new_full(g_int64_hash, g_int64_equal, g_free, NULL); VIR_DEBUG("group=%p signum=%d", group, signum); @@ -2813,7 +2813,7 @@ virCgroupKillRecursive(virCgroupPtr group, int signum) int -virCgroupKillPainfully(virCgroupPtr group) +virCgroupKillPainfully(virCgroup *group) { size_t i; int ret; @@ -2850,9 +2850,9 @@ virCgroupKillPainfully(virCgroupPtr group) * Returns: 0 on success */ int -virCgroupGetCpuCfsQuota(virCgroupPtr group, long long *cfs_quota) +virCgroupGetCpuCfsQuota(virCgroup *group, long long *cfs_quota) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPU, getCpuCfsQuota, -1, cfs_quota); @@ -2860,9 +2860,9 @@ virCgroupGetCpuCfsQuota(virCgroupPtr group, long long *cfs_quota) int -virCgroupGetCpuacctUsage(virCgroupPtr group, unsigned long long *usage) +virCgroupGetCpuacctUsage(virCgroup *group, unsigned long long *usage) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPUACCT, getCpuacctUsage, -1, usage); @@ -2870,10 +2870,10 @@ virCgroupGetCpuacctUsage(virCgroupPtr group, unsigned long long *usage) int -virCgroupGetCpuacctStat(virCgroupPtr group, unsigned long long *user, +virCgroupGetCpuacctStat(virCgroup *group, unsigned long long *user, unsigned long long *sys) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPUACCT, getCpuacctStat, -1, user, sys); @@ -2881,9 +2881,9 @@ virCgroupGetCpuacctStat(virCgroupPtr group, unsigned long long *user, int -virCgroupSetFreezerState(virCgroupPtr group, const char *state) +virCgroupSetFreezerState(virCgroup *group, const char *state) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_FREEZER, setFreezerState, -1, state); @@ -2891,9 +2891,9 @@ virCgroupSetFreezerState(virCgroupPtr group, const char *state) int -virCgroupGetFreezerState(virCgroupPtr group, char **state) +virCgroupGetFreezerState(virCgroup *group, char **state) { - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_FREEZER, getFreezerState, -1, state); @@ -2901,11 +2901,11 @@ virCgroupGetFreezerState(virCgroupPtr group, char **state) int -virCgroupBindMount(virCgroupPtr group, const char *oldroot, +virCgroupBindMount(virCgroup *group, const char *oldroot, const char *mountopts) { size_t i; - virCgroupPtr parent = virCgroupGetNested(group); + virCgroup *parent = virCgroupGetNested(group); for (i = 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) { if (parent->backends[i] && @@ -2918,13 +2918,13 @@ virCgroupBindMount(virCgroupPtr group, const char *oldroot, } -int virCgroupSetOwner(virCgroupPtr cgroup, +int virCgroupSetOwner(virCgroup *cgroup, uid_t uid, gid_t gid, int controllers) { size_t i; - virCgroupPtr parent = virCgroupGetNested(cgroup); + virCgroup *parent = virCgroupGetNested(cgroup); for (i = 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) { if (parent->backends[i] && @@ -2945,19 +2945,19 @@ int virCgroupSetOwner(virCgroupPtr cgroup, * false when CFS bandwidth is not supported. */ bool -virCgroupSupportsCpuBW(virCgroupPtr cgroup) +virCgroupSupportsCpuBW(virCgroup *cgroup) { - virCgroupPtr parent = virCgroupGetNested(cgroup); + virCgroup *parent = virCgroupGetNested(cgroup); VIR_CGROUP_BACKEND_CALL(parent, VIR_CGROUP_CONTROLLER_CPU, supportsCpuBW, false); } int -virCgroupHasEmptyTasks(virCgroupPtr cgroup, int controller) +virCgroupHasEmptyTasks(virCgroup *cgroup, int controller) { size_t i; - virCgroupPtr parent = virCgroupGetNested(cgroup); + virCgroup *parent = virCgroupGetNested(cgroup); for (i = 0; i < VIR_CGROUP_BACKEND_TYPE_LAST; i++) { if (parent->backends[i]) { @@ -2994,7 +2994,7 @@ int virCgroupNewPartition(const char *path G_GNUC_UNUSED, bool create G_GNUC_UNUSED, int controllers G_GNUC_UNUSED, - virCgroupPtr *group G_GNUC_UNUSED) + virCgroup **group G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", _("Control groups not supported on this platform")); @@ -3005,7 +3005,7 @@ virCgroupNewPartition(const char *path G_GNUC_UNUSED, int virCgroupNew(const char *path G_GNUC_UNUSED, int controllers G_GNUC_UNUSED, - virCgroupPtr *group G_GNUC_UNUSED) + virCgroup **group G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", _("Control groups not supported on this platform")); @@ -3014,7 +3014,7 @@ virCgroupNew(const char *path G_GNUC_UNUSED, int -virCgroupNewSelf(virCgroupPtr *group G_GNUC_UNUSED) +virCgroupNewSelf(virCgroup **group G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", _("Control groups not supported on this platform")); @@ -3023,10 +3023,10 @@ virCgroupNewSelf(virCgroupPtr *group G_GNUC_UNUSED) int -virCgroupNewDomainPartition(virCgroupPtr partition G_GNUC_UNUSED, +virCgroupNewDomainPartition(virCgroup *partition G_GNUC_UNUSED, const char *driver G_GNUC_UNUSED, const char *name G_GNUC_UNUSED, - virCgroupPtr *group G_GNUC_UNUSED) + virCgroup **group G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", _("Control groups not supported on this platform")); @@ -3035,11 +3035,11 @@ virCgroupNewDomainPartition(virCgroupPtr partition G_GNUC_UNUSED, int -virCgroupNewThread(virCgroupPtr domain G_GNUC_UNUSED, +virCgroupNewThread(virCgroup *domain G_GNUC_UNUSED, virCgroupThreadName nameval G_GNUC_UNUSED, int id G_GNUC_UNUSED, bool create G_GNUC_UNUSED, - virCgroupPtr *group G_GNUC_UNUSED) + virCgroup **group G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", _("Control groups not supported on this platform")); @@ -3050,7 +3050,7 @@ virCgroupNewThread(virCgroupPtr domain G_GNUC_UNUSED, int virCgroupNewDetect(pid_t pid G_GNUC_UNUSED, int controllers G_GNUC_UNUSED, - virCgroupPtr *group G_GNUC_UNUSED) + virCgroup **group G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", _("Control groups not supported on this platform")); @@ -3064,7 +3064,7 @@ virCgroupNewDetectMachine(const char *name G_GNUC_UNUSED, pid_t pid G_GNUC_UNUSED, int controllers G_GNUC_UNUSED, char *machinename G_GNUC_UNUSED, - virCgroupPtr *group G_GNUC_UNUSED) + virCgroup **group G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", _("Control groups not supported on this platform")); @@ -3092,7 +3092,7 @@ virCgroupNewMachine(const char *name G_GNUC_UNUSED, const char *partition G_GNUC_UNUSED, int controllers G_GNUC_UNUSED, unsigned int maxthreads G_GNUC_UNUSED, - virCgroupPtr *group G_GNUC_UNUSED) + virCgroup **group G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", _("Control groups not supported on this platform")); @@ -3109,7 +3109,7 @@ virCgroupNewIgnoreError(void) bool -virCgroupHasController(virCgroupPtr cgroup G_GNUC_UNUSED, +virCgroupHasController(virCgroup *cgroup G_GNUC_UNUSED, int controller G_GNUC_UNUSED) { return false; @@ -3117,7 +3117,7 @@ virCgroupHasController(virCgroupPtr cgroup G_GNUC_UNUSED, int -virCgroupPathOfController(virCgroupPtr group G_GNUC_UNUSED, +virCgroupPathOfController(virCgroup *group G_GNUC_UNUSED, unsigned int controller G_GNUC_UNUSED, const char *key G_GNUC_UNUSED, char **path G_GNUC_UNUSED) @@ -3129,7 +3129,7 @@ virCgroupPathOfController(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupAddProcess(virCgroupPtr group G_GNUC_UNUSED, +virCgroupAddProcess(virCgroup *group G_GNUC_UNUSED, pid_t pid G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", @@ -3139,7 +3139,7 @@ virCgroupAddProcess(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupAddMachineProcess(virCgroupPtr group G_GNUC_UNUSED, +virCgroupAddMachineProcess(virCgroup *group G_GNUC_UNUSED, pid_t pid G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", @@ -3149,7 +3149,7 @@ virCgroupAddMachineProcess(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupAddThread(virCgroupPtr group G_GNUC_UNUSED, +virCgroupAddThread(virCgroup *group G_GNUC_UNUSED, pid_t pid G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", @@ -3159,7 +3159,7 @@ virCgroupAddThread(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetBlkioIoServiced(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetBlkioIoServiced(virCgroup *group G_GNUC_UNUSED, long long *bytes_read G_GNUC_UNUSED, long long *bytes_write G_GNUC_UNUSED, long long *requests_read G_GNUC_UNUSED, @@ -3172,7 +3172,7 @@ virCgroupGetBlkioIoServiced(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetBlkioIoDeviceServiced(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetBlkioIoDeviceServiced(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, long long *bytes_read G_GNUC_UNUSED, long long *bytes_write G_GNUC_UNUSED, @@ -3186,7 +3186,7 @@ virCgroupGetBlkioIoDeviceServiced(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupSetBlkioWeight(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetBlkioWeight(virCgroup *group G_GNUC_UNUSED, unsigned int weight G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", @@ -3196,7 +3196,7 @@ virCgroupSetBlkioWeight(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetBlkioWeight(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetBlkioWeight(virCgroup *group G_GNUC_UNUSED, unsigned int *weight G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", @@ -3206,7 +3206,7 @@ virCgroupGetBlkioWeight(virCgroupPtr group G_GNUC_UNUSED, static int -virCgroupSetBlkioDeviceWeight(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetBlkioDeviceWeight(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, unsigned int weight G_GNUC_UNUSED) { @@ -3216,7 +3216,7 @@ virCgroupSetBlkioDeviceWeight(virCgroupPtr group G_GNUC_UNUSED, } static int -virCgroupSetBlkioDeviceReadIops(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetBlkioDeviceReadIops(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, unsigned int riops G_GNUC_UNUSED) { @@ -3226,7 +3226,7 @@ virCgroupSetBlkioDeviceReadIops(virCgroupPtr group G_GNUC_UNUSED, } static int -virCgroupSetBlkioDeviceWriteIops(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetBlkioDeviceWriteIops(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, unsigned int wiops G_GNUC_UNUSED) { @@ -3236,7 +3236,7 @@ virCgroupSetBlkioDeviceWriteIops(virCgroupPtr group G_GNUC_UNUSED, } static int -virCgroupSetBlkioDeviceReadBps(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetBlkioDeviceReadBps(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, unsigned long long rbps G_GNUC_UNUSED) { @@ -3246,7 +3246,7 @@ virCgroupSetBlkioDeviceReadBps(virCgroupPtr group G_GNUC_UNUSED, } static int -virCgroupSetBlkioDeviceWriteBps(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetBlkioDeviceWriteBps(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, unsigned long long wbps G_GNUC_UNUSED) { @@ -3256,7 +3256,7 @@ virCgroupSetBlkioDeviceWriteBps(virCgroupPtr group G_GNUC_UNUSED, } static int -virCgroupGetBlkioDeviceWeight(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetBlkioDeviceWeight(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, unsigned int *weight G_GNUC_UNUSED) { @@ -3266,7 +3266,7 @@ virCgroupGetBlkioDeviceWeight(virCgroupPtr group G_GNUC_UNUSED, } static int -virCgroupGetBlkioDeviceReadIops(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetBlkioDeviceReadIops(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, unsigned int *riops G_GNUC_UNUSED) { @@ -3276,7 +3276,7 @@ virCgroupGetBlkioDeviceReadIops(virCgroupPtr group G_GNUC_UNUSED, } static int -virCgroupGetBlkioDeviceWriteIops(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetBlkioDeviceWriteIops(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, unsigned int *wiops G_GNUC_UNUSED) { @@ -3286,7 +3286,7 @@ virCgroupGetBlkioDeviceWriteIops(virCgroupPtr group G_GNUC_UNUSED, } static int -virCgroupGetBlkioDeviceReadBps(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetBlkioDeviceReadBps(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, unsigned long long *rbps G_GNUC_UNUSED) { @@ -3296,7 +3296,7 @@ virCgroupGetBlkioDeviceReadBps(virCgroupPtr group G_GNUC_UNUSED, } static int -virCgroupGetBlkioDeviceWriteBps(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetBlkioDeviceWriteBps(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, unsigned long long *wbps G_GNUC_UNUSED) { @@ -3306,7 +3306,7 @@ virCgroupGetBlkioDeviceWriteBps(virCgroupPtr group G_GNUC_UNUSED, } int -virCgroupSetMemory(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetMemory(virCgroup *group G_GNUC_UNUSED, unsigned long long kb G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3316,7 +3316,7 @@ virCgroupSetMemory(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetMemoryStat(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetMemoryStat(virCgroup *group G_GNUC_UNUSED, unsigned long long *cache G_GNUC_UNUSED, unsigned long long *activeAnon G_GNUC_UNUSED, unsigned long long *inactiveAnon G_GNUC_UNUSED, @@ -3331,7 +3331,7 @@ virCgroupGetMemoryStat(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetMemoryUsage(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetMemoryUsage(virCgroup *group G_GNUC_UNUSED, unsigned long *kb G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3341,7 +3341,7 @@ virCgroupGetMemoryUsage(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupSetMemoryHardLimit(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetMemoryHardLimit(virCgroup *group G_GNUC_UNUSED, unsigned long long kb G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3351,7 +3351,7 @@ virCgroupSetMemoryHardLimit(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetMemoryHardLimit(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetMemoryHardLimit(virCgroup *group G_GNUC_UNUSED, unsigned long long *kb G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3361,7 +3361,7 @@ virCgroupGetMemoryHardLimit(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupSetMemorySoftLimit(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetMemorySoftLimit(virCgroup *group G_GNUC_UNUSED, unsigned long long kb G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3371,7 +3371,7 @@ virCgroupSetMemorySoftLimit(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetMemorySoftLimit(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetMemorySoftLimit(virCgroup *group G_GNUC_UNUSED, unsigned long long *kb G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3381,7 +3381,7 @@ virCgroupGetMemorySoftLimit(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupSetMemSwapHardLimit(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetMemSwapHardLimit(virCgroup *group G_GNUC_UNUSED, unsigned long long kb G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3391,7 +3391,7 @@ virCgroupSetMemSwapHardLimit(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetMemSwapHardLimit(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetMemSwapHardLimit(virCgroup *group G_GNUC_UNUSED, unsigned long long *kb G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3401,7 +3401,7 @@ virCgroupGetMemSwapHardLimit(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetMemSwapUsage(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetMemSwapUsage(virCgroup *group G_GNUC_UNUSED, unsigned long long *kb G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3411,7 +3411,7 @@ virCgroupGetMemSwapUsage(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupSetCpusetMems(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetCpusetMems(virCgroup *group G_GNUC_UNUSED, const char *mems G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3421,7 +3421,7 @@ virCgroupSetCpusetMems(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetCpusetMems(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetCpusetMems(virCgroup *group G_GNUC_UNUSED, char **mems G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3431,7 +3431,7 @@ virCgroupGetCpusetMems(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupSetCpusetMemoryMigrate(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetCpusetMemoryMigrate(virCgroup *group G_GNUC_UNUSED, bool migrate G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3441,7 +3441,7 @@ virCgroupSetCpusetMemoryMigrate(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetCpusetMemoryMigrate(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetCpusetMemoryMigrate(virCgroup *group G_GNUC_UNUSED, bool *migrate G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3451,7 +3451,7 @@ virCgroupGetCpusetMemoryMigrate(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupSetCpusetCpus(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetCpusetCpus(virCgroup *group G_GNUC_UNUSED, const char *cpus G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3461,7 +3461,7 @@ virCgroupSetCpusetCpus(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetCpusetCpus(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetCpusetCpus(virCgroup *group G_GNUC_UNUSED, char **cpus G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3470,7 +3470,7 @@ virCgroupGetCpusetCpus(virCgroupPtr group G_GNUC_UNUSED, } int -virCgroupAllowAllDevices(virCgroupPtr group G_GNUC_UNUSED, +virCgroupAllowAllDevices(virCgroup *group G_GNUC_UNUSED, int perms G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3479,7 +3479,7 @@ virCgroupAllowAllDevices(virCgroupPtr group G_GNUC_UNUSED, } int -virCgroupDenyAllDevices(virCgroupPtr group G_GNUC_UNUSED) +virCgroupDenyAllDevices(virCgroup *group G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("Control groups not supported on this platform")); @@ -3488,7 +3488,7 @@ virCgroupDenyAllDevices(virCgroupPtr group G_GNUC_UNUSED) int -virCgroupAllowDevice(virCgroupPtr group G_GNUC_UNUSED, +virCgroupAllowDevice(virCgroup *group G_GNUC_UNUSED, char type G_GNUC_UNUSED, int major G_GNUC_UNUSED, int minor G_GNUC_UNUSED, @@ -3501,7 +3501,7 @@ virCgroupAllowDevice(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupAllowDevicePath(virCgroupPtr group G_GNUC_UNUSED, +virCgroupAllowDevicePath(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, int perms G_GNUC_UNUSED, bool ignoreEaccess G_GNUC_UNUSED) @@ -3513,7 +3513,7 @@ virCgroupAllowDevicePath(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupDenyDevice(virCgroupPtr group G_GNUC_UNUSED, +virCgroupDenyDevice(virCgroup *group G_GNUC_UNUSED, char type G_GNUC_UNUSED, int major G_GNUC_UNUSED, int minor G_GNUC_UNUSED, @@ -3526,7 +3526,7 @@ virCgroupDenyDevice(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupDenyDevicePath(virCgroupPtr group G_GNUC_UNUSED, +virCgroupDenyDevicePath(virCgroup *group G_GNUC_UNUSED, const char *path G_GNUC_UNUSED, int perms G_GNUC_UNUSED, bool ignoreEacces G_GNUC_UNUSED) @@ -3538,7 +3538,7 @@ virCgroupDenyDevicePath(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupSetCpuShares(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetCpuShares(virCgroup *group G_GNUC_UNUSED, unsigned long long shares G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3548,7 +3548,7 @@ virCgroupSetCpuShares(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetCpuShares(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetCpuShares(virCgroup *group G_GNUC_UNUSED, unsigned long long *shares G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3558,7 +3558,7 @@ virCgroupGetCpuShares(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupSetCpuCfsPeriod(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetCpuCfsPeriod(virCgroup *group G_GNUC_UNUSED, unsigned long long cfs_period G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3568,7 +3568,7 @@ virCgroupSetCpuCfsPeriod(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetCpuCfsPeriod(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetCpuCfsPeriod(virCgroup *group G_GNUC_UNUSED, unsigned long long *cfs_period G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3578,7 +3578,7 @@ virCgroupGetCpuCfsPeriod(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupSetCpuCfsQuota(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetCpuCfsQuota(virCgroup *group G_GNUC_UNUSED, long long cfs_quota G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3588,7 +3588,7 @@ virCgroupSetCpuCfsQuota(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupRemove(virCgroupPtr group G_GNUC_UNUSED) +virCgroupRemove(virCgroup *group G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", _("Control groups not supported on this platform")); @@ -3597,7 +3597,7 @@ virCgroupRemove(virCgroupPtr group G_GNUC_UNUSED) int -virCgroupKillRecursive(virCgroupPtr group G_GNUC_UNUSED, +virCgroupKillRecursive(virCgroup *group G_GNUC_UNUSED, int signum G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3607,7 +3607,7 @@ virCgroupKillRecursive(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupKillPainfully(virCgroupPtr group G_GNUC_UNUSED) +virCgroupKillPainfully(virCgroup *group G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("Control groups not supported on this platform")); @@ -3616,7 +3616,7 @@ virCgroupKillPainfully(virCgroupPtr group G_GNUC_UNUSED) int -virCgroupGetCpuCfsQuota(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetCpuCfsQuota(virCgroup *group G_GNUC_UNUSED, long long *cfs_quota G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3626,7 +3626,7 @@ virCgroupGetCpuCfsQuota(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetCpuacctUsage(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetCpuacctUsage(virCgroup *group G_GNUC_UNUSED, unsigned long long *usage G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3636,7 +3636,7 @@ virCgroupGetCpuacctUsage(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetCpuacctPercpuUsage(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetCpuacctPercpuUsage(virCgroup *group G_GNUC_UNUSED, char **usage G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3646,7 +3646,7 @@ virCgroupGetCpuacctPercpuUsage(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetCpuacctStat(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetCpuacctStat(virCgroup *group G_GNUC_UNUSED, unsigned long long *user G_GNUC_UNUSED, unsigned long long *sys G_GNUC_UNUSED) { @@ -3657,7 +3657,7 @@ virCgroupGetCpuacctStat(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetDomainTotalCpuStats(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetDomainTotalCpuStats(virCgroup *group G_GNUC_UNUSED, virTypedParameterPtr params G_GNUC_UNUSED, int nparams G_GNUC_UNUSED) { @@ -3668,7 +3668,7 @@ virCgroupGetDomainTotalCpuStats(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupSetFreezerState(virCgroupPtr group G_GNUC_UNUSED, +virCgroupSetFreezerState(virCgroup *group G_GNUC_UNUSED, const char *state G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3678,7 +3678,7 @@ virCgroupSetFreezerState(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupGetFreezerState(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetFreezerState(virCgroup *group G_GNUC_UNUSED, char **state G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3688,7 +3688,7 @@ virCgroupGetFreezerState(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupBindMount(virCgroupPtr group G_GNUC_UNUSED, +virCgroupBindMount(virCgroup *group G_GNUC_UNUSED, const char *oldroot G_GNUC_UNUSED, const char *mountopts G_GNUC_UNUSED) { @@ -3699,7 +3699,7 @@ virCgroupBindMount(virCgroupPtr group G_GNUC_UNUSED, bool -virCgroupSupportsCpuBW(virCgroupPtr cgroup G_GNUC_UNUSED) +virCgroupSupportsCpuBW(virCgroup *cgroup G_GNUC_UNUSED) { VIR_DEBUG("Control groups not supported on this platform"); return false; @@ -3707,12 +3707,12 @@ virCgroupSupportsCpuBW(virCgroupPtr cgroup G_GNUC_UNUSED) int -virCgroupGetPercpuStats(virCgroupPtr group G_GNUC_UNUSED, +virCgroupGetPercpuStats(virCgroup *group G_GNUC_UNUSED, virTypedParameterPtr params G_GNUC_UNUSED, unsigned int nparams G_GNUC_UNUSED, int start_cpu G_GNUC_UNUSED, unsigned int ncpus G_GNUC_UNUSED, - virBitmapPtr guestvcpus G_GNUC_UNUSED) + virBitmap *guestvcpus G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("Control groups not supported on this platform")); @@ -3721,7 +3721,7 @@ virCgroupGetPercpuStats(virCgroupPtr group G_GNUC_UNUSED, int -virCgroupSetOwner(virCgroupPtr cgroup G_GNUC_UNUSED, +virCgroupSetOwner(virCgroup *cgroup G_GNUC_UNUSED, uid_t uid G_GNUC_UNUSED, gid_t gid G_GNUC_UNUSED, int controllers G_GNUC_UNUSED) @@ -3732,7 +3732,7 @@ virCgroupSetOwner(virCgroupPtr cgroup G_GNUC_UNUSED, } int -virCgroupHasEmptyTasks(virCgroupPtr cgroup G_GNUC_UNUSED, +virCgroupHasEmptyTasks(virCgroup *cgroup G_GNUC_UNUSED, int controller G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -3754,7 +3754,7 @@ virCgroupControllerAvailable(int controller G_GNUC_UNUSED) * @group: The group structure to free */ void -virCgroupFree(virCgroupPtr group) +virCgroupFree(virCgroup *group) { size_t i; @@ -3778,12 +3778,12 @@ virCgroupFree(virCgroupPtr group) int -virCgroupDelThread(virCgroupPtr cgroup, +virCgroupDelThread(virCgroup *cgroup, virCgroupThreadName nameval, int idx) { g_autoptr(virCgroup) new_cgroup = NULL; - virCgroupPtr parent = NULL; + virCgroup *parent = NULL; if (cgroup) { parent = virCgroupGetNested(cgroup); @@ -3805,7 +3805,7 @@ virCgroupDelThread(virCgroupPtr cgroup, * virCgroupGetBlkioDeviceWeight() in the same @weight pointer. */ int -virCgroupSetupBlkioDeviceWeight(virCgroupPtr cgroup, const char *path, +virCgroupSetupBlkioDeviceWeight(virCgroup *cgroup, const char *path, unsigned int *weight) { if (virCgroupSetBlkioDeviceWeight(cgroup, path, *weight) < 0 || @@ -3822,7 +3822,7 @@ virCgroupSetupBlkioDeviceWeight(virCgroupPtr cgroup, const char *path, * virCgroupGetBlkioDeviceReadIops() in the same @riops pointer. */ int -virCgroupSetupBlkioDeviceReadIops(virCgroupPtr cgroup, const char *path, +virCgroupSetupBlkioDeviceReadIops(virCgroup *cgroup, const char *path, unsigned int *riops) { if (virCgroupSetBlkioDeviceReadIops(cgroup, path, *riops) < 0 || @@ -3839,7 +3839,7 @@ virCgroupSetupBlkioDeviceReadIops(virCgroupPtr cgroup, const char *path, * virCgroupGetBlkioDeviceWriteIops() in the same @wiops pointer. */ int -virCgroupSetupBlkioDeviceWriteIops(virCgroupPtr cgroup, const char *path, +virCgroupSetupBlkioDeviceWriteIops(virCgroup *cgroup, const char *path, unsigned int *wiops) { if (virCgroupSetBlkioDeviceWriteIops(cgroup, path, *wiops) < 0 || @@ -3856,7 +3856,7 @@ virCgroupSetupBlkioDeviceWriteIops(virCgroupPtr cgroup, const char *path, * virCgroupGetBlkioDeviceReadBps() in the same @rbps pointer. */ int -virCgroupSetupBlkioDeviceReadBps(virCgroupPtr cgroup, const char *path, +virCgroupSetupBlkioDeviceReadBps(virCgroup *cgroup, const char *path, unsigned long long *rbps) { if (virCgroupSetBlkioDeviceReadBps(cgroup, path, *rbps) < 0 || @@ -3873,7 +3873,7 @@ virCgroupSetupBlkioDeviceReadBps(virCgroupPtr cgroup, const char *path, * virCgroupGetBlkioDeviceWriteBps() in the same @wbps pointer. */ int -virCgroupSetupBlkioDeviceWriteBps(virCgroupPtr cgroup, const char *path, +virCgroupSetupBlkioDeviceWriteBps(virCgroup *cgroup, const char *path, unsigned long long *wbps) { if (virCgroupSetBlkioDeviceWriteBps(cgroup, path, *wbps) < 0 || @@ -3885,7 +3885,7 @@ virCgroupSetupBlkioDeviceWriteBps(virCgroupPtr cgroup, const char *path, int -virCgroupSetupCpusetCpus(virCgroupPtr cgroup, virBitmapPtr cpumask) +virCgroupSetupCpusetCpus(virCgroup *cgroup, virBitmap *cpumask) { g_autofree char *new_cpus = NULL; @@ -3900,7 +3900,7 @@ virCgroupSetupCpusetCpus(virCgroupPtr cgroup, virBitmapPtr cpumask) int -virCgroupSetupCpuPeriodQuota(virCgroupPtr cgroup, +virCgroupSetupCpuPeriodQuota(virCgroup *cgroup, unsigned long long period, long long quota) { @@ -3938,7 +3938,7 @@ virCgroupSetupCpuPeriodQuota(virCgroupPtr cgroup, int -virCgroupGetCpuPeriodQuota(virCgroupPtr cgroup, unsigned long long *period, +virCgroupGetCpuPeriodQuota(virCgroup *cgroup, unsigned long long *period, long long *quota) { if (virCgroupGetCpuCfsPeriod(cgroup, period) < 0) diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h index 4e6911f34c..8002cac570 100644 --- a/src/util/vircgroup.h +++ b/src/util/vircgroup.h @@ -26,7 +26,6 @@ struct _virCgroup; typedef struct _virCgroup virCgroup; -typedef virCgroup *virCgroupPtr; enum { VIR_CGROUP_CONTROLLER_CPU, @@ -62,25 +61,25 @@ bool virCgroupAvailable(void); int virCgroupNew(const char *path, int controllers, - virCgroupPtr *group); + virCgroup **group); -int virCgroupNewSelf(virCgroupPtr *group) +int virCgroupNewSelf(virCgroup **group) ATTRIBUTE_NONNULL(1); -int virCgroupNewThread(virCgroupPtr domain, +int virCgroupNewThread(virCgroup *domain, virCgroupThreadName nameval, int id, bool create, - virCgroupPtr *group) + virCgroup **group) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(5); -int virCgroupDelThread(virCgroupPtr cgroup, +int virCgroupDelThread(virCgroup *cgroup, virCgroupThreadName nameval, int idx); int virCgroupNewDetect(pid_t pid, int controllers, - virCgroupPtr *group); + virCgroup **group); int virCgroupNewDetectMachine(const char *name, @@ -88,7 +87,7 @@ virCgroupNewDetectMachine(const char *name, pid_t pid, int controllers, char *machinename, - virCgroupPtr *group) + virCgroup **group) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); int virCgroupNewMachine(const char *name, @@ -102,7 +101,7 @@ int virCgroupNewMachine(const char *name, const char *partition, int controllers, unsigned int maxthreads, - virCgroupPtr *group) + virCgroup **group) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); @@ -111,72 +110,72 @@ int virCgroupTerminateMachine(const char *name) bool virCgroupNewIgnoreError(void); -void virCgroupFree(virCgroupPtr group); +void virCgroupFree(virCgroup *group); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCgroup, virCgroupFree); -bool virCgroupHasController(virCgroupPtr cgroup, int controller); -int virCgroupPathOfController(virCgroupPtr group, +bool virCgroupHasController(virCgroup *cgroup, int controller); +int virCgroupPathOfController(virCgroup *group, unsigned int controller, const char *key, char **path); -int virCgroupAddProcess(virCgroupPtr group, pid_t pid); -int virCgroupAddMachineProcess(virCgroupPtr group, pid_t pid); -int virCgroupAddThread(virCgroupPtr group, pid_t pid); +int virCgroupAddProcess(virCgroup *group, pid_t pid); +int virCgroupAddMachineProcess(virCgroup *group, pid_t pid); +int virCgroupAddThread(virCgroup *group, pid_t pid); -int virCgroupSetBlkioWeight(virCgroupPtr group, unsigned int weight); -int virCgroupGetBlkioWeight(virCgroupPtr group, unsigned int *weight); +int virCgroupSetBlkioWeight(virCgroup *group, unsigned int weight); +int virCgroupGetBlkioWeight(virCgroup *group, unsigned int *weight); -int virCgroupGetBlkioIoServiced(virCgroupPtr group, +int virCgroupGetBlkioIoServiced(virCgroup *group, long long *bytes_read, long long *bytes_write, long long *requests_read, long long *requests_write); -int virCgroupGetBlkioIoDeviceServiced(virCgroupPtr group, +int virCgroupGetBlkioIoDeviceServiced(virCgroup *group, const char *path, long long *bytes_read, long long *bytes_write, long long *requests_read, long long *requests_write); -int virCgroupSetupBlkioDeviceWeight(virCgroupPtr cgroup, +int virCgroupSetupBlkioDeviceWeight(virCgroup *cgroup, const char *path, unsigned int *weight); -int virCgroupSetupBlkioDeviceReadIops(virCgroupPtr cgroup, +int virCgroupSetupBlkioDeviceReadIops(virCgroup *cgroup, const char *path, unsigned int *riops); -int virCgroupSetupBlkioDeviceWriteIops(virCgroupPtr cgroup, +int virCgroupSetupBlkioDeviceWriteIops(virCgroup *cgroup, const char *path, unsigned int *wiops); -int virCgroupSetupBlkioDeviceReadBps(virCgroupPtr cgroup, +int virCgroupSetupBlkioDeviceReadBps(virCgroup *cgroup, const char *path, unsigned long long *rbps); -int virCgroupSetupBlkioDeviceWriteBps(virCgroupPtr cgroup, +int virCgroupSetupBlkioDeviceWriteBps(virCgroup *cgroup, const char *path, unsigned long long *wbps); -int virCgroupSetMemory(virCgroupPtr group, unsigned long long kb); -int virCgroupGetMemoryStat(virCgroupPtr group, +int virCgroupSetMemory(virCgroup *group, unsigned long long kb); +int virCgroupGetMemoryStat(virCgroup *group, unsigned long long *cache, unsigned long long *activeAnon, unsigned long long *inactiveAnon, unsigned long long *activeFile, unsigned long long *inactiveFile, unsigned long long *unevictable); -int virCgroupGetMemoryUsage(virCgroupPtr group, unsigned long *kb); +int virCgroupGetMemoryUsage(virCgroup *group, unsigned long *kb); -int virCgroupSetMemoryHardLimit(virCgroupPtr group, unsigned long long kb); -int virCgroupGetMemoryHardLimit(virCgroupPtr group, unsigned long long *kb); -int virCgroupSetMemorySoftLimit(virCgroupPtr group, unsigned long long kb); -int virCgroupGetMemorySoftLimit(virCgroupPtr group, unsigned long long *kb); -int virCgroupSetMemSwapHardLimit(virCgroupPtr group, unsigned long long kb); -int virCgroupGetMemSwapHardLimit(virCgroupPtr group, unsigned long long *kb); -int virCgroupGetMemSwapUsage(virCgroupPtr group, unsigned long long *kb); +int virCgroupSetMemoryHardLimit(virCgroup *group, unsigned long long kb); +int virCgroupGetMemoryHardLimit(virCgroup *group, unsigned long long *kb); +int virCgroupSetMemorySoftLimit(virCgroup *group, unsigned long long kb); +int virCgroupGetMemorySoftLimit(virCgroup *group, unsigned long long *kb); +int virCgroupSetMemSwapHardLimit(virCgroup *group, unsigned long long kb); +int virCgroupGetMemSwapHardLimit(virCgroup *group, unsigned long long *kb); +int virCgroupGetMemSwapUsage(virCgroup *group, unsigned long long *kb); enum { VIR_CGROUP_DEVICE_READ = 1, @@ -188,45 +187,45 @@ enum { const char *virCgroupGetDevicePermsString(int perms); -int virCgroupDenyAllDevices(virCgroupPtr group); +int virCgroupDenyAllDevices(virCgroup *group); -int virCgroupAllowAllDevices(virCgroupPtr group, int perms); +int virCgroupAllowAllDevices(virCgroup *group, int perms); -int virCgroupAllowDevice(virCgroupPtr group, +int virCgroupAllowDevice(virCgroup *group, char type, int major, int minor, int perms); -int virCgroupAllowDevicePath(virCgroupPtr group, +int virCgroupAllowDevicePath(virCgroup *group, const char *path, int perms, bool ignoreEacces); -int virCgroupDenyDevice(virCgroupPtr group, +int virCgroupDenyDevice(virCgroup *group, char type, int major, int minor, int perms); -int virCgroupDenyDevicePath(virCgroupPtr group, +int virCgroupDenyDevicePath(virCgroup *group, const char *path, int perms, bool ignoreEacces); int -virCgroupGetPercpuStats(virCgroupPtr group, +virCgroupGetPercpuStats(virCgroup *group, virTypedParameterPtr params, unsigned int nparams, int start_cpu, unsigned int ncpus, - virBitmapPtr guestvcpus); + virBitmap *guestvcpus); int -virCgroupGetDomainTotalCpuStats(virCgroupPtr group, +virCgroupGetDomainTotalCpuStats(virCgroup *group, virTypedParameterPtr params, int nparams); -int virCgroupSetCpuShares(virCgroupPtr group, unsigned long long shares); -int virCgroupGetCpuShares(virCgroupPtr group, unsigned long long *shares); +int virCgroupSetCpuShares(virCgroup *group, unsigned long long shares); +int virCgroupGetCpuShares(virCgroup *group, unsigned long long *shares); #define VIR_CGROUP_CPU_SHARES_MIN 2LL #define VIR_CGROUP_CPU_SHARES_MAX 262144LL @@ -237,50 +236,50 @@ int virCgroupGetCpuShares(virCgroupPtr group, unsigned long long *shares); * (64 - BW_SHIFT) and BW_SHIFT is 20 */ #define VIR_CGROUP_CPU_QUOTA_MAX 17592186044415LL -int virCgroupSetCpuCfsPeriod(virCgroupPtr group, unsigned long long cfs_period); -int virCgroupGetCpuCfsPeriod(virCgroupPtr group, unsigned long long *cfs_period); -int virCgroupGetCpuPeriodQuota(virCgroupPtr cgroup, unsigned long long *period, +int virCgroupSetCpuCfsPeriod(virCgroup *group, unsigned long long cfs_period); +int virCgroupGetCpuCfsPeriod(virCgroup *group, unsigned long long *cfs_period); +int virCgroupGetCpuPeriodQuota(virCgroup *cgroup, unsigned long long *period, long long *quota); -int virCgroupSetupCpuPeriodQuota(virCgroupPtr cgroup, unsigned long long period, +int virCgroupSetupCpuPeriodQuota(virCgroup *cgroup, unsigned long long period, long long quota); -int virCgroupSetCpuCfsQuota(virCgroupPtr group, long long cfs_quota); -int virCgroupGetCpuCfsQuota(virCgroupPtr group, long long *cfs_quota); +int virCgroupSetCpuCfsQuota(virCgroup *group, long long cfs_quota); +int virCgroupGetCpuCfsQuota(virCgroup *group, long long *cfs_quota); -int virCgroupGetCpuacctUsage(virCgroupPtr group, unsigned long long *usage); -int virCgroupGetCpuacctPercpuUsage(virCgroupPtr group, char **usage); -int virCgroupGetCpuacctStat(virCgroupPtr group, unsigned long long *user, +int virCgroupGetCpuacctUsage(virCgroup *group, unsigned long long *usage); +int virCgroupGetCpuacctPercpuUsage(virCgroup *group, char **usage); +int virCgroupGetCpuacctStat(virCgroup *group, unsigned long long *user, unsigned long long *sys); -int virCgroupSetFreezerState(virCgroupPtr group, const char *state); -int virCgroupGetFreezerState(virCgroupPtr group, char **state); +int virCgroupSetFreezerState(virCgroup *group, const char *state); +int virCgroupGetFreezerState(virCgroup *group, char **state); -int virCgroupSetCpusetMems(virCgroupPtr group, const char *mems); -int virCgroupGetCpusetMems(virCgroupPtr group, char **mems); +int virCgroupSetCpusetMems(virCgroup *group, const char *mems); +int virCgroupGetCpusetMems(virCgroup *group, char **mems); -int virCgroupSetCpusetMemoryMigrate(virCgroupPtr group, bool migrate); -int virCgroupGetCpusetMemoryMigrate(virCgroupPtr group, bool *migrate); +int virCgroupSetCpusetMemoryMigrate(virCgroup *group, bool migrate); +int virCgroupGetCpusetMemoryMigrate(virCgroup *group, bool *migrate); -int virCgroupSetCpusetCpus(virCgroupPtr group, const char *cpus); -int virCgroupGetCpusetCpus(virCgroupPtr group, char **cpus); -int virCgroupSetupCpusetCpus(virCgroupPtr cgroup, virBitmapPtr cpumask); +int virCgroupSetCpusetCpus(virCgroup *group, const char *cpus); +int virCgroupGetCpusetCpus(virCgroup *group, char **cpus); +int virCgroupSetupCpusetCpus(virCgroup *cgroup, virBitmap *cpumask); -int virCgroupRemove(virCgroupPtr group); +int virCgroupRemove(virCgroup *group); -int virCgroupKillRecursive(virCgroupPtr group, int signum); -int virCgroupKillPainfully(virCgroupPtr group); +int virCgroupKillRecursive(virCgroup *group, int signum); +int virCgroupKillPainfully(virCgroup *group); -int virCgroupBindMount(virCgroupPtr group, +int virCgroupBindMount(virCgroup *group, const char *oldroot, const char *mountopts); -bool virCgroupSupportsCpuBW(virCgroupPtr cgroup); +bool virCgroupSupportsCpuBW(virCgroup *cgroup); -int virCgroupSetOwner(virCgroupPtr cgroup, +int virCgroupSetOwner(virCgroup *cgroup, uid_t uid, gid_t gid, int controllers); -int virCgroupHasEmptyTasks(virCgroupPtr cgroup, int controller); +int virCgroupHasEmptyTasks(virCgroup *cgroup, int controller); bool virCgroupControllerAvailable(int controller); diff --git a/src/util/vircgroupbackend.c b/src/util/vircgroupbackend.c index d56e4ea292..53184cd060 100644 --- a/src/util/vircgroupbackend.c +++ b/src/util/vircgroupbackend.c @@ -37,10 +37,10 @@ VIR_ENUM_IMPL(virCgroupBackend, ); static virOnceControl virCgroupBackendOnce = VIR_ONCE_CONTROL_INITIALIZER; -static virCgroupBackendPtr virCgroupBackends[VIR_CGROUP_BACKEND_TYPE_LAST] = { 0 }; +static virCgroupBackend *virCgroupBackends[VIR_CGROUP_BACKEND_TYPE_LAST] = { 0 }; void -virCgroupBackendRegister(virCgroupBackendPtr backend) +virCgroupBackendRegister(virCgroupBackend *backend) { if (virCgroupBackends[backend->type]) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -61,7 +61,7 @@ virCgroupBackendOnceInit(void) } -virCgroupBackendPtr * +virCgroupBackend ** virCgroupBackendGetAll(void) { if (virOnce(&virCgroupBackendOnce, virCgroupBackendOnceInit) < 0) { @@ -73,8 +73,8 @@ virCgroupBackendGetAll(void) } -virCgroupBackendPtr -virCgroupBackendForController(virCgroupPtr group, +virCgroupBackend * +virCgroupBackendForController(virCgroup *group, unsigned int controller) { size_t i; diff --git a/src/util/vircgroupbackend.h b/src/util/vircgroupbackend.h index a338ffb618..c7f5708b86 100644 --- a/src/util/vircgroupbackend.h +++ b/src/util/vircgroupbackend.h @@ -62,117 +62,117 @@ typedef bool (*virCgroupAvailableCB)(void); typedef bool -(*virCgroupValidateMachineGroupCB)(virCgroupPtr group, +(*virCgroupValidateMachineGroupCB)(virCgroup *group, const char *name, const char *drivername, const char *machinename); typedef int -(*virCgroupCopyMountsCB)(virCgroupPtr group, - virCgroupPtr parent); +(*virCgroupCopyMountsCB)(virCgroup *group, + virCgroup *parent); typedef int -(*virCgroupCopyPlacementCB)(virCgroupPtr group, +(*virCgroupCopyPlacementCB)(virCgroup *group, const char *path, - virCgroupPtr parent); + virCgroup *parent); typedef int -(*virCgroupDetectMountsCB)(virCgroupPtr group, +(*virCgroupDetectMountsCB)(virCgroup *group, const char *mntType, const char *mntOpts, const char *mntDir); typedef int -(*virCgroupDetectPlacementCB)(virCgroupPtr group, +(*virCgroupDetectPlacementCB)(virCgroup *group, const char *path, const char *controllers, const char *selfpath); typedef int -(*virCgroupSetPlacementCB)(virCgroupPtr group, +(*virCgroupSetPlacementCB)(virCgroup *group, const char *path); typedef int -(*virCgroupValidatePlacementCB)(virCgroupPtr group, +(*virCgroupValidatePlacementCB)(virCgroup *group, pid_t pid); typedef char * -(*virCgroupStealPlacementCB)(virCgroupPtr group); +(*virCgroupStealPlacementCB)(virCgroup *group); typedef int -(*virCgroupDetectControllersCB)(virCgroupPtr group, +(*virCgroupDetectControllersCB)(virCgroup *group, int controllers, - virCgroupPtr parent, + virCgroup *parent, int detected); typedef bool -(*virCgroupHasControllerCB)(virCgroupPtr cgroup, +(*virCgroupHasControllerCB)(virCgroup *cgroup, int controller); typedef int -(*virCgroupGetAnyControllerCB)(virCgroupPtr group); +(*virCgroupGetAnyControllerCB)(virCgroup *group); typedef int -(*virCgroupPathOfControllerCB)(virCgroupPtr group, +(*virCgroupPathOfControllerCB)(virCgroup *group, int controller, const char *key, char **path); typedef bool -(*virCgroupExistsCB)(virCgroupPtr group); +(*virCgroupExistsCB)(virCgroup *group); typedef int -(*virCgroupMakeGroupCB)(virCgroupPtr parent, - virCgroupPtr group, +(*virCgroupMakeGroupCB)(virCgroup *parent, + virCgroup *group, bool create, pid_t pid, unsigned int flags); typedef int -(*virCgroupRemoveCB)(virCgroupPtr group); +(*virCgroupRemoveCB)(virCgroup *group); typedef int -(*virCgroupAddTaskCB)(virCgroupPtr group, +(*virCgroupAddTaskCB)(virCgroup *group, pid_t pid, unsigned int flags); typedef int -(*virCgroupHasEmptyTasksCB)(virCgroupPtr cgroup, +(*virCgroupHasEmptyTasksCB)(virCgroup *cgroup, int controller); typedef int -(*virCgroupKillRecursiveCB)(virCgroupPtr group, +(*virCgroupKillRecursiveCB)(virCgroup *group, int signum, GHashTable *pids); typedef int -(*virCgroupBindMountCB)(virCgroupPtr group, +(*virCgroupBindMountCB)(virCgroup *group, const char *oldroot, const char *mountopts); typedef int -(*virCgroupSetOwnerCB)(virCgroupPtr cgroup, +(*virCgroupSetOwnerCB)(virCgroup *cgroup, uid_t uid, gid_t gid, int controllers); typedef int -(*virCgroupSetBlkioWeightCB)(virCgroupPtr group, +(*virCgroupSetBlkioWeightCB)(virCgroup *group, unsigned int weight); typedef int -(*virCgroupGetBlkioWeightCB)(virCgroupPtr group, +(*virCgroupGetBlkioWeightCB)(virCgroup *group, unsigned int *weight); typedef int -(*virCgroupGetBlkioIoServicedCB)(virCgroupPtr group, +(*virCgroupGetBlkioIoServicedCB)(virCgroup *group, long long *bytes_read, long long *bytes_write, long long *requests_read, long long *requests_write); typedef int -(*virCgroupGetBlkioIoDeviceServicedCB)(virCgroupPtr group, +(*virCgroupGetBlkioIoDeviceServicedCB)(virCgroup *group, const char *path, long long *bytes_read, long long *bytes_write, @@ -180,61 +180,61 @@ typedef int long long *requests_write); typedef int -(*virCgroupSetBlkioDeviceWeightCB)(virCgroupPtr group, +(*virCgroupSetBlkioDeviceWeightCB)(virCgroup *group, const char *path, unsigned int weight); typedef int -(*virCgroupGetBlkioDeviceWeightCB)(virCgroupPtr group, +(*virCgroupGetBlkioDeviceWeightCB)(virCgroup *group, const char *path, unsigned int *weight); typedef int -(*virCgroupSetBlkioDeviceReadIopsCB)(virCgroupPtr group, +(*virCgroupSetBlkioDeviceReadIopsCB)(virCgroup *group, const char *path, unsigned int riops); typedef int -(*virCgroupGetBlkioDeviceReadIopsCB)(virCgroupPtr group, +(*virCgroupGetBlkioDeviceReadIopsCB)(virCgroup *group, const char *path, unsigned int *riops); typedef int -(*virCgroupSetBlkioDeviceWriteIopsCB)(virCgroupPtr group, +(*virCgroupSetBlkioDeviceWriteIopsCB)(virCgroup *group, const char *path, unsigned int wiops); typedef int -(*virCgroupGetBlkioDeviceWriteIopsCB)(virCgroupPtr group, +(*virCgroupGetBlkioDeviceWriteIopsCB)(virCgroup *group, const char *path, unsigned int *wiops); typedef int -(*virCgroupSetBlkioDeviceReadBpsCB)(virCgroupPtr group, +(*virCgroupSetBlkioDeviceReadBpsCB)(virCgroup *group, const char *path, unsigned long long rbps); typedef int -(*virCgroupGetBlkioDeviceReadBpsCB)(virCgroupPtr group, +(*virCgroupGetBlkioDeviceReadBpsCB)(virCgroup *group, const char *path, unsigned long long *rbps); typedef int -(*virCgroupSetBlkioDeviceWriteBpsCB)(virCgroupPtr group, +(*virCgroupSetBlkioDeviceWriteBpsCB)(virCgroup *group, const char *path, unsigned long long wbps); typedef int -(*virCgroupGetBlkioDeviceWriteBpsCB)(virCgroupPtr group, +(*virCgroupGetBlkioDeviceWriteBpsCB)(virCgroup *group, const char *path, unsigned long long *wbps); typedef int -(*virCgroupSetMemoryCB)(virCgroupPtr group, +(*virCgroupSetMemoryCB)(virCgroup *group, unsigned long long kb); typedef int -(*virCgroupGetMemoryStatCB)(virCgroupPtr group, +(*virCgroupGetMemoryStatCB)(virCgroup *group, unsigned long long *cache, unsigned long long *activeAnon, unsigned long long *inactiveAnon, @@ -243,128 +243,128 @@ typedef int unsigned long long *unevictable); typedef int -(*virCgroupGetMemoryUsageCB)(virCgroupPtr group, +(*virCgroupGetMemoryUsageCB)(virCgroup *group, unsigned long *kb); typedef int -(*virCgroupSetMemoryHardLimitCB)(virCgroupPtr group, +(*virCgroupSetMemoryHardLimitCB)(virCgroup *group, unsigned long long kb); typedef int -(*virCgroupGetMemoryHardLimitCB)(virCgroupPtr group, +(*virCgroupGetMemoryHardLimitCB)(virCgroup *group, unsigned long long *kb); typedef int -(*virCgroupSetMemorySoftLimitCB)(virCgroupPtr group, +(*virCgroupSetMemorySoftLimitCB)(virCgroup *group, unsigned long long kb); typedef int -(*virCgroupGetMemorySoftLimitCB)(virCgroupPtr group, +(*virCgroupGetMemorySoftLimitCB)(virCgroup *group, unsigned long long *kb); typedef int -(*virCgroupSetMemSwapHardLimitCB)(virCgroupPtr group, +(*virCgroupSetMemSwapHardLimitCB)(virCgroup *group, unsigned long long kb); typedef int -(*virCgroupGetMemSwapHardLimitCB)(virCgroupPtr group, +(*virCgroupGetMemSwapHardLimitCB)(virCgroup *group, unsigned long long *kb); typedef int -(*virCgroupGetMemSwapUsageCB)(virCgroupPtr group, +(*virCgroupGetMemSwapUsageCB)(virCgroup *group, unsigned long long *kb); typedef int -(*virCgroupAllowDeviceCB)(virCgroupPtr group, +(*virCgroupAllowDeviceCB)(virCgroup *group, char type, int major, int minor, int perms); typedef int -(*virCgroupDenyDeviceCB)(virCgroupPtr group, +(*virCgroupDenyDeviceCB)(virCgroup *group, char type, int major, int minor, int perms); typedef int -(*virCgroupAllowAllDevicesCB)(virCgroupPtr group, +(*virCgroupAllowAllDevicesCB)(virCgroup *group, int perms); typedef int -(*virCgroupDenyAllDevicesCB)(virCgroupPtr group); +(*virCgroupDenyAllDevicesCB)(virCgroup *group); typedef int -(*virCgroupSetCpuSharesCB)(virCgroupPtr group, +(*virCgroupSetCpuSharesCB)(virCgroup *group, unsigned long long shares); typedef int -(*virCgroupGetCpuSharesCB)(virCgroupPtr group, +(*virCgroupGetCpuSharesCB)(virCgroup *group, unsigned long long *shares); typedef int -(*virCgroupSetCpuCfsPeriodCB)(virCgroupPtr group, +(*virCgroupSetCpuCfsPeriodCB)(virCgroup *group, unsigned long long cfs_period); typedef int -(*virCgroupGetCpuCfsPeriodCB)(virCgroupPtr group, +(*virCgroupGetCpuCfsPeriodCB)(virCgroup *group, unsigned long long *cfs_period); typedef int -(*virCgroupSetCpuCfsQuotaCB)(virCgroupPtr group, +(*virCgroupSetCpuCfsQuotaCB)(virCgroup *group, long long cfs_quota); typedef int -(*virCgroupGetCpuCfsQuotaCB)(virCgroupPtr group, +(*virCgroupGetCpuCfsQuotaCB)(virCgroup *group, long long *cfs_quota); typedef bool -(*virCgroupSupportsCpuBWCB)(virCgroupPtr cgroup); +(*virCgroupSupportsCpuBWCB)(virCgroup *cgroup); typedef int -(*virCgroupGetCpuacctUsageCB)(virCgroupPtr group, +(*virCgroupGetCpuacctUsageCB)(virCgroup *group, unsigned long long *usage); typedef int -(*virCgroupGetCpuacctPercpuUsageCB)(virCgroupPtr group, +(*virCgroupGetCpuacctPercpuUsageCB)(virCgroup *group, char **usage); typedef int -(*virCgroupGetCpuacctStatCB)(virCgroupPtr group, +(*virCgroupGetCpuacctStatCB)(virCgroup *group, unsigned long long *user, unsigned long long *sys); typedef int -(*virCgroupSetFreezerStateCB)(virCgroupPtr group, +(*virCgroupSetFreezerStateCB)(virCgroup *group, const char *state); typedef int -(*virCgroupGetFreezerStateCB)(virCgroupPtr group, +(*virCgroupGetFreezerStateCB)(virCgroup *group, char **state); typedef int -(*virCgroupSetCpusetMemsCB)(virCgroupPtr group, +(*virCgroupSetCpusetMemsCB)(virCgroup *group, const char *mems); typedef int -(*virCgroupGetCpusetMemsCB)(virCgroupPtr group, +(*virCgroupGetCpusetMemsCB)(virCgroup *group, char **mems); typedef int -(*virCgroupSetCpusetMemoryMigrateCB)(virCgroupPtr group, +(*virCgroupSetCpusetMemoryMigrateCB)(virCgroup *group, bool migrate); typedef int -(*virCgroupGetCpusetMemoryMigrateCB)(virCgroupPtr group, +(*virCgroupGetCpusetMemoryMigrateCB)(virCgroup *group, bool *migrate); typedef int -(*virCgroupSetCpusetCpusCB)(virCgroupPtr group, +(*virCgroupSetCpusetCpusCB)(virCgroup *group, const char *cpus); typedef int -(*virCgroupGetCpusetCpusCB)(virCgroupPtr group, +(*virCgroupGetCpusetCpusCB)(virCgroup *group, char **cpus); struct _virCgroupBackend { @@ -448,21 +448,20 @@ struct _virCgroupBackend { virCgroupGetCpusetCpusCB getCpusetCpus; }; typedef struct _virCgroupBackend virCgroupBackend; -typedef virCgroupBackend *virCgroupBackendPtr; void -virCgroupBackendRegister(virCgroupBackendPtr backend); +virCgroupBackendRegister(virCgroupBackend *backend); -virCgroupBackendPtr * +virCgroupBackend ** virCgroupBackendGetAll(void); -virCgroupBackendPtr -virCgroupBackendForController(virCgroupPtr group, +virCgroupBackend * +virCgroupBackendForController(virCgroup *group, unsigned int controller); #define VIR_CGROUP_BACKEND_CALL(group, controller, func, ret, ...) \ do { \ - virCgroupBackendPtr backend = virCgroupBackendForController(group, controller); \ + virCgroupBackend *backend = virCgroupBackendForController(group, controller); \ if (!backend) { \ virReportError(VIR_ERR_INTERNAL_ERROR, \ _("failed to get cgroup backend for '%s'"), #func); \ diff --git a/src/util/vircgrouppriv.h b/src/util/vircgrouppriv.h index 7c63780800..00193fb101 100644 --- a/src/util/vircgrouppriv.h +++ b/src/util/vircgrouppriv.h @@ -39,7 +39,6 @@ struct _virCgroupV1Controller { char *placement; }; typedef struct _virCgroupV1Controller virCgroupV1Controller; -typedef virCgroupV1Controller *virCgroupV1ControllerPtr; struct _virCgroupV2Devices { int mapfd; @@ -48,7 +47,6 @@ struct _virCgroupV2Devices { ssize_t max; }; typedef struct _virCgroupV2Devices virCgroupV2Devices; -typedef virCgroupV2Devices *virCgroupV2DevicesPtr; struct _virCgroupV2Controller { int controllers; @@ -57,16 +55,15 @@ struct _virCgroupV2Controller { virCgroupV2Devices devices; }; typedef struct _virCgroupV2Controller virCgroupV2Controller; -typedef virCgroupV2Controller *virCgroupV2ControllerPtr; struct _virCgroup { - virCgroupBackendPtr backends[VIR_CGROUP_BACKEND_TYPE_LAST]; + virCgroupBackend *backends[VIR_CGROUP_BACKEND_TYPE_LAST]; virCgroupV1Controller legacy[VIR_CGROUP_CONTROLLER_LAST]; virCgroupV2Controller unified; char *unitName; - virCgroupPtr nested; + virCgroup *nested; }; #define virCgroupGetNested(cgroup) \ @@ -82,32 +79,32 @@ int virCgroupSetValueRaw(const char *path, int virCgroupGetValueRaw(const char *path, char **value); -int virCgroupSetValueStr(virCgroupPtr group, +int virCgroupSetValueStr(virCgroup *group, int controller, const char *key, const char *value); -int virCgroupGetValueStr(virCgroupPtr group, +int virCgroupGetValueStr(virCgroup *group, int controller, const char *key, char **value); -int virCgroupSetValueU64(virCgroupPtr group, +int virCgroupSetValueU64(virCgroup *group, int controller, const char *key, unsigned long long int value); -int virCgroupGetValueU64(virCgroupPtr group, +int virCgroupGetValueU64(virCgroup *group, int controller, const char *key, unsigned long long int *value); -int virCgroupSetValueI64(virCgroupPtr group, +int virCgroupSetValueI64(virCgroup *group, int controller, const char *key, long long int value); -int virCgroupGetValueI64(virCgroupPtr group, +int virCgroupGetValueI64(virCgroup *group, int controller, const char *key, long long int *value); @@ -123,19 +120,19 @@ int virCgroupGetValueForBlkDev(const char *str, int virCgroupNewPartition(const char *path, bool create, int controllers, - virCgroupPtr *group) + virCgroup **group) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4); -int virCgroupNewDomainPartition(virCgroupPtr partition, +int virCgroupNewDomainPartition(virCgroup *partition, const char *driver, const char *name, - virCgroupPtr *group) + virCgroup **group) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4); int virCgroupRemoveRecursively(char *grppath); -int virCgroupKillRecursiveInternal(virCgroupPtr group, +int virCgroupKillRecursiveInternal(virCgroup *group, int signum, GHashTable *pids, int controller, diff --git a/src/util/vircgroupv1.c b/src/util/vircgroupv1.c index 0e7ab98a01..2cc7dd386a 100644 --- a/src/util/vircgroupv1.c +++ b/src/util/vircgroupv1.c @@ -88,7 +88,7 @@ virCgroupV1Available(void) static bool -virCgroupV1ValidateMachineGroup(virCgroupPtr group, +virCgroupV1ValidateMachineGroup(virCgroup *group, const char *name, const char *drivername, const char *machinename) @@ -168,8 +168,8 @@ virCgroupV1ValidateMachineGroup(virCgroupPtr group, static int -virCgroupV1CopyMounts(virCgroupPtr group, - virCgroupPtr parent) +virCgroupV1CopyMounts(virCgroup *group, + virCgroup *parent) { size_t i; for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { @@ -185,9 +185,9 @@ virCgroupV1CopyMounts(virCgroupPtr group, static int -virCgroupV1CopyPlacement(virCgroupPtr group, +virCgroupV1CopyPlacement(virCgroup *group, const char *path, - virCgroupPtr parent) + virCgroup *parent) { size_t i; for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) { @@ -218,7 +218,7 @@ virCgroupV1CopyPlacement(virCgroupPtr group, static int virCgroupV1ResolveMountLink(const char *mntDir, const char *typeStr, - virCgroupV1ControllerPtr controller) + virCgroupV1Controller *controller) { g_autofree char *linkSrc = NULL; g_autofree char *tmp = NULL; @@ -290,7 +290,7 @@ virCgroupV1MountOptsMatchController(const char *mntOpts, static int -virCgroupV1DetectMounts(virCgroupPtr group, +virCgroupV1DetectMounts(virCgroup *group, const char *mntType, const char *mntOpts, const char *mntDir) @@ -311,7 +311,7 @@ virCgroupV1DetectMounts(virCgroupPtr group, * once. We need to save the results of the last one, * and we need to be careful to release the memory used * by previous processing. */ - virCgroupV1ControllerPtr controller = &group->legacy[i]; + virCgroupV1Controller *controller = &group->legacy[i]; VIR_FREE(controller->mountPoint); VIR_FREE(controller->linkPoint); @@ -329,7 +329,7 @@ virCgroupV1DetectMounts(virCgroupPtr group, static int -virCgroupV1DetectPlacement(virCgroupPtr group, +virCgroupV1DetectPlacement(virCgroup *group, const char *path, const char *controllers, const char *selfpath) @@ -378,7 +378,7 @@ virCgroupV1DetectPlacement(virCgroupPtr group, static int -virCgroupV1SetPlacement(virCgroupPtr group, +virCgroupV1SetPlacement(virCgroup *group, const char *path) { size_t i; @@ -398,7 +398,7 @@ virCgroupV1SetPlacement(virCgroupPtr group, static int -virCgroupV1ValidatePlacement(virCgroupPtr group, +virCgroupV1ValidatePlacement(virCgroup *group, pid_t pid) { size_t i; @@ -428,16 +428,16 @@ virCgroupV1ValidatePlacement(virCgroupPtr group, static char * -virCgroupV1StealPlacement(virCgroupPtr group) +virCgroupV1StealPlacement(virCgroup *group) { return g_steal_pointer(&group->legacy[VIR_CGROUP_CONTROLLER_SYSTEMD].placement); } static int -virCgroupV1DetectControllers(virCgroupPtr group, +virCgroupV1DetectControllers(virCgroup *group, int controllers, - virCgroupPtr parent G_GNUC_UNUSED, + virCgroup *parent G_GNUC_UNUSED, int detected) { size_t i; @@ -512,7 +512,7 @@ virCgroupV1DetectControllers(virCgroupPtr group, static bool -virCgroupV1HasController(virCgroupPtr group, +virCgroupV1HasController(virCgroup *group, int controller) { return group->legacy[controller].mountPoint != NULL; @@ -520,7 +520,7 @@ virCgroupV1HasController(virCgroupPtr group, static int -virCgroupV1GetAnyController(virCgroupPtr group) +virCgroupV1GetAnyController(virCgroup *group) { size_t i; @@ -541,7 +541,7 @@ virCgroupV1GetAnyController(virCgroupPtr group) static int -virCgroupV1PathOfController(virCgroupPtr group, +virCgroupV1PathOfController(virCgroup *group, int controller, const char *key, char **path) @@ -568,8 +568,8 @@ virCgroupV1PathOfController(virCgroupPtr group, static int -virCgroupV1CpuSetInherit(virCgroupPtr parent, - virCgroupPtr group) +virCgroupV1CpuSetInherit(virCgroup *parent, + virCgroup *group) { size_t i; const char *inherit_values[] = { @@ -604,7 +604,7 @@ virCgroupV1CpuSetInherit(virCgroupPtr parent, static int -virCgroupV1SetMemoryUseHierarchy(virCgroupPtr group) +virCgroupV1SetMemoryUseHierarchy(virCgroup *group) { unsigned long long value; const char *filename = "memory.use_hierarchy"; @@ -628,8 +628,8 @@ virCgroupV1SetMemoryUseHierarchy(virCgroupPtr group) static int -virCgroupV1MakeGroup(virCgroupPtr parent, - virCgroupPtr group, +virCgroupV1MakeGroup(virCgroup *parent, + virCgroup *group, bool create, pid_t pid G_GNUC_UNUSED, unsigned int flags) @@ -700,7 +700,7 @@ virCgroupV1MakeGroup(virCgroupPtr parent, static bool -virCgroupV1Exists(virCgroupPtr group) +virCgroupV1Exists(virCgroup *group) { size_t i; @@ -726,7 +726,7 @@ virCgroupV1Exists(virCgroupPtr group) static int -virCgroupV1Remove(virCgroupPtr group) +virCgroupV1Remove(virCgroup *group) { int rc = 0; size_t i; @@ -762,7 +762,7 @@ virCgroupV1Remove(virCgroupPtr group) static int -virCgroupV1AddTask(virCgroupPtr group, +virCgroupV1AddTask(virCgroup *group, pid_t pid, unsigned int flags) { @@ -789,7 +789,7 @@ virCgroupV1AddTask(virCgroupPtr group, static int -virCgroupV1HasEmptyTasks(virCgroupPtr cgroup, +virCgroupV1HasEmptyTasks(virCgroup *cgroup, int controller) { int ret = -1; @@ -808,7 +808,7 @@ virCgroupV1HasEmptyTasks(virCgroupPtr cgroup, static int -virCgroupV1KillRecursive(virCgroupPtr group, +virCgroupV1KillRecursive(virCgroup *group, int signum, GHashTable *pids) { @@ -823,7 +823,7 @@ virCgroupV1KillRecursive(virCgroupPtr group, static char * -virCgroupV1IdentifyRoot(virCgroupPtr group) +virCgroupV1IdentifyRoot(virCgroup *group) { char *ret = NULL; size_t i; @@ -851,7 +851,7 @@ virCgroupV1IdentifyRoot(virCgroupPtr group) static int -virCgroupV1BindMount(virCgroupPtr group, +virCgroupV1BindMount(virCgroup *group, const char *oldroot, const char *mountopts) { @@ -926,7 +926,7 @@ virCgroupV1BindMount(virCgroupPtr group, static int -virCgroupV1SetOwner(virCgroupPtr cgroup, +virCgroupV1SetOwner(virCgroup *cgroup, uid_t uid, gid_t gid, int controllers) @@ -983,7 +983,7 @@ virCgroupV1SetOwner(virCgroupPtr cgroup, static int -virCgroupV1SetBlkioWeight(virCgroupPtr group, +virCgroupV1SetBlkioWeight(virCgroup *group, unsigned int weight) { g_autofree char *path = NULL; @@ -1021,7 +1021,7 @@ virCgroupV1SetBlkioWeight(virCgroupPtr group, static int -virCgroupV1GetBlkioWeight(virCgroupPtr group, +virCgroupV1GetBlkioWeight(virCgroup *group, unsigned int *weight) { g_autofree char *path = NULL; @@ -1062,7 +1062,7 @@ virCgroupV1GetBlkioWeight(virCgroupPtr group, static int -virCgroupV1GetBlkioIoServiced(virCgroupPtr group, +virCgroupV1GetBlkioIoServiced(virCgroup *group, long long *bytes_read, long long *bytes_write, long long *requests_read, @@ -1156,7 +1156,7 @@ virCgroupV1GetBlkioIoServiced(virCgroupPtr group, static int -virCgroupV1GetBlkioIoDeviceServiced(virCgroupPtr group, +virCgroupV1GetBlkioIoDeviceServiced(virCgroup *group, const char *path, long long *bytes_read, long long *bytes_write, @@ -1245,7 +1245,7 @@ virCgroupV1GetBlkioIoDeviceServiced(virCgroupPtr group, static int -virCgroupV1SetBlkioDeviceWeight(virCgroupPtr group, +virCgroupV1SetBlkioDeviceWeight(virCgroup *group, const char *devPath, unsigned int weight) { @@ -1283,7 +1283,7 @@ virCgroupV1SetBlkioDeviceWeight(virCgroupPtr group, static int -virCgroupV1GetBlkioDeviceWeight(virCgroupPtr group, +virCgroupV1GetBlkioDeviceWeight(virCgroup *group, const char *devPath, unsigned int *weight) { @@ -1322,7 +1322,7 @@ virCgroupV1GetBlkioDeviceWeight(virCgroupPtr group, static int -virCgroupV1SetBlkioDeviceReadIops(virCgroupPtr group, +virCgroupV1SetBlkioDeviceReadIops(virCgroup *group, const char *path, unsigned int riops) { @@ -1342,7 +1342,7 @@ virCgroupV1SetBlkioDeviceReadIops(virCgroupPtr group, static int -virCgroupV1GetBlkioDeviceReadIops(virCgroupPtr group, +virCgroupV1GetBlkioDeviceReadIops(virCgroup *group, const char *path, unsigned int *riops) { @@ -1373,7 +1373,7 @@ virCgroupV1GetBlkioDeviceReadIops(virCgroupPtr group, static int -virCgroupV1SetBlkioDeviceWriteIops(virCgroupPtr group, +virCgroupV1SetBlkioDeviceWriteIops(virCgroup *group, const char *path, unsigned int wiops) { @@ -1393,7 +1393,7 @@ virCgroupV1SetBlkioDeviceWriteIops(virCgroupPtr group, static int -virCgroupV1GetBlkioDeviceWriteIops(virCgroupPtr group, +virCgroupV1GetBlkioDeviceWriteIops(virCgroup *group, const char *path, unsigned int *wiops) { @@ -1424,7 +1424,7 @@ virCgroupV1GetBlkioDeviceWriteIops(virCgroupPtr group, static int -virCgroupV1SetBlkioDeviceReadBps(virCgroupPtr group, +virCgroupV1SetBlkioDeviceReadBps(virCgroup *group, const char *path, unsigned long long rbps) { @@ -1444,7 +1444,7 @@ virCgroupV1SetBlkioDeviceReadBps(virCgroupPtr group, static int -virCgroupV1GetBlkioDeviceReadBps(virCgroupPtr group, +virCgroupV1GetBlkioDeviceReadBps(virCgroup *group, const char *path, unsigned long long *rbps) { @@ -1475,7 +1475,7 @@ virCgroupV1GetBlkioDeviceReadBps(virCgroupPtr group, static int -virCgroupV1SetBlkioDeviceWriteBps(virCgroupPtr group, +virCgroupV1SetBlkioDeviceWriteBps(virCgroup *group, const char *path, unsigned long long wbps) { @@ -1495,7 +1495,7 @@ virCgroupV1SetBlkioDeviceWriteBps(virCgroupPtr group, static int -virCgroupV1GetBlkioDeviceWriteBps(virCgroupPtr group, +virCgroupV1GetBlkioDeviceWriteBps(virCgroup *group, const char *path, unsigned long long *wbps) { @@ -1570,7 +1570,7 @@ virCgroupV1GetMemoryUnlimitedKB(void) static int -virCgroupV1SetMemory(virCgroupPtr group, +virCgroupV1SetMemory(virCgroup *group, unsigned long long kb) { unsigned long long maxkb = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED; @@ -1596,7 +1596,7 @@ virCgroupV1SetMemory(virCgroupPtr group, static int -virCgroupV1GetMemoryStat(virCgroupPtr group, +virCgroupV1GetMemoryStat(virCgroup *group, unsigned long long *cache, unsigned long long *activeAnon, unsigned long long *inactiveAnon, @@ -1675,7 +1675,7 @@ virCgroupV1GetMemoryStat(virCgroupPtr group, static int -virCgroupV1GetMemoryUsage(virCgroupPtr group, +virCgroupV1GetMemoryUsage(virCgroup *group, unsigned long *kb) { long long unsigned int usage_in_bytes; @@ -1690,7 +1690,7 @@ virCgroupV1GetMemoryUsage(virCgroupPtr group, static int -virCgroupV1SetMemoryHardLimit(virCgroupPtr group, +virCgroupV1SetMemoryHardLimit(virCgroup *group, unsigned long long kb) { return virCgroupV1SetMemory(group, kb); @@ -1698,7 +1698,7 @@ virCgroupV1SetMemoryHardLimit(virCgroupPtr group, static int -virCgroupV1GetMemoryHardLimit(virCgroupPtr group, +virCgroupV1GetMemoryHardLimit(virCgroup *group, unsigned long long *kb) { long long unsigned int limit_in_bytes; @@ -1717,7 +1717,7 @@ virCgroupV1GetMemoryHardLimit(virCgroupPtr group, static int -virCgroupV1SetMemorySoftLimit(virCgroupPtr group, +virCgroupV1SetMemorySoftLimit(virCgroup *group, unsigned long long kb) { unsigned long long maxkb = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED; @@ -1743,7 +1743,7 @@ virCgroupV1SetMemorySoftLimit(virCgroupPtr group, static int -virCgroupV1GetMemorySoftLimit(virCgroupPtr group, +virCgroupV1GetMemorySoftLimit(virCgroup *group, unsigned long long *kb) { long long unsigned int limit_in_bytes; @@ -1762,7 +1762,7 @@ virCgroupV1GetMemorySoftLimit(virCgroupPtr group, static int -virCgroupV1SetMemSwapHardLimit(virCgroupPtr group, +virCgroupV1SetMemSwapHardLimit(virCgroup *group, unsigned long long kb) { unsigned long long maxkb = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED; @@ -1788,7 +1788,7 @@ virCgroupV1SetMemSwapHardLimit(virCgroupPtr group, static int -virCgroupV1GetMemSwapHardLimit(virCgroupPtr group, +virCgroupV1GetMemSwapHardLimit(virCgroup *group, unsigned long long *kb) { long long unsigned int limit_in_bytes; @@ -1807,7 +1807,7 @@ virCgroupV1GetMemSwapHardLimit(virCgroupPtr group, static int -virCgroupV1GetMemSwapUsage(virCgroupPtr group, +virCgroupV1GetMemSwapUsage(virCgroup *group, unsigned long long *kb) { long long unsigned int usage_in_bytes; @@ -1822,7 +1822,7 @@ virCgroupV1GetMemSwapUsage(virCgroupPtr group, static int -virCgroupV1AllowDevice(virCgroupPtr group, +virCgroupV1AllowDevice(virCgroup *group, char type, int major, int minor, @@ -1856,7 +1856,7 @@ virCgroupV1AllowDevice(virCgroupPtr group, static int -virCgroupV1DenyDevice(virCgroupPtr group, +virCgroupV1DenyDevice(virCgroup *group, char type, int major, int minor, @@ -1890,7 +1890,7 @@ virCgroupV1DenyDevice(virCgroupPtr group, static int -virCgroupV1AllowAllDevices(virCgroupPtr group, +virCgroupV1AllowAllDevices(virCgroup *group, int perms) { if (virCgroupV1AllowDevice(group, 'b', -1, -1, perms) < 0) @@ -1904,7 +1904,7 @@ virCgroupV1AllowAllDevices(virCgroupPtr group, static int -virCgroupV1DenyAllDevices(virCgroupPtr group) +virCgroupV1DenyAllDevices(virCgroup *group) { return virCgroupSetValueStr(group, VIR_CGROUP_CONTROLLER_DEVICES, @@ -1914,7 +1914,7 @@ virCgroupV1DenyAllDevices(virCgroupPtr group) static int -virCgroupV1SetCpuShares(virCgroupPtr group, +virCgroupV1SetCpuShares(virCgroup *group, unsigned long long shares) { if (shares < VIR_CGROUP_CPU_SHARES_MIN || @@ -1940,7 +1940,7 @@ virCgroupV1SetCpuShares(virCgroupPtr group, static int -virCgroupV1GetCpuShares(virCgroupPtr group, +virCgroupV1GetCpuShares(virCgroup *group, unsigned long long *shares) { return virCgroupGetValueU64(group, @@ -1950,7 +1950,7 @@ virCgroupV1GetCpuShares(virCgroupPtr group, static int -virCgroupV1SetCpuCfsPeriod(virCgroupPtr group, +virCgroupV1SetCpuCfsPeriod(virCgroup *group, unsigned long long cfs_period) { if (cfs_period < VIR_CGROUP_CPU_PERIOD_MIN || @@ -1970,7 +1970,7 @@ virCgroupV1SetCpuCfsPeriod(virCgroupPtr group, static int -virCgroupV1GetCpuCfsPeriod(virCgroupPtr group, +virCgroupV1GetCpuCfsPeriod(virCgroup *group, unsigned long long *cfs_period) { return virCgroupGetValueU64(group, @@ -1980,7 +1980,7 @@ virCgroupV1GetCpuCfsPeriod(virCgroupPtr group, static int -virCgroupV1SetCpuCfsQuota(virCgroupPtr group, +virCgroupV1SetCpuCfsQuota(virCgroup *group, long long cfs_quota) { if (cfs_quota >= 0 && @@ -2001,7 +2001,7 @@ virCgroupV1SetCpuCfsQuota(virCgroupPtr group, static int -virCgroupV1GetCpuCfsQuota(virCgroupPtr group, +virCgroupV1GetCpuCfsQuota(virCgroup *group, long long *cfs_quota) { return virCgroupGetValueI64(group, @@ -2011,7 +2011,7 @@ virCgroupV1GetCpuCfsQuota(virCgroupPtr group, static bool -virCgroupV1SupportsCpuBW(virCgroupPtr cgroup) +virCgroupV1SupportsCpuBW(virCgroup *cgroup) { g_autofree char *path = NULL; @@ -2029,7 +2029,7 @@ virCgroupV1SupportsCpuBW(virCgroupPtr cgroup) static int -virCgroupV1GetCpuacctUsage(virCgroupPtr group, +virCgroupV1GetCpuacctUsage(virCgroup *group, unsigned long long *usage) { return virCgroupGetValueU64(group, @@ -2039,7 +2039,7 @@ virCgroupV1GetCpuacctUsage(virCgroupPtr group, static int -virCgroupV1GetCpuacctPercpuUsage(virCgroupPtr group, +virCgroupV1GetCpuacctPercpuUsage(virCgroup *group, char **usage) { return virCgroupGetValueStr(group, VIR_CGROUP_CONTROLLER_CPUACCT, @@ -2048,7 +2048,7 @@ virCgroupV1GetCpuacctPercpuUsage(virCgroupPtr group, static int -virCgroupV1GetCpuacctStat(virCgroupPtr group, +virCgroupV1GetCpuacctStat(virCgroup *group, unsigned long long *user, unsigned long long *sys) { @@ -2094,7 +2094,7 @@ virCgroupV1GetCpuacctStat(virCgroupPtr group, static int -virCgroupV1SetFreezerState(virCgroupPtr group, +virCgroupV1SetFreezerState(virCgroup *group, const char *state) { return virCgroupSetValueStr(group, @@ -2104,7 +2104,7 @@ virCgroupV1SetFreezerState(virCgroupPtr group, static int -virCgroupV1GetFreezerState(virCgroupPtr group, +virCgroupV1GetFreezerState(virCgroup *group, char **state) { return virCgroupGetValueStr(group, @@ -2114,7 +2114,7 @@ virCgroupV1GetFreezerState(virCgroupPtr group, static int -virCgroupV1SetCpusetMems(virCgroupPtr group, +virCgroupV1SetCpusetMems(virCgroup *group, const char *mems) { return virCgroupSetValueStr(group, @@ -2125,7 +2125,7 @@ virCgroupV1SetCpusetMems(virCgroupPtr group, static int -virCgroupV1GetCpusetMems(virCgroupPtr group, +virCgroupV1GetCpusetMems(virCgroup *group, char **mems) { return virCgroupGetValueStr(group, @@ -2136,7 +2136,7 @@ virCgroupV1GetCpusetMems(virCgroupPtr group, static int -virCgroupV1SetCpusetMemoryMigrate(virCgroupPtr group, +virCgroupV1SetCpusetMemoryMigrate(virCgroup *group, bool migrate) { return virCgroupSetValueStr(group, @@ -2147,7 +2147,7 @@ virCgroupV1SetCpusetMemoryMigrate(virCgroupPtr group, static int -virCgroupV1GetCpusetMemoryMigrate(virCgroupPtr group, +virCgroupV1GetCpusetMemoryMigrate(virCgroup *group, bool *migrate) { unsigned long long value = 0; @@ -2161,7 +2161,7 @@ virCgroupV1GetCpusetMemoryMigrate(virCgroupPtr group, static int -virCgroupV1SetCpusetCpus(virCgroupPtr group, +virCgroupV1SetCpusetCpus(virCgroup *group, const char *cpus) { return virCgroupSetValueStr(group, @@ -2172,7 +2172,7 @@ virCgroupV1SetCpusetCpus(virCgroupPtr group, static int -virCgroupV1GetCpusetCpus(virCgroupPtr group, +virCgroupV1GetCpusetCpus(virCgroup *group, char **cpus) { return virCgroupGetValueStr(group, diff --git a/src/util/vircgroupv2.c b/src/util/vircgroupv2.c index 248d4047e5..a9e9b9805f 100644 --- a/src/util/vircgroupv2.c +++ b/src/util/vircgroupv2.c @@ -97,7 +97,7 @@ virCgroupV2Available(void) static bool -virCgroupV2ValidateMachineGroup(virCgroupPtr group, +virCgroupV2ValidateMachineGroup(virCgroup *group, const char *name G_GNUC_UNUSED, const char *drivername, const char *machinename) @@ -136,8 +136,8 @@ virCgroupV2ValidateMachineGroup(virCgroupPtr group, static int -virCgroupV2CopyMounts(virCgroupPtr group, - virCgroupPtr parent) +virCgroupV2CopyMounts(virCgroup *group, + virCgroup *parent) { group->unified.mountPoint = g_strdup(parent->unified.mountPoint); return 0; @@ -145,9 +145,9 @@ virCgroupV2CopyMounts(virCgroupPtr group, static int -virCgroupV2CopyPlacement(virCgroupPtr group, +virCgroupV2CopyPlacement(virCgroup *group, const char *path, - virCgroupPtr parent) + virCgroup *parent) { bool delim = STREQ(parent->unified.placement, "/") || STREQ(path, ""); @@ -168,7 +168,7 @@ virCgroupV2CopyPlacement(virCgroupPtr group, static int -virCgroupV2DetectMounts(virCgroupPtr group, +virCgroupV2DetectMounts(virCgroup *group, const char *mntType, const char *mntOpts G_GNUC_UNUSED, const char *mntDir) @@ -184,7 +184,7 @@ virCgroupV2DetectMounts(virCgroupPtr group, static int -virCgroupV2DetectPlacement(virCgroupPtr group, +virCgroupV2DetectPlacement(virCgroup *group, const char *path, const char *controllers, const char *selfpath) @@ -227,7 +227,7 @@ virCgroupV2DetectPlacement(virCgroupPtr group, static int -virCgroupV2SetPlacement(virCgroupPtr group, +virCgroupV2SetPlacement(virCgroup *group, const char *path) { group->unified.placement = g_strdup(path); @@ -237,7 +237,7 @@ virCgroupV2SetPlacement(virCgroupPtr group, static int -virCgroupV2ValidatePlacement(virCgroupPtr group, +virCgroupV2ValidatePlacement(virCgroup *group, pid_t pid G_GNUC_UNUSED) { if (!group->unified.placement) { @@ -251,15 +251,15 @@ virCgroupV2ValidatePlacement(virCgroupPtr group, static char * -virCgroupV2StealPlacement(virCgroupPtr group) +virCgroupV2StealPlacement(virCgroup *group) { return g_steal_pointer(&group->unified.placement); } static int -virCgroupV2ParseControllersFile(virCgroupPtr group, - virCgroupPtr parent) +virCgroupV2ParseControllersFile(virCgroup *group, + virCgroup *parent) { int rc; g_autofree char *contStr = NULL; @@ -307,9 +307,9 @@ virCgroupV2ParseControllersFile(virCgroupPtr group, static int -virCgroupV2DetectControllers(virCgroupPtr group, +virCgroupV2DetectControllers(virCgroup *group, int controllers, - virCgroupPtr parent, + virCgroup *parent, int detected) { size_t i; @@ -339,7 +339,7 @@ virCgroupV2DetectControllers(virCgroupPtr group, static bool -virCgroupV2HasController(virCgroupPtr group, +virCgroupV2HasController(virCgroup *group, int controller) { return group->unified.controllers & (1 << controller); @@ -347,7 +347,7 @@ virCgroupV2HasController(virCgroupPtr group, static int -virCgroupV2GetAnyController(virCgroupPtr group) +virCgroupV2GetAnyController(virCgroup *group) { /* The least significant bit is position 1. */ return __builtin_ffs(group->unified.controllers) - 1; @@ -355,7 +355,7 @@ virCgroupV2GetAnyController(virCgroupPtr group) static int -virCgroupV2PathOfController(virCgroupPtr group, +virCgroupV2PathOfController(virCgroup *group, int controller, const char *key, char **path) @@ -382,8 +382,8 @@ virCgroupV2PathOfController(virCgroupPtr group, * 0 on success */ static int -virCgroupV2EnableController(virCgroupPtr group, - virCgroupPtr parent, +virCgroupV2EnableController(virCgroup *group, + virCgroup *parent, int controller, bool report) { @@ -413,14 +413,14 @@ virCgroupV2EnableController(virCgroupPtr group, static int -virCgroupV2AddTask(virCgroupPtr group, +virCgroupV2AddTask(virCgroup *group, pid_t pid, unsigned int flags); static int -virCgroupV2MakeGroup(virCgroupPtr parent, - virCgroupPtr group, +virCgroupV2MakeGroup(virCgroup *parent, + virCgroup *group, bool create, pid_t pid, unsigned int flags) @@ -506,7 +506,7 @@ virCgroupV2MakeGroup(virCgroupPtr parent, static bool -virCgroupV2Exists(virCgroupPtr group) +virCgroupV2Exists(virCgroup *group) { g_autofree char *path = NULL; int controller; @@ -520,7 +520,7 @@ virCgroupV2Exists(virCgroupPtr group) static int -virCgroupV2Remove(virCgroupPtr group) +virCgroupV2Remove(virCgroup *group) { g_autofree char *grppath = NULL; int controller; @@ -542,7 +542,7 @@ virCgroupV2Remove(virCgroupPtr group) static int -virCgroupV2AddTask(virCgroupPtr group, +virCgroupV2AddTask(virCgroup *group, pid_t pid, unsigned int flags) { @@ -556,7 +556,7 @@ virCgroupV2AddTask(virCgroupPtr group, static int -virCgroupV2HasEmptyTasks(virCgroupPtr cgroup, +virCgroupV2HasEmptyTasks(virCgroup *cgroup, int controller) { int ret = -1; @@ -572,7 +572,7 @@ virCgroupV2HasEmptyTasks(virCgroupPtr cgroup, static int -virCgroupV2KillRecursive(virCgroupPtr group, +virCgroupV2KillRecursive(virCgroup *group, int signum, GHashTable *pids) { @@ -587,7 +587,7 @@ virCgroupV2KillRecursive(virCgroupPtr group, static int -virCgroupV2BindMount(virCgroupPtr group, +virCgroupV2BindMount(virCgroup *group, const char *oldroot, const char *mountopts G_GNUC_UNUSED) { @@ -614,7 +614,7 @@ virCgroupV2BindMount(virCgroupPtr group, static int -virCgroupV2SetOwner(virCgroupPtr cgroup, +virCgroupV2SetOwner(virCgroup *cgroup, uid_t uid, gid_t gid, int controllers G_GNUC_UNUSED) @@ -638,7 +638,7 @@ virCgroupV2SetOwner(virCgroupPtr cgroup, static int -virCgroupV2SetBlkioWeight(virCgroupPtr group, +virCgroupV2SetBlkioWeight(virCgroup *group, unsigned int weight) { g_autofree char *path = NULL; @@ -678,7 +678,7 @@ virCgroupV2SetBlkioWeight(virCgroupPtr group, static int -virCgroupV2GetBlkioWeight(virCgroupPtr group, +virCgroupV2GetBlkioWeight(virCgroup *group, unsigned int *weight) { g_autofree char *path = NULL; @@ -726,7 +726,7 @@ virCgroupV2GetBlkioWeight(virCgroupPtr group, static int -virCgroupV2GetBlkioIoServiced(virCgroupPtr group, +virCgroupV2GetBlkioIoServiced(virCgroup *group, long long *bytes_read, long long *bytes_write, long long *requests_read, @@ -790,7 +790,7 @@ virCgroupV2GetBlkioIoServiced(virCgroupPtr group, static int -virCgroupV2GetBlkioIoDeviceServiced(virCgroupPtr group, +virCgroupV2GetBlkioIoDeviceServiced(virCgroup *group, const char *path, long long *bytes_read, long long *bytes_write, @@ -853,7 +853,7 @@ virCgroupV2GetBlkioIoDeviceServiced(virCgroupPtr group, static int -virCgroupV2SetBlkioDeviceWeight(virCgroupPtr group, +virCgroupV2SetBlkioDeviceWeight(virCgroup *group, const char *devPath, unsigned int weight) { @@ -891,7 +891,7 @@ virCgroupV2SetBlkioDeviceWeight(virCgroupPtr group, static int -virCgroupV2GetBlkioDeviceWeight(virCgroupPtr group, +virCgroupV2GetBlkioDeviceWeight(virCgroup *group, const char *devPath, unsigned int *weight) { @@ -931,7 +931,7 @@ virCgroupV2GetBlkioDeviceWeight(virCgroupPtr group, static int -virCgroupV2SetBlkioDeviceReadIops(virCgroupPtr group, +virCgroupV2SetBlkioDeviceReadIops(virCgroup *group, const char *path, unsigned int riops) { @@ -955,7 +955,7 @@ virCgroupV2SetBlkioDeviceReadIops(virCgroupPtr group, static int -virCgroupV2GetBlkioDeviceReadIops(virCgroupPtr group, +virCgroupV2GetBlkioDeviceReadIops(virCgroup *group, const char *path, unsigned int *riops) { @@ -1000,7 +1000,7 @@ virCgroupV2GetBlkioDeviceReadIops(virCgroupPtr group, static int -virCgroupV2SetBlkioDeviceWriteIops(virCgroupPtr group, +virCgroupV2SetBlkioDeviceWriteIops(virCgroup *group, const char *path, unsigned int wiops) { @@ -1024,7 +1024,7 @@ virCgroupV2SetBlkioDeviceWriteIops(virCgroupPtr group, static int -virCgroupV2GetBlkioDeviceWriteIops(virCgroupPtr group, +virCgroupV2GetBlkioDeviceWriteIops(virCgroup *group, const char *path, unsigned int *wiops) { @@ -1069,7 +1069,7 @@ virCgroupV2GetBlkioDeviceWriteIops(virCgroupPtr group, static int -virCgroupV2SetBlkioDeviceReadBps(virCgroupPtr group, +virCgroupV2SetBlkioDeviceReadBps(virCgroup *group, const char *path, unsigned long long rbps) { @@ -1093,7 +1093,7 @@ virCgroupV2SetBlkioDeviceReadBps(virCgroupPtr group, static int -virCgroupV2GetBlkioDeviceReadBps(virCgroupPtr group, +virCgroupV2GetBlkioDeviceReadBps(virCgroup *group, const char *path, unsigned long long *rbps) { @@ -1138,7 +1138,7 @@ virCgroupV2GetBlkioDeviceReadBps(virCgroupPtr group, static int -virCgroupV2SetBlkioDeviceWriteBps(virCgroupPtr group, +virCgroupV2SetBlkioDeviceWriteBps(virCgroup *group, const char *path, unsigned long long wbps) { @@ -1162,7 +1162,7 @@ virCgroupV2SetBlkioDeviceWriteBps(virCgroupPtr group, static int -virCgroupV2GetBlkioDeviceWriteBps(virCgroupPtr group, +virCgroupV2GetBlkioDeviceWriteBps(virCgroup *group, const char *path, unsigned long long *wbps) { @@ -1207,7 +1207,7 @@ virCgroupV2GetBlkioDeviceWriteBps(virCgroupPtr group, static int -virCgroupV2SetMemory(virCgroupPtr group, +virCgroupV2SetMemory(virCgroup *group, unsigned long long kb) { unsigned long long maxkb = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED; @@ -1234,7 +1234,7 @@ virCgroupV2SetMemory(virCgroupPtr group, static int -virCgroupV2GetMemoryStat(virCgroupPtr group, +virCgroupV2GetMemoryStat(virCgroup *group, unsigned long long *cache, unsigned long long *activeAnon, unsigned long long *inactiveAnon, @@ -1313,7 +1313,7 @@ virCgroupV2GetMemoryStat(virCgroupPtr group, static int -virCgroupV2GetMemoryUsage(virCgroupPtr group, +virCgroupV2GetMemoryUsage(virCgroup *group, unsigned long *kb) { unsigned long long usage_in_bytes; @@ -1327,7 +1327,7 @@ virCgroupV2GetMemoryUsage(virCgroupPtr group, static int -virCgroupV2SetMemoryHardLimit(virCgroupPtr group, +virCgroupV2SetMemoryHardLimit(virCgroup *group, unsigned long long kb) { return virCgroupV2SetMemory(group, kb); @@ -1335,7 +1335,7 @@ virCgroupV2SetMemoryHardLimit(virCgroupPtr group, static int -virCgroupV2GetMemoryHardLimit(virCgroupPtr group, +virCgroupV2GetMemoryHardLimit(virCgroup *group, unsigned long long *kb) { g_autofree char *value = NULL; @@ -1368,7 +1368,7 @@ virCgroupV2GetMemoryHardLimit(virCgroupPtr group, static int -virCgroupV2SetMemorySoftLimit(virCgroupPtr group, +virCgroupV2SetMemorySoftLimit(virCgroup *group, unsigned long long kb) { unsigned long long maxkb = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED; @@ -1395,7 +1395,7 @@ virCgroupV2SetMemorySoftLimit(virCgroupPtr group, static int -virCgroupV2GetMemorySoftLimit(virCgroupPtr group, +virCgroupV2GetMemorySoftLimit(virCgroup *group, unsigned long long *kb) { g_autofree char *value = NULL; @@ -1427,7 +1427,7 @@ virCgroupV2GetMemorySoftLimit(virCgroupPtr group, static int -virCgroupV2SetMemSwapHardLimit(virCgroupPtr group, +virCgroupV2SetMemSwapHardLimit(virCgroup *group, unsigned long long kb) { unsigned long long maxkb = VIR_DOMAIN_MEMORY_PARAM_UNLIMITED; @@ -1454,7 +1454,7 @@ virCgroupV2SetMemSwapHardLimit(virCgroupPtr group, static int -virCgroupV2GetMemSwapHardLimit(virCgroupPtr group, +virCgroupV2GetMemSwapHardLimit(virCgroup *group, unsigned long long *kb) { g_autofree char *value = NULL; @@ -1487,7 +1487,7 @@ virCgroupV2GetMemSwapHardLimit(virCgroupPtr group, static int -virCgroupV2GetMemSwapUsage(virCgroupPtr group, +virCgroupV2GetMemSwapUsage(virCgroup *group, unsigned long long *kb) { unsigned long long usage_in_bytes; @@ -1502,7 +1502,7 @@ virCgroupV2GetMemSwapUsage(virCgroupPtr group, static int -virCgroupV2SetCpuShares(virCgroupPtr group, +virCgroupV2SetCpuShares(virCgroup *group, unsigned long long shares) { if (shares < VIR_CGROUP_CPU_SHARES_MIN || @@ -1528,7 +1528,7 @@ virCgroupV2SetCpuShares(virCgroupPtr group, static int -virCgroupV2GetCpuShares(virCgroupPtr group, +virCgroupV2GetCpuShares(virCgroup *group, unsigned long long *shares) { return virCgroupGetValueU64(group, @@ -1538,7 +1538,7 @@ virCgroupV2GetCpuShares(virCgroupPtr group, static int -virCgroupV2SetCpuCfsPeriod(virCgroupPtr group, +virCgroupV2SetCpuCfsPeriod(virCgroup *group, unsigned long long cfs_period) { g_autofree char *value = NULL; @@ -1575,7 +1575,7 @@ virCgroupV2SetCpuCfsPeriod(virCgroupPtr group, static int -virCgroupV2GetCpuCfsPeriod(virCgroupPtr group, +virCgroupV2GetCpuCfsPeriod(virCgroup *group, unsigned long long *cfs_period) { g_autofree char *str = NULL; @@ -1603,7 +1603,7 @@ virCgroupV2GetCpuCfsPeriod(virCgroupPtr group, static int -virCgroupV2SetCpuCfsQuota(virCgroupPtr group, +virCgroupV2SetCpuCfsQuota(virCgroup *group, long long cfs_quota) { if (cfs_quota >= 0 && @@ -1630,7 +1630,7 @@ virCgroupV2SetCpuCfsQuota(virCgroupPtr group, static int -virCgroupV2GetCpuCfsQuota(virCgroupPtr group, +virCgroupV2GetCpuCfsQuota(virCgroup *group, long long *cfs_quota) { g_autofree char *str = NULL; @@ -1657,7 +1657,7 @@ virCgroupV2GetCpuCfsQuota(virCgroupPtr group, static bool -virCgroupV2SupportsCpuBW(virCgroupPtr cgroup) +virCgroupV2SupportsCpuBW(virCgroup *cgroup) { g_autofree char *path = NULL; @@ -1672,7 +1672,7 @@ virCgroupV2SupportsCpuBW(virCgroupPtr cgroup) static int -virCgroupV2GetCpuacctUsage(virCgroupPtr group, +virCgroupV2GetCpuacctUsage(virCgroup *group, unsigned long long *usage) { g_autofree char *str = NULL; @@ -1703,7 +1703,7 @@ virCgroupV2GetCpuacctUsage(virCgroupPtr group, static int -virCgroupV2GetCpuacctStat(virCgroupPtr group, +virCgroupV2GetCpuacctStat(virCgroup *group, unsigned long long *user, unsigned long long *sys) { @@ -1751,7 +1751,7 @@ virCgroupV2GetCpuacctStat(virCgroupPtr group, static int -virCgroupV2SetCpusetMems(virCgroupPtr group, +virCgroupV2SetCpusetMems(virCgroup *group, const char *mems) { return virCgroupSetValueStr(group, @@ -1762,7 +1762,7 @@ virCgroupV2SetCpusetMems(virCgroupPtr group, static int -virCgroupV2GetCpusetMems(virCgroupPtr group, +virCgroupV2GetCpusetMems(virCgroup *group, char **mems) { return virCgroupGetValueStr(group, @@ -1773,7 +1773,7 @@ virCgroupV2GetCpusetMems(virCgroupPtr group, static int -virCgroupV2SetCpusetMemoryMigrate(virCgroupPtr group G_GNUC_UNUSED, +virCgroupV2SetCpusetMemoryMigrate(virCgroup *group G_GNUC_UNUSED, bool migrate G_GNUC_UNUSED) { return 0; @@ -1781,7 +1781,7 @@ virCgroupV2SetCpusetMemoryMigrate(virCgroupPtr group G_GNUC_UNUSED, static int -virCgroupV2GetCpusetMemoryMigrate(virCgroupPtr group G_GNUC_UNUSED, +virCgroupV2GetCpusetMemoryMigrate(virCgroup *group G_GNUC_UNUSED, bool *migrate) { *migrate = true; @@ -1790,7 +1790,7 @@ virCgroupV2GetCpusetMemoryMigrate(virCgroupPtr group G_GNUC_UNUSED, static int -virCgroupV2SetCpusetCpus(virCgroupPtr group, +virCgroupV2SetCpusetCpus(virCgroup *group, const char *cpus) { return virCgroupSetValueStr(group, @@ -1801,7 +1801,7 @@ virCgroupV2SetCpusetCpus(virCgroupPtr group, static int -virCgroupV2GetCpusetCpus(virCgroupPtr group, +virCgroupV2GetCpusetCpus(virCgroup *group, char **cpus) { return virCgroupGetValueStr(group, @@ -1812,7 +1812,7 @@ virCgroupV2GetCpusetCpus(virCgroupPtr group, static int -virCgroupV2AllowDevice(virCgroupPtr group, +virCgroupV2AllowDevice(virCgroup *group, char type, int major, int minor, @@ -1841,7 +1841,7 @@ virCgroupV2AllowDevice(virCgroupPtr group, static int -virCgroupV2DenyDevice(virCgroupPtr group, +virCgroupV2DenyDevice(virCgroup *group, char type, int major, int minor, @@ -1882,7 +1882,7 @@ virCgroupV2DenyDevice(virCgroupPtr group, static int -virCgroupV2AllowAllDevices(virCgroupPtr group, +virCgroupV2AllowAllDevices(virCgroup *group, int perms) { if (virCgroupV2DevicesPrepareProg(group) < 0) @@ -1899,7 +1899,7 @@ virCgroupV2AllowAllDevices(virCgroupPtr group, static int -virCgroupV2DenyAllDevices(virCgroupPtr group) +virCgroupV2DenyAllDevices(virCgroup *group) { if (virCgroupV2DevicesDetectProg(group) < 0) return -1; diff --git a/src/util/vircgroupv2devices.c b/src/util/vircgroupv2devices.c index 4bcc1d52fe..2c6e083132 100644 --- a/src/util/vircgroupv2devices.c +++ b/src/util/vircgroupv2devices.c @@ -44,7 +44,7 @@ VIR_LOG_INIT("util.cgroup"); #if WITH_DECL_BPF_CGROUP_DEVICE bool -virCgroupV2DevicesAvailable(virCgroupPtr group) +virCgroupV2DevicesAvailable(virCgroup *group) { VIR_AUTOCLOSE cgroupfd = -1; unsigned int progCnt = 0; @@ -276,7 +276,7 @@ virCgroupV2DevicesLoadProg(int mapfd) static int -virCgroupV2DevicesAttachProg(virCgroupPtr group, +virCgroupV2DevicesAttachProg(virCgroup *group, int mapfd, size_t max) { @@ -353,7 +353,7 @@ virCgroupV2DevicesCountMapEntries(int mapfd) # define MAX_PROG_IDS 10 int -virCgroupV2DevicesDetectProg(virCgroupPtr group) +virCgroupV2DevicesDetectProg(virCgroup *group) { g_autofree char *path = NULL; VIR_AUTOCLOSE cgroupfd = -1; @@ -506,7 +506,7 @@ virCgroupV2DevicesReallocMap(int mapfd, int -virCgroupV2DevicesCreateProg(virCgroupPtr group) +virCgroupV2DevicesCreateProg(virCgroup *group) { int mapfd = -1; @@ -523,7 +523,7 @@ virCgroupV2DevicesCreateProg(virCgroupPtr group) int -virCgroupV2DevicesPrepareProg(virCgroupPtr group) +virCgroupV2DevicesPrepareProg(virCgroup *group) { if (virCgroupV2DevicesDetectProg(group) < 0) return -1; @@ -548,7 +548,7 @@ virCgroupV2DevicesPrepareProg(virCgroupPtr group) int -virCgroupV2DevicesRemoveProg(virCgroupPtr group) +virCgroupV2DevicesRemoveProg(virCgroup *group) { if (virCgroupV2DevicesDetectProg(group) < 0) return -1; @@ -592,14 +592,14 @@ virCgroupV2DevicesGetPerms(int perms, } #else /* !WITH_DECL_BPF_CGROUP_DEVICE */ bool -virCgroupV2DevicesAvailable(virCgroupPtr group G_GNUC_UNUSED) +virCgroupV2DevicesAvailable(virCgroup *group G_GNUC_UNUSED) { return false; } int -virCgroupV2DevicesDetectProg(virCgroupPtr group G_GNUC_UNUSED) +virCgroupV2DevicesDetectProg(virCgroup *group G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("cgroups v2 BPF devices not supported " @@ -609,7 +609,7 @@ virCgroupV2DevicesDetectProg(virCgroupPtr group G_GNUC_UNUSED) int -virCgroupV2DevicesCreateProg(virCgroupPtr group G_GNUC_UNUSED) +virCgroupV2DevicesCreateProg(virCgroup *group G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("cgroups v2 BPF devices not supported " @@ -619,7 +619,7 @@ virCgroupV2DevicesCreateProg(virCgroupPtr group G_GNUC_UNUSED) int -virCgroupV2DevicesPrepareProg(virCgroupPtr group G_GNUC_UNUSED) +virCgroupV2DevicesPrepareProg(virCgroup *group G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("cgroups v2 BPF devices not supported " @@ -629,7 +629,7 @@ virCgroupV2DevicesPrepareProg(virCgroupPtr group G_GNUC_UNUSED) int -virCgroupV2DevicesRemoveProg(virCgroupPtr group G_GNUC_UNUSED) +virCgroupV2DevicesRemoveProg(virCgroup *group G_GNUC_UNUSED) { return 0; } diff --git a/src/util/vircgroupv2devices.h b/src/util/vircgroupv2devices.h index 9d91256120..21f1d882f7 100644 --- a/src/util/vircgroupv2devices.h +++ b/src/util/vircgroupv2devices.h @@ -25,20 +25,20 @@ #include "vircgroup.h" bool -virCgroupV2DevicesAvailable(virCgroupPtr group) +virCgroupV2DevicesAvailable(virCgroup *group) G_GNUC_NO_INLINE; int -virCgroupV2DevicesDetectProg(virCgroupPtr group); +virCgroupV2DevicesDetectProg(virCgroup *group); int -virCgroupV2DevicesCreateProg(virCgroupPtr group); +virCgroupV2DevicesCreateProg(virCgroup *group); int -virCgroupV2DevicesPrepareProg(virCgroupPtr group); +virCgroupV2DevicesPrepareProg(virCgroup *group); int -virCgroupV2DevicesRemoveProg(virCgroupPtr group); +virCgroupV2DevicesRemoveProg(virCgroup *group); uint32_t virCgroupV2DevicesGetPerms(int perms, diff --git a/src/util/vircommand.c b/src/util/vircommand.c index 921bc28a03..8117190076 100644 --- a/src/util/vircommand.c +++ b/src/util/vircommand.c @@ -72,16 +72,12 @@ enum { }; typedef struct _virCommandFD virCommandFD; -typedef virCommandFD *virCommandFDPtr; - struct _virCommandFD { int fd; unsigned int flags; }; typedef struct _virCommandSendBuffer virCommandSendBuffer; -typedef virCommandSendBuffer *virCommandSendBufferPtr; - struct _virCommandSendBuffer { int fd; unsigned char *buffer; @@ -103,7 +99,7 @@ struct _virCommand { char *pwd; size_t npassfd; - virCommandFDPtr passfd; + virCommandFD *passfd; unsigned int flags; @@ -118,7 +114,7 @@ struct _virCommand { int *outfdptr; int *errfdptr; - virThreadPtr asyncioThread; + virThread *asyncioThread; bool handshake; int handshakeWait[2]; @@ -152,12 +148,12 @@ struct _virCommand { #endif int mask; - virCommandSendBufferPtr sendBuffers; + virCommandSendBuffer *sendBuffers; size_t numSendBuffers; }; /* See virCommandSetDryRun for description for this variable */ -static virBufferPtr dryRunBuffer; +static virBuffer *dryRunBuffer; static bool dryRunBufferArgLinebreaks; static bool dryRunBufferCommandStripPath; static virCommandDryRunCallback dryRunCallback; @@ -168,14 +164,14 @@ static int dryRunStatus; static bool -virCommandHasError(virCommandPtr cmd) +virCommandHasError(virCommand *cmd) { return !cmd || cmd->has_error != 0; } static int -virCommandRaiseError(virCommandPtr cmd) +virCommandRaiseError(virCommand *cmd) { if (!cmd || cmd->has_error != 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -198,7 +194,7 @@ virCommandRaiseError(virCommandPtr cmd) * false otherwise. */ static bool -virCommandFDIsSet(virCommandPtr cmd, +virCommandFDIsSet(virCommand *cmd, int fd) { size_t i = 0; @@ -223,7 +219,7 @@ virCommandFDIsSet(virCommandPtr cmd, * by FD_SETSIZE. */ static void -virCommandFDSet(virCommandPtr cmd, +virCommandFDSet(virCommand *cmd, int fd, unsigned int flags) { @@ -394,7 +390,7 @@ prepareStdFd(int fd, int std) * completed its pre-exec initialization. */ static int -virCommandHandshakeChild(virCommandPtr cmd) +virCommandHandshakeChild(virCommand *cmd) { char c = '1'; int rv; @@ -436,7 +432,7 @@ virCommandHandshakeChild(virCommandPtr cmd) } static int -virExecCommon(virCommandPtr cmd, gid_t *groups, int ngroups) +virExecCommon(virCommand *cmd, gid_t *groups, int ngroups) { if (cmd->uid != (uid_t)-1 || cmd->gid != (gid_t)-1 || cmd->capabilities || (cmd->flags & VIR_EXEC_CLEAR_CAPS)) { @@ -465,8 +461,8 @@ virExecCommon(virCommandPtr cmd, gid_t *groups, int ngroups) * onto child process (well, the one we will exec soon since this * is called from the child). */ static int -virCommandMassCloseGetFDsLinux(virCommandPtr cmd G_GNUC_UNUSED, - virBitmapPtr fds) +virCommandMassCloseGetFDsLinux(virCommand *cmd G_GNUC_UNUSED, + virBitmap *fds) { g_autoptr(DIR) dp = NULL; struct dirent *entry; @@ -498,8 +494,8 @@ virCommandMassCloseGetFDsLinux(virCommandPtr cmd G_GNUC_UNUSED, # else /* !__linux__ */ static int -virCommandMassCloseGetFDsGeneric(virCommandPtr cmd G_GNUC_UNUSED, - virBitmapPtr fds) +virCommandMassCloseGetFDsGeneric(virCommand *cmd G_GNUC_UNUSED, + virBitmap *fds) { virBitmapSetAll(fds); return 0; @@ -509,7 +505,7 @@ virCommandMassCloseGetFDsGeneric(virCommandPtr cmd G_GNUC_UNUSED, # ifdef __FreeBSD__ static int -virCommandMassClose(virCommandPtr cmd, +virCommandMassClose(virCommand *cmd, int childin, int childout, int childerr) @@ -561,7 +557,7 @@ virCommandMassClose(virCommandPtr cmd, # else /* ! __FreeBSD__ */ static int -virCommandMassClose(virCommandPtr cmd, +virCommandMassClose(virCommand *cmd, int childin, int childout, int childerr) @@ -613,11 +609,11 @@ virCommandMassClose(virCommandPtr cmd, /* * virExec: - * @cmd virCommandPtr containing all information about the program to + * @cmd virCommand * containing all information about the program to * exec. */ static int -virExec(virCommandPtr cmd) +virExec(virCommand *cmd) { pid_t pid; int null = -1; @@ -931,7 +927,7 @@ virFork(void) * it will be found via a PATH search of the parent's PATH (and not * any altered PATH set by virCommandAddEnv* commands). */ -virCommandPtr +virCommand * virCommandNew(const char *binary) { const char *const args[] = { binary, NULL }; @@ -947,10 +943,10 @@ virCommandNew(const char *binary) * set of args, taking binary from args[0]. More arguments can * be added later. @args[0] is handled like @binary of virCommandNew. */ -virCommandPtr +virCommand * virCommandNewArgs(const char *const*args) { - virCommandPtr cmd; + virCommand *cmd; cmd = g_new0(virCommand, 1); @@ -978,10 +974,10 @@ virCommandNewArgs(const char *const*args) * list of args, starting with the binary to run. More arguments can * be added later. @binary is handled as in virCommandNew. */ -virCommandPtr +virCommand * virCommandNewArgList(const char *binary, ...) { - virCommandPtr cmd; + virCommand *cmd; va_list list; va_start(list, binary); @@ -999,10 +995,10 @@ virCommandNewArgList(const char *binary, ...) * Create a new command with a NULL terminated * variable argument list. @binary is handled as in virCommandNew. */ -virCommandPtr +virCommand * virCommandNewVAList(const char *binary, va_list list) { - virCommandPtr cmd = virCommandNew(binary); + virCommand *cmd = virCommandNew(binary); const char *arg; if (virCommandHasError(cmd)) @@ -1035,7 +1031,7 @@ virCommandNewVAList(const char *binary, va_list list) * should cease using the @fd when this call completes */ void -virCommandPassFDIndex(virCommandPtr cmd, int fd, unsigned int flags, size_t *idx) +virCommandPassFDIndex(virCommand *cmd, int fd, unsigned int flags, size_t *idx) { if (!cmd) { VIR_COMMAND_MAYBE_CLOSE_FD(fd, flags); @@ -1071,7 +1067,7 @@ virCommandPassFDIndex(virCommandPtr cmd, int fd, unsigned int flags, size_t *idx * should cease using the @fd when this call completes */ void -virCommandPassFD(virCommandPtr cmd, int fd, unsigned int flags) +virCommandPassFD(virCommand *cmd, int fd, unsigned int flags) { virCommandPassFDIndex(cmd, fd, flags, NULL); } @@ -1087,7 +1083,7 @@ virCommandPassFD(virCommandPtr cmd, int fd, unsigned int flags) * -1 otherwise. */ int -virCommandPassFDGetFDIndex(virCommandPtr cmd, int fd) +virCommandPassFDGetFDIndex(virCommand *cmd, int fd) { size_t i = 0; @@ -1113,7 +1109,7 @@ virCommandPassFDGetFDIndex(virCommandPtr cmd, int fd) * pidfile. */ void -virCommandSetPidFile(virCommandPtr cmd, const char *pidfile) +virCommandSetPidFile(virCommand *cmd, const char *pidfile) { if (virCommandHasError(cmd)) return; @@ -1124,21 +1120,21 @@ virCommandSetPidFile(virCommandPtr cmd, const char *pidfile) gid_t -virCommandGetGID(virCommandPtr cmd) +virCommandGetGID(virCommand *cmd) { return cmd->gid; } uid_t -virCommandGetUID(virCommandPtr cmd) +virCommandGetUID(virCommand *cmd) { return cmd->uid; } void -virCommandSetGID(virCommandPtr cmd, gid_t gid) +virCommandSetGID(virCommand *cmd, gid_t gid) { if (virCommandHasError(cmd)) return; @@ -1147,7 +1143,7 @@ virCommandSetGID(virCommandPtr cmd, gid_t gid) } void -virCommandSetUID(virCommandPtr cmd, uid_t uid) +virCommandSetUID(virCommand *cmd, uid_t uid) { if (virCommandHasError(cmd)) return; @@ -1156,7 +1152,7 @@ virCommandSetUID(virCommandPtr cmd, uid_t uid) } void -virCommandSetMaxMemLock(virCommandPtr cmd, unsigned long long bytes) +virCommandSetMaxMemLock(virCommand *cmd, unsigned long long bytes) { if (virCommandHasError(cmd)) return; @@ -1166,7 +1162,7 @@ virCommandSetMaxMemLock(virCommandPtr cmd, unsigned long long bytes) } void -virCommandSetMaxProcesses(virCommandPtr cmd, unsigned int procs) +virCommandSetMaxProcesses(virCommand *cmd, unsigned int procs) { if (virCommandHasError(cmd)) return; @@ -1176,7 +1172,7 @@ virCommandSetMaxProcesses(virCommandPtr cmd, unsigned int procs) } void -virCommandSetMaxFiles(virCommandPtr cmd, unsigned int files) +virCommandSetMaxFiles(virCommand *cmd, unsigned int files) { if (virCommandHasError(cmd)) return; @@ -1185,7 +1181,7 @@ virCommandSetMaxFiles(virCommandPtr cmd, unsigned int files) cmd->setMaxFiles = true; } -void virCommandSetMaxCoreSize(virCommandPtr cmd, unsigned long long bytes) +void virCommandSetMaxCoreSize(virCommand *cmd, unsigned long long bytes) { if (virCommandHasError(cmd)) return; @@ -1194,7 +1190,7 @@ void virCommandSetMaxCoreSize(virCommandPtr cmd, unsigned long long bytes) cmd->setMaxCore = true; } -void virCommandSetUmask(virCommandPtr cmd, int mask) +void virCommandSetUmask(virCommand *cmd, int mask) { if (virCommandHasError(cmd)) return; @@ -1209,7 +1205,7 @@ void virCommandSetUmask(virCommandPtr cmd, int mask) * Remove all capabilities from the child, after any hooks have been run. */ void -virCommandClearCaps(virCommandPtr cmd) +virCommandClearCaps(virCommand *cmd) { if (virCommandHasError(cmd)) return; @@ -1225,7 +1221,7 @@ virCommandClearCaps(virCommandPtr cmd) * Allow specific capabilities */ void -virCommandAllowCap(virCommandPtr cmd, +virCommandAllowCap(virCommand *cmd, int capability) { if (virCommandHasError(cmd)) @@ -1246,7 +1242,7 @@ virCommandAllowCap(virCommandPtr cmd, * NULL, nothing will be done. */ void -virCommandSetSELinuxLabel(virCommandPtr cmd, +virCommandSetSELinuxLabel(virCommand *cmd, const char *label G_GNUC_UNUSED) { if (virCommandHasError(cmd)) @@ -1270,7 +1266,7 @@ virCommandSetSELinuxLabel(virCommandPtr cmd, * configured into libvirt, or if profile is NULL, nothing will be done. */ void -virCommandSetAppArmorProfile(virCommandPtr cmd, +virCommandSetAppArmorProfile(virCommand *cmd, const char *profile G_GNUC_UNUSED) { if (virCommandHasError(cmd)) @@ -1293,7 +1289,7 @@ virCommandSetAppArmorProfile(virCommandPtr cmd, * complete as soon as the daemon grandchild has started. */ void -virCommandDaemonize(virCommandPtr cmd) +virCommandDaemonize(virCommand *cmd) { if (virCommandHasError(cmd)) return; @@ -1309,7 +1305,7 @@ virCommandDaemonize(virCommandPtr cmd) * as non-blocking in the parent. */ void -virCommandNonblockingFDs(virCommandPtr cmd) +virCommandNonblockingFDs(virCommand *cmd) { if (virCommandHasError(cmd)) return; @@ -1328,7 +1324,7 @@ virCommandNonblockingFDs(virCommandPtr cmd) * signals returns -1). */ void -virCommandRawStatus(virCommandPtr cmd) +virCommandRawStatus(virCommand *cmd) { if (virCommandHasError(cmd)) return; @@ -1341,7 +1337,7 @@ virCommandRawStatus(virCommandPtr cmd) * already set, then it is replaced in the list. */ static void -virCommandAddEnv(virCommandPtr cmd, +virCommandAddEnv(virCommand *cmd, char *envstr) { g_autofree char *env = envstr; @@ -1374,7 +1370,7 @@ virCommandAddEnv(virCommandPtr cmd, * Add an environment variable to the child created by a printf-style format. */ void -virCommandAddEnvFormat(virCommandPtr cmd, const char *format, ...) +virCommandAddEnvFormat(virCommand *cmd, const char *format, ...) { char *env; va_list list; @@ -1399,7 +1395,7 @@ virCommandAddEnvFormat(virCommandPtr cmd, const char *format, ...) * using separate name & value strings */ void -virCommandAddEnvPair(virCommandPtr cmd, const char *name, const char *value) +virCommandAddEnvPair(virCommand *cmd, const char *name, const char *value) { virCommandAddEnvFormat(cmd, "%s=%s", name, value); } @@ -1414,7 +1410,7 @@ virCommandAddEnvPair(virCommandPtr cmd, const char *name, const char *value) * using a preformatted env string FOO=BAR */ void -virCommandAddEnvString(virCommandPtr cmd, const char *str) +virCommandAddEnvString(virCommand *cmd, const char *str) { char *env; @@ -1436,7 +1432,7 @@ virCommandAddEnvString(virCommandPtr cmd, const char *str) * using current process's value */ void -virCommandAddEnvPass(virCommandPtr cmd, const char *name) +virCommandAddEnvPass(virCommand *cmd, const char *name) { const char *value; if (virCommandHasError(cmd)) @@ -1456,7 +1452,7 @@ virCommandAddEnvPass(virCommandPtr cmd, const char *name) * variables (such as PATH) from the parent process. */ void -virCommandAddEnvPassCommon(virCommandPtr cmd) +virCommandAddEnvPassCommon(virCommand *cmd) { if (virCommandHasError(cmd)) return; @@ -1476,7 +1472,7 @@ virCommandAddEnvPassCommon(virCommandPtr cmd) void -virCommandAddEnvXDG(virCommandPtr cmd, const char *baseDir) +virCommandAddEnvXDG(virCommand *cmd, const char *baseDir) { if (virCommandHasError(cmd)) return; @@ -1500,7 +1496,7 @@ virCommandAddEnvXDG(virCommandPtr cmd, const char *baseDir) * Add a command line argument to the child */ void -virCommandAddArg(virCommandPtr cmd, const char *val) +virCommandAddArg(virCommand *cmd, const char *val) { if (virCommandHasError(cmd)) return; @@ -1526,7 +1522,7 @@ virCommandAddArg(virCommandPtr cmd, const char *val) * Correctly transfers memory errors or contents from buf to cmd. */ void -virCommandAddArgBuffer(virCommandPtr cmd, virBufferPtr buf) +virCommandAddArgBuffer(virCommand *cmd, virBuffer *buf) { g_autofree char *str = virBufferContentAndReset(buf); @@ -1553,7 +1549,7 @@ virCommandAddArgBuffer(virCommandPtr cmd, virBufferPtr buf) * Add a command line argument created by a printf-style format. */ void -virCommandAddArgFormat(virCommandPtr cmd, const char *format, ...) +virCommandAddArgFormat(virCommand *cmd, const char *format, ...) { char *arg; va_list list; @@ -1580,7 +1576,7 @@ virCommandAddArgFormat(virCommandPtr cmd, const char *format, ...) * Add "NAME=VAL" as a single command line argument to the child */ void -virCommandAddArgPair(virCommandPtr cmd, const char *name, const char *val) +virCommandAddArgPair(virCommand *cmd, const char *name, const char *val) { if (name == NULL || val == NULL) { cmd->has_error = EINVAL; @@ -1597,7 +1593,7 @@ virCommandAddArgPair(virCommandPtr cmd, const char *name, const char *val) * Add a NULL terminated list of args */ void -virCommandAddArgSet(virCommandPtr cmd, const char *const*vals) +virCommandAddArgSet(virCommand *cmd, const char *const*vals) { int narg = 0; @@ -1632,7 +1628,7 @@ virCommandAddArgSet(virCommandPtr cmd, const char *const*vals) * Add a NULL terminated list of args. */ void -virCommandAddArgList(virCommandPtr cmd, ...) +virCommandAddArgList(virCommand *cmd, ...) { va_list list; int narg = 0; @@ -1669,7 +1665,7 @@ virCommandAddArgList(virCommandPtr cmd, ...) * without using this call. */ void -virCommandSetWorkingDirectory(virCommandPtr cmd, const char *pwd) +virCommandSetWorkingDirectory(virCommand *cmd, const char *pwd) { if (virCommandHasError(cmd)) return; @@ -1684,14 +1680,14 @@ virCommandSetWorkingDirectory(virCommandPtr cmd, const char *pwd) static int -virCommandGetNumSendBuffers(virCommandPtr cmd) +virCommandGetNumSendBuffers(virCommand *cmd) { return cmd->numSendBuffers; } static void -virCommandFreeSendBuffers(virCommandPtr cmd) +virCommandFreeSendBuffers(virCommand *cmd) { size_t i; @@ -1720,7 +1716,7 @@ virCommandFreeSendBuffers(virCommandPtr cmd) * Thus callers don't need to take a special action if -1 is returned. */ int -virCommandSetSendBuffer(virCommandPtr cmd, +virCommandSetSendBuffer(virCommand *cmd, unsigned char *buffer, size_t buflen) { @@ -1760,7 +1756,7 @@ virCommandSetSendBuffer(virCommandPtr cmd, static int -virCommandSendBuffersFillPollfd(virCommandPtr cmd, +virCommandSendBuffersFillPollfd(virCommand *cmd, struct pollfd *fds, int startidx) { @@ -1780,7 +1776,7 @@ virCommandSendBuffersFillPollfd(virCommandPtr cmd, static int -virCommandSendBuffersHandlePoll(virCommandPtr cmd, +virCommandSendBuffersHandlePoll(virCommand *cmd, struct pollfd *fds) { size_t i; @@ -1827,7 +1823,7 @@ virCommandSendBuffersHandlePoll(virCommandPtr cmd, * virCommandRunAsync. The buffer is forgotten after each @cmd run. */ void -virCommandSetInputBuffer(virCommandPtr cmd, const char *inbuf) +virCommandSetInputBuffer(virCommand *cmd, const char *inbuf) { if (virCommandHasError(cmd)) return; @@ -1856,7 +1852,7 @@ virCommandSetInputBuffer(virCommandPtr cmd, const char *inbuf) * buffer is forgotten after each @cmd run. */ void -virCommandSetOutputBuffer(virCommandPtr cmd, char **outbuf) +virCommandSetOutputBuffer(virCommand *cmd, char **outbuf) { *outbuf = NULL; if (virCommandHasError(cmd)) @@ -1890,7 +1886,7 @@ virCommandSetOutputBuffer(virCommandPtr cmd, char **outbuf) * forgotten after each @cmd run. */ void -virCommandSetErrorBuffer(virCommandPtr cmd, char **errbuf) +virCommandSetErrorBuffer(virCommand *cmd, char **errbuf) { *errbuf = NULL; if (virCommandHasError(cmd)) @@ -1915,7 +1911,7 @@ virCommandSetErrorBuffer(virCommandPtr cmd, char **errbuf) * Attach a file descriptor to the child's stdin */ void -virCommandSetInputFD(virCommandPtr cmd, int infd) +virCommandSetInputFD(virCommand *cmd, int infd) { if (virCommandHasError(cmd)) return; @@ -1945,7 +1941,7 @@ virCommandSetInputFD(virCommandPtr cmd, int infd) * the child is run. Otherwise, *@outfd is used as the output. */ void -virCommandSetOutputFD(virCommandPtr cmd, int *outfd) +virCommandSetOutputFD(virCommand *cmd, int *outfd) { if (virCommandHasError(cmd)) return; @@ -1971,7 +1967,7 @@ virCommandSetOutputFD(virCommandPtr cmd, int *outfd) * and may be the same as outfd given to virCommandSetOutputFD(). */ void -virCommandSetErrorFD(virCommandPtr cmd, int *errfd) +virCommandSetErrorFD(virCommand *cmd, int *errfd) { if (virCommandHasError(cmd)) return; @@ -2000,7 +1996,7 @@ virCommandSetErrorFD(virCommandPtr cmd, int *errfd) * any functions that are not async-signal-safe. */ void -virCommandSetPreExecHook(virCommandPtr cmd, virExecHook hook, void *opaque) +virCommandSetPreExecHook(virCommand *cmd, virExecHook hook, void *opaque) { if (virCommandHasError(cmd)) return; @@ -2026,7 +2022,7 @@ virCommandSetPreExecHook(virCommandPtr cmd, virExecHook hook, void *opaque) * out-of-memory condition while building cmd), nothing will be logged. */ void -virCommandWriteArgLog(virCommandPtr cmd, int logfd) +virCommandWriteArgLog(virCommand *cmd, int logfd) { int ioError = 0; size_t i; @@ -2070,7 +2066,7 @@ virCommandWriteArgLog(virCommandPtr cmd, int logfd) * Caller is responsible for freeing the resulting string. */ char * -virCommandToStringFull(virCommandPtr cmd, +virCommandToStringFull(virCommand *cmd, bool linebreaks, bool stripCommandPath) { @@ -2145,7 +2141,7 @@ virCommandToStringFull(virCommandPtr cmd, char * -virCommandToString(virCommandPtr cmd, +virCommandToString(virCommand *cmd, bool linebreaks) { return virCommandToStringFull(cmd, linebreaks, false); @@ -2153,7 +2149,7 @@ virCommandToString(virCommandPtr cmd, int -virCommandGetArgList(virCommandPtr cmd, +virCommandGetArgList(virCommand *cmd, char ***args, size_t *nargs) { @@ -2179,7 +2175,7 @@ virCommandGetArgList(virCommandPtr cmd, * Manage input and output to the child process. */ static int -virCommandProcessIO(virCommandPtr cmd) +virCommandProcessIO(virCommand *cmd) { int outfd = -1, errfd = -1; size_t inlen = 0, outlen = 0, errlen = 0; @@ -2342,7 +2338,7 @@ virCommandProcessIO(virCommandPtr cmd) * Returns -1 on any error executing the command. * Will not return on success. */ -int virCommandExec(virCommandPtr cmd, gid_t *groups, int ngroups) +int virCommandExec(virCommand *cmd, gid_t *groups, int ngroups) { if (virCommandHasError(cmd)) { virCommandRaiseError(cmd); @@ -2377,7 +2373,7 @@ int virCommandExec(virCommandPtr cmd, gid_t *groups, int ngroups) * status that the caller must then decipher using WIFEXITED() and friends. */ int -virCommandRun(virCommandPtr cmd, int *exitstatus) +virCommandRun(virCommand *cmd, int *exitstatus) { int ret = 0; char *outbuf = NULL; @@ -2497,7 +2493,7 @@ virCommandRun(virCommandPtr cmd, int *exitstatus) static void virCommandDoAsyncIOHelper(void *opaque) { - virCommandPtr cmd = opaque; + virCommand *cmd = opaque; if (virCommandProcessIO(cmd) < 0) { /* If something went wrong, save errno or -1 */ cmd->has_error = errno ? errno : -1; @@ -2526,7 +2522,7 @@ virCommandDoAsyncIOHelper(void *opaque) * you call virProcessWait or virProcessAbort. */ int -virCommandRunAsync(virCommandPtr cmd, pid_t *pid) +virCommandRunAsync(virCommand *cmd, pid_t *pid) { int ret = -1; g_autofree char *str = NULL; @@ -2678,7 +2674,7 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid) * status that the caller must then decipher using WIFEXITED() and friends. */ int -virCommandWait(virCommandPtr cmd, int *exitstatus) +virCommandWait(virCommand *cmd, int *exitstatus) { int ret; int status = 0; @@ -2758,7 +2754,7 @@ virCommandWait(virCommandPtr cmd, int *exitstatus) * have started the child process. */ void -virCommandAbort(virCommandPtr cmd) +virCommandAbort(virCommand *cmd) { if (!cmd || cmd->pid == -1) return; @@ -2777,7 +2773,7 @@ virCommandAbort(virCommandPtr cmd) * execution. The child will not exec() until the * parent has notified */ -void virCommandRequireHandshake(virCommandPtr cmd) +void virCommandRequireHandshake(virCommand *cmd) { if (virCommandHasError(cmd)) return; @@ -2817,7 +2813,7 @@ void virCommandRequireHandshake(virCommandPtr cmd) * Wait for the child to complete execution of its * hook function. To be called in the parent. */ -int virCommandHandshakeWait(virCommandPtr cmd) +int virCommandHandshakeWait(virCommand *cmd) { char c; int rv; @@ -2881,7 +2877,7 @@ int virCommandHandshakeWait(virCommandPtr cmd) * Notify the child that it is OK to exec() the * real binary now. To be called in the parent. */ -int virCommandHandshakeNotify(virCommandPtr cmd) +int virCommandHandshakeNotify(virCommand *cmd) { char c = '1'; @@ -2913,7 +2909,7 @@ int virCommandHandshakeNotify(virCommandPtr cmd) } #else /* WIN32 */ int -virCommandSetSendBuffer(virCommandPtr cmd, +virCommandSetSendBuffer(virCommand *cmd, unsigned char *buffer G_GNUC_UNUSED, size_t buflen G_GNUC_UNUSED) { @@ -2927,7 +2923,7 @@ virCommandSetSendBuffer(virCommandPtr cmd, int -virCommandExec(virCommandPtr cmd G_GNUC_UNUSED, gid_t *groups G_GNUC_UNUSED, +virCommandExec(virCommand *cmd G_GNUC_UNUSED, gid_t *groups G_GNUC_UNUSED, int ngroups G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -2937,7 +2933,7 @@ virCommandExec(virCommandPtr cmd G_GNUC_UNUSED, gid_t *groups G_GNUC_UNUSED, int -virCommandRun(virCommandPtr cmd G_GNUC_UNUSED, int *exitstatus G_GNUC_UNUSED) +virCommandRun(virCommand *cmd G_GNUC_UNUSED, int *exitstatus G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("Executing new processes is not supported on Win32 platform")); @@ -2946,7 +2942,7 @@ virCommandRun(virCommandPtr cmd G_GNUC_UNUSED, int *exitstatus G_GNUC_UNUSED) int -virCommandRunAsync(virCommandPtr cmd G_GNUC_UNUSED, pid_t *pid G_GNUC_UNUSED) +virCommandRunAsync(virCommand *cmd G_GNUC_UNUSED, pid_t *pid G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("Executing new processes is not supported on Win32 platform")); @@ -2955,7 +2951,7 @@ virCommandRunAsync(virCommandPtr cmd G_GNUC_UNUSED, pid_t *pid G_GNUC_UNUSED) int -virCommandWait(virCommandPtr cmd G_GNUC_UNUSED, int *exitstatus G_GNUC_UNUSED) +virCommandWait(virCommand *cmd G_GNUC_UNUSED, int *exitstatus G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("Executing new processes is not supported on Win32 platform")); @@ -2964,7 +2960,7 @@ virCommandWait(virCommandPtr cmd G_GNUC_UNUSED, int *exitstatus G_GNUC_UNUSED) void -virCommandAbort(virCommandPtr cmd G_GNUC_UNUSED) +virCommandAbort(virCommand *cmd G_GNUC_UNUSED) { /* Mingw lacks WNOHANG and kill(). But since we haven't ported * virExec to mingw yet, there's no process to be killed, @@ -2972,7 +2968,7 @@ virCommandAbort(virCommandPtr cmd G_GNUC_UNUSED) } -void virCommandRequireHandshake(virCommandPtr cmd) +void virCommandRequireHandshake(virCommand *cmd) { if (virCommandHasError(cmd)) return; @@ -2981,7 +2977,7 @@ void virCommandRequireHandshake(virCommandPtr cmd) } -int virCommandHandshakeWait(virCommandPtr cmd G_GNUC_UNUSED) +int virCommandHandshakeWait(virCommand *cmd G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("Executing new processes is not supported on Win32 platform")); @@ -2989,7 +2985,7 @@ int virCommandHandshakeWait(virCommandPtr cmd G_GNUC_UNUSED) } -int virCommandHandshakeNotify(virCommandPtr cmd G_GNUC_UNUSED) +int virCommandHandshakeNotify(virCommand *cmd G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("Executing new processes is not supported on Win32 platform")); @@ -3007,7 +3003,7 @@ int virCommandHandshakeNotify(virCommandPtr cmd G_GNUC_UNUSED) * is not reaped, and you must call virProcessWait() or virProcessAbort() yourself. */ void -virCommandFree(virCommandPtr cmd) +virCommandFree(virCommand *cmd) { size_t i; if (!cmd) @@ -3099,7 +3095,7 @@ virCommandFree(virCommandPtr cmd) * buffer setting functions (virCommandSet.*Buffer) prior each run. */ void -virCommandDoAsyncIO(virCommandPtr cmd) +virCommandDoAsyncIO(virCommand *cmd) { if (virCommandHasError(cmd)) return; @@ -3171,7 +3167,7 @@ virCommandDryRunTokenFree(virCommandDryRunToken *tok) * virBuffer buffer = VIR_BUFFER_INITIALIZER; * virCommandSetDryRun(&buffer); * - * virCommandPtr echocmd = virCommandNewArgList("/bin/echo", "Hello world", NULL); + * virCommand *echocmd = virCommandNewArgList("/bin/echo", "Hello world", NULL); * virCommandRun(echocmd, NULL); * * After this, the @buffer should contain: @@ -3182,7 +3178,7 @@ virCommandDryRunTokenFree(virCommandDryRunToken *tok) */ void virCommandSetDryRun(virCommandDryRunToken *tok, - virBufferPtr buf, + virBuffer *buf, bool bufArgLinebreaks, bool bufCommandStripPath, virCommandDryRunCallback cb, @@ -3221,7 +3217,7 @@ virCommandSetDryRun(virCommandDryRunToken *tok, * error or callback function error */ int -virCommandRunRegex(virCommandPtr cmd, +virCommandRunRegex(virCommand *cmd, int nregex, const char **regex, int *nvars, @@ -3328,7 +3324,7 @@ virCommandRunRegex(virCommandPtr cmd, * If there are no input tokens (empty input), call FUNC with N_COLUMNS == 0. */ int -virCommandRunNul(virCommandPtr cmd, +virCommandRunNul(virCommand *cmd, size_t n_columns, virCommandRunNulFunc func, void *data) @@ -3402,7 +3398,7 @@ virCommandRunNul(virCommandPtr cmd, #else /* WIN32 */ int -virCommandRunRegex(virCommandPtr cmd G_GNUC_UNUSED, +virCommandRunRegex(virCommand *cmd G_GNUC_UNUSED, int nregex G_GNUC_UNUSED, const char **regex G_GNUC_UNUSED, int *nvars G_GNUC_UNUSED, @@ -3417,7 +3413,7 @@ virCommandRunRegex(virCommandPtr cmd G_GNUC_UNUSED, } int -virCommandRunNul(virCommandPtr cmd G_GNUC_UNUSED, +virCommandRunNul(virCommand *cmd G_GNUC_UNUSED, size_t n_columns G_GNUC_UNUSED, virCommandRunNulFunc func G_GNUC_UNUSED, void *data G_GNUC_UNUSED) diff --git a/src/util/vircommand.h b/src/util/vircommand.h index 5a700f8e15..77cf8c8ec9 100644 --- a/src/util/vircommand.h +++ b/src/util/vircommand.h @@ -25,7 +25,6 @@ #include "virbuffer.h" typedef struct _virCommand virCommand; -typedef virCommand *virCommandPtr; /* This will execute in the context of the first child * after fork() but before execve(). As such, it is unsafe to @@ -34,14 +33,14 @@ typedef int (*virExecHook)(void *data); pid_t virFork(void) G_GNUC_WARN_UNUSED_RESULT; -virCommandPtr virCommandNew(const char *binary) ATTRIBUTE_NONNULL(1); +virCommand *virCommandNew(const char *binary) ATTRIBUTE_NONNULL(1); -virCommandPtr virCommandNewArgs(const char *const*args) ATTRIBUTE_NONNULL(1); +virCommand *virCommandNewArgs(const char *const*args) ATTRIBUTE_NONNULL(1); -virCommandPtr virCommandNewArgList(const char *binary, ...) +virCommand *virCommandNewArgList(const char *binary, ...) ATTRIBUTE_NONNULL(1) G_GNUC_NULL_TERMINATED; -virCommandPtr virCommandNewVAList(const char *binary, va_list list) +virCommand *virCommandNewVAList(const char *binary, va_list list) ATTRIBUTE_NONNULL(1); /* All error report from these setup APIs is @@ -53,154 +52,154 @@ typedef enum { VIR_COMMAND_PASS_FD_CLOSE_PARENT = (1 << 0), } virCommandPassFDFlags; -void virCommandPassFD(virCommandPtr cmd, +void virCommandPassFD(virCommand *cmd, int fd, unsigned int flags) G_GNUC_NO_INLINE; -void virCommandPassFDIndex(virCommandPtr cmd, +void virCommandPassFDIndex(virCommand *cmd, int fd, unsigned int flags, size_t *idx) G_GNUC_NO_INLINE; -int virCommandPassFDGetFDIndex(virCommandPtr cmd, +int virCommandPassFDGetFDIndex(virCommand *cmd, int fd); -void virCommandSetPidFile(virCommandPtr cmd, +void virCommandSetPidFile(virCommand *cmd, const char *pidfile) ATTRIBUTE_NONNULL(2); -gid_t virCommandGetGID(virCommandPtr cmd) ATTRIBUTE_NONNULL(1); +gid_t virCommandGetGID(virCommand *cmd) ATTRIBUTE_NONNULL(1); -uid_t virCommandGetUID(virCommandPtr cmd) ATTRIBUTE_NONNULL(1); +uid_t virCommandGetUID(virCommand *cmd) ATTRIBUTE_NONNULL(1); -void virCommandSetGID(virCommandPtr cmd, gid_t gid); +void virCommandSetGID(virCommand *cmd, gid_t gid); -void virCommandSetUID(virCommandPtr cmd, uid_t uid); +void virCommandSetUID(virCommand *cmd, uid_t uid); -void virCommandSetMaxMemLock(virCommandPtr cmd, unsigned long long bytes); -void virCommandSetMaxProcesses(virCommandPtr cmd, unsigned int procs); -void virCommandSetMaxFiles(virCommandPtr cmd, unsigned int files); -void virCommandSetMaxCoreSize(virCommandPtr cmd, unsigned long long bytes); -void virCommandSetUmask(virCommandPtr cmd, int umask); +void virCommandSetMaxMemLock(virCommand *cmd, unsigned long long bytes); +void virCommandSetMaxProcesses(virCommand *cmd, unsigned int procs); +void virCommandSetMaxFiles(virCommand *cmd, unsigned int files); +void virCommandSetMaxCoreSize(virCommand *cmd, unsigned long long bytes); +void virCommandSetUmask(virCommand *cmd, int umask); -void virCommandClearCaps(virCommandPtr cmd); +void virCommandClearCaps(virCommand *cmd); -void virCommandAllowCap(virCommandPtr cmd, +void virCommandAllowCap(virCommand *cmd, int capability); -void virCommandSetSELinuxLabel(virCommandPtr cmd, +void virCommandSetSELinuxLabel(virCommand *cmd, const char *label); -void virCommandSetAppArmorProfile(virCommandPtr cmd, +void virCommandSetAppArmorProfile(virCommand *cmd, const char *profile); -void virCommandDaemonize(virCommandPtr cmd); +void virCommandDaemonize(virCommand *cmd); -void virCommandNonblockingFDs(virCommandPtr cmd); +void virCommandNonblockingFDs(virCommand *cmd); -void virCommandRawStatus(virCommandPtr cmd); +void virCommandRawStatus(virCommand *cmd); -void virCommandAddEnvFormat(virCommandPtr cmd, const char *format, ...) +void virCommandAddEnvFormat(virCommand *cmd, const char *format, ...) ATTRIBUTE_NONNULL(2) G_GNUC_PRINTF(2, 3); -void virCommandAddEnvPair(virCommandPtr cmd, +void virCommandAddEnvPair(virCommand *cmd, const char *name, const char *value) ATTRIBUTE_NONNULL(2); -void virCommandAddEnvString(virCommandPtr cmd, +void virCommandAddEnvString(virCommand *cmd, const char *str) ATTRIBUTE_NONNULL(2); -void virCommandAddEnvPass(virCommandPtr cmd, +void virCommandAddEnvPass(virCommand *cmd, const char *name) ATTRIBUTE_NONNULL(2); -void virCommandAddEnvPassCommon(virCommandPtr cmd); +void virCommandAddEnvPassCommon(virCommand *cmd); -void virCommandAddEnvXDG(virCommandPtr cmd, const char *baseDir); +void virCommandAddEnvXDG(virCommand *cmd, const char *baseDir); -void virCommandAddArg(virCommandPtr cmd, +void virCommandAddArg(virCommand *cmd, const char *val) ATTRIBUTE_NONNULL(2); -void virCommandAddArgBuffer(virCommandPtr cmd, - virBufferPtr buf); +void virCommandAddArgBuffer(virCommand *cmd, + virBuffer *buf); -void virCommandAddArgFormat(virCommandPtr cmd, +void virCommandAddArgFormat(virCommand *cmd, const char *format, ...) ATTRIBUTE_NONNULL(2) G_GNUC_PRINTF(2, 3); -void virCommandAddArgPair(virCommandPtr cmd, +void virCommandAddArgPair(virCommand *cmd, const char *name, const char *val); -void virCommandAddArgSet(virCommandPtr cmd, +void virCommandAddArgSet(virCommand *cmd, const char *const*vals) ATTRIBUTE_NONNULL(2); -void virCommandAddArgList(virCommandPtr cmd, +void virCommandAddArgList(virCommand *cmd, ... /* const char *arg, ..., NULL */) G_GNUC_NULL_TERMINATED; -void virCommandSetWorkingDirectory(virCommandPtr cmd, +void virCommandSetWorkingDirectory(virCommand *cmd, const char *pwd) ATTRIBUTE_NONNULL(2); -int virCommandSetSendBuffer(virCommandPtr cmd, +int virCommandSetSendBuffer(virCommand *cmd, unsigned char *buffer, size_t buflen) ATTRIBUTE_NONNULL(2); -void virCommandSetInputBuffer(virCommandPtr cmd, +void virCommandSetInputBuffer(virCommand *cmd, const char *inbuf) ATTRIBUTE_NONNULL(2); -void virCommandSetOutputBuffer(virCommandPtr cmd, +void virCommandSetOutputBuffer(virCommand *cmd, char **outbuf) ATTRIBUTE_NONNULL(2); -void virCommandSetErrorBuffer(virCommandPtr cmd, +void virCommandSetErrorBuffer(virCommand *cmd, char **errbuf) ATTRIBUTE_NONNULL(2); -void virCommandSetInputFD(virCommandPtr cmd, +void virCommandSetInputFD(virCommand *cmd, int infd); -void virCommandSetOutputFD(virCommandPtr cmd, +void virCommandSetOutputFD(virCommand *cmd, int *outfd) ATTRIBUTE_NONNULL(2); -void virCommandSetErrorFD(virCommandPtr cmd, +void virCommandSetErrorFD(virCommand *cmd, int *errfd) ATTRIBUTE_NONNULL(2); -void virCommandSetPreExecHook(virCommandPtr cmd, +void virCommandSetPreExecHook(virCommand *cmd, virExecHook hook, void *opaque) ATTRIBUTE_NONNULL(2); -void virCommandWriteArgLog(virCommandPtr cmd, +void virCommandWriteArgLog(virCommand *cmd, int logfd); -char *virCommandToString(virCommandPtr cmd, bool linebreaks) G_GNUC_WARN_UNUSED_RESULT; -char *virCommandToStringFull(virCommandPtr cmd, +char *virCommandToString(virCommand *cmd, bool linebreaks) G_GNUC_WARN_UNUSED_RESULT; +char *virCommandToStringFull(virCommand *cmd, bool linebreaks, bool stripCommandPath); -int virCommandGetArgList(virCommandPtr cmd, char ***args, size_t *nargs); +int virCommandGetArgList(virCommand *cmd, char ***args, size_t *nargs); -int virCommandExec(virCommandPtr cmd, gid_t *groups, int ngroups) G_GNUC_WARN_UNUSED_RESULT; +int virCommandExec(virCommand *cmd, gid_t *groups, int ngroups) G_GNUC_WARN_UNUSED_RESULT; -int virCommandRun(virCommandPtr cmd, +int virCommandRun(virCommand *cmd, int *exitstatus) G_GNUC_WARN_UNUSED_RESULT; -int virCommandRunAsync(virCommandPtr cmd, +int virCommandRunAsync(virCommand *cmd, pid_t *pid) G_GNUC_WARN_UNUSED_RESULT; -int virCommandWait(virCommandPtr cmd, +int virCommandWait(virCommand *cmd, int *exitstatus) G_GNUC_WARN_UNUSED_RESULT; -void virCommandRequireHandshake(virCommandPtr cmd); +void virCommandRequireHandshake(virCommand *cmd); -int virCommandHandshakeWait(virCommandPtr cmd) +int virCommandHandshakeWait(virCommand *cmd) G_GNUC_WARN_UNUSED_RESULT; -int virCommandHandshakeNotify(virCommandPtr cmd) +int virCommandHandshakeNotify(virCommand *cmd) G_GNUC_WARN_UNUSED_RESULT; -void virCommandAbort(virCommandPtr cmd); +void virCommandAbort(virCommand *cmd); -void virCommandFree(virCommandPtr cmd); +void virCommandFree(virCommand *cmd); -void virCommandDoAsyncIO(virCommandPtr cmd); +void virCommandDoAsyncIO(virCommand *cmd); typedef int (*virCommandRunRegexFunc)(char **const groups, void *data); @@ -208,7 +207,7 @@ typedef int (*virCommandRunNulFunc)(size_t n_tokens, char **const groups, void *data); -int virCommandRunRegex(virCommandPtr cmd, +int virCommandRunRegex(virCommand *cmd, int nregex, const char **regex, int *nvars, @@ -217,7 +216,7 @@ int virCommandRunRegex(virCommandPtr cmd, const char *cmd_to_ignore, int *exitstatus); -int virCommandRunNul(virCommandPtr cmd, +int virCommandRunNul(virCommand *cmd, size_t n_columns, virCommandRunNulFunc func, void *data); diff --git a/src/util/vircommandpriv.h b/src/util/vircommandpriv.h index 6e01585766..ff17fa5ded 100644 --- a/src/util/vircommandpriv.h +++ b/src/util/vircommandpriv.h @@ -42,7 +42,7 @@ void virCommandDryRunTokenFree(virCommandDryRunToken *token); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virCommandDryRunToken, virCommandDryRunTokenFree); void virCommandSetDryRun(virCommandDryRunToken *tok, - virBufferPtr buf, + virBuffer *buf, bool bufArgLinebreaks, bool bufCommandStripPath, virCommandDryRunCallback cb, diff --git a/src/util/virconf.c b/src/util/virconf.c index 572fe31049..15a65ec394 100644 --- a/src/util/virconf.c +++ b/src/util/virconf.c @@ -40,8 +40,6 @@ VIR_LOG_INIT("util.conf"); typedef struct _virConfParserCtxt virConfParserCtxt; -typedef virConfParserCtxt *virConfParserCtxtPtr; - struct _virConfParserCtxt { const char* filename; const char* base; @@ -49,7 +47,7 @@ struct _virConfParserCtxt { const char *end; int line; - virConfPtr conf; + virConf *conf; }; #define CUR (*ctxt->cur) @@ -75,19 +73,17 @@ VIR_ENUM_IMPL(virConf, ); typedef struct _virConfEntry virConfEntry; -typedef virConfEntry *virConfEntryPtr; - struct _virConfEntry { - virConfEntryPtr next; + virConfEntry *next; char* name; char* comment; - virConfValuePtr value; + virConfValue *value; }; struct _virConf { char *filename; unsigned int flags; - virConfEntryPtr entries; + virConfEntry *entries; }; /** @@ -102,7 +98,7 @@ struct _virConf { virConfErrorHelper(__FILE__, __FUNCTION__, __LINE__, ctxt, error, info) static void virConfErrorHelper(const char *file, const char *func, size_t line, - virConfParserCtxtPtr ctxt, + virConfParserCtxt *ctxt, virErrorNumber error, const char *info) { if (error == VIR_ERR_OK) @@ -126,9 +122,9 @@ virConfErrorHelper(const char *file, const char *func, size_t line, * Free a list */ static void -virConfFreeList(virConfValuePtr list) +virConfFreeList(virConfValue *list) { - virConfValuePtr next; + virConfValue *next; while (list != NULL) { next = g_steal_pointer(&list->next); @@ -144,7 +140,7 @@ virConfFreeList(virConfValuePtr list) * Free a value */ void -virConfFreeValue(virConfValuePtr val) +virConfFreeValue(virConfValue *val) { if (val == NULL) return; @@ -157,10 +153,10 @@ virConfFreeValue(virConfValuePtr val) g_free(val); } -virConfPtr +virConf * virConfNew(void) { - virConfPtr ret; + virConf *ret; ret = g_new0(virConf, 1); ret->filename = NULL; @@ -178,10 +174,10 @@ virConfNew(void) * * Returns a pointer or NULL in case of error. */ -static virConfPtr +static virConf * virConfCreate(const char *filename, unsigned int flags) { - virConfPtr ret = virConfNew(); + virConf *ret = virConfNew(); if (!ret) return NULL; @@ -203,11 +199,11 @@ virConfCreate(const char *filename, unsigned int flags) * * Returns a pointer to the entry or NULL in case of failure */ -static virConfEntryPtr -virConfAddEntry(virConfPtr conf, char *name, virConfValuePtr value, char *comm) +static virConfEntry * +virConfAddEntry(virConf *conf, char *name, virConfValue *value, char *comm) { - virConfEntryPtr ret; - virConfEntryPtr prev; + virConfEntry *ret; + virConfEntry *prev; if (conf == NULL) return NULL; @@ -246,7 +242,7 @@ virConfAddEntry(virConfPtr conf, char *name, virConfValuePtr value, char *comm) * Returns 0 in case of success, -1 in case of error. */ static int -virConfSaveValue(virBufferPtr buf, virConfValuePtr val) +virConfSaveValue(virBuffer *buf, virConfValue *val) { if (val == NULL) return -1; @@ -273,7 +269,7 @@ virConfSaveValue(virBufferPtr buf, virConfValuePtr val) } break; case VIR_CONF_LIST: { - virConfValuePtr cur; + virConfValue *cur; cur = val->list; virBufferAddLit(buf, "[ "); @@ -307,7 +303,7 @@ virConfSaveValue(virBufferPtr buf, virConfValuePtr val) * Returns 0 in case of success, -1 in case of error. */ static int -virConfSaveEntry(virBufferPtr buf, virConfEntryPtr cur) +virConfSaveEntry(virBuffer *buf, virConfEntry *cur) { if (cur->name != NULL) { virBufferAdd(buf, cur->name, -1); @@ -336,7 +332,7 @@ virConfSaveEntry(virBufferPtr buf, virConfEntryPtr cur) * Returns 0 in case of success and -1 in case of error */ static int -virConfParseLong(virConfParserCtxtPtr ctxt, long long *val) +virConfParseLong(virConfParserCtxt *ctxt, long long *val) { long long l = 0; int neg = 0; @@ -370,7 +366,7 @@ virConfParseLong(virConfParserCtxtPtr ctxt, long long *val) * Returns a pointer to the string or NULL in case of error */ static char * -virConfParseString(virConfParserCtxtPtr ctxt) +virConfParseString(virConfParserCtxt *ctxt) { const char *base; char *ret = NULL; @@ -438,13 +434,13 @@ virConfParseString(virConfParserCtxtPtr ctxt) * * Returns a pointer to the value or NULL in case of error */ -static virConfValuePtr -virConfParseValue(virConfParserCtxtPtr ctxt) +static virConfValue * +virConfParseValue(virConfParserCtxt *ctxt) { - virConfValuePtr ret; - virConfValuePtr lst = NULL; - virConfValuePtr tmp; - virConfValuePtr prev; + virConfValue *ret; + virConfValue *lst = NULL; + virConfValue *tmp; + virConfValue *prev; virConfType type = VIR_CONF_NONE; char *str = NULL; long long l = 0; @@ -540,7 +536,7 @@ virConfParseValue(virConfParserCtxtPtr ctxt) * Returns a copy of the new string, NULL in case of error */ static char * -virConfParseName(virConfParserCtxtPtr ctxt) +virConfParseName(virConfParserCtxt *ctxt) { const char *base; char *ret; @@ -573,7 +569,7 @@ virConfParseName(virConfParserCtxtPtr ctxt) * Returns 0 in case of success and -1 in case of error */ static int -virConfParseComment(virConfParserCtxtPtr ctxt) +virConfParseComment(virConfParserCtxt *ctxt) { const char *base; char *comm; @@ -600,7 +596,7 @@ virConfParseComment(virConfParserCtxtPtr ctxt) * Returns 0 in case of success and -1 in case of error */ static int -virConfParseSeparator(virConfParserCtxtPtr ctxt) +virConfParseSeparator(virConfParserCtxt *ctxt) { SKIP_BLANKS; if (ctxt->cur >= ctxt->end) @@ -626,11 +622,11 @@ virConfParseSeparator(virConfParserCtxtPtr ctxt) * Returns 0 in case of success and -1 in case of error */ static int -virConfParseStatement(virConfParserCtxtPtr ctxt) +virConfParseStatement(virConfParserCtxt *ctxt) { const char *base; char *name; - virConfValuePtr value; + virConfValue *value; char *comm = NULL; SKIP_BLANKS_AND_EOL; @@ -681,7 +677,7 @@ virConfParseStatement(virConfParserCtxtPtr ctxt) * Returns a handle to lookup settings or NULL if it failed to * read or parse the file, use virConfFree() to free the data. */ -static virConfPtr +static virConf * virConfParse(const char *filename, const char *content, int len, unsigned int flags) { @@ -724,12 +720,12 @@ virConfParse(const char *filename, const char *content, int len, * Returns a handle to lookup settings or NULL if it failed to * read or parse the file, use virConfFree() to free the data. */ -virConfPtr +virConf * virConfReadFile(const char *filename, unsigned int flags) { char *content; int len; - virConfPtr conf; + virConf *conf; VIR_DEBUG("filename=%s", NULLSTR(filename)); @@ -759,7 +755,7 @@ virConfReadFile(const char *filename, unsigned int flags) * Returns a handle to lookup settings or NULL if it failed to * parse the content, use virConfFree() to free the data. */ -virConfPtr +virConf * virConfReadString(const char *memory, unsigned int flags) { size_t len; @@ -782,15 +778,15 @@ virConfReadString(const char *memory, unsigned int flags) * Returns 0 in case of success, -1 in case of error. */ int -virConfFree(virConfPtr conf) +virConfFree(virConf *conf) { - virConfEntryPtr tmp; + virConfEntry *tmp; if (conf == NULL) return 0; tmp = conf->entries; while (tmp) { - virConfEntryPtr next; + virConfEntry *next; g_free(tmp->name); virConfFreeValue(tmp->value); g_free(tmp->comment); @@ -813,10 +809,10 @@ virConfFree(virConfPtr conf) * Returns a pointer to the value or NULL if the lookup failed, the data * associated will be freed when virConfFree() is called */ -virConfValuePtr -virConfGetValue(virConfPtr conf, const char *setting) +virConfValue * +virConfGetValue(virConf *conf, const char *setting) { - virConfEntryPtr cur; + virConfEntry *cur; if (conf == NULL) return NULL; @@ -843,10 +839,10 @@ virConfGetValue(virConfPtr conf, const char *setting) * * Returns: the entry type, or VIR_CONF_NONE if not set. */ -virConfType virConfGetValueType(virConfPtr conf, +virConfType virConfGetValueType(virConf *conf, const char *setting) { - virConfValuePtr cval = virConfGetValue(conf, setting); + virConfValue *cval = virConfGetValue(conf, setting); if (!cval) return VIR_CONF_NONE; @@ -869,11 +865,11 @@ virConfType virConfGetValueType(virConfPtr conf, * * Returns: 1 if the value was present, 0 if missing, -1 on error */ -int virConfGetValueString(virConfPtr conf, +int virConfGetValueString(virConf *conf, const char *setting, char **value) { - virConfValuePtr cval = virConfGetValue(conf, setting); + virConfValue *cval = virConfGetValue(conf, setting); VIR_DEBUG("Get value string %p %d", cval, cval ? cval->type : VIR_CONF_NONE); @@ -914,14 +910,14 @@ int virConfGetValueString(virConfPtr conf, * * Returns: 1 if the value was present, 0 if missing, -1 on error */ -int virConfGetValueStringList(virConfPtr conf, +int virConfGetValueStringList(virConf *conf, const char *setting, bool compatString, char ***values) { - virConfValuePtr cval = virConfGetValue(conf, setting); + virConfValue *cval = virConfGetValue(conf, setting); size_t len; - virConfValuePtr eval; + virConfValue *eval; VIR_DEBUG("Get value string list %p %d", cval, cval ? cval->type : VIR_CONF_NONE); @@ -994,11 +990,11 @@ int virConfGetValueStringList(virConfPtr conf, * * Returns: 1 if the value was present, 0 if missing, -1 on error */ -int virConfGetValueBool(virConfPtr conf, +int virConfGetValueBool(virConf *conf, const char *setting, bool *value) { - virConfValuePtr cval = virConfGetValue(conf, setting); + virConfValue *cval = virConfGetValue(conf, setting); VIR_DEBUG("Get value bool %p %d", cval, cval ? cval->type : VIR_CONF_NONE); @@ -1042,11 +1038,11 @@ int virConfGetValueBool(virConfPtr conf, * * Returns: 1 if the value was present, 0 if missing, -1 on error */ -int virConfGetValueInt(virConfPtr conf, +int virConfGetValueInt(virConf *conf, const char *setting, int *value) { - virConfValuePtr cval = virConfGetValue(conf, setting); + virConfValue *cval = virConfGetValue(conf, setting); VIR_DEBUG("Get value int %p %d", cval, cval ? cval->type : VIR_CONF_NONE); @@ -1091,11 +1087,11 @@ int virConfGetValueInt(virConfPtr conf, * * Returns: 1 if the value was present, 0 if missing, -1 on error */ -int virConfGetValueUInt(virConfPtr conf, +int virConfGetValueUInt(virConf *conf, const char *setting, unsigned int *value) { - virConfValuePtr cval = virConfGetValue(conf, setting); + virConfValue *cval = virConfGetValue(conf, setting); VIR_DEBUG("Get value uint %p %d", cval, cval ? cval->type : VIR_CONF_NONE); @@ -1139,11 +1135,11 @@ int virConfGetValueUInt(virConfPtr conf, * * Returns: 1 if the value was present, 0 if missing, -1 on error */ -int virConfGetValueSizeT(virConfPtr conf, +int virConfGetValueSizeT(virConf *conf, const char *setting, size_t *value) { - virConfValuePtr cval = virConfGetValue(conf, setting); + virConfValue *cval = virConfGetValue(conf, setting); VIR_DEBUG("Get value size_t %p %d", cval, cval ? cval->type : VIR_CONF_NONE); @@ -1189,11 +1185,11 @@ int virConfGetValueSizeT(virConfPtr conf, * * Returns: 1 if the value was present, 0 if missing, -1 on error */ -int virConfGetValueSSizeT(virConfPtr conf, +int virConfGetValueSSizeT(virConf *conf, const char *setting, ssize_t *value) { - virConfValuePtr cval = virConfGetValue(conf, setting); + virConfValue *cval = virConfGetValue(conf, setting); VIR_DEBUG("Get value ssize_t %p %d", cval, cval ? cval->type : VIR_CONF_NONE); @@ -1246,11 +1242,11 @@ int virConfGetValueSSizeT(virConfPtr conf, * * Returns: 1 if the value was present, 0 if missing, -1 on error */ -int virConfGetValueLLong(virConfPtr conf, +int virConfGetValueLLong(virConf *conf, const char *setting, long long *value) { - virConfValuePtr cval = virConfGetValue(conf, setting); + virConfValue *cval = virConfGetValue(conf, setting); VIR_DEBUG("Get value long long %p %d", cval, cval ? cval->type : VIR_CONF_NONE); @@ -1293,11 +1289,11 @@ int virConfGetValueLLong(virConfPtr conf, * * Returns: 1 if the value was present, 0 if missing, -1 on error */ -int virConfGetValueULLong(virConfPtr conf, +int virConfGetValueULLong(virConf *conf, const char *setting, unsigned long long *value) { - virConfValuePtr cval = virConfGetValue(conf, setting); + virConfValue *cval = virConfGetValue(conf, setting); VIR_DEBUG("Get value unsigned long long %p %d", cval, cval ? cval->type : VIR_CONF_NONE); @@ -1331,12 +1327,12 @@ int virConfGetValueULLong(virConfPtr conf, * Returns 0 on success, or -1 on failure. */ int -virConfSetValue(virConfPtr conf, +virConfSetValue(virConf *conf, const char *setting, - virConfValuePtr value) + virConfValue *value) { - virConfEntryPtr cur; - virConfEntryPtr prev = NULL; + virConfEntry *cur; + virConfEntry *prev = NULL; if (value && value->type == VIR_CONF_STRING && value->str == NULL) { virConfFreeValue(value); @@ -1381,11 +1377,11 @@ virConfSetValue(virConfPtr conf, * * Returns 0 on success, or -1 on failure. */ -int virConfWalk(virConfPtr conf, +int virConfWalk(virConf *conf, virConfWalkCallback callback, void *opaque) { - virConfEntryPtr cur; + virConfEntry *cur; if (!conf) return 0; @@ -1410,10 +1406,10 @@ int virConfWalk(virConfPtr conf, * Returns the number of bytes written or -1 in case of error. */ int -virConfWriteFile(const char *filename, virConfPtr conf) +virConfWriteFile(const char *filename, virConf *conf) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virConfEntryPtr cur; + virConfEntry *cur; int ret; int fd; char *content; @@ -1461,10 +1457,10 @@ virConfWriteFile(const char *filename, virConfPtr conf) * Returns the number of bytes written or -1 in case of error. */ int -virConfWriteMem(char *memory, int *len, virConfPtr conf) +virConfWriteMem(char *memory, int *len, virConf *conf) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virConfEntryPtr cur; + virConfEntry *cur; char *content; unsigned int use; @@ -1507,7 +1503,7 @@ virConfLoadConfigPath(const char *name) } int -virConfLoadConfig(virConfPtr *conf, const char *name) +virConfLoadConfig(virConf **conf, const char *name) { char *path = NULL; int ret = -1; diff --git a/src/util/virconf.h b/src/util/virconf.h index 6f0101bd3a..937e5d43ed 100644 --- a/src/util/virconf.h +++ b/src/util/virconf.h @@ -53,77 +53,74 @@ typedef enum { * a value from the configuration file */ typedef struct _virConfValue virConfValue; -typedef virConfValue *virConfValuePtr; - struct _virConfValue { virConfType type; /* the virConfType */ - virConfValuePtr next; /* next element if in a list */ + virConfValue *next; /* next element if in a list */ long long l; /* very long integer */ char *str; /* pointer to 0 terminated string */ - virConfValuePtr list; /* list of a list */ + virConfValue *list; /* list of a list */ }; /** - * virConfPtr: + * virConf *: * a pointer to a parsed configuration file */ typedef struct _virConf virConf; -typedef virConf *virConfPtr; typedef int (*virConfWalkCallback)(const char* name, - virConfValuePtr value, + virConfValue *value, void *opaque); -virConfPtr virConfNew(void); -virConfPtr virConfReadFile(const char *filename, unsigned int flags); -virConfPtr virConfReadString(const char *memory, +virConf *virConfNew(void); +virConf *virConfReadFile(const char *filename, unsigned int flags); +virConf *virConfReadString(const char *memory, unsigned int flags); -int virConfFree(virConfPtr conf); +int virConfFree(virConf *conf); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virConf, virConfFree); -void virConfFreeValue(virConfValuePtr val); -virConfValuePtr virConfGetValue(virConfPtr conf, +void virConfFreeValue(virConfValue *val); +virConfValue *virConfGetValue(virConf *conf, const char *setting); -virConfType virConfGetValueType(virConfPtr conf, +virConfType virConfGetValueType(virConf *conf, const char *setting); -int virConfGetValueString(virConfPtr conf, +int virConfGetValueString(virConf *conf, const char *setting, char **value); -int virConfGetValueStringList(virConfPtr conf, +int virConfGetValueStringList(virConf *conf, const char *setting, bool compatString, char ***values); -int virConfGetValueBool(virConfPtr conf, +int virConfGetValueBool(virConf *conf, const char *setting, bool *value); -int virConfGetValueInt(virConfPtr conf, +int virConfGetValueInt(virConf *conf, const char *setting, int *value); -int virConfGetValueUInt(virConfPtr conf, +int virConfGetValueUInt(virConf *conf, const char *setting, unsigned int *value); -int virConfGetValueSizeT(virConfPtr conf, +int virConfGetValueSizeT(virConf *conf, const char *setting, size_t *value); -int virConfGetValueSSizeT(virConfPtr conf, +int virConfGetValueSSizeT(virConf *conf, const char *setting, ssize_t *value); -int virConfGetValueLLong(virConfPtr conf, +int virConfGetValueLLong(virConf *conf, const char *setting, long long *value); -int virConfGetValueULLong(virConfPtr conf, +int virConfGetValueULLong(virConf *conf, const char *setting, unsigned long long *value); -int virConfSetValue(virConfPtr conf, +int virConfSetValue(virConf *conf, const char *setting, - virConfValuePtr value); -int virConfWalk(virConfPtr conf, + virConfValue *value); +int virConfWalk(virConf *conf, virConfWalkCallback callback, void *opaque); int virConfWriteFile(const char *filename, - virConfPtr conf); + virConf *conf); int virConfWriteMem(char *memory, int *len, - virConfPtr conf); -int virConfLoadConfig(virConfPtr *conf, const char *name); + virConf *conf); +int virConfLoadConfig(virConf **conf, const char *name); diff --git a/src/util/virdnsmasq.c b/src/util/virdnsmasq.c index fa59954997..3db718c1d9 100644 --- a/src/util/virdnsmasq.c +++ b/src/util/virdnsmasq.c @@ -585,16 +585,16 @@ struct _dnsmasqCaps { char *binaryPath; bool noRefresh; time_t mtime; - virBitmapPtr flags; + virBitmap *flags; unsigned long version; }; -static virClassPtr dnsmasqCapsClass; +static virClass *dnsmasqCapsClass; static void dnsmasqCapsDispose(void *obj) { - dnsmasqCapsPtr caps = obj; + dnsmasqCaps *caps = obj; virBitmapFree(caps->flags); g_free(caps->binaryPath); @@ -611,7 +611,7 @@ static int dnsmasqCapsOnceInit(void) VIR_ONCE_GLOBAL_INIT(dnsmasqCaps); static void -dnsmasqCapsSet(dnsmasqCapsPtr caps, +dnsmasqCapsSet(dnsmasqCaps *caps, dnsmasqCapsFlags flag) { ignore_value(virBitmapSetBit(caps->flags, flag)); @@ -621,7 +621,7 @@ dnsmasqCapsSet(dnsmasqCapsPtr caps, #define DNSMASQ_VERSION_STR "Dnsmasq version " static int -dnsmasqCapsSetFromBuffer(dnsmasqCapsPtr caps, const char *buf) +dnsmasqCapsSetFromBuffer(dnsmasqCaps *caps, const char *buf) { int len; const char *p; @@ -674,7 +674,7 @@ dnsmasqCapsSetFromBuffer(dnsmasqCapsPtr caps, const char *buf) } static int -dnsmasqCapsSetFromFile(dnsmasqCapsPtr caps, const char *path) +dnsmasqCapsSetFromFile(dnsmasqCaps *caps, const char *path) { int ret = -1; g_autofree char *buf = NULL; @@ -689,11 +689,11 @@ dnsmasqCapsSetFromFile(dnsmasqCapsPtr caps, const char *path) } static int -dnsmasqCapsRefreshInternal(dnsmasqCapsPtr caps, bool force) +dnsmasqCapsRefreshInternal(dnsmasqCaps *caps, bool force) { int ret = -1; struct stat sb; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; g_autofree char *help = NULL; g_autofree char *version = NULL; g_autofree char *complete = NULL; @@ -744,10 +744,10 @@ dnsmasqCapsRefreshInternal(dnsmasqCapsPtr caps, bool force) return ret; } -static dnsmasqCapsPtr +static dnsmasqCaps * dnsmasqCapsNewEmpty(const char *binaryPath) { - dnsmasqCapsPtr caps; + dnsmasqCaps *caps; if (dnsmasqCapsInitialize() < 0) return NULL; @@ -758,10 +758,10 @@ dnsmasqCapsNewEmpty(const char *binaryPath) return caps; } -dnsmasqCapsPtr +dnsmasqCaps * dnsmasqCapsNewFromBuffer(const char *buf, const char *binaryPath) { - dnsmasqCapsPtr caps = dnsmasqCapsNewEmpty(binaryPath); + dnsmasqCaps *caps = dnsmasqCapsNewEmpty(binaryPath); if (!caps) return NULL; @@ -773,10 +773,10 @@ dnsmasqCapsNewFromBuffer(const char *buf, const char *binaryPath) return caps; } -dnsmasqCapsPtr +dnsmasqCaps * dnsmasqCapsNewFromFile(const char *dataPath, const char *binaryPath) { - dnsmasqCapsPtr caps = dnsmasqCapsNewEmpty(binaryPath); + dnsmasqCaps *caps = dnsmasqCapsNewEmpty(binaryPath); if (!caps) return NULL; @@ -788,10 +788,10 @@ dnsmasqCapsNewFromFile(const char *dataPath, const char *binaryPath) return caps; } -dnsmasqCapsPtr +dnsmasqCaps * dnsmasqCapsNewFromBinary(const char *binaryPath) { - dnsmasqCapsPtr caps = dnsmasqCapsNewEmpty(binaryPath); + dnsmasqCaps *caps = dnsmasqCapsNewEmpty(binaryPath); if (!caps) return NULL; @@ -811,7 +811,7 @@ dnsmasqCapsNewFromBinary(const char *binaryPath) * Returns 0 on success, -1 on failure */ int -dnsmasqCapsRefresh(dnsmasqCapsPtr *caps, const char *binaryPath) +dnsmasqCapsRefresh(dnsmasqCaps **caps, const char *binaryPath) { if (!*caps) { *caps = dnsmasqCapsNewFromBinary(binaryPath); @@ -821,13 +821,13 @@ dnsmasqCapsRefresh(dnsmasqCapsPtr *caps, const char *binaryPath) } const char * -dnsmasqCapsGetBinaryPath(dnsmasqCapsPtr caps) +dnsmasqCapsGetBinaryPath(dnsmasqCaps *caps) { return caps ? caps->binaryPath : DNSMASQ; } unsigned long -dnsmasqCapsGetVersion(dnsmasqCapsPtr caps) +dnsmasqCapsGetVersion(dnsmasqCaps *caps) { if (caps) return caps->version; @@ -836,7 +836,7 @@ dnsmasqCapsGetVersion(dnsmasqCapsPtr caps) } bool -dnsmasqCapsGet(dnsmasqCapsPtr caps, dnsmasqCapsFlags flag) +dnsmasqCapsGet(dnsmasqCaps *caps, dnsmasqCapsFlags flag) { return caps && virBitmapIsBitSet(caps->flags, flag); } diff --git a/src/util/virdnsmasq.h b/src/util/virdnsmasq.h index e3814c2eb1..6cdc619d8f 100644 --- a/src/util/virdnsmasq.h +++ b/src/util/virdnsmasq.h @@ -76,7 +76,6 @@ typedef enum { } dnsmasqCapsFlags; typedef struct _dnsmasqCaps dnsmasqCaps; -typedef dnsmasqCaps *dnsmasqCapsPtr; G_DEFINE_AUTOPTR_CLEANUP_FUNC(dnsmasqCaps, virObjectUnref); @@ -100,15 +99,15 @@ int dnsmasqSave(const dnsmasqContext *ctx); int dnsmasqDelete(const dnsmasqContext *ctx); int dnsmasqReload(pid_t pid); -dnsmasqCapsPtr dnsmasqCapsNewFromBuffer(const char *buf, +dnsmasqCaps *dnsmasqCapsNewFromBuffer(const char *buf, const char *binaryPath); -dnsmasqCapsPtr dnsmasqCapsNewFromFile(const char *dataPath, +dnsmasqCaps *dnsmasqCapsNewFromFile(const char *dataPath, const char *binaryPath); -dnsmasqCapsPtr dnsmasqCapsNewFromBinary(const char *binaryPath); -int dnsmasqCapsRefresh(dnsmasqCapsPtr *caps, const char *binaryPath); -bool dnsmasqCapsGet(dnsmasqCapsPtr caps, dnsmasqCapsFlags flag); -const char *dnsmasqCapsGetBinaryPath(dnsmasqCapsPtr caps); -unsigned long dnsmasqCapsGetVersion(dnsmasqCapsPtr caps); +dnsmasqCaps *dnsmasqCapsNewFromBinary(const char *binaryPath); +int dnsmasqCapsRefresh(dnsmasqCaps **caps, const char *binaryPath); +bool dnsmasqCapsGet(dnsmasqCaps *caps, dnsmasqCapsFlags flag); +const char *dnsmasqCapsGetBinaryPath(dnsmasqCaps *caps); +unsigned long dnsmasqCapsGetVersion(dnsmasqCaps *caps); char *dnsmasqDhcpHostsToString(dnsmasqDhcpHost *hosts, unsigned int nhosts); diff --git a/src/util/virfdstream.c b/src/util/virfdstream.c index 3cf3a3b46a..e2c6461ded 100644 --- a/src/util/virfdstream.c +++ b/src/util/virfdstream.c @@ -53,9 +53,8 @@ typedef enum { } virFDStreamMsgType; typedef struct _virFDStreamMsg virFDStreamMsg; -typedef virFDStreamMsg *virFDStreamMsgPtr; struct _virFDStreamMsg { - virFDStreamMsgPtr next; + virFDStreamMsg *next; virFDStreamMsgType type; @@ -74,7 +73,6 @@ struct _virFDStreamMsg { /* Tunnelled migration stream support */ typedef struct virFDStreamData virFDStreamData; -typedef virFDStreamData *virFDStreamDataPtr; struct virFDStreamData { virObjectLockable parent; @@ -102,24 +100,24 @@ struct virFDStreamData { void *icbOpaque; /* Thread data */ - virThreadPtr thread; + virThread *thread; virCond threadCond; virErrorPtr threadErr; bool threadQuit; bool threadAbort; bool threadDoRead; - virFDStreamMsgPtr msg; + virFDStreamMsg *msg; }; -static virClassPtr virFDStreamDataClass; +static virClass *virFDStreamDataClass; static __thread bool virFDStreamDataDisposed; -static void virFDStreamMsgQueueFree(virFDStreamMsgPtr *queue); +static void virFDStreamMsgQueueFree(virFDStreamMsg **queue); static void virFDStreamDataDispose(void *obj) { - virFDStreamDataPtr fdst = obj; + virFDStreamData *fdst = obj; VIR_DEBUG("obj=%p", fdst); virFDStreamDataDisposed = true; @@ -139,12 +137,12 @@ VIR_ONCE_GLOBAL_INIT(virFDStreamData); static int -virFDStreamMsgQueuePush(virFDStreamDataPtr fdst, - virFDStreamMsgPtr *msg, +virFDStreamMsgQueuePush(virFDStreamData *fdst, + virFDStreamMsg **msg, int fd, const char *fdname) { - virFDStreamMsgPtr *tmp = &fdst->msg; + virFDStreamMsg **tmp = &fdst->msg; char c = '1'; while (*tmp) @@ -164,12 +162,12 @@ virFDStreamMsgQueuePush(virFDStreamDataPtr fdst, } -static virFDStreamMsgPtr -virFDStreamMsgQueuePop(virFDStreamDataPtr fdst, +static virFDStreamMsg * +virFDStreamMsgQueuePop(virFDStreamData *fdst, int fd, const char *fdname) { - virFDStreamMsgPtr tmp = fdst->msg; + virFDStreamMsg *tmp = fdst->msg; char c; if (tmp) { @@ -190,7 +188,7 @@ virFDStreamMsgQueuePop(virFDStreamDataPtr fdst, static void -virFDStreamMsgFree(virFDStreamMsgPtr msg) +virFDStreamMsgFree(virFDStreamMsg *msg) { if (!msg) return; @@ -211,12 +209,12 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virFDStreamMsg, virFDStreamMsgFree); static void -virFDStreamMsgQueueFree(virFDStreamMsgPtr *queue) +virFDStreamMsgQueueFree(virFDStreamMsg **queue) { - virFDStreamMsgPtr tmp = *queue; + virFDStreamMsg *tmp = *queue; while (tmp) { - virFDStreamMsgPtr next = tmp->next; + virFDStreamMsg *next = tmp->next; virFDStreamMsgFree(tmp); tmp = next; } @@ -227,7 +225,7 @@ virFDStreamMsgQueueFree(virFDStreamMsgPtr *queue) static int virFDStreamRemoveCallback(virStreamPtr stream) { - virFDStreamDataPtr fdst = stream->privateData; + virFDStreamData *fdst = stream->privateData; int ret = -1; if (!fdst) { @@ -264,7 +262,7 @@ static int virFDStreamRemoveCallback(virStreamPtr stream) static int virFDStreamUpdateCallback(virStreamPtr stream, int events) { - virFDStreamDataPtr fdst = stream->privateData; + virFDStreamData *fdst = stream->privateData; int ret = -1; if (!fdst) { @@ -296,7 +294,7 @@ static void virFDStreamEvent(int watch G_GNUC_UNUSED, void *opaque) { virStreamPtr stream = opaque; - virFDStreamDataPtr fdst = stream->privateData; + virFDStreamData *fdst = stream->privateData; virStreamEventCallback cb; void *cbopaque; virFreeCallback ff; @@ -348,7 +346,7 @@ virFDStreamAddCallback(virStreamPtr st, void *opaque, virFreeCallback ff) { - virFDStreamDataPtr fdst = st->privateData; + virFDStreamData *fdst = st->privateData; int ret = -1; if (!fdst) { @@ -391,7 +389,6 @@ virFDStreamAddCallback(virStreamPtr st, typedef struct _virFDStreamThreadData virFDStreamThreadData; -typedef virFDStreamThreadData *virFDStreamThreadDataPtr; struct _virFDStreamThreadData { virStreamPtr st; size_t length; @@ -406,7 +403,7 @@ struct _virFDStreamThreadData { static void -virFDStreamThreadDataFree(virFDStreamThreadDataPtr data) +virFDStreamThreadDataFree(virFDStreamThreadData *data) { if (!data) return; @@ -419,7 +416,7 @@ virFDStreamThreadDataFree(virFDStreamThreadDataPtr data) static ssize_t -virFDStreamThreadDoRead(virFDStreamDataPtr fdst, +virFDStreamThreadDoRead(virFDStreamData *fdst, bool sparse, bool isBlock, const int fdin, @@ -509,7 +506,7 @@ virFDStreamThreadDoRead(virFDStreamDataPtr fdst, static ssize_t -virFDStreamThreadDoWrite(virFDStreamDataPtr fdst, +virFDStreamThreadDoWrite(virFDStreamData *fdst, bool sparse, bool isBlock, const int fdin, @@ -518,7 +515,7 @@ virFDStreamThreadDoWrite(virFDStreamDataPtr fdst, const char *fdoutname) { ssize_t got = 0; - virFDStreamMsgPtr msg = fdst->msg; + virFDStreamMsg *msg = fdst->msg; bool pop = false; switch (msg->type) { @@ -606,7 +603,7 @@ virFDStreamThreadDoWrite(virFDStreamDataPtr fdst, static void virFDStreamThread(void *opaque) { - virFDStreamThreadDataPtr data = opaque; + virFDStreamThreadData *data = opaque; virStreamPtr st = data->st; size_t length = data->length; bool sparse = data->sparse; @@ -615,7 +612,7 @@ virFDStreamThread(void *opaque) char *fdinname = data->fdinname; VIR_AUTOCLOSE fdout = data->fdout; char *fdoutname = data->fdoutname; - virFDStreamDataPtr fdst = st->privateData; + virFDStreamData *fdst = st->privateData; bool doRead = fdst->threadDoRead; size_t buflen = 256 * 1024; size_t total = 0; @@ -683,7 +680,7 @@ virFDStreamThread(void *opaque) static int -virFDStreamJoinWorker(virFDStreamDataPtr fdst, +virFDStreamJoinWorker(virFDStreamData *fdst, bool streamAbort) { int ret = -1; @@ -715,7 +712,7 @@ virFDStreamJoinWorker(virFDStreamDataPtr fdst, static int virFDStreamCloseInt(virStreamPtr st, bool streamAbort) { - virFDStreamDataPtr fdst; + virFDStreamData *fdst; virStreamEventCallback cb; void *opaque; int ret; @@ -797,7 +794,7 @@ virFDStreamAbort(virStreamPtr st) static int virFDStreamWrite(virStreamPtr st, const char *bytes, size_t nbytes) { - virFDStreamDataPtr fdst = st->privateData; + virFDStreamData *fdst = st->privateData; g_autoptr(virFDStreamMsg) msg = NULL; int ret = -1; @@ -880,7 +877,7 @@ static int virFDStreamWrite(virStreamPtr st, const char *bytes, size_t nbytes) static int virFDStreamRead(virStreamPtr st, char *bytes, size_t nbytes) { - virFDStreamDataPtr fdst = st->privateData; + virFDStreamData *fdst = st->privateData; int ret = -1; if (nbytes > INT_MAX) { @@ -908,7 +905,7 @@ static int virFDStreamRead(virStreamPtr st, char *bytes, size_t nbytes) } if (fdst->thread) { - virFDStreamMsgPtr msg = NULL; + virFDStreamMsg *msg = NULL; while (!(msg = fdst->msg)) { if (fdst->threadQuit || fdst->threadErr) { @@ -994,7 +991,7 @@ virFDStreamSendHole(virStreamPtr st, long long length, unsigned int flags) { - virFDStreamDataPtr fdst = st->privateData; + virFDStreamData *fdst = st->privateData; g_autoptr(virFDStreamMsg) msg = NULL; off_t off; int ret = -1; @@ -1071,13 +1068,13 @@ virFDStreamInData(virStreamPtr st, int *inData, long long *length) { - virFDStreamDataPtr fdst = st->privateData; + virFDStreamData *fdst = st->privateData; int ret = -1; virObjectLock(fdst); if (fdst->thread) { - virFDStreamMsgPtr msg; + virFDStreamMsg *msg; if (fdst->threadErr) goto cleanup; @@ -1126,10 +1123,10 @@ static virStreamDriver virFDStreamDrv = { static int virFDStreamOpenInternal(virStreamPtr st, int fd, - virFDStreamThreadDataPtr threadData, + virFDStreamThreadData *threadData, unsigned long long length) { - virFDStreamDataPtr fdst; + virFDStreamData *fdst; VIR_DEBUG("st=%p fd=%d threadData=%p length=%llu", st, fd, threadData, length); @@ -1256,7 +1253,7 @@ virFDStreamOpenFileInternal(virStreamPtr st, int pipefds[2] = { -1, -1 }; int tmpfd = -1; struct stat sb; - virFDStreamThreadDataPtr threadData = NULL; + virFDStreamThreadData *threadData = NULL; VIR_DEBUG("st=%p path=%s oflags=0x%x offset=%llu length=%llu mode=0%o", st, path, oflags, offset, length, mode); @@ -1384,7 +1381,7 @@ int virFDStreamOpenPTY(virStreamPtr st, unsigned long long length, int oflags) { - virFDStreamDataPtr fdst = NULL; + virFDStreamData *fdst = NULL; struct termios rawattr; if (virFDStreamOpenFileInternal(st, path, @@ -1435,7 +1432,7 @@ int virFDStreamSetInternalCloseCb(virStreamPtr st, void *opaque, virFDStreamInternalCloseCbFreeOpaque fcb) { - virFDStreamDataPtr fdst = st->privateData; + virFDStreamData *fdst = st->privateData; virObjectLock(fdst); diff --git a/src/util/virfile.c b/src/util/virfile.c index 3311eaff3d..03a7725dd3 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -196,7 +196,7 @@ virFileDirectFdFlag(void) * read-write is not supported, just a single direction. */ struct _virFileWrapperFd { bool closed; /* Whether virFileWrapperFdClose() has been already called */ - virCommandPtr cmd; /* Child iohelper process to do the I/O. */ + virCommand *cmd; /* Child iohelper process to do the I/O. */ char *err_msg; /* stderr of @cmd */ }; @@ -228,10 +228,10 @@ struct _virFileWrapperFd { * freed with virFileWrapperFdFree(). On failure, @fd is unchanged, an * error message is output, and NULL is returned. */ -virFileWrapperFdPtr +virFileWrapperFd * virFileWrapperFdNew(int *fd, const char *name, unsigned int flags) { - virFileWrapperFdPtr ret = NULL; + virFileWrapperFd *ret = NULL; bool output = false; int pipefd[2] = { -1, -1 }; int mode = -1; @@ -318,7 +318,7 @@ virFileWrapperFdNew(int *fd, const char *name, unsigned int flags) return NULL; } #else /* WIN32 */ -virFileWrapperFdPtr +virFileWrapperFd * virFileWrapperFdNew(int *fd G_GNUC_UNUSED, const char *name G_GNUC_UNUSED, unsigned int fdflags G_GNUC_UNUSED) @@ -344,7 +344,7 @@ virFileWrapperFdNew(int *fd G_GNUC_UNUSED, * This function can be safely called multiple times on the same @wfd. */ int -virFileWrapperFdClose(virFileWrapperFdPtr wfd) +virFileWrapperFdClose(virFileWrapperFd *wfd) { int ret; @@ -377,7 +377,7 @@ virFileWrapperFdClose(virFileWrapperFdPtr wfd) * closing the fd resulting from virFileWrapperFdNew(). */ void -virFileWrapperFdFree(virFileWrapperFdPtr wfd) +virFileWrapperFdFree(virFileWrapperFd *wfd) { if (!wfd) return; @@ -3514,14 +3514,14 @@ virFileGetDefaultHugepageSize(unsigned long long *size) } int -virFileFindHugeTLBFS(virHugeTLBFSPtr *ret_fs, +virFileFindHugeTLBFS(virHugeTLBFS **ret_fs, size_t *ret_nfs) { int ret = -1; FILE *f = NULL; struct mntent mb; char mntbuf[1024]; - virHugeTLBFSPtr fs = NULL; + virHugeTLBFS *fs = NULL; size_t nfs = 0; unsigned long long default_hugepagesz = 0; @@ -3533,7 +3533,7 @@ virFileFindHugeTLBFS(virHugeTLBFSPtr *ret_fs, } while (getmntent_r(f, &mb, mntbuf, sizeof(mntbuf))) { - virHugeTLBFSPtr tmp; + virHugeTLBFS *tmp; if (STRNEQ(mb.mnt_type, "hugetlbfs")) continue; @@ -3586,7 +3586,7 @@ virFileGetHugepageSize(const char *path G_GNUC_UNUSED, } int -virFileFindHugeTLBFS(virHugeTLBFSPtr *ret_fs G_GNUC_UNUSED, +virFileFindHugeTLBFS(virHugeTLBFS **ret_fs G_GNUC_UNUSED, size_t *ret_nfs G_GNUC_UNUSED) { /* XXX implement me :-) */ @@ -3606,8 +3606,8 @@ virFileFindHugeTLBFS(virHugeTLBFSPtr *ret_fs G_GNUC_UNUSED, * Returns: default hugepage, or * NULL if none found */ -virHugeTLBFSPtr -virFileGetDefaultHugepage(virHugeTLBFSPtr fs, +virHugeTLBFS * +virFileGetDefaultHugepage(virHugeTLBFS *fs, size_t nfs) { size_t i; @@ -4166,7 +4166,7 @@ virFileReadValueScaledInt(unsigned long long *value, const char *format, ...) /** * virFileReadValueBitmap: - * @value: pointer to virBitmapPtr to be allocated and filled in with the value + * @value: pointer to virBitmap * to be allocated and filled in with the value * @format, ...: file to read from * * Read int from @format and put it into @value. @@ -4175,7 +4175,7 @@ virFileReadValueScaledInt(unsigned long long *value, const char *format, ...) * fine. */ int -virFileReadValueBitmap(virBitmapPtr *value, const char *format, ...) +virFileReadValueBitmap(virBitmap **value, const char *format, ...) { g_autofree char *str = NULL; g_autofree char *path = NULL; diff --git a/src/util/virfile.h b/src/util/virfile.h index 26197cb39d..a02779f0ec 100644 --- a/src/util/virfile.h +++ b/src/util/virfile.h @@ -101,7 +101,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(FILE, fclose); struct _virFileWrapperFd; typedef struct _virFileWrapperFd virFileWrapperFd; -typedef virFileWrapperFd *virFileWrapperFdPtr; int virFileDirectFdFlag(void); @@ -110,14 +109,14 @@ typedef enum { VIR_FILE_WRAPPER_NON_BLOCKING = (1 << 1), } virFileWrapperFdFlags; -virFileWrapperFdPtr virFileWrapperFdNew(int *fd, +virFileWrapperFd *virFileWrapperFdNew(int *fd, const char *name, unsigned int flags) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int virFileWrapperFdClose(virFileWrapperFdPtr dfd); +int virFileWrapperFdClose(virFileWrapperFd *dfd); -void virFileWrapperFdFree(virFileWrapperFdPtr dfd); +void virFileWrapperFdFree(virFileWrapperFd *dfd); int virFileLock(int fd, bool shared, off_t start, off_t len, bool waitForLock) G_GNUC_NO_INLINE; @@ -300,7 +299,6 @@ char *virFileFindMountPoint(const char *type); void virBuildPathInternal(char **path, ...) G_GNUC_NULL_TERMINATED; typedef struct _virHugeTLBFS virHugeTLBFS; -typedef virHugeTLBFS *virHugeTLBFSPtr; struct _virHugeTLBFS { char *mnt_dir; /* Where the FS is mount to */ unsigned long long size; /* page size in kibibytes */ @@ -309,10 +307,10 @@ struct _virHugeTLBFS { int virFileGetHugepageSize(const char *path, unsigned long long *size); -int virFileFindHugeTLBFS(virHugeTLBFSPtr *ret_fs, +int virFileFindHugeTLBFS(virHugeTLBFS **ret_fs, size_t *ret_nfs); -virHugeTLBFSPtr virFileGetDefaultHugepage(virHugeTLBFSPtr fs, +virHugeTLBFS *virFileGetDefaultHugepage(virHugeTLBFS *fs, size_t nfs); int virFileSetupDev(const char *path, @@ -343,7 +341,7 @@ int virFileReadValueUint(unsigned int *value, const char *format, ...) G_GNUC_PRINTF(2, 3); int virFileReadValueUllong(unsigned long long *value, const char *format, ...) G_GNUC_PRINTF(2, 3); -int virFileReadValueBitmap(virBitmapPtr *value, const char *format, ...) +int virFileReadValueBitmap(virBitmap **value, const char *format, ...) G_GNUC_PRINTF(2, 3); int virFileReadValueScaledInt(unsigned long long *value, const char *format, ...) G_GNUC_PRINTF(2, 3); diff --git a/src/util/virfilecache.c b/src/util/virfilecache.c index f2324b2cf2..2f55deefb6 100644 --- a/src/util/virfilecache.c +++ b/src/util/virfilecache.c @@ -58,11 +58,11 @@ struct _virFileCache { }; -static virClassPtr virFileCacheClass; +static virClass *virFileCacheClass; static void -virFileCachePrivFree(virFileCachePtr cache) +virFileCachePrivFree(virFileCache *cache) { if (cache->priv && cache->handlers.privFree) cache->handlers.privFree(cache->priv); @@ -72,7 +72,7 @@ virFileCachePrivFree(virFileCachePtr cache) static void virFileCacheDispose(void *obj) { - virFileCachePtr cache = obj; + virFileCache *cache = obj; g_free(cache->dir); g_free(cache->suffix); @@ -97,7 +97,7 @@ VIR_ONCE_GLOBAL_INIT(virFileCache); static char * -virFileCacheGetFileName(virFileCachePtr cache, +virFileCacheGetFileName(virFileCache *cache, const char *name) { g_autofree char *namehash = NULL; @@ -123,7 +123,7 @@ virFileCacheGetFileName(virFileCachePtr cache, static int -virFileCacheLoad(virFileCachePtr cache, +virFileCacheLoad(virFileCache *cache, const char *name, void **data) { @@ -178,7 +178,7 @@ virFileCacheLoad(virFileCachePtr cache, static int -virFileCacheSave(virFileCachePtr cache, +virFileCacheSave(virFileCache *cache, const char *name, void *data) { @@ -195,7 +195,7 @@ virFileCacheSave(virFileCachePtr cache, static void * -virFileCacheNewData(virFileCachePtr cache, +virFileCacheNewData(virFileCache *cache, const char *name) { void *data = NULL; @@ -229,12 +229,12 @@ virFileCacheNewData(virFileCachePtr cache, * * Returns new cache object or NULL on error. */ -virFileCachePtr +virFileCache * virFileCacheNew(const char *dir, const char *suffix, virFileCacheHandlers *handlers) { - virFileCachePtr cache; + virFileCache *cache; if (virFileCacheInitialize() < 0) return NULL; @@ -260,7 +260,7 @@ virFileCacheNew(const char *dir, static void -virFileCacheValidate(virFileCachePtr cache, +virFileCacheValidate(virFileCache *cache, const char *name, void **data) { @@ -299,7 +299,7 @@ virFileCacheValidate(virFileCachePtr cache, * unrefing the data. */ void * -virFileCacheLookup(virFileCachePtr cache, +virFileCacheLookup(virFileCache *cache, const char *name) { void *data = NULL; @@ -328,7 +328,7 @@ virFileCacheLookup(virFileCachePtr cache, * unrefing the data. */ void * -virFileCacheLookupByFunc(virFileCachePtr cache, +virFileCacheLookupByFunc(virFileCache *cache, virHashSearcher iter, const void *iterData) { @@ -354,7 +354,7 @@ virFileCacheLookupByFunc(virFileCachePtr cache, * Returns private data used by @handlers. */ void * -virFileCacheGetPriv(virFileCachePtr cache) +virFileCacheGetPriv(virFileCache *cache) { void *priv; @@ -377,7 +377,7 @@ virFileCacheGetPriv(virFileCachePtr cache) * set, privFree() will be called on the old @priv before setting a new one. */ void -virFileCacheSetPriv(virFileCachePtr cache, +virFileCacheSetPriv(virFileCache *cache, void *priv) { virObjectLock(cache); @@ -402,7 +402,7 @@ virFileCacheSetPriv(virFileCachePtr cache, * Returns 0 on success, -1 on error. */ int -virFileCacheInsertData(virFileCachePtr cache, +virFileCacheInsertData(virFileCache *cache, const char *name, void *data) { diff --git a/src/util/virfilecache.h b/src/util/virfilecache.h index 9a7edf07e6..81be8feef5 100644 --- a/src/util/virfilecache.h +++ b/src/util/virfilecache.h @@ -27,7 +27,6 @@ #include "virhash.h" typedef struct _virFileCache virFileCache; -typedef virFileCache *virFileCachePtr; /** * virFileCacheIsValidPtr: @@ -103,7 +102,6 @@ typedef void (*virFileCachePrivFreePtr)(void *priv); typedef struct _virFileCacheHandlers virFileCacheHandlers; -typedef virFileCacheHandlers *virFileCacheHandlersPtr; struct _virFileCacheHandlers { virFileCacheIsValidPtr isValid; virFileCacheNewDataPtr newData; @@ -112,28 +110,28 @@ struct _virFileCacheHandlers { virFileCachePrivFreePtr privFree; }; -virFileCachePtr +virFileCache * virFileCacheNew(const char *dir, const char *suffix, virFileCacheHandlers *handlers); void * -virFileCacheLookup(virFileCachePtr cache, +virFileCacheLookup(virFileCache *cache, const char *name); void * -virFileCacheLookupByFunc(virFileCachePtr cache, +virFileCacheLookupByFunc(virFileCache *cache, virHashSearcher iter, const void *iterData); void * -virFileCacheGetPriv(virFileCachePtr cache); +virFileCacheGetPriv(virFileCache *cache); void -virFileCacheSetPriv(virFileCachePtr cache, +virFileCacheSetPriv(virFileCache *cache, void *priv); int -virFileCacheInsertData(virFileCachePtr cache, +virFileCacheInsertData(virFileCache *cache, const char *name, void *data); diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c index eee191ff23..78aa7e580e 100644 --- a/src/util/virfirewall.c +++ b/src/util/virfirewall.c @@ -38,7 +38,6 @@ VIR_LOG_INIT("util.firewall"); typedef struct _virFirewallGroup virFirewallGroup; -typedef virFirewallGroup *virFirewallGroupPtr; VIR_ENUM_DECL(virFirewallLayerCommand); VIR_ENUM_IMPL(virFirewallLayerCommand, @@ -65,10 +64,10 @@ struct _virFirewallGroup { unsigned int rollbackFlags; size_t naction; - virFirewallRulePtr *action; + virFirewallRule **action; size_t nrollback; - virFirewallRulePtr *rollback; + virFirewallRule **rollback; bool addingRollback; }; @@ -78,7 +77,7 @@ struct _virFirewall { int err; size_t ngroups; - virFirewallGroupPtr *groups; + virFirewallGroup **groups; size_t currentGroup; }; @@ -153,10 +152,10 @@ virFirewallSetBackend(virFirewallBackend backend) return virFirewallValidateBackend(backend); } -static virFirewallGroupPtr +static virFirewallGroup * virFirewallGroupNew(void) { - virFirewallGroupPtr group; + virFirewallGroup *group; group = g_new0(virFirewallGroup, 1); @@ -174,9 +173,9 @@ virFirewallGroupNew(void) * * Returns the new firewall ruleset */ -virFirewallPtr virFirewallNew(void) +virFirewall *virFirewallNew(void) { - virFirewallPtr firewall; + virFirewall *firewall; if (virFirewallInitialize() < 0) return NULL; @@ -188,7 +187,7 @@ virFirewallPtr virFirewallNew(void) static void -virFirewallRuleFree(virFirewallRulePtr rule) +virFirewallRuleFree(virFirewallRule *rule) { size_t i; @@ -203,7 +202,7 @@ virFirewallRuleFree(virFirewallRulePtr rule) static void -virFirewallGroupFree(virFirewallGroupPtr group) +virFirewallGroupFree(virFirewallGroup *group) { size_t i; @@ -228,7 +227,7 @@ virFirewallGroupFree(virFirewallGroupPtr group) * Release all memory associated with the firewall * ruleset */ -void virFirewallFree(virFirewallPtr firewall) +void virFirewallFree(virFirewall *firewall) { size_t i; @@ -266,16 +265,16 @@ void virFirewallFree(virFirewallPtr firewall) rule->args[rule->argsLen++] = g_strdup(str); \ } while (0) -static virFirewallRulePtr -virFirewallAddRuleFullV(virFirewallPtr firewall, +static virFirewallRule * +virFirewallAddRuleFullV(virFirewall *firewall, virFirewallLayer layer, bool ignoreErrors, virFirewallQueryCallback cb, void *opaque, va_list args) { - virFirewallGroupPtr group; - virFirewallRulePtr rule; + virFirewallGroup *group; + virFirewallRule *rule; char *str; VIR_FIREWALL_RETURN_NULL_IF_ERROR(firewall); @@ -348,14 +347,14 @@ virFirewallAddRuleFullV(virFirewallPtr firewall, * * Returns the new rule */ -virFirewallRulePtr virFirewallAddRuleFull(virFirewallPtr firewall, +virFirewallRule *virFirewallAddRuleFull(virFirewall *firewall, virFirewallLayer layer, bool ignoreErrors, virFirewallQueryCallback cb, void *opaque, ...) { - virFirewallRulePtr rule; + virFirewallRule *rule; va_list args; va_start(args, opaque); rule = virFirewallAddRuleFullV(firewall, layer, ignoreErrors, cb, opaque, args); @@ -371,11 +370,11 @@ virFirewallRulePtr virFirewallAddRuleFull(virFirewallPtr firewall, * * Remove a rule from the current transaction */ -void virFirewallRemoveRule(virFirewallPtr firewall, - virFirewallRulePtr rule) +void virFirewallRemoveRule(virFirewall *firewall, + virFirewallRule *rule) { size_t i; - virFirewallGroupPtr group; + virFirewallGroup *group; /* Explicitly not checking firewall->err too, * because if rule was partially created @@ -413,8 +412,8 @@ void virFirewallRemoveRule(virFirewallPtr firewall, } -void virFirewallRuleAddArg(virFirewallPtr firewall, - virFirewallRulePtr rule, +void virFirewallRuleAddArg(virFirewall *firewall, + virFirewallRule *rule, const char *arg) { VIR_FIREWALL_RULE_RETURN_IF_ERROR(firewall, rule); @@ -425,8 +424,8 @@ void virFirewallRuleAddArg(virFirewallPtr firewall, } -void virFirewallRuleAddArgFormat(virFirewallPtr firewall, - virFirewallRulePtr rule, +void virFirewallRuleAddArgFormat(virFirewall *firewall, + virFirewallRule *rule, const char *fmt, ...) { g_autofree char *arg = NULL; @@ -444,8 +443,8 @@ void virFirewallRuleAddArgFormat(virFirewallPtr firewall, } -void virFirewallRuleAddArgSet(virFirewallPtr firewall, - virFirewallRulePtr rule, +void virFirewallRuleAddArgSet(virFirewall *firewall, + virFirewallRule *rule, const char *const *args) { VIR_FIREWALL_RULE_RETURN_IF_ERROR(firewall, rule); @@ -459,8 +458,8 @@ void virFirewallRuleAddArgSet(virFirewallPtr firewall, } -void virFirewallRuleAddArgList(virFirewallPtr firewall, - virFirewallRulePtr rule, +void virFirewallRuleAddArgList(virFirewall *firewall, + virFirewallRule *rule, ...) { va_list list; @@ -479,7 +478,7 @@ void virFirewallRuleAddArgList(virFirewallPtr firewall, } -size_t virFirewallRuleGetArgCount(virFirewallRulePtr rule) +size_t virFirewallRuleGetArgCount(virFirewallRule *rule) { if (!rule) return 0; @@ -500,10 +499,10 @@ size_t virFirewallRuleGetArgCount(virFirewallRulePtr rule) * be used to provide rules to rollback upon transaction * failure */ -void virFirewallStartTransaction(virFirewallPtr firewall, +void virFirewallStartTransaction(virFirewall *firewall, unsigned int flags) { - virFirewallGroupPtr group; + virFirewallGroup *group; VIR_FIREWALL_RETURN_IF_ERROR(firewall); @@ -528,10 +527,10 @@ void virFirewallStartTransaction(virFirewallPtr firewall, * should be used to indicate the beginning of the next * transactional ruleset. */ -void virFirewallStartRollback(virFirewallPtr firewall, +void virFirewallStartRollback(virFirewall *firewall, unsigned int flags) { - virFirewallGroupPtr group; + virFirewallGroup *group; VIR_FIREWALL_RETURN_IF_ERROR(firewall); @@ -547,7 +546,7 @@ void virFirewallStartRollback(virFirewallPtr firewall, static char * -virFirewallRuleToString(virFirewallRulePtr rule) +virFirewallRuleToString(virFirewallRule *rule) { const char *bin = virFirewallLayerCommandTypeToString(rule->layer); g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -563,7 +562,7 @@ virFirewallRuleToString(virFirewallRulePtr rule) } static int -virFirewallApplyRuleDirect(virFirewallRulePtr rule, +virFirewallApplyRuleDirect(virFirewallRule *rule, bool ignoreErrors, char **output) { @@ -609,7 +608,7 @@ virFirewallApplyRuleDirect(virFirewallRulePtr rule, static int G_GNUC_UNUSED -virFirewallApplyRuleFirewallD(virFirewallRulePtr rule, +virFirewallApplyRuleFirewallD(virFirewallRule *rule, bool ignoreErrors, char **output) { @@ -648,8 +647,8 @@ virFirewallBackendSynchronize(void) static int -virFirewallApplyRule(virFirewallPtr firewall, - virFirewallRulePtr rule, +virFirewallApplyRule(virFirewall *firewall, + virFirewallRule *rule, bool ignoreErrors) { g_autofree char *output = NULL; @@ -706,10 +705,10 @@ virFirewallApplyRule(virFirewallPtr firewall, } static int -virFirewallApplyGroup(virFirewallPtr firewall, +virFirewallApplyGroup(virFirewall *firewall, size_t idx) { - virFirewallGroupPtr group = firewall->groups[idx]; + virFirewallGroup *group = firewall->groups[idx]; bool ignoreErrors = (group->actionFlags & VIR_FIREWALL_TRANSACTION_IGNORE_ERRORS); size_t i; @@ -728,10 +727,10 @@ virFirewallApplyGroup(virFirewallPtr firewall, static void -virFirewallRollbackGroup(virFirewallPtr firewall, +virFirewallRollbackGroup(virFirewall *firewall, size_t idx) { - virFirewallGroupPtr group = firewall->groups[idx]; + virFirewallGroup *group = firewall->groups[idx]; size_t i; VIR_INFO("Starting rollback for group %p", group); @@ -746,7 +745,7 @@ virFirewallRollbackGroup(virFirewallPtr firewall, int -virFirewallApply(virFirewallPtr firewall) +virFirewallApply(virFirewall *firewall) { size_t i, j; int ret = -1; diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h index 3db0864380..169d99fe2b 100644 --- a/src/util/virfirewall.h +++ b/src/util/virfirewall.h @@ -23,10 +23,8 @@ #include "internal.h" typedef struct _virFirewall virFirewall; -typedef virFirewall *virFirewallPtr; typedef struct _virFirewallRule virFirewallRule; -typedef virFirewallRule *virFirewallRulePtr; typedef enum { VIR_FIREWALL_LAYER_ETHERNET, @@ -36,9 +34,9 @@ typedef enum { VIR_FIREWALL_LAYER_LAST, } virFirewallLayer; -virFirewallPtr virFirewallNew(void); +virFirewall *virFirewallNew(void); -void virFirewallFree(virFirewallPtr firewall); +void virFirewallFree(virFirewall *firewall); /** * virFirewallAddRule: @@ -53,12 +51,12 @@ void virFirewallFree(virFirewallPtr firewall); #define virFirewallAddRule(firewall, layer, ...) \ virFirewallAddRuleFull(firewall, layer, false, NULL, NULL, __VA_ARGS__) -typedef int (*virFirewallQueryCallback)(virFirewallPtr firewall, +typedef int (*virFirewallQueryCallback)(virFirewall *firewall, virFirewallLayer layer, const char *const *lines, void *opaque); -virFirewallRulePtr virFirewallAddRuleFull(virFirewallPtr firewall, +virFirewallRule *virFirewallAddRuleFull(virFirewall *firewall, virFirewallLayer layer, bool ignoreErrors, virFirewallQueryCallback cb, @@ -66,30 +64,30 @@ virFirewallRulePtr virFirewallAddRuleFull(virFirewallPtr firewall, ...) G_GNUC_NULL_TERMINATED; -void virFirewallRemoveRule(virFirewallPtr firewall, - virFirewallRulePtr rule); +void virFirewallRemoveRule(virFirewall *firewall, + virFirewallRule *rule); -void virFirewallRuleAddArg(virFirewallPtr firewall, - virFirewallRulePtr rule, +void virFirewallRuleAddArg(virFirewall *firewall, + virFirewallRule *rule, const char *arg) ATTRIBUTE_NONNULL(3); -void virFirewallRuleAddArgFormat(virFirewallPtr firewall, - virFirewallRulePtr rule, +void virFirewallRuleAddArgFormat(virFirewall *firewall, + virFirewallRule *rule, const char *fmt, ...) ATTRIBUTE_NONNULL(3) G_GNUC_PRINTF(3, 4); -void virFirewallRuleAddArgSet(virFirewallPtr firewall, - virFirewallRulePtr rule, +void virFirewallRuleAddArgSet(virFirewall *firewall, + virFirewallRule *rule, const char *const *args) ATTRIBUTE_NONNULL(3); -void virFirewallRuleAddArgList(virFirewallPtr firewall, - virFirewallRulePtr rule, +void virFirewallRuleAddArgList(virFirewall *firewall, + virFirewallRule *rule, ...) G_GNUC_NULL_TERMINATED; -size_t virFirewallRuleGetArgCount(virFirewallRulePtr rule); +size_t virFirewallRuleGetArgCount(virFirewallRule *rule); typedef enum { /* Ignore all errors when applying rules, so no @@ -97,7 +95,7 @@ typedef enum { VIR_FIREWALL_TRANSACTION_IGNORE_ERRORS = (1 << 0), } virFirewallTransactionFlags; -void virFirewallStartTransaction(virFirewallPtr firewall, +void virFirewallStartTransaction(virFirewall *firewall, unsigned int flags); typedef enum { @@ -106,10 +104,10 @@ typedef enum { VIR_FIREWALL_ROLLBACK_INHERIT_PREVIOUS = (1 << 0), } virFirewallRollbackFlags; -void virFirewallStartRollback(virFirewallPtr firewall, +void virFirewallStartRollback(virFirewall *firewall, unsigned int flags); -int virFirewallApply(virFirewallPtr firewall); +int virFirewallApply(virFirewall *firewall); void virFirewallBackendSynchronize(void); diff --git a/src/util/virfirmware.c b/src/util/virfirmware.c index c0ffcb4392..258d13bb73 100644 --- a/src/util/virfirmware.c +++ b/src/util/virfirmware.c @@ -32,7 +32,7 @@ VIR_LOG_INIT("util.firmware"); void -virFirmwareFree(virFirmwarePtr firmware) +virFirmwareFree(virFirmware *firmware) { if (!firmware) return; @@ -44,7 +44,7 @@ virFirmwareFree(virFirmwarePtr firmware) void -virFirmwareFreeList(virFirmwarePtr *firmwares, size_t nfirmwares) +virFirmwareFreeList(virFirmware **firmwares, size_t nfirmwares) { size_t i; @@ -56,7 +56,7 @@ virFirmwareFreeList(virFirmwarePtr *firmwares, size_t nfirmwares) int -virFirmwareParse(const char *str, virFirmwarePtr firmware) +virFirmwareParse(const char *str, virFirmware *firmware) { int ret = -1; char **token; @@ -91,7 +91,7 @@ virFirmwareParse(const char *str, virFirmwarePtr firmware) int virFirmwareParseList(const char *list, - virFirmwarePtr **firmwares, + virFirmware ***firmwares, size_t *nfirmwares) { int ret = -1; @@ -112,11 +112,11 @@ virFirmwareParseList(const char *list, } if (i) { - *firmwares = g_new0(virFirmwarePtr, i / 2); + *firmwares = g_new0(virFirmware *, i / 2); *nfirmwares = i / 2; for (j = 0; j < i / 2; j++) { - virFirmwarePtr *fws = *firmwares; + virFirmware **fws = *firmwares; fws[j] = g_new0(virFirmware, 1); fws[j]->name = g_strdup(token[2 * j]); diff --git a/src/util/virfirmware.h b/src/util/virfirmware.h index 20bb850500..7c9b078b7c 100644 --- a/src/util/virfirmware.h +++ b/src/util/virfirmware.h @@ -23,8 +23,6 @@ #include "internal.h" typedef struct _virFirmware virFirmware; -typedef virFirmware *virFirmwarePtr; - struct _virFirmware { char *name; char *nvram; @@ -32,19 +30,19 @@ struct _virFirmware { void -virFirmwareFree(virFirmwarePtr firmware); +virFirmwareFree(virFirmware *firmware); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virFirmware, virFirmwareFree); void -virFirmwareFreeList(virFirmwarePtr *firmwares, size_t nfirmwares); +virFirmwareFreeList(virFirmware **firmwares, size_t nfirmwares); int -virFirmwareParse(const char *str, virFirmwarePtr firmware) +virFirmwareParse(const char *str, virFirmware *firmware) ATTRIBUTE_NONNULL(2); int virFirmwareParseList(const char *list, - virFirmwarePtr **firmwares, + virFirmware ***firmwares, size_t *nfirmwares) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3); diff --git a/src/util/virgic.h b/src/util/virgic.h index 08838a619c..1c469f20ce 100644 --- a/src/util/virgic.h +++ b/src/util/virgic.h @@ -39,7 +39,6 @@ typedef enum { } virGICImplementation; typedef struct _virGICCapability virGICCapability; -typedef virGICCapability *virGICCapabilityPtr; struct _virGICCapability { virGICVersion version; virGICImplementation implementation; diff --git a/src/util/virhash.c b/src/util/virhash.c index 5d5b6389b5..f6c9d9744d 100644 --- a/src/util/virhash.c +++ b/src/util/virhash.c @@ -36,7 +36,7 @@ struct _virHashAtomic { GHashTable *hash; }; -static virClassPtr virHashAtomicClass; +static virClass *virHashAtomicClass; static void virHashAtomicDispose(void *obj); static int virHashAtomicOnceInit(void) @@ -91,10 +91,10 @@ virHashNew(virHashDataFree dataFree) } -virHashAtomicPtr +virHashAtomic * virHashAtomicNew(virHashDataFree dataFree) { - virHashAtomicPtr hash; + virHashAtomic *hash; if (virHashAtomicInitialize() < 0) return NULL; @@ -113,7 +113,7 @@ virHashAtomicNew(virHashDataFree dataFree) static void virHashAtomicDispose(void *obj) { - virHashAtomicPtr hash = obj; + virHashAtomic *hash = obj; virHashFree(hash->hash); } @@ -198,7 +198,7 @@ virHashUpdateEntry(GHashTable *table, const char *name, } int -virHashAtomicUpdate(virHashAtomicPtr table, +virHashAtomicUpdate(virHashAtomic *table, const char *name, void *userdata) { @@ -287,7 +287,7 @@ void *virHashSteal(GHashTable *table, const char *name) } void * -virHashAtomicSteal(virHashAtomicPtr table, +virHashAtomicSteal(virHashAtomic *table, const char *name) { void *data; @@ -404,7 +404,7 @@ virHashForEachSafe(GHashTable *table, virHashIterator iter, void *opaque) { - g_autofree virHashKeyValuePairPtr items = virHashGetItems(table, NULL, false); + g_autofree virHashKeyValuePair *items = virHashGetItems(table, NULL, false); size_t i; if (!items) @@ -424,7 +424,7 @@ virHashForEachSorted(GHashTable *table, virHashIterator iter, void *opaque) { - g_autofree virHashKeyValuePairPtr items = virHashGetItems(table, NULL, true); + g_autofree virHashKeyValuePair *items = virHashGetItems(table, NULL, true); size_t i; if (!items) @@ -550,7 +550,7 @@ virHashGetItemsKeySorter(const void *va, } -virHashKeyValuePairPtr +virHashKeyValuePair * virHashGetItems(GHashTable *table, size_t *nitems, bool sortKeys) diff --git a/src/util/virhash.h b/src/util/virhash.h index 8b4e844eb4..c2a0681317 100644 --- a/src/util/virhash.h +++ b/src/util/virhash.h @@ -10,7 +10,6 @@ #pragma once typedef struct _virHashAtomic virHashAtomic; -typedef virHashAtomic *virHashAtomicPtr; /* * function types: @@ -52,7 +51,7 @@ typedef int (*virHashSearcher) (const void *payload, const char *name, * Constructor and destructor. */ GHashTable *virHashNew(virHashDataFree dataFree); -virHashAtomicPtr virHashAtomicNew(virHashDataFree dataFree); +virHashAtomic *virHashAtomicNew(virHashDataFree dataFree); void virHashFree(GHashTable *table); ssize_t virHashSize(GHashTable *table); @@ -64,7 +63,7 @@ int virHashAddEntry(GHashTable *table, int virHashUpdateEntry(GHashTable *table, const char *name, void *userdata); -int virHashAtomicUpdate(virHashAtomicPtr table, +int virHashAtomicUpdate(virHashAtomic *table, const char *name, void *userdata); @@ -89,7 +88,7 @@ bool virHashHasEntry(GHashTable *table, const char *name); * Retrieve & remove the userdata. */ void *virHashSteal(GHashTable *table, const char *name); -void *virHashAtomicSteal(virHashAtomicPtr table, +void *virHashAtomicSteal(virHashAtomic *table, const char *name); /* @@ -105,12 +104,11 @@ void *virHashAtomicSteal(virHashAtomicPtr table, * to be used somewhere else. */ typedef struct _virHashKeyValuePair virHashKeyValuePair; -typedef virHashKeyValuePair *virHashKeyValuePairPtr; struct _virHashKeyValuePair { const void *key; const void *value; }; -virHashKeyValuePairPtr virHashGetItems(GHashTable *table, +virHashKeyValuePair *virHashGetItems(GHashTable *table, size_t *nitems, bool sortedKeys); diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c index 2446948bc1..bf7fda23af 100644 --- a/src/util/virhostcpu.c +++ b/src/util/virhostcpu.c @@ -253,10 +253,10 @@ virHostCPUGetCore(unsigned int cpu, unsigned int *core) return 0; } -virBitmapPtr +virBitmap * virHostCPUGetSiblingsList(unsigned int cpu) { - virBitmapPtr ret = NULL; + virBitmap *ret = NULL; int rv = -1; rv = virFileReadValueBitmap(&ret, @@ -274,7 +274,7 @@ virHostCPUGetSiblingsList(unsigned int cpu) static unsigned long virHostCPUCountThreadSiblings(unsigned int cpu) { - virBitmapPtr siblings_map; + virBitmap *siblings_map; unsigned long ret = 0; if (!(siblings_map = virHostCPUGetSiblingsList(cpu))) @@ -296,8 +296,8 @@ ATTRIBUTE_NONNULL(7) ATTRIBUTE_NONNULL(8) ATTRIBUTE_NONNULL(9) virHostCPUParseNode(const char *node, virArch arch, - virBitmapPtr present_cpus_map, - virBitmapPtr online_cpus_map, + virBitmap *present_cpus_map, + virBitmap *online_cpus_map, int threads_per_subcore, int *sockets, int *cores, @@ -308,9 +308,9 @@ virHostCPUParseNode(const char *node, int processors = 0; g_autoptr(DIR) cpudir = NULL; struct dirent *cpudirent = NULL; - virBitmapPtr node_cpus_map = NULL; - virBitmapPtr sockets_map = NULL; - virBitmapPtr *cores_maps = NULL; + virBitmap *node_cpus_map = NULL; + virBitmap *sockets_map = NULL; + virBitmap **cores_maps = NULL; int npresent_cpus = virBitmapSize(present_cpus_map); unsigned int sock_max = 0; unsigned int sock; @@ -363,7 +363,7 @@ virHostCPUParseNode(const char *node, sock_max++; /* allocate cores maps for each socket */ - cores_maps = g_new0(virBitmapPtr, sock_max); + cores_maps = g_new0(virBitmap *, sock_max); for (i = 0; i < sock_max; i++) cores_maps[i] = virBitmapNew(0); @@ -458,7 +458,7 @@ virHostCPUParseNode(const char *node, static bool virHostCPUHasValidSubcoreConfiguration(int threads_per_subcore) { - virBitmapPtr online_cpus = NULL; + virBitmap *online_cpus = NULL; int cpu = -1; bool ret = false; @@ -606,8 +606,8 @@ virHostCPUGetInfoPopulateLinux(FILE *cpuinfo, unsigned int *cores, unsigned int *threads) { - virBitmapPtr present_cpus_map = NULL; - virBitmapPtr online_cpus_map = NULL; + virBitmap *present_cpus_map = NULL; + virBitmap *online_cpus_map = NULL; g_autoptr(DIR) nodedir = NULL; struct dirent *nodedirent = NULL; int nodecpus, nodecores, nodesockets, nodethreads, offline = 0; @@ -1027,11 +1027,11 @@ virHostCPUHasBitmap(void) #endif } -virBitmapPtr +virBitmap * virHostCPUGetPresentBitmap(void) { #ifdef __linux__ - virBitmapPtr ret = NULL; + virBitmap *ret = NULL; virFileReadValueBitmap(&ret, "%s/cpu/present", SYSFS_SYSTEM_PATH); @@ -1043,11 +1043,11 @@ virHostCPUGetPresentBitmap(void) #endif } -virBitmapPtr +virBitmap * virHostCPUGetOnlineBitmap(void) { #ifdef __linux__ - virBitmapPtr ret = NULL; + virBitmap *ret = NULL; virFileReadValueBitmap(&ret, "%s/cpu/online", SYSFS_SYSTEM_PATH); @@ -1100,7 +1100,7 @@ virHostCPUGetMap(unsigned char **cpumap, * the caller having to handle it outside the function, returns * a virBitmap with all the possible CPUs in the host, up to * virHostCPUGetCount(). */ -virBitmapPtr +virBitmap * virHostCPUGetAvailableCPUsBitmap(void) { g_autoptr(virBitmap) bitmap = NULL; @@ -1346,10 +1346,10 @@ virHostCPUGetMSR(unsigned long index, * Returns pointer to the TSC info structure on success, * NULL when TSC cannot be probed otherwise. */ -virHostCPUTscInfoPtr +virHostCPUTscInfo * virHostCPUGetTscInfo(void) { - virHostCPUTscInfoPtr info; + virHostCPUTscInfo *info; VIR_AUTOCLOSE kvmFd = -1; VIR_AUTOCLOSE vmFd = -1; VIR_AUTOCLOSE vcpuFd = -1; @@ -1408,7 +1408,7 @@ virHostCPUGetMSR(unsigned long index G_GNUC_UNUSED, return -1; } -virHostCPUTscInfoPtr +virHostCPUTscInfo * virHostCPUGetTscInfo(void) { virReportSystemError(ENOSYS, "%s", diff --git a/src/util/virhostcpu.h b/src/util/virhostcpu.h index 6148f9e66f..fc717250d9 100644 --- a/src/util/virhostcpu.h +++ b/src/util/virhostcpu.h @@ -28,7 +28,6 @@ typedef struct _virHostCPUTscInfo virHostCPUTscInfo; -typedef virHostCPUTscInfo *virHostCPUTscInfoPtr; struct _virHostCPUTscInfo { unsigned long long frequency; virTristateBool scaling; @@ -41,9 +40,9 @@ int virHostCPUGetStats(int cpuNum, unsigned int flags); bool virHostCPUHasBitmap(void); -virBitmapPtr virHostCPUGetPresentBitmap(void); -virBitmapPtr virHostCPUGetOnlineBitmap(void); -virBitmapPtr virHostCPUGetAvailableCPUsBitmap(void); +virBitmap *virHostCPUGetPresentBitmap(void); +virBitmap *virHostCPUGetOnlineBitmap(void); +virBitmap *virHostCPUGetAvailableCPUsBitmap(void); int virHostCPUGetCount(void); int virHostCPUGetThreadsPerSubcore(virArch arch) G_GNUC_NO_INLINE; @@ -70,7 +69,7 @@ int virHostCPUGetSocket(unsigned int cpu, unsigned int *socket); int virHostCPUGetDie(unsigned int cpu, unsigned int *die); int virHostCPUGetCore(unsigned int cpu, unsigned int *core); -virBitmapPtr virHostCPUGetSiblingsList(unsigned int cpu); +virBitmap *virHostCPUGetSiblingsList(unsigned int cpu); #endif int virHostCPUGetOnline(unsigned int cpu, bool *online); @@ -81,6 +80,6 @@ virHostCPUGetMicrocodeVersion(virArch hostArch) G_GNUC_NO_INLINE; int virHostCPUGetMSR(unsigned long index, uint64_t *msr); -virHostCPUTscInfoPtr virHostCPUGetTscInfo(void); +virHostCPUTscInfo *virHostCPUGetTscInfo(void); int virHostCPUGetSignature(char **signature); diff --git a/src/util/viridentity.c b/src/util/viridentity.c index 2cb9042a84..7edb6a171a 100644 --- a/src/util/viridentity.c +++ b/src/util/viridentity.c @@ -97,9 +97,9 @@ static void vir_identity_class_init(virIdentityClass *klass) * * Returns: a reference to the current identity, or NULL */ -virIdentityPtr virIdentityGetCurrent(void) +virIdentity *virIdentityGetCurrent(void) { - virIdentityPtr ident; + virIdentity *ident; if (virIdentityInitialize() < 0) return NULL; @@ -120,7 +120,7 @@ virIdentityPtr virIdentityGetCurrent(void) * * Returns 0 on success, or -1 on error */ -int virIdentitySetCurrent(virIdentityPtr ident) +int virIdentitySetCurrent(virIdentity *ident) { g_autoptr(virIdentity) old = NULL; @@ -150,7 +150,7 @@ int virIdentitySetCurrent(virIdentityPtr ident) * * Returns a reference to the system identity, or NULL */ -virIdentityPtr virIdentityGetSystem(void) +virIdentity *virIdentityGetSystem(void) { g_autofree char *username = NULL; g_autofree char *groupname = NULL; @@ -213,7 +213,7 @@ virIdentityPtr virIdentityGetSystem(void) * * Returns: a new empty identity */ -virIdentityPtr virIdentityNew(void) +virIdentity *virIdentityNew(void) { return VIR_IDENTITY(g_object_new(VIR_TYPE_IDENTITY, NULL)); } @@ -221,7 +221,7 @@ virIdentityPtr virIdentityNew(void) static void virIdentityFinalize(GObject *object) { - virIdentityPtr ident = VIR_IDENTITY(object); + virIdentity *ident = VIR_IDENTITY(object); virTypedParamsFree(ident->params, ident->nparams); @@ -232,7 +232,7 @@ static void virIdentityFinalize(GObject *object) /* * Returns: 0 if not present, 1 if present, -1 on error */ -int virIdentityGetUserName(virIdentityPtr ident, +int virIdentityGetUserName(virIdentity *ident, const char **username) { *username = NULL; @@ -246,7 +246,7 @@ int virIdentityGetUserName(virIdentityPtr ident, /* * Returns: 0 if not present, 1 if present, -1 on error */ -int virIdentityGetUNIXUserID(virIdentityPtr ident, +int virIdentityGetUNIXUserID(virIdentity *ident, uid_t *uid) { unsigned long long val; @@ -269,7 +269,7 @@ int virIdentityGetUNIXUserID(virIdentityPtr ident, /* * Returns: 0 if not present, 1 if present, -1 on error */ -int virIdentityGetGroupName(virIdentityPtr ident, +int virIdentityGetGroupName(virIdentity *ident, const char **groupname) { *groupname = NULL; @@ -283,7 +283,7 @@ int virIdentityGetGroupName(virIdentityPtr ident, /* * Returns: 0 if not present, 1 if present, -1 on error */ -int virIdentityGetUNIXGroupID(virIdentityPtr ident, +int virIdentityGetUNIXGroupID(virIdentity *ident, gid_t *gid) { unsigned long long val; @@ -306,7 +306,7 @@ int virIdentityGetUNIXGroupID(virIdentityPtr ident, /* * Returns: 0 if not present, 1 if present, -1 on error */ -int virIdentityGetProcessID(virIdentityPtr ident, +int virIdentityGetProcessID(virIdentity *ident, pid_t *pid) { long long val; @@ -329,7 +329,7 @@ int virIdentityGetProcessID(virIdentityPtr ident, /* * Returns: 0 if not present, 1 if present, -1 on error */ -int virIdentityGetProcessTime(virIdentityPtr ident, +int virIdentityGetProcessTime(virIdentity *ident, unsigned long long *timestamp) { *timestamp = 0; @@ -343,7 +343,7 @@ int virIdentityGetProcessTime(virIdentityPtr ident, /* * Returns: 0 if not present, 1 if present, -1 on error */ -int virIdentityGetSASLUserName(virIdentityPtr ident, +int virIdentityGetSASLUserName(virIdentity *ident, const char **username) { *username = NULL; @@ -357,7 +357,7 @@ int virIdentityGetSASLUserName(virIdentityPtr ident, /* * Returns: 0 if not present, 1 if present, -1 on error */ -int virIdentityGetX509DName(virIdentityPtr ident, +int virIdentityGetX509DName(virIdentity *ident, const char **dname) { *dname = NULL; @@ -371,7 +371,7 @@ int virIdentityGetX509DName(virIdentityPtr ident, /* * Returns: 0 if not present, 1 if present, -1 on error */ -int virIdentityGetSELinuxContext(virIdentityPtr ident, +int virIdentityGetSELinuxContext(virIdentity *ident, const char **context) { *context = NULL; @@ -382,7 +382,7 @@ int virIdentityGetSELinuxContext(virIdentityPtr ident, } -int virIdentitySetUserName(virIdentityPtr ident, +int virIdentitySetUserName(virIdentity *ident, const char *username) { if (virTypedParamsGet(ident->params, @@ -401,7 +401,7 @@ int virIdentitySetUserName(virIdentityPtr ident, } -int virIdentitySetUNIXUserID(virIdentityPtr ident, +int virIdentitySetUNIXUserID(virIdentity *ident, uid_t uid) { if (virTypedParamsGet(ident->params, @@ -420,7 +420,7 @@ int virIdentitySetUNIXUserID(virIdentityPtr ident, } -int virIdentitySetGroupName(virIdentityPtr ident, +int virIdentitySetGroupName(virIdentity *ident, const char *groupname) { if (virTypedParamsGet(ident->params, @@ -439,7 +439,7 @@ int virIdentitySetGroupName(virIdentityPtr ident, } -int virIdentitySetUNIXGroupID(virIdentityPtr ident, +int virIdentitySetUNIXGroupID(virIdentity *ident, gid_t gid) { if (virTypedParamsGet(ident->params, @@ -458,7 +458,7 @@ int virIdentitySetUNIXGroupID(virIdentityPtr ident, } -int virIdentitySetProcessID(virIdentityPtr ident, +int virIdentitySetProcessID(virIdentity *ident, pid_t pid) { if (virTypedParamsGet(ident->params, @@ -477,7 +477,7 @@ int virIdentitySetProcessID(virIdentityPtr ident, } -int virIdentitySetProcessTime(virIdentityPtr ident, +int virIdentitySetProcessTime(virIdentity *ident, unsigned long long timestamp) { if (virTypedParamsGet(ident->params, @@ -497,7 +497,7 @@ int virIdentitySetProcessTime(virIdentityPtr ident, -int virIdentitySetSASLUserName(virIdentityPtr ident, +int virIdentitySetSASLUserName(virIdentity *ident, const char *username) { if (virTypedParamsGet(ident->params, @@ -516,7 +516,7 @@ int virIdentitySetSASLUserName(virIdentityPtr ident, } -int virIdentitySetX509DName(virIdentityPtr ident, +int virIdentitySetX509DName(virIdentity *ident, const char *dname) { if (virTypedParamsGet(ident->params, @@ -535,7 +535,7 @@ int virIdentitySetX509DName(virIdentityPtr ident, } -int virIdentitySetSELinuxContext(virIdentityPtr ident, +int virIdentitySetSELinuxContext(virIdentity *ident, const char *context) { if (virTypedParamsGet(ident->params, @@ -554,7 +554,7 @@ int virIdentitySetSELinuxContext(virIdentityPtr ident, } -int virIdentitySetParameters(virIdentityPtr ident, +int virIdentitySetParameters(virIdentity *ident, virTypedParameterPtr params, int nparams) { @@ -593,7 +593,7 @@ int virIdentitySetParameters(virIdentityPtr ident, } -int virIdentityGetParameters(virIdentityPtr ident, +int virIdentityGetParameters(virIdentity *ident, virTypedParameterPtr *params, int *nparams) { diff --git a/src/util/viridentity.h b/src/util/viridentity.h index 2940e02054..fa3f46788c 100644 --- a/src/util/viridentity.h +++ b/src/util/viridentity.h @@ -27,58 +27,56 @@ #define VIR_TYPE_IDENTITY vir_identity_get_type() G_DECLARE_FINAL_TYPE(virIdentity, vir_identity, VIR, IDENTITY, GObject); -typedef virIdentity *virIdentityPtr; +virIdentity *virIdentityGetCurrent(void); +int virIdentitySetCurrent(virIdentity *ident); -virIdentityPtr virIdentityGetCurrent(void); -int virIdentitySetCurrent(virIdentityPtr ident); +virIdentity *virIdentityGetSystem(void); -virIdentityPtr virIdentityGetSystem(void); +virIdentity *virIdentityNew(void); -virIdentityPtr virIdentityNew(void); - -int virIdentityGetUserName(virIdentityPtr ident, +int virIdentityGetUserName(virIdentity *ident, const char **username); -int virIdentityGetUNIXUserID(virIdentityPtr ident, +int virIdentityGetUNIXUserID(virIdentity *ident, uid_t *uid); -int virIdentityGetGroupName(virIdentityPtr ident, +int virIdentityGetGroupName(virIdentity *ident, const char **groupname); -int virIdentityGetUNIXGroupID(virIdentityPtr ident, +int virIdentityGetUNIXGroupID(virIdentity *ident, gid_t *gid); -int virIdentityGetProcessID(virIdentityPtr ident, +int virIdentityGetProcessID(virIdentity *ident, pid_t *pid); -int virIdentityGetProcessTime(virIdentityPtr ident, +int virIdentityGetProcessTime(virIdentity *ident, unsigned long long *timestamp); -int virIdentityGetSASLUserName(virIdentityPtr ident, +int virIdentityGetSASLUserName(virIdentity *ident, const char **username); -int virIdentityGetX509DName(virIdentityPtr ident, +int virIdentityGetX509DName(virIdentity *ident, const char **dname); -int virIdentityGetSELinuxContext(virIdentityPtr ident, +int virIdentityGetSELinuxContext(virIdentity *ident, const char **context); -int virIdentitySetUserName(virIdentityPtr ident, +int virIdentitySetUserName(virIdentity *ident, const char *username); -int virIdentitySetUNIXUserID(virIdentityPtr ident, +int virIdentitySetUNIXUserID(virIdentity *ident, uid_t uid); -int virIdentitySetGroupName(virIdentityPtr ident, +int virIdentitySetGroupName(virIdentity *ident, const char *groupname); -int virIdentitySetUNIXGroupID(virIdentityPtr ident, +int virIdentitySetUNIXGroupID(virIdentity *ident, gid_t gid); -int virIdentitySetProcessID(virIdentityPtr ident, +int virIdentitySetProcessID(virIdentity *ident, pid_t pid); -int virIdentitySetProcessTime(virIdentityPtr ident, +int virIdentitySetProcessTime(virIdentity *ident, unsigned long long timestamp); -int virIdentitySetSASLUserName(virIdentityPtr ident, +int virIdentitySetSASLUserName(virIdentity *ident, const char *username); -int virIdentitySetX509DName(virIdentityPtr ident, +int virIdentitySetX509DName(virIdentity *ident, const char *dname); -int virIdentitySetSELinuxContext(virIdentityPtr ident, +int virIdentitySetSELinuxContext(virIdentity *ident, const char *context); -int virIdentitySetParameters(virIdentityPtr ident, +int virIdentitySetParameters(virIdentity *ident, virTypedParameterPtr params, int nparams); -int virIdentityGetParameters(virIdentityPtr ident, +int virIdentityGetParameters(virIdentity *ident, virTypedParameterPtr *params, int *nparams); diff --git a/src/util/viriptables.c b/src/util/viriptables.c index 5fbb77fd5b..4189578245 100644 --- a/src/util/viriptables.c +++ b/src/util/viriptables.c @@ -64,7 +64,7 @@ typedef struct { static int -iptablesPrivateChainCreate(virFirewallPtr fw, +iptablesPrivateChainCreate(virFirewall *fw, virFirewallLayer layer, const char *const *lines, void *opaque) @@ -180,7 +180,7 @@ iptablesSetDeletePrivate(bool pvt) static void -iptablesInput(virFirewallPtr fw, +iptablesInput(virFirewall *fw, virFirewallLayer layer, bool pvt, const char *iface, @@ -205,7 +205,7 @@ iptablesInput(virFirewallPtr fw, } static void -iptablesOutput(virFirewallPtr fw, +iptablesOutput(virFirewall *fw, virFirewallLayer layer, bool pvt, const char *iface, @@ -239,7 +239,7 @@ iptablesOutput(virFirewallPtr fw, * the given @iface interface for TCP packets */ void -iptablesAddTcpInput(virFirewallPtr fw, +iptablesAddTcpInput(virFirewall *fw, virFirewallLayer layer, const char *iface, int port) @@ -257,7 +257,7 @@ iptablesAddTcpInput(virFirewallPtr fw, * @port on the given @iface interface for TCP packets */ void -iptablesRemoveTcpInput(virFirewallPtr fw, +iptablesRemoveTcpInput(virFirewall *fw, virFirewallLayer layer, const char *iface, int port) @@ -275,7 +275,7 @@ iptablesRemoveTcpInput(virFirewallPtr fw, * the given @iface interface for UDP packets */ void -iptablesAddUdpInput(virFirewallPtr fw, +iptablesAddUdpInput(virFirewall *fw, virFirewallLayer layer, const char *iface, int port) @@ -293,7 +293,7 @@ iptablesAddUdpInput(virFirewallPtr fw, * @port on the given @iface interface for UDP packets */ void -iptablesRemoveUdpInput(virFirewallPtr fw, +iptablesRemoveUdpInput(virFirewall *fw, virFirewallLayer layer, const char *iface, int port) @@ -311,7 +311,7 @@ iptablesRemoveUdpInput(virFirewallPtr fw, * the given @iface interface for TCP packets */ void -iptablesAddTcpOutput(virFirewallPtr fw, +iptablesAddTcpOutput(virFirewall *fw, virFirewallLayer layer, const char *iface, int port) @@ -329,7 +329,7 @@ iptablesAddTcpOutput(virFirewallPtr fw, * @port from the given @iface interface for TCP packets */ void -iptablesRemoveTcpOutput(virFirewallPtr fw, +iptablesRemoveTcpOutput(virFirewall *fw, virFirewallLayer layer, const char *iface, int port) @@ -347,7 +347,7 @@ iptablesRemoveTcpOutput(virFirewallPtr fw, * the given @iface interface for UDP packets */ void -iptablesAddUdpOutput(virFirewallPtr fw, +iptablesAddUdpOutput(virFirewall *fw, virFirewallLayer layer, const char *iface, int port) @@ -365,7 +365,7 @@ iptablesAddUdpOutput(virFirewallPtr fw, * @port from the given @iface interface for UDP packets */ void -iptablesRemoveUdpOutput(virFirewallPtr fw, +iptablesRemoveUdpOutput(virFirewall *fw, virFirewallLayer layer, const char *iface, int port) @@ -409,7 +409,7 @@ static char *iptablesFormatNetwork(virSocketAddr *netaddr, * to proceed to WAN */ static int -iptablesForwardAllowOut(virFirewallPtr fw, +iptablesForwardAllowOut(virFirewall *fw, bool pvt, virSocketAddr *netaddr, unsigned int prefix, @@ -461,7 +461,7 @@ iptablesForwardAllowOut(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ int -iptablesAddForwardAllowOut(virFirewallPtr fw, +iptablesAddForwardAllowOut(virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, @@ -484,7 +484,7 @@ iptablesAddForwardAllowOut(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ int -iptablesRemoveForwardAllowOut(virFirewallPtr fw, +iptablesRemoveForwardAllowOut(virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, @@ -498,7 +498,7 @@ iptablesRemoveForwardAllowOut(virFirewallPtr fw, * and associated with an existing connection */ static int -iptablesForwardAllowRelatedIn(virFirewallPtr fw, +iptablesForwardAllowRelatedIn(virFirewall *fw, bool pvt, virSocketAddr *netaddr, unsigned int prefix, @@ -554,7 +554,7 @@ iptablesForwardAllowRelatedIn(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ int -iptablesAddForwardAllowRelatedIn(virFirewallPtr fw, +iptablesAddForwardAllowRelatedIn(virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, @@ -577,7 +577,7 @@ iptablesAddForwardAllowRelatedIn(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ int -iptablesRemoveForwardAllowRelatedIn(virFirewallPtr fw, +iptablesRemoveForwardAllowRelatedIn(virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, @@ -589,7 +589,7 @@ iptablesRemoveForwardAllowRelatedIn(virFirewallPtr fw, /* Allow all traffic destined to the bridge, with a valid network address */ static int -iptablesForwardAllowIn(virFirewallPtr fw, +iptablesForwardAllowIn(virFirewall *fw, bool pvt, virSocketAddr *netaddr, unsigned int prefix, @@ -640,7 +640,7 @@ iptablesForwardAllowIn(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ int -iptablesAddForwardAllowIn(virFirewallPtr fw, +iptablesAddForwardAllowIn(virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, @@ -663,7 +663,7 @@ iptablesAddForwardAllowIn(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ int -iptablesRemoveForwardAllowIn(virFirewallPtr fw, +iptablesRemoveForwardAllowIn(virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, @@ -673,7 +673,7 @@ iptablesRemoveForwardAllowIn(virFirewallPtr fw, } static void -iptablesForwardAllowCross(virFirewallPtr fw, +iptablesForwardAllowCross(virFirewall *fw, virFirewallLayer layer, bool pvt, const char *iface, @@ -701,7 +701,7 @@ iptablesForwardAllowCross(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ void -iptablesAddForwardAllowCross(virFirewallPtr fw, +iptablesAddForwardAllowCross(virFirewall *fw, virFirewallLayer layer, const char *iface) { @@ -720,7 +720,7 @@ iptablesAddForwardAllowCross(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ void -iptablesRemoveForwardAllowCross(virFirewallPtr fw, +iptablesRemoveForwardAllowCross(virFirewall *fw, virFirewallLayer layer, const char *iface) { @@ -728,7 +728,7 @@ iptablesRemoveForwardAllowCross(virFirewallPtr fw, } static void -iptablesForwardRejectOut(virFirewallPtr fw, +iptablesForwardRejectOut(virFirewall *fw, virFirewallLayer layer, bool pvt, const char *iface, @@ -754,7 +754,7 @@ iptablesForwardRejectOut(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ void -iptablesAddForwardRejectOut(virFirewallPtr fw, +iptablesAddForwardRejectOut(virFirewall *fw, virFirewallLayer layer, const char *iface) { @@ -772,7 +772,7 @@ iptablesAddForwardRejectOut(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ void -iptablesRemoveForwardRejectOut(virFirewallPtr fw, +iptablesRemoveForwardRejectOut(virFirewall *fw, virFirewallLayer layer, const char *iface) { @@ -781,7 +781,7 @@ iptablesRemoveForwardRejectOut(virFirewallPtr fw, static void -iptablesForwardRejectIn(virFirewallPtr fw, +iptablesForwardRejectIn(virFirewall *fw, virFirewallLayer layer, bool pvt, const char *iface, @@ -807,7 +807,7 @@ iptablesForwardRejectIn(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ void -iptablesAddForwardRejectIn(virFirewallPtr fw, +iptablesAddForwardRejectIn(virFirewall *fw, virFirewallLayer layer, const char *iface) { @@ -825,7 +825,7 @@ iptablesAddForwardRejectIn(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ void -iptablesRemoveForwardRejectIn(virFirewallPtr fw, +iptablesRemoveForwardRejectIn(virFirewall *fw, virFirewallLayer layer, const char *iface) { @@ -837,13 +837,13 @@ iptablesRemoveForwardRejectIn(virFirewallPtr fw, * with the bridge */ static int -iptablesForwardMasquerade(virFirewallPtr fw, +iptablesForwardMasquerade(virFirewall *fw, bool pvt, virSocketAddr *netaddr, unsigned int prefix, const char *physdev, - virSocketAddrRangePtr addr, - virPortRangePtr port, + virSocketAddrRange *addr, + virPortRange *port, const char *protocol, int action) { @@ -852,7 +852,7 @@ iptablesForwardMasquerade(virFirewallPtr fw, g_autofree char *addrEndStr = NULL; g_autofree char *portRangeStr = NULL; g_autofree char *natRangeStr = NULL; - virFirewallRulePtr rule; + virFirewallRule *rule; int af = VIR_SOCKET_ADDR_FAMILY(netaddr); virFirewallLayer layer = af == AF_INET ? VIR_FIREWALL_LAYER_IPV4 : VIR_FIREWALL_LAYER_IPV6; @@ -946,12 +946,12 @@ iptablesForwardMasquerade(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ int -iptablesAddForwardMasquerade(virFirewallPtr fw, +iptablesAddForwardMasquerade(virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *physdev, - virSocketAddrRangePtr addr, - virPortRangePtr port, + virSocketAddrRange *addr, + virPortRange *port, const char *protocol) { return iptablesForwardMasquerade(fw, true, netaddr, prefix, @@ -972,12 +972,12 @@ iptablesAddForwardMasquerade(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise */ int -iptablesRemoveForwardMasquerade(virFirewallPtr fw, +iptablesRemoveForwardMasquerade(virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *physdev, - virSocketAddrRangePtr addr, - virPortRangePtr port, + virSocketAddrRange *addr, + virPortRange *port, const char *protocol) { return iptablesForwardMasquerade(fw, deletePrivate, netaddr, prefix, @@ -989,7 +989,7 @@ iptablesRemoveForwardMasquerade(virFirewallPtr fw, * if said traffic targets @destaddr. */ static int -iptablesForwardDontMasquerade(virFirewallPtr fw, +iptablesForwardDontMasquerade(virFirewall *fw, bool pvt, virSocketAddr *netaddr, unsigned int prefix, @@ -1042,7 +1042,7 @@ iptablesForwardDontMasquerade(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise. */ int -iptablesAddDontMasquerade(virFirewallPtr fw, +iptablesAddDontMasquerade(virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *physdev, @@ -1067,7 +1067,7 @@ iptablesAddDontMasquerade(virFirewallPtr fw, * Returns 0 in case of success or an error code otherwise. */ int -iptablesRemoveDontMasquerade(virFirewallPtr fw, +iptablesRemoveDontMasquerade(virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *physdev, @@ -1079,7 +1079,7 @@ iptablesRemoveDontMasquerade(virFirewallPtr fw, static void -iptablesOutputFixUdpChecksum(virFirewallPtr fw, +iptablesOutputFixUdpChecksum(virFirewall *fw, bool pvt, const char *iface, int port, @@ -1113,7 +1113,7 @@ iptablesOutputFixUdpChecksum(virFirewallPtr fw, * */ void -iptablesAddOutputFixUdpChecksum(virFirewallPtr fw, +iptablesAddOutputFixUdpChecksum(virFirewall *fw, const char *iface, int port) { @@ -1130,7 +1130,7 @@ iptablesAddOutputFixUdpChecksum(virFirewallPtr fw, * iptablesAddOutputFixUdpChecksum. */ void -iptablesRemoveOutputFixUdpChecksum(virFirewallPtr fw, +iptablesRemoveOutputFixUdpChecksum(virFirewall *fw, const char *iface, int port) { diff --git a/src/util/viriptables.h b/src/util/viriptables.h index c4c6595a2d..41c493d3eb 100644 --- a/src/util/viriptables.h +++ b/src/util/viriptables.h @@ -27,131 +27,131 @@ int iptablesSetupPrivateChains (virFirewallLayer layer); void iptablesSetDeletePrivate (bool pvt); -void iptablesAddTcpInput (virFirewallPtr fw, +void iptablesAddTcpInput (virFirewall *fw, virFirewallLayer layer, const char *iface, int port); -void iptablesRemoveTcpInput (virFirewallPtr fw, +void iptablesRemoveTcpInput (virFirewall *fw, virFirewallLayer layer, const char *iface, int port); -void iptablesAddUdpInput (virFirewallPtr fw, +void iptablesAddUdpInput (virFirewall *fw, virFirewallLayer layer, const char *iface, int port); -void iptablesRemoveUdpInput (virFirewallPtr fw, +void iptablesRemoveUdpInput (virFirewall *fw, virFirewallLayer layer, const char *iface, int port); -void iptablesAddTcpOutput (virFirewallPtr fw, +void iptablesAddTcpOutput (virFirewall *fw, virFirewallLayer layer, const char *iface, int port); -void iptablesRemoveTcpOutput (virFirewallPtr fw, +void iptablesRemoveTcpOutput (virFirewall *fw, virFirewallLayer layer, const char *iface, int port); -void iptablesAddUdpOutput (virFirewallPtr fw, +void iptablesAddUdpOutput (virFirewall *fw, virFirewallLayer layer, const char *iface, int port); -void iptablesRemoveUdpOutput (virFirewallPtr fw, +void iptablesRemoveUdpOutput (virFirewall *fw, virFirewallLayer layer, const char *iface, int port); -int iptablesAddForwardAllowOut (virFirewallPtr fw, +int iptablesAddForwardAllowOut (virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, const char *physdev) G_GNUC_WARN_UNUSED_RESULT; -int iptablesRemoveForwardAllowOut (virFirewallPtr fw, +int iptablesRemoveForwardAllowOut (virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, const char *physdev) G_GNUC_WARN_UNUSED_RESULT; -int iptablesAddForwardAllowRelatedIn(virFirewallPtr fw, +int iptablesAddForwardAllowRelatedIn(virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, const char *physdev) G_GNUC_WARN_UNUSED_RESULT; -int iptablesRemoveForwardAllowRelatedIn(virFirewallPtr fw, +int iptablesRemoveForwardAllowRelatedIn(virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, const char *physdev) G_GNUC_WARN_UNUSED_RESULT; -int iptablesAddForwardAllowIn (virFirewallPtr fw, +int iptablesAddForwardAllowIn (virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, const char *physdev) G_GNUC_WARN_UNUSED_RESULT; -int iptablesRemoveForwardAllowIn (virFirewallPtr fw, +int iptablesRemoveForwardAllowIn (virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *iface, const char *physdev) G_GNUC_WARN_UNUSED_RESULT; -void iptablesAddForwardAllowCross (virFirewallPtr fw, +void iptablesAddForwardAllowCross (virFirewall *fw, virFirewallLayer layer, const char *iface); -void iptablesRemoveForwardAllowCross (virFirewallPtr fw, +void iptablesRemoveForwardAllowCross (virFirewall *fw, virFirewallLayer layer, const char *iface); -void iptablesAddForwardRejectOut (virFirewallPtr fw, +void iptablesAddForwardRejectOut (virFirewall *fw, virFirewallLayer layer, const char *iface); -void iptablesRemoveForwardRejectOut (virFirewallPtr fw, +void iptablesRemoveForwardRejectOut (virFirewall *fw, virFirewallLayer layer, const char *iface); -void iptablesAddForwardRejectIn (virFirewallPtr fw, +void iptablesAddForwardRejectIn (virFirewall *fw, virFirewallLayer layer, const char *iface); -void iptablesRemoveForwardRejectIn (virFirewallPtr fw, +void iptablesRemoveForwardRejectIn (virFirewall *fw, virFirewallLayer layery, const char *iface); -int iptablesAddForwardMasquerade (virFirewallPtr fw, +int iptablesAddForwardMasquerade (virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *physdev, - virSocketAddrRangePtr addr, - virPortRangePtr port, + virSocketAddrRange *addr, + virPortRange *port, const char *protocol) G_GNUC_WARN_UNUSED_RESULT; -int iptablesRemoveForwardMasquerade (virFirewallPtr fw, +int iptablesRemoveForwardMasquerade (virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *physdev, - virSocketAddrRangePtr addr, - virPortRangePtr port, + virSocketAddrRange *addr, + virPortRange *port, const char *protocol) G_GNUC_WARN_UNUSED_RESULT; -int iptablesAddDontMasquerade (virFirewallPtr fw, +int iptablesAddDontMasquerade (virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *physdev, const char *destaddr) G_GNUC_WARN_UNUSED_RESULT; -int iptablesRemoveDontMasquerade (virFirewallPtr fw, +int iptablesRemoveDontMasquerade (virFirewall *fw, virSocketAddr *netaddr, unsigned int prefix, const char *physdev, const char *destaddr) G_GNUC_WARN_UNUSED_RESULT; -void iptablesAddOutputFixUdpChecksum (virFirewallPtr fw, +void iptablesAddOutputFixUdpChecksum (virFirewall *fw, const char *iface, int port); -void iptablesRemoveOutputFixUdpChecksum (virFirewallPtr fw, +void iptablesRemoveOutputFixUdpChecksum (virFirewall *fw, const char *iface, int port); diff --git a/src/util/virjson.c b/src/util/virjson.c index d52b99e11b..b5f553a724 100644 --- a/src/util/virjson.c +++ b/src/util/virjson.c @@ -45,28 +45,25 @@ VIR_LOG_INIT("util.json"); typedef struct _virJSONObject virJSONObject; -typedef virJSONObject *virJSONObjectPtr; typedef struct _virJSONObjectPair virJSONObjectPair; -typedef virJSONObjectPair *virJSONObjectPairPtr; typedef struct _virJSONArray virJSONArray; -typedef virJSONArray *virJSONArrayPtr; struct _virJSONObjectPair { char *key; - virJSONValuePtr value; + virJSONValue *value; }; struct _virJSONObject { size_t npairs; - virJSONObjectPairPtr pairs; + virJSONObjectPair *pairs; }; struct _virJSONArray { size_t nvalues; - virJSONValuePtr *values; + virJSONValue **values; }; struct _virJSONValue { @@ -83,17 +80,15 @@ struct _virJSONValue { typedef struct _virJSONParserState virJSONParserState; -typedef virJSONParserState *virJSONParserStatePtr; struct _virJSONParserState { - virJSONValuePtr value; + virJSONValue *value; char *key; }; typedef struct _virJSONParser virJSONParser; -typedef virJSONParser *virJSONParserPtr; struct _virJSONParser { - virJSONValuePtr head; - virJSONParserStatePtr state; + virJSONValue *head; + virJSONParserState *state; size_t nstate; int wrap; }; @@ -142,8 +137,8 @@ virJSONValueGetType(const virJSONValue *value) * d: double precision floating point number * n: json null value * - * The following two cases take a pointer to a pointer to a virJSONValuePtr. The - * pointer is cleared when the virJSONValuePtr is stolen into the object. + * The following two cases take a pointer to a pointer to a virJSONValue *. The + * pointer is cleared when the virJSONValue *is stolen into the object. * a: json object, must be non-NULL * A: json object, omitted if NULL * @@ -156,7 +151,7 @@ virJSONValueGetType(const virJSONValue *value) * in case of no error but nothing was filled. */ int -virJSONValueObjectAddVArgs(virJSONValuePtr obj, +virJSONValueObjectAddVArgs(virJSONValue *obj, va_list args) { char type; @@ -287,7 +282,7 @@ virJSONValueObjectAddVArgs(virJSONValuePtr obj, case 'A': case 'a': { - virJSONValuePtr *val = va_arg(args, virJSONValuePtr *); + virJSONValue **val = va_arg(args, virJSONValue **); if (!(*val)) { if (type == 'A') @@ -304,7 +299,7 @@ virJSONValueObjectAddVArgs(virJSONValuePtr obj, case 'M': case 'm': { - virBitmapPtr map = va_arg(args, virBitmapPtr); + virBitmap *map = va_arg(args, virBitmap *); g_autoptr(virJSONValue) jsonMap = virJSONValueNewArray(); ssize_t pos = -1; @@ -348,7 +343,7 @@ virJSONValueObjectAddVArgs(virJSONValuePtr obj, int -virJSONValueObjectAdd(virJSONValuePtr obj, ...) +virJSONValueObjectAdd(virJSONValue *obj, ...) { va_list args; int ret; @@ -362,7 +357,7 @@ virJSONValueObjectAdd(virJSONValuePtr obj, ...) int -virJSONValueObjectCreateVArgs(virJSONValuePtr *obj, +virJSONValueObjectCreateVArgs(virJSONValue **obj, va_list args) { int ret; @@ -380,7 +375,7 @@ virJSONValueObjectCreateVArgs(virJSONValuePtr *obj, int -virJSONValueObjectCreate(virJSONValuePtr *obj, ...) +virJSONValueObjectCreate(virJSONValue **obj, ...) { va_list args; int ret; @@ -394,7 +389,7 @@ virJSONValueObjectCreate(virJSONValuePtr *obj, ...) void -virJSONValueFree(virJSONValuePtr value) +virJSONValueFree(virJSONValue *value) { size_t i; if (!value) @@ -435,10 +430,10 @@ virJSONValueHashFree(void *opaque) } -virJSONValuePtr +virJSONValue * virJSONValueNewString(const char *data) { - virJSONValuePtr val; + virJSONValue *val; if (!data) return virJSONValueNewNull(); @@ -452,11 +447,11 @@ virJSONValueNewString(const char *data) } -virJSONValuePtr +virJSONValue * virJSONValueNewStringLen(const char *data, size_t length) { - virJSONValuePtr val; + virJSONValue *val; if (!data) return virJSONValueNewNull(); @@ -477,10 +472,10 @@ virJSONValueNewStringLen(const char *data, * Creates a new virJSONValue of VIR_JSON_TYPE_NUMBER type. Note that this * function takes ownership of @data. */ -static virJSONValuePtr +static virJSONValue * virJSONValueNewNumber(char *data) { - virJSONValuePtr val; + virJSONValue *val; val = g_new0(virJSONValue, 1); @@ -491,35 +486,35 @@ virJSONValueNewNumber(char *data) } -virJSONValuePtr +virJSONValue * virJSONValueNewNumberInt(int data) { return virJSONValueNewNumber(g_strdup_printf("%i", data)); } -virJSONValuePtr +virJSONValue * virJSONValueNewNumberUint(unsigned int data) { return virJSONValueNewNumber(g_strdup_printf("%u", data)); } -virJSONValuePtr +virJSONValue * virJSONValueNewNumberLong(long long data) { return virJSONValueNewNumber(g_strdup_printf("%lld", data)); } -virJSONValuePtr +virJSONValue * virJSONValueNewNumberUlong(unsigned long long data) { return virJSONValueNewNumber(g_strdup_printf("%llu", data)); } -virJSONValuePtr +virJSONValue * virJSONValueNewNumberDouble(double data) { char *str = NULL; @@ -529,10 +524,10 @@ virJSONValueNewNumberDouble(double data) } -virJSONValuePtr +virJSONValue * virJSONValueNewBoolean(int boolean_) { - virJSONValuePtr val; + virJSONValue *val; val = g_new0(virJSONValue, 1); @@ -543,10 +538,10 @@ virJSONValueNewBoolean(int boolean_) } -virJSONValuePtr +virJSONValue * virJSONValueNewNull(void) { - virJSONValuePtr val; + virJSONValue *val; val = g_new0(virJSONValue, 1); @@ -556,10 +551,10 @@ virJSONValueNewNull(void) } -virJSONValuePtr +virJSONValue * virJSONValueNewArray(void) { - virJSONValuePtr val = g_new0(virJSONValue, 1); + virJSONValue *val = g_new0(virJSONValue, 1); val->type = VIR_JSON_TYPE_ARRAY; @@ -567,10 +562,10 @@ virJSONValueNewArray(void) } -virJSONValuePtr +virJSONValue * virJSONValueNewObject(void) { - virJSONValuePtr val = g_new0(virJSONValue, 1); + virJSONValue *val = g_new0(virJSONValue, 1); val->type = VIR_JSON_TYPE_OBJECT; @@ -579,9 +574,9 @@ virJSONValueNewObject(void) static int -virJSONValueObjectInsert(virJSONValuePtr object, +virJSONValueObjectInsert(virJSONValue *object, const char *key, - virJSONValuePtr *value, + virJSONValue **value, bool prepend) { virJSONObjectPair pair = { NULL, *value }; @@ -617,21 +612,21 @@ virJSONValueObjectInsert(virJSONValuePtr object, int -virJSONValueObjectAppend(virJSONValuePtr object, +virJSONValueObjectAppend(virJSONValue *object, const char *key, - virJSONValuePtr *value) + virJSONValue **value) { return virJSONValueObjectInsert(object, key, value, false); } static int -virJSONValueObjectInsertString(virJSONValuePtr object, +virJSONValueObjectInsertString(virJSONValue *object, const char *key, const char *value, bool prepend) { - virJSONValuePtr jvalue = virJSONValueNewString(value); + virJSONValue *jvalue = virJSONValueNewString(value); if (!jvalue) return -1; if (virJSONValueObjectInsert(object, key, &jvalue, prepend) < 0) @@ -641,7 +636,7 @@ virJSONValueObjectInsertString(virJSONValuePtr object, int -virJSONValueObjectAppendString(virJSONValuePtr object, +virJSONValueObjectAppendString(virJSONValue *object, const char *key, const char *value) { @@ -650,7 +645,7 @@ virJSONValueObjectAppendString(virJSONValuePtr object, int -virJSONValueObjectAppendStringPrintf(virJSONValuePtr object, +virJSONValueObjectAppendStringPrintf(virJSONValue *object, const char *key, const char *fmt, ...) @@ -667,7 +662,7 @@ virJSONValueObjectAppendStringPrintf(virJSONValuePtr object, int -virJSONValueObjectPrependString(virJSONValuePtr object, +virJSONValueObjectPrependString(virJSONValue *object, const char *key, const char *value) { @@ -676,7 +671,7 @@ virJSONValueObjectPrependString(virJSONValuePtr object, int -virJSONValueObjectAppendNumberInt(virJSONValuePtr object, +virJSONValueObjectAppendNumberInt(virJSONValue *object, const char *key, int number) { @@ -690,7 +685,7 @@ virJSONValueObjectAppendNumberInt(virJSONValuePtr object, int -virJSONValueObjectAppendNumberUint(virJSONValuePtr object, +virJSONValueObjectAppendNumberUint(virJSONValue *object, const char *key, unsigned int number) { @@ -704,7 +699,7 @@ virJSONValueObjectAppendNumberUint(virJSONValuePtr object, int -virJSONValueObjectAppendNumberLong(virJSONValuePtr object, +virJSONValueObjectAppendNumberLong(virJSONValue *object, const char *key, long long number) { @@ -718,7 +713,7 @@ virJSONValueObjectAppendNumberLong(virJSONValuePtr object, int -virJSONValueObjectAppendNumberUlong(virJSONValuePtr object, +virJSONValueObjectAppendNumberUlong(virJSONValue *object, const char *key, unsigned long long number) { @@ -732,7 +727,7 @@ virJSONValueObjectAppendNumberUlong(virJSONValuePtr object, int -virJSONValueObjectAppendNumberDouble(virJSONValuePtr object, +virJSONValueObjectAppendNumberDouble(virJSONValue *object, const char *key, double number) { @@ -750,7 +745,7 @@ virJSONValueObjectAppendNumberDouble(virJSONValuePtr object, int -virJSONValueObjectAppendBoolean(virJSONValuePtr object, +virJSONValueObjectAppendBoolean(virJSONValue *object, const char *key, int boolean_) { @@ -764,7 +759,7 @@ virJSONValueObjectAppendBoolean(virJSONValuePtr object, int -virJSONValueObjectAppendNull(virJSONValuePtr object, +virJSONValueObjectAppendNull(virJSONValue *object, const char *key) { g_autoptr(virJSONValue) jvalue = virJSONValueNewNull(); @@ -777,8 +772,8 @@ virJSONValueObjectAppendNull(virJSONValuePtr object, int -virJSONValueArrayAppend(virJSONValuePtr array, - virJSONValuePtr *value) +virJSONValueArrayAppend(virJSONValue *array, + virJSONValue **value) { if (array->type != VIR_JSON_TYPE_ARRAY) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("expecting JSON array")); @@ -795,7 +790,7 @@ virJSONValueArrayAppend(virJSONValuePtr array, int -virJSONValueArrayAppendString(virJSONValuePtr object, +virJSONValueArrayAppendString(virJSONValue *object, const char *value) { g_autoptr(virJSONValue) jvalue = virJSONValueNewString(value); @@ -815,8 +810,8 @@ virJSONValueArrayAppendString(virJSONValuePtr object, * Merges the members of @c array into @a. The values are stolen from @c. */ int -virJSONValueArrayConcat(virJSONValuePtr a, - virJSONValuePtr c) +virJSONValueArrayConcat(virJSONValue *a, + virJSONValue *c) { size_t i; @@ -826,7 +821,7 @@ virJSONValueArrayConcat(virJSONValuePtr a, return -1; } - a->data.array.values = g_renew(virJSONValuePtr, a->data.array.values, + a->data.array.values = g_renew(virJSONValue *, a->data.array.values, a->data.array.nvalues + c->data.array.nvalues); for (i = 0; i < c->data.array.nvalues; i++) @@ -839,7 +834,7 @@ virJSONValueArrayConcat(virJSONValuePtr a, int -virJSONValueObjectHasKey(virJSONValuePtr object, +virJSONValueObjectHasKey(virJSONValue *object, const char *key) { size_t i; @@ -856,8 +851,8 @@ virJSONValueObjectHasKey(virJSONValuePtr object, } -virJSONValuePtr -virJSONValueObjectGet(virJSONValuePtr object, +virJSONValue * +virJSONValueObjectGet(virJSONValue *object, const char *key) { size_t i; @@ -876,12 +871,12 @@ virJSONValueObjectGet(virJSONValuePtr object, /* Return the value associated with KEY within OBJECT, but return NULL * if the key is missing or if value is not the correct TYPE. */ -virJSONValuePtr -virJSONValueObjectGetByType(virJSONValuePtr object, +virJSONValue * +virJSONValueObjectGetByType(virJSONValue *object, const char *key, virJSONType type) { - virJSONValuePtr value = virJSONValueObjectGet(object, key); + virJSONValue *value = virJSONValueObjectGet(object, key); if (value && value->type == type) return value; @@ -891,12 +886,12 @@ virJSONValueObjectGetByType(virJSONValuePtr object, /* Steal the value associated with KEY within OBJECT, but return NULL * if the key is missing or if value is not the correct TYPE. */ -static virJSONValuePtr -virJSONValueObjectStealByType(virJSONValuePtr object, +static virJSONValue * +virJSONValueObjectStealByType(virJSONValue *object, const char *key, virJSONType type) { - virJSONValuePtr value; + virJSONValue *value; if (virJSONValueObjectRemoveKey(object, key, &value) <= 0) return NULL; @@ -908,7 +903,7 @@ virJSONValueObjectStealByType(virJSONValuePtr object, int -virJSONValueObjectKeysNumber(virJSONValuePtr object) +virJSONValueObjectKeysNumber(virJSONValue *object) { if (object->type != VIR_JSON_TYPE_OBJECT) return -1; @@ -918,7 +913,7 @@ virJSONValueObjectKeysNumber(virJSONValuePtr object) const char * -virJSONValueObjectGetKey(virJSONValuePtr object, +virJSONValueObjectGetKey(virJSONValue *object, unsigned int n) { if (object->type != VIR_JSON_TYPE_OBJECT) @@ -935,9 +930,9 @@ virJSONValueObjectGetKey(virJSONValuePtr object, * not NULL, the dropped value object is returned instead of freed. * Returns 1 on success, 0 if no key was found, and -1 on error. */ int -virJSONValueObjectRemoveKey(virJSONValuePtr object, +virJSONValueObjectRemoveKey(virJSONValue *object, const char *key, - virJSONValuePtr *value) + virJSONValue **value) { size_t i; @@ -964,8 +959,8 @@ virJSONValueObjectRemoveKey(virJSONValuePtr object, } -virJSONValuePtr -virJSONValueObjectGetValue(virJSONValuePtr object, +virJSONValue * +virJSONValueObjectGetValue(virJSONValue *object, unsigned int n) { if (object->type != VIR_JSON_TYPE_OBJECT) @@ -979,7 +974,7 @@ virJSONValueObjectGetValue(virJSONValuePtr object, bool -virJSONValueIsObject(virJSONValuePtr object) +virJSONValueIsObject(virJSONValue *object) { if (object) return object->type == VIR_JSON_TYPE_OBJECT; @@ -989,7 +984,7 @@ virJSONValueIsObject(virJSONValuePtr object) bool -virJSONValueIsArray(virJSONValuePtr array) +virJSONValueIsArray(virJSONValue *array) { return array->type == VIR_JSON_TYPE_ARRAY; } @@ -1002,8 +997,8 @@ virJSONValueArraySize(const virJSONValue *array) } -virJSONValuePtr -virJSONValueArrayGet(virJSONValuePtr array, +virJSONValue * +virJSONValueArrayGet(virJSONValue *array, unsigned int element) { if (array->type != VIR_JSON_TYPE_ARRAY) @@ -1016,11 +1011,11 @@ virJSONValueArrayGet(virJSONValuePtr array, } -virJSONValuePtr -virJSONValueArraySteal(virJSONValuePtr array, +virJSONValue * +virJSONValueArraySteal(virJSONValue *array, unsigned int element) { - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; if (array->type != VIR_JSON_TYPE_ARRAY) return NULL; @@ -1057,7 +1052,7 @@ virJSONValueArraySteal(virJSONValuePtr array, * The rest of the members stay in possession of the array and it's condensed. */ int -virJSONValueArrayForeachSteal(virJSONValuePtr array, +virJSONValueArrayForeachSteal(virJSONValue *array, virJSONArrayIteratorFunc cb, void *opaque) { @@ -1094,7 +1089,7 @@ virJSONValueArrayForeachSteal(virJSONValuePtr array, const char * -virJSONValueGetString(virJSONValuePtr string) +virJSONValueGetString(virJSONValue *string) { if (string->type != VIR_JSON_TYPE_STRING) return NULL; @@ -1104,7 +1099,7 @@ virJSONValueGetString(virJSONValuePtr string) const char * -virJSONValueGetNumberString(virJSONValuePtr number) +virJSONValueGetNumberString(virJSONValue *number) { if (number->type != VIR_JSON_TYPE_NUMBER) return NULL; @@ -1114,7 +1109,7 @@ virJSONValueGetNumberString(virJSONValuePtr number) int -virJSONValueGetNumberInt(virJSONValuePtr number, +virJSONValueGetNumberInt(virJSONValue *number, int *value) { if (number->type != VIR_JSON_TYPE_NUMBER) @@ -1125,7 +1120,7 @@ virJSONValueGetNumberInt(virJSONValuePtr number, int -virJSONValueGetNumberUint(virJSONValuePtr number, +virJSONValueGetNumberUint(virJSONValue *number, unsigned int *value) { if (number->type != VIR_JSON_TYPE_NUMBER) @@ -1136,7 +1131,7 @@ virJSONValueGetNumberUint(virJSONValuePtr number, int -virJSONValueGetNumberLong(virJSONValuePtr number, +virJSONValueGetNumberLong(virJSONValue *number, long long *value) { if (number->type != VIR_JSON_TYPE_NUMBER) @@ -1147,7 +1142,7 @@ virJSONValueGetNumberLong(virJSONValuePtr number, int -virJSONValueGetNumberUlong(virJSONValuePtr number, +virJSONValueGetNumberUlong(virJSONValue *number, unsigned long long *value) { if (number->type != VIR_JSON_TYPE_NUMBER) @@ -1158,7 +1153,7 @@ virJSONValueGetNumberUlong(virJSONValuePtr number, int -virJSONValueGetNumberDouble(virJSONValuePtr number, +virJSONValueGetNumberDouble(virJSONValue *number, double *value) { if (number->type != VIR_JSON_TYPE_NUMBER) @@ -1169,7 +1164,7 @@ virJSONValueGetNumberDouble(virJSONValuePtr number, int -virJSONValueGetBoolean(virJSONValuePtr val, +virJSONValueGetBoolean(virJSONValue *val, bool *value) { if (val->type != VIR_JSON_TYPE_BOOLEAN) @@ -1181,17 +1176,17 @@ virJSONValueGetBoolean(virJSONValuePtr val, bool -virJSONValueIsNull(virJSONValuePtr val) +virJSONValueIsNull(virJSONValue *val) { return val->type == VIR_JSON_TYPE_NULL; } const char * -virJSONValueObjectGetString(virJSONValuePtr object, +virJSONValueObjectGetString(virJSONValue *object, const char *key) { - virJSONValuePtr val = virJSONValueObjectGet(object, key); + virJSONValue *val = virJSONValueObjectGet(object, key); if (!val) return NULL; @@ -1210,10 +1205,10 @@ virJSONValueObjectGetString(virJSONValuePtr object, * is not present or is not a string or number NULL is returned. */ const char * -virJSONValueObjectGetStringOrNumber(virJSONValuePtr object, +virJSONValueObjectGetStringOrNumber(virJSONValue *object, const char *key) { - virJSONValuePtr val = virJSONValueObjectGet(object, key); + virJSONValue *val = virJSONValueObjectGet(object, key); if (!val) return NULL; @@ -1228,11 +1223,11 @@ virJSONValueObjectGetStringOrNumber(virJSONValuePtr object, int -virJSONValueObjectGetNumberInt(virJSONValuePtr object, +virJSONValueObjectGetNumberInt(virJSONValue *object, const char *key, int *value) { - virJSONValuePtr val = virJSONValueObjectGet(object, key); + virJSONValue *val = virJSONValueObjectGet(object, key); if (!val) return -1; @@ -1242,11 +1237,11 @@ virJSONValueObjectGetNumberInt(virJSONValuePtr object, int -virJSONValueObjectGetNumberUint(virJSONValuePtr object, +virJSONValueObjectGetNumberUint(virJSONValue *object, const char *key, unsigned int *value) { - virJSONValuePtr val = virJSONValueObjectGet(object, key); + virJSONValue *val = virJSONValueObjectGet(object, key); if (!val) return -1; @@ -1256,11 +1251,11 @@ virJSONValueObjectGetNumberUint(virJSONValuePtr object, int -virJSONValueObjectGetNumberLong(virJSONValuePtr object, +virJSONValueObjectGetNumberLong(virJSONValue *object, const char *key, long long *value) { - virJSONValuePtr val = virJSONValueObjectGet(object, key); + virJSONValue *val = virJSONValueObjectGet(object, key); if (!val) return -1; @@ -1270,11 +1265,11 @@ virJSONValueObjectGetNumberLong(virJSONValuePtr object, int -virJSONValueObjectGetNumberUlong(virJSONValuePtr object, +virJSONValueObjectGetNumberUlong(virJSONValue *object, const char *key, unsigned long long *value) { - virJSONValuePtr val = virJSONValueObjectGet(object, key); + virJSONValue *val = virJSONValueObjectGet(object, key); if (!val) return -1; @@ -1284,11 +1279,11 @@ virJSONValueObjectGetNumberUlong(virJSONValuePtr object, int -virJSONValueObjectGetNumberDouble(virJSONValuePtr object, +virJSONValueObjectGetNumberDouble(virJSONValue *object, const char *key, double *value) { - virJSONValuePtr val = virJSONValueObjectGet(object, key); + virJSONValue *val = virJSONValueObjectGet(object, key); if (!val) return -1; @@ -1298,11 +1293,11 @@ virJSONValueObjectGetNumberDouble(virJSONValuePtr object, int -virJSONValueObjectGetBoolean(virJSONValuePtr object, +virJSONValueObjectGetBoolean(virJSONValue *object, const char *key, bool *value) { - virJSONValuePtr val = virJSONValueObjectGet(object, key); + virJSONValue *val = virJSONValueObjectGet(object, key); if (!val) return -1; @@ -1311,29 +1306,29 @@ virJSONValueObjectGetBoolean(virJSONValuePtr object, } -virJSONValuePtr -virJSONValueObjectGetObject(virJSONValuePtr object, const char *key) +virJSONValue * +virJSONValueObjectGetObject(virJSONValue *object, const char *key) { return virJSONValueObjectGetByType(object, key, VIR_JSON_TYPE_OBJECT); } -virJSONValuePtr -virJSONValueObjectGetArray(virJSONValuePtr object, const char *key) +virJSONValue * +virJSONValueObjectGetArray(virJSONValue *object, const char *key) { return virJSONValueObjectGetByType(object, key, VIR_JSON_TYPE_ARRAY); } -virJSONValuePtr -virJSONValueObjectStealArray(virJSONValuePtr object, const char *key) +virJSONValue * +virJSONValueObjectStealArray(virJSONValue *object, const char *key) { return virJSONValueObjectStealByType(object, key, VIR_JSON_TYPE_ARRAY); } -virJSONValuePtr -virJSONValueObjectStealObject(virJSONValuePtr object, +virJSONValue * +virJSONValueObjectStealObject(virJSONValue *object, const char *key) { return virJSONValueObjectStealByType(object, key, VIR_JSON_TYPE_OBJECT); @@ -1341,10 +1336,10 @@ virJSONValueObjectStealObject(virJSONValuePtr object, int -virJSONValueObjectIsNull(virJSONValuePtr object, +virJSONValueObjectIsNull(virJSONValue *object, const char *key) { - virJSONValuePtr val = virJSONValueObjectGet(object, key); + virJSONValue *val = virJSONValueObjectGet(object, key); if (!val) return -1; @@ -1353,10 +1348,10 @@ virJSONValueObjectIsNull(virJSONValuePtr object, } char ** -virJSONValueObjectGetStringArray(virJSONValuePtr object, const char *key) +virJSONValueObjectGetStringArray(virJSONValue *object, const char *key) { g_auto(GStrv) ret = NULL; - virJSONValuePtr data; + virJSONValue *data; size_t n; size_t i; @@ -1371,7 +1366,7 @@ virJSONValueObjectGetStringArray(virJSONValuePtr object, const char *key) n = virJSONValueArraySize(data); ret = g_new0(char *, n + 1); for (i = 0; i < n; i++) { - virJSONValuePtr child = virJSONValueArrayGet(data, i); + virJSONValue *child = virJSONValueArrayGet(data, i); const char *tmp; if (!child) { @@ -1407,7 +1402,7 @@ virJSONValueObjectGetStringArray(virJSONValuePtr object, const char *key) * during iteration and -1 on generic errors. */ int -virJSONValueObjectForeachKeyValue(virJSONValuePtr object, +virJSONValueObjectForeachKeyValue(virJSONValue *object, virJSONValueObjectIteratorFunc cb, void *opaque) { @@ -1417,7 +1412,7 @@ virJSONValueObjectForeachKeyValue(virJSONValuePtr object, return -1; for (i = 0; i < object->data.object.npairs; i++) { - virJSONObjectPairPtr elem = object->data.object.pairs + i; + virJSONObjectPair *elem = object->data.object.pairs + i; if (cb(elem->key, elem->value, opaque) < 0) return -2; @@ -1427,11 +1422,11 @@ virJSONValueObjectForeachKeyValue(virJSONValuePtr object, } -virJSONValuePtr +virJSONValue * virJSONValueCopy(const virJSONValue *in) { size_t i; - virJSONValuePtr out = NULL; + virJSONValue *out = NULL; if (!in) return NULL; @@ -1451,7 +1446,7 @@ virJSONValueCopy(const virJSONValue *in) case VIR_JSON_TYPE_ARRAY: out = virJSONValueNewArray(); - out->data.array.values = g_new0(virJSONValuePtr, in->data.array.nvalues); + out->data.array.values = g_new0(virJSONValue *, in->data.array.nvalues); out->data.array.nvalues = in->data.array.nvalues; for (i = 0; i < in->data.array.nvalues; i++) { @@ -1480,13 +1475,13 @@ virJSONValueCopy(const virJSONValue *in) #if WITH_YAJL static int -virJSONParserInsertValue(virJSONParserPtr parser, - virJSONValuePtr *value) +virJSONParserInsertValue(virJSONParser *parser, + virJSONValue **value) { if (!parser->head) { parser->head = g_steal_pointer(value); } else { - virJSONParserStatePtr state; + virJSONParserState *state; if (!parser->nstate) { VIR_DEBUG("got a value to insert without a container"); return -1; @@ -1533,7 +1528,7 @@ virJSONParserInsertValue(virJSONParserPtr parser, static int virJSONParserHandleNull(void *ctx) { - virJSONParserPtr parser = ctx; + virJSONParser *parser = ctx; g_autoptr(virJSONValue) value = virJSONValueNewNull(); VIR_DEBUG("parser=%p", parser); @@ -1549,7 +1544,7 @@ static int virJSONParserHandleBoolean(void *ctx, int boolean_) { - virJSONParserPtr parser = ctx; + virJSONParser *parser = ctx; g_autoptr(virJSONValue) value = virJSONValueNewBoolean(boolean_); VIR_DEBUG("parser=%p boolean=%d", parser, boolean_); @@ -1566,7 +1561,7 @@ virJSONParserHandleNumber(void *ctx, const char *s, size_t l) { - virJSONParserPtr parser = ctx; + virJSONParser *parser = ctx; g_autoptr(virJSONValue) value = virJSONValueNewNumber(g_strndup(s, l)); VIR_DEBUG("parser=%p str=%s", parser, value->data.number); @@ -1583,7 +1578,7 @@ virJSONParserHandleString(void *ctx, const unsigned char *stringVal, size_t stringLen) { - virJSONParserPtr parser = ctx; + virJSONParser *parser = ctx; g_autoptr(virJSONValue) value = virJSONValueNewStringLen((const char *)stringVal, stringLen); @@ -1601,8 +1596,8 @@ virJSONParserHandleMapKey(void *ctx, const unsigned char *stringVal, size_t stringLen) { - virJSONParserPtr parser = ctx; - virJSONParserStatePtr state; + virJSONParser *parser = ctx; + virJSONParserState *state; VIR_DEBUG("parser=%p key=%p", parser, (const char *)stringVal); @@ -1620,9 +1615,9 @@ virJSONParserHandleMapKey(void *ctx, static int virJSONParserHandleStartMap(void *ctx) { - virJSONParserPtr parser = ctx; + virJSONParser *parser = ctx; g_autoptr(virJSONValue) value = virJSONValueNewObject(); - virJSONValuePtr tmp = value; + virJSONValue *tmp = value; VIR_DEBUG("parser=%p", parser); @@ -1642,8 +1637,8 @@ virJSONParserHandleStartMap(void *ctx) static int virJSONParserHandleEndMap(void *ctx) { - virJSONParserPtr parser = ctx; - virJSONParserStatePtr state; + virJSONParser *parser = ctx; + virJSONParserState *state; VIR_DEBUG("parser=%p", parser); @@ -1665,9 +1660,9 @@ virJSONParserHandleEndMap(void *ctx) static int virJSONParserHandleStartArray(void *ctx) { - virJSONParserPtr parser = ctx; + virJSONParser *parser = ctx; g_autoptr(virJSONValue) value = virJSONValueNewArray(); - virJSONValuePtr tmp = value; + virJSONValue *tmp = value; VIR_DEBUG("parser=%p", parser); @@ -1687,8 +1682,8 @@ virJSONParserHandleStartArray(void *ctx) static int virJSONParserHandleEndArray(void *ctx) { - virJSONParserPtr parser = ctx; - virJSONParserStatePtr state; + virJSONParser *parser = ctx; + virJSONParserState *state; VIR_DEBUG("parser=%p", parser); @@ -1723,12 +1718,12 @@ static const yajl_callbacks parserCallbacks = { /* XXX add an incremental streaming parser - yajl trivially supports it */ -virJSONValuePtr +virJSONValue * virJSONValueFromString(const char *jsonstring) { yajl_handle hand; virJSONParser parser = { NULL, NULL, 0, 0 }; - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; int rc; size_t len = strlen(jsonstring); @@ -1783,7 +1778,7 @@ virJSONValueFromString(const char *jsonstring) static int -virJSONValueToStringOne(virJSONValuePtr object, +virJSONValueToStringOne(virJSONValue *object, yajl_gen g) { size_t i; @@ -1848,8 +1843,8 @@ virJSONValueToStringOne(virJSONValuePtr object, int -virJSONValueToBuffer(virJSONValuePtr object, - virBufferPtr buf, +virJSONValueToBuffer(virJSONValue *object, + virBuffer *buf, bool pretty) { yajl_gen g; @@ -1892,7 +1887,7 @@ virJSONValueToBuffer(virJSONValuePtr object, #else -virJSONValuePtr +virJSONValue * virJSONValueFromString(const char *jsonstring G_GNUC_UNUSED) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -1902,8 +1897,8 @@ virJSONValueFromString(const char *jsonstring G_GNUC_UNUSED) int -virJSONValueToBuffer(virJSONValuePtr object G_GNUC_UNUSED, - virBufferPtr buf G_GNUC_UNUSED, +virJSONValueToBuffer(virJSONValue *object G_GNUC_UNUSED, + virBuffer *buf G_GNUC_UNUSED, bool pretty G_GNUC_UNUSED) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -1914,7 +1909,7 @@ virJSONValueToBuffer(virJSONValuePtr object G_GNUC_UNUSED, char * -virJSONValueToString(virJSONValuePtr object, +virJSONValueToString(virJSONValue *object, bool pretty) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -1951,18 +1946,18 @@ virJSONStringReformat(const char *jsonstr, } -static virJSONValuePtr -virJSONValueObjectDeflattenKeys(virJSONValuePtr json); +static virJSONValue * +virJSONValueObjectDeflattenKeys(virJSONValue *json); static int virJSONValueObjectDeflattenWorker(const char *key, - virJSONValuePtr value, + virJSONValue *value, void *opaque) { - virJSONValuePtr retobj = opaque; + virJSONValue *retobj = opaque; g_autoptr(virJSONValue) newval = NULL; - virJSONValuePtr existobj; + virJSONValue *existobj; g_auto(GStrv) tokens = NULL; /* non-nested keys only need to be copied */ @@ -1998,7 +1993,7 @@ virJSONValueObjectDeflattenWorker(const char *key, } if (!(existobj = virJSONValueObjectGet(retobj, tokens[0]))) { - virJSONValuePtr newobj = virJSONValueNewObject(); + virJSONValue *newobj = virJSONValueNewObject(); existobj = newobj; if (virJSONValueObjectAppend(retobj, tokens[0], &newobj) < 0) @@ -2017,8 +2012,8 @@ virJSONValueObjectDeflattenWorker(const char *key, } -static virJSONValuePtr -virJSONValueObjectDeflattenKeys(virJSONValuePtr json) +static virJSONValue * +virJSONValueObjectDeflattenKeys(virJSONValue *json) { g_autoptr(virJSONValue) deflattened = virJSONValueNewObject(); @@ -2038,10 +2033,10 @@ virJSONValueObjectDeflattenKeys(virJSONValuePtr json) * keys starting from 0. */ static void -virJSONValueObjectDeflattenArrays(virJSONValuePtr json) +virJSONValueObjectDeflattenArrays(virJSONValue *json) { - g_autofree virJSONValuePtr *arraymembers = NULL; - virJSONObjectPtr obj; + g_autofree virJSONValue **arraymembers = NULL; + virJSONObject *obj; size_t i; if (!json || @@ -2050,13 +2045,13 @@ virJSONValueObjectDeflattenArrays(virJSONValuePtr json) obj = &json->data.object; - arraymembers = g_new0(virJSONValuePtr, obj->npairs); + arraymembers = g_new0(virJSONValue *, obj->npairs); for (i = 0; i < obj->npairs; i++) virJSONValueObjectDeflattenArrays(obj->pairs[i].value); for (i = 0; i < obj->npairs; i++) { - virJSONObjectPairPtr pair = obj->pairs + i; + virJSONObjectPair *pair = obj->pairs + i; unsigned int keynum; if (virStrToLong_uip(pair->key, NULL, 10, &keynum) < 0) @@ -2095,10 +2090,10 @@ virJSONValueObjectDeflattenArrays(virJSONValuePtr json) * hierarchy so that the parsers can be kept simple and we still can use the * weird syntax some users might use. */ -virJSONValuePtr -virJSONValueObjectDeflatten(virJSONValuePtr json) +virJSONValue * +virJSONValueObjectDeflatten(virJSONValue *json) { - virJSONValuePtr deflattened; + virJSONValue *deflattened; if (!(deflattened = virJSONValueObjectDeflattenKeys(json))) return NULL; diff --git a/src/util/virjson.h b/src/util/virjson.h index 3197f81f86..7b9fcbf99b 100644 --- a/src/util/virjson.h +++ b/src/util/virjson.h @@ -38,132 +38,131 @@ typedef enum { } virJSONType; typedef struct _virJSONValue virJSONValue; -typedef virJSONValue *virJSONValuePtr; -void virJSONValueFree(virJSONValuePtr value); +void virJSONValueFree(virJSONValue *value); void virJSONValueHashFree(void *opaque); virJSONType virJSONValueGetType(const virJSONValue *value); -int virJSONValueObjectCreate(virJSONValuePtr *obj, ...) +int virJSONValueObjectCreate(virJSONValue **obj, ...) ATTRIBUTE_NONNULL(1) G_GNUC_NULL_TERMINATED; -int virJSONValueObjectCreateVArgs(virJSONValuePtr *obj, va_list args) +int virJSONValueObjectCreateVArgs(virJSONValue **obj, va_list args) ATTRIBUTE_NONNULL(1); -int virJSONValueObjectAdd(virJSONValuePtr obj, ...) +int virJSONValueObjectAdd(virJSONValue *obj, ...) ATTRIBUTE_NONNULL(1) G_GNUC_NULL_TERMINATED; -int virJSONValueObjectAddVArgs(virJSONValuePtr obj, va_list args) +int virJSONValueObjectAddVArgs(virJSONValue *obj, va_list args) ATTRIBUTE_NONNULL(1); -virJSONValuePtr virJSONValueNewString(const char *data); -virJSONValuePtr virJSONValueNewStringLen(const char *data, size_t length); -virJSONValuePtr virJSONValueNewNumberInt(int data); -virJSONValuePtr virJSONValueNewNumberUint(unsigned int data); -virJSONValuePtr virJSONValueNewNumberLong(long long data); -virJSONValuePtr virJSONValueNewNumberUlong(unsigned long long data); -virJSONValuePtr virJSONValueNewNumberDouble(double data); -virJSONValuePtr virJSONValueNewBoolean(int boolean); -virJSONValuePtr virJSONValueNewNull(void); -virJSONValuePtr virJSONValueNewArray(void); -virJSONValuePtr virJSONValueNewObject(void); +virJSONValue *virJSONValueNewString(const char *data); +virJSONValue *virJSONValueNewStringLen(const char *data, size_t length); +virJSONValue *virJSONValueNewNumberInt(int data); +virJSONValue *virJSONValueNewNumberUint(unsigned int data); +virJSONValue *virJSONValueNewNumberLong(long long data); +virJSONValue *virJSONValueNewNumberUlong(unsigned long long data); +virJSONValue *virJSONValueNewNumberDouble(double data); +virJSONValue *virJSONValueNewBoolean(int boolean); +virJSONValue *virJSONValueNewNull(void); +virJSONValue *virJSONValueNewArray(void); +virJSONValue *virJSONValueNewObject(void); -int virJSONValueObjectAppend(virJSONValuePtr object, +int virJSONValueObjectAppend(virJSONValue *object, const char *key, - virJSONValuePtr *value); -int virJSONValueArrayAppend(virJSONValuePtr object, - virJSONValuePtr *value); -int virJSONValueArrayConcat(virJSONValuePtr a, - virJSONValuePtr c); + virJSONValue **value); +int virJSONValueArrayAppend(virJSONValue *object, + virJSONValue **value); +int virJSONValueArrayConcat(virJSONValue *a, + virJSONValue *c); -int virJSONValueObjectHasKey(virJSONValuePtr object, const char *key); -virJSONValuePtr virJSONValueObjectGet(virJSONValuePtr object, const char *key); -virJSONValuePtr virJSONValueObjectGetByType(virJSONValuePtr object, +int virJSONValueObjectHasKey(virJSONValue *object, const char *key); +virJSONValue *virJSONValueObjectGet(virJSONValue *object, const char *key); +virJSONValue *virJSONValueObjectGetByType(virJSONValue *object, const char *key, virJSONType type); -bool virJSONValueIsObject(virJSONValuePtr object); +bool virJSONValueIsObject(virJSONValue *object); -bool virJSONValueIsArray(virJSONValuePtr array); +bool virJSONValueIsArray(virJSONValue *array); size_t virJSONValueArraySize(const virJSONValue *array); -virJSONValuePtr virJSONValueArrayGet(virJSONValuePtr object, unsigned int element); -virJSONValuePtr virJSONValueArraySteal(virJSONValuePtr object, unsigned int element); +virJSONValue *virJSONValueArrayGet(virJSONValue *object, unsigned int element); +virJSONValue *virJSONValueArraySteal(virJSONValue *object, unsigned int element); typedef int (*virJSONArrayIteratorFunc)(size_t pos, - virJSONValuePtr item, + virJSONValue *item, void *opaque); -int virJSONValueArrayForeachSteal(virJSONValuePtr array, +int virJSONValueArrayForeachSteal(virJSONValue *array, virJSONArrayIteratorFunc cb, void *opaque); -int virJSONValueObjectKeysNumber(virJSONValuePtr object); -const char *virJSONValueObjectGetKey(virJSONValuePtr object, unsigned int n); -virJSONValuePtr virJSONValueObjectGetValue(virJSONValuePtr object, unsigned int n); +int virJSONValueObjectKeysNumber(virJSONValue *object); +const char *virJSONValueObjectGetKey(virJSONValue *object, unsigned int n); +virJSONValue *virJSONValueObjectGetValue(virJSONValue *object, unsigned int n); -const char *virJSONValueGetString(virJSONValuePtr object); -const char *virJSONValueGetNumberString(virJSONValuePtr number); -int virJSONValueGetNumberInt(virJSONValuePtr object, int *value); -int virJSONValueGetNumberUint(virJSONValuePtr object, unsigned int *value); -int virJSONValueGetNumberLong(virJSONValuePtr object, long long *value); -int virJSONValueGetNumberUlong(virJSONValuePtr object, unsigned long long *value); -int virJSONValueGetNumberDouble(virJSONValuePtr object, double *value); -int virJSONValueGetBoolean(virJSONValuePtr object, bool *value); -bool virJSONValueIsNull(virJSONValuePtr object); -virJSONValuePtr virJSONValueObjectGetObject(virJSONValuePtr object, +const char *virJSONValueGetString(virJSONValue *object); +const char *virJSONValueGetNumberString(virJSONValue *number); +int virJSONValueGetNumberInt(virJSONValue *object, int *value); +int virJSONValueGetNumberUint(virJSONValue *object, unsigned int *value); +int virJSONValueGetNumberLong(virJSONValue *object, long long *value); +int virJSONValueGetNumberUlong(virJSONValue *object, unsigned long long *value); +int virJSONValueGetNumberDouble(virJSONValue *object, double *value); +int virJSONValueGetBoolean(virJSONValue *object, bool *value); +bool virJSONValueIsNull(virJSONValue *object); +virJSONValue *virJSONValueObjectGetObject(virJSONValue *object, const char *key); -virJSONValuePtr virJSONValueObjectGetArray(virJSONValuePtr object, +virJSONValue *virJSONValueObjectGetArray(virJSONValue *object, const char *key); -virJSONValuePtr virJSONValueObjectStealArray(virJSONValuePtr object, +virJSONValue *virJSONValueObjectStealArray(virJSONValue *object, const char *key); -virJSONValuePtr virJSONValueObjectStealObject(virJSONValuePtr object, +virJSONValue *virJSONValueObjectStealObject(virJSONValue *object, const char *key); -const char *virJSONValueObjectGetString(virJSONValuePtr object, const char *key); -char **virJSONValueObjectGetStringArray(virJSONValuePtr object, const char *key); -const char *virJSONValueObjectGetStringOrNumber(virJSONValuePtr object, const char *key); -int virJSONValueObjectGetNumberInt(virJSONValuePtr object, const char *key, int *value); -int virJSONValueObjectGetNumberUint(virJSONValuePtr object, const char *key, unsigned int *value); -int virJSONValueObjectGetNumberLong(virJSONValuePtr object, const char *key, long long *value); -int virJSONValueObjectGetNumberUlong(virJSONValuePtr object, const char *key, unsigned long long *value); -int virJSONValueObjectGetNumberDouble(virJSONValuePtr object, const char *key, double *value); -int virJSONValueObjectGetBoolean(virJSONValuePtr object, const char *key, bool *value); -int virJSONValueObjectIsNull(virJSONValuePtr object, const char *key); +const char *virJSONValueObjectGetString(virJSONValue *object, const char *key); +char **virJSONValueObjectGetStringArray(virJSONValue *object, const char *key); +const char *virJSONValueObjectGetStringOrNumber(virJSONValue *object, const char *key); +int virJSONValueObjectGetNumberInt(virJSONValue *object, const char *key, int *value); +int virJSONValueObjectGetNumberUint(virJSONValue *object, const char *key, unsigned int *value); +int virJSONValueObjectGetNumberLong(virJSONValue *object, const char *key, long long *value); +int virJSONValueObjectGetNumberUlong(virJSONValue *object, const char *key, unsigned long long *value); +int virJSONValueObjectGetNumberDouble(virJSONValue *object, const char *key, double *value); +int virJSONValueObjectGetBoolean(virJSONValue *object, const char *key, bool *value); +int virJSONValueObjectIsNull(virJSONValue *object, const char *key); -int virJSONValueObjectAppendString(virJSONValuePtr object, const char *key, const char *value); -int virJSONValueObjectAppendStringPrintf(virJSONValuePtr object, const char *key, const char *fmt, ...) +int virJSONValueObjectAppendString(virJSONValue *object, const char *key, const char *value); +int virJSONValueObjectAppendStringPrintf(virJSONValue *object, const char *key, const char *fmt, ...) G_GNUC_PRINTF(3, 4); -int virJSONValueObjectPrependString(virJSONValuePtr object, const char *key, const char *value); -int virJSONValueObjectAppendNumberInt(virJSONValuePtr object, const char *key, int number); -int virJSONValueObjectAppendNumberUint(virJSONValuePtr object, const char *key, unsigned int number); -int virJSONValueObjectAppendNumberLong(virJSONValuePtr object, const char *key, long long number); -int virJSONValueObjectAppendNumberUlong(virJSONValuePtr object, const char *key, unsigned long long number); -int virJSONValueObjectAppendNumberDouble(virJSONValuePtr object, const char *key, double number); -int virJSONValueObjectAppendBoolean(virJSONValuePtr object, const char *key, int boolean); -int virJSONValueObjectAppendNull(virJSONValuePtr object, const char *key); +int virJSONValueObjectPrependString(virJSONValue *object, const char *key, const char *value); +int virJSONValueObjectAppendNumberInt(virJSONValue *object, const char *key, int number); +int virJSONValueObjectAppendNumberUint(virJSONValue *object, const char *key, unsigned int number); +int virJSONValueObjectAppendNumberLong(virJSONValue *object, const char *key, long long number); +int virJSONValueObjectAppendNumberUlong(virJSONValue *object, const char *key, unsigned long long number); +int virJSONValueObjectAppendNumberDouble(virJSONValue *object, const char *key, double number); +int virJSONValueObjectAppendBoolean(virJSONValue *object, const char *key, int boolean); +int virJSONValueObjectAppendNull(virJSONValue *object, const char *key); -int virJSONValueObjectRemoveKey(virJSONValuePtr object, const char *key, - virJSONValuePtr *value) +int virJSONValueObjectRemoveKey(virJSONValue *object, const char *key, + virJSONValue **value) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -int virJSONValueArrayAppendString(virJSONValuePtr object, const char *value); +int virJSONValueArrayAppendString(virJSONValue *object, const char *value); -virJSONValuePtr virJSONValueFromString(const char *jsonstring); -char *virJSONValueToString(virJSONValuePtr object, +virJSONValue *virJSONValueFromString(const char *jsonstring); +char *virJSONValueToString(virJSONValue *object, bool pretty); -int virJSONValueToBuffer(virJSONValuePtr object, - virBufferPtr buf, +int virJSONValueToBuffer(virJSONValue *object, + virBuffer *buf, bool pretty) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; typedef int (*virJSONValueObjectIteratorFunc)(const char *key, - virJSONValuePtr value, + virJSONValue *value, void *opaque); -int virJSONValueObjectForeachKeyValue(virJSONValuePtr object, +int virJSONValueObjectForeachKeyValue(virJSONValue *object, virJSONValueObjectIteratorFunc cb, void *opaque); -virJSONValuePtr virJSONValueCopy(const virJSONValue *in); +virJSONValue *virJSONValueCopy(const virJSONValue *in); char *virJSONStringReformat(const char *jsonstr, bool pretty); -virJSONValuePtr virJSONValueObjectDeflatten(virJSONValuePtr json); +virJSONValue *virJSONValueObjectDeflatten(virJSONValue *json); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virJSONValue, virJSONValueFree); diff --git a/src/util/virlease.c b/src/util/virlease.c index 59eaabd4d9..0e28a47dd2 100644 --- a/src/util/virlease.c +++ b/src/util/virlease.c @@ -43,7 +43,7 @@ int -virLeaseReadCustomLeaseFile(virJSONValuePtr leases_array_new, +virLeaseReadCustomLeaseFile(virJSONValue *leases_array_new, const char *custom_lease_file, const char *ip_to_delete, char **server_duid) @@ -79,7 +79,7 @@ virLeaseReadCustomLeaseFile(virJSONValuePtr leases_array_new, i = 0; while (i < virJSONValueArraySize(leases_array)) { - virJSONValuePtr lease_tmp = virJSONValueArrayGet(leases_array, i); + virJSONValue *lease_tmp = virJSONValueArrayGet(leases_array, i); long long expirytime; const char *ip_tmp = NULL; @@ -133,10 +133,10 @@ virLeaseReadCustomLeaseFile(virJSONValuePtr leases_array_new, int -virLeasePrintLeases(virJSONValuePtr leases_array_new, +virLeasePrintLeases(virJSONValue *leases_array_new, const char *server_duid) { - virJSONValuePtr lease_tmp = NULL; + virJSONValue *lease_tmp = NULL; const char *ip_tmp = NULL; long long expirytime = 0; size_t i; @@ -201,7 +201,7 @@ virLeasePrintLeases(virJSONValuePtr leases_array_new, int -virLeaseNew(virJSONValuePtr *lease_ret, +virLeaseNew(virJSONValue **lease_ret, const char *mac, const char *clientid, const char *ip, diff --git a/src/util/virlease.h b/src/util/virlease.h index 98a3a5854d..d2e440c654 100644 --- a/src/util/virlease.h +++ b/src/util/virlease.h @@ -24,16 +24,16 @@ #include "virjson.h" -int virLeaseReadCustomLeaseFile(virJSONValuePtr leases_array_new, +int virLeaseReadCustomLeaseFile(virJSONValue *leases_array_new, const char *custom_lease_file, const char *ip_to_delete, char **server_duid); -int virLeasePrintLeases(virJSONValuePtr leases_array_new, +int virLeasePrintLeases(virJSONValue *leases_array_new, const char *server_duid); -int virLeaseNew(virJSONValuePtr *lease_ret, +int virLeaseNew(virJSONValue **lease_ret, const char *mac, const char *clientid, const char *ip, diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c index 5e6d3ea428..9986d8df41 100644 --- a/src/util/virlockspace.c +++ b/src/util/virlockspace.c @@ -42,8 +42,6 @@ VIR_LOG_INIT("util.lockspace"); #define VIR_LOCKSPACE_TABLE_SIZE 10 typedef struct _virLockSpaceResource virLockSpaceResource; -typedef virLockSpaceResource *virLockSpaceResourcePtr; - struct _virLockSpaceResource { char *name; char *path; @@ -62,7 +60,7 @@ struct _virLockSpace { }; -static char *virLockSpaceGetResourcePath(virLockSpacePtr lockspace, +static char *virLockSpaceGetResourcePath(virLockSpace *lockspace, const char *resname) { char *ret; @@ -74,7 +72,7 @@ static char *virLockSpaceGetResourcePath(virLockSpacePtr lockspace, } -static void virLockSpaceResourceFree(virLockSpaceResourcePtr res) +static void virLockSpaceResourceFree(virLockSpaceResource *res) { if (!res) return; @@ -110,13 +108,13 @@ static void virLockSpaceResourceFree(virLockSpaceResourcePtr res) } -static virLockSpaceResourcePtr -virLockSpaceResourceNew(virLockSpacePtr lockspace, +static virLockSpaceResource * +virLockSpaceResourceNew(virLockSpace *lockspace, const char *resname, unsigned int flags, pid_t owner) { - virLockSpaceResourcePtr res; + virLockSpaceResource *res; bool shared = !!(flags & VIR_LOCK_SPACE_ACQUIRE_SHARED); res = g_new0(virLockSpaceResource, 1); @@ -227,14 +225,14 @@ virLockSpaceResourceNew(virLockSpacePtr lockspace, static void virLockSpaceResourceDataFree(void *opaque) { - virLockSpaceResourcePtr res = opaque; + virLockSpaceResource *res = opaque; virLockSpaceResourceFree(res); } -virLockSpacePtr virLockSpaceNew(const char *directory) +virLockSpace *virLockSpaceNew(const char *directory) { - virLockSpacePtr lockspace; + virLockSpace *lockspace; VIR_DEBUG("directory=%s", NULLSTR(directory)); @@ -279,10 +277,10 @@ virLockSpacePtr virLockSpaceNew(const char *directory) -virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object) +virLockSpace *virLockSpaceNewPostExecRestart(virJSONValue *object) { - virLockSpacePtr lockspace; - virJSONValuePtr resources; + virLockSpace *lockspace; + virJSONValue *resources; size_t i; VIR_DEBUG("object=%p", object); @@ -317,10 +315,10 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object) } for (i = 0; i < virJSONValueArraySize(resources); i++) { - virJSONValuePtr child = virJSONValueArrayGet(resources, i); - virLockSpaceResourcePtr res; + virJSONValue *child = virJSONValueArrayGet(resources, i); + virLockSpaceResource *res; const char *tmp; - virJSONValuePtr owners; + virJSONValue *owners; size_t j; res = g_new0(virLockSpaceResource, 1); @@ -386,7 +384,7 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object) for (j = 0; j < res->nOwners; j++) { unsigned long long int owner; - virJSONValuePtr ownerval = virJSONValueArrayGet(owners, j); + virJSONValue *ownerval = virJSONValueArrayGet(owners, j); if (virJSONValueGetNumberUlong(ownerval, &owner) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -412,12 +410,12 @@ virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object) } -virJSONValuePtr virLockSpacePreExecRestart(virLockSpacePtr lockspace) +virJSONValue *virLockSpacePreExecRestart(virLockSpace *lockspace) { g_autoptr(virJSONValue) object = virJSONValueNewObject(); g_autoptr(virJSONValue) resources = virJSONValueNewArray(); - g_autofree virHashKeyValuePairPtr pairs = NULL; - virHashKeyValuePairPtr tmp; + g_autofree virHashKeyValuePair *pairs = NULL; + virHashKeyValuePair *tmp; virMutexLock(&lockspace->lock); @@ -428,7 +426,7 @@ virJSONValuePtr virLockSpacePreExecRestart(virLockSpacePtr lockspace) tmp = pairs = virHashGetItems(lockspace->resources, NULL, false); while (tmp && tmp->value) { - virLockSpaceResourcePtr res = (virLockSpaceResourcePtr)tmp->value; + virLockSpaceResource *res = (virLockSpaceResource *)tmp->value; g_autoptr(virJSONValue) child = virJSONValueNewObject(); g_autoptr(virJSONValue) owners = virJSONValueNewArray(); size_t i; @@ -476,7 +474,7 @@ virJSONValuePtr virLockSpacePreExecRestart(virLockSpacePtr lockspace) } -void virLockSpaceFree(virLockSpacePtr lockspace) +void virLockSpaceFree(virLockSpace *lockspace) { if (!lockspace) return; @@ -488,13 +486,13 @@ void virLockSpaceFree(virLockSpacePtr lockspace) } -const char *virLockSpaceGetDirectory(virLockSpacePtr lockspace) +const char *virLockSpaceGetDirectory(virLockSpace *lockspace) { return lockspace->dir; } -int virLockSpaceCreateResource(virLockSpacePtr lockspace, +int virLockSpaceCreateResource(virLockSpace *lockspace, const char *resname) { int ret = -1; @@ -525,7 +523,7 @@ int virLockSpaceCreateResource(virLockSpacePtr lockspace, } -int virLockSpaceDeleteResource(virLockSpacePtr lockspace, +int virLockSpaceDeleteResource(virLockSpace *lockspace, const char *resname) { int ret = -1; @@ -561,13 +559,13 @@ int virLockSpaceDeleteResource(virLockSpacePtr lockspace, } -int virLockSpaceAcquireResource(virLockSpacePtr lockspace, +int virLockSpaceAcquireResource(virLockSpace *lockspace, const char *resname, pid_t owner, unsigned int flags) { int ret = -1; - virLockSpaceResourcePtr res; + virLockSpaceResource *res; VIR_DEBUG("lockspace=%p resname=%s flags=0x%x owner=%lld", lockspace, resname, flags, (unsigned long long)owner); @@ -609,12 +607,12 @@ int virLockSpaceAcquireResource(virLockSpacePtr lockspace, } -int virLockSpaceReleaseResource(virLockSpacePtr lockspace, +int virLockSpaceReleaseResource(virLockSpace *lockspace, const char *resname, pid_t owner) { int ret = -1; - virLockSpaceResourcePtr res; + virLockSpaceResource *res; size_t i; VIR_DEBUG("lockspace=%p resname=%s owner=%lld", @@ -666,7 +664,7 @@ virLockSpaceRemoveResourcesForOwner(const void *payload, const char *name G_GNUC_UNUSED, const void *opaque) { - virLockSpaceResourcePtr res = (virLockSpaceResourcePtr)payload; + virLockSpaceResource *res = (virLockSpaceResource *)payload; struct virLockSpaceRemoveData *data = (struct virLockSpaceRemoveData *)opaque; size_t i; @@ -694,7 +692,7 @@ virLockSpaceRemoveResourcesForOwner(const void *payload, } -int virLockSpaceReleaseResourcesForOwner(virLockSpacePtr lockspace, +int virLockSpaceReleaseResourcesForOwner(virLockSpace *lockspace, pid_t owner) { int ret = 0; diff --git a/src/util/virlockspace.h b/src/util/virlockspace.h index 7f4833c35c..da83c001e9 100644 --- a/src/util/virlockspace.h +++ b/src/util/virlockspace.h @@ -25,20 +25,19 @@ #include "virjson.h" typedef struct _virLockSpace virLockSpace; -typedef virLockSpace *virLockSpacePtr; -virLockSpacePtr virLockSpaceNew(const char *directory); -virLockSpacePtr virLockSpaceNewPostExecRestart(virJSONValuePtr object); +virLockSpace *virLockSpaceNew(const char *directory); +virLockSpace *virLockSpaceNewPostExecRestart(virJSONValue *object); -virJSONValuePtr virLockSpacePreExecRestart(virLockSpacePtr lockspace); +virJSONValue *virLockSpacePreExecRestart(virLockSpace *lockspace); -void virLockSpaceFree(virLockSpacePtr lockspace); +void virLockSpaceFree(virLockSpace *lockspace); -const char *virLockSpaceGetDirectory(virLockSpacePtr lockspace); +const char *virLockSpaceGetDirectory(virLockSpace *lockspace); -int virLockSpaceCreateResource(virLockSpacePtr lockspace, +int virLockSpaceCreateResource(virLockSpace *lockspace, const char *resname); -int virLockSpaceDeleteResource(virLockSpacePtr lockspace, +int virLockSpaceDeleteResource(virLockSpace *lockspace, const char *resname); typedef enum { @@ -46,14 +45,14 @@ typedef enum { VIR_LOCK_SPACE_ACQUIRE_AUTOCREATE = (1 << 1), } virLockSpaceAcquireFlags; -int virLockSpaceAcquireResource(virLockSpacePtr lockspace, +int virLockSpaceAcquireResource(virLockSpace *lockspace, const char *resname, pid_t owner, unsigned int flags); -int virLockSpaceReleaseResource(virLockSpacePtr lockspace, +int virLockSpaceReleaseResource(virLockSpace *lockspace, const char *resname, pid_t owner); -int virLockSpaceReleaseResourcesForOwner(virLockSpacePtr lockspace, +int virLockSpaceReleaseResourcesForOwner(virLockSpace *lockspace, pid_t owner); diff --git a/src/util/virlog.c b/src/util/virlog.c index 7778724d58..8a582a06c0 100644 --- a/src/util/virlog.c +++ b/src/util/virlog.c @@ -82,7 +82,7 @@ struct _virLogFilter { }; static int virLogFiltersSerial = 1; -static virLogFilterPtr *virLogFilters; +static virLogFilter **virLogFilters; static size_t virLogNbFilters; /* @@ -100,7 +100,7 @@ struct _virLogOutput { }; static char *virLogDefaultOutput; -static virLogOutputPtr *virLogOutputs; +static virLogOutput **virLogOutputs; static size_t virLogNbOutputs; /* @@ -110,13 +110,13 @@ static virLogPriority virLogDefaultPriority = VIR_LOG_DEFAULT; static void virLogResetFilters(void); static void virLogResetOutputs(void); -static void virLogOutputToFd(virLogSourcePtr src, +static void virLogOutputToFd(virLogSource *src, virLogPriority priority, const char *filename, int linenr, const char *funcname, const char *timestamp, - virLogMetadataPtr metadata, + struct _virLogMetadata *metadata, const char *rawstr, const char *str, void *data); @@ -334,7 +334,7 @@ virLogResetFilters(void) void -virLogFilterFree(virLogFilterPtr filter) +virLogFilterFree(virLogFilter *filter) { if (!filter) return; @@ -352,7 +352,7 @@ virLogFilterFree(virLogFilterPtr filter) * Frees a list of filters. */ void -virLogFilterListFree(virLogFilterPtr *list, int count) +virLogFilterListFree(virLogFilter **list, int count) { size_t i; @@ -380,7 +380,7 @@ virLogResetOutputs(void) void -virLogOutputFree(virLogOutputPtr output) +virLogOutputFree(virLogOutput *output) { if (!output) return; @@ -401,7 +401,7 @@ virLogOutputFree(virLogOutputPtr output) * Frees a list of outputs. */ void -virLogOutputListFree(virLogOutputPtr *list, int count) +virLogOutputListFree(virLogOutput **list, int count) { size_t i; @@ -458,7 +458,7 @@ virLogHostnameString(char **rawmsg, static void -virLogSourceUpdate(virLogSourcePtr source) +virLogSourceUpdate(virLogSource *source) { virLogLock(); if (source->serial < virLogFiltersSerial) { @@ -495,12 +495,12 @@ virLogSourceUpdate(virLogSourcePtr source) */ static void G_GNUC_PRINTF(7, 0) -virLogVMessage(virLogSourcePtr source, +virLogVMessage(virLogSource *source, virLogPriority priority, const char *filename, int linenr, const char *funcname, - virLogMetadataPtr metadata, + struct _virLogMetadata *metadata, const char *fmt, va_list vargs) { @@ -622,12 +622,12 @@ virLogVMessage(virLogSourcePtr source, * the message may be stored, sent to output or just discarded */ void -virLogMessage(virLogSourcePtr source, +virLogMessage(virLogSource *source, virLogPriority priority, const char *filename, int linenr, const char *funcname, - virLogMetadataPtr metadata, + struct _virLogMetadata *metadata, const char *fmt, ...) { va_list ap; @@ -640,13 +640,13 @@ virLogMessage(virLogSourcePtr source, static void -virLogOutputToFd(virLogSourcePtr source G_GNUC_UNUSED, +virLogOutputToFd(virLogSource *source G_GNUC_UNUSED, virLogPriority priority G_GNUC_UNUSED, const char *filename G_GNUC_UNUSED, int linenr G_GNUC_UNUSED, const char *funcname G_GNUC_UNUSED, const char *timestamp, - virLogMetadataPtr metadata G_GNUC_UNUSED, + struct _virLogMetadata *metadata G_GNUC_UNUSED, const char *rawstr G_GNUC_UNUSED, const char *str, void *data) @@ -672,7 +672,7 @@ virLogCloseFd(void *data) } -static virLogOutputPtr +static virLogOutput * virLogNewOutputToStderr(virLogPriority priority) { return virLogOutputNew(virLogOutputToFd, NULL, (void *)STDERR_FILENO, @@ -680,12 +680,12 @@ virLogNewOutputToStderr(virLogPriority priority) } -static virLogOutputPtr +static virLogOutput * virLogNewOutputToFile(virLogPriority priority, const char *file) { int fd; - virLogOutputPtr ret = NULL; + virLogOutput *ret = NULL; fd = open(file, O_CREAT | O_APPEND | O_WRONLY, S_IRUSR | S_IWUSR); if (fd < 0) { @@ -740,13 +740,13 @@ virLogPrioritySyslog(virLogPriority priority) #if WITH_SYSLOG_H static void -virLogOutputToSyslog(virLogSourcePtr source G_GNUC_UNUSED, +virLogOutputToSyslog(virLogSource *source G_GNUC_UNUSED, virLogPriority priority, const char *filename G_GNUC_UNUSED, int linenr G_GNUC_UNUSED, const char *funcname G_GNUC_UNUSED, const char *timestamp G_GNUC_UNUSED, - virLogMetadataPtr metadata G_GNUC_UNUSED, + struct _virLogMetadata *metadata G_GNUC_UNUSED, const char *rawstr G_GNUC_UNUSED, const char *str, void *data G_GNUC_UNUSED) @@ -765,11 +765,11 @@ virLogCloseSyslog(void *data G_GNUC_UNUSED) } -static virLogOutputPtr +static virLogOutput * virLogNewOutputToSyslog(virLogPriority priority, const char *ident) { - virLogOutputPtr ret = NULL; + virLogOutput *ret = NULL; int at = -1; /* There are a couple of issues with syslog: @@ -884,13 +884,13 @@ journalAddInt(struct journalState *state, const char *field, int value) } static void -virLogOutputToJournald(virLogSourcePtr source, +virLogOutputToJournald(virLogSource *source, virLogPriority priority, const char *filename, int linenr, const char *funcname, const char *timestamp G_GNUC_UNUSED, - virLogMetadataPtr metadata, + struct _virLogMetadata *metadata, const char *rawstr, const char *str G_GNUC_UNUSED, void *data) @@ -996,11 +996,11 @@ virLogOutputToJournald(virLogSourcePtr source, } -static virLogOutputPtr +static virLogOutput * virLogNewOutputToJournald(int priority) { int journalfd; - virLogOutputPtr ret = NULL; + virLogOutput *ret = NULL; if ((journalfd = socket(AF_UNIX, SOCK_DGRAM, 0)) < 0) return NULL; @@ -1248,7 +1248,7 @@ bool virLogProbablyLogMessage(const char *str) * * Returns reference to a newly created object or NULL in case of failure. */ -virLogOutputPtr +virLogOutput * virLogOutputNew(virLogOutputFunc f, virLogCloseFunc c, void *data, @@ -1256,7 +1256,7 @@ virLogOutputNew(virLogOutputFunc f, virLogDestination dest, const char *name) { - virLogOutputPtr ret = NULL; + virLogOutput *ret = NULL; char *ndup = NULL; if (dest == VIR_LOG_TO_SYSLOG || dest == VIR_LOG_TO_FILE) { @@ -1298,11 +1298,11 @@ virLogOutputNew(virLogOutputFunc f, * Returns a reference to a newly created filter that needs to be defined using * virLogDefineFilters, or NULL in case of an error. */ -virLogFilterPtr +virLogFilter * virLogFilterNew(const char *match, virLogPriority priority) { - virLogFilterPtr ret = NULL; + virLogFilter *ret = NULL; size_t mlen = strlen(match); if (priority < VIR_LOG_DEBUG || priority > VIR_LOG_ERROR) { @@ -1342,7 +1342,7 @@ virLogFilterNew(const char *match, * specified @dest type and/or @opaque data one was found. */ int -virLogFindOutput(virLogOutputPtr *outputs, size_t noutputs, +virLogFindOutput(virLogOutput **outputs, size_t noutputs, virLogDestination dest, const void *opaque) { size_t i; @@ -1368,7 +1368,7 @@ virLogFindOutput(virLogOutputPtr *outputs, size_t noutputs, * Returns number of outputs successfully defined or -1 in case of error; */ int -virLogDefineOutputs(virLogOutputPtr *outputs, size_t noutputs) +virLogDefineOutputs(virLogOutput **outputs, size_t noutputs) { #if WITH_SYSLOG_H int id; @@ -1416,7 +1416,7 @@ virLogDefineOutputs(virLogOutputPtr *outputs, size_t noutputs) * Returns 0 on success or -1 in case of error. */ int -virLogDefineFilters(virLogFilterPtr *filters, size_t nfilters) +virLogDefineFilters(virLogFilter **filters, size_t nfilters) { if (virLogInitialize() < 0) return -1; @@ -1455,10 +1455,10 @@ virLogDefineFilters(virLogFilterPtr *filters, size_t nfilters) * Returns a newly created logging object from @src on success or NULL in case * of an error. */ -virLogOutputPtr +virLogOutput * virLogParseOutput(const char *src) { - virLogOutputPtr ret = NULL; + virLogOutput *ret = NULL; g_auto(GStrv) tokens = NULL; char *abspath = NULL; size_t count = 0; @@ -1554,7 +1554,7 @@ virLogParseOutput(const char *src) * Returns a newly created logging object from @src on success or NULL in case * of an error. */ -virLogFilterPtr +virLogFilter * virLogParseFilter(const char *src) { virLogPriority prio; @@ -1609,14 +1609,14 @@ virLogParseFilter(const char *src) * Returns the number of outputs parsed or -1 in case of error. */ int -virLogParseOutputs(const char *src, virLogOutputPtr **outputs) +virLogParseOutputs(const char *src, virLogOutput ***outputs) { int at = -1; size_t noutputs = 0; g_auto(GStrv) strings = NULL; GStrv next; - virLogOutputPtr output = NULL; - virLogOutputPtr *list = NULL; + virLogOutput *output = NULL; + virLogOutput **list = NULL; VIR_DEBUG("outputs=%s", src); @@ -1666,13 +1666,13 @@ virLogParseOutputs(const char *src, virLogOutputPtr **outputs) * Returns the number of filter parsed or -1 in case of error. */ int -virLogParseFilters(const char *src, virLogFilterPtr **filters) +virLogParseFilters(const char *src, virLogFilter ***filters) { size_t nfilters = 0; g_auto(GStrv) strings = NULL; GStrv next; - virLogFilterPtr filter = NULL; - virLogFilterPtr *list = NULL; + virLogFilter *filter = NULL; + virLogFilter **list = NULL; VIR_DEBUG("filters=%s", src); @@ -1713,7 +1713,7 @@ virLogSetOutputs(const char *src) int ret = -1; int noutputs = 0; const char *outputstr = virLogDefaultOutput; - virLogOutputPtr *outputs = NULL; + virLogOutput **outputs = NULL; if (virLogInitialize() < 0) return -1; @@ -1755,7 +1755,7 @@ virLogSetFilters(const char *src) { int ret = -1; int nfilters = 0; - virLogFilterPtr *filters = NULL; + virLogFilter **filters = NULL; if (virLogInitialize() < 0) return -1; diff --git a/src/util/virlog.h b/src/util/virlog.h index 984a9d5a43..460e54ba05 100644 --- a/src/util/virlog.h +++ b/src/util/virlog.h @@ -57,8 +57,6 @@ typedef enum { } virLogDestination; typedef struct _virLogSource virLogSource; -typedef virLogSource *virLogSourcePtr; - struct _virLogSource { const char *name; unsigned int priority; @@ -103,13 +101,10 @@ struct _virLogMetadata { }; typedef struct _virLogMetadata virLogMetadata; -typedef struct _virLogMetadata *virLogMetadataPtr; typedef struct _virLogOutput virLogOutput; -typedef virLogOutput *virLogOutputPtr; typedef struct _virLogFilter virLogFilter; -typedef virLogFilter *virLogFilterPtr; /** * virLogOutputFunc: @@ -126,13 +121,13 @@ typedef virLogFilter *virLogFilterPtr; * * Callback function used to output messages */ -typedef void (*virLogOutputFunc) (virLogSourcePtr src, +typedef void (*virLogOutputFunc) (virLogSource *src, virLogPriority priority, const char *filename, int linenr, const char *funcname, const char *timestamp, - virLogMetadataPtr metadata, + struct _virLogMetadata *metadata, const char *rawstr, const char *str, void *data); @@ -152,10 +147,10 @@ char *virLogGetOutputs(void); virLogPriority virLogGetDefaultPriority(void); int virLogSetDefaultPriority(virLogPriority priority); void virLogSetFromEnv(void); -void virLogOutputFree(virLogOutputPtr output); -void virLogOutputListFree(virLogOutputPtr *list, int count); -void virLogFilterFree(virLogFilterPtr filter); -void virLogFilterListFree(virLogFilterPtr *list, int count); +void virLogOutputFree(virLogOutput *output); +void virLogOutputListFree(virLogOutput **list, int count); +void virLogFilterFree(virLogFilter *filter); +void virLogFilterListFree(virLogFilter **list, int count); int virLogSetOutputs(const char *outputs); int virLogSetFilters(const char *filters); char *virLogGetDefaultOutput(void); @@ -170,31 +165,31 @@ void virLogUnlock(void); int virLogReset(void); int virLogParseDefaultPriority(const char *priority); int virLogPriorityFromSyslog(int priority); -void virLogMessage(virLogSourcePtr source, +void virLogMessage(virLogSource *source, virLogPriority priority, const char *filename, int linenr, const char *funcname, - virLogMetadataPtr metadata, + struct _virLogMetadata *metadata, const char *fmt, ...) G_GNUC_PRINTF(7, 8); bool virLogProbablyLogMessage(const char *str); -virLogOutputPtr virLogOutputNew(virLogOutputFunc f, +virLogOutput *virLogOutputNew(virLogOutputFunc f, virLogCloseFunc c, void *data, virLogPriority priority, virLogDestination dest, const char *name) ATTRIBUTE_NONNULL(1); -virLogFilterPtr virLogFilterNew(const char *match, +virLogFilter *virLogFilterNew(const char *match, virLogPriority priority) ATTRIBUTE_NONNULL(1); -int virLogFindOutput(virLogOutputPtr *outputs, size_t noutputs, +int virLogFindOutput(virLogOutput **outputs, size_t noutputs, virLogDestination dest, const void *opaque); -int virLogDefineOutputs(virLogOutputPtr *outputs, +int virLogDefineOutputs(virLogOutput **outputs, size_t noutputs) ATTRIBUTE_NONNULL(1); -int virLogDefineFilters(virLogFilterPtr *filters, size_t nfilters); -virLogOutputPtr virLogParseOutput(const char *src) ATTRIBUTE_NONNULL(1); -virLogFilterPtr virLogParseFilter(const char *src) ATTRIBUTE_NONNULL(1); +int virLogDefineFilters(virLogFilter **filters, size_t nfilters); +virLogOutput *virLogParseOutput(const char *src) ATTRIBUTE_NONNULL(1); +virLogFilter *virLogParseFilter(const char *src) ATTRIBUTE_NONNULL(1); int virLogParseOutputs(const char *src, - virLogOutputPtr **outputs) ATTRIBUTE_NONNULL(1); + virLogOutput ***outputs) ATTRIBUTE_NONNULL(1); int virLogParseFilters(const char *src, - virLogFilterPtr **filters) ATTRIBUTE_NONNULL(1); + virLogFilter ***filters) ATTRIBUTE_NONNULL(1); diff --git a/src/util/virmacaddr.c b/src/util/virmacaddr.c index 3811457f31..6b22384cee 100644 --- a/src/util/virmacaddr.c +++ b/src/util/virmacaddr.c @@ -98,7 +98,7 @@ virMacAddrCmpRaw(const virMacAddr *mac1, * Copy src to dst */ void -virMacAddrSet(virMacAddrPtr dst, const virMacAddr *src) +virMacAddrSet(virMacAddr *dst, const virMacAddr *src) { memcpy(dst, src, sizeof(*src)); } @@ -111,7 +111,7 @@ virMacAddrSet(virMacAddrPtr dst, const virMacAddr *src) * Set the MAC address to the given value */ void -virMacAddrSetRaw(virMacAddrPtr dst, const unsigned char src[VIR_MAC_BUFLEN]) +virMacAddrSetRaw(virMacAddr *dst, const unsigned char src[VIR_MAC_BUFLEN]) { memcpy(dst->addr, src, VIR_MAC_BUFLEN); } @@ -139,7 +139,7 @@ virMacAddrGetRaw(const virMacAddr *src, unsigned char dst[VIR_MAC_BUFLEN]) * Return 0 upon success, or -1 in case of error. */ int -virMacAddrParse(const char* str, virMacAddrPtr addr) +virMacAddrParse(const char* str, virMacAddr *addr) { size_t i; @@ -203,7 +203,7 @@ virMacAddrFormat(const virMacAddr *addr, * Return 0 upon success, or -1 in case of error. */ int -virMacAddrParseHex(const char *str, virMacAddrPtr addr) +virMacAddrParseHex(const char *str, virMacAddr *addr) { size_t i; @@ -218,7 +218,7 @@ virMacAddrParseHex(const char *str, virMacAddrPtr addr) } void virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN], - virMacAddrPtr addr) + virMacAddr *addr) { addr->addr[0] = prefix[0]; addr->addr[1] = prefix[1]; @@ -248,7 +248,7 @@ virMacAddrIsBroadcastRaw(const unsigned char s[VIR_MAC_BUFLEN]) } void -virMacAddrFree(virMacAddrPtr addr) +virMacAddrFree(virMacAddr *addr) { g_free(addr); } diff --git a/src/util/virmacaddr.h b/src/util/virmacaddr.h index e43ac3f32a..1a46565fe6 100644 --- a/src/util/virmacaddr.h +++ b/src/util/virmacaddr.h @@ -28,8 +28,6 @@ #define VIR_MAC_STRING_BUFLEN (VIR_MAC_BUFLEN * 3) typedef struct _virMacAddr virMacAddr; -typedef virMacAddr *virMacAddrPtr; - struct _virMacAddr { unsigned char addr[VIR_MAC_BUFLEN]; }; @@ -45,21 +43,21 @@ int virMacAddrCompare(const char *mac1, const char *mac2); int virMacAddrCmp(const virMacAddr *mac1, const virMacAddr *mac2); int virMacAddrCmpRaw(const virMacAddr *mac1, const unsigned char s[VIR_MAC_BUFLEN]); -void virMacAddrSet(virMacAddrPtr dst, const virMacAddr *src); -void virMacAddrSetRaw(virMacAddrPtr dst, const unsigned char s[VIR_MAC_BUFLEN]); +void virMacAddrSet(virMacAddr *dst, const virMacAddr *src); +void virMacAddrSetRaw(virMacAddr *dst, const unsigned char s[VIR_MAC_BUFLEN]); void virMacAddrGetRaw(const virMacAddr *src, unsigned char dst[VIR_MAC_BUFLEN]); const char *virMacAddrFormat(const virMacAddr *addr, char *str); void virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN], - virMacAddrPtr addr) G_GNUC_NO_INLINE; + virMacAddr *addr) G_GNUC_NO_INLINE; int virMacAddrParse(const char* str, - virMacAddrPtr addr) G_GNUC_WARN_UNUSED_RESULT; + virMacAddr *addr) G_GNUC_WARN_UNUSED_RESULT; int virMacAddrParseHex(const char* str, - virMacAddrPtr addr) + virMacAddr *addr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; bool virMacAddrIsUnicast(const virMacAddr *addr); bool virMacAddrIsMulticast(const virMacAddr *addr); bool virMacAddrIsBroadcastRaw(const unsigned char s[VIR_MAC_BUFLEN]); -void virMacAddrFree(virMacAddrPtr addr); +void virMacAddrFree(virMacAddr *addr); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virMacAddr, virMacAddrFree); diff --git a/src/util/virmacmap.c b/src/util/virmacmap.c index bb14513c30..297d57a931 100644 --- a/src/util/virmacmap.c +++ b/src/util/virmacmap.c @@ -47,13 +47,13 @@ struct virMacMap { }; -static virClassPtr virMacMapClass; +static virClass *virMacMapClass; static void virMacMapDispose(void *obj) { - virMacMapPtr mgr = obj; + virMacMap *mgr = obj; GHashTableIter htitr; void *value; @@ -78,7 +78,7 @@ VIR_ONCE_GLOBAL_INIT(virMacMap); static void -virMacMapAddLocked(virMacMapPtr mgr, +virMacMapAddLocked(virMacMap *mgr, const char *domain, const char *mac) { @@ -101,7 +101,7 @@ virMacMapAddLocked(virMacMapPtr mgr, static void -virMacMapRemoveLocked(virMacMapPtr mgr, +virMacMapRemoveLocked(virMacMap *mgr, const char *domain, const char *mac) { @@ -132,7 +132,7 @@ virMacMapRemoveLocked(virMacMapPtr mgr, static int -virMacMapLoadFile(virMacMapPtr mgr, +virMacMapLoadFile(virMacMap *mgr, const char *file) { g_autofree char *map_str = NULL; @@ -164,8 +164,8 @@ virMacMapLoadFile(virMacMapPtr mgr, } for (i = 0; i < virJSONValueArraySize(map); i++) { - virJSONValuePtr tmp = virJSONValueArrayGet(map, i); - virJSONValuePtr macs; + virJSONValue *tmp = virJSONValueArrayGet(map, i); + virJSONValue *macs; const char *domain; size_t j; GSList *vals = NULL; @@ -190,7 +190,7 @@ virMacMapLoadFile(virMacMapPtr mgr, } for (j = 0; j < virJSONValueArraySize(macs); j++) { - virJSONValuePtr macJSON = virJSONValueArrayGet(macs, j); + virJSONValue *macJSON = virJSONValueArrayGet(macs, j); vals = g_slist_prepend(vals, g_strdup(virJSONValueGetString(macJSON))); } @@ -232,7 +232,7 @@ virMACMapHashDumper(void *payload, static int -virMacMapDumpStrLocked(virMacMapPtr mgr, +virMacMapDumpStrLocked(virMacMap *mgr, char **str) { g_autoptr(virJSONValue) arr = virJSONValueNewArray(); @@ -248,7 +248,7 @@ virMacMapDumpStrLocked(virMacMapPtr mgr, static int -virMacMapWriteFileLocked(virMacMapPtr mgr, +virMacMapWriteFileLocked(virMacMap *mgr, const char *file) { g_autofree char *str = NULL; @@ -277,10 +277,10 @@ virMacMapFileName(const char *dnsmasqStateDir, #define VIR_MAC_HASH_TABLE_SIZE 10 -virMacMapPtr +virMacMap * virMacMapNew(const char *file) { - virMacMapPtr mgr; + virMacMap *mgr; if (virMacMapInitialize() < 0) return NULL; @@ -307,7 +307,7 @@ virMacMapNew(const char *file) int -virMacMapAdd(virMacMapPtr mgr, +virMacMapAdd(virMacMap *mgr, const char *domain, const char *mac) { @@ -319,7 +319,7 @@ virMacMapAdd(virMacMapPtr mgr, int -virMacMapRemove(virMacMapPtr mgr, +virMacMapRemove(virMacMap *mgr, const char *domain, const char *mac) { @@ -332,7 +332,7 @@ virMacMapRemove(virMacMapPtr mgr, /* note that the returned pointer may be invalidated by other APIs in this module */ GSList * -virMacMapLookup(virMacMapPtr mgr, +virMacMapLookup(virMacMap *mgr, const char *domain) { GSList *ret; @@ -345,7 +345,7 @@ virMacMapLookup(virMacMapPtr mgr, int -virMacMapWriteFile(virMacMapPtr mgr, +virMacMapWriteFile(virMacMap *mgr, const char *filename) { int ret; @@ -358,7 +358,7 @@ virMacMapWriteFile(virMacMapPtr mgr, int -virMacMapDumpStr(virMacMapPtr mgr, +virMacMapDumpStr(virMacMap *mgr, char **str) { int ret; diff --git a/src/util/virmacmap.h b/src/util/virmacmap.h index 96e32256e3..582c4a8bdf 100644 --- a/src/util/virmacmap.h +++ b/src/util/virmacmap.h @@ -23,27 +23,26 @@ #include "internal.h" typedef struct virMacMap virMacMap; -typedef virMacMap *virMacMapPtr; char * virMacMapFileName(const char *dnsmasqStateDir, const char *bridge); -virMacMapPtr virMacMapNew(const char *file); +virMacMap *virMacMapNew(const char *file); -int virMacMapAdd(virMacMapPtr mgr, +int virMacMapAdd(virMacMap *mgr, const char *domain, const char *mac); -int virMacMapRemove(virMacMapPtr mgr, +int virMacMapRemove(virMacMap *mgr, const char *domain, const char *mac); -GSList *virMacMapLookup(virMacMapPtr mgr, +GSList *virMacMapLookup(virMacMap *mgr, const char *domain); -int virMacMapWriteFile(virMacMapPtr mgr, +int virMacMapWriteFile(virMacMap *mgr, const char *filename); -int virMacMapDumpStr(virMacMapPtr mgr, +int virMacMapDumpStr(virMacMap *mgr, char **str); diff --git a/src/util/virmdev.c b/src/util/virmdev.c index 2b7f730bd1..7f4a499536 100644 --- a/src/util/virmdev.c +++ b/src/util/virmdev.c @@ -43,7 +43,7 @@ struct _virMediatedDeviceList { virObjectLockable parent; size_t count; - virMediatedDevicePtr *devs; + virMediatedDevice **devs; }; VIR_ENUM_IMPL(virMediatedDeviceModel, @@ -53,7 +53,7 @@ VIR_ENUM_IMPL(virMediatedDeviceModel, "vfio-ap", ); -static virClassPtr virMediatedDeviceListClass; +static virClass *virMediatedDeviceListClass; static void virMediatedDeviceListDispose(void *obj); @@ -72,7 +72,7 @@ VIR_ONCE_GLOBAL_INIT(virMediated); #ifdef __linux__ static int -virMediatedDeviceGetSysfsDeviceAPI(virMediatedDevicePtr dev, +virMediatedDeviceGetSysfsDeviceAPI(virMediatedDevice *dev, char **device_api) { g_autofree char *buf = NULL; @@ -102,7 +102,7 @@ virMediatedDeviceGetSysfsDeviceAPI(virMediatedDevicePtr dev, static int -virMediatedDeviceCheckModel(virMediatedDevicePtr dev, +virMediatedDeviceCheckModel(virMediatedDevice *dev, virMediatedDeviceModelType model) { g_autofree char *dev_api = NULL; @@ -134,7 +134,7 @@ virMediatedDeviceCheckModel(virMediatedDevicePtr dev, } -virMediatedDevicePtr +virMediatedDevice * virMediatedDeviceNew(const char *uuidstr, virMediatedDeviceModelType model) { g_autoptr(virMediatedDevice) dev = NULL; @@ -165,7 +165,7 @@ virMediatedDeviceNew(const char *uuidstr, virMediatedDeviceModelType model) #else -virMediatedDevicePtr +virMediatedDevice * virMediatedDeviceNew(const char *uuidstr G_GNUC_UNUSED, virMediatedDeviceModelType model G_GNUC_UNUSED) { @@ -178,7 +178,7 @@ virMediatedDeviceNew(const char *uuidstr G_GNUC_UNUSED, #endif /* __linux__ */ void -virMediatedDeviceFree(virMediatedDevicePtr dev) +virMediatedDeviceFree(virMediatedDevice *dev) { if (!dev) return; @@ -190,7 +190,7 @@ virMediatedDeviceFree(virMediatedDevicePtr dev) const char * -virMediatedDeviceGetPath(virMediatedDevicePtr dev) +virMediatedDeviceGetPath(virMediatedDevice *dev) { return dev->path; } @@ -247,7 +247,7 @@ virMediatedDeviceGetIOMMUGroupNum(const char *uuidstr) void -virMediatedDeviceGetUsedBy(virMediatedDevicePtr dev, +virMediatedDeviceGetUsedBy(virMediatedDevice *dev, const char **drvname, const char **domname) { *drvname = dev->used_by_drvname; @@ -256,7 +256,7 @@ virMediatedDeviceGetUsedBy(virMediatedDevicePtr dev, int -virMediatedDeviceSetUsedBy(virMediatedDevicePtr dev, +virMediatedDeviceSetUsedBy(virMediatedDevice *dev, const char *drvname, const char *domname) { @@ -269,10 +269,10 @@ virMediatedDeviceSetUsedBy(virMediatedDevicePtr dev, } -virMediatedDeviceListPtr +virMediatedDeviceList * virMediatedDeviceListNew(void) { - virMediatedDeviceListPtr list; + virMediatedDeviceList *list; if (virMediatedInitialize() < 0) return NULL; @@ -287,7 +287,7 @@ virMediatedDeviceListNew(void) static void virMediatedDeviceListDispose(void *obj) { - virMediatedDeviceListPtr list = obj; + virMediatedDeviceList *list = obj; size_t i; for (i = 0; i < list->count; i++) { @@ -304,8 +304,8 @@ virMediatedDeviceListDispose(void *obj) * the pointer and we need to clear the original not a copy on the stack */ int -virMediatedDeviceListAdd(virMediatedDeviceListPtr list, - virMediatedDevicePtr *dev) +virMediatedDeviceListAdd(virMediatedDeviceList *list, + virMediatedDevice **dev) { if (virMediatedDeviceListFind(list, (*dev)->path)) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -316,8 +316,8 @@ virMediatedDeviceListAdd(virMediatedDeviceListPtr list, } -virMediatedDevicePtr -virMediatedDeviceListGet(virMediatedDeviceListPtr list, +virMediatedDevice * +virMediatedDeviceListGet(virMediatedDeviceList *list, ssize_t idx) { if (idx < 0 || idx >= list->count) @@ -328,17 +328,17 @@ virMediatedDeviceListGet(virMediatedDeviceListPtr list, size_t -virMediatedDeviceListCount(virMediatedDeviceListPtr list) +virMediatedDeviceListCount(virMediatedDeviceList *list) { return list->count; } -virMediatedDevicePtr -virMediatedDeviceListStealIndex(virMediatedDeviceListPtr list, +virMediatedDevice * +virMediatedDeviceListStealIndex(virMediatedDeviceList *list, ssize_t idx) { - virMediatedDevicePtr ret; + virMediatedDevice *ret; if (idx < 0 || idx >= list->count) return NULL; @@ -349,9 +349,9 @@ virMediatedDeviceListStealIndex(virMediatedDeviceListPtr list, } -virMediatedDevicePtr -virMediatedDeviceListSteal(virMediatedDeviceListPtr list, - virMediatedDevicePtr dev) +virMediatedDevice * +virMediatedDeviceListSteal(virMediatedDeviceList *list, + virMediatedDevice *dev) { int idx = -1; @@ -365,21 +365,21 @@ virMediatedDeviceListSteal(virMediatedDeviceListPtr list, void -virMediatedDeviceListDel(virMediatedDeviceListPtr list, - virMediatedDevicePtr dev) +virMediatedDeviceListDel(virMediatedDeviceList *list, + virMediatedDevice *dev) { virMediatedDeviceFree(virMediatedDeviceListSteal(list, dev)); } int -virMediatedDeviceListFindIndex(virMediatedDeviceListPtr list, +virMediatedDeviceListFindIndex(virMediatedDeviceList *list, const char *sysfspath) { size_t i; for (i = 0; i < list->count; i++) { - virMediatedDevicePtr dev = list->devs[i]; + virMediatedDevice *dev = list->devs[i]; if (STREQ(sysfspath, dev->path)) return i; } @@ -387,8 +387,8 @@ virMediatedDeviceListFindIndex(virMediatedDeviceListPtr list, } -virMediatedDevicePtr -virMediatedDeviceListFind(virMediatedDeviceListPtr list, +virMediatedDevice * +virMediatedDeviceListFind(virMediatedDeviceList *list, const char *sysfspath) { int idx; @@ -401,11 +401,11 @@ virMediatedDeviceListFind(virMediatedDeviceListPtr list, bool -virMediatedDeviceIsUsed(virMediatedDevicePtr dev, - virMediatedDeviceListPtr list) +virMediatedDeviceIsUsed(virMediatedDevice *dev, + virMediatedDeviceList *list) { const char *drvname, *domname; - virMediatedDevicePtr tmp = NULL; + virMediatedDevice *tmp = NULL; if ((tmp = virMediatedDeviceListFind(list, dev->path))) { virMediatedDeviceGetUsedBy(tmp, &drvname, &domname); @@ -427,8 +427,8 @@ virMediatedDeviceGetSysfsPath(const char *uuidstr) int -virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst, - virMediatedDeviceListPtr src, +virMediatedDeviceListMarkDevices(virMediatedDeviceList *dst, + virMediatedDeviceList *src, const char *drvname, const char *domname) { @@ -438,7 +438,7 @@ virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst, virObjectLock(dst); for (i = 0; i < count; i++) { - virMediatedDevicePtr mdev = virMediatedDeviceListGet(src, i); + virMediatedDevice *mdev = virMediatedDeviceListGet(src, i); if (virMediatedDeviceIsUsed(mdev, dst) || virMediatedDeviceSetUsedBy(mdev, drvname, domname) < 0) @@ -462,7 +462,7 @@ virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst, rollback: for (j = 0; j < i; j++) { - virMediatedDevicePtr tmp = virMediatedDeviceListGet(src, j); + virMediatedDevice *tmp = virMediatedDeviceListGet(src, j); virMediatedDeviceListSteal(dst, tmp); } goto cleanup; @@ -470,7 +470,7 @@ virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst, void -virMediatedDeviceTypeFree(virMediatedDeviceTypePtr type) +virMediatedDeviceTypeFree(virMediatedDeviceType *type) { if (!type) return; @@ -484,7 +484,7 @@ virMediatedDeviceTypeFree(virMediatedDeviceTypePtr type) int virMediatedDeviceTypeReadAttrs(const char *sysfspath, - virMediatedDeviceTypePtr *type) + virMediatedDeviceType **type) { g_autoptr(virMediatedDeviceType) tmp = NULL; @@ -515,12 +515,12 @@ virMediatedDeviceTypeReadAttrs(const char *sysfspath, return 0; } -virMediatedDeviceAttrPtr virMediatedDeviceAttrNew(void) +virMediatedDeviceAttr *virMediatedDeviceAttrNew(void) { return g_new0(virMediatedDeviceAttr, 1); } -void virMediatedDeviceAttrFree(virMediatedDeviceAttrPtr attr) +void virMediatedDeviceAttrFree(virMediatedDeviceAttr *attr) { g_free(attr->name); g_free(attr->value); @@ -532,7 +532,7 @@ void virMediatedDeviceAttrFree(virMediatedDeviceAttrPtr attr) ssize_t virMediatedDeviceGetMdevTypes(const char *sysfspath, - virMediatedDeviceTypePtr **types, + virMediatedDeviceType ***types, size_t *ntypes) { ssize_t ret = -1; @@ -541,7 +541,7 @@ virMediatedDeviceGetMdevTypes(const char *sysfspath, struct dirent *entry; g_autofree char *types_path = NULL; g_autoptr(virMediatedDeviceType) mdev_type = NULL; - virMediatedDeviceTypePtr *mdev_types = NULL; + virMediatedDeviceType **mdev_types = NULL; size_t nmdev_types = 0; size_t i; @@ -586,7 +586,7 @@ static const char *unsupported = N_("not supported on non-linux platforms"); ssize_t virMediatedDeviceGetMdevTypes(const char *sysfspath G_GNUC_UNUSED, - virMediatedDeviceTypePtr **types G_GNUC_UNUSED, + virMediatedDeviceType ***types G_GNUC_UNUSED, size_t *ntypes G_GNUC_UNUSED) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); diff --git a/src/util/virmdev.h b/src/util/virmdev.h index e96e5bb8c6..4d3655a091 100644 --- a/src/util/virmdev.h +++ b/src/util/virmdev.h @@ -34,26 +34,21 @@ VIR_ENUM_DECL(virMediatedDeviceModel); typedef struct _virMediatedDevice virMediatedDevice; -typedef virMediatedDevice *virMediatedDevicePtr; typedef struct _virMediatedDeviceList virMediatedDeviceList; -typedef virMediatedDeviceList *virMediatedDeviceListPtr; typedef struct _virMediatedDeviceAttr virMediatedDeviceAttr; -typedef virMediatedDeviceAttr *virMediatedDeviceAttrPtr; - struct _virMediatedDeviceAttr { char *name; char *value; }; -virMediatedDeviceAttrPtr virMediatedDeviceAttrNew(void); -void virMediatedDeviceAttrFree(virMediatedDeviceAttrPtr attr); +virMediatedDeviceAttr *virMediatedDeviceAttrNew(void); +void virMediatedDeviceAttrFree(virMediatedDeviceAttr *attr); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virMediatedDeviceAttr, virMediatedDeviceAttrFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virMediatedDeviceList, virObjectUnref); typedef struct _virMediatedDeviceType virMediatedDeviceType; -typedef virMediatedDeviceType *virMediatedDeviceTypePtr; struct _virMediatedDeviceType { char *id; char *name; @@ -61,27 +56,27 @@ struct _virMediatedDeviceType { unsigned int available_instances; }; -typedef int (*virMediatedDeviceCallback)(virMediatedDevicePtr dev, +typedef int (*virMediatedDeviceCallback)(virMediatedDevice *dev, const char *path, void *opaque); -virMediatedDevicePtr +virMediatedDevice * virMediatedDeviceNew(const char *uuidstr, virMediatedDeviceModelType model); -virMediatedDevicePtr -virMediatedDeviceCopy(virMediatedDevicePtr dev); +virMediatedDevice * +virMediatedDeviceCopy(virMediatedDevice *dev); void -virMediatedDeviceFree(virMediatedDevicePtr dev); +virMediatedDeviceFree(virMediatedDevice *dev); const char * -virMediatedDeviceGetPath(virMediatedDevicePtr dev); +virMediatedDeviceGetPath(virMediatedDevice *dev); void -virMediatedDeviceGetUsedBy(virMediatedDevicePtr dev, +virMediatedDeviceGetUsedBy(virMediatedDevice *dev, const char **drvname, const char **domname); int -virMediatedDeviceSetUsedBy(virMediatedDevicePtr dev, +virMediatedDeviceSetUsedBy(virMediatedDevice *dev, const char *drvname, const char *domname); @@ -95,63 +90,63 @@ char * virMediatedDeviceGetSysfsPath(const char *uuidstr); bool -virMediatedDeviceIsUsed(virMediatedDevicePtr dev, - virMediatedDeviceListPtr list); +virMediatedDeviceIsUsed(virMediatedDevice *dev, + virMediatedDeviceList *list); bool -virMediatedDeviceIsUsed(virMediatedDevicePtr dev, - virMediatedDeviceListPtr list); +virMediatedDeviceIsUsed(virMediatedDevice *dev, + virMediatedDeviceList *list); -virMediatedDeviceListPtr +virMediatedDeviceList * virMediatedDeviceListNew(void); int -virMediatedDeviceListAdd(virMediatedDeviceListPtr list, - virMediatedDevicePtr *dev); +virMediatedDeviceListAdd(virMediatedDeviceList *list, + virMediatedDevice **dev); -virMediatedDevicePtr -virMediatedDeviceListGet(virMediatedDeviceListPtr list, +virMediatedDevice * +virMediatedDeviceListGet(virMediatedDeviceList *list, ssize_t idx); size_t -virMediatedDeviceListCount(virMediatedDeviceListPtr list); +virMediatedDeviceListCount(virMediatedDeviceList *list); -virMediatedDevicePtr -virMediatedDeviceListSteal(virMediatedDeviceListPtr list, - virMediatedDevicePtr dev); +virMediatedDevice * +virMediatedDeviceListSteal(virMediatedDeviceList *list, + virMediatedDevice *dev); -virMediatedDevicePtr -virMediatedDeviceListStealIndex(virMediatedDeviceListPtr list, +virMediatedDevice * +virMediatedDeviceListStealIndex(virMediatedDeviceList *list, ssize_t idx); void -virMediatedDeviceListDel(virMediatedDeviceListPtr list, - virMediatedDevicePtr dev); +virMediatedDeviceListDel(virMediatedDeviceList *list, + virMediatedDevice *dev); -virMediatedDevicePtr -virMediatedDeviceListFind(virMediatedDeviceListPtr list, +virMediatedDevice * +virMediatedDeviceListFind(virMediatedDeviceList *list, const char *sysfspath); int -virMediatedDeviceListFindIndex(virMediatedDeviceListPtr list, +virMediatedDeviceListFindIndex(virMediatedDeviceList *list, const char *sysfspath); int -virMediatedDeviceListMarkDevices(virMediatedDeviceListPtr dst, - virMediatedDeviceListPtr src, +virMediatedDeviceListMarkDevices(virMediatedDeviceList *dst, + virMediatedDeviceList *src, const char *drvname, const char *domname); void -virMediatedDeviceTypeFree(virMediatedDeviceTypePtr type); +virMediatedDeviceTypeFree(virMediatedDeviceType *type); int virMediatedDeviceTypeReadAttrs(const char *sysfspath, - virMediatedDeviceTypePtr *type); + virMediatedDeviceType **type); ssize_t virMediatedDeviceGetMdevTypes(const char *sysfspath, - virMediatedDeviceTypePtr **types, + virMediatedDeviceType ***types, size_t *ntypes); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virMediatedDevice, virMediatedDeviceFree); diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 90d583ad96..4263a07b59 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -115,7 +115,6 @@ typedef enum { } virMCastType; typedef struct _virNetDevMcastEntry virNetDevMcastEntry; -typedef virNetDevMcastEntry *virNetDevMcastEntryPtr; struct _virNetDevMcastEntry { int idx; char name[VIR_MCAST_NAME_LEN]; @@ -125,7 +124,7 @@ struct _virNetDevMcastEntry { }; static void -virNetDevMcastEntryFree(virNetDevMcastEntryPtr entry) +virNetDevMcastEntryFree(virNetDevMcastEntry *entry) { g_free(entry); } @@ -133,10 +132,9 @@ virNetDevMcastEntryFree(virNetDevMcastEntryPtr entry) G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevMcastEntry, virNetDevMcastEntryFree); typedef struct _virNetDevMcastList virNetDevMcastList; -typedef virNetDevMcastList *virNetDevMcastListPtr; struct _virNetDevMcastList { size_t nentries; - virNetDevMcastEntryPtr *entries; + virNetDevMcastEntry **entries; }; #if defined(WITH_STRUCT_IFREQ) @@ -370,7 +368,7 @@ virNetDevSetMAC(const char *ifname, * Returns 0 in case of success or -1 on failure */ int virNetDevGetMAC(const char *ifname, - virMacAddrPtr macaddr) + virMacAddr *macaddr) { struct ifreq ifr; VIR_AUTOCLOSE fd = -1; @@ -391,7 +389,7 @@ int virNetDevGetMAC(const char *ifname, } #else int virNetDevGetMAC(const char *ifname, - virMacAddrPtr macaddr G_GNUC_UNUSED) + virMacAddr *macaddr G_GNUC_UNUSED) { virReportSystemError(ENOSYS, _("Cannot get interface MAC on '%s'"), @@ -1125,7 +1123,7 @@ virNetDevIsPCIDevice(const char *devpath) } -static virPCIDevicePtr +static virPCIDevice * virNetDevGetPCIDevice(const char *devName) { g_autofree char *vfSysfsDevicePath = NULL; @@ -1226,7 +1224,7 @@ virNetDevGetPhysPortName(const char *ifname, int virNetDevGetVirtualFunctions(const char *pfname, char ***vfname, - virPCIDeviceAddressPtr **virt_fns, + virPCIDeviceAddress ***virt_fns, size_t *n_vfname, unsigned int *max_vfs) { @@ -1481,7 +1479,7 @@ virNetDevGetPhysPortName(const char *ifname G_GNUC_UNUSED, int virNetDevGetVirtualFunctions(const char *pfname G_GNUC_UNUSED, char ***vfname G_GNUC_UNUSED, - virPCIDeviceAddressPtr **virt_fns G_GNUC_UNUSED, + virPCIDeviceAddress ***virt_fns G_GNUC_UNUSED, size_t *n_vfname G_GNUC_UNUSED, unsigned int *max_vfs G_GNUC_UNUSED) { @@ -1714,7 +1712,7 @@ virNetDevSetVfConfig(const char *ifname, int vf, * data is better than add a new function. */ static int -virNetDevParseVfInfo(struct nlattr **tb, int32_t vf, virMacAddrPtr mac, +virNetDevParseVfInfo(struct nlattr **tb, int32_t vf, virMacAddr *mac, int *vlanid, virDomainInterfaceStatsPtr stats) { int rc = -1; @@ -1789,7 +1787,7 @@ virNetDevParseVfInfo(struct nlattr **tb, int32_t vf, virMacAddrPtr mac, } static int -virNetDevGetVfConfig(const char *ifname, int vf, virMacAddrPtr mac, +virNetDevGetVfConfig(const char *ifname, int vf, virMacAddr *mac, int *vlanid) { g_autofree void *nlData = NULL; @@ -1812,7 +1810,7 @@ virNetDevGetVfConfig(const char *ifname, int vf, virMacAddrPtr mac, * Returns 0 on success, -1 on failure. */ int -virNetDevVFInterfaceStats(virPCIDeviceAddressPtr vfAddr, +virNetDevVFInterfaceStats(virPCIDeviceAddress *vfAddr, virDomainInterfaceStatsPtr stats) { g_autofree void *nlData = NULL; @@ -2028,9 +2026,9 @@ virNetDevSaveNetConfig(const char *linkdev, int vf, int virNetDevReadNetConfig(const char *linkdev, int vf, const char *stateDir, - virMacAddrPtr *adminMAC, - virNetDevVlanPtr *vlan, - virMacAddrPtr *MAC) + virMacAddr **adminMAC, + virNetDevVlan **vlan, + virMacAddr **MAC) { int ret = -1; const char *pfDevName = NULL; @@ -2427,9 +2425,9 @@ int virNetDevReadNetConfig(const char *linkdev G_GNUC_UNUSED, int vf G_GNUC_UNUSED, const char *stateDir G_GNUC_UNUSED, - virMacAddrPtr *adminMAC G_GNUC_UNUSED, - virNetDevVlanPtr *vlan G_GNUC_UNUSED, - virMacAddrPtr *MAC G_GNUC_UNUSED) + virMacAddr **adminMAC G_GNUC_UNUSED, + virNetDevVlan **vlan G_GNUC_UNUSED, + virMacAddr **MAC G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("Unable to read net device config on this platform")); @@ -2452,7 +2450,7 @@ virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUSED, int -virNetDevVFInterfaceStats(virPCIDeviceAddressPtr vfAddr G_GNUC_UNUSED, +virNetDevVFInterfaceStats(virPCIDeviceAddress *vfAddr G_GNUC_UNUSED, virDomainInterfaceStatsPtr stats G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", @@ -2492,7 +2490,7 @@ VIR_ENUM_IMPL(virNetDevFeature, #ifdef __linux__ int virNetDevGetLinkInfo(const char *ifname, - virNetDevIfLinkPtr lnk) + virNetDevIfLink *lnk) { g_autofree char *path = NULL; g_autofree char *buf = NULL; @@ -2583,7 +2581,7 @@ virNetDevGetLinkInfo(const char *ifname, int virNetDevGetLinkInfo(const char *ifname, - virNetDevIfLinkPtr lnk) + virNetDevIfLink *lnk) { /* Port me */ VIR_DEBUG("Getting link info on %s is not implemented on this platform", @@ -2607,7 +2605,7 @@ virNetDevGetLinkInfo(const char *ifname, * Returns 0 in case of success or -1 on failure */ int virNetDevAddMulti(const char *ifname, - virMacAddrPtr macaddr) + virMacAddr *macaddr) { struct ifreq ifr; VIR_AUTOCLOSE fd = -1; @@ -2630,7 +2628,7 @@ int virNetDevAddMulti(const char *ifname, } #else int virNetDevAddMulti(const char *ifname G_GNUC_UNUSED, - virMacAddrPtr macaddr G_GNUC_UNUSED) + virMacAddr *macaddr G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("Unable to add address to interface " @@ -2652,7 +2650,7 @@ int virNetDevAddMulti(const char *ifname G_GNUC_UNUSED, * Returns 0 in case of success or -1 on failure */ int virNetDevDelMulti(const char *ifname, - virMacAddrPtr macaddr) + virMacAddr *macaddr) { struct ifreq ifr; VIR_AUTOCLOSE fd = -1; @@ -2675,7 +2673,7 @@ int virNetDevDelMulti(const char *ifname, } #else int virNetDevDelMulti(const char *ifname G_GNUC_UNUSED, - virMacAddrPtr macaddr G_GNUC_UNUSED) + virMacAddr *macaddr G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", _("Unable to delete address from interface " @@ -2684,7 +2682,7 @@ int virNetDevDelMulti(const char *ifname G_GNUC_UNUSED, } #endif -static int virNetDevParseMcast(char *buf, virNetDevMcastEntryPtr mcast) +static int virNetDevParseMcast(char *buf, virNetDevMcastEntry *mcast) { int ifindex; int num; @@ -2761,7 +2759,7 @@ static int virNetDevParseMcast(char *buf, virNetDevMcastEntryPtr mcast) } -static void virNetDevMcastListClear(virNetDevMcastListPtr mcast) +static void virNetDevMcastListClear(virNetDevMcastList *mcast) { size_t i; @@ -2773,7 +2771,7 @@ static void virNetDevMcastListClear(virNetDevMcastListPtr mcast) static int virNetDevGetMcastList(const char *ifname, - virNetDevMcastListPtr mcast) + virNetDevMcastList *mcast) { char *cur = NULL; g_autofree char *buf = NULL; @@ -2823,7 +2821,7 @@ VIR_ENUM_IMPL(virNetDevRxFilterMode, static int virNetDevGetMulticastTable(const char *ifname, - virNetDevRxFilterPtr filter) + virNetDevRxFilter *filter) { size_t i; int ret = -1; @@ -2853,10 +2851,10 @@ static int virNetDevGetMulticastTable(const char *ifname, } -virNetDevRxFilterPtr +virNetDevRxFilter * virNetDevRxFilterNew(void) { - virNetDevRxFilterPtr filter; + virNetDevRxFilter *filter; filter = g_new0(virNetDevRxFilter, 1); return filter; @@ -2864,7 +2862,7 @@ virNetDevRxFilterNew(void) void -virNetDevRxFilterFree(virNetDevRxFilterPtr filter) +virNetDevRxFilterFree(virNetDevRxFilter *filter) { if (filter) { g_free(filter->name); @@ -2886,11 +2884,11 @@ virNetDevRxFilterFree(virNetDevRxFilterPtr filter) * Returns 0 or -1 on failure. */ int virNetDevGetRxFilter(const char *ifname, - virNetDevRxFilterPtr *filter) + virNetDevRxFilter **filter) { int ret = -1; bool receive = false; - virNetDevRxFilterPtr fil = virNetDevRxFilterNew(); + virNetDevRxFilter *fil = virNetDevRxFilterNew(); if (!fil) goto cleanup; @@ -2944,7 +2942,7 @@ int virNetDevGetRxFilter(const char *ifname, */ static int virNetDevRDMAFeature(const char *ifname, - virBitmapPtr *out) + virBitmap **out) { g_autofree char *eth_devpath = NULL; g_autofree char *eth_res_buf = NULL; @@ -3045,7 +3043,7 @@ virNetDevFeatureAvailable(const char *ifname, int fd, struct ifreq *ifr, struct static void virNetDevGetEthtoolFeatures(const char *ifname, - virBitmapPtr bitmap, + virBitmap *bitmap, int fd, struct ifreq *ifr) { @@ -3177,7 +3175,7 @@ virNetDevGetFamilyId(const char *family_name, */ static int virNetDevSwitchdevFeature(const char *ifname, - virBitmapPtr *out) + virBitmap **out) { struct nl_msg *nl_msg = NULL; g_autofree struct nlmsghdr *resp = NULL; @@ -3248,7 +3246,7 @@ virNetDevSwitchdevFeature(const char *ifname, # else static int virNetDevSwitchdevFeature(const char *ifname G_GNUC_UNUSED, - virBitmapPtr *out G_GNUC_UNUSED) + virBitmap **out G_GNUC_UNUSED) { return 0; } @@ -3281,7 +3279,7 @@ virNetDevGFeatureAvailable(const char *ifname, static int virNetDevGetEthtoolGFeatures(const char *ifname, - virBitmapPtr bitmap, + virBitmap *bitmap, int fd, struct ifreq *ifr) { @@ -3299,7 +3297,7 @@ virNetDevGetEthtoolGFeatures(const char *ifname, # else static int virNetDevGetEthtoolGFeatures(const char *ifname G_GNUC_UNUSED, - virBitmapPtr bitmap G_GNUC_UNUSED, + virBitmap *bitmap G_GNUC_UNUSED, int fd G_GNUC_UNUSED, struct ifreq *ifr G_GNUC_UNUSED) { @@ -3321,7 +3319,7 @@ virNetDevGetEthtoolGFeatures(const char *ifname G_GNUC_UNUSED, * Returns 0 in case of success or -1 on failure */ int virNetDevSetCoalesce(const char *ifname, - virNetDevCoalescePtr coalesce, + virNetDevCoalesce *coalesce, bool update) { struct ifreq ifr; @@ -3406,7 +3404,7 @@ int virNetDevSetCoalesce(const char *ifname, } # else int virNetDevSetCoalesce(const char *ifname, - virNetDevCoalescePtr coalesce, + virNetDevCoalesce *coalesce, bool update) { if (!coalesce && !update) @@ -3432,7 +3430,7 @@ int virNetDevSetCoalesce(const char *ifname, */ int virNetDevGetFeatures(const char *ifname, - virBitmapPtr *out) + virBitmap **out) { struct ifreq ifr; VIR_AUTOCLOSE fd = -1; @@ -3458,7 +3456,7 @@ virNetDevGetFeatures(const char *ifname, #else int virNetDevGetFeatures(const char *ifname G_GNUC_UNUSED, - virBitmapPtr *out G_GNUC_UNUSED) + virBitmap **out G_GNUC_UNUSED) { VIR_DEBUG("Getting network device features on %s is not implemented on this platform", ifname); @@ -3466,7 +3464,7 @@ virNetDevGetFeatures(const char *ifname G_GNUC_UNUSED, } int virNetDevSetCoalesce(const char *ifname, - virNetDevCoalescePtr coalesce, + virNetDevCoalesce *coalesce, bool update) { if (!coalesce && !update) diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h index e9349e7f59..1f03d88293 100644 --- a/src/util/virnetdev.h +++ b/src/util/virnetdev.h @@ -56,7 +56,6 @@ typedef enum { VIR_ENUM_DECL(virNetDevRxFilterMode); typedef struct _virNetDevRxFilter virNetDevRxFilter; -typedef virNetDevRxFilter *virNetDevRxFilterPtr; struct _virNetDevRxFilter { char *name; /* the alias used by qemu, *not* name used by guest */ virMacAddr mac; @@ -66,13 +65,13 @@ struct _virNetDevRxFilter { struct { int mode; /* enum virNetDevRxFilterMode */ bool overflow; - virMacAddrPtr table; + virMacAddr *table; size_t nTable; } unicast; struct { int mode; /* enum virNetDevRxFilterMode */ bool overflow; - virMacAddrPtr table; + virMacAddr *table; size_t nTable; } multicast; struct { @@ -96,7 +95,6 @@ typedef enum { VIR_ENUM_DECL(virNetDevIfState); typedef struct _virNetDevIfLink virNetDevIfLink; -typedef virNetDevIfLink *virNetDevIfLinkPtr; struct _virNetDevIfLink { virNetDevIfState state; /* link state */ unsigned int speed; /* link speed in Mbits per second */ @@ -125,7 +123,6 @@ VIR_ENUM_DECL(virNetDevFeature); /* Modeled after struct ethtool_coalesce, see linux/ethtool.h for explanations * of particular fields */ typedef struct _virNetDevCoalesce virNetDevCoalesce; -typedef virNetDevCoalesce *virNetDevCoalescePtr; struct _virNetDevCoalesce { uint32_t rx_coalesce_usecs; uint32_t rx_max_coalesced_frames; @@ -159,7 +156,6 @@ typedef enum { } virNetDevGenNameType; typedef struct _virNetDevGenName virNetDevGenName; -typedef virNetDevGenName *virNetDevGenNamePtr; struct _virNetDevGenName { int lastID; /* not "unsigned" because callers use %d */ const char *prefix; @@ -186,7 +182,7 @@ int virNetDevSetMAC(const char *ifname, const virMacAddr *macaddr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT G_GNUC_NO_INLINE; int virNetDevGetMAC(const char *ifname, - virMacAddrPtr macaddr) + virMacAddr *macaddr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevReplaceMacAddress(const char *linkdev, @@ -200,7 +196,7 @@ int virNetDevRestoreMacAddress(const char *linkdev, ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSetCoalesce(const char *ifname, - virNetDevCoalescePtr coalesce, + virNetDevCoalesce *coalesce, bool update) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; @@ -257,7 +253,7 @@ int virNetDevGetPhysPortName(const char *ifname, int virNetDevGetVirtualFunctions(const char *pfname, char ***vfname, - virPCIDeviceAddressPtr **virt_fns, + virPCIDeviceAddress ***virt_fns, size_t *n_vfname, unsigned int *max_vfs) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) @@ -271,9 +267,9 @@ int virNetDevSaveNetConfig(const char *linkdev, int vf, int virNetDevReadNetConfig(const char *linkdev, int vf, const char *stateDir, - virMacAddrPtr *adminMAC, - virNetDevVlanPtr *vlan, - virMacAddrPtr *MAC) + virMacAddr **adminMAC, + virNetDevVlan **vlan, + virMacAddr **MAC) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) ATTRIBUTE_NONNULL(5) ATTRIBUTE_NONNULL(6) G_GNUC_WARN_UNUSED_RESULT; @@ -290,25 +286,25 @@ int virNetDevGetVirtualFunctionInfo(const char *vfname, char **pfname, ATTRIBUTE_NONNULL(1); int virNetDevGetFeatures(const char *ifname, - virBitmapPtr *out) + virBitmap **out) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; int virNetDevGetLinkInfo(const char *ifname, - virNetDevIfLinkPtr lnk) + virNetDevIfLink *lnk) ATTRIBUTE_NONNULL(1); -virNetDevRxFilterPtr virNetDevRxFilterNew(void) +virNetDevRxFilter *virNetDevRxFilterNew(void) G_GNUC_WARN_UNUSED_RESULT; -void virNetDevRxFilterFree(virNetDevRxFilterPtr filter); +void virNetDevRxFilterFree(virNetDevRxFilter *filter); int virNetDevGetRxFilter(const char *ifname, - virNetDevRxFilterPtr *filter) + virNetDevRxFilter **filter) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevAddMulti(const char *ifname, - virMacAddrPtr macaddr) + virMacAddr *macaddr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevDelMulti(const char *ifname, - virMacAddrPtr macaddr) + virMacAddr *macaddr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; int virNetDevSetPromiscuous(const char *ifname, bool promiscuous) @@ -341,7 +337,7 @@ int virNetDevSetRootQDisc(const char *ifname, const char *qdisc) G_GNUC_NO_INLINE; -int virNetDevVFInterfaceStats(virPCIDeviceAddressPtr vfAddr, +int virNetDevVFInterfaceStats(virPCIDeviceAddress *vfAddr, virDomainInterfaceStatsPtr stats) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); diff --git a/src/util/virnetdevbandwidth.c b/src/util/virnetdevbandwidth.c index f39635b35f..0fc802b174 100644 --- a/src/util/virnetdevbandwidth.c +++ b/src/util/virnetdevbandwidth.c @@ -29,7 +29,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE void -virNetDevBandwidthFree(virNetDevBandwidthPtr def) +virNetDevBandwidthFree(virNetDevBandwidth *def) { if (!def) return; @@ -40,7 +40,7 @@ virNetDevBandwidthFree(virNetDevBandwidthPtr def) } static void -virNetDevBandwidthCmdAddOptimalQuantum(virCommandPtr cmd, +virNetDevBandwidthCmdAddOptimalQuantum(virCommand *cmd, const virNetDevBandwidthRate *rate) { const unsigned long long mtu = 1500; @@ -103,7 +103,7 @@ virNetDevBandwidthManipulateFilter(const char *ifname, { int ret = -1; char *filter_id = NULL; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; unsigned char ifmac[VIR_MAC_BUFLEN]; char *mac[2] = {NULL, NULL}; @@ -193,9 +193,9 @@ virNetDevBandwidthSet(const char *ifname, bool swapped) { int ret = -1; - virNetDevBandwidthRatePtr rx = NULL; /* From domain POV */ - virNetDevBandwidthRatePtr tx = NULL; /* From domain POV */ - virCommandPtr cmd = NULL; + virNetDevBandwidthRate *rx = NULL; /* From domain POV */ + virNetDevBandwidthRate *tx = NULL; /* From domain POV */ + virCommand *cmd = NULL; char *average = NULL; char *peak = NULL; char *burst = NULL; @@ -417,7 +417,7 @@ virNetDevBandwidthClear(const char *ifname) { int ret = 0; int dummy; /* for ignoring the exit status */ - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; if (!ifname) return 0; @@ -450,7 +450,7 @@ virNetDevBandwidthClear(const char *ifname) * 0 otherwise. */ int -virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest, +virNetDevBandwidthCopy(virNetDevBandwidth **dest, const virNetDevBandwidth *src) { *dest = NULL; @@ -537,13 +537,13 @@ virNetDevBandwidthEqual(const virNetDevBandwidth *a, */ int virNetDevBandwidthPlug(const char *brname, - virNetDevBandwidthPtr net_bandwidth, + virNetDevBandwidth *net_bandwidth, const virMacAddr *ifmac_ptr, - virNetDevBandwidthPtr bandwidth, + virNetDevBandwidth *bandwidth, unsigned int id) { int ret = -1; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; char *class_id = NULL; char *qdisc_id = NULL; char *floor = NULL; @@ -620,7 +620,7 @@ virNetDevBandwidthUnplug(const char *brname, { int ret = -1; int cmd_ret = 0; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; char *class_id = NULL; char *qdisc_id = NULL; @@ -679,11 +679,11 @@ virNetDevBandwidthUnplug(const char *brname, int virNetDevBandwidthUpdateRate(const char *ifname, unsigned int id, - virNetDevBandwidthPtr bandwidth, + virNetDevBandwidth *bandwidth, unsigned long long new_rate) { int ret = -1; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; char *class_id = NULL; char *rate = NULL; char *ceil = NULL; diff --git a/src/util/virnetdevbandwidth.h b/src/util/virnetdevbandwidth.h index 91de9323ba..35e26b66f7 100644 --- a/src/util/virnetdevbandwidth.h +++ b/src/util/virnetdevbandwidth.h @@ -22,7 +22,6 @@ #include "virmacaddr.h" typedef struct _virNetDevBandwidthRate virNetDevBandwidthRate; -typedef virNetDevBandwidthRate *virNetDevBandwidthRatePtr; struct _virNetDevBandwidthRate { unsigned long long average; /* kbytes/s */ unsigned long long peak; /* kbytes/s */ @@ -31,13 +30,12 @@ struct _virNetDevBandwidthRate { }; typedef struct _virNetDevBandwidth virNetDevBandwidth; -typedef virNetDevBandwidth *virNetDevBandwidthPtr; struct _virNetDevBandwidth { - virNetDevBandwidthRatePtr in; - virNetDevBandwidthRatePtr out; + virNetDevBandwidthRate *in; + virNetDevBandwidthRate *out; }; -void virNetDevBandwidthFree(virNetDevBandwidthPtr def); +void virNetDevBandwidthFree(virNetDevBandwidth *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevBandwidth, virNetDevBandwidthFree); @@ -47,16 +45,16 @@ int virNetDevBandwidthSet(const char *ifname, bool swapped) G_GNUC_WARN_UNUSED_RESULT; int virNetDevBandwidthClear(const char *ifname); -int virNetDevBandwidthCopy(virNetDevBandwidthPtr *dest, +int virNetDevBandwidthCopy(virNetDevBandwidth **dest, const virNetDevBandwidth *src) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; bool virNetDevBandwidthEqual(const virNetDevBandwidth *a, const virNetDevBandwidth *b); int virNetDevBandwidthPlug(const char *brname, - virNetDevBandwidthPtr net_bandwidth, + virNetDevBandwidth *net_bandwidth, const virMacAddr *ifmac_ptr, - virNetDevBandwidthPtr bandwidth, + virNetDevBandwidth *bandwidth, unsigned int id) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; @@ -67,7 +65,7 @@ int virNetDevBandwidthUnplug(const char *brname, int virNetDevBandwidthUpdateRate(const char *ifname, unsigned int id, - virNetDevBandwidthPtr bandwidth, + virNetDevBandwidth *bandwidth, unsigned long long new_rate) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index 83da7bc46d..0ce8f5b536 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -270,9 +270,9 @@ virNetDevIPAddrDel(const char *ifname, */ int virNetDevIPRouteAdd(const char *ifname, - virSocketAddrPtr addr, + virSocketAddr *addr, unsigned int prefix, - virSocketAddrPtr gateway, + virSocketAddr *gateway, unsigned int metric) { unsigned int recvbuflen; @@ -283,7 +283,7 @@ virNetDevIPRouteAdd(const char *ifname, size_t addrDataLen; int errCode; virSocketAddr defaultAddr; - virSocketAddrPtr actualAddr; + virSocketAddr *actualAddr; g_autoptr(virNetlinkMsg) nlmsg = NULL; g_autofree char *toStr = NULL; g_autofree char *viaStr = NULL; @@ -460,9 +460,9 @@ virNetDevIPAddrDel(const char *ifname, int virNetDevIPRouteAdd(const char *ifname, - virSocketAddrPtr addr, + virSocketAddr *addr, unsigned int prefix, - virSocketAddrPtr gateway, + virSocketAddr *gateway, unsigned int metric) { g_autoptr(virCommand) cmd = NULL; @@ -627,7 +627,7 @@ virNetDevIPCheckIPv6Forwarding(void) #if defined(SIOCGIFADDR) && defined(WITH_STRUCT_IFREQ) static int virNetDevGetIPv4AddressIoctl(const char *ifname, - virSocketAddrPtr addr) + virSocketAddr *addr) { int fd = -1; int ret = -1; @@ -657,7 +657,7 @@ virNetDevGetIPv4AddressIoctl(const char *ifname, static int virNetDevGetIPv4AddressIoctl(const char *ifname G_GNUC_UNUSED, - virSocketAddrPtr addr G_GNUC_UNUSED) + virSocketAddr *addr G_GNUC_UNUSED) { return -2; } @@ -677,7 +677,7 @@ virNetDevGetIPv4AddressIoctl(const char *ifname G_GNUC_UNUSED, #if WITH_GETIFADDRS static int virNetDevGetifaddrsAddress(const char *ifname, - virSocketAddrPtr addr) + virSocketAddr *addr) { struct ifaddrs *ifap, *ifa; int ret = -1; @@ -725,7 +725,7 @@ virNetDevGetifaddrsAddress(const char *ifname, static int virNetDevGetifaddrsAddress(const char *ifname G_GNUC_UNUSED, - virSocketAddrPtr addr G_GNUC_UNUSED) + virSocketAddr *addr G_GNUC_UNUSED) { return -2; } @@ -744,7 +744,7 @@ virNetDevGetifaddrsAddress(const char *ifname G_GNUC_UNUSED, */ int virNetDevIPAddrGet(const char *ifname, - virSocketAddrPtr addr) + virSocketAddr *addr) { int ret; @@ -764,7 +764,7 @@ virNetDevIPAddrGet(const char *ifname, /* manipulating the virNetDevIPRoute object */ void -virNetDevIPRouteFree(virNetDevIPRoutePtr def) +virNetDevIPRouteFree(virNetDevIPRoute *def) { if (!def) return; @@ -772,8 +772,8 @@ virNetDevIPRouteFree(virNetDevIPRoutePtr def) g_free(def); } -virSocketAddrPtr -virNetDevIPRouteGetAddress(virNetDevIPRoutePtr def) +virSocketAddr * +virNetDevIPRouteGetAddress(virNetDevIPRoute *def) { if (def) return &def->address; @@ -782,7 +782,7 @@ virNetDevIPRouteGetAddress(virNetDevIPRoutePtr def) } int -virNetDevIPRouteGetPrefix(virNetDevIPRoutePtr def) +virNetDevIPRouteGetPrefix(virNetDevIPRoute *def) { int prefix = 0; virSocketAddr zero; @@ -815,7 +815,7 @@ virNetDevIPRouteGetPrefix(virNetDevIPRoutePtr def) } unsigned int -virNetDevIPRouteGetMetric(virNetDevIPRoutePtr def) +virNetDevIPRouteGetMetric(virNetDevIPRoute *def) { if (def && def->has_metric && def->metric > 0) return def->metric; @@ -823,8 +823,8 @@ virNetDevIPRouteGetMetric(virNetDevIPRoutePtr def) return 1; } -virSocketAddrPtr -virNetDevIPRouteGetGateway(virNetDevIPRoutePtr def) +virSocketAddr * +virNetDevIPRouteGetGateway(virNetDevIPRoute *def) { if (def) return &def->gateway; @@ -834,7 +834,7 @@ virNetDevIPRouteGetGateway(virNetDevIPRoutePtr def) /* manipulating the virNetDevIPInfo object */ void -virNetDevIPInfoClear(virNetDevIPInfoPtr ip) +virNetDevIPInfoClear(virNetDevIPInfo *ip) { size_t i; @@ -869,7 +869,7 @@ virNetDevIPInfoAddToDev(const char *ifname, /* add all IP addresses */ for (i = 0; i < ipInfo->nips; i++) { - virNetDevIPAddrPtr ip = ipInfo->ips[i]; + virNetDevIPAddr *ip = ipInfo->ips[i]; if ((prefix = virSocketAddrGetIPPrefix(&ip->address, NULL, ip->prefix)) < 0) { @@ -885,7 +885,7 @@ virNetDevIPInfoAddToDev(const char *ifname, /* add all routes */ for (i = 0; i < ipInfo->nroutes; i++) { - virNetDevIPRoutePtr route = ipInfo->routes[i]; + virNetDevIPRoute *route = ipInfo->routes[i]; if ((prefix = virNetDevIPRouteGetPrefix(route)) < 0) { ipStr = virSocketAddrFormat(&route->address); @@ -904,7 +904,7 @@ virNetDevIPInfoAddToDev(const char *ifname, } void -virNetDevIPAddrFree(virNetDevIPAddrPtr ip) +virNetDevIPAddrFree(virNetDevIPAddr *ip) { g_free(ip); } diff --git a/src/util/virnetdevip.h b/src/util/virnetdevip.h index faaa4f2c01..136048090d 100644 --- a/src/util/virnetdevip.h +++ b/src/util/virnetdevip.h @@ -21,7 +21,6 @@ #include "virsocketaddr.h" typedef struct _virNetDevIPAddr virNetDevIPAddr; -typedef virNetDevIPAddr *virNetDevIPAddrPtr; struct _virNetDevIPAddr { virSocketAddr address; /* ipv4 or ipv6 address */ virSocketAddr peer; /* ipv4 or ipv6 address of peer */ @@ -29,7 +28,6 @@ struct _virNetDevIPAddr { }; typedef struct _virNetDevIPRoute virNetDevIPRoute; -typedef virNetDevIPRoute *virNetDevIPRoutePtr; struct _virNetDevIPRoute { char *family; /* ipv4 or ipv6 - default is ipv4 */ virSocketAddr address; /* Routed Network IP address */ @@ -49,12 +47,11 @@ struct _virNetDevIPRoute { /* A full set of all IP config info for a network device */ typedef struct _virNetDevIPInfo virNetDevIPInfo; -typedef virNetDevIPInfo *virNetDevIPInfoPtr; struct _virNetDevIPInfo { size_t nips; - virNetDevIPAddrPtr *ips; + virNetDevIPAddr **ips; size_t nroutes; - virNetDevIPRoutePtr *routes; + virNetDevIPRoute **routes; }; /* manipulating/querying the netdev */ @@ -64,9 +61,9 @@ int virNetDevIPAddrAdd(const char *ifname, unsigned int prefix) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT G_GNUC_NO_INLINE; int virNetDevIPRouteAdd(const char *ifname, - virSocketAddrPtr addr, + virSocketAddr *addr, unsigned int prefix, - virSocketAddrPtr gateway, + virSocketAddr *gateway, unsigned int metric) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT; @@ -74,20 +71,20 @@ int virNetDevIPAddrDel(const char *ifname, virSocketAddr *addr, unsigned int prefix) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int virNetDevIPAddrGet(const char *ifname, virSocketAddrPtr addr) +int virNetDevIPAddrGet(const char *ifname, virSocketAddr *addr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; bool virNetDevIPCheckIPv6Forwarding(void); -void virNetDevIPAddrFree(virNetDevIPAddrPtr ip); +void virNetDevIPAddrFree(virNetDevIPAddr *ip); /* virNetDevIPRoute object */ -void virNetDevIPRouteFree(virNetDevIPRoutePtr def); -virSocketAddrPtr virNetDevIPRouteGetAddress(virNetDevIPRoutePtr def); -int virNetDevIPRouteGetPrefix(virNetDevIPRoutePtr def); -unsigned int virNetDevIPRouteGetMetric(virNetDevIPRoutePtr def); -virSocketAddrPtr virNetDevIPRouteGetGateway(virNetDevIPRoutePtr def); +void virNetDevIPRouteFree(virNetDevIPRoute *def); +virSocketAddr *virNetDevIPRouteGetAddress(virNetDevIPRoute *def); +int virNetDevIPRouteGetPrefix(virNetDevIPRoute *def); +unsigned int virNetDevIPRouteGetMetric(virNetDevIPRoute *def); +virSocketAddr *virNetDevIPRouteGetGateway(virNetDevIPRoute *def); /* virNetDevIPInfo object */ -void virNetDevIPInfoClear(virNetDevIPInfoPtr ip); +void virNetDevIPInfoClear(virNetDevIPInfo *ip); int virNetDevIPInfoAddToDev(const char *ifname, virNetDevIPInfo const *ipInfo); diff --git a/src/util/virnetdevmacvlan.c b/src/util/virnetdevmacvlan.c index ed677193af..fd8c20e059 100644 --- a/src/util/virnetdevmacvlan.c +++ b/src/util/virnetdevmacvlan.c @@ -278,7 +278,7 @@ static const uint32_t modeMap[VIR_NETDEV_MACVLAN_MODE_LAST] = { /* Struct to hold the state and configuration of a 802.1qbg port */ struct virNetlinkCallbackData { char *cr_ifname; - virNetDevVPortProfilePtr virtPortProfile; + virNetDevVPortProfile *virtPortProfile; virMacAddr macaddress; char *linkdev; int vf; @@ -287,8 +287,6 @@ struct virNetlinkCallbackData { unsigned int linkState; }; -typedef struct virNetlinkCallbackData *virNetlinkCallbackDataPtr; - # define INSTANCE_STRLEN 36 static int instance2str(const unsigned char *p, char *dst, size_t size) @@ -347,7 +345,7 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr, int rem; char *ifname; bool indicate = false; - virNetlinkCallbackDataPtr calld = opaque; + struct virNetlinkCallbackData *calld = opaque; pid_t lldpad_pid = 0; pid_t virip_pid = 0; char macaddr[VIR_MAC_STRING_BUFLEN]; @@ -560,7 +558,7 @@ virNetDevMacVLanVPortProfileCallback(struct nlmsghdr *hdr, * Returns nothing. */ static void -virNetlinkCallbackDataFree(virNetlinkCallbackDataPtr calld) +virNetlinkCallbackDataFree(struct virNetlinkCallbackData *calld) { if (calld) { g_free(calld->cr_ifname); @@ -586,7 +584,7 @@ virNetDevMacVLanVPortProfileDestroyCallback(int watch G_GNUC_UNUSED, const virMacAddr *macaddr G_GNUC_UNUSED, void *opaque) { - virNetlinkCallbackDataFree((virNetlinkCallbackDataPtr)opaque); + virNetlinkCallbackDataFree((struct virNetlinkCallbackData *)opaque); } int @@ -597,7 +595,7 @@ virNetDevMacVLanVPortProfileRegisterCallback(const char *ifname, const virNetDevVPortProfile *virtPortProfile, virNetDevVPortProfileOp vmOp) { - virNetlinkCallbackDataPtr calld = NULL; + struct virNetlinkCallbackData *calld = NULL; if (virtPortProfile && virNetlinkEventServiceIsRunning(NETLINK_ROUTE)) { calld = g_new0(struct virNetlinkCallbackData, 1); diff --git a/src/util/virnetdevmidonet.c b/src/util/virnetdevmidonet.c index be1b6e8a45..9061f1516f 100644 --- a/src/util/virnetdevmidonet.c +++ b/src/util/virnetdevmidonet.c @@ -40,7 +40,7 @@ virNetDevMidonetBindPort(const char *ifname, const virNetDevVPortProfile *virtualport) { int ret = -1; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; char virtportuuid[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(virtualport->interfaceID, virtportuuid); @@ -74,7 +74,7 @@ int virNetDevMidonetUnbindPort(const virNetDevVPortProfile *virtualport) { int ret = -1; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; char virtportuuid[VIR_UUID_STRING_BUFLEN]; virUUIDFormat(virtualport->interfaceID, virtportuuid); diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c index bd840bd3b7..21ee4bdd42 100644 --- a/src/util/virnetdevopenvswitch.c +++ b/src/util/virnetdevopenvswitch.c @@ -52,10 +52,10 @@ virNetDevOpenvswitchSetTimeout(unsigned int timeout) virNetDevOpenvswitchTimeout = timeout; } -static virCommandPtr +static virCommand * virNetDevOpenvswitchCreateCmd(void) { - virCommandPtr cmd = virCommandNew(OVS_VSCTL); + virCommand *cmd = virCommandNew(OVS_VSCTL); virCommandAddArgFormat(cmd, "--timeout=%u", virNetDevOpenvswitchTimeout); return cmd; } @@ -69,7 +69,7 @@ virNetDevOpenvswitchCreateCmd(void) * ovs-vsctl command. */ static void -virNetDevOpenvswitchConstructVlans(virCommandPtr cmd, const virNetDevVlan *virtVlan) +virNetDevOpenvswitchConstructVlans(virCommand *cmd, const virNetDevVlan *virtVlan) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -297,7 +297,7 @@ virNetDevOpenvswitchInterfaceParseStats(const char *json, virDomainInterfaceStatsPtr stats) { g_autoptr(virJSONValue) jsonStats = NULL; - virJSONValuePtr jsonMap = NULL; + virJSONValue *jsonMap = NULL; size_t i; stats->rx_bytes = stats->rx_packets = stats->rx_errs = stats->rx_drop = -1; @@ -312,9 +312,9 @@ virNetDevOpenvswitchInterfaceParseStats(const char *json, } for (i = 0; i < virJSONValueArraySize(jsonMap); i++) { - virJSONValuePtr item = virJSONValueArrayGet(jsonMap, i); - virJSONValuePtr jsonKey; - virJSONValuePtr jsonVal; + virJSONValue *item = virJSONValueArrayGet(jsonMap, i); + virJSONValue *jsonKey; + virJSONValue *jsonVal; const char *key; long long val; diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c index 0142d3dda5..cdaf67a72e 100644 --- a/src/util/virnetdevtap.c +++ b/src/util/virnetdevtap.c @@ -591,7 +591,7 @@ int virNetDevTapCreateInBridgePort(const char *brname, const virNetDevVPortProfile *virtPortProfile, const virNetDevVlan *virtVlan, virTristateBool isolatedPort, - virNetDevCoalescePtr coalesce, + virNetDevCoalesce *coalesce, unsigned int mtu, unsigned int *actualMTU, unsigned int flags) diff --git a/src/util/virnetdevtap.h b/src/util/virnetdevtap.h index c6bd9285ba..922682adae 100644 --- a/src/util/virnetdevtap.h +++ b/src/util/virnetdevtap.h @@ -94,7 +94,7 @@ int virNetDevTapCreateInBridgePort(const char *brname, const virNetDevVPortProfile *virtPortProfile, const virNetDevVlan *virtVlan, virTristateBool isolatedPort, - virNetDevCoalescePtr coalesce, + virNetDevCoalesce *coalesce, unsigned int mtu, unsigned int *actualMTU, unsigned int flags) diff --git a/src/util/virnetdevvlan.c b/src/util/virnetdevvlan.c index 339290fe79..64fbacd4f8 100644 --- a/src/util/virnetdevvlan.c +++ b/src/util/virnetdevvlan.c @@ -26,7 +26,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE void -virNetDevVlanClear(virNetDevVlanPtr vlan) +virNetDevVlanClear(virNetDevVlan *vlan) { VIR_FREE(vlan->tag); vlan->nTags = 0; @@ -35,7 +35,7 @@ virNetDevVlanClear(virNetDevVlanPtr vlan) } void -virNetDevVlanFree(virNetDevVlanPtr vlan) +virNetDevVlanFree(virNetDevVlan *vlan) { if (vlan) virNetDevVlanClear(vlan); @@ -78,7 +78,7 @@ virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b) * dst is assumed to be empty on entry. */ int -virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlan *src) +virNetDevVlanCopy(virNetDevVlan *dst, const virNetDevVlan *src) { if (!src || src->nTags == 0) return 0; diff --git a/src/util/virnetdevvlan.h b/src/util/virnetdevvlan.h index 0c1f5f1ecd..228d270869 100644 --- a/src/util/virnetdevvlan.h +++ b/src/util/virnetdevvlan.h @@ -31,7 +31,6 @@ typedef enum { VIR_ENUM_DECL(virNativeVlanMode); typedef struct _virNetDevVlan virNetDevVlan; -typedef virNetDevVlan *virNetDevVlanPtr; struct _virNetDevVlan { bool trunk; /* true if this is a trunk */ int nTags; /* number of tags in array */ @@ -40,9 +39,9 @@ struct _virNetDevVlan { unsigned int nativeTag; }; -void virNetDevVlanClear(virNetDevVlanPtr vlan); -void virNetDevVlanFree(virNetDevVlanPtr vlan); +void virNetDevVlanClear(virNetDevVlan *vlan); +void virNetDevVlanFree(virNetDevVlan *vlan); int virNetDevVlanEqual(const virNetDevVlan *a, const virNetDevVlan *b); -int virNetDevVlanCopy(virNetDevVlanPtr dst, const virNetDevVlan *src); +int virNetDevVlanCopy(virNetDevVlan *dst, const virNetDevVlan *src); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetDevVlan, virNetDevVlanFree); diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c index c0fc04c699..88c3487952 100644 --- a/src/util/virnetdevvportprofile.c +++ b/src/util/virnetdevvportprofile.c @@ -122,7 +122,7 @@ virNetDevVPortProfileEqual(const virNetDevVPortProfile *a, const virNetDevVPortP } -int virNetDevVPortProfileCopy(virNetDevVPortProfilePtr *dst, const virNetDevVPortProfile *src) +int virNetDevVPortProfileCopy(virNetDevVPortProfile **dst, const virNetDevVPortProfile *src) { if (!src) { *dst = NULL; @@ -144,7 +144,7 @@ int virNetDevVPortProfileCopy(virNetDevVPortProfilePtr *dst, const virNetDevVPor * and -1 is returned. */ int -virNetDevVPortProfileCheckComplete(virNetDevVPortProfilePtr virtport, +virNetDevVPortProfileCheckComplete(virNetDevVPortProfile *virtport, bool generateMissing) { const char *missing = NULL; @@ -274,7 +274,7 @@ virNetDevVPortProfileCheckNoExtras(const virNetDevVPortProfile *virtport) * *and doesn't match*, log an error and return -1, otherwise return 0. */ static int -virNetDevVPortProfileMerge(virNetDevVPortProfilePtr orig, +virNetDevVPortProfileMerge(virNetDevVPortProfile *orig, const virNetDevVPortProfile *mods) { enum virNetDevVPortProfile otype; @@ -414,7 +414,7 @@ virNetDevVPortProfileMerge(virNetDevVPortProfilePtr orig, * change it, that is an error. */ -int virNetDevVPortProfileMerge3(virNetDevVPortProfilePtr *result, +int virNetDevVPortProfileMerge3(virNetDevVPortProfile **result, const virNetDevVPortProfile *fromInterface, const virNetDevVPortProfile *fromNetwork, const virNetDevVPortProfile *fromPortgroup) diff --git a/src/util/virnetdevvportprofile.h b/src/util/virnetdevvportprofile.h index 3873fdf067..e7a93e23a4 100644 --- a/src/util/virnetdevvportprofile.h +++ b/src/util/virnetdevvportprofile.h @@ -52,7 +52,6 @@ VIR_ENUM_DECL(virNetDevVPortProfileOp); /* profile data for macvtap (VEPA) and openvswitch */ typedef struct _virNetDevVPortProfile virNetDevVPortProfile; -typedef virNetDevVPortProfile *virNetDevVPortProfilePtr; struct _virNetDevVPortProfile { int virtPortType; /* enum virNetDevVPortProfile */ /* these members are used when virtPortType == 802.1Qbg */ @@ -78,14 +77,14 @@ struct _virNetDevVPortProfile { bool virNetDevVPortProfileEqual(const virNetDevVPortProfile *a, const virNetDevVPortProfile *b); -int virNetDevVPortProfileCopy(virNetDevVPortProfilePtr *dst, +int virNetDevVPortProfileCopy(virNetDevVPortProfile **dst, const virNetDevVPortProfile *src); -int virNetDevVPortProfileCheckComplete(virNetDevVPortProfilePtr virtport, +int virNetDevVPortProfileCheckComplete(virNetDevVPortProfile *virtport, bool generateMissing); int virNetDevVPortProfileCheckNoExtras(const virNetDevVPortProfile *virtport); -int virNetDevVPortProfileMerge3(virNetDevVPortProfilePtr *result, +int virNetDevVPortProfileMerge3(virNetDevVPortProfile **result, const virNetDevVPortProfile *fromInterface, const virNetDevVPortProfile *fromNetwork, const virNetDevVPortProfile *fromPortgroup); diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index c26c03de32..81c49abd5d 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -100,7 +100,6 @@ typedef struct nl_sock virNetlinkHandle; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNetlinkHandle, virNetlinkFree); typedef struct _virNetlinkEventSrvPrivate virNetlinkEventSrvPrivate; -typedef virNetlinkEventSrvPrivate *virNetlinkEventSrvPrivatePtr; struct _virNetlinkEventSrvPrivate { /* Server */ virMutex lock; @@ -128,7 +127,7 @@ static int nextWatch = 1; /* Linux kernel supports up to MAX_LINKS (32 at the time) individual * netlink protocols. */ -static virNetlinkEventSrvPrivatePtr server[MAX_LINKS] = {NULL}; +static virNetlinkEventSrvPrivate *server[MAX_LINKS] = {NULL}; static virNetlinkHandle *placeholder_nlhandle; /* Function definitions */ @@ -583,7 +582,7 @@ virNetlinkDumpLink(const char *ifname, int ifindex, int virNetlinkNewLink(const char *ifname, const char *type, - virNetlinkNewLinkDataPtr extra_args, + virNetlinkNewLinkData *extra_args, int *error) { struct nlattr *linkinfo = NULL; @@ -802,13 +801,13 @@ virNetlinkGetErrorCode(struct nlmsghdr *resp, unsigned int recvbuflen) static void -virNetlinkEventServerLock(virNetlinkEventSrvPrivatePtr driver) +virNetlinkEventServerLock(virNetlinkEventSrvPrivate *driver) { virMutexLock(&driver->lock); } static void -virNetlinkEventServerUnlock(virNetlinkEventSrvPrivatePtr driver) +virNetlinkEventServerUnlock(virNetlinkEventSrvPrivate *driver) { virMutexUnlock(&driver->lock); } @@ -852,7 +851,7 @@ virNetlinkEventCallback(int watch, int events G_GNUC_UNUSED, void *opaque) { - virNetlinkEventSrvPrivatePtr srv = opaque; + virNetlinkEventSrvPrivate *srv = opaque; struct sockaddr_nl peer; struct ucred *creds = NULL; size_t i; @@ -905,7 +904,7 @@ virNetlinkEventCallback(int watch, int virNetlinkEventServiceStop(unsigned int protocol) { - virNetlinkEventSrvPrivatePtr srv; + virNetlinkEventSrvPrivate *srv; size_t i; if (protocol >= MAX_LINKS) @@ -1016,7 +1015,7 @@ int virNetlinkEventServiceLocalPid(unsigned int protocol) int virNetlinkEventServiceStart(unsigned int protocol, unsigned int groups) { - virNetlinkEventSrvPrivatePtr srv; + virNetlinkEventSrvPrivate *srv; int fd; int ret = -1; @@ -1117,7 +1116,7 @@ virNetlinkEventAddClient(virNetlinkEventHandleCallback handleCB, { size_t i; int r, ret = -1; - virNetlinkEventSrvPrivatePtr srv = NULL; + virNetlinkEventSrvPrivate *srv = NULL; if (protocol >= MAX_LINKS) return -EINVAL; @@ -1190,7 +1189,7 @@ virNetlinkEventRemoveClient(int watch, const virMacAddr *macaddr, { size_t i; int ret = -1; - virNetlinkEventSrvPrivatePtr srv = NULL; + virNetlinkEventSrvPrivate *srv = NULL; if (protocol >= MAX_LINKS) return -EINVAL; @@ -1299,7 +1298,7 @@ virNetlinkDelLink(const char *ifname G_GNUC_UNUSED, int virNetlinkNewLink(const char *ifname G_GNUC_UNUSED, const char *type G_GNUC_UNUSED, - virNetlinkNewLinkDataPtr extra_args G_GNUC_UNUSED, + virNetlinkNewLinkData *extra_args G_GNUC_UNUSED, int *error G_GNUC_UNUSED) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h index e05c62e635..75192f645f 100644 --- a/src/util/virnetlink.h +++ b/src/util/virnetlink.h @@ -60,7 +60,6 @@ int virNetlinkDumpCommand(struct nl_msg *nl_msg, void *opaque); typedef struct _virNetlinkNewLinkData virNetlinkNewLinkData; -typedef virNetlinkNewLinkData *virNetlinkNewLinkDataPtr; struct _virNetlinkNewLinkData { const int *ifindex; /* The index for the 'link' device */ const virMacAddr *mac; /* The MAC address of the device */ @@ -70,7 +69,7 @@ struct _virNetlinkNewLinkData { int virNetlinkNewLink(const char *ifname, const char *type, - virNetlinkNewLinkDataPtr data, + virNetlinkNewLinkData *data, int *error); typedef int (*virNetlinkTalkFallback)(const char *ifname); diff --git a/src/util/virnodesuspend.c b/src/util/virnodesuspend.c index 544a29783c..451d798363 100644 --- a/src/util/virnodesuspend.c +++ b/src/util/virnodesuspend.c @@ -73,7 +73,7 @@ static void virNodeSuspendUnlock(void) */ static int virNodeSuspendSetNodeWakeup(unsigned long long alarmTime) { - virCommandPtr setAlarmCmd; + virCommand *setAlarmCmd; int ret = -1; if (alarmTime < MIN_TIME_REQ_FOR_SUSPEND) { @@ -110,7 +110,7 @@ static int virNodeSuspendSetNodeWakeup(unsigned long long alarmTime) */ static void virNodeSuspendHelper(void *cmdString) { - virCommandPtr suspendCmd = virCommandNew((const char *)cmdString); + virCommand *suspendCmd = virCommandNew((const char *)cmdString); /* * Delay for sometime so that the function virNodeSuspend() diff --git a/src/util/virnuma.c b/src/util/virnuma.c index 6c194b54d1..0c9599003a 100644 --- a/src/util/virnuma.c +++ b/src/util/virnuma.c @@ -90,7 +90,7 @@ virNumaGetAutoPlacementAdvice(unsigned short vcpus G_GNUC_UNUSED, #if WITH_NUMACTL int virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode, - virBitmapPtr nodeset) + virBitmap *nodeset) { nodemask_t mask; int node = -1; @@ -249,7 +249,7 @@ virNumaGetNodeMemory(int node, (((mask)[((cpu) / n_bits(*(mask)))] >> ((cpu) % n_bits(*(mask)))) & 1) int virNumaGetNodeCPUs(int node, - virBitmapPtr *cpus) + virBitmap **cpus) { int ncpus = 0; int max_n_cpus = virNumaGetMaxCPUs(); @@ -297,8 +297,8 @@ virNumaGetNodeCPUs(int node, * Returns 0 on success, <0 on failure. */ int -virNumaNodesetToCPUset(virBitmapPtr nodeset, - virBitmapPtr *cpuset) +virNumaNodesetToCPUset(virBitmap *nodeset, + virBitmap **cpuset) { g_autoptr(virBitmap) allNodesCPUs = NULL; size_t nodesetSize; @@ -343,7 +343,7 @@ virNumaNodesetToCPUset(virBitmapPtr nodeset, int virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode G_GNUC_UNUSED, - virBitmapPtr nodeset) + virBitmap *nodeset) { if (!virNumaNodesetIsAvailable(nodeset)) return -1; @@ -385,7 +385,7 @@ virNumaGetNodeMemory(int node G_GNUC_UNUSED, int virNumaGetNodeCPUs(int node G_GNUC_UNUSED, - virBitmapPtr *cpus) + virBitmap **cpus) { *cpus = NULL; @@ -395,8 +395,8 @@ virNumaGetNodeCPUs(int node G_GNUC_UNUSED, } int -virNumaNodesetToCPUset(virBitmapPtr nodeset G_GNUC_UNUSED, - virBitmapPtr *cpuset) +virNumaNodesetToCPUset(virBitmap *nodeset G_GNUC_UNUSED, + virBitmap **cpuset) { *cpuset = NULL; @@ -982,7 +982,7 @@ virNumaSetPagePoolSize(int node G_GNUC_UNUSED, #endif /* #ifdef __linux__ */ bool -virNumaNodesetIsAvailable(virBitmapPtr nodeset) +virNumaNodesetIsAvailable(virBitmap *nodeset) { ssize_t bit = -1; @@ -1006,13 +1006,13 @@ virNumaNodesetIsAvailable(virBitmapPtr nodeset) * * Returns a bitmap of guest numa node ids that contain memory. */ -virBitmapPtr +virBitmap * virNumaGetHostMemoryNodeset(void) { int maxnode = virNumaGetMaxNode(); unsigned long long nodesize; size_t i = 0; - virBitmapPtr nodeset = NULL; + virBitmap *nodeset = NULL; if (maxnode < 0) return NULL; diff --git a/src/util/virnuma.h b/src/util/virnuma.h index c5bb5ffece..45342ecf11 100644 --- a/src/util/virnuma.h +++ b/src/util/virnuma.h @@ -29,10 +29,10 @@ char *virNumaGetAutoPlacementAdvice(unsigned short vcpus, unsigned long long balloon); int virNumaSetupMemoryPolicy(virDomainNumatuneMemMode mode, - virBitmapPtr nodeset); + virBitmap *nodeset); -virBitmapPtr virNumaGetHostMemoryNodeset(void); -bool virNumaNodesetIsAvailable(virBitmapPtr nodeset) G_GNUC_NO_INLINE; +virBitmap *virNumaGetHostMemoryNodeset(void); +bool virNumaNodesetIsAvailable(virBitmap *nodeset) G_GNUC_NO_INLINE; bool virNumaIsAvailable(void) G_GNUC_NO_INLINE; int virNumaGetMaxNode(void) G_GNUC_NO_INLINE; bool virNumaNodeIsAvailable(int node) G_GNUC_NO_INLINE; @@ -45,9 +45,9 @@ int virNumaGetNodeMemory(int node, unsigned int virNumaGetMaxCPUs(void); -int virNumaGetNodeCPUs(int node, virBitmapPtr *cpus) G_GNUC_NO_INLINE; -int virNumaNodesetToCPUset(virBitmapPtr nodeset, - virBitmapPtr *cpuset); +int virNumaGetNodeCPUs(int node, virBitmap **cpus) G_GNUC_NO_INLINE; +int virNumaNodesetToCPUset(virBitmap *nodeset, + virBitmap **cpuset); int virNumaGetPageInfo(int node, unsigned int page_size, diff --git a/src/util/virnvme.c b/src/util/virnvme.c index a1fc9aab57..0eda36aa6d 100644 --- a/src/util/virnvme.c +++ b/src/util/virnvme.c @@ -42,11 +42,11 @@ struct _virNVMeDeviceList { virObjectLockable parent; size_t count; - virNVMeDevicePtr *devs; + virNVMeDevice **devs; }; -static virClassPtr virNVMeDeviceListClass; +static virClass *virNVMeDeviceListClass; static void virNVMeDeviceListDispose(void *obj); @@ -62,12 +62,12 @@ virNVMeOnceInit(void) VIR_ONCE_GLOBAL_INIT(virNVMe); -virNVMeDevicePtr +virNVMeDevice * virNVMeDeviceNew(const virPCIDeviceAddress *address, unsigned long namespace, bool managed) { - virNVMeDevicePtr dev = NULL; + virNVMeDevice *dev = NULL; dev = g_new0(virNVMeDevice, 1); @@ -80,7 +80,7 @@ virNVMeDeviceNew(const virPCIDeviceAddress *address, void -virNVMeDeviceFree(virNVMeDevicePtr dev) +virNVMeDeviceFree(virNVMeDevice *dev) { if (!dev) return; @@ -90,10 +90,10 @@ virNVMeDeviceFree(virNVMeDevicePtr dev) } -virNVMeDevicePtr +virNVMeDevice * virNVMeDeviceCopy(const virNVMeDevice *dev) { - virNVMeDevicePtr copy = NULL; + virNVMeDevice *copy = NULL; copy = g_new0(virNVMeDevice, 1); copy->drvname = g_strdup(dev->drvname); @@ -115,7 +115,7 @@ virNVMeDeviceAddressGet(const virNVMeDevice *dev) void -virNVMeDeviceUsedByClear(virNVMeDevicePtr dev) +virNVMeDeviceUsedByClear(virNVMeDevice *dev) { VIR_FREE(dev->drvname); VIR_FREE(dev->domname); @@ -133,7 +133,7 @@ virNVMeDeviceUsedByGet(const virNVMeDevice *dev, void -virNVMeDeviceUsedBySet(virNVMeDevicePtr dev, +virNVMeDeviceUsedBySet(virNVMeDevice *dev, const char *drv, const char *dom) { @@ -142,10 +142,10 @@ virNVMeDeviceUsedBySet(virNVMeDevicePtr dev, } -virNVMeDeviceListPtr +virNVMeDeviceList * virNVMeDeviceListNew(void) { - virNVMeDeviceListPtr list; + virNVMeDeviceList *list; if (virNVMeInitialize() < 0) return NULL; @@ -160,7 +160,7 @@ virNVMeDeviceListNew(void) static void virNVMeDeviceListDispose(void *obj) { - virNVMeDeviceListPtr list = obj; + virNVMeDeviceList *list = obj; size_t i; for (i = 0; i < list->count; i++) @@ -178,10 +178,10 @@ virNVMeDeviceListCount(const virNVMeDeviceList *list) int -virNVMeDeviceListAdd(virNVMeDeviceListPtr list, +virNVMeDeviceListAdd(virNVMeDeviceList *list, const virNVMeDevice *dev) { - virNVMeDevicePtr tmp; + virNVMeDevice *tmp; if ((tmp = virNVMeDeviceListLookup(list, dev))) { g_autofree char *addrStr = virPCIDeviceAddressAsString(&tmp->address); @@ -202,11 +202,11 @@ virNVMeDeviceListAdd(virNVMeDeviceListPtr list, int -virNVMeDeviceListDel(virNVMeDeviceListPtr list, +virNVMeDeviceListDel(virNVMeDeviceList *list, const virNVMeDevice *dev) { ssize_t idx; - virNVMeDevicePtr tmp = NULL; + virNVMeDevice *tmp = NULL; if ((idx = virNVMeDeviceListLookupIndex(list, dev)) < 0) { g_autofree char *addrStr = virPCIDeviceAddressAsString(&dev->address); @@ -223,16 +223,16 @@ virNVMeDeviceListDel(virNVMeDeviceListPtr list, } -virNVMeDevicePtr -virNVMeDeviceListGet(virNVMeDeviceListPtr list, +virNVMeDevice * +virNVMeDeviceListGet(virNVMeDeviceList *list, size_t i) { return i < list->count ? list->devs[i] : NULL; } -virNVMeDevicePtr -virNVMeDeviceListLookup(virNVMeDeviceListPtr list, +virNVMeDevice * +virNVMeDeviceListLookup(virNVMeDeviceList *list, const virNVMeDevice *dev) { ssize_t idx; @@ -245,7 +245,7 @@ virNVMeDeviceListLookup(virNVMeDeviceListPtr list, ssize_t -virNVMeDeviceListLookupIndex(virNVMeDeviceListPtr list, +virNVMeDeviceListLookupIndex(virNVMeDeviceList *list, const virNVMeDevice *dev) { size_t i; @@ -254,7 +254,7 @@ virNVMeDeviceListLookupIndex(virNVMeDeviceListPtr list, return -1; for (i = 0; i < list->count; i++) { - virNVMeDevicePtr other = list->devs[i]; + virNVMeDevice *other = list->devs[i]; if (virPCIDeviceAddressEqual(&dev->address, &other->address) && dev->namespace == other->namespace) @@ -265,8 +265,8 @@ virNVMeDeviceListLookupIndex(virNVMeDeviceListPtr list, } -static virNVMeDevicePtr -virNVMeDeviceListLookupByPCIAddress(virNVMeDeviceListPtr list, +static virNVMeDevice * +virNVMeDeviceListLookupByPCIAddress(virNVMeDeviceList *list, const virPCIDeviceAddress *address) { size_t i; @@ -275,7 +275,7 @@ virNVMeDeviceListLookupByPCIAddress(virNVMeDeviceListPtr list, return NULL; for (i = 0; i < list->count; i++) { - virNVMeDevicePtr other = list->devs[i]; + virNVMeDevice *other = list->devs[i]; if (virPCIDeviceAddressEqual(address, &other->address)) return other; @@ -285,7 +285,7 @@ virNVMeDeviceListLookupByPCIAddress(virNVMeDeviceListPtr list, } -static virPCIDevicePtr +static virPCIDevice * virNVMeDeviceCreatePCIDevice(const virNVMeDevice *nvme) { g_autoptr(virPCIDevice) pci = NULL; @@ -317,9 +317,9 @@ virNVMeDeviceCreatePCIDevice(const virNVMeDevice *nvme) * Returns: a list on success, * NULL otherwise. */ -virPCIDeviceListPtr -virNVMeDeviceListCreateDetachList(virNVMeDeviceListPtr activeList, - virNVMeDeviceListPtr toDetachList) +virPCIDeviceList * +virNVMeDeviceListCreateDetachList(virNVMeDeviceList *activeList, + virNVMeDeviceList *toDetachList) { g_autoptr(virPCIDeviceList) pciDevices = NULL; size_t i; @@ -383,9 +383,9 @@ virNVMeDeviceListCreateDetachList(virNVMeDeviceListPtr activeList, * Returns: a list on success, * NULL otherwise. */ -virPCIDeviceListPtr -virNVMeDeviceListCreateReAttachList(virNVMeDeviceListPtr activeList, - virNVMeDeviceListPtr toReAttachList) +virPCIDeviceList * +virNVMeDeviceListCreateReAttachList(virNVMeDeviceList *activeList, + virNVMeDeviceList *toReAttachList) { g_autoptr(virPCIDeviceList) pciDevices = NULL; size_t i; @@ -402,7 +402,7 @@ virNVMeDeviceListCreateReAttachList(virNVMeDeviceListPtr activeList, * @d. To simplify this, let's just count how many NVMe devices with * the same PCI address there are on the @activeList. */ for (i = 0; i < activeList->count; i++) { - virNVMeDevicePtr other = activeList->devs[i]; + virNVMeDevice *other = activeList->devs[i]; if (!virPCIDeviceAddressEqual(&d->address, &other->address)) continue; diff --git a/src/util/virnvme.h b/src/util/virnvme.h index db4d72ab9a..ceef402c4b 100644 --- a/src/util/virnvme.h +++ b/src/util/virnvme.h @@ -21,7 +21,6 @@ #include "virpci.h" typedef struct _virNVMeDevice virNVMeDevice; -typedef virNVMeDevice *virNVMeDevicePtr; /* Note that this list is lockable, and in fact, it is caller's * responsibility to acquire the lock and release it. The reason @@ -29,28 +28,27 @@ typedef virNVMeDevice *virNVMeDevicePtr; * API calls and therefore only caller knows when it is safe to * finally release the lock. */ typedef struct _virNVMeDeviceList virNVMeDeviceList; -typedef virNVMeDeviceList *virNVMeDeviceListPtr; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNVMeDeviceList, virObjectUnref); -virNVMeDevicePtr +virNVMeDevice * virNVMeDeviceNew(const virPCIDeviceAddress *address, unsigned long namespace, bool managed); void -virNVMeDeviceFree(virNVMeDevicePtr dev); +virNVMeDeviceFree(virNVMeDevice *dev); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virNVMeDevice, virNVMeDeviceFree); -virNVMeDevicePtr +virNVMeDevice * virNVMeDeviceCopy(const virNVMeDevice *dev); const virPCIDeviceAddress * virNVMeDeviceAddressGet(const virNVMeDevice *dev); void -virNVMeDeviceUsedByClear(virNVMeDevicePtr dev); +virNVMeDeviceUsedByClear(virNVMeDevice *dev); void virNVMeDeviceUsedByGet(const virNVMeDevice *dev, @@ -58,40 +56,40 @@ virNVMeDeviceUsedByGet(const virNVMeDevice *dev, const char **dom); void -virNVMeDeviceUsedBySet(virNVMeDevicePtr dev, +virNVMeDeviceUsedBySet(virNVMeDevice *dev, const char *drv, const char *dom); -virNVMeDeviceListPtr +virNVMeDeviceList * virNVMeDeviceListNew(void); size_t virNVMeDeviceListCount(const virNVMeDeviceList *list); int -virNVMeDeviceListAdd(virNVMeDeviceListPtr list, +virNVMeDeviceListAdd(virNVMeDeviceList *list, const virNVMeDevice *dev); int -virNVMeDeviceListDel(virNVMeDeviceListPtr list, +virNVMeDeviceListDel(virNVMeDeviceList *list, const virNVMeDevice *dev); -virNVMeDevicePtr -virNVMeDeviceListGet(virNVMeDeviceListPtr list, +virNVMeDevice * +virNVMeDeviceListGet(virNVMeDeviceList *list, size_t i); -virNVMeDevicePtr -virNVMeDeviceListLookup(virNVMeDeviceListPtr list, +virNVMeDevice * +virNVMeDeviceListLookup(virNVMeDeviceList *list, const virNVMeDevice *dev); ssize_t -virNVMeDeviceListLookupIndex(virNVMeDeviceListPtr list, +virNVMeDeviceListLookupIndex(virNVMeDeviceList *list, const virNVMeDevice *dev); -virPCIDeviceListPtr -virNVMeDeviceListCreateDetachList(virNVMeDeviceListPtr activeList, - virNVMeDeviceListPtr toDetachList); +virPCIDeviceList * +virNVMeDeviceListCreateDetachList(virNVMeDeviceList *activeList, + virNVMeDeviceList *toDetachList); -virPCIDeviceListPtr -virNVMeDeviceListCreateReAttachList(virNVMeDeviceListPtr activeList, - virNVMeDeviceListPtr toReAttachList); +virPCIDeviceList * +virNVMeDeviceListCreateReAttachList(virNVMeDeviceList *activeList, + virNVMeDeviceList *toReAttachList); diff --git a/src/util/virobject.c b/src/util/virobject.c index 370a64bd6d..7173b9136f 100644 --- a/src/util/virobject.c +++ b/src/util/virobject.c @@ -37,7 +37,7 @@ VIR_LOG_INIT("util.object"); static unsigned int magicCounter = 0xCAFE0000; struct _virClass { - virClassPtr parent; + virClass *parent; GType type; unsigned int magic; @@ -49,7 +49,7 @@ struct _virClass { typedef struct _virObjectPrivate virObjectPrivate; struct _virObjectPrivate { - virClassPtr klass; + virClass *klass; }; @@ -59,7 +59,7 @@ G_DEFINE_TYPE_WITH_PRIVATE(virObject, vir_object, G_TYPE_OBJECT) #define VIR_OBJECT_USAGE_PRINT_WARNING(anyobj, objclass) \ do { \ - virObjectPtr obj = anyobj; \ + virObject *obj = anyobj; \ if (!obj) \ VIR_WARN("Object cannot be NULL"); \ if (VIR_OBJECT_NOTVALID(obj)) \ @@ -68,9 +68,9 @@ G_DEFINE_TYPE_WITH_PRIVATE(virObject, vir_object, G_TYPE_OBJECT) } while (0) -static virClassPtr virObjectClassImpl; -static virClassPtr virObjectLockableClass; -static virClassPtr virObjectRWLockableClass; +static virClass *virObjectClassImpl; +static virClass *virObjectLockableClass; +static virClass *virObjectRWLockableClass; static void virObjectLockableDispose(void *anyobj); static void virObjectRWLockableDispose(void *anyobj); @@ -102,7 +102,7 @@ VIR_ONCE_GLOBAL_INIT(virObject); * * Returns the class instance for the base virObject type */ -virClassPtr +virClass * virClassForObject(void) { if (virObjectInitialize() < 0) @@ -117,7 +117,7 @@ virClassForObject(void) * * Returns the class instance for the virObjectLockable type */ -virClassPtr +virClass * virClassForObjectLockable(void) { if (virObjectInitialize() < 0) @@ -132,7 +132,7 @@ virClassForObjectLockable(void) * * Returns the class instance for the virObjectRWLockable type */ -virClassPtr +virClass * virClassForObjectRWLockable(void) { if (virObjectInitialize() < 0) @@ -167,14 +167,14 @@ static void virObjectDummyInit(void *obj G_GNUC_UNUSED) * * Returns a new class instance */ -virClassPtr -virClassNew(virClassPtr parent, +virClass * +virClassNew(virClass *parent, const char *name, size_t objectSize, size_t parentSize, virObjectDisposeCallback dispose) { - virClassPtr klass; + virClass *klass; if (parent == NULL && STRNEQ(name, "virObject")) { @@ -222,8 +222,8 @@ virClassNew(virClassPtr parent, * Return true if @klass is derived from @parent, false otherwise */ bool -virClassIsDerivedFrom(virClassPtr klass, - virClassPtr parent) +virClassIsDerivedFrom(virClass *klass, + virClass *parent) { while (klass) { if (klass->magic == parent->magic) @@ -239,7 +239,7 @@ virClassIsDerivedFrom(virClassPtr klass, * @klass: the klass of object to create * * Allocates a new object of type @klass. The returned - * object will be an instance of "virObjectPtr", which + * object will be an instance of "virObject *", which * can be cast to the struct associated with @klass. * * The initial reference count of the object will be 1. @@ -247,9 +247,9 @@ virClassIsDerivedFrom(virClassPtr klass, * Returns the new object */ void * -virObjectNew(virClassPtr klass) +virObjectNew(virClass *klass) { - virObjectPtr obj = NULL; + virObject *obj = NULL; virObjectPrivate *priv; obj = g_object_new(klass->type, NULL); @@ -263,9 +263,9 @@ virObjectNew(virClassPtr klass) void * -virObjectLockableNew(virClassPtr klass) +virObjectLockableNew(virClass *klass) { - virObjectLockablePtr obj; + virObjectLockable *obj; if (!virClassIsDerivedFrom(klass, virClassForObjectLockable())) { virReportInvalidArg(klass, @@ -289,9 +289,9 @@ virObjectLockableNew(virClassPtr klass) void * -virObjectRWLockableNew(virClassPtr klass) +virObjectRWLockableNew(virClass *klass) { - virObjectRWLockablePtr obj; + virObjectRWLockable *obj; if (!virClassIsDerivedFrom(klass, virClassForObjectRWLockable())) { virReportInvalidArg(klass, @@ -315,9 +315,9 @@ virObjectRWLockableNew(virClassPtr klass) static void vir_object_finalize(GObject *gobj) { - virObjectPtr obj = VIR_OBJECT(gobj); + virObject *obj = VIR_OBJECT(gobj); virObjectPrivate *priv = vir_object_get_instance_private(obj); - virClassPtr klass = priv->klass; + virClass *klass = priv->klass; PROBE(OBJECT_DISPOSE, "obj=%p", gobj); @@ -345,7 +345,7 @@ static void vir_object_class_init(virObjectClass *klass) static void virObjectLockableDispose(void *anyobj) { - virObjectLockablePtr obj = anyobj; + virObjectLockable *obj = anyobj; virMutexDestroy(&obj->lock); } @@ -354,7 +354,7 @@ virObjectLockableDispose(void *anyobj) static void virObjectRWLockableDispose(void *anyobj) { - virObjectRWLockablePtr obj = anyobj; + virObjectRWLockable *obj = anyobj; virRWLockDestroy(&obj->lock); } @@ -362,7 +362,7 @@ virObjectRWLockableDispose(void *anyobj) /** * virObjectUnref: - * @anyobj: any instance of virObjectPtr + * @anyobj: any instance of virObject * * * Decrement the reference count on @anyobj and if * it hits zero, runs the "dispose" callbacks associated @@ -372,7 +372,7 @@ virObjectRWLockableDispose(void *anyobj) void virObjectUnref(void *anyobj) { - virObjectPtr obj = anyobj; + virObject *obj = anyobj; if (VIR_OBJECT_NOTVALID(obj)) return; @@ -384,7 +384,7 @@ virObjectUnref(void *anyobj) /** * virObjectRef: - * @anyobj: any instance of virObjectPtr + * @anyobj: any instance of virObject * * * Increment the reference count on @anyobj and return * the same pointer @@ -394,7 +394,7 @@ virObjectUnref(void *anyobj) void * virObjectRef(void *anyobj) { - virObjectPtr obj = anyobj; + virObject *obj = anyobj; if (VIR_OBJECT_NOTVALID(obj)) return NULL; @@ -405,7 +405,7 @@ virObjectRef(void *anyobj) } -static virObjectLockablePtr +static virObjectLockable * virObjectGetLockableObj(void *anyobj) { if (virObjectIsClass(anyobj, virObjectLockableClass)) @@ -416,7 +416,7 @@ virObjectGetLockableObj(void *anyobj) } -static virObjectRWLockablePtr +static virObjectRWLockable * virObjectGetRWLockableObj(void *anyobj) { if (virObjectIsClass(anyobj, virObjectRWLockableClass)) @@ -442,7 +442,7 @@ virObjectGetRWLockableObj(void *anyobj) void virObjectLock(void *anyobj) { - virObjectLockablePtr obj = virObjectGetLockableObj(anyobj); + virObjectLockable *obj = virObjectGetLockableObj(anyobj); if (!obj) return; @@ -471,7 +471,7 @@ virObjectLock(void *anyobj) void virObjectRWLockRead(void *anyobj) { - virObjectRWLockablePtr obj = virObjectGetRWLockableObj(anyobj); + virObjectRWLockable *obj = virObjectGetRWLockableObj(anyobj); if (!obj) return; @@ -500,7 +500,7 @@ virObjectRWLockRead(void *anyobj) void virObjectRWLockWrite(void *anyobj) { - virObjectRWLockablePtr obj = virObjectGetRWLockableObj(anyobj); + virObjectRWLockable *obj = virObjectGetRWLockableObj(anyobj); if (!obj) return; @@ -519,7 +519,7 @@ virObjectRWLockWrite(void *anyobj) void virObjectUnlock(void *anyobj) { - virObjectLockablePtr obj = virObjectGetLockableObj(anyobj); + virObjectLockable *obj = virObjectGetLockableObj(anyobj); if (!obj) return; @@ -538,7 +538,7 @@ virObjectUnlock(void *anyobj) void virObjectRWUnlock(void *anyobj) { - virObjectRWLockablePtr obj = virObjectGetRWLockableObj(anyobj); + virObjectRWLockable *obj = virObjectGetRWLockableObj(anyobj); if (!obj) return; @@ -549,7 +549,7 @@ virObjectRWUnlock(void *anyobj) /** * virObjectIsClass: - * @anyobj: any instance of virObjectPtr + * @anyobj: any instance of virObject * * @klass: the class to check * * Checks whether @anyobj is an instance of @@ -559,9 +559,9 @@ virObjectRWUnlock(void *anyobj) */ bool virObjectIsClass(void *anyobj, - virClassPtr klass) + virClass *klass) { - virObjectPtr obj = anyobj; + virObject *obj = anyobj; virObjectPrivate *priv; if (VIR_OBJECT_NOTVALID(obj)) @@ -579,7 +579,7 @@ virObjectIsClass(void *anyobj, * Returns the name of @klass */ const char * -virClassName(virClassPtr klass) +virClassName(virClass *klass) { return klass->name; } diff --git a/src/util/virobject.h b/src/util/virobject.h index 18a9f098a6..1e34c77744 100644 --- a/src/util/virobject.h +++ b/src/util/virobject.h @@ -27,16 +27,12 @@ #include typedef struct _virClass virClass; -typedef virClass *virClassPtr; typedef struct _virObject virObject; -typedef virObject *virObjectPtr; typedef struct _virObjectLockable virObjectLockable; -typedef virObjectLockable *virObjectLockablePtr; typedef struct _virObjectRWLockable virObjectRWLockable; -typedef virObjectRWLockable *virObjectRWLockablePtr; typedef void (*virObjectDisposeCallback)(void *obj); @@ -57,9 +53,9 @@ struct _virObjectRWLockable { virRWLock lock; }; -virClassPtr virClassForObject(void); -virClassPtr virClassForObjectLockable(void); -virClassPtr virClassForObjectRWLockable(void); +virClass *virClassForObject(void); +virClass *virClassForObjectLockable(void); +virClass *virClassForObjectRWLockable(void); #ifndef VIR_PARENT_REQUIRED # define VIR_PARENT_REQUIRED ATTRIBUTE_NONNULL(1) @@ -76,8 +72,8 @@ virClassPtr virClassForObjectRWLockable(void); sizeof(((name *)NULL)->parent), \ name##Dispose))) -virClassPtr -virClassNew(virClassPtr parent, +virClass * +virClassNew(virClass *parent, const char *name, size_t objectSize, size_t parentSize, @@ -85,16 +81,16 @@ virClassNew(virClassPtr parent, VIR_PARENT_REQUIRED ATTRIBUTE_NONNULL(2); const char * -virClassName(virClassPtr klass) +virClassName(virClass *klass) ATTRIBUTE_NONNULL(1); bool -virClassIsDerivedFrom(virClassPtr klass, - virClassPtr parent) +virClassIsDerivedFrom(virClass *klass, + virClass *parent) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); void * -virObjectNew(virClassPtr klass) +virObjectNew(virClass *klass) ATTRIBUTE_NONNULL(1); void @@ -105,7 +101,7 @@ virObjectRef(void *obj); bool virObjectIsClass(void *obj, - virClassPtr klass) + virClass *klass) ATTRIBUTE_NONNULL(2); void @@ -115,11 +111,11 @@ void virObjectFreeHashData(void *opaque); void * -virObjectLockableNew(virClassPtr klass) +virObjectLockableNew(virClass *klass) ATTRIBUTE_NONNULL(1); void * -virObjectRWLockableNew(virClassPtr klass) +virObjectRWLockableNew(virClass *klass) ATTRIBUTE_NONNULL(1); void diff --git a/src/util/virpci.c b/src/util/virpci.c index 5da74d5e9f..d479c75db0 100644 --- a/src/util/virpci.c +++ b/src/util/virpci.c @@ -99,7 +99,7 @@ struct _virPCIDeviceList { virObjectLockable parent; size_t count; - virPCIDevicePtr *devs; + virPCIDevice **devs; }; @@ -198,7 +198,7 @@ struct _virPCIDeviceList { #define PCI_EXP_TYPE_ROOT_INT_EP 0x9 /* Root Complex Integrated Endpoint */ #define PCI_EXP_TYPE_ROOT_EC 0xa /* Root Complex Event Collector */ -static virClassPtr virPCIDeviceListClass; +static virClass *virPCIDeviceListClass; static void virPCIDeviceListDispose(void *obj); @@ -235,7 +235,7 @@ virPCIFile(const char *device, const char *file) * Return 0 for success, -1 for error. */ int -virPCIDeviceGetDriverPathAndName(virPCIDevicePtr dev, char **path, char **name) +virPCIDeviceGetDriverPathAndName(virPCIDevice *dev, char **path, char **name) { int ret = -1; g_autofree char *drvlink = NULL; @@ -278,7 +278,7 @@ virPCIDeviceGetDriverPathAndName(virPCIDevicePtr dev, char **path, char **name) static int -virPCIDeviceConfigOpenInternal(virPCIDevicePtr dev, bool readonly, bool fatal) +virPCIDeviceConfigOpenInternal(virPCIDevice *dev, bool readonly, bool fatal) { int fd; @@ -301,25 +301,25 @@ virPCIDeviceConfigOpenInternal(virPCIDevicePtr dev, bool readonly, bool fatal) } static int -virPCIDeviceConfigOpen(virPCIDevicePtr dev) +virPCIDeviceConfigOpen(virPCIDevice *dev) { return virPCIDeviceConfigOpenInternal(dev, true, true); } static int -virPCIDeviceConfigOpenTry(virPCIDevicePtr dev) +virPCIDeviceConfigOpenTry(virPCIDevice *dev) { return virPCIDeviceConfigOpenInternal(dev, true, false); } static int -virPCIDeviceConfigOpenWrite(virPCIDevicePtr dev) +virPCIDeviceConfigOpenWrite(virPCIDevice *dev) { return virPCIDeviceConfigOpenInternal(dev, false, true); } static void -virPCIDeviceConfigClose(virPCIDevicePtr dev, int cfgfd) +virPCIDeviceConfigClose(virPCIDevice *dev, int cfgfd) { if (VIR_CLOSE(cfgfd) < 0) { VIR_WARN("Failed to close config space file '%s': %s", @@ -329,7 +329,7 @@ virPCIDeviceConfigClose(virPCIDevicePtr dev, int cfgfd) static int -virPCIDeviceRead(virPCIDevicePtr dev, +virPCIDeviceRead(virPCIDevice *dev, int cfgfd, unsigned int pos, uint8_t *buf, @@ -369,7 +369,7 @@ virPCIDeviceRead(virPCIDevicePtr dev, * the value 0 at @pos. */ static uint8_t -virPCIDeviceRead8(virPCIDevicePtr dev, int cfgfd, unsigned int pos) +virPCIDeviceRead8(virPCIDevice *dev, int cfgfd, unsigned int pos) { uint8_t buf; virPCIDeviceRead(dev, cfgfd, pos, &buf, sizeof(buf)); @@ -377,7 +377,7 @@ virPCIDeviceRead8(virPCIDevicePtr dev, int cfgfd, unsigned int pos) } static uint16_t -virPCIDeviceRead16(virPCIDevicePtr dev, int cfgfd, unsigned int pos) +virPCIDeviceRead16(virPCIDevice *dev, int cfgfd, unsigned int pos) { uint8_t buf[2]; virPCIDeviceRead(dev, cfgfd, pos, &buf[0], sizeof(buf)); @@ -385,7 +385,7 @@ virPCIDeviceRead16(virPCIDevicePtr dev, int cfgfd, unsigned int pos) } static uint32_t -virPCIDeviceRead32(virPCIDevicePtr dev, int cfgfd, unsigned int pos) +virPCIDeviceRead32(virPCIDevice *dev, int cfgfd, unsigned int pos) { uint8_t buf[4]; virPCIDeviceRead(dev, cfgfd, pos, &buf[0], sizeof(buf)); @@ -393,7 +393,7 @@ virPCIDeviceRead32(virPCIDevicePtr dev, int cfgfd, unsigned int pos) } static int -virPCIDeviceReadClass(virPCIDevicePtr dev, uint16_t *device_class) +virPCIDeviceReadClass(virPCIDevice *dev, uint16_t *device_class) { g_autofree char *path = NULL; g_autofree char *id_str = NULL; @@ -418,7 +418,7 @@ virPCIDeviceReadClass(virPCIDevicePtr dev, uint16_t *device_class) } static int -virPCIDeviceWrite(virPCIDevicePtr dev, +virPCIDeviceWrite(virPCIDevice *dev, int cfgfd, unsigned int pos, uint8_t *buf, @@ -434,20 +434,20 @@ virPCIDeviceWrite(virPCIDevicePtr dev, } static void -virPCIDeviceWrite16(virPCIDevicePtr dev, int cfgfd, unsigned int pos, uint16_t val) +virPCIDeviceWrite16(virPCIDevice *dev, int cfgfd, unsigned int pos, uint16_t val) { uint8_t buf[2] = { (val >> 0), (val >> 8) }; virPCIDeviceWrite(dev, cfgfd, pos, &buf[0], sizeof(buf)); } static void -virPCIDeviceWrite32(virPCIDevicePtr dev, int cfgfd, unsigned int pos, uint32_t val) +virPCIDeviceWrite32(virPCIDevice *dev, int cfgfd, unsigned int pos, uint32_t val) { uint8_t buf[4] = { (val >> 0), (val >> 8), (val >> 16), (val >> 24) }; virPCIDeviceWrite(dev, cfgfd, pos, &buf[0], sizeof(buf)); } -typedef int (*virPCIDeviceIterPredicate)(virPCIDevicePtr, virPCIDevicePtr, +typedef int (*virPCIDeviceIterPredicate)(virPCIDevice *, virPCIDevice *, void *); /* Iterate over available PCI devices calling @predicate @@ -457,8 +457,8 @@ typedef int (*virPCIDeviceIterPredicate)(virPCIDevicePtr, virPCIDevicePtr, */ static int virPCIDeviceIterDevices(virPCIDeviceIterPredicate predicate, - virPCIDevicePtr dev, - virPCIDevicePtr *matched, + virPCIDevice *dev, + virPCIDevice **matched, void *data) { g_autoptr(DIR) dir = NULL; @@ -527,7 +527,7 @@ virPCIDeviceIterDevices(virPCIDeviceIterPredicate predicate, * Returns 0 on success, -1 on failure. */ static int -virPCIDeviceFindCapabilityOffset(virPCIDevicePtr dev, +virPCIDeviceFindCapabilityOffset(virPCIDevice *dev, int cfgfd, unsigned int capability, unsigned int *offset) @@ -582,7 +582,7 @@ virPCIDeviceFindCapabilityOffset(virPCIDevicePtr dev, } static unsigned int -virPCIDeviceFindExtendedCapabilityOffset(virPCIDevicePtr dev, +virPCIDeviceFindExtendedCapabilityOffset(virPCIDevice *dev, int cfgfd, unsigned int capability) { @@ -611,7 +611,7 @@ virPCIDeviceFindExtendedCapabilityOffset(virPCIDevicePtr dev, * not have FLR, 1 if it does, and -1 on error */ static bool -virPCIDeviceDetectFunctionLevelReset(virPCIDevicePtr dev, int cfgfd) +virPCIDeviceDetectFunctionLevelReset(virPCIDevice *dev, int cfgfd) { uint32_t caps; unsigned int pos; @@ -672,7 +672,7 @@ virPCIDeviceDetectFunctionLevelReset(virPCIDevicePtr dev, int cfgfd) * internal reset, not just a soft reset. */ static bool -virPCIDeviceDetectPowerManagementReset(virPCIDevicePtr dev, int cfgfd) +virPCIDeviceDetectPowerManagementReset(virPCIDevice *dev, int cfgfd) { if (dev->pci_pm_cap_pos) { uint32_t ctl; @@ -692,7 +692,7 @@ virPCIDeviceDetectPowerManagementReset(virPCIDevicePtr dev, int cfgfd) /* Any active devices on the same domain/bus ? */ static int -virPCIDeviceSharesBusWithActive(virPCIDevicePtr dev, virPCIDevicePtr check, void *data) +virPCIDeviceSharesBusWithActive(virPCIDevice *dev, virPCIDevice *check, void *data) { virPCIDeviceList *inactiveDevs = data; @@ -710,11 +710,11 @@ virPCIDeviceSharesBusWithActive(virPCIDevicePtr dev, virPCIDevicePtr check, void return 1; } -static virPCIDevicePtr -virPCIDeviceBusContainsActiveDevices(virPCIDevicePtr dev, +static virPCIDevice * +virPCIDeviceBusContainsActiveDevices(virPCIDevice *dev, virPCIDeviceList *inactiveDevs) { - virPCIDevicePtr active = NULL; + virPCIDevice *active = NULL; if (virPCIDeviceIterDevices(virPCIDeviceSharesBusWithActive, dev, &active, inactiveDevs) < 0) return NULL; @@ -723,11 +723,11 @@ virPCIDeviceBusContainsActiveDevices(virPCIDevicePtr dev, /* Is @check the parent of @dev ? */ static int -virPCIDeviceIsParent(virPCIDevicePtr dev, virPCIDevicePtr check, void *data) +virPCIDeviceIsParent(virPCIDevice *dev, virPCIDevice *check, void *data) { uint16_t device_class; uint8_t header_type, secondary, subordinate; - virPCIDevicePtr *best = data; + virPCIDevice **best = data; int ret = 0; int fd; @@ -801,9 +801,9 @@ virPCIDeviceIsParent(virPCIDevicePtr dev, virPCIDevicePtr check, void *data) } static int -virPCIDeviceGetParent(virPCIDevicePtr dev, virPCIDevicePtr *parent) +virPCIDeviceGetParent(virPCIDevice *dev, virPCIDevice **parent) { - virPCIDevicePtr best = NULL; + virPCIDevice *best = NULL; int ret; *parent = NULL; @@ -819,7 +819,7 @@ virPCIDeviceGetParent(virPCIDevicePtr dev, virPCIDevicePtr *parent) * devices behind a bus. */ static int -virPCIDeviceTrySecondaryBusReset(virPCIDevicePtr dev, +virPCIDeviceTrySecondaryBusReset(virPCIDevice *dev, int cfgfd, virPCIDeviceList *inactiveDevs) { @@ -898,7 +898,7 @@ virPCIDeviceTrySecondaryBusReset(virPCIDevicePtr dev, * above we require the device supports a full internal reset. */ static int -virPCIDeviceTryPowerManagementReset(virPCIDevicePtr dev, int cfgfd) +virPCIDeviceTryPowerManagementReset(virPCIDevice *dev, int cfgfd) { uint8_t config_space[PCI_CONF_LEN]; uint32_t ctl; @@ -964,7 +964,7 @@ virPCIDeviceTryPowerManagementReset(virPCIDevicePtr dev, int cfgfd) * Always returns success (0) (for now) */ static int -virPCIDeviceInit(virPCIDevicePtr dev, int cfgfd) +virPCIDeviceInit(virPCIDevice *dev, int cfgfd) { dev->is_pcie = false; if (virPCIDeviceFindCapabilityOffset(dev, cfgfd, PCI_CAP_ID_EXP, &dev->pcie_cap_pos) < 0) { @@ -1000,7 +1000,7 @@ virPCIDeviceInit(virPCIDevicePtr dev, int cfgfd) } int -virPCIDeviceReset(virPCIDevicePtr dev, +virPCIDeviceReset(virPCIDevice *dev, virPCIDeviceList *activeDevs, virPCIDeviceList *inactiveDevs) { @@ -1132,7 +1132,7 @@ virPCIProbeStubDriver(virPCIStubDriver driver) } int -virPCIDeviceUnbind(virPCIDevicePtr dev) +virPCIDeviceUnbind(virPCIDevice *dev) { g_autofree char *path = NULL; g_autofree char *drvpath = NULL; @@ -1168,7 +1168,7 @@ virPCIDeviceUnbind(virPCIDevicePtr dev) * * Returns 0 on success, -1 on failure */ -int virPCIDeviceRebind(virPCIDevicePtr dev) +int virPCIDeviceRebind(virPCIDevice *dev) { if (virPCIDeviceUnbind(dev) < 0) return -1; @@ -1196,7 +1196,7 @@ int virPCIDeviceRebind(virPCIDevicePtr dev) * preferred driver. */ static int -virPCIDeviceBindWithDriverOverride(virPCIDevicePtr dev, +virPCIDeviceBindWithDriverOverride(virPCIDevice *dev, const char *driverName) { g_autofree char *path = NULL; @@ -1218,7 +1218,7 @@ virPCIDeviceBindWithDriverOverride(virPCIDevicePtr dev, } static int -virPCIDeviceUnbindFromStub(virPCIDevicePtr dev) +virPCIDeviceUnbindFromStub(virPCIDevice *dev) { if (!dev->unbind_from_stub) { VIR_DEBUG("Unbind from stub skipped for PCI device %s", dev->name); @@ -1229,7 +1229,7 @@ virPCIDeviceUnbindFromStub(virPCIDevicePtr dev) } static int -virPCIDeviceBindToStub(virPCIDevicePtr dev) +virPCIDeviceBindToStub(virPCIDevice *dev) { const char *stubDriverName; g_autofree char *stubDriverPath = NULL; @@ -1286,7 +1286,7 @@ virPCIDeviceBindToStub(virPCIDevicePtr dev) * list. */ int -virPCIDeviceDetach(virPCIDevicePtr dev, +virPCIDeviceDetach(virPCIDevice *dev, virPCIDeviceList *activeDevs, virPCIDeviceList *inactiveDevs) { @@ -1319,9 +1319,9 @@ virPCIDeviceDetach(virPCIDevicePtr dev, * are locked */ int -virPCIDeviceReattach(virPCIDevicePtr dev, - virPCIDeviceListPtr activeDevs, - virPCIDeviceListPtr inactiveDevs) +virPCIDeviceReattach(virPCIDevice *dev, + virPCIDeviceList *activeDevs, + virPCIDeviceList *inactiveDevs) { if (activeDevs && virPCIDeviceListFind(activeDevs, &dev->address)) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -1342,7 +1342,7 @@ virPCIDeviceReattach(virPCIDevicePtr dev, } static char * -virPCIDeviceReadID(virPCIDevicePtr dev, const char *id_name) +virPCIDeviceReadID(virPCIDevice *dev, const char *id_name) { g_autofree char *path = NULL; g_autofree char *id_str = NULL; @@ -1364,7 +1364,7 @@ virPCIDeviceReadID(virPCIDevicePtr dev, const char *id_name) } bool -virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr, +virPCIDeviceAddressIsValid(virPCIDeviceAddress *addr, bool report) { if (addr->bus > 0xFF) { @@ -1428,7 +1428,7 @@ virPCIDeviceAddressEqual(const virPCIDeviceAddress *addr1, * Creates a deep copy of given @src address and stores it into * @dst which has to be pre-allocated by caller. */ -void virPCIDeviceAddressCopy(virPCIDeviceAddressPtr dst, +void virPCIDeviceAddressCopy(virPCIDeviceAddress *dst, const virPCIDeviceAddress *src) { memcpy(dst, src, sizeof(*src)); @@ -1457,7 +1457,7 @@ virPCIDeviceExists(const virPCIDeviceAddress *addr) return virFileExists(devPath); } -virPCIDevicePtr +virPCIDevice * virPCIDeviceNew(const virPCIDeviceAddress *address) { g_autoptr(virPCIDevice) dev = NULL; @@ -1504,10 +1504,10 @@ virPCIDeviceNew(const virPCIDeviceAddress *address) } -virPCIDevicePtr -virPCIDeviceCopy(virPCIDevicePtr dev) +virPCIDevice * +virPCIDeviceCopy(virPCIDevice *dev) { - virPCIDevicePtr copy; + virPCIDevice *copy; copy = g_new0(virPCIDevice, 1); @@ -1524,7 +1524,7 @@ virPCIDeviceCopy(virPCIDevicePtr dev) void -virPCIDeviceFree(virPCIDevicePtr dev) +virPCIDeviceFree(virPCIDevice *dev) { if (!dev) return; @@ -1545,14 +1545,14 @@ virPCIDeviceFree(virPCIDevicePtr dev) * * Returns: a pointer to the address, which can never be NULL. */ -virPCIDeviceAddressPtr -virPCIDeviceGetAddress(virPCIDevicePtr dev) +virPCIDeviceAddress * +virPCIDeviceGetAddress(virPCIDevice *dev) { return &(dev->address); } const char * -virPCIDeviceGetName(virPCIDevicePtr dev) +virPCIDeviceGetName(virPCIDevice *dev) { return dev->name; } @@ -1564,72 +1564,72 @@ virPCIDeviceGetName(virPCIDevicePtr dev) * config file. */ const char * -virPCIDeviceGetConfigPath(virPCIDevicePtr dev) +virPCIDeviceGetConfigPath(virPCIDevice *dev) { return dev->path; } -void virPCIDeviceSetManaged(virPCIDevicePtr dev, bool managed) +void virPCIDeviceSetManaged(virPCIDevice *dev, bool managed) { dev->managed = managed; } bool -virPCIDeviceGetManaged(virPCIDevicePtr dev) +virPCIDeviceGetManaged(virPCIDevice *dev) { return dev->managed; } void -virPCIDeviceSetStubDriver(virPCIDevicePtr dev, virPCIStubDriver driver) +virPCIDeviceSetStubDriver(virPCIDevice *dev, virPCIStubDriver driver) { dev->stubDriver = driver; } virPCIStubDriver -virPCIDeviceGetStubDriver(virPCIDevicePtr dev) +virPCIDeviceGetStubDriver(virPCIDevice *dev) { return dev->stubDriver; } bool -virPCIDeviceGetUnbindFromStub(virPCIDevicePtr dev) +virPCIDeviceGetUnbindFromStub(virPCIDevice *dev) { return dev->unbind_from_stub; } void -virPCIDeviceSetUnbindFromStub(virPCIDevicePtr dev, bool unbind) +virPCIDeviceSetUnbindFromStub(virPCIDevice *dev, bool unbind) { dev->unbind_from_stub = unbind; } bool -virPCIDeviceGetRemoveSlot(virPCIDevicePtr dev) +virPCIDeviceGetRemoveSlot(virPCIDevice *dev) { return dev->remove_slot; } void -virPCIDeviceSetRemoveSlot(virPCIDevicePtr dev, bool remove_slot) +virPCIDeviceSetRemoveSlot(virPCIDevice *dev, bool remove_slot) { dev->remove_slot = remove_slot; } bool -virPCIDeviceGetReprobe(virPCIDevicePtr dev) +virPCIDeviceGetReprobe(virPCIDevice *dev) { return dev->reprobe; } void -virPCIDeviceSetReprobe(virPCIDevicePtr dev, bool reprobe) +virPCIDeviceSetReprobe(virPCIDevice *dev, bool reprobe) { dev->reprobe = reprobe; } int -virPCIDeviceSetUsedBy(virPCIDevicePtr dev, +virPCIDeviceSetUsedBy(virPCIDevice *dev, const char *drv_name, const char *dom_name) { @@ -1642,7 +1642,7 @@ virPCIDeviceSetUsedBy(virPCIDevicePtr dev, } void -virPCIDeviceGetUsedBy(virPCIDevicePtr dev, +virPCIDeviceGetUsedBy(virPCIDevice *dev, const char **drv_name, const char **dom_name) { @@ -1650,10 +1650,10 @@ virPCIDeviceGetUsedBy(virPCIDevicePtr dev, *dom_name = dev->used_by_domname; } -virPCIDeviceListPtr +virPCIDeviceList * virPCIDeviceListNew(void) { - virPCIDeviceListPtr list; + virPCIDeviceList *list; if (virPCIInitialize() < 0) return NULL; @@ -1667,7 +1667,7 @@ virPCIDeviceListNew(void) static void virPCIDeviceListDispose(void *obj) { - virPCIDeviceListPtr list = obj; + virPCIDeviceList *list = obj; size_t i; for (i = 0; i < list->count; i++) { @@ -1680,8 +1680,8 @@ virPCIDeviceListDispose(void *obj) } int -virPCIDeviceListAdd(virPCIDeviceListPtr list, - virPCIDevicePtr dev) +virPCIDeviceListAdd(virPCIDeviceList *list, + virPCIDevice *dev) { if (virPCIDeviceListFind(list, &dev->address)) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -1694,7 +1694,7 @@ virPCIDeviceListAdd(virPCIDeviceListPtr list, /* virPCIDeviceListAddCopy - add a *copy* of the device to this list */ int -virPCIDeviceListAddCopy(virPCIDeviceListPtr list, virPCIDevicePtr dev) +virPCIDeviceListAddCopy(virPCIDeviceList *list, virPCIDevice *dev) { g_autoptr(virPCIDevice) copy = virPCIDeviceCopy(dev); @@ -1708,8 +1708,8 @@ virPCIDeviceListAddCopy(virPCIDeviceListPtr list, virPCIDevicePtr dev) } -virPCIDevicePtr -virPCIDeviceListGet(virPCIDeviceListPtr list, +virPCIDevice * +virPCIDeviceListGet(virPCIDeviceList *list, int idx) { if (idx >= list->count) @@ -1721,16 +1721,16 @@ virPCIDeviceListGet(virPCIDeviceListPtr list, } size_t -virPCIDeviceListCount(virPCIDeviceListPtr list) +virPCIDeviceListCount(virPCIDeviceList *list) { return list->count; } -virPCIDevicePtr -virPCIDeviceListStealIndex(virPCIDeviceListPtr list, +virPCIDevice * +virPCIDeviceListStealIndex(virPCIDeviceList *list, int idx) { - virPCIDevicePtr ret; + virPCIDevice *ret; if (idx < 0 || idx >= list->count) return NULL; @@ -1740,28 +1740,28 @@ virPCIDeviceListStealIndex(virPCIDeviceListPtr list, return ret; } -virPCIDevicePtr -virPCIDeviceListSteal(virPCIDeviceListPtr list, - virPCIDeviceAddressPtr devAddr) +virPCIDevice * +virPCIDeviceListSteal(virPCIDeviceList *list, + virPCIDeviceAddress *devAddr) { return virPCIDeviceListStealIndex(list, virPCIDeviceListFindIndex(list, devAddr)); } void -virPCIDeviceListDel(virPCIDeviceListPtr list, - virPCIDeviceAddressPtr devAddr) +virPCIDeviceListDel(virPCIDeviceList *list, + virPCIDeviceAddress *devAddr) { virPCIDeviceFree(virPCIDeviceListSteal(list, devAddr)); } int -virPCIDeviceListFindIndex(virPCIDeviceListPtr list, - virPCIDeviceAddressPtr devAddr) +virPCIDeviceListFindIndex(virPCIDeviceList *list, + virPCIDeviceAddress *devAddr) { size_t i; for (i = 0; i < list->count; i++) { - virPCIDevicePtr other = list->devs[i]; + virPCIDevice *other = list->devs[i]; if (other->address.domain == devAddr->domain && other->address.bus == devAddr->bus && other->address.slot == devAddr->slot && @@ -1772,8 +1772,8 @@ virPCIDeviceListFindIndex(virPCIDeviceListPtr list, } -virPCIDevicePtr -virPCIDeviceListFindByIDs(virPCIDeviceListPtr list, +virPCIDevice * +virPCIDeviceListFindByIDs(virPCIDeviceList *list, unsigned int domain, unsigned int bus, unsigned int slot, @@ -1782,7 +1782,7 @@ virPCIDeviceListFindByIDs(virPCIDeviceListPtr list, size_t i; for (i = 0; i < list->count; i++) { - virPCIDevicePtr other = list->devs[i]; + virPCIDevice *other = list->devs[i]; if (other->address.domain == domain && other->address.bus == bus && other->address.slot == slot && @@ -1793,8 +1793,8 @@ virPCIDeviceListFindByIDs(virPCIDeviceListPtr list, } -virPCIDevicePtr -virPCIDeviceListFind(virPCIDeviceListPtr list, virPCIDeviceAddressPtr devAddr) +virPCIDevice * +virPCIDeviceListFind(virPCIDeviceList *list, virPCIDeviceAddress *devAddr) { int idx; @@ -1805,7 +1805,7 @@ virPCIDeviceListFind(virPCIDeviceListPtr list, virPCIDeviceAddressPtr devAddr) } -int virPCIDeviceFileIterate(virPCIDevicePtr dev, +int virPCIDeviceFileIterate(virPCIDevice *dev, virPCIDeviceFileActor actor, void *opaque) { @@ -1851,7 +1851,7 @@ int virPCIDeviceFileIterate(virPCIDevicePtr dev, * device, call @actor once for orig. */ int -virPCIDeviceAddressIOMMUGroupIterate(virPCIDeviceAddressPtr orig, +virPCIDeviceAddressIOMMUGroupIterate(virPCIDeviceAddress *orig, virPCIDeviceAddressActor actor, void *opaque) { @@ -1889,9 +1889,9 @@ virPCIDeviceAddressIOMMUGroupIterate(virPCIDeviceAddressPtr orig, static int -virPCIDeviceGetIOMMUGroupAddOne(virPCIDeviceAddressPtr newDevAddr, void *opaque) +virPCIDeviceGetIOMMUGroupAddOne(virPCIDeviceAddress *newDevAddr, void *opaque) { - virPCIDeviceListPtr groupList = opaque; + virPCIDeviceList *groupList = opaque; g_autoptr(virPCIDevice) newDev = NULL; if (!(newDev = virPCIDeviceNew(newDevAddr))) @@ -1911,10 +1911,10 @@ virPCIDeviceGetIOMMUGroupAddOne(virPCIDeviceAddressPtr newDevAddr, void *opaque) * * Return the new list, or NULL on failure */ -virPCIDeviceListPtr -virPCIDeviceGetIOMMUGroupList(virPCIDevicePtr dev) +virPCIDeviceList * +virPCIDeviceGetIOMMUGroupList(virPCIDevice *dev) { - virPCIDeviceListPtr groupList = virPCIDeviceListNew(); + virPCIDeviceList *groupList = virPCIDeviceListNew(); if (!groupList) goto error; @@ -1933,16 +1933,15 @@ virPCIDeviceGetIOMMUGroupList(virPCIDevicePtr dev) typedef struct { - virPCIDeviceAddressPtr **iommuGroupDevices; + virPCIDeviceAddress ***iommuGroupDevices; size_t *nIommuGroupDevices; } virPCIDeviceAddressList; -typedef virPCIDeviceAddressList *virPCIDeviceAddressListPtr; static int -virPCIGetIOMMUGroupAddressesAddOne(virPCIDeviceAddressPtr newDevAddr, void *opaque) +virPCIGetIOMMUGroupAddressesAddOne(virPCIDeviceAddress *newDevAddr, void *opaque) { - virPCIDeviceAddressListPtr addrList = opaque; - g_autofree virPCIDeviceAddressPtr copyAddr = NULL; + virPCIDeviceAddressList *addrList = opaque; + g_autofree virPCIDeviceAddress *copyAddr = NULL; /* make a copy to insert onto the list */ copyAddr = g_new0(virPCIDeviceAddress, 1); @@ -1965,8 +1964,8 @@ virPCIGetIOMMUGroupAddressesAddOne(virPCIDeviceAddressPtr newDevAddr, void *opaq * Return the new list, or NULL on failure */ int -virPCIDeviceAddressGetIOMMUGroupAddresses(virPCIDeviceAddressPtr devAddr, - virPCIDeviceAddressPtr **iommuGroupDevices, +virPCIDeviceAddressGetIOMMUGroupAddresses(virPCIDeviceAddress *devAddr, + virPCIDeviceAddress ***iommuGroupDevices, size_t *nIommuGroupDevices) { virPCIDeviceAddressList addrList = { iommuGroupDevices, @@ -1986,7 +1985,7 @@ virPCIDeviceAddressGetIOMMUGroupAddresses(virPCIDeviceAddressPtr devAddr, * the device (or -1 if there was any other error) */ int -virPCIDeviceAddressGetIOMMUGroupNum(virPCIDeviceAddressPtr addr) +virPCIDeviceAddressGetIOMMUGroupNum(virPCIDeviceAddress *addr) { g_autofree char *devName = NULL; g_autofree char *devPath = NULL; @@ -2036,7 +2035,7 @@ virPCIDeviceAddressGetIOMMUGroupDev(const virPCIDeviceAddress *devAddr) * to control this PCI device's group (e.g. "/dev/vfio/15") */ char * -virPCIDeviceGetIOMMUGroupDev(virPCIDevicePtr dev) +virPCIDeviceGetIOMMUGroupDev(virPCIDevice *dev) { g_autofree char *devPath = NULL; g_autofree char *groupPath = NULL; @@ -2062,7 +2061,7 @@ virPCIDeviceGetIOMMUGroupDev(virPCIDevicePtr dev) } static int -virPCIDeviceDownstreamLacksACS(virPCIDevicePtr dev) +virPCIDeviceDownstreamLacksACS(virPCIDevice *dev) { uint16_t flags; uint16_t ctrl; @@ -2111,7 +2110,7 @@ virPCIDeviceDownstreamLacksACS(virPCIDevicePtr dev) } static int -virPCIDeviceIsBehindSwitchLackingACS(virPCIDevicePtr dev) +virPCIDeviceIsBehindSwitchLackingACS(virPCIDevice *dev) { g_autoptr(virPCIDevice) parent = NULL; @@ -2159,7 +2158,7 @@ virPCIDeviceIsBehindSwitchLackingACS(virPCIDevicePtr dev) return 0; } -int virPCIDeviceIsAssignable(virPCIDevicePtr dev, +int virPCIDeviceIsAssignable(virPCIDevice *dev, int strict_acs_check) { int ret; @@ -2205,7 +2204,7 @@ logStrToLong_ui(char const *s, int virPCIDeviceAddressParse(char *address, - virPCIDeviceAddressPtr bdf) + virPCIDeviceAddress *bdf) { char *p = NULL; @@ -2249,10 +2248,10 @@ virZPCIDeviceAddressIsPresent(const virZPCIDeviceAddress *addr) #ifdef __linux__ -virPCIDeviceAddressPtr +virPCIDeviceAddress * virPCIGetDeviceAddressFromSysfsLink(const char *device_link) { - g_autofree virPCIDeviceAddressPtr bdf = NULL; + g_autofree virPCIDeviceAddress *bdf = NULL; g_autofree char *config_address = NULL; g_autofree char *device_path = NULL; @@ -2298,7 +2297,7 @@ virPCIGetDeviceAddressFromSysfsLink(const char *device_link) */ int virPCIGetPhysicalFunction(const char *vf_sysfs_path, - virPCIDeviceAddressPtr *pf) + virPCIDeviceAddress **pf) { g_autofree char *device_link = NULL; @@ -2321,14 +2320,14 @@ virPCIGetPhysicalFunction(const char *vf_sysfs_path, */ int virPCIGetVirtualFunctions(const char *sysfs_path, - virPCIDeviceAddressPtr **virtual_functions, + virPCIDeviceAddress ***virtual_functions, size_t *num_virtual_functions, unsigned int *max_virtual_functions) { size_t i; g_autofree char *totalvfs_file = NULL; g_autofree char *totalvfs_str = NULL; - g_autofree virPCIDeviceAddressPtr config_addr = NULL; + g_autofree virPCIDeviceAddress *config_addr = NULL; *virtual_functions = NULL; *num_virtual_functions = 0; @@ -2407,8 +2406,8 @@ virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link, size_t i; size_t num_virt_fns = 0; unsigned int max_virt_fns = 0; - g_autofree virPCIDeviceAddressPtr vf_bdf = NULL; - virPCIDeviceAddressPtr *virt_fns = NULL; + g_autofree virPCIDeviceAddress *vf_bdf = NULL; + virPCIDeviceAddress **virt_fns = NULL; if (!(vf_bdf = virPCIGetDeviceAddressFromSysfsLink(vf_sysfs_device_link))) return ret; @@ -2444,7 +2443,7 @@ virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link, */ int -virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddressPtr addr, +virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddress *addr, char **pci_sysfs_device_link) { *pci_sysfs_device_link = g_strdup_printf(PCI_SYSFS "devices/" VIR_PCI_DEVICE_ADDRESS_FMT, addr->domain, @@ -2565,7 +2564,7 @@ virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path, char **pfname, int *vf_index) { - g_autofree virPCIDeviceAddressPtr pf_config_address = NULL; + g_autofree virPCIDeviceAddress *pf_config_address = NULL; g_autofree char *pf_sysfs_device_path = NULL; g_autofree char *vfname = NULL; g_autofree char *vfPhysPortID = NULL; @@ -2625,7 +2624,7 @@ virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path, #else static const char *unsupported = N_("not supported on non-linux platforms"); -virPCIDeviceAddressPtr +virPCIDeviceAddress * virPCIGetDeviceAddressFromSysfsLink(const char *device_link G_GNUC_UNUSED) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); @@ -2635,7 +2634,7 @@ virPCIGetDeviceAddressFromSysfsLink(const char *device_link G_GNUC_UNUSED) int virPCIGetPhysicalFunction(const char *vf_sysfs_path G_GNUC_UNUSED, - virPCIDeviceAddressPtr *pf G_GNUC_UNUSED) + virPCIDeviceAddress **pf G_GNUC_UNUSED) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); return -1; @@ -2643,7 +2642,7 @@ virPCIGetPhysicalFunction(const char *vf_sysfs_path G_GNUC_UNUSED, int virPCIGetVirtualFunctions(const char *sysfs_path G_GNUC_UNUSED, - virPCIDeviceAddressPtr **virtual_functions G_GNUC_UNUSED, + virPCIDeviceAddress ***virtual_functions G_GNUC_UNUSED, size_t *num_virtual_functions G_GNUC_UNUSED, unsigned int *max_virtual_functions G_GNUC_UNUSED) { @@ -2670,7 +2669,7 @@ virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link G_GNUC_UNUSED, int -virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddressPtr dev G_GNUC_UNUSED, +virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddress *dev G_GNUC_UNUSED, char **pci_sysfs_device_link G_GNUC_UNUSED) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported)); @@ -2699,7 +2698,7 @@ virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path G_GNUC_UNUSED, #endif /* __linux__ */ int -virPCIDeviceIsPCIExpress(virPCIDevicePtr dev) +virPCIDeviceIsPCIExpress(virPCIDevice *dev) { int fd; int ret = -1; @@ -2718,7 +2717,7 @@ virPCIDeviceIsPCIExpress(virPCIDevicePtr dev) } int -virPCIDeviceHasPCIExpressLink(virPCIDevicePtr dev) +virPCIDeviceHasPCIExpressLink(virPCIDevice *dev) { int fd; int ret = -1; @@ -2746,7 +2745,7 @@ virPCIDeviceHasPCIExpressLink(virPCIDevicePtr dev) } int -virPCIDeviceGetLinkCapSta(virPCIDevicePtr dev, +virPCIDeviceGetLinkCapSta(virPCIDevice *dev, int *cap_port, unsigned int *cap_speed, unsigned int *cap_width, @@ -2788,7 +2787,7 @@ virPCIDeviceGetLinkCapSta(virPCIDevicePtr dev, } -int virPCIGetHeaderType(virPCIDevicePtr dev, int *hdrType) +int virPCIGetHeaderType(virPCIDevice *dev, int *hdrType) { int fd; uint8_t type; @@ -2817,7 +2816,7 @@ int virPCIGetHeaderType(virPCIDevicePtr dev, int *hdrType) void -virPCIEDeviceInfoFree(virPCIEDeviceInfoPtr dev) +virPCIEDeviceInfoFree(virPCIEDeviceInfo *dev) { if (!dev) return; @@ -2828,7 +2827,7 @@ virPCIEDeviceInfoFree(virPCIEDeviceInfoPtr dev) } void -virPCIDeviceAddressFree(virPCIDeviceAddressPtr address) +virPCIDeviceAddressFree(virPCIDeviceAddress *address) { g_free(address); } diff --git a/src/util/virpci.h b/src/util/virpci.h index 9b37a12883..398a1682c2 100644 --- a/src/util/virpci.h +++ b/src/util/virpci.h @@ -26,11 +26,8 @@ #include "virenum.h" typedef struct _virPCIDevice virPCIDevice; -typedef virPCIDevice *virPCIDevicePtr; typedef struct _virPCIDeviceAddress virPCIDeviceAddress; -typedef virPCIDeviceAddress *virPCIDeviceAddressPtr; typedef struct _virPCIDeviceList virPCIDeviceList; -typedef virPCIDeviceList *virPCIDeviceListPtr; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPCIDeviceList, virObjectUnref); @@ -40,7 +37,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPCIDeviceList, virObjectUnref); typedef struct _virZPCIDeviceAddressID virZPCIDeviceAddressID; typedef struct _virZPCIDeviceAddress virZPCIDeviceAddress; -typedef virZPCIDeviceAddress *virZPCIDeviceAddressPtr; struct _virZPCIDeviceAddressID { unsigned int value; @@ -102,7 +98,6 @@ typedef enum { VIR_ENUM_DECL(virPCIHeader); typedef struct _virPCIELink virPCIELink; -typedef virPCIELink *virPCIELinkPtr; struct _virPCIELink { int port; virPCIELinkSpeed speed; @@ -110,7 +105,6 @@ struct _virPCIELink { }; typedef struct _virPCIEDeviceInfo virPCIEDeviceInfo; -typedef virPCIEDeviceInfo *virPCIEDeviceInfoPtr; struct _virPCIEDeviceInfo { /* Not all PCI Express devices have link. For example this 'Root Complex * Integrated Endpoint' and 'Root Complex Event Collector' don't have it. */ @@ -118,69 +112,69 @@ struct _virPCIEDeviceInfo { virPCIELink *link_sta; /* Actually negotiated capabilities */ }; -virPCIDevicePtr virPCIDeviceNew(const virPCIDeviceAddress *address); -virPCIDevicePtr virPCIDeviceCopy(virPCIDevicePtr dev); -void virPCIDeviceFree(virPCIDevicePtr dev); -const char *virPCIDeviceGetName(virPCIDevicePtr dev); -const char *virPCIDeviceGetConfigPath(virPCIDevicePtr dev); +virPCIDevice *virPCIDeviceNew(const virPCIDeviceAddress *address); +virPCIDevice *virPCIDeviceCopy(virPCIDevice *dev); +void virPCIDeviceFree(virPCIDevice *dev); +const char *virPCIDeviceGetName(virPCIDevice *dev); +const char *virPCIDeviceGetConfigPath(virPCIDevice *dev); -int virPCIDeviceDetach(virPCIDevicePtr dev, - virPCIDeviceListPtr activeDevs, - virPCIDeviceListPtr inactiveDevs); -int virPCIDeviceReattach(virPCIDevicePtr dev, - virPCIDeviceListPtr activeDevs, - virPCIDeviceListPtr inactiveDevs); -int virPCIDeviceReset(virPCIDevicePtr dev, - virPCIDeviceListPtr activeDevs, - virPCIDeviceListPtr inactiveDevs); +int virPCIDeviceDetach(virPCIDevice *dev, + virPCIDeviceList *activeDevs, + virPCIDeviceList *inactiveDevs); +int virPCIDeviceReattach(virPCIDevice *dev, + virPCIDeviceList *activeDevs, + virPCIDeviceList *inactiveDevs); +int virPCIDeviceReset(virPCIDevice *dev, + virPCIDeviceList *activeDevs, + virPCIDeviceList *inactiveDevs); void virPCIDeviceSetManaged(virPCIDevice *dev, bool managed); bool virPCIDeviceGetManaged(virPCIDevice *dev); -void virPCIDeviceSetStubDriver(virPCIDevicePtr dev, +void virPCIDeviceSetStubDriver(virPCIDevice *dev, virPCIStubDriver driver); -virPCIStubDriver virPCIDeviceGetStubDriver(virPCIDevicePtr dev); -virPCIDeviceAddressPtr virPCIDeviceGetAddress(virPCIDevicePtr dev); +virPCIStubDriver virPCIDeviceGetStubDriver(virPCIDevice *dev); +virPCIDeviceAddress *virPCIDeviceGetAddress(virPCIDevice *dev); int virPCIDeviceSetUsedBy(virPCIDevice *dev, const char *drv_name, const char *dom_name); void virPCIDeviceGetUsedBy(virPCIDevice *dev, const char **drv_name, const char **dom_name); -bool virPCIDeviceGetUnbindFromStub(virPCIDevicePtr dev); +bool virPCIDeviceGetUnbindFromStub(virPCIDevice *dev); void virPCIDeviceSetUnbindFromStub(virPCIDevice *dev, bool unbind); -bool virPCIDeviceGetRemoveSlot(virPCIDevicePtr dev); +bool virPCIDeviceGetRemoveSlot(virPCIDevice *dev); void virPCIDeviceSetRemoveSlot(virPCIDevice *dev, bool remove_slot); -bool virPCIDeviceGetReprobe(virPCIDevicePtr dev); +bool virPCIDeviceGetReprobe(virPCIDevice *dev); void virPCIDeviceSetReprobe(virPCIDevice *dev, bool reprobe); -virPCIDeviceListPtr virPCIDeviceListNew(void); -int virPCIDeviceListAdd(virPCIDeviceListPtr list, - virPCIDevicePtr dev); -int virPCIDeviceListAddCopy(virPCIDeviceListPtr list, virPCIDevicePtr dev); -virPCIDevicePtr virPCIDeviceListGet(virPCIDeviceListPtr list, +virPCIDeviceList *virPCIDeviceListNew(void); +int virPCIDeviceListAdd(virPCIDeviceList *list, + virPCIDevice *dev); +int virPCIDeviceListAddCopy(virPCIDeviceList *list, virPCIDevice *dev); +virPCIDevice *virPCIDeviceListGet(virPCIDeviceList *list, int idx); -size_t virPCIDeviceListCount(virPCIDeviceListPtr list); -virPCIDevicePtr virPCIDeviceListSteal(virPCIDeviceListPtr list, - virPCIDeviceAddressPtr devAddr); -virPCIDevicePtr virPCIDeviceListStealIndex(virPCIDeviceListPtr list, +size_t virPCIDeviceListCount(virPCIDeviceList *list); +virPCIDevice *virPCIDeviceListSteal(virPCIDeviceList *list, + virPCIDeviceAddress *devAddr); +virPCIDevice *virPCIDeviceListStealIndex(virPCIDeviceList *list, int idx); -void virPCIDeviceListDel(virPCIDeviceListPtr list, - virPCIDeviceAddressPtr devAddr); -virPCIDevicePtr virPCIDeviceListFind(virPCIDeviceListPtr list, - virPCIDeviceAddressPtr devAddr); -virPCIDevicePtr -virPCIDeviceListFindByIDs(virPCIDeviceListPtr list, +void virPCIDeviceListDel(virPCIDeviceList *list, + virPCIDeviceAddress *devAddr); +virPCIDevice *virPCIDeviceListFind(virPCIDeviceList *list, + virPCIDeviceAddress *devAddr); +virPCIDevice * +virPCIDeviceListFindByIDs(virPCIDeviceList *list, unsigned int domain, unsigned int bus, unsigned int slot, unsigned int function); -int virPCIDeviceListFindIndex(virPCIDeviceListPtr list, - virPCIDeviceAddressPtr devAddr); +int virPCIDeviceListFindIndex(virPCIDeviceList *list, + virPCIDeviceAddress *devAddr); /* * Callback that will be invoked once for each file @@ -189,37 +183,37 @@ int virPCIDeviceListFindIndex(virPCIDeviceListPtr list, * Should return 0 if successfully processed, or * -1 to indicate error and abort iteration */ -typedef int (*virPCIDeviceFileActor)(virPCIDevicePtr dev, +typedef int (*virPCIDeviceFileActor)(virPCIDevice *dev, const char *path, void *opaque); -int virPCIDeviceFileIterate(virPCIDevicePtr dev, +int virPCIDeviceFileIterate(virPCIDevice *dev, virPCIDeviceFileActor actor, void *opaque); -typedef int (*virPCIDeviceAddressActor)(virPCIDeviceAddressPtr addr, +typedef int (*virPCIDeviceAddressActor)(virPCIDeviceAddress *addr, void *opaque); -int virPCIDeviceAddressIOMMUGroupIterate(virPCIDeviceAddressPtr orig, +int virPCIDeviceAddressIOMMUGroupIterate(virPCIDeviceAddress *orig, virPCIDeviceAddressActor actor, void *opaque); -virPCIDeviceListPtr virPCIDeviceGetIOMMUGroupList(virPCIDevicePtr dev); -int virPCIDeviceAddressGetIOMMUGroupAddresses(virPCIDeviceAddressPtr devAddr, - virPCIDeviceAddressPtr **iommuGroupDevices, +virPCIDeviceList *virPCIDeviceGetIOMMUGroupList(virPCIDevice *dev); +int virPCIDeviceAddressGetIOMMUGroupAddresses(virPCIDeviceAddress *devAddr, + virPCIDeviceAddress ***iommuGroupDevices, size_t *nIommuGroupDevices); -int virPCIDeviceAddressGetIOMMUGroupNum(virPCIDeviceAddressPtr addr); +int virPCIDeviceAddressGetIOMMUGroupNum(virPCIDeviceAddress *addr); char *virPCIDeviceAddressGetIOMMUGroupDev(const virPCIDeviceAddress *devAddr); bool virPCIDeviceExists(const virPCIDeviceAddress *addr); -char *virPCIDeviceGetIOMMUGroupDev(virPCIDevicePtr dev); +char *virPCIDeviceGetIOMMUGroupDev(virPCIDevice *dev); -int virPCIDeviceIsAssignable(virPCIDevicePtr dev, +int virPCIDeviceIsAssignable(virPCIDevice *dev, int strict_acs_check); -virPCIDeviceAddressPtr +virPCIDeviceAddress * virPCIGetDeviceAddressFromSysfsLink(const char *device_link); int virPCIGetPhysicalFunction(const char *vf_sysfs_path, - virPCIDeviceAddressPtr *pf); + virPCIDeviceAddress **pf); int virPCIGetVirtualFunctions(const char *sysfs_path, - virPCIDeviceAddressPtr **virtual_functions, + virPCIDeviceAddress ***virtual_functions, size_t *num_virtual_functions, unsigned int *max_virtual_functions); @@ -229,7 +223,7 @@ int virPCIGetVirtualFunctionIndex(const char *pf_sysfs_device_link, const char *vf_sysfs_device_link, int *vf_index); -int virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddressPtr addr, +int virPCIDeviceAddressGetSysfsFile(virPCIDeviceAddress *addr, char **pci_sysfs_device_link); int virPCIGetNetName(const char *device_link_sysfs_path, @@ -237,19 +231,19 @@ int virPCIGetNetName(const char *device_link_sysfs_path, char *physPortID, char **netname); -bool virPCIDeviceAddressIsValid(virPCIDeviceAddressPtr addr, +bool virPCIDeviceAddressIsValid(virPCIDeviceAddress *addr, bool report); bool virPCIDeviceAddressIsEmpty(const virPCIDeviceAddress *addr); bool virPCIDeviceAddressEqual(const virPCIDeviceAddress *addr1, const virPCIDeviceAddress *addr2); -void virPCIDeviceAddressCopy(virPCIDeviceAddressPtr dst, +void virPCIDeviceAddressCopy(virPCIDeviceAddress *dst, const virPCIDeviceAddress *src); char *virPCIDeviceAddressAsString(const virPCIDeviceAddress *addr) ATTRIBUTE_NONNULL(1); -int virPCIDeviceAddressParse(char *address, virPCIDeviceAddressPtr bdf); +int virPCIDeviceAddressParse(char *address, virPCIDeviceAddress *bdf); bool virZPCIDeviceAddressIsIncomplete(const virZPCIDeviceAddress *addr); bool virZPCIDeviceAddressIsPresent(const virZPCIDeviceAddress *addr); @@ -259,26 +253,26 @@ int virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path, char **pfname, int *vf_index); -int virPCIDeviceUnbind(virPCIDevicePtr dev); -int virPCIDeviceRebind(virPCIDevicePtr dev); -int virPCIDeviceGetDriverPathAndName(virPCIDevicePtr dev, +int virPCIDeviceUnbind(virPCIDevice *dev); +int virPCIDeviceRebind(virPCIDevice *dev); +int virPCIDeviceGetDriverPathAndName(virPCIDevice *dev, char **path, char **name); -int virPCIDeviceIsPCIExpress(virPCIDevicePtr dev); -int virPCIDeviceHasPCIExpressLink(virPCIDevicePtr dev); -int virPCIDeviceGetLinkCapSta(virPCIDevicePtr dev, +int virPCIDeviceIsPCIExpress(virPCIDevice *dev); +int virPCIDeviceHasPCIExpressLink(virPCIDevice *dev); +int virPCIDeviceGetLinkCapSta(virPCIDevice *dev, int *ca_port, unsigned int *cap_speed, unsigned int *cap_width, unsigned int *sta_speed, unsigned int *sta_width); -int virPCIGetHeaderType(virPCIDevicePtr dev, int *hdrType); +int virPCIGetHeaderType(virPCIDevice *dev, int *hdrType); -void virPCIEDeviceInfoFree(virPCIEDeviceInfoPtr dev); +void virPCIEDeviceInfoFree(virPCIEDeviceInfo *dev); -void virPCIDeviceAddressFree(virPCIDeviceAddressPtr address); +void virPCIDeviceAddressFree(virPCIDeviceAddress *address); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPCIDevice, virPCIDeviceFree); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPCIDeviceAddress, virPCIDeviceAddressFree); diff --git a/src/util/virperf.c b/src/util/virperf.c index f6b9a3824b..fde8ca7e34 100644 --- a/src/util/virperf.c +++ b/src/util/virperf.c @@ -61,7 +61,6 @@ struct virPerfEvent { } cmt; } efields; }; -typedef struct virPerfEvent *virPerfEventPtr; struct _virPerf { struct virPerfEvent events[VIR_PERF_EVENT_LAST]; @@ -172,7 +171,6 @@ static struct virPerfEventAttr attrs[] = { }, }; G_STATIC_ASSERT(G_N_ELEMENTS(attrs) == VIR_PERF_EVENT_LAST); -typedef struct virPerfEventAttr *virPerfEventAttrPtr; static int @@ -203,13 +201,13 @@ virPerfRdtAttrInit(void) int -virPerfEventEnable(virPerfPtr perf, +virPerfEventEnable(virPerf *perf, virPerfEventType type, pid_t pid) { struct perf_event_attr attr; - virPerfEventPtr event = &(perf->events[type]); - virPerfEventAttrPtr event_attr = &attrs[type]; + struct virPerfEvent *event = &(perf->events[type]); + struct virPerfEventAttr *event_attr = &attrs[type]; if (event->enabled) return 0; @@ -269,10 +267,10 @@ virPerfEventEnable(virPerfPtr perf, } int -virPerfEventDisable(virPerfPtr perf, +virPerfEventDisable(virPerf *perf, virPerfEventType type) { - virPerfEventPtr event = &(perf->events[type]); + struct virPerfEvent *event = &(perf->events[type]); if (!event->enabled) return 0; @@ -289,18 +287,18 @@ virPerfEventDisable(virPerfPtr perf, return 0; } -bool virPerfEventIsEnabled(virPerfPtr perf, +bool virPerfEventIsEnabled(virPerf *perf, virPerfEventType type) { return perf && perf->events[type].enabled; } int -virPerfReadEvent(virPerfPtr perf, +virPerfReadEvent(virPerf *perf, virPerfEventType type, uint64_t *value) { - virPerfEventPtr event = &perf->events[type]; + struct virPerfEvent *event = &perf->events[type]; if (!event->enabled) return -1; @@ -325,7 +323,7 @@ virPerfRdtAttrInit(void) int -virPerfEventEnable(virPerfPtr perf G_GNUC_UNUSED, +virPerfEventEnable(virPerf *perf G_GNUC_UNUSED, virPerfEventType type G_GNUC_UNUSED, pid_t pid G_GNUC_UNUSED) { @@ -335,7 +333,7 @@ virPerfEventEnable(virPerfPtr perf G_GNUC_UNUSED, } int -virPerfEventDisable(virPerfPtr perf G_GNUC_UNUSED, +virPerfEventDisable(virPerf *perf G_GNUC_UNUSED, virPerfEventType type G_GNUC_UNUSED) { virReportSystemError(ENXIO, "%s", @@ -344,14 +342,14 @@ virPerfEventDisable(virPerfPtr perf G_GNUC_UNUSED, } bool -virPerfEventIsEnabled(virPerfPtr perf G_GNUC_UNUSED, +virPerfEventIsEnabled(virPerf *perf G_GNUC_UNUSED, virPerfEventType type G_GNUC_UNUSED) { return false; } int -virPerfReadEvent(virPerfPtr perf G_GNUC_UNUSED, +virPerfReadEvent(virPerf *perf G_GNUC_UNUSED, virPerfEventType type G_GNUC_UNUSED, uint64_t *value G_GNUC_UNUSED) { @@ -362,11 +360,11 @@ virPerfReadEvent(virPerfPtr perf G_GNUC_UNUSED, #endif -virPerfPtr +virPerf * virPerfNew(void) { size_t i; - virPerfPtr perf; + virPerf *perf; perf = g_new0(virPerf, 1); @@ -382,7 +380,7 @@ virPerfNew(void) } void -virPerfFree(virPerfPtr perf) +virPerfFree(virPerf *perf) { size_t i; diff --git a/src/util/virperf.h b/src/util/virperf.h index 46307714c3..34e4e1f4c7 100644 --- a/src/util/virperf.h +++ b/src/util/virperf.h @@ -60,23 +60,22 @@ VIR_ENUM_DECL(virPerfEvent); struct _virPerf; typedef struct _virPerf virPerf; -typedef virPerf *virPerfPtr; -virPerfPtr virPerfNew(void); +virPerf *virPerfNew(void); -void virPerfFree(virPerfPtr perf); +void virPerfFree(virPerf *perf); -int virPerfEventEnable(virPerfPtr perf, +int virPerfEventEnable(virPerf *perf, virPerfEventType type, pid_t pid); -int virPerfEventDisable(virPerfPtr perf, +int virPerfEventDisable(virPerf *perf, virPerfEventType type); -bool virPerfEventIsEnabled(virPerfPtr perf, +bool virPerfEventIsEnabled(virPerf *perf, virPerfEventType type); -int virPerfReadEvent(virPerfPtr perf, +int virPerfReadEvent(virPerf *perf, virPerfEventType type, uint64_t *value); diff --git a/src/util/virpolkit.c b/src/util/virpolkit.c index c657c45681..e90b3b871d 100644 --- a/src/util/virpolkit.c +++ b/src/util/virpolkit.c @@ -40,7 +40,7 @@ VIR_LOG_INIT("util.polkit"); # include struct _virPolkitAgent { - virCommandPtr cmd; + virCommand *cmd; }; /* @@ -150,12 +150,12 @@ int virPolkitCheckAuth(const char *actionid, /* virPolkitAgentDestroy: - * @cmd: Pointer to the virCommandPtr created during virPolkitAgentCreate + * @cmd: Pointer to the virCommand * created during virPolkitAgentCreate * * Destroy resources used by Polkit Agent */ void -virPolkitAgentDestroy(virPolkitAgentPtr agent) +virPolkitAgentDestroy(virPolkitAgent *agent) { if (!agent) return; @@ -168,12 +168,12 @@ virPolkitAgentDestroy(virPolkitAgentPtr agent) * * Allocate and setup a polkit agent * - * Returns a virCommandPtr on success and NULL on failure + * Returns a virCommand *on success and NULL on failure */ -virPolkitAgentPtr +virPolkitAgent * virPolkitAgentCreate(void) { - virPolkitAgentPtr agent = NULL; + virPolkitAgent *agent = NULL; int pipe_fd[2] = {-1, -1}; struct pollfd pollfd; int outfd = STDOUT_FILENO; @@ -234,13 +234,13 @@ int virPolkitCheckAuth(const char *actionid G_GNUC_UNUSED, void -virPolkitAgentDestroy(virPolkitAgentPtr agent G_GNUC_UNUSED) +virPolkitAgentDestroy(virPolkitAgent *agent G_GNUC_UNUSED) { return; /* do nothing */ } -virPolkitAgentPtr +virPolkitAgent * virPolkitAgentCreate(void) { virReportError(VIR_ERR_AUTH_FAILED, "%s", diff --git a/src/util/virpolkit.h b/src/util/virpolkit.h index 8247be33d0..a577d59452 100644 --- a/src/util/virpolkit.h +++ b/src/util/virpolkit.h @@ -34,7 +34,6 @@ int virPolkitCheckAuth(const char *actionid, bool allowInteraction); typedef struct _virPolkitAgent virPolkitAgent; -typedef virPolkitAgent *virPolkitAgentPtr; -void virPolkitAgentDestroy(virPolkitAgentPtr cmd); -virPolkitAgentPtr virPolkitAgentCreate(void); +void virPolkitAgentDestroy(virPolkitAgent *cmd); +virPolkitAgent *virPolkitAgentCreate(void); diff --git a/src/util/virportallocator.c b/src/util/virportallocator.c index d694d53b5e..5e63470848 100644 --- a/src/util/virportallocator.c +++ b/src/util/virportallocator.c @@ -38,10 +38,9 @@ #define VIR_PORT_ALLOCATOR_NUM_PORTS 65536 typedef struct _virPortAllocator virPortAllocator; -typedef virPortAllocator *virPortAllocatorPtr; struct _virPortAllocator { virObjectLockable parent; - virBitmapPtr bitmap; + virBitmap *bitmap; }; struct _virPortAllocatorRange { @@ -51,21 +50,21 @@ struct _virPortAllocatorRange { unsigned short end; }; -static virClassPtr virPortAllocatorClass; -static virPortAllocatorPtr virPortAllocatorInstance; +static virClass *virPortAllocatorClass; +static virPortAllocator *virPortAllocatorInstance; static void virPortAllocatorDispose(void *obj) { - virPortAllocatorPtr pa = obj; + virPortAllocator *pa = obj; virBitmapFree(pa->bitmap); } -static virPortAllocatorPtr +static virPortAllocator * virPortAllocatorNew(void) { - virPortAllocatorPtr pa; + virPortAllocator *pa; if (!(pa = virObjectLockableNew(virPortAllocatorClass))) return NULL; @@ -89,12 +88,12 @@ virPortAllocatorOnceInit(void) VIR_ONCE_GLOBAL_INIT(virPortAllocator); -virPortAllocatorRangePtr +virPortAllocatorRange * virPortAllocatorRangeNew(const char *name, unsigned short start, unsigned short end) { - virPortAllocatorRangePtr range; + virPortAllocatorRange *range; if (start >= end) { virReportInvalidArg(start, "start port %d must be less than end port %d", @@ -112,7 +111,7 @@ virPortAllocatorRangeNew(const char *name, } void -virPortAllocatorRangeFree(virPortAllocatorRangePtr range) +virPortAllocatorRangeFree(virPortAllocatorRange *range) { if (!range) return; @@ -192,7 +191,7 @@ virPortAllocatorBindToPort(bool *used, return ret; } -static virPortAllocatorPtr +static virPortAllocator * virPortAllocatorGet(void) { if (virPortAllocatorInitialize() < 0) @@ -207,7 +206,7 @@ virPortAllocatorAcquire(const virPortAllocatorRange *range, { int ret = -1; size_t i; - virPortAllocatorPtr pa = virPortAllocatorGet(); + virPortAllocator *pa = virPortAllocatorGet(); *port = 0; @@ -252,7 +251,7 @@ int virPortAllocatorRelease(unsigned short port) { int ret = -1; - virPortAllocatorPtr pa = virPortAllocatorGet(); + virPortAllocator *pa = virPortAllocatorGet(); if (!pa) return -1; @@ -279,7 +278,7 @@ int virPortAllocatorSetUsed(unsigned short port) { int ret = -1; - virPortAllocatorPtr pa = virPortAllocatorGet(); + virPortAllocator *pa = virPortAllocatorGet(); if (!pa) return -1; diff --git a/src/util/virportallocator.h b/src/util/virportallocator.h index e86fd0e62b..0d6dabb8ac 100644 --- a/src/util/virportallocator.h +++ b/src/util/virportallocator.h @@ -25,14 +25,13 @@ #include "virobject.h" typedef struct _virPortAllocatorRange virPortAllocatorRange; -typedef virPortAllocatorRange *virPortAllocatorRangePtr; -virPortAllocatorRangePtr +virPortAllocatorRange * virPortAllocatorRangeNew(const char *name, unsigned short start, unsigned short end); -void virPortAllocatorRangeFree(virPortAllocatorRangePtr range); +void virPortAllocatorRangeFree(virPortAllocatorRange *range); int virPortAllocatorAcquire(const virPortAllocatorRange *range, unsigned short *port); diff --git a/src/util/virprocess.c b/src/util/virprocess.c index 209b6e4958..a3facd8ac2 100644 --- a/src/util/virprocess.c +++ b/src/util/virprocess.c @@ -441,7 +441,7 @@ int virProcessKillPainfully(pid_t pid, bool force) #if WITH_SCHED_GETAFFINITY -int virProcessSetAffinity(pid_t pid, virBitmapPtr map, bool quiet) +int virProcessSetAffinity(pid_t pid, virBitmap *map, bool quiet) { size_t i; int numcpus = 1024; @@ -493,14 +493,14 @@ int virProcessSetAffinity(pid_t pid, virBitmapPtr map, bool quiet) return 0; } -virBitmapPtr +virBitmap * virProcessGetAffinity(pid_t pid) { size_t i; cpu_set_t *mask; size_t masklen; size_t ncpus; - virBitmapPtr ret = NULL; + virBitmap *ret = NULL; /* 262144 cpus ought to be enough for anyone */ ncpus = 1024 << 8; @@ -535,7 +535,7 @@ virProcessGetAffinity(pid_t pid) #elif defined(WITH_BSD_CPU_AFFINITY) int virProcessSetAffinity(pid_t pid, - virBitmapPtr map, + virBitmap *map, bool quiet) { size_t i; @@ -562,12 +562,12 @@ int virProcessSetAffinity(pid_t pid, return 0; } -virBitmapPtr +virBitmap * virProcessGetAffinity(pid_t pid) { size_t i; cpuset_t mask; - virBitmapPtr ret = NULL; + virBitmap *ret = NULL; CPU_ZERO(&mask); if (cpuset_getaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, pid, @@ -589,7 +589,7 @@ virProcessGetAffinity(pid_t pid) #else /* WITH_SCHED_GETAFFINITY */ int virProcessSetAffinity(pid_t pid G_GNUC_UNUSED, - virBitmapPtr map G_GNUC_UNUSED, + virBitmap *map G_GNUC_UNUSED, bool quiet G_GNUC_UNUSED) { /* The @quiet parameter is ignored here, it is used only for silencing @@ -599,7 +599,7 @@ int virProcessSetAffinity(pid_t pid G_GNUC_UNUSED, return -1; } -virBitmapPtr +virBitmap * virProcessGetAffinity(pid_t pid G_GNUC_UNUSED) { virReportSystemError(ENOSYS, "%s", diff --git a/src/util/virprocess.h b/src/util/virprocess.h index dbf4148e90..d16e8b23bb 100644 --- a/src/util/virprocess.h +++ b/src/util/virprocess.h @@ -58,9 +58,9 @@ int virProcessKillPainfullyDelay(pid_t pid, bool force, unsigned int extradelay); -int virProcessSetAffinity(pid_t pid, virBitmapPtr map, bool quiet); +int virProcessSetAffinity(pid_t pid, virBitmap *map, bool quiet); -virBitmapPtr virProcessGetAffinity(pid_t pid); +virBitmap *virProcessGetAffinity(pid_t pid); int virProcessGetPids(pid_t pid, size_t *npids, pid_t **pids); diff --git a/src/util/virqemu.c b/src/util/virqemu.c index 4d432651ee..644a1615dc 100644 --- a/src/util/virqemu.c +++ b/src/util/virqemu.c @@ -36,7 +36,7 @@ VIR_LOG_INIT("util.qemu"); struct virQEMUCommandLineJSONIteratorData { const char *prefix; - virBufferPtr buf; + virBuffer *buf; const char *skipKey; virQEMUBuildCommandLineJSONArrayFormatFunc arrayFunc; }; @@ -44,8 +44,8 @@ struct virQEMUCommandLineJSONIteratorData { static int virQEMUBuildCommandLineJSONRecurse(const char *key, - virJSONValuePtr value, - virBufferPtr buf, + virJSONValue *value, + virBuffer *buf, const char *skipKey, virQEMUBuildCommandLineJSONArrayFormatFunc arrayFunc, bool nested); @@ -54,8 +54,8 @@ virQEMUBuildCommandLineJSONRecurse(const char *key, int virQEMUBuildCommandLineJSONArrayBitmap(const char *key, - virJSONValuePtr array, - virBufferPtr buf, + virJSONValue *array, + virBuffer *buf, const char *skipKey G_GNUC_UNUSED) { ssize_t pos = -1; @@ -92,17 +92,17 @@ virQEMUBuildCommandLineJSONArrayBitmap(const char *key, int virQEMUBuildCommandLineJSONArrayNumbered(const char *key, - virJSONValuePtr array, - virBufferPtr buf, + virJSONValue *array, + virBuffer *buf, const char *skipKey) { - virJSONValuePtr member; + virJSONValue *member; size_t i; for (i = 0; i < virJSONValueArraySize(array); i++) { g_autofree char *prefix = NULL; - member = virJSONValueArrayGet((virJSONValuePtr) array, i); + member = virJSONValueArrayGet((virJSONValue *) array, i); prefix = g_strdup_printf("%s.%zu", key, i); if (virQEMUBuildCommandLineJSONRecurse(prefix, member, buf, skipKey, @@ -129,15 +129,15 @@ virQEMUBuildCommandLineJSONArrayNumbered(const char *key, */ static int virQEMUBuildCommandLineJSONArrayObjectsStr(const char *key, - virJSONValuePtr array, - virBufferPtr buf, + virJSONValue *array, + virBuffer *buf, const char *skipKey G_GNUC_UNUSED) { g_auto(virBuffer) tmp = VIR_BUFFER_INITIALIZER; size_t i; for (i = 0; i < virJSONValueArraySize(array); i++) { - virJSONValuePtr member = virJSONValueArrayGet(array, i); + virJSONValue *member = virJSONValueArrayGet(array, i); const char *str = virJSONValueObjectGetString(member, "str"); if (!str) @@ -154,7 +154,7 @@ virQEMUBuildCommandLineJSONArrayObjectsStr(const char *key, /* internal iterator to handle nested object formatting */ static int virQEMUBuildCommandLineJSONIterate(const char *key, - virJSONValuePtr value, + virJSONValue *value, void *opaque) { struct virQEMUCommandLineJSONIteratorData *data = opaque; @@ -180,15 +180,15 @@ virQEMUBuildCommandLineJSONIterate(const char *key, static int virQEMUBuildCommandLineJSONRecurse(const char *key, - virJSONValuePtr value, - virBufferPtr buf, + virJSONValue *value, + virBuffer *buf, const char *skipKey, virQEMUBuildCommandLineJSONArrayFormatFunc arrayFunc, bool nested) { struct virQEMUCommandLineJSONIteratorData data = { key, buf, skipKey, arrayFunc }; virJSONType type = virJSONValueGetType(value); - virJSONValuePtr elem; + virJSONValue *elem; bool tmp; size_t i; @@ -229,7 +229,7 @@ virQEMUBuildCommandLineJSONRecurse(const char *key, /* fallback, treat the array as a non-bitmap, adding the key * for each member */ for (i = 0; i < virJSONValueArraySize(value); i++) { - elem = virJSONValueArrayGet((virJSONValuePtr)value, i); + elem = virJSONValueArrayGet((virJSONValue *)value, i); /* recurse to avoid duplicating code */ if (virQEMUBuildCommandLineJSONRecurse(key, elem, buf, skipKey, @@ -269,8 +269,8 @@ virQEMUBuildCommandLineJSONRecurse(const char *key, * Returns 0 on success -1 on error. */ int -virQEMUBuildCommandLineJSON(virJSONValuePtr value, - virBufferPtr buf, +virQEMUBuildCommandLineJSON(virJSONValue *value, + virBuffer *buf, const char *skipKey, virQEMUBuildCommandLineJSONArrayFormatFunc array) { @@ -294,7 +294,7 @@ virQEMUBuildCommandLineJSON(virJSONValuePtr value, * @rawjson is meant for testing of the schema in the xml2argvtest */ char * -virQEMUBuildNetdevCommandlineFromJSON(virJSONValuePtr props, +virQEMUBuildNetdevCommandlineFromJSON(virJSONValue *props, bool rawjson) { const char *type = virJSONValueObjectGetString(props, "type"); @@ -314,7 +314,7 @@ virQEMUBuildNetdevCommandlineFromJSON(virJSONValuePtr props, char * -virQEMUBuildDriveCommandlineFromJSON(virJSONValuePtr srcdef) +virQEMUBuildDriveCommandlineFromJSON(virJSONValue *srcdef) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -335,7 +335,7 @@ virQEMUBuildDriveCommandlineFromJSON(virJSONValuePtr srcdef) * a ',' must escape it using an extra ',' as the escape character */ void -virQEMUBuildBufferEscapeComma(virBufferPtr buf, const char *str) +virQEMUBuildBufferEscapeComma(virBuffer *buf, const char *str) { virBufferEscape(buf, ',', ",", "%s", str); } diff --git a/src/util/virqemu.h b/src/util/virqemu.h index 361abddd11..70668faf47 100644 --- a/src/util/virqemu.h +++ b/src/util/virqemu.h @@ -27,27 +27,27 @@ #include "virjson.h" typedef int (*virQEMUBuildCommandLineJSONArrayFormatFunc)(const char *key, - virJSONValuePtr array, - virBufferPtr buf, + virJSONValue *array, + virBuffer *buf, const char *skipKey); int virQEMUBuildCommandLineJSONArrayBitmap(const char *key, - virJSONValuePtr array, - virBufferPtr buf, + virJSONValue *array, + virBuffer *buf, const char *skipKey); int virQEMUBuildCommandLineJSONArrayNumbered(const char *key, - virJSONValuePtr array, - virBufferPtr buf, + virJSONValue *array, + virBuffer *buf, const char *skipKey); -int virQEMUBuildCommandLineJSON(virJSONValuePtr value, - virBufferPtr buf, +int virQEMUBuildCommandLineJSON(virJSONValue *value, + virBuffer *buf, const char *skipKey, virQEMUBuildCommandLineJSONArrayFormatFunc array); char * -virQEMUBuildNetdevCommandlineFromJSON(virJSONValuePtr props, +virQEMUBuildNetdevCommandlineFromJSON(virJSONValue *props, bool rawjson); -char *virQEMUBuildDriveCommandlineFromJSON(virJSONValuePtr src); +char *virQEMUBuildDriveCommandlineFromJSON(virJSONValue *src); -void virQEMUBuildBufferEscapeComma(virBufferPtr buf, const char *str); +void virQEMUBuildBufferEscapeComma(virBuffer *buf, const char *str); diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index f1649f967b..a03113d4d6 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -92,31 +92,24 @@ VIR_ENUM_IMPL(virResctrlMonitorPrefix, * structs can be included in one or another without reorganizing the code every * time. */ typedef struct _virResctrlInfoPerType virResctrlInfoPerType; -typedef virResctrlInfoPerType *virResctrlInfoPerTypePtr; typedef struct _virResctrlInfoPerLevel virResctrlInfoPerLevel; -typedef virResctrlInfoPerLevel *virResctrlInfoPerLevelPtr; typedef struct _virResctrlInfoMemBW virResctrlInfoMemBW; -typedef virResctrlInfoMemBW *virResctrlInfoMemBWPtr; typedef struct _virResctrlInfoMongrp virResctrlInfoMongrp; -typedef virResctrlInfoMongrp *virResctrlInfoMongrpPtr; typedef struct _virResctrlAllocPerType virResctrlAllocPerType; -typedef virResctrlAllocPerType *virResctrlAllocPerTypePtr; typedef struct _virResctrlAllocPerLevel virResctrlAllocPerLevel; -typedef virResctrlAllocPerLevel *virResctrlAllocPerLevelPtr; typedef struct _virResctrlAllocMemBW virResctrlAllocMemBW; -typedef virResctrlAllocMemBW *virResctrlAllocMemBWPtr; /* Class definitions and initializations */ -static virClassPtr virResctrlInfoClass; -static virClassPtr virResctrlAllocClass; -static virClassPtr virResctrlMonitorClass; +static virClass *virResctrlInfoClass; +static virClass *virResctrlAllocClass; +static virClass *virResctrlMonitorClass; /* virResctrlInfo */ @@ -140,7 +133,7 @@ struct _virResctrlInfoPerType { }; struct _virResctrlInfoPerLevel { - virResctrlInfoPerTypePtr *types; + virResctrlInfoPerType **types; }; /* Information about memory bandwidth allocation */ @@ -185,12 +178,12 @@ struct _virResctrlInfoMongrp { struct _virResctrlInfo { virObject parent; - virResctrlInfoPerLevelPtr *levels; + virResctrlInfoPerLevel **levels; size_t nlevels; - virResctrlInfoMemBWPtr membw_info; + virResctrlInfoMemBW *membw_info; - virResctrlInfoMongrpPtr monitor_info; + virResctrlInfoMongrp *monitor_info; }; @@ -200,10 +193,10 @@ virResctrlInfoDispose(void *obj) size_t i = 0; size_t j = 0; - virResctrlInfoPtr resctrl = obj; + virResctrlInfo *resctrl = obj; for (i = 0; i < resctrl->nlevels; i++) { - virResctrlInfoPerLevelPtr level = resctrl->levels[i]; + virResctrlInfoPerLevel *level = resctrl->levels[i]; if (!level) continue; @@ -226,7 +219,7 @@ virResctrlInfoDispose(void *obj) void -virResctrlInfoMonFree(virResctrlInfoMonPtr mon) +virResctrlInfoMonFree(virResctrlInfoMon *mon) { if (!mon) return; @@ -314,12 +307,12 @@ struct _virResctrlAllocPerType { size_t nsizes; /* Mask for each cache */ - virBitmapPtr *masks; + virBitmap **masks; size_t nmasks; }; struct _virResctrlAllocPerLevel { - virResctrlAllocPerTypePtr *types; /* Indexed with enum virCacheType */ + virResctrlAllocPerType **types; /* Indexed with enum virCacheType */ /* There is no `ntypes` member variable as it is always allocated for * VIR_CACHE_TYPE_LAST number of items */ }; @@ -337,10 +330,10 @@ struct _virResctrlAllocMemBW { struct _virResctrlAlloc { virObject parent; - virResctrlAllocPerLevelPtr *levels; + virResctrlAllocPerLevel **levels; size_t nlevels; - virResctrlAllocMemBWPtr mem_bw; + virResctrlAllocMemBW *mem_bw; /* The identifier (any unique string for now) */ char *id; @@ -363,7 +356,7 @@ struct _virResctrlMonitor { * specific allocation defined under the root directory. * This pointer points to the allocation this monitor is associated with. */ - virResctrlAllocPtr alloc; + virResctrlAlloc *alloc; /* The monitor identifier. For a monitor has the same @path name as its * @alloc, the @id will be set to the same value as it is in @alloc->id. */ @@ -381,16 +374,16 @@ virResctrlAllocDispose(void *obj) size_t j = 0; size_t k = 0; - virResctrlAllocPtr alloc = obj; + virResctrlAlloc *alloc = obj; for (i = 0; i < alloc->nlevels; i++) { - virResctrlAllocPerLevelPtr level = alloc->levels[i]; + virResctrlAllocPerLevel *level = alloc->levels[i]; if (!level) continue; for (j = 0; j < VIR_CACHE_TYPE_LAST; j++) { - virResctrlAllocPerTypePtr type = level->types[j]; + virResctrlAllocPerType *type = level->types[j]; if (!type) continue; @@ -410,7 +403,7 @@ virResctrlAllocDispose(void *obj) } if (alloc->mem_bw) { - virResctrlAllocMemBWPtr mem_bw = alloc->mem_bw; + virResctrlAllocMemBW *mem_bw = alloc->mem_bw; for (i = 0; i < mem_bw->nbandwidths; i++) g_free(mem_bw->bandwidths[i]); g_free(alloc->mem_bw->bandwidths); @@ -426,7 +419,7 @@ virResctrlAllocDispose(void *obj) static void virResctrlMonitorDispose(void *obj) { - virResctrlMonitorPtr monitor = obj; + virResctrlMonitor *monitor = obj; virObjectUnref(monitor->alloc); g_free(monitor->id); @@ -523,7 +516,7 @@ virResctrlUnlock(int fd G_GNUC_UNUSED) /* virResctrlInfo-related definitions */ static int -virResctrlGetCacheInfo(virResctrlInfoPtr resctrl, +virResctrlGetCacheInfo(virResctrlInfo *resctrl, DIR *dirp) { int rv = -1; @@ -535,8 +528,8 @@ virResctrlGetCacheInfo(virResctrlInfoPtr resctrl, char *endptr = NULL; int type = 0; unsigned int level = 0; - virResctrlInfoPerLevelPtr i_level = NULL; - g_autofree virResctrlInfoPerTypePtr i_type = NULL; + virResctrlInfoPerLevel *i_level = NULL; + g_autofree virResctrlInfoPerType *i_type = NULL; VIR_DEBUG("Parsing info type '%s'", ent->d_name); if (ent->d_name[0] != 'L') @@ -609,9 +602,9 @@ virResctrlGetCacheInfo(virResctrlInfoPtr resctrl, level - resctrl->nlevels + 1); if (!resctrl->levels[level]) { - virResctrlInfoPerTypePtr *types = NULL; + virResctrlInfoPerType **types = NULL; - types = g_new0(virResctrlInfoPerTypePtr, VIR_CACHE_TYPE_LAST); + types = g_new0(virResctrlInfoPerType *, VIR_CACHE_TYPE_LAST); resctrl->levels[level] = g_new0(virResctrlInfoPerLevel, 1); resctrl->levels[level]->types = types; @@ -634,10 +627,10 @@ virResctrlGetCacheInfo(virResctrlInfoPtr resctrl, static int -virResctrlGetMemoryBandwidthInfo(virResctrlInfoPtr resctrl) +virResctrlGetMemoryBandwidthInfo(virResctrlInfo *resctrl) { int rv = -1; - g_autofree virResctrlInfoMemBWPtr i_membw = NULL; + g_autofree virResctrlInfoMemBW *i_membw = NULL; /* query memory bandwidth allocation info */ i_membw = g_new0(virResctrlInfoMemBW, 1); @@ -693,11 +686,11 @@ virResctrlGetMemoryBandwidthInfo(virResctrlInfoPtr resctrl) * @resctrl->monitor_info empty if not supported. */ static int -virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl) +virResctrlGetMonitorInfo(virResctrlInfo *resctrl) { int rv = -1; g_autofree char *featurestr = NULL; - g_autofree virResctrlInfoMongrpPtr info_monitor = NULL; + g_autofree virResctrlInfoMongrp *info_monitor = NULL; info_monitor = g_new0(virResctrlInfoMongrp, 1); @@ -757,7 +750,7 @@ virResctrlGetMonitorInfo(virResctrlInfoPtr resctrl) static int -virResctrlGetInfo(virResctrlInfoPtr resctrl) +virResctrlGetInfo(virResctrlInfo *resctrl) { g_autoptr(DIR) dirp = NULL; int ret = -1; @@ -779,10 +772,10 @@ virResctrlGetInfo(virResctrlInfoPtr resctrl) } -virResctrlInfoPtr +virResctrlInfo * virResctrlInfoNew(void) { - virResctrlInfoPtr ret = NULL; + virResctrlInfo *ret = NULL; if (virResctrlInitialize() < 0) return NULL; @@ -801,7 +794,7 @@ virResctrlInfoNew(void) static bool -virResctrlInfoIsEmpty(virResctrlInfoPtr resctrl) +virResctrlInfoIsEmpty(virResctrlInfo *resctrl) { size_t i = 0; size_t j = 0; @@ -816,7 +809,7 @@ virResctrlInfoIsEmpty(virResctrlInfoPtr resctrl) return false; for (i = 0; i < resctrl->nlevels; i++) { - virResctrlInfoPerLevelPtr i_level = resctrl->levels[i]; + virResctrlInfoPerLevel *i_level = resctrl->levels[i]; if (!i_level) continue; @@ -832,11 +825,11 @@ virResctrlInfoIsEmpty(virResctrlInfoPtr resctrl) int -virResctrlInfoGetMemoryBandwidth(virResctrlInfoPtr resctrl, +virResctrlInfoGetMemoryBandwidth(virResctrlInfo *resctrl, unsigned int level, - virResctrlInfoMemBWPerNodePtr control) + virResctrlInfoMemBWPerNode *control) { - virResctrlInfoMemBWPtr membw_info = resctrl->membw_info; + virResctrlInfoMemBW *membw_info = resctrl->membw_info; if (!membw_info) return 0; @@ -852,14 +845,14 @@ virResctrlInfoGetMemoryBandwidth(virResctrlInfoPtr resctrl, int -virResctrlInfoGetCache(virResctrlInfoPtr resctrl, +virResctrlInfoGetCache(virResctrlInfo *resctrl, unsigned int level, unsigned long long size, size_t *ncontrols, - virResctrlInfoPerCachePtr **controls) + virResctrlInfoPerCache ***controls) { - virResctrlInfoPerLevelPtr i_level = NULL; - virResctrlInfoPerTypePtr i_type = NULL; + virResctrlInfoPerLevel *i_level = NULL; + virResctrlInfoPerType *i_type = NULL; size_t i = 0; if (virResctrlInfoIsEmpty(resctrl)) @@ -869,7 +862,7 @@ virResctrlInfoGetCache(virResctrlInfoPtr resctrl, * cache. This number of memory bandwidth controller is same with * last level cache */ if (resctrl->membw_info) { - virResctrlInfoMemBWPtr membw_info = resctrl->membw_info; + virResctrlInfoMemBW *membw_info = resctrl->membw_info; if (level > membw_info->last_level_cache) { membw_info->last_level_cache = level; @@ -938,13 +931,13 @@ virResctrlInfoGetCache(virResctrlInfoPtr resctrl, * supported by host, -1 on failure with error message set. */ int -virResctrlInfoGetMonitorPrefix(virResctrlInfoPtr resctrl, +virResctrlInfoGetMonitorPrefix(virResctrlInfo *resctrl, const char *prefix, - virResctrlInfoMonPtr *monitor) + virResctrlInfoMon **monitor) { size_t i = 0; - virResctrlInfoMongrpPtr mongrp_info = NULL; - virResctrlInfoMonPtr mon = NULL; + virResctrlInfoMongrp *mongrp_info = NULL; + virResctrlInfoMon *mon = NULL; int ret = -1; if (!prefix) { @@ -1016,7 +1009,7 @@ virResctrlInfoGetMonitorPrefix(virResctrlInfoPtr resctrl, /* virResctrlAlloc-related definitions */ -virResctrlAllocPtr +virResctrlAlloc * virResctrlAllocNew(void) { if (virResctrlInitialize() < 0) @@ -1027,7 +1020,7 @@ virResctrlAllocNew(void) bool -virResctrlAllocIsEmpty(virResctrlAllocPtr alloc) +virResctrlAllocIsEmpty(virResctrlAlloc *alloc) { size_t i = 0; size_t j = 0; @@ -1040,13 +1033,13 @@ virResctrlAllocIsEmpty(virResctrlAllocPtr alloc) return false; for (i = 0; i < alloc->nlevels; i++) { - virResctrlAllocPerLevelPtr a_level = alloc->levels[i]; + virResctrlAllocPerLevel *a_level = alloc->levels[i]; if (!a_level) continue; for (j = 0; j < VIR_CACHE_TYPE_LAST; j++) { - virResctrlAllocPerTypePtr a_type = a_level->types[j]; + virResctrlAllocPerType *a_type = a_level->types[j]; if (!a_type) continue; @@ -1067,20 +1060,20 @@ virResctrlAllocIsEmpty(virResctrlAllocPtr alloc) } -static virResctrlAllocPerTypePtr -virResctrlAllocGetType(virResctrlAllocPtr alloc, +static virResctrlAllocPerType * +virResctrlAllocGetType(virResctrlAlloc *alloc, unsigned int level, virCacheType type) { - virResctrlAllocPerLevelPtr a_level = NULL; + virResctrlAllocPerLevel *a_level = NULL; if (alloc->nlevels <= level) VIR_EXPAND_N(alloc->levels, alloc->nlevels, level - alloc->nlevels + 1); if (!alloc->levels[level]) { - virResctrlAllocPerTypePtr *types = NULL; + virResctrlAllocPerType **types = NULL; - types = g_new0(virResctrlAllocPerTypePtr, VIR_CACHE_TYPE_LAST); + types = g_new0(virResctrlAllocPerType *, VIR_CACHE_TYPE_LAST); alloc->levels[level] = g_new0(virResctrlAllocPerLevel, 1); alloc->levels[level]->types = types; @@ -1096,13 +1089,13 @@ virResctrlAllocGetType(virResctrlAllocPtr alloc, static int -virResctrlAllocUpdateMask(virResctrlAllocPtr alloc, +virResctrlAllocUpdateMask(virResctrlAlloc *alloc, unsigned int level, virCacheType type, unsigned int cache, - virBitmapPtr mask) + virBitmap *mask) { - virResctrlAllocPerTypePtr a_type = virResctrlAllocGetType(alloc, level, type); + virResctrlAllocPerType *a_type = virResctrlAllocGetType(alloc, level, type); if (!a_type) return -1; @@ -1119,13 +1112,13 @@ virResctrlAllocUpdateMask(virResctrlAllocPtr alloc, static int -virResctrlAllocUpdateSize(virResctrlAllocPtr alloc, +virResctrlAllocUpdateSize(virResctrlAlloc *alloc, unsigned int level, virCacheType type, unsigned int cache, unsigned long long size) { - virResctrlAllocPerTypePtr a_type = virResctrlAllocGetType(alloc, level, type); + virResctrlAllocPerType *a_type = virResctrlAllocGetType(alloc, level, type); if (!a_type) return -1; @@ -1154,13 +1147,13 @@ virResctrlAllocUpdateSize(virResctrlAllocPtr alloc, * the way. */ static bool -virResctrlAllocCheckCollision(virResctrlAllocPtr alloc, +virResctrlAllocCheckCollision(virResctrlAlloc *alloc, unsigned int level, virCacheType type, unsigned int cache) { - virResctrlAllocPerLevelPtr a_level = NULL; - virResctrlAllocPerTypePtr a_type = NULL; + virResctrlAllocPerLevel *a_level = NULL; + virResctrlAllocPerType *a_type = NULL; if (!alloc) return false; @@ -1202,7 +1195,7 @@ virResctrlAllocCheckCollision(virResctrlAllocPtr alloc, int -virResctrlAllocSetCacheSize(virResctrlAllocPtr alloc, +virResctrlAllocSetCacheSize(virResctrlAlloc *alloc, unsigned int level, virCacheType type, unsigned int cache, @@ -1221,7 +1214,7 @@ virResctrlAllocSetCacheSize(virResctrlAllocPtr alloc, int -virResctrlAllocForeachCache(virResctrlAllocPtr alloc, +virResctrlAllocForeachCache(virResctrlAlloc *alloc, virResctrlAllocForeachCacheCallback cb, void *opaque) { @@ -1234,13 +1227,13 @@ virResctrlAllocForeachCache(virResctrlAllocPtr alloc, return 0; for (level = 0; level < alloc->nlevels; level++) { - virResctrlAllocPerLevelPtr a_level = alloc->levels[level]; + virResctrlAllocPerLevel *a_level = alloc->levels[level]; if (!a_level) continue; for (type = 0; type < VIR_CACHE_TYPE_LAST; type++) { - virResctrlAllocPerTypePtr a_type = a_level->types[type]; + virResctrlAllocPerType *a_type = a_level->types[type]; if (!a_type) continue; @@ -1272,11 +1265,11 @@ virResctrlAllocForeachCache(virResctrlAllocPtr alloc, * Returns 0 on success, -1 on failure with error message set. */ int -virResctrlAllocSetMemoryBandwidth(virResctrlAllocPtr alloc, +virResctrlAllocSetMemoryBandwidth(virResctrlAlloc *alloc, unsigned int id, unsigned int memory_bandwidth) { - virResctrlAllocMemBWPtr mem_bw = alloc->mem_bw; + virResctrlAllocMemBW *mem_bw = alloc->mem_bw; if (memory_bandwidth > 100) { virReportError(VIR_ERR_XML_ERROR, "%s", @@ -1317,12 +1310,12 @@ virResctrlAllocSetMemoryBandwidth(virResctrlAllocPtr alloc, * Returns 0 on success, -1 and immediate failure if the @cb has any failure. */ int -virResctrlAllocForeachMemory(virResctrlAllocPtr alloc, +virResctrlAllocForeachMemory(virResctrlAlloc *alloc, virResctrlAllocForeachMemoryCallback cb, void *opaque) { size_t i = 0; - virResctrlAllocMemBWPtr mem_bw; + virResctrlAllocMemBW *mem_bw; if (!alloc || !alloc->mem_bw) return 0; @@ -1362,7 +1355,7 @@ virResctrlSetID(char **resctrlid, int -virResctrlAllocSetID(virResctrlAllocPtr alloc, +virResctrlAllocSetID(virResctrlAlloc *alloc, const char *id) { return virResctrlSetID(&alloc->id, id); @@ -1370,7 +1363,7 @@ virResctrlAllocSetID(virResctrlAllocPtr alloc, const char * -virResctrlAllocGetID(virResctrlAllocPtr alloc) +virResctrlAllocGetID(virResctrlAlloc *alloc) { return alloc->id; } @@ -1386,8 +1379,8 @@ virResctrlAllocGetID(virResctrlAllocPtr alloc) * has 100 percent bandwidth. A trailing semi-colon is not formatted. */ static int -virResctrlAllocMemoryBandwidthFormat(virResctrlAllocPtr alloc, - virBufferPtr buf) +virResctrlAllocMemoryBandwidthFormat(virResctrlAlloc *alloc, + virBuffer *buf) { size_t i; @@ -1410,8 +1403,8 @@ virResctrlAllocMemoryBandwidthFormat(virResctrlAllocPtr alloc, static int -virResctrlAllocParseProcessMemoryBandwidth(virResctrlInfoPtr resctrl, - virResctrlAllocPtr alloc, +virResctrlAllocParseProcessMemoryBandwidth(virResctrlInfo *resctrl, + virResctrlAlloc *alloc, char *mem_bw) { unsigned int bandwidth; @@ -1458,8 +1451,8 @@ virResctrlAllocParseProcessMemoryBandwidth(virResctrlInfoPtr resctrl, * virResctrlAllocMemoryBandwidthFormat. */ static int -virResctrlAllocParseMemoryBandwidthLine(virResctrlInfoPtr resctrl, - virResctrlAllocPtr alloc, +virResctrlAllocParseMemoryBandwidthLine(virResctrlInfo *resctrl, + virResctrlAlloc *alloc, char *line) { g_auto(GStrv) mbs = NULL; @@ -1500,21 +1493,21 @@ virResctrlAllocParseMemoryBandwidthLine(virResctrlInfoPtr resctrl, static int -virResctrlAllocFormatCache(virResctrlAllocPtr alloc, - virBufferPtr buf) +virResctrlAllocFormatCache(virResctrlAlloc *alloc, + virBuffer *buf) { unsigned int level = 0; unsigned int type = 0; unsigned int cache = 0; for (level = 0; level < alloc->nlevels; level++) { - virResctrlAllocPerLevelPtr a_level = alloc->levels[level]; + virResctrlAllocPerLevel *a_level = alloc->levels[level]; if (!a_level) continue; for (type = 0; type < VIR_CACHE_TYPE_LAST; type++) { - virResctrlAllocPerTypePtr a_type = a_level->types[type]; + virResctrlAllocPerType *a_type = a_level->types[type]; if (!a_type) continue; @@ -1522,7 +1515,7 @@ virResctrlAllocFormatCache(virResctrlAllocPtr alloc, virBufferAsprintf(buf, "L%u%s:", level, virResctrlTypeToString(type)); for (cache = 0; cache < a_type->nmasks; cache++) { - virBitmapPtr mask = a_type->masks[cache]; + virBitmap *mask = a_type->masks[cache]; char *mask_str = NULL; if (!mask) @@ -1546,7 +1539,7 @@ virResctrlAllocFormatCache(virResctrlAllocPtr alloc, char * -virResctrlAllocFormat(virResctrlAllocPtr alloc) +virResctrlAllocFormat(virResctrlAlloc *alloc) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -1564,8 +1557,8 @@ virResctrlAllocFormat(virResctrlAllocPtr alloc) static int -virResctrlAllocParseProcessCache(virResctrlInfoPtr resctrl, - virResctrlAllocPtr alloc, +virResctrlAllocParseProcessCache(virResctrlInfo *resctrl, + virResctrlAlloc *alloc, unsigned int level, virCacheType type, char *cache) @@ -1611,8 +1604,8 @@ virResctrlAllocParseProcessCache(virResctrlInfoPtr resctrl, static int -virResctrlAllocParseCacheLine(virResctrlInfoPtr resctrl, - virResctrlAllocPtr alloc, +virResctrlAllocParseCacheLine(virResctrlInfo *resctrl, + virResctrlAlloc *alloc, char *line) { g_auto(GStrv) caches = NULL; @@ -1665,8 +1658,8 @@ virResctrlAllocParseCacheLine(virResctrlInfoPtr resctrl, static int -virResctrlAllocParse(virResctrlInfoPtr resctrl, - virResctrlAllocPtr alloc, +virResctrlAllocParse(virResctrlInfo *resctrl, + virResctrlAlloc *alloc, const char *schemata) { g_auto(GStrv) lines = NULL; @@ -1685,9 +1678,9 @@ virResctrlAllocParse(virResctrlInfoPtr resctrl, static int -virResctrlAllocGetGroup(virResctrlInfoPtr resctrl, +virResctrlAllocGetGroup(virResctrlInfo *resctrl, const char *groupname, - virResctrlAllocPtr *alloc) + virResctrlAlloc **alloc) { char *schemata = NULL; int rv = virFileReadValueString(&schemata, @@ -1717,10 +1710,10 @@ virResctrlAllocGetGroup(virResctrlInfoPtr resctrl, } -static virResctrlAllocPtr -virResctrlAllocGetDefault(virResctrlInfoPtr resctrl) +static virResctrlAlloc * +virResctrlAllocGetDefault(virResctrlInfo *resctrl) { - virResctrlAllocPtr ret = NULL; + virResctrlAlloc *ret = NULL; int rv = virResctrlAllocGetGroup(resctrl, ".", &ret); if (rv == -2) { @@ -1733,8 +1726,8 @@ virResctrlAllocGetDefault(virResctrlInfoPtr resctrl) static void -virResctrlAllocSubtractPerType(virResctrlAllocPerTypePtr dst, - virResctrlAllocPerTypePtr src) +virResctrlAllocSubtractPerType(virResctrlAllocPerType *dst, + virResctrlAllocPerType *src) { size_t i = 0; @@ -1749,8 +1742,8 @@ virResctrlAllocSubtractPerType(virResctrlAllocPerTypePtr dst, static void -virResctrlAllocSubtract(virResctrlAllocPtr dst, - virResctrlAllocPtr src) +virResctrlAllocSubtract(virResctrlAlloc *dst, + virResctrlAlloc *src) { size_t i = 0; size_t j = 0; @@ -1769,8 +1762,8 @@ virResctrlAllocSubtract(virResctrlAllocPtr dst, } -static virResctrlAllocPtr -virResctrlAllocNewFromInfo(virResctrlInfoPtr info) +static virResctrlAlloc * +virResctrlAllocNewFromInfo(virResctrlInfo *info) { size_t i = 0; g_autoptr(virResctrlAlloc) ret = virResctrlAllocNew(); @@ -1779,14 +1772,14 @@ virResctrlAllocNewFromInfo(virResctrlInfoPtr info) return NULL; for (i = 0; i < info->nlevels; i++) { - virResctrlInfoPerLevelPtr i_level = info->levels[i]; + virResctrlInfoPerLevel *i_level = info->levels[i]; size_t j = 0; if (!i_level) continue; for (j = 0; j < VIR_CACHE_TYPE_LAST; j++) { - virResctrlInfoPerTypePtr i_type = i_level->types[j]; + virResctrlInfoPerType *i_type = i_level->types[j]; g_autoptr(virBitmap) mask = NULL; size_t k = 0; @@ -1833,8 +1826,8 @@ virResctrlAllocNewFromInfo(virResctrlInfoPtr info) * limiting setting, not an allocating one. The way it works is also vastly * different from CAT. */ -virResctrlAllocPtr -virResctrlAllocGetUnused(virResctrlInfoPtr resctrl) +virResctrlAlloc * +virResctrlAllocGetUnused(virResctrlInfo *resctrl) { g_autoptr(virResctrlAlloc) ret = NULL; g_autoptr(virResctrlAlloc) alloc_default = NULL; @@ -1898,16 +1891,16 @@ virResctrlAllocGetUnused(virResctrlInfoPtr resctrl) * allocated for @alloc (does not have to exist though). */ static int -virResctrlAllocFindUnused(virResctrlAllocPtr alloc, - virResctrlInfoPerTypePtr i_type, - virResctrlAllocPerTypePtr f_type, +virResctrlAllocFindUnused(virResctrlAlloc *alloc, + virResctrlInfoPerType *i_type, + virResctrlAllocPerType *f_type, unsigned int level, unsigned int type, unsigned int cache) { unsigned long long *size = alloc->levels[level]->types[type]->sizes[cache]; g_autoptr(virBitmap) a_mask = NULL; - virBitmapPtr f_mask = NULL; + virBitmap *f_mask = NULL; unsigned long long need_bits; size_t i = 0; ssize_t pos = -1; @@ -2013,12 +2006,12 @@ virResctrlAllocFindUnused(virResctrlAllocPtr alloc, static int -virResctrlAllocMemoryBandwidth(virResctrlInfoPtr resctrl, - virResctrlAllocPtr alloc) +virResctrlAllocMemoryBandwidth(virResctrlInfo *resctrl, + virResctrlAlloc *alloc) { size_t i; - virResctrlAllocMemBWPtr mem_bw_alloc = alloc->mem_bw; - virResctrlInfoMemBWPtr mem_bw_info = resctrl->membw_info; + virResctrlAllocMemBW *mem_bw_alloc = alloc->mem_bw; + virResctrlInfoMemBW *mem_bw_info = resctrl->membw_info; if (!mem_bw_alloc) return 0; @@ -2063,12 +2056,12 @@ virResctrlAllocMemoryBandwidth(virResctrlInfoPtr resctrl, static int -virResctrlAllocCopyMemBW(virResctrlAllocPtr dst, - virResctrlAllocPtr src) +virResctrlAllocCopyMemBW(virResctrlAlloc *dst, + virResctrlAlloc *src) { size_t i = 0; - virResctrlAllocMemBWPtr dst_bw = NULL; - virResctrlAllocMemBWPtr src_bw = src->mem_bw; + virResctrlAllocMemBW *dst_bw = NULL; + virResctrlAllocMemBW *src_bw = src->mem_bw; if (!src->mem_bw) return 0; @@ -2094,21 +2087,21 @@ virResctrlAllocCopyMemBW(virResctrlAllocPtr dst, static int -virResctrlAllocCopyMasks(virResctrlAllocPtr dst, - virResctrlAllocPtr src) +virResctrlAllocCopyMasks(virResctrlAlloc *dst, + virResctrlAlloc *src) { unsigned int level = 0; for (level = 0; level < src->nlevels; level++) { - virResctrlAllocPerLevelPtr s_level = src->levels[level]; + virResctrlAllocPerLevel *s_level = src->levels[level]; unsigned int type = 0; if (!s_level) continue; for (type = 0; type < VIR_CACHE_TYPE_LAST; type++) { - virResctrlAllocPerTypePtr s_type = s_level->types[type]; - virResctrlAllocPerTypePtr d_type = NULL; + virResctrlAllocPerType *s_type = s_level->types[type]; + virResctrlAllocPerType *d_type = NULL; unsigned int cache = 0; if (!s_type) @@ -2119,7 +2112,7 @@ virResctrlAllocCopyMasks(virResctrlAllocPtr dst, return -1; for (cache = 0; cache < s_type->nmasks; cache++) { - virBitmapPtr mask = s_type->masks[cache]; + virBitmap *mask = s_type->masks[cache]; if (mask && virResctrlAllocUpdateMask(dst, level, type, cache, mask) < 0) return -1; @@ -2138,8 +2131,8 @@ virResctrlAllocCopyMasks(virResctrlAllocPtr dst, * every requested allocation effectively transforming `sizes` into `masks`. */ static int -virResctrlAllocAssign(virResctrlInfoPtr resctrl, - virResctrlAllocPtr alloc) +virResctrlAllocAssign(virResctrlInfo *resctrl, + virResctrlAlloc *alloc) { unsigned int level = 0; g_autoptr(virResctrlAlloc) alloc_free = NULL; @@ -2163,8 +2156,8 @@ virResctrlAllocAssign(virResctrlInfoPtr resctrl, return -1; for (level = 0; level < alloc->nlevels; level++) { - virResctrlAllocPerLevelPtr a_level = alloc->levels[level]; - virResctrlAllocPerLevelPtr f_level = NULL; + virResctrlAllocPerLevel *a_level = alloc->levels[level]; + virResctrlAllocPerLevel *f_level = NULL; unsigned int type = 0; if (!a_level) @@ -2181,8 +2174,8 @@ virResctrlAllocAssign(virResctrlInfoPtr resctrl, } for (type = 0; type < VIR_CACHE_TYPE_LAST; type++) { - virResctrlAllocPerTypePtr a_type = a_level->types[type]; - virResctrlAllocPerTypePtr f_type = f_level->types[type]; + virResctrlAllocPerType *a_type = a_level->types[type]; + virResctrlAllocPerType *f_type = f_level->types[type]; unsigned int cache = 0; if (!a_type) @@ -2197,8 +2190,8 @@ virResctrlAllocAssign(virResctrlInfoPtr resctrl, } for (cache = 0; cache < a_type->nsizes; cache++) { - virResctrlInfoPerLevelPtr i_level = resctrl->levels[level]; - virResctrlInfoPerTypePtr i_type = i_level->types[type]; + virResctrlInfoPerLevel *i_level = resctrl->levels[level]; + virResctrlInfoPerType *i_type = i_level->types[type]; if (virResctrlAllocFindUnused(alloc, i_type, f_type, level, type, cache) < 0) return -1; @@ -2227,7 +2220,7 @@ virResctrlDeterminePath(const char *parentpath, int -virResctrlAllocDeterminePath(virResctrlAllocPtr alloc, +virResctrlAllocDeterminePath(virResctrlAlloc *alloc, const char *machinename) { if (alloc->path) { @@ -2277,8 +2270,8 @@ virResctrlCreateGroupPath(const char *path) /* This checks if the directory for the alloc exists. If not it tries to create * it and apply appropriate alloc settings. */ int -virResctrlAllocCreate(virResctrlInfoPtr resctrl, - virResctrlAllocPtr alloc, +virResctrlAllocCreate(virResctrlInfo *resctrl, + virResctrlAlloc *alloc, const char *machinename) { g_autofree char *schemata_path = NULL; @@ -2363,7 +2356,7 @@ virResctrlAddPID(const char *path, int -virResctrlAllocAddPID(virResctrlAllocPtr alloc, +virResctrlAllocAddPID(virResctrlAlloc *alloc, pid_t pid) { /* If the allocation is empty, then it is impossible to add a PID to @@ -2376,7 +2369,7 @@ virResctrlAllocAddPID(virResctrlAllocPtr alloc, int -virResctrlAllocRemove(virResctrlAllocPtr alloc) +virResctrlAllocRemove(virResctrlAlloc *alloc) { int ret = 0; @@ -2399,7 +2392,7 @@ virResctrlAllocRemove(virResctrlAllocPtr alloc) /* virResctrlMonitor-related definitions */ -virResctrlMonitorPtr +virResctrlMonitor * virResctrlMonitorNew(void) { if (virResctrlInitialize() < 0) @@ -2426,7 +2419,7 @@ virResctrlMonitorNew(void) * Returns 0 on success, -1 on error. */ int -virResctrlMonitorDeterminePath(virResctrlMonitorPtr monitor, +virResctrlMonitorDeterminePath(virResctrlMonitor *monitor, const char *machinename) { g_autofree char *parentpath = NULL; @@ -2468,7 +2461,7 @@ virResctrlMonitorDeterminePath(virResctrlMonitorPtr monitor, int -virResctrlMonitorAddPID(virResctrlMonitorPtr monitor, +virResctrlMonitorAddPID(virResctrlMonitor *monitor, pid_t pid) { return virResctrlAddPID(monitor->path, pid); @@ -2476,7 +2469,7 @@ virResctrlMonitorAddPID(virResctrlMonitorPtr monitor, int -virResctrlMonitorCreate(virResctrlMonitorPtr monitor, +virResctrlMonitorCreate(virResctrlMonitor *monitor, const char *machinename) { int lockfd = -1; @@ -2500,7 +2493,7 @@ virResctrlMonitorCreate(virResctrlMonitorPtr monitor, int -virResctrlMonitorSetID(virResctrlMonitorPtr monitor, +virResctrlMonitorSetID(virResctrlMonitor *monitor, const char *id) { @@ -2509,22 +2502,22 @@ virResctrlMonitorSetID(virResctrlMonitorPtr monitor, const char * -virResctrlMonitorGetID(virResctrlMonitorPtr monitor) +virResctrlMonitorGetID(virResctrlMonitor *monitor) { return monitor->id; } void -virResctrlMonitorSetAlloc(virResctrlMonitorPtr monitor, - virResctrlAllocPtr alloc) +virResctrlMonitorSetAlloc(virResctrlMonitor *monitor, + virResctrlAlloc *alloc) { monitor->alloc = virObjectRef(alloc); } int -virResctrlMonitorRemove(virResctrlMonitorPtr monitor) +virResctrlMonitorRemove(virResctrlMonitor *monitor) { int ret = 0; @@ -2548,8 +2541,8 @@ static int virResctrlMonitorStatsSorter(const void *a, const void *b) { - return (*(virResctrlMonitorStatsPtr *)a)->id - - (*(virResctrlMonitorStatsPtr *)b)->id; + return (*(virResctrlMonitorStats **)a)->id + - (*(virResctrlMonitorStats **)b)->id; } @@ -2558,7 +2551,7 @@ virResctrlMonitorStatsSorter(const void *a, * * @monitor: The monitor that the statistic data will be retrieved from. * @resources: A string list for the monitor feature names. - * @stats: Pointer of of virResctrlMonitorStatsPtr array for holding cache or + * @stats: Pointer of of virResctrlMonitorStats * array for holding cache or * memory bandwidth usage data. * @nstats: A size_t pointer to hold the returned array length of @stats * @@ -2567,9 +2560,9 @@ virResctrlMonitorStatsSorter(const void *a, * Returns 0 on success, -1 on error. */ int -virResctrlMonitorGetStats(virResctrlMonitorPtr monitor, +virResctrlMonitorGetStats(virResctrlMonitor *monitor, const char **resources, - virResctrlMonitorStatsPtr **stats, + virResctrlMonitorStats ***stats, size_t *nstats) { int rv = -1; @@ -2579,7 +2572,7 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor, g_autoptr(DIR) dirp = NULL; g_autofree char *datapath = NULL; struct dirent *ent = NULL; - virResctrlMonitorStatsPtr stat = NULL; + virResctrlMonitorStats *stat = NULL; size_t nresources = g_strv_length((char **) resources); if (!monitor) { @@ -2662,7 +2655,7 @@ virResctrlMonitorGetStats(virResctrlMonitorPtr monitor, void -virResctrlMonitorStatsFree(virResctrlMonitorStatsPtr stat) +virResctrlMonitorStatsFree(virResctrlMonitorStats *stat) { if (!stat) return; diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h index 2f84401dfb..5d7b23c3c4 100644 --- a/src/util/virresctrl.h +++ b/src/util/virresctrl.h @@ -47,7 +47,6 @@ VIR_ENUM_DECL(virResctrlMonitorPrefix); typedef struct _virResctrlInfoPerCache virResctrlInfoPerCache; -typedef virResctrlInfoPerCache *virResctrlInfoPerCachePtr; struct _virResctrlInfoPerCache { /* Smallest possible increase of the allocation size in bytes */ unsigned long long granularity; @@ -60,7 +59,6 @@ struct _virResctrlInfoPerCache { }; typedef struct _virResctrlInfoMemBWPerNode virResctrlInfoMemBWPerNode; -typedef virResctrlInfoMemBWPerNode *virResctrlInfoMemBWPerNodePtr; struct _virResctrlInfoMemBWPerNode { /* Smallest possible increase of the allocation bandwidth in percentage */ unsigned int granularity; @@ -71,7 +69,6 @@ struct _virResctrlInfoMemBWPerNode { }; typedef struct _virResctrlInfoMon virResctrlInfoMon; -typedef virResctrlInfoMon *virResctrlInfoMonPtr; struct _virResctrlInfoMon { /* Maximum number of simultaneous monitors */ unsigned int max_monitor; @@ -94,25 +91,23 @@ struct _virResctrlInfoMon { }; typedef struct _virResctrlInfo virResctrlInfo; -typedef virResctrlInfo *virResctrlInfoPtr; -virResctrlInfoPtr +virResctrlInfo * virResctrlInfoNew(void); int -virResctrlInfoGetCache(virResctrlInfoPtr resctrl, +virResctrlInfoGetCache(virResctrlInfo *resctrl, unsigned int level, unsigned long long size, size_t *ncontrols, - virResctrlInfoPerCachePtr **controls); + virResctrlInfoPerCache ***controls); int -virResctrlInfoGetMemoryBandwidth(virResctrlInfoPtr resctrl, +virResctrlInfoGetMemoryBandwidth(virResctrlInfo *resctrl, unsigned int level, - virResctrlInfoMemBWPerNodePtr control); + virResctrlInfoMemBWPerNode *control); /* Alloc-related things */ typedef struct _virResctrlAlloc virResctrlAlloc; -typedef virResctrlAlloc *virResctrlAllocPtr; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virResctrlAlloc, virObjectUnref); @@ -127,74 +122,72 @@ typedef int virResctrlAllocForeachMemoryCallback(unsigned int id, unsigned int size, void *opaque); -virResctrlAllocPtr +virResctrlAlloc * virResctrlAllocNew(void); bool -virResctrlAllocIsEmpty(virResctrlAllocPtr alloc); +virResctrlAllocIsEmpty(virResctrlAlloc *alloc); int -virResctrlAllocSetCacheSize(virResctrlAllocPtr alloc, +virResctrlAllocSetCacheSize(virResctrlAlloc *alloc, unsigned int level, virCacheType type, unsigned int cache, unsigned long long size); int -virResctrlAllocForeachCache(virResctrlAllocPtr alloc, +virResctrlAllocForeachCache(virResctrlAlloc *alloc, virResctrlAllocForeachCacheCallback cb, void *opaque); int -virResctrlAllocSetMemoryBandwidth(virResctrlAllocPtr alloc, +virResctrlAllocSetMemoryBandwidth(virResctrlAlloc *alloc, unsigned int id, unsigned int memory_bandwidth); int -virResctrlAllocForeachMemory(virResctrlAllocPtr alloc, +virResctrlAllocForeachMemory(virResctrlAlloc *alloc, virResctrlAllocForeachMemoryCallback cb, void *opaque); int -virResctrlAllocSetID(virResctrlAllocPtr alloc, +virResctrlAllocSetID(virResctrlAlloc *alloc, const char *id); const char * -virResctrlAllocGetID(virResctrlAllocPtr alloc); +virResctrlAllocGetID(virResctrlAlloc *alloc); char * -virResctrlAllocFormat(virResctrlAllocPtr alloc); +virResctrlAllocFormat(virResctrlAlloc *alloc); int -virResctrlAllocDeterminePath(virResctrlAllocPtr alloc, +virResctrlAllocDeterminePath(virResctrlAlloc *alloc, const char *machinename); int -virResctrlAllocCreate(virResctrlInfoPtr r_info, - virResctrlAllocPtr alloc, +virResctrlAllocCreate(virResctrlInfo *r_info, + virResctrlAlloc *alloc, const char *machinename); int -virResctrlAllocAddPID(virResctrlAllocPtr alloc, +virResctrlAllocAddPID(virResctrlAlloc *alloc, pid_t pid); int -virResctrlAllocRemove(virResctrlAllocPtr alloc); +virResctrlAllocRemove(virResctrlAlloc *alloc); void -virResctrlInfoMonFree(virResctrlInfoMonPtr mon); +virResctrlInfoMonFree(virResctrlInfoMon *mon); int -virResctrlInfoGetMonitorPrefix(virResctrlInfoPtr resctrl, +virResctrlInfoGetMonitorPrefix(virResctrlInfo *resctrl, const char *prefix, - virResctrlInfoMonPtr *monitor); + virResctrlInfoMon **monitor); /* Monitor-related things */ typedef struct _virResctrlMonitor virResctrlMonitor; -typedef virResctrlMonitor *virResctrlMonitorPtr; typedef struct _virResctrlMonitorStats virResctrlMonitorStats; -typedef virResctrlMonitorStats *virResctrlMonitorStatsPtr; struct _virResctrlMonitorStats { /* The system assigned cache ID associated with statistical record */ unsigned int id; @@ -208,40 +201,40 @@ struct _virResctrlMonitorStats { size_t nvals; }; -virResctrlMonitorPtr +virResctrlMonitor * virResctrlMonitorNew(void); int -virResctrlMonitorDeterminePath(virResctrlMonitorPtr monitor, +virResctrlMonitorDeterminePath(virResctrlMonitor *monitor, const char *machinename); int -virResctrlMonitorAddPID(virResctrlMonitorPtr monitor, +virResctrlMonitorAddPID(virResctrlMonitor *monitor, pid_t pid); int -virResctrlMonitorCreate(virResctrlMonitorPtr monitor, +virResctrlMonitorCreate(virResctrlMonitor *monitor, const char *machinename); int -virResctrlMonitorSetID(virResctrlMonitorPtr monitor, +virResctrlMonitorSetID(virResctrlMonitor *monitor, const char *id); const char * -virResctrlMonitorGetID(virResctrlMonitorPtr monitor); +virResctrlMonitorGetID(virResctrlMonitor *monitor); void -virResctrlMonitorSetAlloc(virResctrlMonitorPtr monitor, - virResctrlAllocPtr alloc); +virResctrlMonitorSetAlloc(virResctrlMonitor *monitor, + virResctrlAlloc *alloc); int -virResctrlMonitorRemove(virResctrlMonitorPtr monitor); +virResctrlMonitorRemove(virResctrlMonitor *monitor); int -virResctrlMonitorGetStats(virResctrlMonitorPtr monitor, +virResctrlMonitorGetStats(virResctrlMonitor *monitor, const char **resources, - virResctrlMonitorStatsPtr **stats, + virResctrlMonitorStats ***stats, size_t *nstats); void -virResctrlMonitorStatsFree(virResctrlMonitorStatsPtr stats); +virResctrlMonitorStatsFree(virResctrlMonitorStats *stats); diff --git a/src/util/virresctrlpriv.h b/src/util/virresctrlpriv.h index 8aba32ab37..803f9b62ab 100644 --- a/src/util/virresctrlpriv.h +++ b/src/util/virresctrlpriv.h @@ -24,5 +24,5 @@ #include "virresctrl.h" -virResctrlAllocPtr -virResctrlAllocGetUnused(virResctrlInfoPtr resctrl); +virResctrlAlloc * +virResctrlAllocGetUnused(virResctrlInfo *resctrl); diff --git a/src/util/virrotatingfile.c b/src/util/virrotatingfile.c index 718578765f..4e6fa382a8 100644 --- a/src/util/virrotatingfile.c +++ b/src/util/virrotatingfile.c @@ -39,10 +39,8 @@ VIR_LOG_INIT("util.rotatingfile"); #define VIR_MAX_MAX_BACKUP 32 typedef struct virRotatingFileWriterEntry virRotatingFileWriterEntry; -typedef virRotatingFileWriterEntry *virRotatingFileWriterEntryPtr; typedef struct virRotatingFileReaderEntry virRotatingFileReaderEntry; -typedef virRotatingFileReaderEntry *virRotatingFileReaderEntryPtr; struct virRotatingFileWriterEntry { int fd; @@ -53,7 +51,7 @@ struct virRotatingFileWriterEntry { struct virRotatingFileWriter { char *basepath; - virRotatingFileWriterEntryPtr entry; + virRotatingFileWriterEntry *entry; size_t maxbackup; mode_t mode; size_t maxlen; @@ -67,14 +65,14 @@ struct virRotatingFileReaderEntry { }; struct virRotatingFileReader { - virRotatingFileReaderEntryPtr *entries; + virRotatingFileReaderEntry **entries; size_t nentries; size_t current; }; static void -virRotatingFileWriterEntryFree(virRotatingFileWriterEntryPtr entry) +virRotatingFileWriterEntryFree(virRotatingFileWriterEntry *entry) { if (!entry) return; @@ -85,7 +83,7 @@ virRotatingFileWriterEntryFree(virRotatingFileWriterEntryPtr entry) static void -virRotatingFileReaderEntryFree(virRotatingFileReaderEntryPtr entry) +virRotatingFileReaderEntryFree(virRotatingFileReaderEntry *entry) { if (!entry) return; @@ -96,11 +94,11 @@ virRotatingFileReaderEntryFree(virRotatingFileReaderEntryPtr entry) } -static virRotatingFileWriterEntryPtr +static virRotatingFileWriterEntry * virRotatingFileWriterEntryNew(const char *path, mode_t mode) { - virRotatingFileWriterEntryPtr entry; + virRotatingFileWriterEntry *entry; struct stat sb; VIR_DEBUG("Opening %s mode=0%02o", path, mode); @@ -139,10 +137,10 @@ virRotatingFileWriterEntryNew(const char *path, } -static virRotatingFileReaderEntryPtr +static virRotatingFileReaderEntry * virRotatingFileReaderEntryNew(const char *path) { - virRotatingFileReaderEntryPtr entry; + virRotatingFileReaderEntry *entry; struct stat sb; VIR_DEBUG("Opening %s", path); @@ -179,7 +177,7 @@ virRotatingFileReaderEntryNew(const char *path) static int -virRotatingFileWriterDelete(virRotatingFileWriterPtr file) +virRotatingFileWriterDelete(virRotatingFileWriter *file) { size_t i; @@ -228,14 +226,14 @@ virRotatingFileWriterDelete(virRotatingFileWriterPtr file) * in order to avoid splitting lines. If @maxlen is * zero then no rollover will be performed. */ -virRotatingFileWriterPtr +virRotatingFileWriter * virRotatingFileWriterNew(const char *path, off_t maxlen, size_t maxbackup, bool trunc, mode_t mode) { - virRotatingFileWriterPtr file; + virRotatingFileWriter *file; file = g_new0(virRotatingFileWriter, 1); @@ -279,11 +277,11 @@ virRotatingFileWriterNew(const char *path, * * If @maxbackup is zero the only the newest file will be read. */ -virRotatingFileReaderPtr +virRotatingFileReader * virRotatingFileReaderNew(const char *path, size_t maxbackup) { - virRotatingFileReaderPtr file; + virRotatingFileReader *file; size_t i; file = g_new0(virRotatingFileReader, 1); @@ -296,7 +294,7 @@ virRotatingFileReaderNew(const char *path, } file->nentries = maxbackup + 1; - file->entries = g_new0(virRotatingFileReaderEntryPtr, file->nentries); + file->entries = g_new0(virRotatingFileReaderEntry *, file->nentries); if (!(file->entries[file->nentries - 1] = virRotatingFileReaderEntryNew(path))) goto error; @@ -326,7 +324,7 @@ virRotatingFileReaderNew(const char *path, * Return the primary file path */ const char * -virRotatingFileWriterGetPath(virRotatingFileWriterPtr file) +virRotatingFileWriterGetPath(virRotatingFileWriter *file) { return file->basepath; } @@ -339,7 +337,7 @@ virRotatingFileWriterGetPath(virRotatingFileWriterPtr file) * Return the inode of the file currently being written to */ ino_t -virRotatingFileWriterGetINode(virRotatingFileWriterPtr file) +virRotatingFileWriterGetINode(virRotatingFileWriter *file) { return file->entry->inode; } @@ -352,14 +350,14 @@ virRotatingFileWriterGetINode(virRotatingFileWriterPtr file) * Return the offset at which data is currently being written */ off_t -virRotatingFileWriterGetOffset(virRotatingFileWriterPtr file) +virRotatingFileWriterGetOffset(virRotatingFileWriter *file) { return file->entry->pos; } static int -virRotatingFileWriterRollover(virRotatingFileWriterPtr file) +virRotatingFileWriterRollover(virRotatingFileWriter *file) { size_t i; char *nextpath = NULL; @@ -421,7 +419,7 @@ virRotatingFileWriterRollover(virRotatingFileWriterPtr file) * Returns the number of bytes written, or -1 on error */ ssize_t -virRotatingFileWriterAppend(virRotatingFileWriterPtr file, +virRotatingFileWriterAppend(virRotatingFileWriter *file, const char *buf, size_t len) { @@ -474,7 +472,7 @@ virRotatingFileWriterAppend(virRotatingFileWriterPtr file, if (file->maxlen != 0 && ((file->entry->pos == file->maxlen && len) || forceRollover)) { - virRotatingFileWriterEntryPtr tmp; + virRotatingFileWriterEntry *tmp; VIR_DEBUG("Hit max size %zu on %s (force=%d)", file->maxlen, file->basepath, forceRollover); @@ -507,7 +505,7 @@ virRotatingFileWriterAppend(virRotatingFileWriterPtr file, * probably been rotated out of existence */ int -virRotatingFileReaderSeek(virRotatingFileReaderPtr file, +virRotatingFileReaderSeek(virRotatingFileReader *file, ino_t inode, off_t offset) { @@ -515,7 +513,7 @@ virRotatingFileReaderSeek(virRotatingFileReaderPtr file, off_t ret; for (i = 0; i < file->nentries; i++) { - virRotatingFileReaderEntryPtr entry = file->entries[i]; + virRotatingFileReaderEntry *entry = file->entries[i]; if (entry->inode != inode || entry->fd == -1) continue; @@ -556,7 +554,7 @@ virRotatingFileReaderSeek(virRotatingFileReaderPtr file, * Returns: the number of bytes read or -1 on error */ ssize_t -virRotatingFileReaderConsume(virRotatingFileReaderPtr file, +virRotatingFileReaderConsume(virRotatingFileReader *file, char *buf, size_t len) { @@ -564,7 +562,7 @@ virRotatingFileReaderConsume(virRotatingFileReaderPtr file, VIR_DEBUG("Consume %p %zu", buf, len); while (len) { - virRotatingFileReaderEntryPtr entry; + virRotatingFileReaderEntry *entry; ssize_t got; if (file->current >= file->nentries) @@ -604,7 +602,7 @@ virRotatingFileReaderConsume(virRotatingFileReaderPtr file, * Close the current file and release all resources */ void -virRotatingFileWriterFree(virRotatingFileWriterPtr file) +virRotatingFileWriterFree(virRotatingFileWriter *file) { if (!file) return; @@ -622,7 +620,7 @@ virRotatingFileWriterFree(virRotatingFileWriterPtr file) * Close the files and release all resources */ void -virRotatingFileReaderFree(virRotatingFileReaderPtr file) +virRotatingFileReaderFree(virRotatingFileReader *file) { size_t i; diff --git a/src/util/virrotatingfile.h b/src/util/virrotatingfile.h index 71fbe2c38c..1ed8838e7d 100644 --- a/src/util/virrotatingfile.h +++ b/src/util/virrotatingfile.h @@ -24,36 +24,34 @@ #include "internal.h" typedef struct virRotatingFileWriter virRotatingFileWriter; -typedef virRotatingFileWriter *virRotatingFileWriterPtr; typedef struct virRotatingFileReader virRotatingFileReader; -typedef virRotatingFileReader *virRotatingFileReaderPtr; -virRotatingFileWriterPtr virRotatingFileWriterNew(const char *path, +virRotatingFileWriter *virRotatingFileWriterNew(const char *path, off_t maxlen, size_t maxbackup, bool trunc, mode_t mode); -virRotatingFileReaderPtr virRotatingFileReaderNew(const char *path, +virRotatingFileReader *virRotatingFileReaderNew(const char *path, size_t maxbackup); -const char *virRotatingFileWriterGetPath(virRotatingFileWriterPtr file); +const char *virRotatingFileWriterGetPath(virRotatingFileWriter *file); -ino_t virRotatingFileWriterGetINode(virRotatingFileWriterPtr file); -off_t virRotatingFileWriterGetOffset(virRotatingFileWriterPtr file); +ino_t virRotatingFileWriterGetINode(virRotatingFileWriter *file); +off_t virRotatingFileWriterGetOffset(virRotatingFileWriter *file); -ssize_t virRotatingFileWriterAppend(virRotatingFileWriterPtr file, +ssize_t virRotatingFileWriterAppend(virRotatingFileWriter *file, const char *buf, size_t len); -int virRotatingFileReaderSeek(virRotatingFileReaderPtr file, +int virRotatingFileReaderSeek(virRotatingFileReader *file, ino_t inode, off_t offset); -ssize_t virRotatingFileReaderConsume(virRotatingFileReaderPtr file, +ssize_t virRotatingFileReaderConsume(virRotatingFileReader *file, char *buf, size_t len); -void virRotatingFileWriterFree(virRotatingFileWriterPtr file); -void virRotatingFileReaderFree(virRotatingFileReaderPtr file); +void virRotatingFileWriterFree(virRotatingFileWriter *file); +void virRotatingFileReaderFree(virRotatingFileReader *file); diff --git a/src/util/virscsi.c b/src/util/virscsi.c index d0ba33e254..b1f202eef1 100644 --- a/src/util/virscsi.c +++ b/src/util/virscsi.c @@ -46,7 +46,6 @@ struct _virUsedByInfo { char *domname; /* which domain */ }; typedef struct _virUsedByInfo virUsedByInfo; -typedef virUsedByInfo *virUsedByInfoPtr; struct _virSCSIDevice { unsigned int adapter; @@ -57,7 +56,7 @@ struct _virSCSIDevice { char *name; /* adapter:bus:target:unit */ char *id; /* model:vendor */ char *sg_path; /* e.g. /dev/sg2 */ - virUsedByInfoPtr *used_by; /* driver:domain(s) using this dev */ + virUsedByInfo **used_by; /* driver:domain(s) using this dev */ size_t n_used_by; /* how many domains are using this dev */ bool readonly; @@ -67,10 +66,10 @@ struct _virSCSIDevice { struct _virSCSIDeviceList { virObjectLockable parent; size_t count; - virSCSIDevicePtr *devs; + virSCSIDevice **devs; }; -static virClassPtr virSCSIDeviceListClass; +static virClass *virSCSIDeviceListClass; static void virSCSIDeviceListDispose(void *obj); @@ -158,7 +157,7 @@ virSCSIDeviceGetDevName(const char *sysfs_prefix, return NULL; } -virSCSIDevicePtr +virSCSIDevice * virSCSIDeviceNew(const char *sysfs_prefix, const char *adapter, unsigned int bus, @@ -219,7 +218,7 @@ virSCSIDeviceNew(const char *sysfs_prefix, } static void -virSCSIDeviceUsedByInfoFree(virUsedByInfoPtr used_by) +virSCSIDeviceUsedByInfoFree(virUsedByInfo *used_by) { g_free(used_by->drvname); g_free(used_by->domname); @@ -228,7 +227,7 @@ virSCSIDeviceUsedByInfoFree(virUsedByInfoPtr used_by) G_DEFINE_AUTOPTR_CLEANUP_FUNC(virUsedByInfo, virSCSIDeviceUsedByInfoFree); void -virSCSIDeviceFree(virSCSIDevicePtr dev) +virSCSIDeviceFree(virSCSIDevice *dev) { size_t i; @@ -245,7 +244,7 @@ virSCSIDeviceFree(virSCSIDevicePtr dev) } int -virSCSIDeviceSetUsedBy(virSCSIDevicePtr dev, +virSCSIDeviceSetUsedBy(virSCSIDevice *dev, const char *drvname, const char *domname) { @@ -262,71 +261,71 @@ virSCSIDeviceSetUsedBy(virSCSIDevicePtr dev, } bool -virSCSIDeviceIsAvailable(virSCSIDevicePtr dev) +virSCSIDeviceIsAvailable(virSCSIDevice *dev) { return dev->n_used_by == 0; } const char * -virSCSIDeviceGetName(virSCSIDevicePtr dev) +virSCSIDeviceGetName(virSCSIDevice *dev) { return dev->name; } const char * -virSCSIDeviceGetPath(virSCSIDevicePtr dev) +virSCSIDeviceGetPath(virSCSIDevice *dev) { return dev->sg_path; } unsigned int -virSCSIDeviceGetAdapter(virSCSIDevicePtr dev) +virSCSIDeviceGetAdapter(virSCSIDevice *dev) { return dev->adapter; } unsigned int -virSCSIDeviceGetBus(virSCSIDevicePtr dev) +virSCSIDeviceGetBus(virSCSIDevice *dev) { return dev->bus; } unsigned int -virSCSIDeviceGetTarget(virSCSIDevicePtr dev) +virSCSIDeviceGetTarget(virSCSIDevice *dev) { return dev->target; } unsigned long long -virSCSIDeviceGetUnit(virSCSIDevicePtr dev) +virSCSIDeviceGetUnit(virSCSIDevice *dev) { return dev->unit; } bool -virSCSIDeviceGetReadonly(virSCSIDevicePtr dev) +virSCSIDeviceGetReadonly(virSCSIDevice *dev) { return dev->readonly; } bool -virSCSIDeviceGetShareable(virSCSIDevicePtr dev) +virSCSIDeviceGetShareable(virSCSIDevice *dev) { return dev->shareable; } int -virSCSIDeviceFileIterate(virSCSIDevicePtr dev, +virSCSIDeviceFileIterate(virSCSIDevice *dev, virSCSIDeviceFileActor actor, void *opaque) { return (actor)(dev, dev->sg_path, opaque); } -virSCSIDeviceListPtr +virSCSIDeviceList * virSCSIDeviceListNew(void) { - virSCSIDeviceListPtr list; + virSCSIDeviceList *list; if (virSCSIInitialize() < 0) return NULL; @@ -340,7 +339,7 @@ virSCSIDeviceListNew(void) static void virSCSIDeviceListDispose(void *obj) { - virSCSIDeviceListPtr list = obj; + virSCSIDeviceList *list = obj; size_t i; for (i = 0; i < list->count; i++) @@ -350,8 +349,8 @@ virSCSIDeviceListDispose(void *obj) } int -virSCSIDeviceListAdd(virSCSIDeviceListPtr list, - virSCSIDevicePtr dev) +virSCSIDeviceListAdd(virSCSIDeviceList *list, + virSCSIDevice *dev) { if (virSCSIDeviceListFind(list, dev)) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -363,8 +362,8 @@ virSCSIDeviceListAdd(virSCSIDeviceListPtr list, return VIR_APPEND_ELEMENT(list->devs, list->count, dev); } -virSCSIDevicePtr -virSCSIDeviceListGet(virSCSIDeviceListPtr list, int idx) +virSCSIDevice * +virSCSIDeviceListGet(virSCSIDeviceList *list, int idx) { if (idx >= list->count || idx < 0) return NULL; @@ -373,16 +372,16 @@ virSCSIDeviceListGet(virSCSIDeviceListPtr list, int idx) } size_t -virSCSIDeviceListCount(virSCSIDeviceListPtr list) +virSCSIDeviceListCount(virSCSIDeviceList *list) { return list->count; } -virSCSIDevicePtr -virSCSIDeviceListSteal(virSCSIDeviceListPtr list, - virSCSIDevicePtr dev) +virSCSIDevice * +virSCSIDeviceListSteal(virSCSIDeviceList *list, + virSCSIDevice *dev) { - virSCSIDevicePtr ret = NULL; + virSCSIDevice *ret = NULL; size_t i; for (i = 0; i < list->count; i++) { @@ -400,8 +399,8 @@ virSCSIDeviceListSteal(virSCSIDeviceListPtr list, } void -virSCSIDeviceListDel(virSCSIDeviceListPtr list, - virSCSIDevicePtr dev, +virSCSIDeviceListDel(virSCSIDeviceList *list, + virSCSIDevice *dev, const char *drvname, const char *domname) { @@ -422,9 +421,9 @@ virSCSIDeviceListDel(virSCSIDeviceListPtr list, } } -virSCSIDevicePtr -virSCSIDeviceListFind(virSCSIDeviceListPtr list, - virSCSIDevicePtr dev) +virSCSIDevice * +virSCSIDeviceListFind(virSCSIDeviceList *list, + virSCSIDevice *dev) { size_t i; diff --git a/src/util/virscsi.h b/src/util/virscsi.h index 51627e0c05..65ad15ed76 100644 --- a/src/util/virscsi.h +++ b/src/util/virscsi.h @@ -24,10 +24,8 @@ #include "virobject.h" typedef struct _virSCSIDevice virSCSIDevice; -typedef virSCSIDevice *virSCSIDevicePtr; typedef struct _virSCSIDeviceList virSCSIDeviceList; -typedef virSCSIDeviceList *virSCSIDeviceListPtr; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSCSIDeviceList, virObjectUnref); @@ -43,7 +41,7 @@ char *virSCSIDeviceGetDevName(const char *sysfs_prefix, unsigned int target, unsigned long long unit); -virSCSIDevicePtr virSCSIDeviceNew(const char *sysfs_prefix, +virSCSIDevice *virSCSIDeviceNew(const char *sysfs_prefix, const char *adapter, unsigned int bus, unsigned int target, @@ -51,19 +49,19 @@ virSCSIDevicePtr virSCSIDeviceNew(const char *sysfs_prefix, bool readonly, bool shareable); -void virSCSIDeviceFree(virSCSIDevicePtr dev); -int virSCSIDeviceSetUsedBy(virSCSIDevicePtr dev, +void virSCSIDeviceFree(virSCSIDevice *dev); +int virSCSIDeviceSetUsedBy(virSCSIDevice *dev, const char *drvname, const char *domname); -bool virSCSIDeviceIsAvailable(virSCSIDevicePtr dev); -const char *virSCSIDeviceGetName(virSCSIDevicePtr dev); -const char *virSCSIDeviceGetPath(virSCSIDevicePtr dev); -unsigned int virSCSIDeviceGetAdapter(virSCSIDevicePtr dev); -unsigned int virSCSIDeviceGetBus(virSCSIDevicePtr dev); -unsigned int virSCSIDeviceGetTarget(virSCSIDevicePtr dev); -unsigned long long virSCSIDeviceGetUnit(virSCSIDevicePtr dev); -bool virSCSIDeviceGetReadonly(virSCSIDevicePtr dev); -bool virSCSIDeviceGetShareable(virSCSIDevicePtr dev); +bool virSCSIDeviceIsAvailable(virSCSIDevice *dev); +const char *virSCSIDeviceGetName(virSCSIDevice *dev); +const char *virSCSIDeviceGetPath(virSCSIDevice *dev); +unsigned int virSCSIDeviceGetAdapter(virSCSIDevice *dev); +unsigned int virSCSIDeviceGetBus(virSCSIDevice *dev); +unsigned int virSCSIDeviceGetTarget(virSCSIDevice *dev); +unsigned long long virSCSIDeviceGetUnit(virSCSIDevice *dev); +bool virSCSIDeviceGetReadonly(virSCSIDevice *dev); +bool virSCSIDeviceGetShareable(virSCSIDevice *dev); /* * Callback that will be invoked once for each file @@ -72,26 +70,26 @@ bool virSCSIDeviceGetShareable(virSCSIDevicePtr dev); * Should return 0 if successfully processed, or * -1 to indicate error and abort iteration */ -typedef int (*virSCSIDeviceFileActor)(virSCSIDevicePtr dev, +typedef int (*virSCSIDeviceFileActor)(virSCSIDevice *dev, const char *path, void *opaque); -int virSCSIDeviceFileIterate(virSCSIDevicePtr dev, +int virSCSIDeviceFileIterate(virSCSIDevice *dev, virSCSIDeviceFileActor actor, void *opaque); -virSCSIDeviceListPtr virSCSIDeviceListNew(void); -int virSCSIDeviceListAdd(virSCSIDeviceListPtr list, - virSCSIDevicePtr dev); -virSCSIDevicePtr virSCSIDeviceListGet(virSCSIDeviceListPtr list, +virSCSIDeviceList *virSCSIDeviceListNew(void); +int virSCSIDeviceListAdd(virSCSIDeviceList *list, + virSCSIDevice *dev); +virSCSIDevice *virSCSIDeviceListGet(virSCSIDeviceList *list, int idx); -size_t virSCSIDeviceListCount(virSCSIDeviceListPtr list); -virSCSIDevicePtr virSCSIDeviceListSteal(virSCSIDeviceListPtr list, - virSCSIDevicePtr dev); -void virSCSIDeviceListDel(virSCSIDeviceListPtr list, - virSCSIDevicePtr dev, +size_t virSCSIDeviceListCount(virSCSIDeviceList *list); +virSCSIDevice *virSCSIDeviceListSteal(virSCSIDeviceList *list, + virSCSIDevice *dev); +void virSCSIDeviceListDel(virSCSIDeviceList *list, + virSCSIDevice *dev, const char *drvname, const char *domname); -virSCSIDevicePtr virSCSIDeviceListFind(virSCSIDeviceListPtr list, - virSCSIDevicePtr dev); +virSCSIDevice *virSCSIDeviceListFind(virSCSIDeviceList *list, + virSCSIDevice *dev); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSCSIDevice, virSCSIDeviceFree); diff --git a/src/util/virscsivhost.c b/src/util/virscsivhost.c index a0dfb8021a..396f10d708 100644 --- a/src/util/virscsivhost.c +++ b/src/util/virscsivhost.c @@ -45,15 +45,15 @@ struct _virSCSIVHostDevice { struct _virSCSIVHostDeviceList { virObjectLockable parent; size_t count; - virSCSIVHostDevicePtr *devs; + virSCSIVHostDevice **devs; }; -static virClassPtr virSCSIVHostDeviceListClass; +static virClass *virSCSIVHostDeviceListClass; static void virSCSIVHostDeviceListDispose(void *obj) { - virSCSIVHostDeviceListPtr list = obj; + virSCSIVHostDeviceList *list = obj; size_t i; for (i = 0; i < list->count; i++) @@ -103,21 +103,21 @@ virSCSIVHostOpenVhostSCSI(int *vhostfd) void -virSCSIVHostDeviceListDel(virSCSIVHostDeviceListPtr list, - virSCSIVHostDevicePtr dev) +virSCSIVHostDeviceListDel(virSCSIVHostDeviceList *list, + virSCSIVHostDevice *dev) { virSCSIVHostDeviceFree(virSCSIVHostDeviceListSteal(list, dev)); } static int -virSCSIVHostDeviceListFindIndex(virSCSIVHostDeviceListPtr list, - virSCSIVHostDevicePtr dev) +virSCSIVHostDeviceListFindIndex(virSCSIVHostDeviceList *list, + virSCSIVHostDevice *dev) { size_t i; for (i = 0; i < list->count; i++) { - virSCSIVHostDevicePtr other = list->devs[i]; + virSCSIVHostDevice *other = list->devs[i]; if (STREQ_NULLABLE(other->name, dev->name)) return i; } @@ -125,8 +125,8 @@ virSCSIVHostDeviceListFindIndex(virSCSIVHostDeviceListPtr list, } -virSCSIVHostDevicePtr -virSCSIVHostDeviceListGet(virSCSIVHostDeviceListPtr list, int idx) +virSCSIVHostDevice * +virSCSIVHostDeviceListGet(virSCSIVHostDeviceList *list, int idx) { if (idx >= list->count || idx < 0) return NULL; @@ -136,17 +136,17 @@ virSCSIVHostDeviceListGet(virSCSIVHostDeviceListPtr list, int idx) size_t -virSCSIVHostDeviceListCount(virSCSIVHostDeviceListPtr list) +virSCSIVHostDeviceListCount(virSCSIVHostDeviceList *list) { return list->count; } -virSCSIVHostDevicePtr -virSCSIVHostDeviceListSteal(virSCSIVHostDeviceListPtr list, - virSCSIVHostDevicePtr dev) +virSCSIVHostDevice * +virSCSIVHostDeviceListSteal(virSCSIVHostDeviceList *list, + virSCSIVHostDevice *dev) { - virSCSIVHostDevicePtr ret = NULL; + virSCSIVHostDevice *ret = NULL; size_t i; for (i = 0; i < list->count; i++) { @@ -161,9 +161,9 @@ virSCSIVHostDeviceListSteal(virSCSIVHostDeviceListPtr list, } -virSCSIVHostDevicePtr -virSCSIVHostDeviceListFind(virSCSIVHostDeviceListPtr list, - virSCSIVHostDevicePtr dev) +virSCSIVHostDevice * +virSCSIVHostDeviceListFind(virSCSIVHostDeviceList *list, + virSCSIVHostDevice *dev) { int idx; @@ -175,8 +175,8 @@ virSCSIVHostDeviceListFind(virSCSIVHostDeviceListPtr list, int -virSCSIVHostDeviceListAdd(virSCSIVHostDeviceListPtr list, - virSCSIVHostDevicePtr dev) +virSCSIVHostDeviceListAdd(virSCSIVHostDeviceList *list, + virSCSIVHostDevice *dev) { if (virSCSIVHostDeviceListFind(list, dev)) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -187,7 +187,7 @@ virSCSIVHostDeviceListAdd(virSCSIVHostDeviceListPtr list, } -virSCSIVHostDeviceListPtr +virSCSIVHostDeviceList * virSCSIVHostDeviceListNew(void) { if (virSCSIVHostInitialize() < 0) @@ -198,7 +198,7 @@ virSCSIVHostDeviceListNew(void) int -virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevicePtr dev, +virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevice *dev, const char *drvname, const char *domname) { @@ -212,7 +212,7 @@ virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevicePtr dev, void -virSCSIVHostDeviceGetUsedBy(virSCSIVHostDevicePtr dev, +virSCSIVHostDeviceGetUsedBy(virSCSIVHostDevice *dev, const char **drv_name, const char **dom_name) { @@ -222,7 +222,7 @@ virSCSIVHostDeviceGetUsedBy(virSCSIVHostDevicePtr dev, int -virSCSIVHostDeviceFileIterate(virSCSIVHostDevicePtr dev, +virSCSIVHostDeviceFileIterate(virSCSIVHostDevice *dev, virSCSIVHostDeviceFileActor actor, void *opaque) { @@ -231,20 +231,20 @@ virSCSIVHostDeviceFileIterate(virSCSIVHostDevicePtr dev, const char * -virSCSIVHostDeviceGetName(virSCSIVHostDevicePtr dev) +virSCSIVHostDeviceGetName(virSCSIVHostDevice *dev) { return dev->name; } const char * -virSCSIVHostDeviceGetPath(virSCSIVHostDevicePtr dev) +virSCSIVHostDeviceGetPath(virSCSIVHostDevice *dev) { return dev->path; } -virSCSIVHostDevicePtr +virSCSIVHostDevice * virSCSIVHostDeviceNew(const char *name) { g_autoptr(virSCSIVHostDevice) dev = NULL; @@ -262,7 +262,7 @@ virSCSIVHostDeviceNew(const char *name) void -virSCSIVHostDeviceFree(virSCSIVHostDevicePtr dev) +virSCSIVHostDeviceFree(virSCSIVHostDevice *dev) { if (!dev) return; diff --git a/src/util/virscsivhost.h b/src/util/virscsivhost.h index 802c4d7bd7..d030aea397 100644 --- a/src/util/virscsivhost.h +++ b/src/util/virscsivhost.h @@ -24,41 +24,39 @@ #include "virobject.h" typedef struct _virSCSIVHostDevice virSCSIVHostDevice; -typedef virSCSIVHostDevice *virSCSIVHostDevicePtr; typedef struct _virSCSIVHostDeviceList virSCSIVHostDeviceList; -typedef virSCSIVHostDeviceList *virSCSIVHostDeviceListPtr; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSCSIVHostDeviceList, virObjectUnref); -typedef int (*virSCSIVHostDeviceFileActor)(virSCSIVHostDevicePtr dev, +typedef int (*virSCSIVHostDeviceFileActor)(virSCSIVHostDevice *dev, const char *name, void *opaque); -int virSCSIVHostDeviceFileIterate(virSCSIVHostDevicePtr dev, +int virSCSIVHostDeviceFileIterate(virSCSIVHostDevice *dev, virSCSIVHostDeviceFileActor actor, void *opaque); -const char *virSCSIVHostDeviceGetName(virSCSIVHostDevicePtr dev); -const char *virSCSIVHostDeviceGetPath(virSCSIVHostDevicePtr dev); -virSCSIVHostDevicePtr virSCSIVHostDeviceListGet(virSCSIVHostDeviceListPtr list, +const char *virSCSIVHostDeviceGetName(virSCSIVHostDevice *dev); +const char *virSCSIVHostDeviceGetPath(virSCSIVHostDevice *dev); +virSCSIVHostDevice *virSCSIVHostDeviceListGet(virSCSIVHostDeviceList *list, int idx); -size_t virSCSIVHostDeviceListCount(virSCSIVHostDeviceListPtr list); -virSCSIVHostDevicePtr virSCSIVHostDeviceListSteal(virSCSIVHostDeviceListPtr list, - virSCSIVHostDevicePtr dev); -virSCSIVHostDevicePtr virSCSIVHostDeviceListFind(virSCSIVHostDeviceListPtr list, - virSCSIVHostDevicePtr dev); -int virSCSIVHostDeviceListAdd(virSCSIVHostDeviceListPtr list, - virSCSIVHostDevicePtr dev); -void virSCSIVHostDeviceListDel(virSCSIVHostDeviceListPtr list, - virSCSIVHostDevicePtr dev); -virSCSIVHostDeviceListPtr virSCSIVHostDeviceListNew(void); -virSCSIVHostDevicePtr virSCSIVHostDeviceNew(const char *name); -int virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevicePtr dev, +size_t virSCSIVHostDeviceListCount(virSCSIVHostDeviceList *list); +virSCSIVHostDevice *virSCSIVHostDeviceListSteal(virSCSIVHostDeviceList *list, + virSCSIVHostDevice *dev); +virSCSIVHostDevice *virSCSIVHostDeviceListFind(virSCSIVHostDeviceList *list, + virSCSIVHostDevice *dev); +int virSCSIVHostDeviceListAdd(virSCSIVHostDeviceList *list, + virSCSIVHostDevice *dev); +void virSCSIVHostDeviceListDel(virSCSIVHostDeviceList *list, + virSCSIVHostDevice *dev); +virSCSIVHostDeviceList *virSCSIVHostDeviceListNew(void); +virSCSIVHostDevice *virSCSIVHostDeviceNew(const char *name); +int virSCSIVHostDeviceSetUsedBy(virSCSIVHostDevice *dev, const char *drvname, const char *domname); -void virSCSIVHostDeviceGetUsedBy(virSCSIVHostDevicePtr dev, +void virSCSIVHostDeviceGetUsedBy(virSCSIVHostDevice *dev, const char **drv_name, const char **dom_name); -void virSCSIVHostDeviceFree(virSCSIVHostDevicePtr dev); +void virSCSIVHostDeviceFree(virSCSIVHostDevice *dev); int virSCSIVHostOpenVhostSCSI(int *vhostfd) G_GNUC_NO_INLINE; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSCSIVHostDevice, virSCSIVHostDeviceFree); diff --git a/src/util/virseclabel.c b/src/util/virseclabel.c index 3dc2b74a9c..907e154d14 100644 --- a/src/util/virseclabel.c +++ b/src/util/virseclabel.c @@ -30,7 +30,7 @@ void -virSecurityLabelDefFree(virSecurityLabelDefPtr def) +virSecurityLabelDefFree(virSecurityLabelDef *def) { if (!def) return; @@ -43,7 +43,7 @@ virSecurityLabelDefFree(virSecurityLabelDefPtr def) void -virSecurityDeviceLabelDefFree(virSecurityDeviceLabelDefPtr def) +virSecurityDeviceLabelDefFree(virSecurityDeviceLabelDef *def) { if (!def) return; @@ -53,10 +53,10 @@ virSecurityDeviceLabelDefFree(virSecurityDeviceLabelDefPtr def) } -virSecurityLabelDefPtr +virSecurityLabelDef * virSecurityLabelDefNew(const char *model) { - virSecurityLabelDefPtr seclabel = NULL; + virSecurityLabelDef *seclabel = NULL; seclabel = g_new0(virSecurityLabelDef, 1); @@ -67,10 +67,10 @@ virSecurityLabelDefNew(const char *model) return seclabel; } -virSecurityDeviceLabelDefPtr +virSecurityDeviceLabelDef * virSecurityDeviceLabelDefNew(const char *model) { - virSecurityDeviceLabelDefPtr seclabel = NULL; + virSecurityDeviceLabelDef *seclabel = NULL; seclabel = g_new0(virSecurityDeviceLabelDef, 1); @@ -80,10 +80,10 @@ virSecurityDeviceLabelDefNew(const char *model) } -virSecurityDeviceLabelDefPtr +virSecurityDeviceLabelDef * virSecurityDeviceLabelDefCopy(const virSecurityDeviceLabelDef *src) { - virSecurityDeviceLabelDefPtr ret; + virSecurityDeviceLabelDef *ret; ret = g_new0(virSecurityDeviceLabelDef, 1); diff --git a/src/util/virseclabel.h b/src/util/virseclabel.h index 4395a73240..18447051fc 100644 --- a/src/util/virseclabel.h +++ b/src/util/virseclabel.h @@ -32,7 +32,6 @@ typedef enum { /* Security configuration for domain */ typedef struct _virSecurityLabelDef virSecurityLabelDef; -typedef virSecurityLabelDef *virSecurityLabelDefPtr; struct _virSecurityLabelDef { char *model; /* name of security model */ char *label; /* security label string */ @@ -46,7 +45,6 @@ struct _virSecurityLabelDef { /* Security configuration for device */ typedef struct _virSecurityDeviceLabelDef virSecurityDeviceLabelDef; -typedef virSecurityDeviceLabelDef *virSecurityDeviceLabelDefPtr; struct _virSecurityDeviceLabelDef { char *model; char *label; /* image label string */ @@ -54,15 +52,15 @@ struct _virSecurityDeviceLabelDef { bool labelskip; /* live-only; true if skipping failed label attempt */ }; -virSecurityLabelDefPtr +virSecurityLabelDef * virSecurityLabelDefNew(const char *model); -virSecurityDeviceLabelDefPtr +virSecurityDeviceLabelDef * virSecurityDeviceLabelDefNew(const char *model); -virSecurityDeviceLabelDefPtr +virSecurityDeviceLabelDef * virSecurityDeviceLabelDefCopy(const virSecurityDeviceLabelDef *src) ATTRIBUTE_NONNULL(1); -void virSecurityLabelDefFree(virSecurityLabelDefPtr def); -void virSecurityDeviceLabelDefFree(virSecurityDeviceLabelDefPtr def); +void virSecurityLabelDefFree(virSecurityLabelDef *def); +void virSecurityDeviceLabelDefFree(virSecurityDeviceLabelDef *def); diff --git a/src/util/virsecret.c b/src/util/virsecret.c index 57c8583539..0695288229 100644 --- a/src/util/virsecret.c +++ b/src/util/virsecret.c @@ -39,7 +39,7 @@ VIR_ENUM_IMPL(virSecretUsage, ); void -virSecretLookupDefClear(virSecretLookupTypeDefPtr def) +virSecretLookupDefClear(virSecretLookupTypeDef *def) { if (def->type == VIR_SECRET_LOOKUP_TYPE_USAGE) VIR_FREE(def->u.usage); @@ -49,7 +49,7 @@ virSecretLookupDefClear(virSecretLookupTypeDefPtr def) void -virSecretLookupDefCopy(virSecretLookupTypeDefPtr dst, +virSecretLookupDefCopy(virSecretLookupTypeDef *dst, const virSecretLookupTypeDef *src) { dst->type = src->type; @@ -63,7 +63,7 @@ virSecretLookupDefCopy(virSecretLookupTypeDefPtr dst, int virSecretLookupParseSecret(xmlNodePtr secretnode, - virSecretLookupTypeDefPtr def) + virSecretLookupTypeDef *def) { g_autofree char *uuid = NULL; g_autofree char *usage = NULL; @@ -98,9 +98,9 @@ virSecretLookupParseSecret(xmlNodePtr secretnode, void -virSecretLookupFormatSecret(virBufferPtr buf, +virSecretLookupFormatSecret(virBuffer *buf, const char *secrettype, - virSecretLookupTypeDefPtr def) + virSecretLookupTypeDef *def) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -135,7 +135,7 @@ virSecretLookupFormatSecret(virBufferPtr buf, */ int virSecretGetSecretString(virConnectPtr conn, - virSecretLookupTypeDefPtr seclookupdef, + virSecretLookupTypeDef *seclookupdef, virSecretUsageType secretUsageType, uint8_t **secret, size_t *secret_size) diff --git a/src/util/virsecret.h b/src/util/virsecret.h index cfdf2b6e29..c803f0fe33 100644 --- a/src/util/virsecret.h +++ b/src/util/virsecret.h @@ -37,7 +37,6 @@ typedef enum { } virSecretLookupType; typedef struct _virSecretLookupTypeDef virSecretLookupTypeDef; -typedef virSecretLookupTypeDef *virSecretLookupTypeDefPtr; struct _virSecretLookupTypeDef { int type; /* virSecretLookupType */ union { @@ -47,17 +46,17 @@ struct _virSecretLookupTypeDef { }; -void virSecretLookupDefClear(virSecretLookupTypeDefPtr def); -void virSecretLookupDefCopy(virSecretLookupTypeDefPtr dst, +void virSecretLookupDefClear(virSecretLookupTypeDef *def); +void virSecretLookupDefCopy(virSecretLookupTypeDef *dst, const virSecretLookupTypeDef *src); int virSecretLookupParseSecret(xmlNodePtr secretnode, - virSecretLookupTypeDefPtr def); -void virSecretLookupFormatSecret(virBufferPtr buf, + virSecretLookupTypeDef *def); +void virSecretLookupFormatSecret(virBuffer *buf, const char *secrettype, - virSecretLookupTypeDefPtr def); + virSecretLookupTypeDef *def); int virSecretGetSecretString(virConnectPtr conn, - virSecretLookupTypeDefPtr seclookupdef, + virSecretLookupTypeDef *seclookupdef, virSecretUsageType secretUsageType, uint8_t **ret_secret, size_t *ret_secret_size) diff --git a/src/util/virsocketaddr.c b/src/util/virsocketaddr.c index 8ac0ab5f5a..94cbfc6264 100644 --- a/src/util/virsocketaddr.c +++ b/src/util/virsocketaddr.c @@ -27,19 +27,16 @@ #define VIR_FROM_THIS VIR_FROM_NONE /* - * Helpers to extract the IP arrays from the virSocketAddrPtr + * Helpers to extract the IP arrays from the virSocketAddr * * That part is the less portable of the module */ typedef unsigned char virSocketAddrIPv4[4]; -typedef virSocketAddrIPv4 *virSocketAddrIPv4Ptr; typedef unsigned short virSocketAddrIPv6[8]; -typedef virSocketAddrIPv6 *virSocketAddrIPv6Ptr; typedef unsigned char virSocketAddrIPv6Nibbles[32]; -typedef virSocketAddrIPv6Nibbles *virSocketAddrIPv6NibblesPtr; static int virSocketAddrGetIPv4Addr(const virSocketAddr *addr, - virSocketAddrIPv4Ptr tab) + virSocketAddrIPv4 *tab) { unsigned long val; size_t i; @@ -58,7 +55,7 @@ virSocketAddrGetIPv4Addr(const virSocketAddr *addr, } static int -virSocketAddrGetIPv6Addr(const virSocketAddr *addr, virSocketAddrIPv6Ptr tab) +virSocketAddrGetIPv6Addr(const virSocketAddr *addr, virSocketAddrIPv6 *tab) { size_t i; @@ -75,7 +72,7 @@ virSocketAddrGetIPv6Addr(const virSocketAddr *addr, virSocketAddrIPv6Ptr tab) static int virSocketAddrGetIPv6Nibbles(const virSocketAddr *addr, - virSocketAddrIPv6NibblesPtr tab) + virSocketAddrIPv6Nibbles *tab) { size_t i; @@ -132,7 +129,7 @@ virSocketAddrParseInternal(struct addrinfo **res, * * Returns the length of the network address or -1 in case of error. */ -int virSocketAddrParse(virSocketAddrPtr addr, const char *val, int family) +int virSocketAddrParse(virSocketAddr *addr, const char *val, int family) { int len; struct addrinfo *res; @@ -173,7 +170,7 @@ int virSocketAddrParse(virSocketAddrPtr addr, const char *val, int family) * * Returns the length of the network address or -1 in case of error. */ -int virSocketAddrParseAny(virSocketAddrPtr addr, +int virSocketAddrParseAny(virSocketAddr *addr, const char *val, int family, bool reportError) @@ -213,7 +210,7 @@ int virSocketAddrParseAny(virSocketAddrPtr addr, * Returns the length of the network address or -1 in case of error. */ int -virSocketAddrParseIPv4(virSocketAddrPtr addr, const char *val) +virSocketAddrParseIPv4(virSocketAddr *addr, const char *val) { return virSocketAddrParse(addr, val, AF_INET); } @@ -228,7 +225,7 @@ virSocketAddrParseIPv4(virSocketAddrPtr addr, const char *val) * Returns the length of the network address or -1 in case of error. */ int -virSocketAddrParseIPv6(virSocketAddrPtr addr, const char *val) +virSocketAddrParseIPv6(virSocketAddr *addr, const char *val) { return virSocketAddrParse(addr, val, AF_INET6); } @@ -293,7 +290,7 @@ int virSocketAddrResolveService(const char *service) * touch any previously set port. */ void -virSocketAddrSetIPv4AddrNetOrder(virSocketAddrPtr addr, uint32_t val) +virSocketAddrSetIPv4AddrNetOrder(virSocketAddr *addr, uint32_t val) { addr->data.stor.ss_family = AF_INET; addr->data.inet4.sin_addr.s_addr = val; @@ -309,7 +306,7 @@ virSocketAddrSetIPv4AddrNetOrder(virSocketAddrPtr addr, uint32_t val) * touch any previously set port. */ void -virSocketAddrSetIPv4Addr(virSocketAddrPtr addr, uint32_t val) +virSocketAddrSetIPv4Addr(virSocketAddr *addr, uint32_t val) { virSocketAddrSetIPv4AddrNetOrder(addr, htonl(val)); } @@ -322,7 +319,7 @@ virSocketAddrSetIPv4Addr(virSocketAddrPtr addr, uint32_t val) * Set the IPv6 address given an integer in network order. This function does not * touch any previously set port. */ -void virSocketAddrSetIPv6AddrNetOrder(virSocketAddrPtr addr, uint32_t val[4]) +void virSocketAddrSetIPv6AddrNetOrder(virSocketAddr *addr, uint32_t val[4]) { addr->data.stor.ss_family = AF_INET6; memcpy(addr->data.inet6.sin6_addr.s6_addr, val, 4 * sizeof(*val)); @@ -337,7 +334,7 @@ void virSocketAddrSetIPv6AddrNetOrder(virSocketAddrPtr addr, uint32_t val[4]) * Set the IPv6 address given an integer in host order. This function does not * touch any previously set port. */ -void virSocketAddrSetIPv6Addr(virSocketAddrPtr addr, uint32_t val[4]) +void virSocketAddrSetIPv6Addr(virSocketAddr *addr, uint32_t val[4]) { size_t i = 0; uint32_t host_val[4]; @@ -432,7 +429,7 @@ virSocketAddrIsWildcard(const virSocketAddr *addr) /* * virSocketAddrFormat: - * @addr: an initialized virSocketAddrPtr + * @addr: an initialized virSocketAddr * * * Returns a string representation of the given address * Returns NULL on any error @@ -447,7 +444,7 @@ virSocketAddrFormat(const virSocketAddr *addr) /* * virSocketAddrFormatFull: - * @addr: an initialized virSocketAddrPtr + * @addr: an initialized virSocketAddr * * @withService: if true, then service info is appended * @separator: separator between hostname & service. * @@ -516,7 +513,7 @@ virSocketAddrFormatFull(const virSocketAddr *addr, /* * virSocketAddrSetPort: - * @addr: an initialized virSocketAddrPtr + * @addr: an initialized virSocketAddr * * @port: the port number to set * * Set the transport layer port of the given virtSocketAddr @@ -524,7 +521,7 @@ virSocketAddrFormatFull(const virSocketAddr *addr, * Returns 0 on success, -1 on failure */ int -virSocketAddrSetPort(virSocketAddrPtr addr, int port) +virSocketAddrSetPort(virSocketAddr *addr, int port) { if (addr == NULL) return -1; @@ -544,13 +541,13 @@ virSocketAddrSetPort(virSocketAddrPtr addr, int port) /* * virSocketGetPort: - * @addr: an initialized virSocketAddrPtr + * @addr: an initialized virSocketAddr * * * Returns the transport layer port of the given virtSocketAddr * Returns -1 if @addr is invalid */ int -virSocketAddrGetPort(virSocketAddrPtr addr) +virSocketAddrGetPort(virSocketAddr *addr) { if (addr == NULL) return -1; @@ -567,7 +564,7 @@ virSocketAddrGetPort(virSocketAddrPtr addr) /* * virSocketGetPath: - * @addr: an initialized virSocketAddrPtr + * @addr: an initialized virSocketAddr * * * Returns the UNIX socket path of the given virtSocketAddr * @@ -575,7 +572,7 @@ virSocketAddrGetPort(virSocketAddrPtr addr) * address of type AF_UNIX; */ char * -virSocketAddrGetPath(virSocketAddrPtr addr G_GNUC_UNUSED) +virSocketAddrGetPath(virSocketAddr *addr G_GNUC_UNUSED) { #ifndef WIN32 if (addr == NULL) { @@ -607,7 +604,7 @@ virSocketAddrGetPath(virSocketAddrPtr addr G_GNUC_UNUSED) * * Returns 0 in case of success and -1 in case of error */ -int virSocketAddrIsNetmask(virSocketAddrPtr netmask) +int virSocketAddrIsNetmask(virSocketAddr *netmask) { int n = virSocketAddrGetNumNetmaskBits(netmask); if (n < 0) @@ -629,7 +626,7 @@ int virSocketAddrIsNetmask(virSocketAddrPtr netmask) int virSocketAddrMask(const virSocketAddr *addr, const virSocketAddr *netmask, - virSocketAddrPtr network) + virSocketAddr *network) { memset(network, 0, sizeof(*network)); if (addr->data.stor.ss_family != netmask->data.stor.ss_family) { @@ -676,7 +673,7 @@ virSocketAddrMask(const virSocketAddr *addr, int virSocketAddrMaskByPrefix(const virSocketAddr *addr, unsigned int prefix, - virSocketAddrPtr network) + virSocketAddr *network) { virSocketAddr netmask; @@ -703,7 +700,7 @@ virSocketAddrMaskByPrefix(const virSocketAddr *addr, int virSocketAddrBroadcast(const virSocketAddr *addr, const virSocketAddr *netmask, - virSocketAddrPtr broadcast) + virSocketAddr *broadcast) { memset(broadcast, 0, sizeof(*broadcast)); @@ -735,7 +732,7 @@ virSocketAddrBroadcast(const virSocketAddr *addr, int virSocketAddrBroadcastByPrefix(const virSocketAddr *addr, unsigned int prefix, - virSocketAddrPtr broadcast) + virSocketAddr *broadcast) { virSocketAddr netmask; @@ -758,8 +755,8 @@ virSocketAddrBroadcastByPrefix(const virSocketAddr *addr, * Returns 1 in case of success and 0 in case of failure and * -1 in case of error */ -int virSocketAddrCheckNetmask(virSocketAddrPtr addr1, virSocketAddrPtr addr2, - virSocketAddrPtr netmask) +int virSocketAddrCheckNetmask(virSocketAddr *addr1, virSocketAddr *addr2, + virSocketAddr *netmask) { size_t i; @@ -820,8 +817,8 @@ int virSocketAddrCheckNetmask(virSocketAddrPtr addr1, virSocketAddrPtr addr2, * Returns the size of the range or -1 in case of failure */ int -virSocketAddrGetRange(virSocketAddrPtr start, virSocketAddrPtr end, - virSocketAddrPtr network, int prefix) +virSocketAddrGetRange(virSocketAddr *start, virSocketAddr *end, + virSocketAddr *network, int prefix) { int ret = 0; size_t i; @@ -1094,7 +1091,7 @@ int virSocketAddrGetNumNetmaskBits(const virSocketAddr *netmask) int virSocketAddrPrefixToNetmask(unsigned int prefix, - virSocketAddrPtr netmask, + virSocketAddr *netmask, int family) { memset(netmask, 0, sizeof(*netmask)); @@ -1305,7 +1302,7 @@ virSocketAddrPTRDomain(const virSocketAddr *addr, } void -virSocketAddrFree(virSocketAddrPtr addr) +virSocketAddrFree(virSocketAddr *addr) { g_free(addr); } diff --git a/src/util/virsocketaddr.h b/src/util/virsocketaddr.h index 6c08f8b35c..f76e229730 100644 --- a/src/util/virsocketaddr.h +++ b/src/util/virsocketaddr.h @@ -50,81 +50,77 @@ typedef struct { #define VIR_SOCKET_ADDR_IPV4_ARPA "in-addr.arpa" #define VIR_SOCKET_ADDR_IPV6_ARPA "ip6.arpa" -typedef virSocketAddr *virSocketAddrPtr; - typedef struct _virSocketAddrRange virSocketAddrRange; -typedef virSocketAddrRange *virSocketAddrRangePtr; struct _virSocketAddrRange { virSocketAddr start; virSocketAddr end; }; typedef struct _virPortRange virPortRange; -typedef virPortRange *virPortRangePtr; struct _virPortRange { unsigned int start; unsigned int end; }; -int virSocketAddrParse(virSocketAddrPtr addr, +int virSocketAddrParse(virSocketAddr *addr, const char *val, int family); -int virSocketAddrParseAny(virSocketAddrPtr addr, +int virSocketAddrParseAny(virSocketAddr *addr, const char *val, int family, bool reportError); -int virSocketAddrParseIPv4(virSocketAddrPtr addr, +int virSocketAddrParseIPv4(virSocketAddr *addr, const char *val); -int virSocketAddrParseIPv6(virSocketAddrPtr addr, +int virSocketAddrParseIPv6(virSocketAddr *addr, const char *val); int virSocketAddrResolveService(const char *service); -void virSocketAddrSetIPv4AddrNetOrder(virSocketAddrPtr addr, uint32_t val); -void virSocketAddrSetIPv4Addr(virSocketAddrPtr addr, uint32_t val); -void virSocketAddrSetIPv6AddrNetOrder(virSocketAddrPtr addr, uint32_t val[4]); -void virSocketAddrSetIPv6Addr(virSocketAddrPtr addr, uint32_t val[4]); +void virSocketAddrSetIPv4AddrNetOrder(virSocketAddr *addr, uint32_t val); +void virSocketAddrSetIPv4Addr(virSocketAddr *addr, uint32_t val); +void virSocketAddrSetIPv6AddrNetOrder(virSocketAddr *addr, uint32_t val[4]); +void virSocketAddrSetIPv6Addr(virSocketAddr *addr, uint32_t val[4]); char *virSocketAddrFormat(const virSocketAddr *addr); char *virSocketAddrFormatFull(const virSocketAddr *addr, bool withService, const char *separator); -char *virSocketAddrGetPath(virSocketAddrPtr addr); +char *virSocketAddrGetPath(virSocketAddr *addr); -int virSocketAddrSetPort(virSocketAddrPtr addr, int port); +int virSocketAddrSetPort(virSocketAddr *addr, int port); -int virSocketAddrGetPort(virSocketAddrPtr addr); +int virSocketAddrGetPort(virSocketAddr *addr); -int virSocketAddrGetRange(virSocketAddrPtr start, - virSocketAddrPtr end, - virSocketAddrPtr network, +int virSocketAddrGetRange(virSocketAddr *start, + virSocketAddr *end, + virSocketAddr *network, int prefix); -int virSocketAddrIsNetmask(virSocketAddrPtr netmask); +int virSocketAddrIsNetmask(virSocketAddr *netmask); -int virSocketAddrCheckNetmask(virSocketAddrPtr addr1, - virSocketAddrPtr addr2, - virSocketAddrPtr netmask); +int virSocketAddrCheckNetmask(virSocketAddr *addr1, + virSocketAddr *addr2, + virSocketAddr *netmask); int virSocketAddrMask(const virSocketAddr *addr, const virSocketAddr *netmask, - virSocketAddrPtr network); + virSocketAddr *network); int virSocketAddrMaskByPrefix(const virSocketAddr *addr, unsigned int prefix, - virSocketAddrPtr network); + virSocketAddr *network); int virSocketAddrBroadcast(const virSocketAddr *addr, const virSocketAddr *netmask, - virSocketAddrPtr broadcast); + virSocketAddr *broadcast); int virSocketAddrBroadcastByPrefix(const virSocketAddr *addr, unsigned int prefix, - virSocketAddrPtr broadcast); + virSocketAddr *broadcast); int virSocketAddrGetNumNetmaskBits(const virSocketAddr *netmask); int virSocketAddrPrefixToNetmask(unsigned int prefix, - virSocketAddrPtr netmask, + virSocketAddr *netmask, int family); int virSocketAddrGetIPPrefix(const virSocketAddr *address, const virSocketAddr *netmask, @@ -144,6 +140,6 @@ int virSocketAddrPTRDomain(const virSocketAddr *addr, char **ptr) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(3); -void virSocketAddrFree(virSocketAddrPtr addr); +void virSocketAddrFree(virSocketAddr *addr); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSocketAddr, virSocketAddrFree); diff --git a/src/util/virsysinfo.c b/src/util/virsysinfo.c index 2ddbc1ac17..af9e03c5ac 100644 --- a/src/util/virsysinfo.c +++ b/src/util/virsysinfo.c @@ -63,7 +63,7 @@ virSysinfoSetup(const char *sysinfo, sysinfoCpuinfo = cpuinfo; } -void virSysinfoBIOSDefFree(virSysinfoBIOSDefPtr def) +void virSysinfoBIOSDefFree(virSysinfoBIOSDef *def) { if (def == NULL) return; @@ -75,7 +75,7 @@ void virSysinfoBIOSDefFree(virSysinfoBIOSDefPtr def) g_free(def); } -void virSysinfoSystemDefFree(virSysinfoSystemDefPtr def) +void virSysinfoSystemDefFree(virSysinfoSystemDef *def) { if (def == NULL) return; @@ -90,7 +90,7 @@ void virSysinfoSystemDefFree(virSysinfoSystemDefPtr def) g_free(def); } -void virSysinfoBaseBoardDefClear(virSysinfoBaseBoardDefPtr def) +void virSysinfoBaseBoardDefClear(virSysinfoBaseBoardDef *def) { if (def == NULL) return; @@ -104,7 +104,7 @@ void virSysinfoBaseBoardDefClear(virSysinfoBaseBoardDefPtr def) } -void virSysinfoChassisDefFree(virSysinfoChassisDefPtr def) +void virSysinfoChassisDefFree(virSysinfoChassisDef *def) { if (def == NULL) return; @@ -118,7 +118,7 @@ void virSysinfoChassisDefFree(virSysinfoChassisDefPtr def) } -void virSysinfoOEMStringsDefFree(virSysinfoOEMStringsDefPtr def) +void virSysinfoOEMStringsDefFree(virSysinfoOEMStringsDef *def) { size_t i; @@ -134,7 +134,7 @@ void virSysinfoOEMStringsDefFree(virSysinfoOEMStringsDefPtr def) static void -virSysinfoFWCfgDefClear(virSysinfoFWCfgDefPtr def) +virSysinfoFWCfgDefClear(virSysinfoFWCfgDef *def) { if (!def) return; @@ -152,7 +152,7 @@ virSysinfoFWCfgDefClear(virSysinfoFWCfgDefPtr def) * Free up the sysinfo structure */ -void virSysinfoDefFree(virSysinfoDefPtr def) +void virSysinfoDefFree(virSysinfoDef *def) { size_t i; @@ -216,12 +216,12 @@ virSysinfoDefIsEmpty(const virSysinfoDef *def) static int -virSysinfoParsePPCSystem(const char *base, virSysinfoSystemDefPtr *sysdef) +virSysinfoParsePPCSystem(const char *base, virSysinfoSystemDef **sysdef) { int ret = -1; char *eol = NULL; const char *cur; - virSysinfoSystemDefPtr def; + virSysinfoSystemDef *def; if ((cur = strstr(base, "platform")) == NULL) return 0; @@ -265,11 +265,11 @@ virSysinfoParsePPCSystem(const char *base, virSysinfoSystemDefPtr *sysdef) } static int -virSysinfoParsePPCProcessor(const char *base, virSysinfoDefPtr ret) +virSysinfoParsePPCProcessor(const char *base, virSysinfoDef *ret) { const char *cur; char *eol, *tmp_base; - virSysinfoProcessorDefPtr processor; + virSysinfoProcessorDef *processor; while ((tmp_base = strstr(base, "processor")) != NULL) { base = tmp_base; @@ -310,7 +310,7 @@ virSysinfoParsePPCProcessor(const char *base, virSysinfoDefPtr ret) /* virSysinfoRead for PowerPC * Gathers sysinfo data from /proc/cpuinfo */ -virSysinfoDefPtr +virSysinfoDef * virSysinfoReadPPC(void) { g_autoptr(virSysinfoDef) ret = NULL; @@ -337,12 +337,12 @@ virSysinfoReadPPC(void) static int -virSysinfoParseARMSystem(const char *base, virSysinfoSystemDefPtr *sysdef) +virSysinfoParseARMSystem(const char *base, virSysinfoSystemDef **sysdef) { int ret = -1; char *eol = NULL; const char *cur; - virSysinfoSystemDefPtr def; + virSysinfoSystemDef *def; if ((cur = strstr(base, "platform")) == NULL) return 0; @@ -386,11 +386,11 @@ virSysinfoParseARMSystem(const char *base, virSysinfoSystemDefPtr *sysdef) } static int -virSysinfoParseARMProcessor(const char *base, virSysinfoDefPtr ret) +virSysinfoParseARMProcessor(const char *base, virSysinfoDef *ret) { const char *cur; char *eol, *tmp_base; - virSysinfoProcessorDefPtr processor; + virSysinfoProcessorDef *processor; char *processor_type = NULL; if (!(tmp_base = strstr(base, "model name")) && @@ -427,7 +427,7 @@ virSysinfoParseARMProcessor(const char *base, virSysinfoDefPtr ret) /* virSysinfoRead for ARMv7 * Gathers sysinfo data from /proc/cpuinfo */ -virSysinfoDefPtr +virSysinfoDef * virSysinfoReadARM(void) { g_autoptr(virSysinfoDef) ret = NULL; @@ -491,10 +491,10 @@ virSysinfoParseS390Line(const char *base, const char *name, char **value) } static int -virSysinfoParseS390System(const char *base, virSysinfoSystemDefPtr *sysdef) +virSysinfoParseS390System(const char *base, virSysinfoSystemDef **sysdef) { int ret = -1; - virSysinfoSystemDefPtr def; + virSysinfoSystemDef *def; def = g_new0(virSysinfoSystemDef, 1); @@ -521,14 +521,14 @@ virSysinfoParseS390System(const char *base, virSysinfoSystemDefPtr *sysdef) } static int -virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) +virSysinfoParseS390Processor(const char *base, virSysinfoDef *ret) { const char *tmp_base; char *manufacturer = NULL; char *procline = NULL; char *ncpu = NULL; int result = -1; - virSysinfoProcessorDefPtr processor; + virSysinfoProcessorDef *processor; if (!(tmp_base = virSysinfoParseS390Line(base, "vendor_id", &manufacturer))) goto error; @@ -592,7 +592,7 @@ virSysinfoParseS390Processor(const char *base, virSysinfoDefPtr ret) /* virSysinfoRead for s390x * Gathers sysinfo data from /proc/sysinfo and /proc/cpuinfo */ -virSysinfoDefPtr +virSysinfoDef * virSysinfoReadS390(void) { g_autoptr(virSysinfoDef) ret = NULL; @@ -628,12 +628,12 @@ virSysinfoReadS390(void) static int -virSysinfoParseBIOS(const char *base, virSysinfoBIOSDefPtr *bios) +virSysinfoParseBIOS(const char *base, virSysinfoBIOSDef **bios) { int ret = -1; const char *cur; char *eol = NULL; - virSysinfoBIOSDefPtr def; + virSysinfoBIOSDef *def; if ((cur = strstr(base, "BIOS Information")) == NULL) return 0; @@ -683,12 +683,12 @@ virSysinfoParseBIOS(const char *base, virSysinfoBIOSDefPtr *bios) } static int -virSysinfoParseX86System(const char *base, virSysinfoSystemDefPtr *sysdef) +virSysinfoParseX86System(const char *base, virSysinfoSystemDef **sysdef) { int ret = -1; const char *cur; char *eol = NULL; - virSysinfoSystemDefPtr def; + virSysinfoSystemDef *def; if ((cur = strstr(base, "System Information")) == NULL) return 0; @@ -760,16 +760,16 @@ virSysinfoParseX86System(const char *base, virSysinfoSystemDefPtr *sysdef) static int virSysinfoParseX86BaseBoard(const char *base, - virSysinfoBaseBoardDefPtr *baseBoard, + virSysinfoBaseBoardDef **baseBoard, size_t *nbaseBoard) { const char *cur; char *eol = NULL; - virSysinfoBaseBoardDefPtr boards = NULL; + virSysinfoBaseBoardDef *boards = NULL; size_t nboards = 0; while (base && (cur = strstr(base, "Base Board Information"))) { - virSysinfoBaseBoardDefPtr def; + virSysinfoBaseBoardDef *def; VIR_EXPAND_N(boards, nboards, 1); @@ -838,12 +838,12 @@ virSysinfoParseX86BaseBoard(const char *base, static int virSysinfoParseX86Chassis(const char *base, - virSysinfoChassisDefPtr *chassisdef) + virSysinfoChassisDef **chassisdef) { int ret = -1; const char *cur; char *eol = NULL; - virSysinfoChassisDefPtr def; + virSysinfoChassisDef *def; if ((cur = strstr(base, "Chassis Information")) == NULL) return 0; @@ -927,9 +927,9 @@ virSysinfoDMIDecodeOEMString(size_t i, static int virSysinfoParseOEMStrings(const char *base, - virSysinfoOEMStringsDefPtr *stringsRet) + virSysinfoOEMStringsDef **stringsRet) { - virSysinfoOEMStringsDefPtr strings = NULL; + virSysinfoOEMStringsDef *strings = NULL; size_t i = 1; int ret = -1; const char *cur; @@ -996,11 +996,11 @@ virSysinfoParseOEMStrings(const char *base, static int -virSysinfoParseX86Processor(const char *base, virSysinfoDefPtr ret) +virSysinfoParseX86Processor(const char *base, virSysinfoDef *ret) { const char *cur, *tmp_base; char *eol; - virSysinfoProcessorDefPtr processor; + virSysinfoProcessorDef *processor; while ((tmp_base = strstr(base, "Processor Information")) != NULL) { base = tmp_base; @@ -1096,11 +1096,11 @@ virSysinfoParseX86Processor(const char *base, virSysinfoDefPtr ret) } static int -virSysinfoParseX86Memory(const char *base, virSysinfoDefPtr ret) +virSysinfoParseX86Memory(const char *base, virSysinfoDef *ret) { const char *cur, *tmp_base; char *eol; - virSysinfoMemoryDefPtr memory; + virSysinfoMemoryDef *memory; while ((tmp_base = strstr(base, "Memory Device")) != NULL) { base = tmp_base; @@ -1190,7 +1190,7 @@ virSysinfoParseX86Memory(const char *base, virSysinfoDefPtr ret) return 0; } -virSysinfoDefPtr +virSysinfoDef * virSysinfoReadDMI(void) { g_autoptr(virSysinfoDef) ret = NULL; @@ -1242,7 +1242,7 @@ virSysinfoReadDMI(void) * * Returns: a filled up sysinfo structure or NULL in case of error */ -virSysinfoDefPtr +virSysinfoDef * virSysinfoRead(void) { #if defined(__powerpc__) @@ -1269,7 +1269,7 @@ virSysinfoRead(void) static void -virSysinfoBIOSFormat(virBufferPtr buf, virSysinfoBIOSDefPtr def) +virSysinfoBIOSFormat(virBuffer *buf, virSysinfoBIOSDef *def) { if (!def) return; @@ -1289,7 +1289,7 @@ virSysinfoBIOSFormat(virBufferPtr buf, virSysinfoBIOSDefPtr def) } static void -virSysinfoSystemFormat(virBufferPtr buf, virSysinfoSystemDefPtr def) +virSysinfoSystemFormat(virBuffer *buf, virSysinfoSystemDef *def) { if (!def) return; @@ -1315,11 +1315,11 @@ virSysinfoSystemFormat(virBufferPtr buf, virSysinfoSystemDefPtr def) } static void -virSysinfoBaseBoardFormat(virBufferPtr buf, - virSysinfoBaseBoardDefPtr baseBoard, +virSysinfoBaseBoardFormat(virBuffer *buf, + virSysinfoBaseBoardDef *baseBoard, size_t nbaseBoard) { - virSysinfoBaseBoardDefPtr def; + virSysinfoBaseBoardDef *def; size_t i; for (i = 0; i < nbaseBoard; i++) { @@ -1346,8 +1346,8 @@ virSysinfoBaseBoardFormat(virBufferPtr buf, static void -virSysinfoChassisFormat(virBufferPtr buf, - virSysinfoChassisDefPtr def) +virSysinfoChassisFormat(virBuffer *buf, + virSysinfoChassisDef *def) { if (!def) return; @@ -1370,10 +1370,10 @@ virSysinfoChassisFormat(virBufferPtr buf, static void -virSysinfoProcessorFormat(virBufferPtr buf, virSysinfoDefPtr def) +virSysinfoProcessorFormat(virBuffer *buf, virSysinfoDef *def) { size_t i; - virSysinfoProcessorDefPtr processor; + virSysinfoProcessorDef *processor; for (i = 0; i < def->nprocessor; i++) { processor = &def->processor[i]; @@ -1422,10 +1422,10 @@ virSysinfoProcessorFormat(virBufferPtr buf, virSysinfoDefPtr def) } static void -virSysinfoMemoryFormat(virBufferPtr buf, virSysinfoDefPtr def) +virSysinfoMemoryFormat(virBuffer *buf, virSysinfoDef *def) { size_t i; - virSysinfoMemoryDefPtr memory; + virSysinfoMemoryDef *memory; for (i = 0; i < def->nmemory; i++) { memory = &def->memory[i]; @@ -1476,7 +1476,7 @@ virSysinfoMemoryFormat(virBufferPtr buf, virSysinfoDefPtr def) } static void -virSysinfoOEMStringsFormat(virBufferPtr buf, virSysinfoOEMStringsDefPtr def) +virSysinfoOEMStringsFormat(virBuffer *buf, virSysinfoOEMStringsDef *def) { size_t i; @@ -1495,8 +1495,8 @@ virSysinfoOEMStringsFormat(virBufferPtr buf, virSysinfoOEMStringsDefPtr def) static void -virSysinfoFormatSMBIOS(virBufferPtr buf, - virSysinfoDefPtr def) +virSysinfoFormatSMBIOS(virBuffer *buf, + virSysinfoDef *def) { virSysinfoBIOSFormat(buf, def->bios); virSysinfoSystemFormat(buf, def->system); @@ -1509,8 +1509,8 @@ virSysinfoFormatSMBIOS(virBufferPtr buf, static void -virSysinfoFormatFWCfg(virBufferPtr buf, - virSysinfoDefPtr def) +virSysinfoFormatFWCfg(virBuffer *buf, + virSysinfoDef *def) { size_t i; @@ -1535,7 +1535,7 @@ virSysinfoFormatFWCfg(virBufferPtr buf, * Returns 0 on success, -1 on failure after generating an error message. */ int -virSysinfoFormat(virBufferPtr buf, virSysinfoDefPtr def) +virSysinfoFormat(virBuffer *buf, virSysinfoDef *def) { g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) childrenBuf = VIR_BUFFER_INIT_CHILD(buf); @@ -1577,8 +1577,8 @@ virSysinfoFormat(virBufferPtr buf, virSysinfoDefPtr def) } while (0) static bool -virSysinfoBIOSIsEqual(virSysinfoBIOSDefPtr src, - virSysinfoBIOSDefPtr dst) +virSysinfoBIOSIsEqual(virSysinfoBIOSDef *src, + virSysinfoBIOSDef *dst) { if (!src && !dst) return true; @@ -1598,8 +1598,8 @@ virSysinfoBIOSIsEqual(virSysinfoBIOSDefPtr src, } static bool -virSysinfoSystemIsEqual(virSysinfoSystemDefPtr src, - virSysinfoSystemDefPtr dst) +virSysinfoSystemIsEqual(virSysinfoSystemDef *src, + virSysinfoSystemDef *dst) { if (!src && !dst) return true; @@ -1622,8 +1622,8 @@ virSysinfoSystemIsEqual(virSysinfoSystemDefPtr src, } static bool -virSysinfoBaseBoardIsEqual(virSysinfoBaseBoardDefPtr src, - virSysinfoBaseBoardDefPtr dst) +virSysinfoBaseBoardIsEqual(virSysinfoBaseBoardDef *src, + virSysinfoBaseBoardDef *dst) { if (!src && !dst) return true; @@ -1646,8 +1646,8 @@ virSysinfoBaseBoardIsEqual(virSysinfoBaseBoardDefPtr src, static bool -virSysinfoChassisIsEqual(virSysinfoChassisDefPtr src, - virSysinfoChassisDefPtr dst) +virSysinfoChassisIsEqual(virSysinfoChassisDef *src, + virSysinfoChassisDef *dst) { if (!src && !dst) return true; @@ -1670,8 +1670,8 @@ virSysinfoChassisIsEqual(virSysinfoChassisDefPtr src, #undef CHECK_FIELD -bool virSysinfoIsEqual(virSysinfoDefPtr src, - virSysinfoDefPtr dst) +bool virSysinfoIsEqual(virSysinfoDef *src, + virSysinfoDef *dst) { size_t i; diff --git a/src/util/virsysinfo.h b/src/util/virsysinfo.h index 6ae4ba7bf3..97e0e18ddf 100644 --- a/src/util/virsysinfo.h +++ b/src/util/virsysinfo.h @@ -33,7 +33,6 @@ typedef enum { } virSysinfoType; typedef struct _virSysinfoProcessorDef virSysinfoProcessorDef; -typedef virSysinfoProcessorDef *virSysinfoProcessorDefPtr; struct _virSysinfoProcessorDef { char *processor_socket_destination; char *processor_type; @@ -49,7 +48,6 @@ struct _virSysinfoProcessorDef { }; typedef struct _virSysinfoMemoryDef virSysinfoMemoryDef; -typedef virSysinfoMemoryDef *virSysinfoMemoryDefPtr; struct _virSysinfoMemoryDef { char *memory_size; char *memory_form_factor; @@ -64,7 +62,6 @@ struct _virSysinfoMemoryDef { }; typedef struct _virSysinfoBIOSDef virSysinfoBIOSDef; -typedef virSysinfoBIOSDef *virSysinfoBIOSDefPtr; struct _virSysinfoBIOSDef { char *vendor; char *version; @@ -73,7 +70,6 @@ struct _virSysinfoBIOSDef { }; typedef struct _virSysinfoSystemDef virSysinfoSystemDef; -typedef virSysinfoSystemDef *virSysinfoSystemDefPtr; struct _virSysinfoSystemDef { char *manufacturer; char *product; @@ -85,7 +81,6 @@ struct _virSysinfoSystemDef { }; typedef struct _virSysinfoBaseBoardDef virSysinfoBaseBoardDef; -typedef virSysinfoBaseBoardDef *virSysinfoBaseBoardDefPtr; struct _virSysinfoBaseBoardDef { char *manufacturer; char *product; @@ -97,7 +92,6 @@ struct _virSysinfoBaseBoardDef { }; typedef struct _virSysinfoChassisDef virSysinfoChassisDef; -typedef virSysinfoChassisDef *virSysinfoChassisDefPtr; struct _virSysinfoChassisDef { char *manufacturer; char *version; @@ -107,14 +101,12 @@ struct _virSysinfoChassisDef { }; typedef struct _virSysinfoOEMStringsDef virSysinfoOEMStringsDef; -typedef virSysinfoOEMStringsDef *virSysinfoOEMStringsDefPtr; struct _virSysinfoOEMStringsDef { size_t nvalues; char **values; }; typedef struct _virSysinfoFWCfgDef virSysinfoFWCfgDef; -typedef virSysinfoFWCfgDef *virSysinfoFWCfgDefPtr; struct _virSysinfoFWCfgDef { char *name; char *value; @@ -122,47 +114,46 @@ struct _virSysinfoFWCfgDef { }; typedef struct _virSysinfoDef virSysinfoDef; -typedef virSysinfoDef *virSysinfoDefPtr; struct _virSysinfoDef { virSysinfoType type; /* The following members are valid for type == VIR_SYSINFO_SMBIOS */ - virSysinfoBIOSDefPtr bios; - virSysinfoSystemDefPtr system; + virSysinfoBIOSDef *bios; + virSysinfoSystemDef *system; size_t nbaseBoard; - virSysinfoBaseBoardDefPtr baseBoard; + virSysinfoBaseBoardDef *baseBoard; - virSysinfoChassisDefPtr chassis; + virSysinfoChassisDef *chassis; size_t nprocessor; - virSysinfoProcessorDefPtr processor; + virSysinfoProcessorDef *processor; size_t nmemory; - virSysinfoMemoryDefPtr memory; + virSysinfoMemoryDef *memory; - virSysinfoOEMStringsDefPtr oemStrings; + virSysinfoOEMStringsDef *oemStrings; /* The following members are valid for type == VIR_SYSINFO_FWCFG */ size_t nfw_cfgs; - virSysinfoFWCfgDefPtr fw_cfgs; + virSysinfoFWCfgDef *fw_cfgs; }; -virSysinfoDefPtr virSysinfoRead(void); +virSysinfoDef *virSysinfoRead(void); -void virSysinfoBIOSDefFree(virSysinfoBIOSDefPtr def); -void virSysinfoSystemDefFree(virSysinfoSystemDefPtr def); -void virSysinfoBaseBoardDefClear(virSysinfoBaseBoardDefPtr def); -void virSysinfoChassisDefFree(virSysinfoChassisDefPtr def); -void virSysinfoOEMStringsDefFree(virSysinfoOEMStringsDefPtr def); -void virSysinfoDefFree(virSysinfoDefPtr def); +void virSysinfoBIOSDefFree(virSysinfoBIOSDef *def); +void virSysinfoSystemDefFree(virSysinfoSystemDef *def); +void virSysinfoBaseBoardDefClear(virSysinfoBaseBoardDef *def); +void virSysinfoChassisDefFree(virSysinfoChassisDef *def); +void virSysinfoOEMStringsDefFree(virSysinfoOEMStringsDef *def); +void virSysinfoDefFree(virSysinfoDef *def); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSysinfoDef, virSysinfoDefFree); -int virSysinfoFormat(virBufferPtr buf, virSysinfoDefPtr def) +int virSysinfoFormat(virBuffer *buf, virSysinfoDef *def) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); -bool virSysinfoIsEqual(virSysinfoDefPtr src, - virSysinfoDefPtr dst); +bool virSysinfoIsEqual(virSysinfoDef *src, + virSysinfoDef *dst); VIR_ENUM_DECL(virSysinfo); diff --git a/src/util/virsysinfopriv.h b/src/util/virsysinfopriv.h index d6c558a32d..e47bd3c361 100644 --- a/src/util/virsysinfopriv.h +++ b/src/util/virsysinfopriv.h @@ -27,14 +27,14 @@ void virSysinfoSetup(const char *sysinfo, const char *cpuinfo); -virSysinfoDefPtr +virSysinfoDef * virSysinfoReadPPC(void); -virSysinfoDefPtr +virSysinfoDef * virSysinfoReadARM(void); -virSysinfoDefPtr +virSysinfoDef * virSysinfoReadS390(void); -virSysinfoDefPtr +virSysinfoDef * virSysinfoReadDMI(void); diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 718d24dfc5..96f81cd3fa 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -49,14 +49,12 @@ struct _virSystemdActivation { }; typedef struct _virSystemdActivationEntry virSystemdActivationEntry; -typedef virSystemdActivationEntry *virSystemdActivationEntryPtr; - struct _virSystemdActivationEntry { int *fds; size_t nfds; }; -static void virSystemdEscapeName(virBufferPtr buf, +static void virSystemdEscapeName(virBuffer *buf, const char *name) { static const char hextable[16] = "0123456789abcdef"; @@ -703,7 +701,7 @@ int virSystemdCanHybridSleep(bool *result) static void virSystemdActivationEntryFree(void *data) { - virSystemdActivationEntryPtr ent = data; + virSystemdActivationEntry *ent = data; size_t i; VIR_DEBUG("Closing activation FDs"); @@ -718,11 +716,11 @@ virSystemdActivationEntryFree(void *data) static int -virSystemdActivationAddFD(virSystemdActivationPtr act, +virSystemdActivationAddFD(virSystemdActivation *act, const char *name, int fd) { - virSystemdActivationEntryPtr ent = virHashLookup(act->fds, name); + virSystemdActivationEntry *ent = virHashLookup(act->fds, name); if (!ent) { ent = g_new0(virSystemdActivationEntry, 1); @@ -748,7 +746,7 @@ virSystemdActivationAddFD(virSystemdActivationPtr act, static int -virSystemdActivationInitFromNames(virSystemdActivationPtr act, +virSystemdActivationInitFromNames(virSystemdActivation *act, int nfds, const char *fdnames) { @@ -795,7 +793,7 @@ virSystemdActivationInitFromNames(virSystemdActivationPtr act, * Delete when min systemd is increased ie RHEL7 dropped */ static int -virSystemdActivationInitFromMap(virSystemdActivationPtr act, +virSystemdActivationInitFromMap(virSystemdActivation *act, int nfds, virSystemdActivationMap *map, size_t nmap) @@ -955,12 +953,12 @@ virSystemdGetListenFDs(void) #endif /* WIN32 */ -static virSystemdActivationPtr +static virSystemdActivation * virSystemdActivationNew(virSystemdActivationMap *map, size_t nmap, int nfds) { - virSystemdActivationPtr act; + virSystemdActivation *act; const char *fdnames; VIR_DEBUG("Activated with %d FDs", nfds); @@ -1005,7 +1003,7 @@ virSystemdActivationNew(virSystemdActivationMap *map, int virSystemdGetActivation(virSystemdActivationMap *map, size_t nmap, - virSystemdActivationPtr *act) + virSystemdActivation **act) { int nfds = 0; @@ -1034,7 +1032,7 @@ virSystemdGetActivation(virSystemdActivationMap *map, * Returns: true if a FD is present, false otherwise */ bool -virSystemdActivationHasName(virSystemdActivationPtr act, +virSystemdActivationHasName(virSystemdActivation *act, const char *name) { return virHashLookup(act->fds, name) != NULL; @@ -1053,7 +1051,7 @@ virSystemdActivationHasName(virSystemdActivationPtr act, * Returns: 0 on success, -1 if some FDs are unclaimed */ int -virSystemdActivationComplete(virSystemdActivationPtr act) +virSystemdActivationComplete(virSystemdActivation *act) { if (virHashSize(act->fds) != 0) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -1081,12 +1079,12 @@ virSystemdActivationComplete(virSystemdActivationPtr act) * the array memory in @fds. */ void -virSystemdActivationClaimFDs(virSystemdActivationPtr act, +virSystemdActivationClaimFDs(virSystemdActivation *act, const char *name, int **fds, size_t *nfds) { - virSystemdActivationEntryPtr ent = virHashSteal(act->fds, name); + virSystemdActivationEntry *ent = virHashSteal(act->fds, name); if (!ent) { *fds = NULL; @@ -1111,7 +1109,7 @@ virSystemdActivationClaimFDs(virSystemdActivationPtr act, * associated with the activation object */ void -virSystemdActivationFree(virSystemdActivationPtr act) +virSystemdActivationFree(virSystemdActivation *act) { if (!act) return; diff --git a/src/util/virsystemd.h b/src/util/virsystemd.h index cd329c49f9..93320e40b9 100644 --- a/src/util/virsystemd.h +++ b/src/util/virsystemd.h @@ -24,7 +24,6 @@ #include "internal.h" typedef struct _virSystemdActivation virSystemdActivation; -typedef virSystemdActivation *virSystemdActivationPtr; /* * Back compat for systemd < v227 which lacks LISTEN_FDNAMES. @@ -73,18 +72,18 @@ char *virSystemdGetMachineUnitByPID(pid_t pid); int virSystemdGetActivation(virSystemdActivationMap *map, size_t nmap, - virSystemdActivationPtr *act); + virSystemdActivation **act); -bool virSystemdActivationHasName(virSystemdActivationPtr act, +bool virSystemdActivationHasName(virSystemdActivation *act, const char *name); -int virSystemdActivationComplete(virSystemdActivationPtr act); +int virSystemdActivationComplete(virSystemdActivation *act); -void virSystemdActivationClaimFDs(virSystemdActivationPtr act, +void virSystemdActivationClaimFDs(virSystemdActivation *act, const char *name, int **fds, size_t *nfds); -void virSystemdActivationFree(virSystemdActivationPtr act); +void virSystemdActivationFree(virSystemdActivation *act); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virSystemdActivation, virSystemdActivationFree); diff --git a/src/util/virthread.c b/src/util/virthread.c index 814f5313aa..5ddbf7c49a 100644 --- a/src/util/virthread.c +++ b/src/util/virthread.c @@ -37,13 +37,13 @@ #include "virthreadjob.h" -int virOnce(virOnceControlPtr once, virOnceFunc init) +int virOnce(virOnceControl *once, virOnceFunc init) { return pthread_once(&once->once, init); } -int virMutexInit(virMutexPtr m) +int virMutexInit(virMutex *m) { int ret; pthread_mutexattr_t attr; @@ -58,7 +58,7 @@ int virMutexInit(virMutexPtr m) return 0; } -int virMutexInitRecursive(virMutexPtr m) +int virMutexInitRecursive(virMutex *m) { int ret; pthread_mutexattr_t attr; @@ -73,23 +73,23 @@ int virMutexInitRecursive(virMutexPtr m) return 0; } -void virMutexDestroy(virMutexPtr m) +void virMutexDestroy(virMutex *m) { pthread_mutex_destroy(&m->lock); } -void virMutexLock(virMutexPtr m) +void virMutexLock(virMutex *m) { pthread_mutex_lock(&m->lock); } -void virMutexUnlock(virMutexPtr m) +void virMutexUnlock(virMutex *m) { pthread_mutex_unlock(&m->lock); } -int virRWLockInit(virRWLockPtr m) +int virRWLockInit(virRWLock *m) { int ret; ret = pthread_rwlock_init(&m->lock, NULL); @@ -100,29 +100,29 @@ int virRWLockInit(virRWLockPtr m) return 0; } -void virRWLockDestroy(virRWLockPtr m) +void virRWLockDestroy(virRWLock *m) { pthread_rwlock_destroy(&m->lock); } -void virRWLockRead(virRWLockPtr m) +void virRWLockRead(virRWLock *m) { pthread_rwlock_rdlock(&m->lock); } -void virRWLockWrite(virRWLockPtr m) +void virRWLockWrite(virRWLock *m) { pthread_rwlock_wrlock(&m->lock); } -void virRWLockUnlock(virRWLockPtr m) +void virRWLockUnlock(virRWLock *m) { pthread_rwlock_unlock(&m->lock); } -int virCondInit(virCondPtr c) +int virCondInit(virCond *c) { int ret; if ((ret = pthread_cond_init(&c->cond, NULL)) != 0) { @@ -132,7 +132,7 @@ int virCondInit(virCondPtr c) return 0; } -int virCondDestroy(virCondPtr c) +int virCondDestroy(virCond *c) { int ret; if ((ret = pthread_cond_destroy(&c->cond)) != 0) { @@ -142,7 +142,7 @@ int virCondDestroy(virCondPtr c) return 0; } -int virCondWait(virCondPtr c, virMutexPtr m) +int virCondWait(virCond *c, virMutex *m) { int ret; if ((ret = pthread_cond_wait(&c->cond, &m->lock)) != 0) { @@ -152,7 +152,7 @@ int virCondWait(virCondPtr c, virMutexPtr m) return 0; } -int virCondWaitUntil(virCondPtr c, virMutexPtr m, unsigned long long whenms) +int virCondWaitUntil(virCond *c, virMutex *m, unsigned long long whenms) { int ret; struct timespec ts; @@ -167,12 +167,12 @@ int virCondWaitUntil(virCondPtr c, virMutexPtr m, unsigned long long whenms) return 0; } -void virCondSignal(virCondPtr c) +void virCondSignal(virCond *c) { pthread_cond_signal(&c->cond); } -void virCondBroadcast(virCondPtr c) +void virCondBroadcast(virCond *c) { pthread_cond_broadcast(&c->cond); } @@ -239,7 +239,7 @@ static void *virThreadHelper(void *data) return NULL; } -int virThreadCreateFull(virThreadPtr thread, +int virThreadCreateFull(virThread *thread, bool joinable, virThreadFunc func, const char *name, @@ -279,12 +279,12 @@ int virThreadCreateFull(virThreadPtr thread, return ret; } -void virThreadSelf(virThreadPtr thread) +void virThreadSelf(virThread *thread) { thread->thread = pthread_self(); } -bool virThreadIsSelf(virThreadPtr thread) +bool virThreadIsSelf(virThread *thread) { return pthread_equal(pthread_self(), thread->thread) ? true : false; } @@ -310,7 +310,7 @@ unsigned long long virThreadSelfID(void) /* For debugging use only; this result is not guaranteed unique if * pthread_t is larger than a 64-bit pointer, nor does it always match * the thread id of virThreadSelfID on Linux. */ -unsigned long long virThreadID(virThreadPtr thread) +unsigned long long virThreadID(virThread *thread) { union { unsigned long long l; @@ -320,17 +320,17 @@ unsigned long long virThreadID(virThreadPtr thread) return u.l; } -void virThreadJoin(virThreadPtr thread) +void virThreadJoin(virThread *thread) { pthread_join(thread->thread, NULL); } -void virThreadCancel(virThreadPtr thread) +void virThreadCancel(virThread *thread) { pthread_cancel(thread->thread); } -int virThreadLocalInit(virThreadLocalPtr l, +int virThreadLocalInit(virThreadLocal *l, virThreadLocalCleanup c) { int ret; @@ -341,12 +341,12 @@ int virThreadLocalInit(virThreadLocalPtr l, return 0; } -void *virThreadLocalGet(virThreadLocalPtr l) +void *virThreadLocalGet(virThreadLocal *l) { return pthread_getspecific(l->key); } -int virThreadLocalSet(virThreadLocalPtr l, void *val) +int virThreadLocalSet(virThreadLocal *l, void *val) { int err = pthread_setspecific(l->key, val); if (err) { diff --git a/src/util/virthread.h b/src/util/virthread.h index c227951ddd..55c8263ae6 100644 --- a/src/util/virthread.h +++ b/src/util/virthread.h @@ -27,44 +27,32 @@ #include typedef struct virMutex virMutex; -typedef virMutex *virMutexPtr; - struct virMutex { pthread_mutex_t lock; }; typedef struct virRWLock virRWLock; -typedef virRWLock *virRWLockPtr; - struct virRWLock { pthread_rwlock_t lock; }; typedef struct virCond virCond; -typedef virCond *virCondPtr; - struct virCond { pthread_cond_t cond; }; typedef struct virThreadLocal virThreadLocal; -typedef virThreadLocal *virThreadLocalPtr; - struct virThreadLocal { pthread_key_t key; }; typedef struct virThread virThread; -typedef virThread *virThreadPtr; - struct virThread { pthread_t thread; }; typedef struct virOnceControl virOnceControl; -typedef virOnceControl *virOnceControlPtr; - struct virOnceControl { pthread_once_t once; }; @@ -87,28 +75,28 @@ typedef void (*virThreadFunc)(void *opaque); #define virThreadCreate(thread, joinable, func, opaque) \ virThreadCreateFull(thread, joinable, func, #func, false, opaque) -int virThreadCreateFull(virThreadPtr thread, +int virThreadCreateFull(virThread *thread, bool joinable, virThreadFunc func, const char *name, bool worker, void *opaque) G_GNUC_WARN_UNUSED_RESULT; -void virThreadSelf(virThreadPtr thread); -bool virThreadIsSelf(virThreadPtr thread); -void virThreadJoin(virThreadPtr thread); +void virThreadSelf(virThread *thread); +bool virThreadIsSelf(virThread *thread); +void virThreadJoin(virThread *thread); size_t virThreadMaxName(void); /* This API is *NOT* for general use. It exists solely as a stub * for integration with libselinux AVC callbacks */ -void virThreadCancel(virThreadPtr thread); +void virThreadCancel(virThread *thread); /* These next two functions are for debugging only, since they are not * guaranteed to give unique values for distinct threads on all * architectures, nor are the two functions guaranteed to give the same * value for the same thread. */ unsigned long long virThreadSelfID(void); -unsigned long long virThreadID(virThreadPtr thread); +unsigned long long virThreadID(virThread *thread); /* Static initialization of mutexes is not possible, so we instead * provide for guaranteed one-time initialization via a callback @@ -122,45 +110,45 @@ unsigned long long virThreadID(virThreadPtr thread); * ...now guaranteed that initializer has completed exactly once * } */ -int virOnce(virOnceControlPtr once, virOnceFunc init) +int virOnce(virOnceControl *once, virOnceFunc init) ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) G_GNUC_WARN_UNUSED_RESULT; -int virMutexInit(virMutexPtr m) G_GNUC_WARN_UNUSED_RESULT; -int virMutexInitRecursive(virMutexPtr m) G_GNUC_WARN_UNUSED_RESULT; -void virMutexDestroy(virMutexPtr m); +int virMutexInit(virMutex *m) G_GNUC_WARN_UNUSED_RESULT; +int virMutexInitRecursive(virMutex *m) G_GNUC_WARN_UNUSED_RESULT; +void virMutexDestroy(virMutex *m); -void virMutexLock(virMutexPtr m); -void virMutexUnlock(virMutexPtr m); +void virMutexLock(virMutex *m); +void virMutexUnlock(virMutex *m); -int virRWLockInit(virRWLockPtr m) G_GNUC_WARN_UNUSED_RESULT; -void virRWLockDestroy(virRWLockPtr m); +int virRWLockInit(virRWLock *m) G_GNUC_WARN_UNUSED_RESULT; +void virRWLockDestroy(virRWLock *m); -void virRWLockRead(virRWLockPtr m); -void virRWLockWrite(virRWLockPtr m); -void virRWLockUnlock(virRWLockPtr m); +void virRWLockRead(virRWLock *m); +void virRWLockWrite(virRWLock *m); +void virRWLockUnlock(virRWLock *m); -int virCondInit(virCondPtr c) G_GNUC_WARN_UNUSED_RESULT; -int virCondDestroy(virCondPtr c); +int virCondInit(virCond *c) G_GNUC_WARN_UNUSED_RESULT; +int virCondDestroy(virCond *c); /* virCondWait, virCondWaitUntil: * These functions can return without the associated predicate * changing value. Therefore in nearly all cases they * should be enclosed in a while loop that checks the predicate. */ -int virCondWait(virCondPtr c, virMutexPtr m) G_GNUC_WARN_UNUSED_RESULT; -int virCondWaitUntil(virCondPtr c, virMutexPtr m, unsigned long long whenms) G_GNUC_WARN_UNUSED_RESULT; +int virCondWait(virCond *c, virMutex *m) G_GNUC_WARN_UNUSED_RESULT; +int virCondWaitUntil(virCond *c, virMutex *m, unsigned long long whenms) G_GNUC_WARN_UNUSED_RESULT; -void virCondSignal(virCondPtr c); -void virCondBroadcast(virCondPtr c); +void virCondSignal(virCond *c); +void virCondBroadcast(virCond *c); typedef void (*virThreadLocalCleanup)(void *); -int virThreadLocalInit(virThreadLocalPtr l, +int virThreadLocalInit(virThreadLocal *l, virThreadLocalCleanup c) G_GNUC_WARN_UNUSED_RESULT; -void *virThreadLocalGet(virThreadLocalPtr l); -int virThreadLocalSet(virThreadLocalPtr l, void*) G_GNUC_WARN_UNUSED_RESULT; +void *virThreadLocalGet(virThreadLocal *l); +int virThreadLocalSet(virThreadLocal *l, void*) G_GNUC_WARN_UNUSED_RESULT; /** diff --git a/src/util/virthreadpool.c b/src/util/virthreadpool.c index 42549c4892..9ddd86a679 100644 --- a/src/util/virthreadpool.c +++ b/src/util/virthreadpool.c @@ -30,23 +30,19 @@ #define VIR_FROM_THIS VIR_FROM_NONE typedef struct _virThreadPoolJob virThreadPoolJob; -typedef virThreadPoolJob *virThreadPoolJobPtr; - struct _virThreadPoolJob { - virThreadPoolJobPtr prev; - virThreadPoolJobPtr next; + virThreadPoolJob *prev; + virThreadPoolJob *next; unsigned int priority; void *data; }; typedef struct _virThreadPoolJobList virThreadPoolJobList; -typedef virThreadPoolJobList *virThreadPoolJobListPtr; - struct _virThreadPoolJobList { - virThreadPoolJobPtr head; - virThreadPoolJobPtr tail; - virThreadPoolJobPtr firstPrio; + virThreadPoolJob *head; + virThreadPoolJob *tail; + virThreadPoolJob *firstPrio; }; @@ -67,17 +63,17 @@ struct _virThreadPool { size_t minWorkers; size_t freeWorkers; size_t nWorkers; - virThreadPtr workers; + virThread *workers; size_t maxPrioWorkers; size_t nPrioWorkers; - virThreadPtr prioWorkers; + virThread *prioWorkers; virCond prioCond; }; struct virThreadPoolWorkerData { - virThreadPoolPtr pool; - virCondPtr cond; + virThreadPool *pool; + virCond *cond; bool priority; }; @@ -92,12 +88,12 @@ static inline bool virThreadPoolWorkerQuitHelper(size_t count, size_t limit) static void virThreadPoolWorker(void *opaque) { struct virThreadPoolWorkerData *data = opaque; - virThreadPoolPtr pool = data->pool; - virCondPtr cond = data->cond; + virThreadPool *pool = data->pool; + virCond *cond = data->cond; bool priority = data->priority; size_t *curWorkers = priority ? &pool->nPrioWorkers : &pool->nWorkers; size_t *maxLimit = priority ? &pool->maxPrioWorkers : &pool->maxWorkers; - virThreadPoolJobPtr job = NULL; + virThreadPoolJob *job = NULL; VIR_FREE(data); @@ -139,7 +135,7 @@ static void virThreadPoolWorker(void *opaque) } if (job == pool->jobList.firstPrio) { - virThreadPoolJobPtr tmp = job->next; + virThreadPoolJob *tmp = job->next; while (tmp) { if (tmp->priority) break; @@ -176,9 +172,9 @@ static void virThreadPoolWorker(void *opaque) } static int -virThreadPoolExpand(virThreadPoolPtr pool, size_t gain, bool priority) +virThreadPoolExpand(virThreadPool *pool, size_t gain, bool priority) { - virThreadPtr *workers = priority ? &pool->prioWorkers : &pool->workers; + virThread **workers = priority ? &pool->prioWorkers : &pool->workers; size_t *curWorkers = priority ? &pool->nPrioWorkers : &pool->nWorkers; size_t i = 0; struct virThreadPoolWorkerData *data = NULL; @@ -217,7 +213,7 @@ virThreadPoolExpand(virThreadPoolPtr pool, size_t gain, bool priority) return -1; } -virThreadPoolPtr +virThreadPool * virThreadPoolNewFull(size_t minWorkers, size_t maxWorkers, size_t prioWorkers, @@ -225,7 +221,7 @@ virThreadPoolNewFull(size_t minWorkers, const char *name, void *opaque) { - virThreadPoolPtr pool; + virThreadPool *pool; if (minWorkers > maxWorkers) minWorkers = maxWorkers; @@ -267,7 +263,7 @@ virThreadPoolNewFull(size_t minWorkers, static void -virThreadPoolStopLocked(virThreadPoolPtr pool) +virThreadPoolStopLocked(virThreadPool *pool) { if (pool->quit) return; @@ -281,9 +277,9 @@ virThreadPoolStopLocked(virThreadPoolPtr pool) static void -virThreadPoolDrainLocked(virThreadPoolPtr pool) +virThreadPoolDrainLocked(virThreadPool *pool) { - virThreadPoolJobPtr job; + virThreadPoolJob *job; virThreadPoolStopLocked(pool); @@ -296,7 +292,7 @@ virThreadPoolDrainLocked(virThreadPoolPtr pool) } } -void virThreadPoolFree(virThreadPoolPtr pool) +void virThreadPoolFree(virThreadPool *pool) { if (!pool) return; @@ -315,7 +311,7 @@ void virThreadPoolFree(virThreadPoolPtr pool) } -size_t virThreadPoolGetMinWorkers(virThreadPoolPtr pool) +size_t virThreadPoolGetMinWorkers(virThreadPool *pool) { size_t ret; @@ -326,7 +322,7 @@ size_t virThreadPoolGetMinWorkers(virThreadPoolPtr pool) return ret; } -size_t virThreadPoolGetMaxWorkers(virThreadPoolPtr pool) +size_t virThreadPoolGetMaxWorkers(virThreadPool *pool) { size_t ret; @@ -337,7 +333,7 @@ size_t virThreadPoolGetMaxWorkers(virThreadPoolPtr pool) return ret; } -size_t virThreadPoolGetPriorityWorkers(virThreadPoolPtr pool) +size_t virThreadPoolGetPriorityWorkers(virThreadPool *pool) { size_t ret; @@ -348,7 +344,7 @@ size_t virThreadPoolGetPriorityWorkers(virThreadPoolPtr pool) return ret; } -size_t virThreadPoolGetCurrentWorkers(virThreadPoolPtr pool) +size_t virThreadPoolGetCurrentWorkers(virThreadPool *pool) { size_t ret; @@ -359,7 +355,7 @@ size_t virThreadPoolGetCurrentWorkers(virThreadPoolPtr pool) return ret; } -size_t virThreadPoolGetFreeWorkers(virThreadPoolPtr pool) +size_t virThreadPoolGetFreeWorkers(virThreadPool *pool) { size_t ret; @@ -370,7 +366,7 @@ size_t virThreadPoolGetFreeWorkers(virThreadPoolPtr pool) return ret; } -size_t virThreadPoolGetJobQueueDepth(virThreadPoolPtr pool) +size_t virThreadPoolGetJobQueueDepth(virThreadPool *pool) { size_t ret; @@ -385,11 +381,11 @@ size_t virThreadPoolGetJobQueueDepth(virThreadPoolPtr pool) * @priority - job priority * Return: 0 on success, -1 otherwise */ -int virThreadPoolSendJob(virThreadPoolPtr pool, +int virThreadPoolSendJob(virThreadPool *pool, unsigned int priority, void *jobData) { - virThreadPoolJobPtr job; + virThreadPoolJob *job; virMutexLock(&pool->mutex); if (pool->quit) @@ -431,7 +427,7 @@ int virThreadPoolSendJob(virThreadPoolPtr pool, } int -virThreadPoolSetParameters(virThreadPoolPtr pool, +virThreadPoolSetParameters(virThreadPool *pool, long long int minWorkers, long long int maxWorkers, long long int prioWorkers) @@ -490,7 +486,7 @@ virThreadPoolSetParameters(virThreadPoolPtr pool, } void -virThreadPoolStop(virThreadPoolPtr pool) +virThreadPoolStop(virThreadPool *pool) { virMutexLock(&pool->mutex); virThreadPoolStopLocked(pool); @@ -498,7 +494,7 @@ virThreadPoolStop(virThreadPoolPtr pool) } void -virThreadPoolDrain(virThreadPoolPtr pool) +virThreadPoolDrain(virThreadPool *pool) { virMutexLock(&pool->mutex); virThreadPoolDrainLocked(pool); diff --git a/src/util/virthreadpool.h b/src/util/virthreadpool.h index cb800dc616..619d128e9a 100644 --- a/src/util/virthreadpool.h +++ b/src/util/virthreadpool.h @@ -24,35 +24,34 @@ #include "internal.h" typedef struct _virThreadPool virThreadPool; -typedef virThreadPool *virThreadPoolPtr; typedef void (*virThreadPoolJobFunc)(void *jobdata, void *opaque); -virThreadPoolPtr virThreadPoolNewFull(size_t minWorkers, +virThreadPool *virThreadPoolNewFull(size_t minWorkers, size_t maxWorkers, size_t prioWorkers, virThreadPoolJobFunc func, const char *name, void *opaque) ATTRIBUTE_NONNULL(4); -size_t virThreadPoolGetMinWorkers(virThreadPoolPtr pool); -size_t virThreadPoolGetMaxWorkers(virThreadPoolPtr pool); -size_t virThreadPoolGetPriorityWorkers(virThreadPoolPtr pool); -size_t virThreadPoolGetCurrentWorkers(virThreadPoolPtr pool); -size_t virThreadPoolGetFreeWorkers(virThreadPoolPtr pool); -size_t virThreadPoolGetJobQueueDepth(virThreadPoolPtr pool); +size_t virThreadPoolGetMinWorkers(virThreadPool *pool); +size_t virThreadPoolGetMaxWorkers(virThreadPool *pool); +size_t virThreadPoolGetPriorityWorkers(virThreadPool *pool); +size_t virThreadPoolGetCurrentWorkers(virThreadPool *pool); +size_t virThreadPoolGetFreeWorkers(virThreadPool *pool); +size_t virThreadPoolGetJobQueueDepth(virThreadPool *pool); -void virThreadPoolFree(virThreadPoolPtr pool); +void virThreadPoolFree(virThreadPool *pool); -int virThreadPoolSendJob(virThreadPoolPtr pool, +int virThreadPoolSendJob(virThreadPool *pool, unsigned int priority, void *jobdata) ATTRIBUTE_NONNULL(1) G_GNUC_WARN_UNUSED_RESULT; -int virThreadPoolSetParameters(virThreadPoolPtr pool, +int virThreadPoolSetParameters(virThreadPool *pool, long long int minWorkers, long long int maxWorkers, long long int prioWorkers); -void virThreadPoolStop(virThreadPoolPtr pool); -void virThreadPoolDrain(virThreadPoolPtr pool); +void virThreadPoolStop(virThreadPool *pool); +void virThreadPoolDrain(virThreadPool *pool); diff --git a/src/util/virtpm.c b/src/util/virtpm.c index 128ca0c579..1a567139b4 100644 --- a/src/util/virtpm.c +++ b/src/util/virtpm.c @@ -95,11 +95,11 @@ virTPMCreateCancelPath(const char *devpath) static virMutex swtpm_tools_lock = VIR_MUTEX_INITIALIZER; static char *swtpm_path; static struct stat swtpm_stat; -static virBitmapPtr swtpm_caps; +static virBitmap *swtpm_caps; static char *swtpm_setup; static struct stat swtpm_setup_stat; -static virBitmapPtr swtpm_setup_caps; +static virBitmap *swtpm_setup_caps; static char *swtpm_ioctl; static struct stat swtpm_ioctl_stat; @@ -166,16 +166,16 @@ virTPMGetSwtpmIoctl(void) * ] * } */ -static virBitmapPtr -virTPMExecGetCaps(virCommandPtr cmd, +static virBitmap * +virTPMExecGetCaps(virCommand *cmd, TypeFromStringFn typeFromStringFn) { int exitstatus; - virBitmapPtr bitmap; + virBitmap *bitmap; g_autofree char *outbuf = NULL; g_autoptr(virJSONValue) json = NULL; - virJSONValuePtr featureList; - virJSONValuePtr item; + virJSONValue *featureList; + virJSONValue *item; size_t idx; const char *str; int typ; @@ -227,7 +227,7 @@ virTPMExecGetCaps(virCommandPtr cmd, return bitmap; } -static virBitmapPtr +static virBitmap * virTPMGetCaps(TypeFromStringFn typeFromStringFn, const char *exec, const char *param1) { @@ -259,7 +259,7 @@ virTPMEmulatorInit(void) char **path; struct stat *stat; const char *parm; - virBitmapPtr *caps; + virBitmap **caps; TypeFromStringFn typeFromStringFn; } prgs[] = { { diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c index 018d504433..aa6a871049 100644 --- a/src/util/virtypedparam.c +++ b/src/util/virtypedparam.c @@ -474,7 +474,7 @@ virTypedParamsGetStringList(virTypedParameterPtr params, * Returns nothing. */ void -virTypedParamsRemoteFree(virTypedParameterRemotePtr remote_params_val, +virTypedParamsRemoteFree(struct _virTypedParameterRemote *remote_params_val, unsigned int remote_params_len) { size_t i; @@ -519,7 +519,7 @@ virTypedParamsRemoteFree(virTypedParameterRemotePtr remote_params_val, * Returns 0 on success or -1 in case of an error. */ int -virTypedParamsDeserialize(virTypedParameterRemotePtr remote_params, +virTypedParamsDeserialize(struct _virTypedParameterRemote *remote_params, unsigned int remote_params_len, int limit, virTypedParameterPtr *params, @@ -552,7 +552,7 @@ virTypedParamsDeserialize(virTypedParameterRemotePtr remote_params, /* Deserialize the result. */ for (i = 0; i < remote_params_len; ++i) { virTypedParameterPtr param = *params + i; - virTypedParameterRemotePtr remote_param = remote_params + i; + struct _virTypedParameterRemote *remote_param = remote_params + i; if (virStrcpyStatic(param->field, remote_param->field) < 0) { @@ -638,14 +638,14 @@ int virTypedParamsSerialize(virTypedParameterPtr params, int nparams, int limit, - virTypedParameterRemotePtr *remote_params_val, + struct _virTypedParameterRemote **remote_params_val, unsigned int *remote_params_len, unsigned int flags) { size_t i; size_t j; int rv = -1; - virTypedParameterRemotePtr params_val = NULL; + struct _virTypedParameterRemote *params_val = NULL; int params_len = nparams; if (nparams > limit) { @@ -659,7 +659,7 @@ virTypedParamsSerialize(virTypedParameterPtr params, for (i = 0, j = 0; i < nparams; ++i) { virTypedParameterPtr param = params + i; - virTypedParameterRemotePtr val = params_val + j; + struct _virTypedParameterRemote *val = params_val + j; /* NOTE: Following snippet is relevant to server only, because * virDomainGetCPUStats can return a sparse array; also, we can't pass * back strings to older clients. */ @@ -715,7 +715,7 @@ virTypedParamsSerialize(virTypedParameterPtr params, void -virTypedParamListFree(virTypedParamListPtr list) +virTypedParamListFree(virTypedParamList *list) { if (!list) return; @@ -726,7 +726,7 @@ virTypedParamListFree(virTypedParamListPtr list) size_t -virTypedParamListStealParams(virTypedParamListPtr list, +virTypedParamListStealParams(virTypedParamList *list, virTypedParameterPtr *params) { size_t ret = list->npar; @@ -754,7 +754,7 @@ virTypedParamSetNameVPrintf(virTypedParameterPtr par, static virTypedParameterPtr -virTypedParamListExtend(virTypedParamListPtr list) +virTypedParamListExtend(virTypedParamList *list) { VIR_RESIZE_N(list->par, list->par_alloc, list->npar, 1); @@ -765,7 +765,7 @@ virTypedParamListExtend(virTypedParamListPtr list) int -virTypedParamListAddInt(virTypedParamListPtr list, +virTypedParamListAddInt(virTypedParamList *list, int value, const char *namefmt, ...) @@ -787,7 +787,7 @@ virTypedParamListAddInt(virTypedParamListPtr list, int -virTypedParamListAddUInt(virTypedParamListPtr list, +virTypedParamListAddUInt(virTypedParamList *list, unsigned int value, const char *namefmt, ...) @@ -809,7 +809,7 @@ virTypedParamListAddUInt(virTypedParamListPtr list, int -virTypedParamListAddLLong(virTypedParamListPtr list, +virTypedParamListAddLLong(virTypedParamList *list, long long value, const char *namefmt, ...) @@ -831,7 +831,7 @@ virTypedParamListAddLLong(virTypedParamListPtr list, int -virTypedParamListAddULLong(virTypedParamListPtr list, +virTypedParamListAddULLong(virTypedParamList *list, unsigned long long value, const char *namefmt, ...) @@ -853,7 +853,7 @@ virTypedParamListAddULLong(virTypedParamListPtr list, int -virTypedParamListAddString(virTypedParamListPtr list, +virTypedParamListAddString(virTypedParamList *list, const char *value, const char *namefmt, ...) @@ -875,7 +875,7 @@ virTypedParamListAddString(virTypedParamListPtr list, int -virTypedParamListAddBoolean(virTypedParamListPtr list, +virTypedParamListAddBoolean(virTypedParamList *list, bool value, const char *namefmt, ...) @@ -897,7 +897,7 @@ virTypedParamListAddBoolean(virTypedParamListPtr list, int -virTypedParamListAddDouble(virTypedParamListPtr list, +virTypedParamListAddDouble(virTypedParamList *list, double value, const char *namefmt, ...) diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h index 0a430924a7..f4b3921c38 100644 --- a/src/util/virtypedparam.h +++ b/src/util/virtypedparam.h @@ -35,8 +35,6 @@ G_STATIC_ASSERT(!(VIR_TYPED_PARAM_LAST & VIR_TYPED_PARAM_MULTIPLE)); typedef struct _virTypedParameterRemoteValue virTypedParameterRemoteValue; -typedef struct virTypedParameterRemoteValue *virTypedParameterRemoteValuePtr; - struct _virTypedParameterRemoteValue { int type; union { @@ -50,7 +48,6 @@ struct _virTypedParameterRemoteValue { } remote_typed_param_value; }; -typedef struct _virTypedParameterRemote *virTypedParameterRemotePtr; struct _virTypedParameterRemote { char *field; @@ -95,10 +92,10 @@ int virTypedParamsCopy(virTypedParameterPtr *dst, char *virTypedParameterToString(virTypedParameterPtr param); -void virTypedParamsRemoteFree(virTypedParameterRemotePtr remote_params_val, +void virTypedParamsRemoteFree(struct _virTypedParameterRemote *remote_params_val, unsigned int remote_params_len); -int virTypedParamsDeserialize(virTypedParameterRemotePtr remote_params, +int virTypedParamsDeserialize(struct _virTypedParameterRemote *remote_params, unsigned int remote_params_len, int limit, virTypedParameterPtr *params, @@ -107,7 +104,7 @@ int virTypedParamsDeserialize(virTypedParameterRemotePtr remote_params, int virTypedParamsSerialize(virTypedParameterPtr params, int nparams, int limit, - virTypedParameterRemotePtr *remote_params_val, + struct _virTypedParameterRemote **remote_params_val, unsigned int *remote_params_len, unsigned int flags); @@ -129,51 +126,49 @@ VIR_ENUM_DECL(virTypedParameter); } while (0) typedef struct _virTypedParamList virTypedParamList; -typedef virTypedParamList *virTypedParamListPtr; - struct _virTypedParamList { virTypedParameterPtr par; size_t npar; size_t par_alloc; }; -void virTypedParamListFree(virTypedParamListPtr list); +void virTypedParamListFree(virTypedParamList *list); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virTypedParamList, virTypedParamListFree); -size_t virTypedParamListStealParams(virTypedParamListPtr list, +size_t virTypedParamListStealParams(virTypedParamList *list, virTypedParameterPtr *params); -int virTypedParamListAddInt(virTypedParamListPtr list, +int virTypedParamListAddInt(virTypedParamList *list, int value, const char *namefmt, ...) G_GNUC_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; -int virTypedParamListAddUInt(virTypedParamListPtr list, +int virTypedParamListAddUInt(virTypedParamList *list, unsigned int value, const char *namefmt, ...) G_GNUC_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; -int virTypedParamListAddLLong(virTypedParamListPtr list, +int virTypedParamListAddLLong(virTypedParamList *list, long long value, const char *namefmt, ...) G_GNUC_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; -int virTypedParamListAddULLong(virTypedParamListPtr list, +int virTypedParamListAddULLong(virTypedParamList *list, unsigned long long value, const char *namefmt, ...) G_GNUC_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; -int virTypedParamListAddString(virTypedParamListPtr list, +int virTypedParamListAddString(virTypedParamList *list, const char *value, const char *namefmt, ...) G_GNUC_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; -int virTypedParamListAddBoolean(virTypedParamListPtr list, +int virTypedParamListAddBoolean(virTypedParamList *list, bool value, const char *namefmt, ...) G_GNUC_PRINTF(3, 4) G_GNUC_WARN_UNUSED_RESULT; -int virTypedParamListAddDouble(virTypedParamListPtr list, +int virTypedParamListAddDouble(virTypedParamList *list, double value, const char *namefmt, ...) diff --git a/src/util/viruri.c b/src/util/viruri.c index 90594fce5e..252e4f598e 100644 --- a/src/util/viruri.c +++ b/src/util/viruri.c @@ -35,7 +35,7 @@ VIR_LOG_INIT("util.uri"); static int -virURIParamAppend(virURIPtr uri, +virURIParamAppend(virURI *uri, const char *name, const char *value) { @@ -57,7 +57,7 @@ virURIParamAppend(virURIPtr uri, static int -virURIParseParams(virURIPtr uri) +virURIParseParams(virURI *uri) { const char *end, *eq; const char *query = uri->query; @@ -136,11 +136,11 @@ virURIParseParams(virURIPtr uri) * * @returns the parsed uri object with some fixes */ -virURIPtr +virURI * virURIParse(const char *uri) { xmlURIPtr xmluri; - virURIPtr ret = NULL; + virURI *ret = NULL; xmluri = xmlParseURI(uri); @@ -200,7 +200,7 @@ virURIParse(const char *uri) * @returns the constructed uri as a string */ char * -virURIFormat(virURIPtr uri) +virURIFormat(virURI *uri) { xmlURI xmluri; g_autofree char *tmpserver = NULL; @@ -240,7 +240,7 @@ virURIFormat(virURIPtr uri) } -char *virURIFormatParams(virURIPtr uri) +char *virURIFormatParams(virURI *uri) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t i; @@ -264,7 +264,7 @@ char *virURIFormatParams(virURIPtr uri) * * Frees the URI */ -void virURIFree(virURIPtr uri) +void virURIFree(virURI *uri) { size_t i; @@ -346,7 +346,7 @@ virURIFindAliasMatch(char *const*aliases, const char *alias, * Returns 0 on success, -1 on error. */ int -virURIResolveAlias(virConfPtr conf, const char *alias, char **uri) +virURIResolveAlias(virConf *conf, const char *alias, char **uri) { int ret = -1; char **aliases = NULL; @@ -368,7 +368,7 @@ virURIResolveAlias(virConfPtr conf, const char *alias, char **uri) const char * -virURIGetParam(virURIPtr uri, const char *name) +virURIGetParam(virURI *uri, const char *name) { size_t i; @@ -394,7 +394,7 @@ virURIGetParam(virURIPtr uri, const char *name) * Returns: true if the URI might be proxied to a remote server */ bool -virURICheckUnixSocket(virURIPtr uri) +virURICheckUnixSocket(virURI *uri) { size_t i = 0; diff --git a/src/util/viruri.h b/src/util/viruri.h index dc4907b550..4f27fa26d2 100644 --- a/src/util/viruri.h +++ b/src/util/viruri.h @@ -24,11 +24,8 @@ #include "virconf.h" typedef struct _virURI virURI; -typedef virURI *virURIPtr; typedef struct _virURIParam virURIParam; -typedef virURIParam *virURIParamPtr; - struct _virURIParam { char *name; /* Name (unescaped). */ char *value; /* Value (unescaped). */ @@ -46,22 +43,22 @@ struct _virURI { size_t paramsCount; size_t paramsAlloc; - virURIParamPtr params; + virURIParam *params; }; -virURIPtr virURIParse(const char *uri) +virURI *virURIParse(const char *uri) ATTRIBUTE_NONNULL(1); -char *virURIFormat(virURIPtr uri) +char *virURIFormat(virURI *uri) ATTRIBUTE_NONNULL(1); -char *virURIFormatParams(virURIPtr uri); +char *virURIFormatParams(virURI *uri); -void virURIFree(virURIPtr uri); +void virURIFree(virURI *uri); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virURI, virURIFree); -int virURIResolveAlias(virConfPtr conf, const char *alias, char **uri); +int virURIResolveAlias(virConf *conf, const char *alias, char **uri); -const char *virURIGetParam(virURIPtr uri, const char *name); +const char *virURIGetParam(virURI *uri, const char *name); -bool virURICheckUnixSocket(virURIPtr uri); +bool virURICheckUnixSocket(virURI *uri); #define VIR_URI_SERVER(uri) ((uri) && (uri)->server ? (uri)->server : "localhost") diff --git a/src/util/virusb.c b/src/util/virusb.c index 6d897600e5..183b8a9792 100644 --- a/src/util/virusb.c +++ b/src/util/virusb.c @@ -58,7 +58,7 @@ struct _virUSBDevice { struct _virUSBDeviceList { virObjectLockable parent; size_t count; - virUSBDevicePtr *devs; + virUSBDevice **devs; }; typedef enum { @@ -67,7 +67,7 @@ typedef enum { USB_DEVICE_FIND_BY_BUS = 1 << 1, } virUSBDeviceFindFlags; -static virClassPtr virUSBDeviceListClass; +static virClass *virUSBDeviceListClass; static void virUSBDeviceListDispose(void *obj); @@ -102,7 +102,7 @@ static int virUSBSysReadFile(const char *f_name, const char *d_name, return 0; } -static virUSBDeviceListPtr +static virUSBDeviceList * virUSBDeviceSearch(unsigned int vendor, unsigned int product, unsigned int bus, @@ -114,8 +114,8 @@ virUSBDeviceSearch(unsigned int vendor, bool found = false; char *ignore = NULL; struct dirent *de; - virUSBDeviceListPtr list = NULL; - virUSBDeviceListPtr ret = NULL; + virUSBDeviceList *list = NULL; + virUSBDeviceList *ret = NULL; g_autoptr(virUSBDevice) usb = NULL; int direrr; @@ -190,9 +190,9 @@ virUSBDeviceFindByVendor(unsigned int vendor, unsigned int product, const char *vroot, bool mandatory, - virUSBDeviceListPtr *devices) + virUSBDeviceList **devices) { - virUSBDeviceListPtr list; + virUSBDeviceList *list; int count; if (!(list = virUSBDeviceSearch(vendor, product, 0, 0, @@ -229,9 +229,9 @@ virUSBDeviceFindByBus(unsigned int bus, unsigned int devno, const char *vroot, bool mandatory, - virUSBDevicePtr *usb) + virUSBDevice **usb) { - virUSBDeviceListPtr list; + virUSBDeviceList *list; if (!(list = virUSBDeviceSearch(0, 0, bus, devno, vroot, @@ -270,9 +270,9 @@ virUSBDeviceFind(unsigned int vendor, unsigned int devno, const char *vroot, bool mandatory, - virUSBDevicePtr *usb) + virUSBDevice **usb) { - virUSBDeviceListPtr list; + virUSBDeviceList *list; unsigned int flags = USB_DEVICE_FIND_BY_VENDOR|USB_DEVICE_FIND_BY_BUS; if (!(list = virUSBDeviceSearch(vendor, product, bus, devno, @@ -304,12 +304,12 @@ virUSBDeviceFind(unsigned int vendor, return 0; } -virUSBDevicePtr +virUSBDevice * virUSBDeviceNew(unsigned int bus, unsigned int devno, const char *vroot) { - virUSBDevicePtr dev; + virUSBDevice *dev; dev = g_new0(virUSBDevice, 1); @@ -349,7 +349,7 @@ virUSBDeviceNew(unsigned int bus, } void -virUSBDeviceFree(virUSBDevicePtr dev) +virUSBDeviceFree(virUSBDevice *dev) { if (!dev) return; @@ -361,7 +361,7 @@ virUSBDeviceFree(virUSBDevicePtr dev) } int -virUSBDeviceSetUsedBy(virUSBDevicePtr dev, +virUSBDeviceSetUsedBy(virUSBDevice *dev, const char *drv_name, const char *dom_name) { @@ -374,7 +374,7 @@ virUSBDeviceSetUsedBy(virUSBDevicePtr dev, } void -virUSBDeviceGetUsedBy(virUSBDevicePtr dev, +virUSBDeviceGetUsedBy(virUSBDevice *dev, const char **drv_name, const char **dom_name) { @@ -382,39 +382,39 @@ virUSBDeviceGetUsedBy(virUSBDevicePtr dev, *dom_name = dev->used_by_domname; } -const char *virUSBDeviceGetName(virUSBDevicePtr dev) +const char *virUSBDeviceGetName(virUSBDevice *dev) { return dev->name; } -const char *virUSBDeviceGetPath(virUSBDevicePtr dev) +const char *virUSBDeviceGetPath(virUSBDevice *dev) { return dev->path; } -unsigned int virUSBDeviceGetBus(virUSBDevicePtr dev) +unsigned int virUSBDeviceGetBus(virUSBDevice *dev) { return dev->bus; } -unsigned int virUSBDeviceGetDevno(virUSBDevicePtr dev) +unsigned int virUSBDeviceGetDevno(virUSBDevice *dev) { return dev->dev; } -int virUSBDeviceFileIterate(virUSBDevicePtr dev, +int virUSBDeviceFileIterate(virUSBDevice *dev, virUSBDeviceFileActor actor, void *opaque) { return (actor)(dev, dev->path, opaque); } -virUSBDeviceListPtr +virUSBDeviceList * virUSBDeviceListNew(void) { - virUSBDeviceListPtr list; + virUSBDeviceList *list; if (virUSBInitialize() < 0) return NULL; @@ -428,7 +428,7 @@ virUSBDeviceListNew(void) static void virUSBDeviceListDispose(void *obj) { - virUSBDeviceListPtr list = obj; + virUSBDeviceList *list = obj; size_t i; for (i = 0; i < list->count; i++) @@ -438,8 +438,8 @@ virUSBDeviceListDispose(void *obj) } int -virUSBDeviceListAdd(virUSBDeviceListPtr list, - virUSBDevicePtr *dev) +virUSBDeviceListAdd(virUSBDeviceList *list, + virUSBDevice **dev) { if (virUSBDeviceListFind(list, *dev)) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -450,8 +450,8 @@ virUSBDeviceListAdd(virUSBDeviceListPtr list, return VIR_APPEND_ELEMENT(list->devs, list->count, *dev); } -virUSBDevicePtr -virUSBDeviceListGet(virUSBDeviceListPtr list, +virUSBDevice * +virUSBDeviceListGet(virUSBDeviceList *list, int idx) { if (idx >= list->count || @@ -462,16 +462,16 @@ virUSBDeviceListGet(virUSBDeviceListPtr list, } size_t -virUSBDeviceListCount(virUSBDeviceListPtr list) +virUSBDeviceListCount(virUSBDeviceList *list) { return list->count; } -virUSBDevicePtr -virUSBDeviceListSteal(virUSBDeviceListPtr list, - virUSBDevicePtr dev) +virUSBDevice * +virUSBDeviceListSteal(virUSBDeviceList *list, + virUSBDevice *dev) { - virUSBDevicePtr ret = NULL; + virUSBDevice *ret = NULL; size_t i; for (i = 0; i < list->count; i++) { @@ -486,15 +486,15 @@ virUSBDeviceListSteal(virUSBDeviceListPtr list, } void -virUSBDeviceListDel(virUSBDeviceListPtr list, - virUSBDevicePtr dev) +virUSBDeviceListDel(virUSBDeviceList *list, + virUSBDevice *dev) { virUSBDeviceFree(virUSBDeviceListSteal(list, dev)); } -virUSBDevicePtr -virUSBDeviceListFind(virUSBDeviceListPtr list, - virUSBDevicePtr dev) +virUSBDevice * +virUSBDeviceListFind(virUSBDeviceList *list, + virUSBDevice *dev) { size_t i; diff --git a/src/util/virusb.h b/src/util/virusb.h index 42a3303952..d2b3f69942 100644 --- a/src/util/virusb.h +++ b/src/util/virusb.h @@ -26,14 +26,12 @@ #define USB_DEVFS "/dev/bus/usb/" typedef struct _virUSBDevice virUSBDevice; -typedef virUSBDevice *virUSBDevicePtr; typedef struct _virUSBDeviceList virUSBDeviceList; -typedef virUSBDeviceList *virUSBDeviceListPtr; G_DEFINE_AUTOPTR_CLEANUP_FUNC(virUSBDeviceList, virObjectUnref); -virUSBDevicePtr virUSBDeviceNew(unsigned int bus, +virUSBDevice *virUSBDeviceNew(unsigned int bus, unsigned int devno, const char *vroot); @@ -41,13 +39,13 @@ int virUSBDeviceFindByBus(unsigned int bus, unsigned int devno, const char *vroot, bool mandatory, - virUSBDevicePtr *usb); + virUSBDevice **usb); int virUSBDeviceFindByVendor(unsigned int vendor, unsigned int product, const char *vroot, bool mandatory, - virUSBDeviceListPtr *devices); + virUSBDeviceList **devices); int virUSBDeviceFind(unsigned int vendor, unsigned int product, @@ -55,20 +53,20 @@ int virUSBDeviceFind(unsigned int vendor, unsigned int devno, const char *vroot, bool mandatory, - virUSBDevicePtr *usb); + virUSBDevice **usb); -void virUSBDeviceFree(virUSBDevicePtr dev); -int virUSBDeviceSetUsedBy(virUSBDevicePtr dev, +void virUSBDeviceFree(virUSBDevice *dev); +int virUSBDeviceSetUsedBy(virUSBDevice *dev, const char *drv_name, const char *dom_name); -void virUSBDeviceGetUsedBy(virUSBDevicePtr dev, +void virUSBDeviceGetUsedBy(virUSBDevice *dev, const char **drv_name, const char **dom_name); -const char *virUSBDeviceGetName(virUSBDevicePtr dev); -const char *virUSBDeviceGetPath(virUSBDevicePtr usb); +const char *virUSBDeviceGetName(virUSBDevice *dev); +const char *virUSBDeviceGetPath(virUSBDevice *usb); -unsigned int virUSBDeviceGetBus(virUSBDevicePtr dev); -unsigned int virUSBDeviceGetDevno(virUSBDevicePtr dev); +unsigned int virUSBDeviceGetBus(virUSBDevice *dev); +unsigned int virUSBDeviceGetDevno(virUSBDevice *dev); /* * Callback that will be invoked once for each file @@ -77,24 +75,24 @@ unsigned int virUSBDeviceGetDevno(virUSBDevicePtr dev); * Should return 0 if successfully processed, or * -1 to indicate error and abort iteration */ -typedef int (*virUSBDeviceFileActor)(virUSBDevicePtr dev, +typedef int (*virUSBDeviceFileActor)(virUSBDevice *dev, const char *path, void *opaque); -int virUSBDeviceFileIterate(virUSBDevicePtr dev, +int virUSBDeviceFileIterate(virUSBDevice *dev, virUSBDeviceFileActor actor, void *opaque); -virUSBDeviceListPtr virUSBDeviceListNew(void); -int virUSBDeviceListAdd(virUSBDeviceListPtr list, - virUSBDevicePtr *dev); -virUSBDevicePtr virUSBDeviceListGet(virUSBDeviceListPtr list, +virUSBDeviceList *virUSBDeviceListNew(void); +int virUSBDeviceListAdd(virUSBDeviceList *list, + virUSBDevice **dev); +virUSBDevice *virUSBDeviceListGet(virUSBDeviceList *list, int idx); -size_t virUSBDeviceListCount(virUSBDeviceListPtr list); -virUSBDevicePtr virUSBDeviceListSteal(virUSBDeviceListPtr list, - virUSBDevicePtr dev); -void virUSBDeviceListDel(virUSBDeviceListPtr list, - virUSBDevicePtr dev); -virUSBDevicePtr virUSBDeviceListFind(virUSBDeviceListPtr list, - virUSBDevicePtr dev); +size_t virUSBDeviceListCount(virUSBDeviceList *list); +virUSBDevice *virUSBDeviceListSteal(virUSBDeviceList *list, + virUSBDevice *dev); +void virUSBDeviceListDel(virUSBDeviceList *list, + virUSBDevice *dev); +virUSBDevice *virUSBDeviceListFind(virUSBDeviceList *list, + virUSBDevice *dev); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virUSBDevice, virUSBDeviceFree); diff --git a/src/util/virxml.c b/src/util/virxml.c index 4a6fe09468..117f50f2bf 100644 --- a/src/util/virxml.c +++ b/src/util/virxml.c @@ -1182,7 +1182,7 @@ static void catchRNGError(void *ctx, const char *msg, ...) { - virBufferPtr buf = ctx; + virBuffer *buf = ctx; va_list args; va_start(args, msg); @@ -1199,10 +1199,10 @@ static void ignoreRNGError(void *ctx G_GNUC_UNUSED, {} -virXMLValidatorPtr +virXMLValidator * virXMLValidatorInit(const char *schemafile) { - virXMLValidatorPtr validator = NULL; + virXMLValidator *validator = NULL; validator = g_new0(virXMLValidator, 1); @@ -1249,7 +1249,7 @@ virXMLValidatorInit(const char *schemafile) int -virXMLValidatorValidate(virXMLValidatorPtr validator, +virXMLValidatorValidate(virXMLValidator *validator, xmlDocPtr doc) { if (xmlRelaxNGValidateDoc(validator->rngValid, doc) != 0) { @@ -1268,7 +1268,7 @@ int virXMLValidateAgainstSchema(const char *schemafile, xmlDocPtr doc) { - virXMLValidatorPtr validator = NULL; + virXMLValidator *validator = NULL; int ret = -1; if (!(validator = virXMLValidatorInit(schemafile))) @@ -1300,7 +1300,7 @@ virXMLValidateNodeAgainstSchema(const char *schemafile, void -virXMLValidatorFree(virXMLValidatorPtr validator) +virXMLValidatorFree(virXMLValidator *validator) { if (!validator) return; @@ -1329,10 +1329,10 @@ virXMLValidatorFree(virXMLValidatorPtr validator) * Both passed buffers are always consumed and freed. */ void -virXMLFormatElement(virBufferPtr buf, +virXMLFormatElement(virBuffer *buf, const char *name, - virBufferPtr attrBuf, - virBufferPtr childBuf) + virBuffer *attrBuf, + virBuffer *childBuf) { if ((!attrBuf || virBufferUse(attrBuf) == 0) && (!childBuf || virBufferUse(childBuf) == 0)) @@ -1357,7 +1357,7 @@ virXMLFormatElement(virBufferPtr buf, void -virXPathContextNodeRestore(virXPathContextNodeSavePtr save) +virXPathContextNodeRestore(virXPathContextNodeSave *save) { if (!save->ctxt) return; @@ -1367,7 +1367,7 @@ virXPathContextNodeRestore(virXPathContextNodeSavePtr save) void -virXMLNamespaceFormatNS(virBufferPtr buf, +virXMLNamespaceFormatNS(virBuffer *buf, virXMLNamespace const *ns) { virBufferAsprintf(buf, " xmlns:%s='%s'", ns->prefix, ns->uri); diff --git a/src/util/virxml.h b/src/util/virxml.h index d32f77b867..de171dce12 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -199,13 +199,12 @@ struct _virXMLValidator { char *schemafile; }; typedef struct _virXMLValidator virXMLValidator; -typedef virXMLValidator *virXMLValidatorPtr; -virXMLValidatorPtr +virXMLValidator * virXMLValidatorInit(const char *schemafile); int -virXMLValidatorValidate(virXMLValidatorPtr validator, +virXMLValidatorValidate(virXMLValidator *validator, xmlDocPtr doc); int @@ -218,24 +217,23 @@ virXMLValidateNodeAgainstSchema(const char *schemafile, xmlNodePtr node); void -virXMLValidatorFree(virXMLValidatorPtr validator); +virXMLValidatorFree(virXMLValidator *validator); G_DEFINE_AUTOPTR_CLEANUP_FUNC(virXMLValidator, virXMLValidatorFree); void -virXMLFormatElement(virBufferPtr buf, +virXMLFormatElement(virBuffer *buf, const char *name, - virBufferPtr attrBuf, - virBufferPtr childBuf); + virBuffer *attrBuf, + virBuffer *childBuf); struct _virXPathContextNodeSave { xmlXPathContextPtr ctxt; xmlNodePtr node; }; typedef struct _virXPathContextNodeSave virXPathContextNodeSave; -typedef virXPathContextNodeSave *virXPathContextNodeSavePtr; void -virXPathContextNodeRestore(virXPathContextNodeSavePtr save); +virXPathContextNodeRestore(virXPathContextNodeSave *save); G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(virXPathContextNodeSave, virXPathContextNodeRestore); @@ -259,7 +257,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(xmlNode, xmlFreeNode); typedef int (*virXMLNamespaceParse)(xmlXPathContextPtr ctxt, void **nsdata); typedef void (*virXMLNamespaceFree)(void *nsdata); -typedef int (*virXMLNamespaceFormat)(virBufferPtr buf, void *nsdata); +typedef int (*virXMLNamespaceFormat)(virBuffer *buf, void *nsdata); typedef const char *(*virXMLNamespaceHref)(void); struct _virXMLNamespace { @@ -270,10 +268,9 @@ struct _virXMLNamespace { const char *uri; }; typedef struct _virXMLNamespace virXMLNamespace; -typedef virXMLNamespace *virXMLNamespacePtr; void -virXMLNamespaceFormatNS(virBufferPtr buf, +virXMLNamespaceFormatNS(virBuffer *buf, virXMLNamespace const *ns); int virXMLNamespaceRegister(xmlXPathContextPtr ctxt, diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 5a5de85eab..1ea1e4e537 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -57,14 +57,14 @@ VIR_LOG_INIT("vbox.vbox_common"); /* global vbox API, used for all common codes. */ static vboxUniformedAPI gVBoxAPI; -static virClassPtr vboxDriverClass; +static virClass *vboxDriverClass; static virMutex vbox_driver_lock = VIR_MUTEX_INITIALIZER; -static vboxDriverPtr vbox_driver; -static vboxDriverPtr vboxDriverObjNew(void); +static struct _vboxDriver *vbox_driver; +static struct _vboxDriver *vboxDriverObjNew(void); static __thread bool vboxDriverDisposed; static int -vboxDomainDevicesDefPostParse(virDomainDeviceDefPtr dev G_GNUC_UNUSED, +vboxDomainDevicesDefPostParse(virDomainDeviceDef *dev G_GNUC_UNUSED, const virDomainDef *def G_GNUC_UNUSED, unsigned int parseFlags G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED, @@ -84,11 +84,11 @@ static virDomainDefParserConfig vboxDomainDefParserConfig = { .devicesPostParseCallback = vboxDomainDevicesDefPostParse, }; -static virCapsPtr +static virCaps * vboxCapsInit(void) { g_autoptr(virCaps) caps = NULL; - virCapsGuestPtr guest = NULL; + virCapsGuest *guest = NULL; if ((caps = virCapabilitiesNew(virArchFromHost(), false, false)) == NULL) @@ -123,7 +123,7 @@ vboxCapsInit(void) static void vboxDriverDispose(void *obj) { - vboxDriverPtr driver = obj; + struct _vboxDriver *driver = obj; vboxDriverDisposed = true; virObjectUnref(driver->caps); @@ -141,10 +141,10 @@ vboxDriverOnceInit(void) VIR_ONCE_GLOBAL_INIT(vboxDriver); -static vboxDriverPtr +static struct _vboxDriver * vboxDriverObjNew(void) { - vboxDriverPtr driver; + struct _vboxDriver *driver; if (vboxDriverInitialize() < 0) return NULL; @@ -232,7 +232,7 @@ vboxSdkUninitialize(void) gVBoxAPI.UPFN.Uninitialize(vbox_driver); } -static vboxDriverPtr +static struct _vboxDriver * vboxGetDriverConnection(void) { virMutexLock(&vbox_driver_lock); @@ -293,7 +293,7 @@ vboxDestroyDriverConnection(void) virMutexUnlock(&vbox_driver_lock); } -static int openSessionForMachine(vboxDriverPtr data, const unsigned char *dom_uuid, +static int openSessionForMachine(struct _vboxDriver *data, const unsigned char *dom_uuid, vboxIID *iid, IMachine **machine) { VBOX_IID_INITIALIZE(iid); @@ -361,8 +361,8 @@ vboxGenerateMediumName(PRUint32 storageBus, static int -vboxSetStorageController(virDomainControllerDefPtr controller, - vboxDriverPtr data, +vboxSetStorageController(virDomainControllerDef *controller, + struct _vboxDriver *data, IMachine *machine) { PRUnichar *controllerName = NULL; @@ -511,8 +511,8 @@ vboxSetStorageController(virDomainControllerDefPtr controller, static int -vboxAttachStorageControllers(virDomainDefPtr def, - vboxDriverPtr data, +vboxAttachStorageControllers(virDomainDef *def, + struct _vboxDriver *data, IMachine *machine) { size_t i; @@ -536,10 +536,10 @@ vboxConnectURIProbe(char **uri) static virDrvOpenStatus vboxConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { - vboxDriverPtr driver = NULL; + struct _vboxDriver *driver = NULL; uid_t uid = geteuid(); virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -570,7 +570,7 @@ static int vboxConnectClose(virConnectPtr conn) static int vboxDomainSave(virDomainPtr dom, const char *path G_GNUC_UNUSED) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IConsole *console = NULL; vboxIID iid; IMachine *machine = NULL; @@ -624,7 +624,7 @@ vboxDomainSave(virDomainPtr dom, const char *path G_GNUC_UNUSED) static int vboxConnectGetVersion(virConnectPtr conn, unsigned long *version) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; VIR_DEBUG("%s: in vboxGetVersion", conn->driver->name); virObjectLock(data); @@ -659,7 +659,7 @@ static int vboxConnectIsAlive(virConnectPtr conn G_GNUC_UNUSED) static int vboxConnectGetMaxVcpus(virConnectPtr conn, const char *type G_GNUC_UNUSED) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; ISystemProperties *systemProperties = NULL; PRUint32 maxCPUCount = 0; int ret = -1; @@ -686,7 +686,7 @@ vboxConnectGetMaxVcpus(virConnectPtr conn, const char *type G_GNUC_UNUSED) static char *vboxConnectGetCapabilities(virConnectPtr conn) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; char *ret = NULL; if (!data->vboxObj) @@ -701,7 +701,7 @@ static char *vboxConnectGetCapabilities(virConnectPtr conn) static int vboxConnectListDomains(virConnectPtr conn, int *ids, int nids) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxArray machines = VBOX_ARRAY_INITIALIZER; PRUint32 state; nsresult rc; @@ -743,7 +743,7 @@ static int vboxConnectListDomains(virConnectPtr conn, int *ids, int nids) static int vboxConnectNumOfDomains(virConnectPtr conn) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxArray machines = VBOX_ARRAY_INITIALIZER; PRUint32 state; nsresult rc; @@ -782,7 +782,7 @@ static int vboxConnectNumOfDomains(virConnectPtr conn) static virDomainPtr vboxDomainLookupByID(virConnectPtr conn, int id) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxArray machines = VBOX_ARRAY_INITIALIZER; IMachine *machine; PRBool isAccessible = PR_FALSE; @@ -858,7 +858,7 @@ static virDomainPtr vboxDomainLookupByID(virConnectPtr conn, int id) virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxArray machines = VBOX_ARRAY_INITIALIZER; vboxIID iid; char *machineNameUtf8 = NULL; @@ -930,7 +930,7 @@ virDomainPtr vboxDomainLookupByUUID(virConnectPtr conn, static virDomainPtr vboxDomainLookupByName(virConnectPtr conn, const char *name) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxArray machines = VBOX_ARRAY_INITIALIZER; vboxIID iid; char *machineNameUtf8 = NULL; @@ -996,7 +996,7 @@ vboxDomainLookupByName(virConnectPtr conn, const char *name) } static void -vboxSetBootDeviceOrder(virDomainDefPtr def, vboxDriverPtr data, +vboxSetBootDeviceOrder(virDomainDef *def, struct _vboxDriver *data, IMachine *machine) { ISystemProperties *systemProperties = NULL; @@ -1053,14 +1053,14 @@ vboxSetBootDeviceOrder(virDomainDefPtr def, vboxDriverPtr data, } static int -vboxAttachDrives(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) +vboxAttachDrives(virDomainDef *def, struct _vboxDriver *data, IMachine *machine) { size_t i; int type, ret = 0; const char *src = NULL; nsresult rc = 0; - virDomainDiskDefPtr disk = NULL; - virDomainControllerDefPtr cont; + virDomainDiskDef *disk = NULL; + virDomainControllerDef *cont; PRUnichar *storageCtlName = NULL; char *controllerName = NULL; IMedium *medium = NULL; @@ -1254,7 +1254,7 @@ vboxAttachDrives(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) } static void -vboxAttachSound(virDomainDefPtr def, IMachine *machine) +vboxAttachSound(virDomainDef *def, IMachine *machine) { nsresult rc; IAudioAdapter *audioAdapter = NULL; @@ -1286,7 +1286,7 @@ vboxAttachSound(virDomainDefPtr def, IMachine *machine) } static int -vboxAttachNetwork(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) +vboxAttachNetwork(virDomainDef *def, struct _vboxDriver *data, IMachine *machine) { ISystemProperties *systemProperties = NULL; PRUint32 chipsetType = ChipsetType_Null; @@ -1432,7 +1432,7 @@ vboxAttachNetwork(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) } static void -vboxAttachSerial(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) +vboxAttachSerial(virDomainDef *def, struct _vboxDriver *data, IMachine *machine) { ISystemProperties *systemProperties = NULL; PRUint32 serialPortCount = 0; @@ -1508,7 +1508,7 @@ vboxAttachSerial(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) } static void -vboxAttachParallel(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) +vboxAttachParallel(virDomainDef *def, struct _vboxDriver *data, IMachine *machine) { ISystemProperties *systemProperties = NULL; PRUint32 parallelPortCount = 0; @@ -1571,7 +1571,7 @@ vboxAttachParallel(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) } static void -vboxAttachVideo(virDomainDefPtr def, IMachine *machine) +vboxAttachVideo(virDomainDef *def, IMachine *machine) { if ((def->nvideos == 1) && (def->videos[0]->type == VIR_DOMAIN_VIDEO_TYPE_VBOX)) { @@ -1595,7 +1595,7 @@ vboxAttachVideo(virDomainDefPtr def, IMachine *machine) } static void -vboxAttachDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) +vboxAttachDisplay(virDomainDef *def, struct _vboxDriver *data, IMachine *machine) { int vrdpPresent = 0; int sdlPresent = 0; @@ -1603,7 +1603,7 @@ vboxAttachDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) char *guiDisplay = NULL; char *sdlDisplay = NULL; size_t i = 0; - virDomainGraphicsListenDefPtr glisten; + virDomainGraphicsListenDef *glisten; for (i = 0; i < def->ngraphics; i++) { IVRDEServer *VRDEServer = NULL; @@ -1732,7 +1732,7 @@ vboxAttachDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) } static void -vboxAttachUSB(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) +vboxAttachUSB(virDomainDef *def, struct _vboxDriver *data, IMachine *machine) { IUSBCommon *USBCommon = NULL; size_t i = 0; @@ -1835,7 +1835,7 @@ vboxAttachUSB(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) } static void -vboxAttachSharedFolder(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) +vboxAttachSharedFolder(virDomainDef *def, struct _vboxDriver *data, IMachine *machine) { size_t i; PRUnichar *nameUtf16; @@ -1864,11 +1864,11 @@ vboxAttachSharedFolder(virDomainDefPtr def, vboxDriverPtr data, IMachine *machin static virDomainPtr vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; IMachine *machine = NULL; IBIOSSettings *bios = NULL; vboxIID mchiid; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; nsresult rc; char uuidstr[VIR_UUID_STRING_BUFLEN]; virDomainPtr ret = NULL; @@ -2036,7 +2036,7 @@ vboxDomainDefineXML(virConnectPtr conn, const char *xml) static int vboxDomainUndefineFlags(virDomainPtr dom, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IMachine *machine = NULL; vboxIID iid; nsresult rc; @@ -2077,7 +2077,7 @@ static int vboxDomainUndefine(virDomainPtr dom) static int vboxStartMachine(virDomainPtr dom, int maxDomID, IMachine *machine, vboxIID *iid) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; int vrdpPresent = 0; int sdlPresent = 0; int guiPresent = 0; @@ -2219,7 +2219,7 @@ vboxStartMachine(virDomainPtr dom, int maxDomID, IMachine *machine, vboxIID *iid static int vboxDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxArray machines = VBOX_ARRAY_INITIALIZER; unsigned char uuid[VIR_UUID_BUFLEN] = {0}; nsresult rc; @@ -2323,7 +2323,7 @@ static virDomainPtr vboxDomainCreateXML(virConnectPtr conn, const char *xml, static int vboxDomainIsActive(virDomainPtr dom) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxArray machines = VBOX_ARRAY_INITIALIZER; vboxIID iid; char *machineNameUtf8 = NULL; @@ -2395,7 +2395,7 @@ static int vboxDomainIsPersistent(virDomainPtr dom) { /* All domains are persistent. However, we do want to check for * existence. */ - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID iid; IMachine *machine = NULL; int ret = -1; @@ -2418,7 +2418,7 @@ static int vboxDomainIsUpdated(virDomainPtr dom) { /* VBox domains never have a persistent state that differs from * current state. However, we do want to check for existence. */ - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID iid; IMachine *machine = NULL; int ret = -1; @@ -2439,7 +2439,7 @@ static int vboxDomainIsUpdated(virDomainPtr dom) static int vboxDomainSuspend(virDomainPtr dom) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IMachine *machine = NULL; vboxIID iid; IConsole *console = NULL; @@ -2490,7 +2490,7 @@ static int vboxDomainSuspend(virDomainPtr dom) static int vboxDomainResume(virDomainPtr dom) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IMachine *machine = NULL; vboxIID iid; IConsole *console = NULL; @@ -2541,7 +2541,7 @@ static int vboxDomainResume(virDomainPtr dom) static int vboxDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IMachine *machine = NULL; vboxIID iid; IConsole *console = NULL; @@ -2598,7 +2598,7 @@ static int vboxDomainShutdown(virDomainPtr dom) static int vboxDomainReboot(virDomainPtr dom, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IMachine *machine = NULL; vboxIID iid; IConsole *console = NULL; @@ -2646,7 +2646,7 @@ static int vboxDomainReboot(virDomainPtr dom, unsigned int flags) static int vboxDomainDestroyFlags(virDomainPtr dom, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IMachine *machine = NULL; vboxIID iid; IConsole *console = NULL; @@ -2712,7 +2712,7 @@ static char *vboxDomainGetOSType(virDomainPtr dom G_GNUC_UNUSED) { static int vboxDomainSetMemory(virDomainPtr dom, unsigned long memory) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IMachine *machine = NULL; vboxIID iid; PRUint32 state; @@ -2770,7 +2770,7 @@ static int vboxDomainSetMemory(virDomainPtr dom, unsigned long memory) static int vboxDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxArray machines = VBOX_ARRAY_INITIALIZER; char *machineName = NULL; PRUnichar *machineNameUtf16 = NULL; @@ -2853,7 +2853,7 @@ static int vboxDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) static int vboxDomainGetState(virDomainPtr dom, int *state, int *reason, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID domiid; IMachine *machine = NULL; PRUint32 mstate; @@ -2884,7 +2884,7 @@ static int vboxDomainGetState(virDomainPtr dom, int *state, static int vboxDomainSetVcpusFlags(virDomainPtr dom, unsigned int nvcpus, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IMachine *machine = NULL; vboxIID iid; PRUint32 CPUCount = nvcpus; @@ -2938,7 +2938,7 @@ static int vboxDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) static int vboxDomainGetVcpusFlags(virDomainPtr dom, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; ISystemProperties *systemProperties = NULL; PRUint32 maxCPUCount = 0; int ret = -1; @@ -2975,7 +2975,7 @@ static int vboxDomainGetMaxVcpus(virDomainPtr dom) } static void -vboxHostDeviceGetXMLDesc(vboxDriverPtr data, virDomainDefPtr def, IMachine *machine) +vboxHostDeviceGetXMLDesc(struct _vboxDriver *data, virDomainDef *def, IMachine *machine) { IUSBCommon *USBCommon = NULL; PRBool enabled = PR_FALSE; @@ -3016,7 +3016,7 @@ vboxHostDeviceGetXMLDesc(vboxDriverPtr data, virDomainDefPtr def, IMachine *mach goto release_filters; /* Alloc mem needed for the filters now */ - def->hostdevs = g_new0(virDomainHostdevDefPtr, def->nhostdevs); + def->hostdevs = g_new0(virDomainHostdevDef *, def->nhostdevs); for (i = 0; i < def->nhostdevs; i++) { def->hostdevs[i] = virDomainHostdevDefNew(); @@ -3081,7 +3081,7 @@ vboxHostDeviceGetXMLDesc(vboxDriverPtr data, virDomainDefPtr def, IMachine *mach static int -vboxDumpStorageControllers(virDomainDefPtr def, IMachine *machine) +vboxDumpStorageControllers(virDomainDef *def, IMachine *machine) { vboxArray storageControllers = VBOX_ARRAY_INITIALIZER; size_t i = 0; @@ -3163,7 +3163,7 @@ vboxDumpStorageControllers(virDomainDefPtr def, IMachine *machine) } if (type != VIR_DOMAIN_CONTROLLER_TYPE_LAST) { - virDomainControllerDefPtr cont; + virDomainControllerDef *cont; cont = virDomainDefAddController(def, type, -1, model); if (!cont) { @@ -3185,7 +3185,7 @@ vboxDumpStorageControllers(virDomainDefPtr def, IMachine *machine) static int -vboxDumpDisks(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) +vboxDumpDisks(virDomainDef *def, struct _vboxDriver *data, IMachine *machine) { vboxArray mediumAttachments = VBOX_ARRAY_INITIALIZER; int ret = -1; @@ -3197,8 +3197,8 @@ vboxDumpDisks(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) PRInt32 devicePort, deviceSlot; PRBool readOnly; nsresult rc; - virDomainDiskDefPtr disk = NULL; - virDomainControllerDefPtr ctrl = NULL; + virDomainDiskDef *disk = NULL; + virDomainControllerDef *ctrl = NULL; char *mediumLocUtf8 = NULL; size_t sdCount = 0, i, j; @@ -3224,7 +3224,7 @@ vboxDumpDisks(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) } /* Allocate mem, if fails return error */ - def->disks = g_new0(virDomainDiskDefPtr, def->ndisks); + def->disks = g_new0(virDomainDiskDef *, def->ndisks); for (i = 0; i < def->ndisks; i++) { disk = virDomainDiskDefNew(NULL); @@ -3441,7 +3441,7 @@ vboxDumpDisks(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) } static int -vboxDumpVideo(virDomainDefPtr def, vboxDriverPtr data G_GNUC_UNUSED, +vboxDumpVideo(virDomainDef *def, struct _vboxDriver *data G_GNUC_UNUSED, IMachine *machine) { /* dump video options vram/2d/3d/directx/etc. */ @@ -3452,7 +3452,7 @@ vboxDumpVideo(virDomainDefPtr def, vboxDriverPtr data G_GNUC_UNUSED, PRBool accelerate2DEnabled = PR_FALSE; /* Currently supports only one graphics card */ - def->videos = g_new0(virDomainVideoDefPtr, 1); + def->videos = g_new0(virDomainVideoDef *, 1); def->nvideos = 1; def->videos[0] = g_new0(virDomainVideoDef, 1); @@ -3475,7 +3475,7 @@ vboxDumpVideo(virDomainDefPtr def, vboxDriverPtr data G_GNUC_UNUSED, } static int -vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) +vboxDumpDisplay(virDomainDef *def, struct _vboxDriver *data, IMachine *machine) { /* dump display options vrdp/gui/sdl */ PRUnichar *keyUtf16 = NULL; @@ -3484,7 +3484,7 @@ vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) char *netAddressUtf8 = NULL; IVRDEServer *VRDEServer = NULL; PRBool VRDxEnabled = PR_FALSE; - virDomainGraphicsDefPtr graphics = NULL; + virDomainGraphicsDef *graphics = NULL; int ret = -1; def->ngraphics = 0; @@ -3588,7 +3588,7 @@ vboxDumpDisplay(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) } static int -vboxDumpSharedFolders(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine) +vboxDumpSharedFolders(virDomainDef *def, struct _vboxDriver *data, IMachine *machine) { vboxArray sharedFolders = VBOX_ARRAY_INITIALIZER; size_t i = 0; @@ -3604,7 +3604,7 @@ vboxDumpSharedFolders(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine goto cleanup; } - def->fss = g_new0(virDomainFSDefPtr, sharedFolders.count); + def->fss = g_new0(virDomainFSDef *, sharedFolders.count); for (i = 0; i < sharedFolders.count; i++) { ISharedFolder *sharedFolder = sharedFolders.items[i]; @@ -3644,14 +3644,14 @@ vboxDumpSharedFolders(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine return ret; } -static virDomainNetDefPtr -vboxDumpNetwork(vboxDriverPtr data, INetworkAdapter *adapter) +static virDomainNetDef * +vboxDumpNetwork(struct _vboxDriver *data, INetworkAdapter *adapter) { PRUint32 attachmentType = NetworkAttachmentType_Null; PRUint32 adapterType = NetworkAdapterType_Null; PRUnichar *utf16 = NULL; char *utf8 = NULL; - virDomainNetDefPtr net = NULL; + virDomainNetDef *net = NULL; if (!(net = virDomainNetDefNew(data->xmlopt))) return NULL; @@ -3742,13 +3742,13 @@ vboxDumpNetwork(vboxDriverPtr data, INetworkAdapter *adapter) } static int -vboxDumpNetworks(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUint32 networkAdapterCount) +vboxDumpNetworks(virDomainDef *def, struct _vboxDriver *data, IMachine *machine, PRUint32 networkAdapterCount) { size_t i = 0; for (i = 0; i < networkAdapterCount; i++) { INetworkAdapter *adapter = NULL; - virDomainNetDefPtr net = NULL; + virDomainNetDef *net = NULL; PRBool enabled = PR_FALSE; gVBoxAPI.UIMachine.GetNetworkAdapter(machine, i, &adapter); @@ -3770,7 +3770,7 @@ vboxDumpNetworks(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRU } static void -vboxDumpAudio(virDomainDefPtr def, vboxDriverPtr data G_GNUC_UNUSED, +vboxDumpAudio(virDomainDef *def, struct _vboxDriver *data G_GNUC_UNUSED, IMachine *machine) { /* dump sound card if active */ @@ -3789,7 +3789,7 @@ vboxDumpAudio(virDomainDefPtr def, vboxDriverPtr data G_GNUC_UNUSED, PRUint32 audioController = AudioControllerType_AC97; def->nsounds = 1; - def->sounds = g_new0(virDomainSoundDefPtr, 1); + def->sounds = g_new0(virDomainSoundDef *, 1); def->sounds[0] = g_new0(virDomainSoundDef, 1); gVBoxAPI.UIAudioAdapter.GetAudioController(audioAdapter, &audioController); @@ -3804,7 +3804,7 @@ vboxDumpAudio(virDomainDefPtr def, vboxDriverPtr data G_GNUC_UNUSED, } static int -vboxDumpSerial(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUint32 serialPortCount) +vboxDumpSerial(virDomainDef *def, struct _vboxDriver *data, IMachine *machine, PRUint32 serialPortCount) { PRUint32 serialPortIncCount = 0; size_t i = 0; @@ -3828,7 +3828,7 @@ vboxDumpSerial(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUin /* Allocate memory for the serial ports which are enabled */ if (def->nserials > 0) { - def->serials = g_new0(virDomainChrDefPtr, def->nserials); + def->serials = g_new0(virDomainChrDef *, def->nserials); for (i = 0; i < def->nserials; i++) { def->serials[i] = virDomainChrDefNew(NULL); @@ -3898,7 +3898,7 @@ vboxDumpSerial(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUin } static int -vboxDumpParallel(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRUint32 parallelPortCount) +vboxDumpParallel(virDomainDef *def, struct _vboxDriver *data, IMachine *machine, PRUint32 parallelPortCount) { PRUint32 parallelPortIncCount = 0; size_t i = 0; @@ -3922,7 +3922,7 @@ vboxDumpParallel(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRU /* Allocate memory for the parallel ports which are enabled */ if (def->nparallels > 0) { - def->parallels = g_new0(virDomainChrDefPtr, def->nparallels); + def->parallels = g_new0(virDomainChrDef *, def->nparallels); for (i = 0; i < def->nparallels; i++) { def->parallels[i] = virDomainChrDefNew(NULL); @@ -3979,8 +3979,8 @@ vboxDumpParallel(virDomainDefPtr def, vboxDriverPtr data, IMachine *machine, PRU static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; - virDomainDefPtr def = NULL; + struct _vboxDriver *data = dom->conn->privateData; + virDomainDef *def = NULL; IMachine *machine = NULL; vboxIID iid; PRBool accessible = PR_FALSE; @@ -4138,7 +4138,7 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) static int vboxConnectListDefinedDomains(virConnectPtr conn, char ** const names, int maxnames) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxArray machines = VBOX_ARRAY_INITIALIZER; char *machineName = NULL; PRUnichar *machineNameUtf16 = NULL; @@ -4193,7 +4193,7 @@ static int vboxConnectListDefinedDomains(virConnectPtr conn, static int vboxConnectNumOfDefinedDomains(virConnectPtr conn) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxArray machines = VBOX_ARRAY_INITIALIZER; PRUint32 state; nsresult rc; @@ -4238,12 +4238,12 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr dom, const char *xml, int mediaChangeOnly G_GNUC_UNUSED) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IMachine *machine = NULL; vboxIID iid; PRUint32 state; - virDomainDefPtr def = NULL; - virDomainDeviceDefPtr dev = NULL; + virDomainDef *def = NULL; + virDomainDeviceDef *dev = NULL; nsresult rc; int ret = -1; @@ -4357,12 +4357,12 @@ static int vboxDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml, static int vboxDomainDetachDevice(virDomainPtr dom, const char *xml) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IMachine *machine = NULL; vboxIID iid; PRUint32 state; - virDomainDefPtr def = NULL; - virDomainDeviceDefPtr dev = NULL; + virDomainDef *def = NULL; + virDomainDeviceDef *dev = NULL; nsresult rc; int ret = -1; @@ -4453,7 +4453,7 @@ static int vboxDomainDetachDeviceFlags(virDomainPtr dom, const char *xml, static int vboxCloseDisksRecursively(virDomainPtr dom, char *location) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; nsresult rc; size_t i = 0; PRUnichar *locationUtf = NULL; @@ -4523,7 +4523,7 @@ static int vboxCloseDisksRecursively(virDomainPtr dom, char *location) static int vboxSnapshotRedefine(virDomainPtr dom, - virDomainSnapshotDefPtr def, + virDomainSnapshotDef *def, bool isCurrent) { /* @@ -4554,13 +4554,13 @@ vboxSnapshotRedefine(virDomainPtr dom, * * Finally, we register the machine with the new virtualbox description file. */ - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID domiid; IMachine *machine = NULL; nsresult rc; PRUnichar *settingsFilePath = NULL; char *settingsFilePath_Utf8 = NULL; - virVBoxSnapshotConfMachinePtr snapshotMachineDesc = NULL; + virVBoxSnapshotConfMachine *snapshotMachineDesc = NULL; char *currentSnapshotXmlFilePath = NULL; PRUnichar *machineNameUtf16 = NULL; char *machineName = NULL; @@ -4568,11 +4568,11 @@ vboxSnapshotRedefine(virDomainPtr dom, int realReadWriteDisksPathSize = 0; char **realReadOnlyDisksPath = NULL; int realReadOnlyDisksPathSize = 0; - virVBoxSnapshotConfSnapshotPtr newSnapshotPtr = NULL; + virVBoxSnapshotConfSnapshot *newSnapshotPtr = NULL; unsigned char snapshotUuid[VIR_UUID_BUFLEN]; - virVBoxSnapshotConfHardDiskPtr *hardDiskToOpen = NULL; + virVBoxSnapshotConfHardDisk **hardDiskToOpen = NULL; size_t hardDiskToOpenSize = 0; - virVBoxSnapshotConfHardDiskPtr newHardDisk = NULL; + virVBoxSnapshotConfHardDisk *newHardDisk = NULL; char **searchResultTab = NULL; ssize_t resultSize = 0; int it = 0; @@ -4659,7 +4659,7 @@ vboxSnapshotRedefine(virDomainPtr dom, goto cleanup; } for (it = 0; it < realReadWriteDisksPathSize; it++) { - virVBoxSnapshotConfHardDiskPtr readWriteDisk = NULL; + virVBoxSnapshotConfHardDisk *readWriteDisk = NULL; PRUnichar *locationUtf = NULL; IMedium *readWriteMedium = NULL; char *uuid = NULL; @@ -4758,7 +4758,7 @@ vboxSnapshotRedefine(virDomainPtr dom, PRUnichar *formatUtf = NULL; char *format = NULL; char *parentUuid = NULL; - virVBoxSnapshotConfHardDiskPtr readOnlyDisk = NULL; + virVBoxSnapshotConfHardDisk *readOnlyDisk = NULL; vboxIID iid, parentiid; IMedium *parentReadOnlyMedium = NULL; @@ -5043,7 +5043,7 @@ vboxSnapshotRedefine(virDomainPtr dom, for (it = 0; it < def->ndisks; it++) { IMedium *medium = NULL; PRUnichar *locationUtf16 = NULL; - virVBoxSnapshotConfHardDiskPtr disk = NULL; + virVBoxSnapshotConfHardDisk *disk = NULL; PRUnichar *formatUtf16 = NULL; char *format = NULL; char *uuid = NULL; @@ -5392,7 +5392,7 @@ vboxDomainSnapshotCreateXML(virDomainPtr dom, const char *xmlDesc, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID domiid; IMachine *machine = NULL; IConsole *console = NULL; @@ -5588,7 +5588,7 @@ vboxDomainSnapshotGetAll(virDomainPtr dom, } static ISnapshot * -vboxDomainSnapshotGet(vboxDriverPtr data, +vboxDomainSnapshotGet(struct _vboxDriver *data, virDomainPtr dom, IMachine *machine, const char *name) @@ -5638,11 +5638,11 @@ vboxDomainSnapshotGet(vboxDriverPtr data, } static int -vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPtr def, +vboxSnapshotGetReadWriteDisks(virDomainSnapshotDef *def, virDomainSnapshotPtr snapshot) { virDomainPtr dom = snapshot->domain; - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID domiid; IMachine *machine = NULL; ISnapshot *snap = NULL; @@ -5871,11 +5871,11 @@ vboxSnapshotGetReadWriteDisks(virDomainSnapshotDefPtr def, } static int -vboxSnapshotGetReadOnlyDisks(virDomainSnapshotDefPtr def, +vboxSnapshotGetReadOnlyDisks(virDomainSnapshotDef *def, virDomainSnapshotPtr snapshot) { virDomainPtr dom = snapshot->domain; - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID domiid; ISnapshot *snap = NULL; IMachine *machine = NULL; @@ -5886,7 +5886,7 @@ vboxSnapshotGetReadOnlyDisks(virDomainSnapshotDefPtr def, vboxArray mediumAttachments = VBOX_ARRAY_INITIALIZER; size_t i = 0, diskCount = 0, sdCount = 0; int ret = -1; - virDomainDefPtr defdom = def->parent.dom; + virDomainDef *defdom = def->parent.dom; if (!data->vboxObj) return ret; @@ -5937,10 +5937,10 @@ vboxSnapshotGetReadOnlyDisks(virDomainSnapshotDefPtr def, } /* Allocate mem, if fails return error */ - defdom->disks = g_new0(virDomainDiskDefPtr, defdom->ndisks); + defdom->disks = g_new0(virDomainDiskDef *, defdom->ndisks); for (i = 0; i < defdom->ndisks; i++) { - virDomainDiskDefPtr diskDef = virDomainDiskDefNew(NULL); + virDomainDiskDef *diskDef = virDomainDiskDefNew(NULL); if (!diskDef) goto cleanup; defdom->disks[i] = diskDef; @@ -6096,7 +6096,7 @@ static char *vboxDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, unsigned int flags) { virDomainPtr dom = snapshot->domain; - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID domiid; IMachine *machine = NULL; ISnapshot *snap = NULL; @@ -6108,7 +6108,7 @@ static char *vboxDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, PRBool online = PR_FALSE; char uuidstr[VIR_UUID_STRING_BUFLEN]; char *ret = NULL; - virDomainDefPtr defdom; + virDomainDef *defdom; g_autoptr(virDomainSnapshotDef) def = NULL; if (!data->vboxObj) @@ -6233,7 +6233,7 @@ static char *vboxDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, static int vboxDomainSnapshotNum(virDomainPtr dom, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID iid; IMachine *machine = NULL; nsresult rc; @@ -6278,7 +6278,7 @@ static int vboxDomainSnapshotNum(virDomainPtr dom, unsigned int flags) static int vboxDomainSnapshotListNames(virDomainPtr dom, char **names, int nameslen, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID iid; IMachine *machine = NULL; nsresult rc; @@ -6355,7 +6355,7 @@ static virDomainSnapshotPtr vboxDomainSnapshotLookupByName(virDomainPtr dom, const char *name, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID iid; IMachine *machine = NULL; ISnapshot *snapshot = NULL; @@ -6384,7 +6384,7 @@ vboxDomainSnapshotLookupByName(virDomainPtr dom, const char *name, static int vboxDomainHasCurrentSnapshot(virDomainPtr dom, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID iid; IMachine *machine = NULL; ISnapshot *snapshot = NULL; @@ -6422,7 +6422,7 @@ vboxDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, unsigned int flags) { virDomainPtr dom = snapshot->domain; - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID iid; IMachine *machine = NULL; ISnapshot *snap = NULL; @@ -6481,7 +6481,7 @@ vboxDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, static virDomainSnapshotPtr vboxDomainSnapshotCurrent(virDomainPtr dom, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID iid; IMachine *machine = NULL; ISnapshot *snapshot = NULL; @@ -6535,7 +6535,7 @@ static int vboxDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot, unsigned int flags) { virDomainPtr dom = snapshot->domain; - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID iid; IMachine *machine = NULL; ISnapshot *snap = NULL; @@ -6592,7 +6592,7 @@ static int vboxDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot, unsigned int flags) { virDomainPtr dom = snapshot->domain; - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID iid; IMachine *machine = NULL; ISnapshot *snap = NULL; @@ -6623,7 +6623,7 @@ static int vboxDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, unsigned int flags) { virDomainPtr dom = snapshot->domain; - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID domiid; IMachine *machine = NULL; ISnapshot *newSnapshot = NULL; @@ -6693,7 +6693,7 @@ static int vboxDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, } static int -vboxDomainSnapshotDeleteSingle(vboxDriverPtr data, +vboxDomainSnapshotDeleteSingle(struct _vboxDriver *data, IConsole *console, ISnapshot *snapshot) { @@ -6740,7 +6740,7 @@ vboxDomainSnapshotDeleteSingle(vboxDriverPtr data, } static int -vboxDomainSnapshotDeleteTree(vboxDriverPtr data, +vboxDomainSnapshotDeleteTree(struct _vboxDriver *data, IConsole *console, ISnapshot *snapshot) { @@ -6787,15 +6787,15 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot) */ virDomainPtr dom = snapshot->domain; - vboxDriverPtr data = dom->conn->privateData; - virDomainSnapshotDefPtr def = NULL; + struct _vboxDriver *data = dom->conn->privateData; + virDomainSnapshotDef *def = NULL; char *defXml = NULL; vboxIID domiid; nsresult rc; IMachine *machine = NULL; PRUnichar *settingsFilePathUtf16 = NULL; char *settingsFilepath = NULL; - virVBoxSnapshotConfMachinePtr snapshotMachineDesc = NULL; + virVBoxSnapshotConfMachine *snapshotMachineDesc = NULL; int isCurrent = -1; char **searchResultTab = NULL; ssize_t resultSize = 0; @@ -6827,7 +6827,7 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot) VIR_DOMAIN_SNAPSHOT_PARSE_REDEFINE); if (!def) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("Unable to get a virDomainSnapshotDefPtr")); + _("Unable to get a virDomainSnapshotDef *")); goto cleanup; } @@ -6877,7 +6877,7 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot) */ if (def->parent.parent_name != NULL) { for (it = 0; it < def->parent.dom->ndisks; it++) { - virVBoxSnapshotConfHardDiskPtr readOnly = NULL; + virVBoxSnapshotConfHardDisk *readOnly = NULL; IMedium *medium = NULL; PRUnichar *locationUtf16 = NULL; char *parentUuid = NULL; @@ -6886,7 +6886,7 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot) PRUnichar *newLocation = NULL; char *newLocationUtf8 = NULL; IProgress *progress = NULL; - virVBoxSnapshotConfHardDiskPtr disk = NULL; + virVBoxSnapshotConfHardDisk *disk = NULL; char *uuid = NULL; char *format = NULL; char *tmp = NULL; @@ -7159,7 +7159,7 @@ vboxDomainSnapshotDeleteMetadataOnly(virDomainSnapshotPtr snapshot) if (isCurrent) { VIR_FREE(snapshotMachineDesc->currentSnapshot); if (def->parent.parent_name != NULL) { - virVBoxSnapshotConfSnapshotPtr snap = virVBoxSnapshotConfSnapshotByName(snapshotMachineDesc->snapshot, def->parent.parent_name); + virVBoxSnapshotConfSnapshot *snap = virVBoxSnapshotConfSnapshotByName(snapshotMachineDesc->snapshot, def->parent.parent_name); if (!snap) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Unable to get the snapshot to remove")); @@ -7214,7 +7214,7 @@ static int vboxDomainSnapshotDelete(virDomainSnapshotPtr snapshot, unsigned int flags) { virDomainPtr dom = snapshot->domain; - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxIID domiid; IMachine *machine = NULL; ISnapshot *snap = NULL; @@ -7300,7 +7300,7 @@ vboxDomainScreenshot(virDomainPtr dom, unsigned int screen, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IConsole *console = NULL; vboxIID iid; IMachine *machine = NULL; @@ -7427,7 +7427,7 @@ vboxConnectListAllDomains(virConnectPtr conn, virDomainPtr **domains, unsigned int flags) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxArray machines = VBOX_ARRAY_INITIALIZER; char *machineNameUtf8 = NULL; PRUnichar *machineNameUtf16 = NULL; @@ -7635,7 +7635,7 @@ vboxNodeAllocPages(virConnectPtr conn G_GNUC_UNUSED, static int vboxDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; vboxArray machines = VBOX_ARRAY_INITIALIZER; vboxIID iid; char *machineNameUtf8 = NULL; @@ -7711,7 +7711,7 @@ vboxDomainSendKey(virDomainPtr dom, unsigned int flags) { int ret = -1; - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IConsole *console = NULL; vboxIID iid; IMachine *machine = NULL; @@ -7898,7 +7898,7 @@ static virHypervisorDriver vboxCommonDriver = { .domainScreenshot = vboxDomainScreenshot, /* 0.9.2 */ }; -virHypervisorDriverPtr vboxGetHypervisorDriver(uint32_t uVersion) +virHypervisorDriver *vboxGetHypervisorDriver(uint32_t uVersion) { /* Install gVBoxAPI according to the vbox API version. */ int result = 0; diff --git a/src/vbox/vbox_driver.c b/src/vbox/vbox_driver.c index 935658a1da..740af56a13 100644 --- a/src/vbox/vbox_driver.c +++ b/src/vbox/vbox_driver.c @@ -50,7 +50,7 @@ VIR_LOG_INIT("vbox.vbox_driver"); #if defined(VBOX_DRIVER) static virDrvOpenStatus dummyConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { uid_t uid = geteuid(); diff --git a/src/vbox/vbox_get_driver.h b/src/vbox/vbox_get_driver.h index bcfac252d0..84b5d03bd9 100644 --- a/src/vbox/vbox_get_driver.h +++ b/src/vbox/vbox_get_driver.h @@ -20,6 +20,6 @@ #include "internal.h" -virHypervisorDriverPtr vboxGetHypervisorDriver(uint32_t uVersion); -virNetworkDriverPtr vboxGetNetworkDriver(uint32_t uVersion); -virStorageDriverPtr vboxGetStorageDriver(uint32_t uVersion); +virHypervisorDriver *vboxGetHypervisorDriver(uint32_t uVersion); +virNetworkDriver *vboxGetNetworkDriver(uint32_t uVersion); +virStorageDriver *vboxGetStorageDriver(uint32_t uVersion); diff --git a/src/vbox/vbox_network.c b/src/vbox/vbox_network.c index c3c9a55248..afd2acbb03 100644 --- a/src/vbox/vbox_network.c +++ b/src/vbox/vbox_network.c @@ -46,7 +46,7 @@ static vboxUniformedAPI gVBoxAPI; static int vboxConnectNumOfNetworks(virConnectPtr conn) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxArray networkInterfaces = VBOX_ARRAY_INITIALIZER; IHost *host = NULL; size_t i = 0; @@ -91,7 +91,7 @@ static int vboxConnectNumOfNetworks(virConnectPtr conn) static int vboxConnectListNetworks(virConnectPtr conn, char **const names, int nnames) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxArray networkInterfaces = VBOX_ARRAY_INITIALIZER; IHost *host = NULL; size_t i = 0; @@ -148,7 +148,7 @@ static int vboxConnectListNetworks(virConnectPtr conn, char **const names, int n static int vboxConnectNumOfDefinedNetworks(virConnectPtr conn) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxArray networkInterfaces = VBOX_ARRAY_INITIALIZER; IHost *host = NULL; size_t i = 0; @@ -193,7 +193,7 @@ static int vboxConnectNumOfDefinedNetworks(virConnectPtr conn) static int vboxConnectListDefinedNetworks(virConnectPtr conn, char **const names, int nnames) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxArray networkInterfaces = VBOX_ARRAY_INITIALIZER; IHost *host = NULL; size_t i = 0; @@ -250,7 +250,7 @@ static int vboxConnectListDefinedNetworks(virConnectPtr conn, char **const names static virNetworkPtr vboxNetworkLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; PRUint32 interfaceType = 0; char *nameUtf8 = NULL; PRUnichar *nameUtf16 = NULL; @@ -302,7 +302,7 @@ static virNetworkPtr vboxNetworkLookupByUUID(virConnectPtr conn, const unsigned static virNetworkPtr vboxNetworkLookupByName(virConnectPtr conn, const char *name) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; PRUnichar *nameUtf16 = NULL; IHostNetworkInterface *networkInterface = NULL; PRUint32 interfaceType = 0; @@ -350,7 +350,7 @@ static virNetworkPtr vboxNetworkLookupByName(virConnectPtr conn, const char *nam } static PRUnichar * -vboxSocketFormatAddrUtf16(vboxDriverPtr data, virSocketAddrPtr addr) +vboxSocketFormatAddrUtf16(struct _vboxDriver *data, virSocketAddr *addr) { char *utf8 = NULL; PRUnichar *utf16 = NULL; @@ -369,14 +369,14 @@ vboxSocketFormatAddrUtf16(vboxDriverPtr data, virSocketAddrPtr addr) static virNetworkPtr vboxNetworkDefineCreateXML(virConnectPtr conn, const char *xml, bool start) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; PRUnichar *networkInterfaceNameUtf16 = NULL; char *networkInterfaceNameUtf8 = NULL; PRUnichar *networkNameUtf16 = NULL; char *networkNameUtf8 = NULL; IHostNetworkInterface *networkInterface = NULL; - virNetworkDefPtr def = virNetworkDefParseString(xml, NULL); - virNetworkIPDefPtr ipdef = NULL; + virNetworkDef *def = virNetworkDefParseString(xml, NULL); + virNetworkIPDef *ipdef = NULL; unsigned char uuid[VIR_UUID_BUFLEN]; vboxIID vboxnetiid; virSocketAddrRange addr; @@ -565,7 +565,7 @@ static virNetworkPtr vboxNetworkDefineXML(virConnectPtr conn, const char *xml) static int vboxNetworkUndefineDestroy(virNetworkPtr network, bool removeinterface) { - vboxDriverPtr data = network->conn->privateData; + struct _vboxDriver *data = network->conn->privateData; char *networkNameUtf8 = NULL; PRUnichar *networkInterfaceNameUtf16 = NULL; IHostNetworkInterface *networkInterface = NULL; @@ -669,7 +669,7 @@ static int vboxNetworkDestroy(virNetworkPtr network) static int vboxNetworkCreate(virNetworkPtr network) { - vboxDriverPtr data = network->conn->privateData; + struct _vboxDriver *data = network->conn->privateData; char *networkNameUtf8 = NULL; PRUnichar *networkInterfaceNameUtf16 = NULL; IHostNetworkInterface *networkInterface = NULL; @@ -739,8 +739,8 @@ static int vboxNetworkCreate(virNetworkPtr network) } static int -vboxSocketParseAddrUtf16(vboxDriverPtr data, const PRUnichar *utf16, - virSocketAddrPtr addr) +vboxSocketParseAddrUtf16(struct _vboxDriver *data, const PRUnichar *utf16, + virSocketAddr *addr) { int result = -1; char *utf8 = NULL; @@ -760,9 +760,9 @@ vboxSocketParseAddrUtf16(vboxDriverPtr data, const PRUnichar *utf16, static char *vboxNetworkGetXMLDesc(virNetworkPtr network, unsigned int flags) { - vboxDriverPtr data = network->conn->privateData; - virNetworkDefPtr def = NULL; - virNetworkIPDefPtr ipdef = NULL; + struct _vboxDriver *data = network->conn->privateData; + virNetworkDef *def = NULL; + virNetworkIPDef *ipdef = NULL; char *networkNameUtf8 = NULL; PRUnichar *networkInterfaceNameUtf16 = NULL; IHostNetworkInterface *networkInterface = NULL; @@ -927,7 +927,7 @@ virNetworkDriver vboxNetworkDriver = { .networkGetXMLDesc = vboxNetworkGetXMLDesc, /* 0.6.4 */ }; -virNetworkDriverPtr vboxGetNetworkDriver(uint32_t uVersion) +virNetworkDriver *vboxGetNetworkDriver(uint32_t uVersion) { /* Install gVBoxAPI according to the vbox API version. */ int result = 0; diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index 1e6ef81bf4..743ee72211 100644 --- a/src/vbox/vbox_snapshot_conf.c +++ b/src/vbox/vbox_snapshot_conf.c @@ -30,12 +30,12 @@ #define VIR_FROM_THIS VIR_FROM_VBOX VIR_LOG_INIT("vbox.vbox_snapshot_conf"); -static virVBoxSnapshotConfHardDiskPtr +static virVBoxSnapshotConfHardDisk * virVBoxSnapshotConfCreateVBoxSnapshotConfHardDiskPtr(xmlNodePtr diskNode, xmlXPathContextPtr xPathContext, const char *machineLocation) { - virVBoxSnapshotConfHardDiskPtr hardDisk = NULL; + virVBoxSnapshotConfHardDisk *hardDisk = NULL; xmlNodePtr *nodes = NULL; char *uuid = NULL; char **searchTabResult = NULL; @@ -55,7 +55,7 @@ virVBoxSnapshotConfCreateVBoxSnapshotConfHardDiskPtr(xmlNodePtr diskNode, goto cleanup; if (n) - hardDisk->children = g_new0(virVBoxSnapshotConfHardDiskPtr, n); + hardDisk->children = g_new0(virVBoxSnapshotConfHardDisk *, n); hardDisk->nchildren = n; for (i = 0; i < hardDisk->nchildren; i++) { hardDisk->children[i] = virVBoxSnapshotConfCreateVBoxSnapshotConfHardDiskPtr(nodes[i], xPathContext, machineLocation); @@ -111,12 +111,12 @@ virVBoxSnapshotConfCreateVBoxSnapshotConfHardDiskPtr(xmlNodePtr diskNode, return hardDisk; } -static virVBoxSnapshotConfMediaRegistryPtr +static virVBoxSnapshotConfMediaRegistry * virVBoxSnapshotConfRetrieveMediaRegistry(xmlNodePtr mediaRegistryNode, xmlXPathContextPtr xPathContext, const char *machineLocation) { - virVBoxSnapshotConfMediaRegistryPtr mediaRegistry = NULL; + virVBoxSnapshotConfMediaRegistry *mediaRegistry = NULL; xmlNodePtr hardDisksNode = NULL; xmlNodePtr *nodes = NULL; size_t i = 0; @@ -133,7 +133,7 @@ virVBoxSnapshotConfRetrieveMediaRegistry(xmlNodePtr mediaRegistryNode, if (n < 0) goto cleanup; if (n) - mediaRegistry->disks = g_new0(virVBoxSnapshotConfHardDiskPtr, n); + mediaRegistry->disks = g_new0(virVBoxSnapshotConfHardDisk *, n); mediaRegistry->ndisks = n; for (i = 0; i < mediaRegistry->ndisks; i++) { mediaRegistry->disks[i] = virVBoxSnapshotConfCreateVBoxSnapshotConfHardDiskPtr(nodes[i], @@ -173,11 +173,11 @@ virVBoxSnapshotConfRetrieveMediaRegistry(xmlNodePtr mediaRegistryNode, return mediaRegistry; } -static virVBoxSnapshotConfSnapshotPtr +static virVBoxSnapshotConfSnapshot * virVBoxSnapshotConfRetrieveSnapshot(xmlNodePtr snapshotNode, xmlXPathContextPtr xPathContext) { - virVBoxSnapshotConfSnapshotPtr snapshot = NULL; + virVBoxSnapshotConfSnapshot *snapshot = NULL; xmlNodePtr hardwareNode = NULL; xmlNodePtr descriptionNode = NULL; xmlNodePtr storageControllerNode = NULL; @@ -248,7 +248,7 @@ virVBoxSnapshotConfRetrieveSnapshot(xmlNodePtr snapshotNode, if (n < 0) goto cleanup; if (n) - snapshot->children = g_new0(virVBoxSnapshotConfSnapshotPtr, n); + snapshot->children = g_new0(virVBoxSnapshotConfSnapshot *, n); snapshot->nchildren = n; for (i = 0; i < snapshot->nchildren; i++) { snapshot->children[i] = virVBoxSnapshotConfRetrieveSnapshot(nodes[i], xPathContext); @@ -274,12 +274,12 @@ virVBoxSnapshotConfRetrieveSnapshot(xmlNodePtr snapshotNode, return snapshot; } -virVBoxSnapshotConfSnapshotPtr -virVBoxSnapshotConfSnapshotByName(virVBoxSnapshotConfSnapshotPtr snapshot, +virVBoxSnapshotConfSnapshot * +virVBoxSnapshotConfSnapshotByName(virVBoxSnapshotConfSnapshot *snapshot, const char *snapshotName) { size_t i = 0; - virVBoxSnapshotConfSnapshotPtr ret = NULL; + virVBoxSnapshotConfSnapshot *ret = NULL; if (STREQ(snapshot->name, snapshotName)) return snapshot; for (i = 0; i < snapshot->nchildren; i++) { @@ -290,12 +290,12 @@ virVBoxSnapshotConfSnapshotByName(virVBoxSnapshotConfSnapshotPtr snapshot, return ret; } -static virVBoxSnapshotConfHardDiskPtr -virVBoxSnapshotConfHardDiskById(virVBoxSnapshotConfHardDiskPtr disk, +static virVBoxSnapshotConfHardDisk * +virVBoxSnapshotConfHardDiskById(virVBoxSnapshotConfHardDisk *disk, const char *parentHardDiskId) { size_t i = 0; - virVBoxSnapshotConfHardDiskPtr ret = NULL; + virVBoxSnapshotConfHardDisk *ret = NULL; if (STREQ(disk->uuid, parentHardDiskId)) return disk; for (i = 0; i < disk->nchildren; i++) { @@ -306,12 +306,12 @@ virVBoxSnapshotConfHardDiskById(virVBoxSnapshotConfHardDiskPtr disk, return ret; } -static virVBoxSnapshotConfHardDiskPtr -virVBoxSnapshotConfHardDiskByLocation(virVBoxSnapshotConfHardDiskPtr disk, +static virVBoxSnapshotConfHardDisk * +virVBoxSnapshotConfHardDiskByLocation(virVBoxSnapshotConfHardDisk *disk, const char *parentLocation) { size_t i = 0; - virVBoxSnapshotConfHardDiskPtr ret = NULL; + virVBoxSnapshotConfHardDisk *ret = NULL; if (STREQ(disk->location, parentLocation)) return disk; for (i = 0; i < disk->nchildren; i++) { @@ -323,7 +323,7 @@ virVBoxSnapshotConfHardDiskByLocation(virVBoxSnapshotConfHardDiskPtr disk, } static xmlNodePtr -virVBoxSnapshotConfCreateHardDiskNode(virVBoxSnapshotConfHardDiskPtr hardDisk) +virVBoxSnapshotConfCreateHardDiskNode(virVBoxSnapshotConfHardDisk *hardDisk) { int result = -1; size_t i = 0; @@ -359,7 +359,7 @@ virVBoxSnapshotConfCreateHardDiskNode(virVBoxSnapshotConfHardDiskPtr hardDisk) static int virVBoxSnapshotConfSerializeSnapshot(xmlNodePtr node, - virVBoxSnapshotConfSnapshotPtr snapshot) + virVBoxSnapshotConfSnapshot *snapshot) { int result = -1; size_t i = 0; @@ -458,17 +458,17 @@ virVBoxSnapshotConfSerializeSnapshot(xmlNodePtr node, } static size_t -virVBoxSnapshotConfAllChildren(virVBoxSnapshotConfHardDiskPtr disk, - virVBoxSnapshotConfHardDiskPtr **list) +virVBoxSnapshotConfAllChildren(virVBoxSnapshotConfHardDisk *disk, + virVBoxSnapshotConfHardDisk ***list) { size_t returnSize = 0; size_t tempSize = 0; - virVBoxSnapshotConfHardDiskPtr *ret = NULL; - virVBoxSnapshotConfHardDiskPtr *tempList = NULL; + virVBoxSnapshotConfHardDisk **ret = NULL; + virVBoxSnapshotConfHardDisk **tempList = NULL; size_t i = 0; size_t j = 0; - ret = g_new0(virVBoxSnapshotConfHardDiskPtr, 0); + ret = g_new0(virVBoxSnapshotConfHardDisk *, 0); for (i = 0; i < disk->nchildren; i++) { tempSize = virVBoxSnapshotConfAllChildren(disk->children[i], &tempList); @@ -487,7 +487,7 @@ virVBoxSnapshotConfAllChildren(virVBoxSnapshotConfHardDiskPtr disk, } void -virVboxSnapshotConfHardDiskFree(virVBoxSnapshotConfHardDiskPtr disk) +virVboxSnapshotConfHardDiskFree(virVBoxSnapshotConfHardDisk *disk) { size_t i = 0; @@ -506,7 +506,7 @@ virVboxSnapshotConfHardDiskFree(virVBoxSnapshotConfHardDiskPtr disk) void -virVBoxSnapshotConfMediaRegistryFree(virVBoxSnapshotConfMediaRegistryPtr mediaRegistry) +virVBoxSnapshotConfMediaRegistryFree(virVBoxSnapshotConfMediaRegistry *mediaRegistry) { size_t i = 0; @@ -523,7 +523,7 @@ virVBoxSnapshotConfMediaRegistryFree(virVBoxSnapshotConfMediaRegistryPtr mediaRe } void -virVBoxSnapshotConfSnapshotFree(virVBoxSnapshotConfSnapshotPtr snapshot) +virVBoxSnapshotConfSnapshotFree(virVBoxSnapshotConfSnapshot *snapshot) { size_t i = 0; @@ -543,7 +543,7 @@ virVBoxSnapshotConfSnapshotFree(virVBoxSnapshotConfSnapshotPtr snapshot) } void -virVBoxSnapshotConfMachineFree(virVBoxSnapshotConfMachinePtr machine) +virVBoxSnapshotConfMachineFree(virVBoxSnapshotConfMachine *machine) { if (!machine) return; @@ -569,12 +569,12 @@ virVBoxSnapshotConfMachineFree(virVBoxSnapshotConfMachinePtr machine) *return NULL on failure *filePath must not be NULL. */ -virVBoxSnapshotConfMachinePtr +virVBoxSnapshotConfMachine * virVBoxSnapshotConfLoadVboxFile(const char *filePath, const char *machineLocation) { int ret = -1; - virVBoxSnapshotConfMachinePtr machineDescription = NULL; + virVBoxSnapshotConfMachine *machineDescription = NULL; xmlDocPtr xml = NULL; xmlNodePtr machineNode = NULL; xmlNodePtr cur = NULL; @@ -737,11 +737,11 @@ virVBoxSnapshotConfLoadVboxFile(const char *filePath, *return -1 on failure */ int -virVBoxSnapshotConfAddSnapshotToXmlMachine(virVBoxSnapshotConfSnapshotPtr snapshot, - virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfAddSnapshotToXmlMachine(virVBoxSnapshotConfSnapshot *snapshot, + virVBoxSnapshotConfMachine *machine, const char *snapshotParentName) { - virVBoxSnapshotConfSnapshotPtr parentSnapshot = NULL; + virVBoxSnapshotConfSnapshot *parentSnapshot = NULL; if (snapshot == NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -791,12 +791,12 @@ virVBoxSnapshotConfAddSnapshotToXmlMachine(virVBoxSnapshotConfSnapshotPtr snapsh *return -1 on failure */ int -virVBoxSnapshotConfAddHardDiskToMediaRegistry(virVBoxSnapshotConfHardDiskPtr hardDisk, - virVBoxSnapshotConfMediaRegistryPtr mediaRegistry, +virVBoxSnapshotConfAddHardDiskToMediaRegistry(virVBoxSnapshotConfHardDisk *hardDisk, + virVBoxSnapshotConfMediaRegistry *mediaRegistry, const char *parentHardDiskId) { size_t i = 0; - virVBoxSnapshotConfHardDiskPtr parentDisk = NULL; + virVBoxSnapshotConfHardDisk *parentDisk = NULL; if (hardDisk == NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Hard disk is null")); @@ -834,12 +834,12 @@ virVBoxSnapshotConfAddHardDiskToMediaRegistry(virVBoxSnapshotConfHardDiskPtr har *return -1 on failure */ int -virVBoxSnapshotConfRemoveSnapshot(virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfRemoveSnapshot(virVBoxSnapshotConfMachine *machine, const char *snapshotName) { size_t i = 0; - virVBoxSnapshotConfSnapshotPtr snapshot = NULL; - virVBoxSnapshotConfSnapshotPtr parentSnapshot = NULL; + virVBoxSnapshotConfSnapshot *snapshot = NULL; + virVBoxSnapshotConfSnapshot *parentSnapshot = NULL; if (machine == NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("machine is null")); @@ -895,12 +895,12 @@ virVBoxSnapshotConfRemoveSnapshot(virVBoxSnapshotConfMachinePtr machine, *return -1 on failure */ int -virVBoxSnapshotConfRemoveHardDisk(virVBoxSnapshotConfMediaRegistryPtr mediaRegistry, +virVBoxSnapshotConfRemoveHardDisk(virVBoxSnapshotConfMediaRegistry *mediaRegistry, const char *uuid) { size_t i = 0; - virVBoxSnapshotConfHardDiskPtr hardDisk = NULL; - virVBoxSnapshotConfHardDiskPtr parentHardDisk = NULL; + virVBoxSnapshotConfHardDisk *hardDisk = NULL; + virVBoxSnapshotConfHardDisk *parentHardDisk = NULL; if (mediaRegistry == NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Media registry is null")); @@ -950,7 +950,7 @@ virVBoxSnapshotConfRemoveHardDisk(virVBoxSnapshotConfMediaRegistryPtr mediaRegis *return -1 on failure */ int -virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachine *machine, const char *filePath) { int ret = -1; @@ -1185,10 +1185,10 @@ virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine, *vboxSnapshotXmlMachinePtr's current snapshot, return 0 otherwise. */ int -virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapshotConfMachine *machine, const char *snapshotName) { - virVBoxSnapshotConfSnapshotPtr snapshot = NULL; + virVBoxSnapshotConfSnapshot *snapshot = NULL; if (machine == NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Machine is null")); @@ -1338,11 +1338,11 @@ virVBoxSnapshotConfGetRODisksPathsFromLibvirtXML(const char *filePath, *return a valid uuid, or NULL on failure */ const char * -virVBoxSnapshotConfHardDiskUuidByLocation(virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfHardDiskUuidByLocation(virVBoxSnapshotConfMachine *machine, const char *location) { size_t i = 0; - virVBoxSnapshotConfHardDiskPtr hardDisk = NULL; + virVBoxSnapshotConfHardDisk *hardDisk = NULL; for (i = 0; i < machine->mediaRegistry->ndisks; i++) { hardDisk = virVBoxSnapshotConfHardDiskByLocation(machine->mediaRegistry->disks[i], location); if (hardDisk != NULL) @@ -1359,14 +1359,14 @@ virVBoxSnapshotConfHardDiskUuidByLocation(virVBoxSnapshotConfMachinePtr machine, *return array length on success, -1 on failure.*/ size_t -virVBoxSnapshotConfDiskListToOpen(virVBoxSnapshotConfMachinePtr machine, - virVBoxSnapshotConfHardDiskPtr **hardDiskToOpen, +virVBoxSnapshotConfDiskListToOpen(virVBoxSnapshotConfMachine *machine, + virVBoxSnapshotConfHardDisk ***hardDiskToOpen, const char *location) { size_t i = 0; size_t returnSize = 0; - virVBoxSnapshotConfHardDiskPtr *ret = NULL; - virVBoxSnapshotConfHardDiskPtr hardDisk = NULL; + virVBoxSnapshotConfHardDisk **ret = NULL; + virVBoxSnapshotConfHardDisk *hardDisk = NULL; for (i = 0; i < machine->mediaRegistry->ndisks; i++) { hardDisk = virVBoxSnapshotConfHardDiskByLocation(machine->mediaRegistry->disks[i], location); if (hardDisk != NULL) @@ -1374,7 +1374,7 @@ virVBoxSnapshotConfDiskListToOpen(virVBoxSnapshotConfMachinePtr machine, } if (hardDisk == NULL) return 0; - ret = g_new0(virVBoxSnapshotConfHardDiskPtr, 1); + ret = g_new0(virVBoxSnapshotConfHardDisk *, 1); returnSize = 1; ret[returnSize - 1] = hardDisk; @@ -1394,17 +1394,17 @@ virVBoxSnapshotConfDiskListToOpen(virVBoxSnapshotConfMachinePtr machine, *return -1 on failure */ int -virVBoxSnapshotConfRemoveFakeDisks(virVBoxSnapshotConfMachinePtr machine) +virVBoxSnapshotConfRemoveFakeDisks(virVBoxSnapshotConfMachine *machine) { int ret = -1; size_t i = 0; size_t j = 0; size_t tempSize = 0; size_t diskSize = 0; - virVBoxSnapshotConfHardDiskPtr *tempList = NULL; - virVBoxSnapshotConfHardDiskPtr *diskList = NULL; + virVBoxSnapshotConfHardDisk **tempList = NULL; + virVBoxSnapshotConfHardDisk **diskList = NULL; - diskList = g_new0(virVBoxSnapshotConfHardDiskPtr, 0); + diskList = g_new0(virVBoxSnapshotConfHardDisk *, 0); for (i = 0; i < machine->mediaRegistry->ndisks; i++) { tempSize = virVBoxSnapshotConfAllChildren(machine->mediaRegistry->disks[i], &tempList); @@ -1443,7 +1443,7 @@ virVBoxSnapshotConfRemoveFakeDisks(virVBoxSnapshotConfMachinePtr machine) *return -1 on failure */ int -virVBoxSnapshotConfDiskIsInMediaRegistry(virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfDiskIsInMediaRegistry(virVBoxSnapshotConfMachine *machine, const char *location) { int ret = -1; @@ -1451,10 +1451,10 @@ virVBoxSnapshotConfDiskIsInMediaRegistry(virVBoxSnapshotConfMachinePtr machine, size_t j = 0; size_t tempSize = 0; size_t diskSize = 0; - virVBoxSnapshotConfHardDiskPtr *tempList = NULL; - virVBoxSnapshotConfHardDiskPtr *diskList = NULL; + virVBoxSnapshotConfHardDisk **tempList = NULL; + virVBoxSnapshotConfHardDisk **diskList = NULL; - diskList = g_new0(virVBoxSnapshotConfHardDiskPtr, 0); + diskList = g_new0(virVBoxSnapshotConfHardDisk *, 0); for (i = 0; i < machine->mediaRegistry->ndisks; i++) { tempSize = virVBoxSnapshotConfAllChildren(machine->mediaRegistry->disks[i], &tempList); @@ -1485,12 +1485,12 @@ virVBoxSnapshotConfDiskIsInMediaRegistry(virVBoxSnapshotConfMachinePtr machine, /* *hardDisksPtrByLocation: Return a vboxSnapshotXmlHardDiskPtr whose location is 'location' */ -virVBoxSnapshotConfHardDiskPtr -virVBoxSnapshotConfHardDiskPtrByLocation(virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfHardDisk * +virVBoxSnapshotConfHardDiskPtrByLocation(virVBoxSnapshotConfMachine *machine, const char *location) { int it = 0; - virVBoxSnapshotConfHardDiskPtr disk = NULL; + virVBoxSnapshotConfHardDisk *disk = NULL; for (it = 0; it < machine->mediaRegistry->ndisks; it++) { disk = virVBoxSnapshotConfHardDiskByLocation(machine->mediaRegistry->disks[it], location); if (disk != NULL) diff --git a/src/vbox/vbox_snapshot_conf.h b/src/vbox/vbox_snapshot_conf.h index 3394d7dcbc..74fd91ea89 100644 --- a/src/vbox/vbox_snapshot_conf.h +++ b/src/vbox/vbox_snapshot_conf.h @@ -25,24 +25,22 @@ /*Stores VirtualBox xml hard disk information A hard disk can have a parent and children*/ typedef struct _virVBoxSnapshotConfHardDisk virVBoxSnapshotConfHardDisk; -typedef virVBoxSnapshotConfHardDisk *virVBoxSnapshotConfHardDiskPtr; struct _virVBoxSnapshotConfHardDisk { - virVBoxSnapshotConfHardDiskPtr parent; + virVBoxSnapshotConfHardDisk *parent; char *uuid; char *location; char *format; char *type; size_t nchildren; - virVBoxSnapshotConfHardDiskPtr *children; + virVBoxSnapshotConfHardDisk **children; }; /*Stores Virtualbox xml media registry information We separate disks from other media to manipulate them*/ typedef struct _virVBoxSnapshotConfMediaRegistry virVBoxSnapshotConfMediaRegistry; -typedef virVBoxSnapshotConfMediaRegistry *virVBoxSnapshotConfMediaRegistryPtr; struct _virVBoxSnapshotConfMediaRegistry { size_t ndisks; - virVBoxSnapshotConfHardDiskPtr *disks; + virVBoxSnapshotConfHardDisk **disks; size_t notherMedia; char **otherMedia; }; @@ -50,9 +48,8 @@ struct _virVBoxSnapshotConfMediaRegistry { /*Stores VirtualBox xml snapshot information A snapshot can have a parent and children*/ typedef struct _virVBoxSnapshotConfSnapshot virVBoxSnapshotConfSnapshot; -typedef virVBoxSnapshotConfSnapshot *virVBoxSnapshotConfSnapshotPtr; struct _virVBoxSnapshotConfSnapshot { - virVBoxSnapshotConfSnapshotPtr parent; + virVBoxSnapshotConfSnapshot *parent; char *uuid; char *name; char *timeStamp; @@ -60,12 +57,11 @@ struct _virVBoxSnapshotConfSnapshot { char *hardware; char *storageController; size_t nchildren; - virVBoxSnapshotConfSnapshotPtr *children; + virVBoxSnapshotConfSnapshot **children; }; /*Stores VirtualBox xml Machine information*/ typedef struct _virVBoxSnapshotConfMachine virVBoxSnapshotConfMachine; -typedef virVBoxSnapshotConfMachine *virVBoxSnapshotConfMachinePtr; struct _virVBoxSnapshotConfMachine { char *uuid; char *name; @@ -73,44 +69,44 @@ struct _virVBoxSnapshotConfMachine { char *snapshotFolder; int currentStateModified; char *lastStateChange; - virVBoxSnapshotConfMediaRegistryPtr mediaRegistry; + virVBoxSnapshotConfMediaRegistry *mediaRegistry; char *hardware; char *extraData; - virVBoxSnapshotConfSnapshotPtr snapshot; + virVBoxSnapshotConfSnapshot *snapshot; char *storageController; }; void -virVboxSnapshotConfHardDiskFree(virVBoxSnapshotConfHardDiskPtr disk); +virVboxSnapshotConfHardDiskFree(virVBoxSnapshotConfHardDisk *disk); void -virVBoxSnapshotConfMediaRegistryFree(virVBoxSnapshotConfMediaRegistryPtr mediaRegistry); +virVBoxSnapshotConfMediaRegistryFree(virVBoxSnapshotConfMediaRegistry *mediaRegistry); void -virVBoxSnapshotConfSnapshotFree(virVBoxSnapshotConfSnapshotPtr snapshot); +virVBoxSnapshotConfSnapshotFree(virVBoxSnapshotConfSnapshot *snapshot); void -virVBoxSnapshotConfMachineFree(virVBoxSnapshotConfMachinePtr machine); +virVBoxSnapshotConfMachineFree(virVBoxSnapshotConfMachine *machine); -virVBoxSnapshotConfMachinePtr +virVBoxSnapshotConfMachine * virVBoxSnapshotConfLoadVboxFile(const char *filePath, const char *machineLocation); int -virVBoxSnapshotConfAddSnapshotToXmlMachine(virVBoxSnapshotConfSnapshotPtr snapshot, - virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfAddSnapshotToXmlMachine(virVBoxSnapshotConfSnapshot *snapshot, + virVBoxSnapshotConfMachine *machine, const char *snapshotParentName); int -virVBoxSnapshotConfAddHardDiskToMediaRegistry(virVBoxSnapshotConfHardDiskPtr hardDisk, - virVBoxSnapshotConfMediaRegistryPtr mediaRegistry, +virVBoxSnapshotConfAddHardDiskToMediaRegistry(virVBoxSnapshotConfHardDisk *hardDisk, + virVBoxSnapshotConfMediaRegistry *mediaRegistry, const char *parentHardDiskId); int -virVBoxSnapshotConfRemoveSnapshot(virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfRemoveSnapshot(virVBoxSnapshotConfMachine *machine, const char *snapshotName); int -virVBoxSnapshotConfRemoveHardDisk(virVBoxSnapshotConfMediaRegistryPtr mediaRegistry, +virVBoxSnapshotConfRemoveHardDisk(virVBoxSnapshotConfMediaRegistry *mediaRegistry, const char *uuid); int -virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfSaveVboxFile(virVBoxSnapshotConfMachine *machine, const char *filePath); int -virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfIsCurrentSnapshot(virVBoxSnapshotConfMachine *machine, const char *snapshotName); int virVBoxSnapshotConfGetRWDisksPathsFromLibvirtXML(const char *filePath, @@ -119,20 +115,20 @@ int virVBoxSnapshotConfGetRODisksPathsFromLibvirtXML(const char *filePath, char ***realReadOnlyDisksPath); const char * -virVBoxSnapshotConfHardDiskUuidByLocation(virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfHardDiskUuidByLocation(virVBoxSnapshotConfMachine *machine, const char *location); size_t -virVBoxSnapshotConfDiskListToOpen(virVBoxSnapshotConfMachinePtr machine, - virVBoxSnapshotConfHardDiskPtr **hardDiskToOpen, +virVBoxSnapshotConfDiskListToOpen(virVBoxSnapshotConfMachine *machine, + virVBoxSnapshotConfHardDisk ***hardDiskToOpen, const char *location); int -virVBoxSnapshotConfRemoveFakeDisks(virVBoxSnapshotConfMachinePtr machine); +virVBoxSnapshotConfRemoveFakeDisks(virVBoxSnapshotConfMachine *machine); int -virVBoxSnapshotConfDiskIsInMediaRegistry(virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfDiskIsInMediaRegistry(virVBoxSnapshotConfMachine *machine, const char *location); -virVBoxSnapshotConfHardDiskPtr -virVBoxSnapshotConfHardDiskPtrByLocation(virVBoxSnapshotConfMachinePtr machine, +virVBoxSnapshotConfHardDisk * +virVBoxSnapshotConfHardDiskPtrByLocation(virVBoxSnapshotConfMachine *machine, const char *location); -virVBoxSnapshotConfSnapshotPtr -virVBoxSnapshotConfSnapshotByName(virVBoxSnapshotConfSnapshotPtr snapshot, +virVBoxSnapshotConfSnapshot * +virVBoxSnapshotConfSnapshotByName(virVBoxSnapshotConfSnapshot *snapshot, const char *snapshotName); diff --git a/src/vbox/vbox_storage.c b/src/vbox/vbox_storage.c index ee491fa596..10eb35c654 100644 --- a/src/vbox/vbox_storage.c +++ b/src/vbox/vbox_storage.c @@ -87,7 +87,7 @@ vboxStoragePoolLookupByName(virConnectPtr conn, const char *name) static int vboxStoragePoolNumOfVolumes(virStoragePoolPtr pool) { - vboxDriverPtr data = pool->conn->privateData; + struct _vboxDriver *data = pool->conn->privateData; vboxArray hardDisks = VBOX_ARRAY_INITIALIZER; PRUint32 hardDiskAccessible = 0; nsresult rc; @@ -125,7 +125,7 @@ static int vboxStoragePoolNumOfVolumes(virStoragePoolPtr pool) static int vboxStoragePoolListVolumes(virStoragePoolPtr pool, char **const names, int nnames) { - vboxDriverPtr data = pool->conn->privateData; + struct _vboxDriver *data = pool->conn->privateData; vboxArray hardDisks = VBOX_ARRAY_INITIALIZER; PRUint32 numActive = 0; nsresult rc; @@ -178,7 +178,7 @@ vboxStoragePoolListVolumes(virStoragePoolPtr pool, char **const names, int nname static virStorageVolPtr vboxStorageVolLookupByName(virStoragePoolPtr pool, const char *name) { - vboxDriverPtr data = pool->conn->privateData; + struct _vboxDriver *data = pool->conn->privateData; vboxArray hardDisks = VBOX_ARRAY_INITIALIZER; nsresult rc; size_t i; @@ -251,7 +251,7 @@ vboxStorageVolLookupByName(virStoragePoolPtr pool, const char *name) static virStorageVolPtr vboxStorageVolLookupByKey(virConnectPtr conn, const char *key) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; vboxIID hddIID; unsigned char uuid[VIR_UUID_BUFLEN]; IMedium *hardDisk = NULL; @@ -318,7 +318,7 @@ vboxStorageVolLookupByKey(virConnectPtr conn, const char *key) static virStorageVolPtr vboxStorageVolLookupByPath(virConnectPtr conn, const char *path) { - vboxDriverPtr data = conn->privateData; + struct _vboxDriver *data = conn->privateData; PRUnichar *hddPathUtf16 = NULL; IMedium *hardDisk = NULL; PRUnichar *hddNameUtf16 = NULL; @@ -396,7 +396,7 @@ static virStorageVolPtr vboxStorageVolCreateXML(virStoragePoolPtr pool, const char *xml, unsigned int flags) { - vboxDriverPtr data = pool->conn->privateData; + struct _vboxDriver *data = pool->conn->privateData; PRUnichar *hddFormatUtf16 = NULL; PRUnichar *hddNameUtf16 = NULL; virStoragePoolDef poolDef; @@ -504,7 +504,7 @@ vboxStorageVolCreateXML(virStoragePoolPtr pool, static int vboxStorageVolDelete(virStorageVolPtr vol, unsigned int flags) { - vboxDriverPtr data = vol->conn->privateData; + struct _vboxDriver *data = vol->conn->privateData; unsigned char uuid[VIR_UUID_BUFLEN]; IMedium *hardDisk = NULL; int deregister = 0; @@ -657,7 +657,7 @@ static int vboxStorageVolDelete(virStorageVolPtr vol, unsigned int flags) static int vboxStorageVolGetInfo(virStorageVolPtr vol, virStorageVolInfoPtr info) { - vboxDriverPtr data = vol->conn->privateData; + struct _vboxDriver *data = vol->conn->privateData; IMedium *hardDisk = NULL; unsigned char uuid[VIR_UUID_BUFLEN]; PRUint32 hddstate; @@ -712,7 +712,7 @@ static int vboxStorageVolGetInfo(virStorageVolPtr vol, virStorageVolInfoPtr info static char *vboxStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags) { - vboxDriverPtr data = vol->conn->privateData; + struct _vboxDriver *data = vol->conn->privateData; IMedium *hardDisk = NULL; unsigned char uuid[VIR_UUID_BUFLEN]; PRUnichar *hddFormatUtf16 = NULL; @@ -802,7 +802,7 @@ static char *vboxStorageVolGetXMLDesc(virStorageVolPtr vol, unsigned int flags) static char *vboxStorageVolGetPath(virStorageVolPtr vol) { - vboxDriverPtr data = vol->conn->privateData; + struct _vboxDriver *data = vol->conn->privateData; IMedium *hardDisk = NULL; PRUnichar *hddLocationUtf16 = NULL; char *hddLocationUtf8 = NULL; @@ -875,7 +875,7 @@ virStorageDriver vboxStorageDriver = { .storageVolGetPath = vboxStorageVolGetPath /* 0.7.1 */ }; -virStorageDriverPtr vboxGetStorageDriver(uint32_t uVersion) +virStorageDriver *vboxGetStorageDriver(uint32_t uVersion) { /* Install gVBoxAPI according to the vbox API version. * Return -1 for unsupported version. diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c index 182d4c6b75..1772a9b70e 100644 --- a/src/vbox/vbox_tmpl.c +++ b/src/vbox/vbox_tmpl.c @@ -132,7 +132,7 @@ if (strUtf16) {\ #define VBOX_RDP_AUTOPORT_RANGE "3389-3689" static void -_vboxIIDUnalloc(vboxDriverPtr data, vboxIID *iid) +_vboxIIDUnalloc(struct _vboxDriver *data, vboxIID *iid) { if (iid->value != NULL && iid->owner) data->pFuncs->pfnUtf16Free(iid->value); @@ -142,7 +142,7 @@ _vboxIIDUnalloc(vboxDriverPtr data, vboxIID *iid) } static void -_vboxIIDToUUID(vboxDriverPtr data, vboxIID *iid, +_vboxIIDToUUID(struct _vboxDriver *data, vboxIID *iid, unsigned char *uuid) { char *utf8 = NULL; @@ -155,7 +155,7 @@ _vboxIIDToUUID(vboxDriverPtr data, vboxIID *iid, } static void -_vboxIIDFromUUID(vboxDriverPtr data, vboxIID *iid, +_vboxIIDFromUUID(struct _vboxDriver *data, vboxIID *iid, const unsigned char *uuid) { char utf8[VIR_UUID_STRING_BUFLEN]; @@ -168,7 +168,7 @@ _vboxIIDFromUUID(vboxDriverPtr data, vboxIID *iid, } static bool -_vboxIIDIsEqual(vboxDriverPtr data, vboxIID *iid1, +_vboxIIDIsEqual(struct _vboxDriver *data, vboxIID *iid1, vboxIID *iid2) { unsigned char uuid1[VIR_UUID_BUFLEN]; @@ -186,7 +186,7 @@ _vboxIIDIsEqual(vboxDriverPtr data, vboxIID *iid1, } static void -_vboxIIDFromArrayItem(vboxDriverPtr data, vboxIID *iid, +_vboxIIDFromArrayItem(struct _vboxDriver *data, vboxIID *iid, vboxArray *array, int idx) { _vboxIIDUnalloc(data, iid); @@ -292,7 +292,7 @@ _vboxDomainSnapshotRestore(virDomainPtr dom, IMachine *machine, ISnapshot *snapshot) { - vboxDriverPtr data = dom->conn->privateData; + struct _vboxDriver *data = dom->conn->privateData; IProgress *progress = NULL; PRUint32 state; nsresult rc; @@ -364,7 +364,7 @@ _vboxDomainSnapshotRestore(virDomainPtr dom, } static nsresult -_unregisterMachine(vboxDriverPtr data, vboxIID *iid, IMachine **machine) +_unregisterMachine(struct _vboxDriver *data, vboxIID *iid, IMachine **machine) { nsresult rc; vboxArray media = VBOX_ARRAY_INITIALIZER; @@ -428,7 +428,7 @@ _deleteConfig(IMachine *machine) } } -static int _pfnInitialize(vboxDriverPtr driver) +static int _pfnInitialize(struct _vboxDriver *driver) { nsresult rc; @@ -448,7 +448,7 @@ static int _pfnInitialize(vboxDriverPtr driver) return 0; } -static void _pfnUninitialize(vboxDriverPtr data) +static void _pfnUninitialize(struct _vboxDriver *data) { if (data->pFuncs) { VBOX_RELEASE(data->vboxObj); @@ -490,13 +490,13 @@ static void _vboxIIDInitialize(vboxIID *iid) iid->owner = true; } -static void _DEBUGIID(vboxDriverPtr data, const char *msg, vboxIID *iid) +static void _DEBUGIID(struct _vboxDriver *data, const char *msg, vboxIID *iid) { DEBUGPRUnichar(msg, iid->value); } static void -_vboxIIDToUtf8(vboxDriverPtr data G_GNUC_UNUSED, +_vboxIIDToUtf8(struct _vboxDriver *data G_GNUC_UNUSED, vboxIID *iid G_GNUC_UNUSED, char **utf8 G_GNUC_UNUSED) { @@ -605,7 +605,7 @@ _virtualboxGetHost(IVirtualBox *vboxObj, IHost **host) } static nsresult -_virtualboxCreateMachine(vboxDriverPtr data, virDomainDefPtr def, IMachine **machine, char *uuidstr G_GNUC_UNUSED) +_virtualboxCreateMachine(struct _vboxDriver *data, virDomainDef *def, IMachine **machine, char *uuidstr G_GNUC_UNUSED) { vboxIID iid = VBOX_IID_INITIALIZER; PRUnichar *machineNameUtf16 = NULL; @@ -745,7 +745,7 @@ _machineRemoveSharedFolder(IMachine *machine, PRUnichar *name) } static nsresult -_machineLaunchVMProcess(vboxDriverPtr data, +_machineLaunchVMProcess(struct _vboxDriver *data, IMachine *machine G_GNUC_UNUSED, vboxIID *iid G_GNUC_UNUSED, PRUnichar *sessionType, PRUnichar *env, @@ -1062,13 +1062,13 @@ _machineSaveSettings(IMachine *machine) } static nsresult -_sessionOpen(vboxDriverPtr data, vboxIID *iid G_GNUC_UNUSED, IMachine *machine) +_sessionOpen(struct _vboxDriver *data, vboxIID *iid G_GNUC_UNUSED, IMachine *machine) { return machine->vtbl->LockMachine(machine, data->vboxSession, LockType_Write); } static nsresult -_sessionOpenExisting(vboxDriverPtr data, vboxIID *iid G_GNUC_UNUSED, IMachine *machine) +_sessionOpenExisting(struct _vboxDriver *data, vboxIID *iid G_GNUC_UNUSED, IMachine *machine) { return machine->vtbl->LockMachine(machine, data->vboxSession, LockType_Shared); } @@ -1540,8 +1540,8 @@ _vrdeServerSetEnabled(IVRDEServer *VRDEServer, PRBool enabled) } static nsresult -_vrdeServerGetPorts(vboxDriverPtr data, IVRDEServer *VRDEServer, - IMachine *machine, virDomainGraphicsDefPtr graphics) +_vrdeServerGetPorts(struct _vboxDriver *data, IVRDEServer *VRDEServer, + IMachine *machine, virDomainGraphicsDef *graphics) { nsresult rc; PRUnichar *VRDEPortsKey = NULL; @@ -1605,8 +1605,8 @@ _vrdeServerGetPorts(vboxDriverPtr data, IVRDEServer *VRDEServer, } static nsresult -_vrdeServerSetPorts(vboxDriverPtr data, IVRDEServer *VRDEServer, - virDomainGraphicsDefPtr graphics) +_vrdeServerSetPorts(struct _vboxDriver *data, IVRDEServer *VRDEServer, + virDomainGraphicsDef *graphics) { nsresult rc = 0; PRUnichar *VRDEPortsKey = NULL; @@ -1653,7 +1653,7 @@ _vrdeServerSetAllowMultiConnection(IVRDEServer *VRDEServer, PRBool enabled) } static nsresult -_vrdeServerGetNetAddress(vboxDriverPtr data G_GNUC_UNUSED, +_vrdeServerGetNetAddress(struct _vboxDriver *data G_GNUC_UNUSED, IVRDEServer *VRDEServer, PRUnichar **netAddress) { PRUnichar *VRDENetAddressKey = NULL; @@ -1667,7 +1667,7 @@ _vrdeServerGetNetAddress(vboxDriverPtr data G_GNUC_UNUSED, } static nsresult -_vrdeServerSetNetAddress(vboxDriverPtr data G_GNUC_UNUSED, +_vrdeServerSetNetAddress(struct _vboxDriver *data G_GNUC_UNUSED, IVRDEServer *VRDEServer, PRUnichar *netAddress) { PRUnichar *netAddressKey = NULL; @@ -2006,7 +2006,7 @@ _hostFindHostNetworkInterfaceByName(IHost *host, PRUnichar *name, } static nsresult -_hostCreateHostOnlyNetworkInterface(vboxDriverPtr data G_GNUC_UNUSED, +_hostCreateHostOnlyNetworkInterface(struct _vboxDriver *data G_GNUC_UNUSED, IHost *host, char *name G_GNUC_UNUSED, IHostNetworkInterface **networkInterface) { diff --git a/src/vbox/vbox_uniformed_api.h b/src/vbox/vbox_uniformed_api.h index 42c4ad3dfb..18f352d98e 100644 --- a/src/vbox/vbox_uniformed_api.h +++ b/src/vbox/vbox_uniformed_api.h @@ -76,9 +76,9 @@ typedef union { struct _vboxDriver { virObjectLockable parent; - virCapsPtr caps; - virDomainXMLOptionPtr xmlopt; - virObjectEventStatePtr domainEventState; + virCaps *caps; + virDomainXMLOption *xmlopt; + virObjectEventState *domainEventState; /* vbox API initialization members */ PCVBOXXPCOM pFuncs; @@ -95,7 +95,6 @@ struct _vboxDriver { }; typedef struct _vboxDriver vboxDriver; -typedef struct _vboxDriver *vboxDriverPtr; /* vboxUniformedAPI gives vbox_common.c a uniformed layer to see * vbox API. @@ -103,8 +102,8 @@ typedef struct _vboxDriver *vboxDriverPtr; /* Functions for pFuncs */ typedef struct { - int (*Initialize)(vboxDriverPtr driver); - void (*Uninitialize)(vboxDriverPtr driver); + int (*Initialize)(struct _vboxDriver *driver); + void (*Uninitialize)(struct _vboxDriver *driver); void (*ComUnallocMem)(PCVBOXXPCOM pFuncs, void *pv); void (*Utf16Free)(PCVBOXXPCOM pFuncs, PRUnichar *pwszString); void (*Utf8Free)(PCVBOXXPCOM pFuncs, char *pszString); @@ -115,13 +114,13 @@ typedef struct { /* Functions for vboxIID */ typedef struct { void (*vboxIIDInitialize)(vboxIID *iid); - void (*vboxIIDUnalloc)(vboxDriverPtr driver, vboxIID *iid); - void (*vboxIIDToUUID)(vboxDriverPtr driver, vboxIID *iid, unsigned char *uuid); - void (*vboxIIDFromUUID)(vboxDriverPtr driver, vboxIID *iid, const unsigned char *uuid); - bool (*vboxIIDIsEqual)(vboxDriverPtr driver, vboxIID *iid1, vboxIID *iid2); - void (*vboxIIDFromArrayItem)(vboxDriverPtr driver, vboxIID *iid, vboxArray *array, int idx); - void (*vboxIIDToUtf8)(vboxDriverPtr driver, vboxIID *iid, char **utf8); - void (*DEBUGIID)(vboxDriverPtr driver, const char *msg, vboxIID *iid); + void (*vboxIIDUnalloc)(struct _vboxDriver *driver, vboxIID *iid); + void (*vboxIIDToUUID)(struct _vboxDriver *driver, vboxIID *iid, unsigned char *uuid); + void (*vboxIIDFromUUID)(struct _vboxDriver *driver, vboxIID *iid, const unsigned char *uuid); + bool (*vboxIIDIsEqual)(struct _vboxDriver *driver, vboxIID *iid1, vboxIID *iid2); + void (*vboxIIDFromArrayItem)(struct _vboxDriver *driver, vboxIID *iid, vboxArray *array, int idx); + void (*vboxIIDToUtf8)(struct _vboxDriver *driver, vboxIID *iid, char **utf8); + void (*DEBUGIID)(struct _vboxDriver *driver, const char *msg, vboxIID *iid); } vboxUniformedIID; /* Functions for vboxArray */ @@ -157,7 +156,7 @@ typedef struct { nsresult (*OpenMachine)(IVirtualBox *vboxObj, PRUnichar *settingsFile, IMachine **machine); nsresult (*GetSystemProperties)(IVirtualBox *vboxObj, ISystemProperties **systemProperties); nsresult (*GetHost)(IVirtualBox *vboxObj, IHost **host); - nsresult (*CreateMachine)(vboxDriverPtr driver, virDomainDefPtr def, IMachine **machine, char *uuidstr); + nsresult (*CreateMachine)(struct _vboxDriver *driver, virDomainDef *def, IMachine **machine, char *uuidstr); nsresult (*CreateHardDisk)(IVirtualBox *vboxObj, PRUnichar *format, PRUnichar *location, IMedium **medium); nsresult (*RegisterMachine)(IVirtualBox *vboxObj, IMachine *machine); nsresult (*FindHardDisk)(IVirtualBox *vboxObj, PRUnichar *location, PRUint32 deviceType, @@ -182,7 +181,7 @@ typedef struct { PRUnichar *hostPath, PRBool writable, PRBool automount); nsresult (*RemoveSharedFolder)(IMachine *machine, PRUnichar *name); - nsresult (*LaunchVMProcess)(vboxDriverPtr driver, IMachine *machine, + nsresult (*LaunchVMProcess)(struct _vboxDriver *driver, IMachine *machine, vboxIID *iid, PRUnichar *sessionType, PRUnichar *env, IProgress **progress); @@ -229,8 +228,8 @@ typedef struct { /* Functions for ISession */ typedef struct { - nsresult (*Open)(vboxDriverPtr driver, vboxIID *iid, IMachine *machine); - nsresult (*OpenExisting)(vboxDriverPtr driver, vboxIID *iid, IMachine *machine); + nsresult (*Open)(struct _vboxDriver *driver, vboxIID *iid, IMachine *machine); + nsresult (*OpenExisting)(struct _vboxDriver *driver, vboxIID *iid, IMachine *machine); nsresult (*GetConsole)(ISession *session, IConsole **console); nsresult (*GetMachine)(ISession *session, IMachine **machine); nsresult (*Close)(ISession *session); @@ -340,17 +339,17 @@ typedef struct { typedef struct { nsresult (*GetEnabled)(IVRDEServer *VRDEServer, PRBool *enabled); nsresult (*SetEnabled)(IVRDEServer *VRDEServer, PRBool enabled); - nsresult (*GetPorts)(vboxDriverPtr driver, IVRDEServer *VRDEServer, - IMachine *machine, virDomainGraphicsDefPtr graphics); - nsresult (*SetPorts)(vboxDriverPtr driver, IVRDEServer *VRDEServer, - virDomainGraphicsDefPtr graphics); + nsresult (*GetPorts)(struct _vboxDriver *driver, IVRDEServer *VRDEServer, + IMachine *machine, virDomainGraphicsDef *graphics); + nsresult (*SetPorts)(struct _vboxDriver *driver, IVRDEServer *VRDEServer, + virDomainGraphicsDef *graphics); nsresult (*GetReuseSingleConnection)(IVRDEServer *VRDEServer, PRBool *enabled); nsresult (*SetReuseSingleConnection)(IVRDEServer *VRDEServer, PRBool enabled); nsresult (*GetAllowMultiConnection)(IVRDEServer *VRDEServer, PRBool *enabled); nsresult (*SetAllowMultiConnection)(IVRDEServer *VRDEServer, PRBool enabled); - nsresult (*GetNetAddress)(vboxDriverPtr driver, IVRDEServer *VRDEServer, + nsresult (*GetNetAddress)(struct _vboxDriver *driver, IVRDEServer *VRDEServer, PRUnichar **netAddress); - nsresult (*SetNetAddress)(vboxDriverPtr driver, IVRDEServer *VRDEServer, + nsresult (*SetNetAddress)(struct _vboxDriver *driver, IVRDEServer *VRDEServer, PRUnichar *netAddress); } vboxUniformedIVRDEServer; @@ -455,7 +454,7 @@ typedef struct { IHostNetworkInterface **networkInterface); nsresult (*FindHostNetworkInterfaceByName)(IHost *host, PRUnichar *name, IHostNetworkInterface **networkInterface); - nsresult (*CreateHostOnlyNetworkInterface)(vboxDriverPtr driver, + nsresult (*CreateHostOnlyNetworkInterface)(struct _vboxDriver *driver, IHost *host, char *name, IHostNetworkInterface **networkInterface); nsresult (*RemoveHostOnlyNetworkInterface)(IHost *host, vboxIID *iid, @@ -512,9 +511,9 @@ typedef struct { uint32_t APIVersion; uint32_t XPCOMCVersion; /* vbox APIs */ - nsresult (*unregisterMachine)(vboxDriverPtr driver, vboxIID *iid, IMachine **machine); + nsresult (*unregisterMachine)(struct _vboxDriver *driver, vboxIID *iid, IMachine **machine); void (*deleteConfig)(IMachine *machine); - void (*vboxAttachDrivesOld)(virDomainDefPtr def, vboxDriverPtr driver, IMachine *machine); + void (*vboxAttachDrivesOld)(virDomainDef *def, struct _vboxDriver *driver, IMachine *machine); virDomainState (*vboxConvertState)(PRUint32 state); int (*snapshotRestore)(virDomainPtr dom, IMachine *machine, ISnapshot *snapshot); vboxUniformedPFN UPFN; diff --git a/src/vmware/vmware_conf.c b/src/vmware/vmware_conf.c index f905962b85..6b0d3f9610 100644 --- a/src/vmware/vmware_conf.c +++ b/src/vmware/vmware_conf.c @@ -61,11 +61,11 @@ vmwareFreeDriver(struct vmware_driver *driver) } -virCapsPtr +virCaps * vmwareCapsInit(void) { - virCapsPtr caps = NULL; - virCapsGuestPtr guest = NULL; + virCaps *caps = NULL; + virCapsGuest *guest = NULL; if ((caps = virCapabilitiesNew(virArchFromHost(), false, false)) == NULL) @@ -127,8 +127,8 @@ vmwareCapsInit(void) int vmwareLoadDomains(struct vmware_driver *driver) { - virDomainDefPtr vmdef = NULL; - virDomainObjPtr vm = NULL; + virDomainDef *vmdef = NULL; + virDomainObj *vm = NULL; char *vmxPath = NULL; char *vmx = NULL; vmwareDomainPtr pDomain; @@ -137,7 +137,7 @@ vmwareLoadDomains(struct vmware_driver *driver) char *outbuf = NULL; char *str; char *saveptr = NULL; - virCommandPtr cmd; + virCommand *cmd; ctx.parseFileName = vmwareParseVMXFileName; ctx.formatFileName = NULL; @@ -261,7 +261,7 @@ int vmwareExtractVersion(struct vmware_driver *driver) { int ret = -1; - virCommandPtr cmd = NULL; + virCommand *cmd = NULL; char * outbuf = NULL; char *bin = NULL; char *vmwarePath = NULL; @@ -308,7 +308,7 @@ vmwareExtractVersion(struct vmware_driver *driver) } int -vmwareDomainConfigDisplay(vmwareDomainPtr pDomain, virDomainDefPtr def) +vmwareDomainConfigDisplay(vmwareDomainPtr pDomain, virDomainDef *def) { size_t i; @@ -363,9 +363,9 @@ vmwareConstructVmxPath(char *directoryName, char *name, char **vmxPath) } int -vmwareVmxPath(virDomainDefPtr vmdef, char **vmxPath) +vmwareVmxPath(virDomainDef *vmdef, char **vmxPath) { - virDomainDiskDefPtr disk = NULL; + virDomainDiskDef *disk = NULL; char *directoryName = NULL; char *fileName = NULL; int ret = -1; diff --git a/src/vmware/vmware_conf.h b/src/vmware/vmware_conf.h index 4974260e68..d91b84f38f 100644 --- a/src/vmware/vmware_conf.h +++ b/src/vmware/vmware_conf.h @@ -42,10 +42,10 @@ VIR_ENUM_DECL(vmwareDriver); struct vmware_driver { virMutex lock; - virCapsPtr caps; - virDomainXMLOptionPtr xmlopt; + virCaps *caps; + virDomainXMLOption *xmlopt; - virDomainObjListPtr domains; + virDomainObjList *domains; unsigned long version; int type; char *vmrun; @@ -59,7 +59,7 @@ typedef struct _vmwareDomain { void vmwareFreeDriver(struct vmware_driver *driver); -virCapsPtr vmwareCapsInit(void); +virCaps *vmwareCapsInit(void); int vmwareLoadDomains(struct vmware_driver *driver); @@ -69,12 +69,12 @@ int vmwareExtractVersion(struct vmware_driver *driver); int vmwareParseVersionStr(int type, const char *buf, unsigned long *version); -int vmwareDomainConfigDisplay(vmwareDomainPtr domain, virDomainDefPtr vmdef); +int vmwareDomainConfigDisplay(vmwareDomainPtr domain, virDomainDef *vmdef); void vmwareConstructVmxPath(char *directoryName, char *name, char **vmxPath); -int vmwareVmxPath(virDomainDefPtr vmdef, char **vmxPath); +int vmwareVmxPath(virDomainDef *vmdef, char **vmxPath); int vmwareMoveFile(char *srcFile, char *dstFile); diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c index 5f1edeb7f5..62f653e86f 100644 --- a/src/vmware/vmware_driver.c +++ b/src/vmware/vmware_driver.c @@ -60,11 +60,11 @@ vmwareDriverUnlock(struct vmware_driver *driver) } -static virDomainObjPtr +static virDomainObj * vmwareDomObjFromDomainLocked(struct vmware_driver *driver, const unsigned char *uuid) { - virDomainObjPtr vm; + virDomainObj *vm; char uuidstr[VIR_UUID_STRING_BUFLEN]; if (!(vm = virDomainObjListFindByUUID(driver->domains, uuid))) { @@ -79,11 +79,11 @@ vmwareDomObjFromDomainLocked(struct vmware_driver *driver, } -static virDomainObjPtr +static virDomainObj * vmwareDomObjFromDomain(struct vmware_driver *driver, const unsigned char *uuid) { - virDomainObjPtr vm; + virDomainObj *vm; vmwareDriverLock(driver); vm = vmwareDomObjFromDomainLocked(driver, uuid); @@ -115,7 +115,7 @@ vmwareDataFreeFunc(void *data) } static int -vmwareDomainDefPostParse(virDomainDefPtr def, +vmwareDomainDefPostParse(virDomainDef *def, unsigned int parseFlags G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED, void *parseOpaque G_GNUC_UNUSED) @@ -130,7 +130,7 @@ vmwareDomainDefPostParse(virDomainDefPtr def, } static int -vmwareDomainDeviceDefPostParse(virDomainDeviceDefPtr dev G_GNUC_UNUSED, +vmwareDomainDeviceDefPostParse(virDomainDeviceDef *dev G_GNUC_UNUSED, const virDomainDef *def G_GNUC_UNUSED, unsigned int parseFlags G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED, @@ -149,7 +149,7 @@ virDomainDefParserConfig vmwareDomainDefParserConfig = { .defArch = VIR_ARCH_I686, }; -static virDomainXMLOptionPtr +static virDomainXMLOption * vmwareDomainXMLConfigInit(struct vmware_driver *driver) { virDomainXMLPrivateDataCallbacks priv = { .alloc = vmwareDataAllocFunc, @@ -162,7 +162,7 @@ vmwareDomainXMLConfigInit(struct vmware_driver *driver) static virDrvOpenStatus vmwareConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { struct vmware_driver *driver; @@ -282,9 +282,9 @@ vmwareConnectGetVersion(virConnectPtr conn, unsigned long *version) } static int -vmwareUpdateVMStatus(struct vmware_driver *driver, virDomainObjPtr vm) +vmwareUpdateVMStatus(struct vmware_driver *driver, virDomainObj *vm) { - virCommandPtr cmd; + virCommand *cmd; char *outbuf = NULL; char *vmxAbsolutePath = NULL; char *parsedVmxPath = NULL; @@ -342,7 +342,7 @@ vmwareUpdateVMStatus(struct vmware_driver *driver, virDomainObjPtr vm) static int vmwareStopVM(struct vmware_driver *driver, - virDomainObjPtr vm, + virDomainObj *vm, virDomainShutoffReason reason) { g_autoptr(virCommand) cmd = virCommandNew(driver->vmrun); @@ -360,7 +360,7 @@ vmwareStopVM(struct vmware_driver *driver, } static int -vmwareStartVM(struct vmware_driver *driver, virDomainObjPtr vm) +vmwareStartVM(struct vmware_driver *driver, virDomainObj *vm) { g_autoptr(virCommand) cmd = virCommandNew(driver->vmrun); const char *vmxPath = ((vmwareDomainPtr) vm->privateData)->vmxPath; @@ -394,8 +394,8 @@ static virDomainPtr vmwareDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags) { struct vmware_driver *driver = conn->privateData; - virDomainDefPtr vmdef = NULL; - virDomainObjPtr vm = NULL; + virDomainDef *vmdef = NULL; + virDomainObj *vm = NULL; virDomainPtr dom = NULL; char *vmx = NULL; char *vmxPath = NULL; @@ -475,7 +475,7 @@ vmwareDomainShutdownFlags(virDomainPtr dom, unsigned int flags) { struct vmware_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -532,7 +532,7 @@ vmwareDomainSuspend(virDomainPtr dom) struct vmware_driver *driver = dom->conn->privateData; g_autoptr(virCommand) cmd = virCommandNew(driver->vmrun); - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (driver->type == VMWARE_DRIVER_PLAYER) { @@ -572,7 +572,7 @@ vmwareDomainResume(virDomainPtr dom) struct vmware_driver *driver = dom->conn->privateData; g_autoptr(virCommand) cmd = virCommandNew(driver->vmrun); - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (driver->type == VMWARE_DRIVER_PLAYER) { @@ -611,7 +611,7 @@ vmwareDomainReboot(virDomainPtr dom, unsigned int flags) { struct vmware_driver *driver = dom->conn->privateData; g_autoptr(virCommand) cmd = virCommandNew(driver->vmrun); - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -647,8 +647,8 @@ vmwareDomainCreateXML(virConnectPtr conn, const char *xml, unsigned int flags) { struct vmware_driver *driver = conn->privateData; - virDomainDefPtr vmdef = NULL; - virDomainObjPtr vm = NULL; + virDomainDef *vmdef = NULL; + virDomainObj *vm = NULL; virDomainPtr dom = NULL; char *vmx = NULL; char *vmxPath = NULL; @@ -724,7 +724,7 @@ vmwareDomainCreateWithFlags(virDomainPtr dom, unsigned int flags) { struct vmware_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -761,7 +761,7 @@ vmwareDomainUndefineFlags(virDomainPtr dom, unsigned int flags) { struct vmware_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -802,7 +802,7 @@ static virDomainPtr vmwareDomainLookupByID(virConnectPtr conn, int id) { struct vmware_driver *driver = conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; virDomainPtr dom = NULL; vmwareDriverLock(driver); @@ -826,7 +826,7 @@ static char * vmwareDomainGetOSType(virDomainPtr dom) { struct vmware_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; char *ret = NULL; if (!(vm = vmwareDomObjFromDomain(driver, dom->uuid))) @@ -843,7 +843,7 @@ static virDomainPtr vmwareDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { struct vmware_driver *driver = conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; virDomainPtr dom = NULL; if (!(vm = vmwareDomObjFromDomain(driver, uuid))) @@ -859,7 +859,7 @@ static virDomainPtr vmwareDomainLookupByName(virConnectPtr conn, const char *name) { struct vmware_driver *driver = conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; virDomainPtr dom = NULL; vmwareDriverLock(driver); @@ -883,7 +883,7 @@ static int vmwareDomainIsActive(virDomainPtr dom) { struct vmware_driver *driver = dom->conn->privateData; - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = vmwareDomObjFromDomain(driver, dom->uuid))) @@ -900,7 +900,7 @@ static int vmwareDomainIsPersistent(virDomainPtr dom) { struct vmware_driver *driver = dom->conn->privateData; - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; if (!(obj = vmwareDomObjFromDomain(driver, dom->uuid))) @@ -917,7 +917,7 @@ static char * vmwareDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) { struct vmware_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; char *ret = NULL; virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS, NULL); @@ -939,7 +939,7 @@ vmwareConnectDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat, { struct vmware_driver *driver = conn->privateData; virVMXContext ctx; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; char *xml = NULL; virCheckFlags(0, NULL); @@ -966,7 +966,7 @@ vmwareConnectDomainXMLFromNative(virConnectPtr conn, const char *nativeFormat, return xml; } -static int vmwareDomainObjListUpdateDomain(virDomainObjPtr dom, void *data) +static int vmwareDomainObjListUpdateDomain(virDomainObj *dom, void *data) { struct vmware_driver *driver = data; virObjectLock(dom); @@ -976,7 +976,7 @@ static int vmwareDomainObjListUpdateDomain(virDomainObjPtr dom, void *data) } static void -vmwareDomainObjListUpdateAll(virDomainObjListPtr doms, struct vmware_driver *driver) +vmwareDomainObjListUpdateAll(virDomainObjList *doms, struct vmware_driver *driver) { virDomainObjListForEach(doms, false, vmwareDomainObjListUpdateDomain, driver); } @@ -1043,7 +1043,7 @@ static int vmwareDomainGetInfo(virDomainPtr dom, virDomainInfoPtr info) { struct vmware_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; if (!(vm = vmwareDomObjFromDomain(driver, dom->uuid))) @@ -1071,7 +1071,7 @@ vmwareDomainGetState(virDomainPtr dom, unsigned int flags) { struct vmware_driver *driver = dom->conn->privateData; - virDomainObjPtr vm; + virDomainObj *vm; int ret = -1; virCheckFlags(0, -1); @@ -1118,7 +1118,7 @@ static int vmwareDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags) { struct vmware_driver *driver = dom->conn->privateData; - virDomainObjPtr obj; + virDomainObj *obj; int ret = -1; virCheckFlags(0, -1); diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 89d08c1ce0..7aa76c0055 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -565,48 +565,48 @@ VIR_ENUM_IMPL(virVMXControllerModelSCSI, "UNUSED am53c974", ); -static int virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def); -static int virVMXParseSCSIController(virConfPtr conf, int controller, bool *present, +static int virVMXParseVNC(virConf *conf, virDomainGraphicsDef **def); +static int virVMXParseSCSIController(virConf *conf, int controller, bool *present, int *virtualDev); -static int virVMXParseSATAController(virConfPtr conf, int controller, bool *present); -static int virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, - virConfPtr conf, int device, int busType, - int controllerOrBus, int unit, virDomainDiskDefPtr *def, - virDomainDefPtr vmdef); -static int virVMXParseFileSystem(virConfPtr conf, int number, virDomainFSDefPtr *def); -static int virVMXParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def); -static int virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, int port, - virDomainChrDefPtr *def); -static int virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, int port, - virDomainChrDefPtr *def); -static int virVMXParseSVGA(virConfPtr conf, virDomainVideoDefPtr *def); +static int virVMXParseSATAController(virConf *conf, int controller, bool *present); +static int virVMXParseDisk(virVMXContext *ctx, virDomainXMLOption *xmlopt, + virConf *conf, int device, int busType, + int controllerOrBus, int unit, virDomainDiskDef **def, + virDomainDef *vmdef); +static int virVMXParseFileSystem(virConf *conf, int number, virDomainFSDef **def); +static int virVMXParseEthernet(virConf *conf, int controller, virDomainNetDef **def); +static int virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port, + virDomainChrDef **def); +static int virVMXParseParallel(virVMXContext *ctx, virConf *conf, int port, + virDomainChrDef **def); +static int virVMXParseSVGA(virConf *conf, virDomainVideoDef **def); -static int virVMXFormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer); -static int virVMXFormatDisk(virVMXContext *ctx, virDomainDiskDefPtr def, - virBufferPtr buffer); -static int virVMXFormatFloppy(virVMXContext *ctx, virDomainDiskDefPtr def, - virBufferPtr buffer, bool floppy_present[2]); -static int virVMXFormatFileSystem(virDomainFSDefPtr def, int number, - virBufferPtr buffer); -static int virVMXFormatEthernet(virDomainNetDefPtr def, int controller, - virBufferPtr buffer, int virtualHW_version); -static int virVMXFormatSerial(virVMXContext *ctx, virDomainChrDefPtr def, - virBufferPtr buffer); -static int virVMXFormatParallel(virVMXContext *ctx, virDomainChrDefPtr def, - virBufferPtr buffer); -static int virVMXFormatSVGA(virDomainVideoDefPtr def, virBufferPtr buffer); +static int virVMXFormatVNC(virDomainGraphicsDef *def, virBuffer *buffer); +static int virVMXFormatDisk(virVMXContext *ctx, virDomainDiskDef *def, + virBuffer *buffer); +static int virVMXFormatFloppy(virVMXContext *ctx, virDomainDiskDef *def, + virBuffer *buffer, bool floppy_present[2]); +static int virVMXFormatFileSystem(virDomainFSDef *def, int number, + virBuffer *buffer); +static int virVMXFormatEthernet(virDomainNetDef *def, int controller, + virBuffer *buffer, int virtualHW_version); +static int virVMXFormatSerial(virVMXContext *ctx, virDomainChrDef *def, + virBuffer *buffer); +static int virVMXFormatParallel(virVMXContext *ctx, virDomainChrDef *def, + virBuffer *buffer); +static int virVMXFormatSVGA(virDomainVideoDef *def, virBuffer *buffer); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Helpers */ static int -virVMXDomainDefPostParse(virDomainDefPtr def, +virVMXDomainDefPostParse(virDomainDef *def, unsigned int parseFlags G_GNUC_UNUSED, void *opaque, void *parseOpaque G_GNUC_UNUSED) { - virCapsPtr caps = opaque; + virCaps *caps = opaque; if (!virCapabilitiesDomainSupported(caps, def->os.type, def->os.arch, def->virtType)) @@ -616,7 +616,7 @@ virVMXDomainDefPostParse(virDomainDefPtr def, } static int -virVMXDomainDevicesDefPostParse(virDomainDeviceDefPtr dev G_GNUC_UNUSED, +virVMXDomainDevicesDefPostParse(virDomainDeviceDef *dev G_GNUC_UNUSED, const virDomainDef *def G_GNUC_UNUSED, unsigned int parseFlags G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED, @@ -657,7 +657,7 @@ virVMXDomainDefNamespaceFree(void *nsdata) } static int -virVMXDomainDefNamespaceFormatXML(virBufferPtr buf, void *nsdata) +virVMXDomainDefNamespaceFormatXML(virBuffer *buf, void *nsdata) { struct virVMXDomainDefNamespaceData *data = nsdata; @@ -686,8 +686,8 @@ static virXMLNamespace virVMXDomainXMLNamespace = { .uri = "http://libvirt.org/schemas/domain/vmware/1.0", }; -virDomainXMLOptionPtr -virVMXDomainXMLConfInit(virCapsPtr caps) +virDomainXMLOption * +virVMXDomainXMLConfInit(virCaps *caps) { virVMXDomainDefParserConfig.priv = caps; return virDomainXMLOptionNew(&virVMXDomainDefParserConfig, NULL, @@ -798,7 +798,7 @@ virVMXConvertToUTF8(const char *encoding, const char *string) static int -virVMXGetConfigStringHelper(virConfPtr conf, const char *name, char **string, +virVMXGetConfigStringHelper(virConf *conf, const char *name, char **string, bool optional) { int rc; @@ -819,7 +819,7 @@ virVMXGetConfigStringHelper(virConfPtr conf, const char *name, char **string, static int -virVMXGetConfigString(virConfPtr conf, const char *name, char **string, +virVMXGetConfigString(virConf *conf, const char *name, char **string, bool optional) { *string = NULL; @@ -833,7 +833,7 @@ virVMXGetConfigString(virConfPtr conf, const char *name, char **string, static int -virVMXGetConfigUUID(virConfPtr conf, const char *name, unsigned char *uuid, +virVMXGetConfigUUID(virConf *conf, const char *name, unsigned char *uuid, bool optional) { char *string = NULL; @@ -861,7 +861,7 @@ virVMXGetConfigUUID(virConfPtr conf, const char *name, unsigned char *uuid, static int -virVMXGetConfigLong(virConfPtr conf, const char *name, long long *number, +virVMXGetConfigLong(virConf *conf, const char *name, long long *number, long long default_, bool optional) { char *string = NULL; @@ -893,7 +893,7 @@ virVMXGetConfigLong(virConfPtr conf, const char *name, long long *number, static int -virVMXGetConfigBoolean(virConfPtr conf, const char *name, bool *boolean_, +virVMXGetConfigBoolean(virConf *conf, const char *name, bool *boolean_, bool default_, bool optional) { char *string = NULL; @@ -1035,12 +1035,12 @@ virVMXFloppyDiskNameToUnit(const char *name, int *unit) static int -virVMXVerifyDiskAddress(virDomainXMLOptionPtr xmlopt, - virDomainDiskDefPtr disk, - virDomainDefPtr vmdef) +virVMXVerifyDiskAddress(virDomainXMLOption *xmlopt, + virDomainDiskDef *disk, + virDomainDef *vmdef) { virDomainDiskDef def; - virDomainDeviceDriveAddressPtr drive; + virDomainDeviceDriveAddress *drive; memset(&def, 0, sizeof(def)); @@ -1148,13 +1148,13 @@ virVMXVerifyDiskAddress(virDomainXMLOptionPtr xmlopt, static int -virVMXHandleLegacySCSIDiskDriverName(virDomainDefPtr def, - virDomainDiskDefPtr disk) +virVMXHandleLegacySCSIDiskDriverName(virDomainDef *def, + virDomainDiskDef *disk) { char *tmp; int model; size_t i; - virDomainControllerDefPtr controller = NULL; + virDomainControllerDef *controller = NULL; const char *driver = virDomainDiskGetDriver(disk); char *copy; @@ -1207,13 +1207,13 @@ virVMXHandleLegacySCSIDiskDriverName(virDomainDefPtr def, static int -virVMXGatherSCSIControllers(virVMXContext *ctx, virDomainDefPtr def, +virVMXGatherSCSIControllers(virVMXContext *ctx, virDomainDef *def, int virtualDev[4], bool present[4]) { int result = -1; size_t i, k; - virDomainDiskDefPtr disk; - virDomainControllerDefPtr controller; + virDomainDiskDef *disk; + virDomainControllerDef *controller; bool controllerHasDisksAttached; int count = 0; int *autodetectedModels; @@ -1312,7 +1312,7 @@ struct virVMXConfigScanResults { static int virVMXConfigScanResultsCollector(const char* name, - virConfValuePtr value G_GNUC_UNUSED, + virConfValue *value G_GNUC_UNUSED, void *opaque) { struct virVMXConfigScanResults *results = opaque; @@ -1342,17 +1342,17 @@ virVMXConfigScanResultsCollector(const char* name, * VMX -> Domain XML */ -virDomainDefPtr +virDomainDef * virVMXParseConfig(virVMXContext *ctx, - virDomainXMLOptionPtr xmlopt, - virCapsPtr caps G_GNUC_UNUSED, + virDomainXMLOption *xmlopt, + virCaps *caps G_GNUC_UNUSED, const char *vmx) { bool success = false; g_autoptr(virConf) conf = NULL; char *encoding = NULL; char *utf8; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; long long config_version = 0; long long virtualHW_version = 0; long long memsize = 0; @@ -1373,7 +1373,7 @@ virVMXParseConfig(virVMXContext *ctx, long long sharedFolder_maxNum = 0; struct virVMXConfigScanResults results = { -1 }; long long coresPerSocket = 0; - virCPUDefPtr cpu = NULL; + virCPUDef *cpu = NULL; char *firmware = NULL; size_t saved_ndisks = 0; @@ -1676,7 +1676,7 @@ virVMXParseConfig(virVMXContext *ctx, /* FIXME */ /* def:graphics */ - def->graphics = g_new0(virDomainGraphicsDefPtr, 1); + def->graphics = g_new0(virDomainGraphicsDef *, 1); def->ngraphics = 0; if (virVMXParseVNC(conf, &def->graphics[def->ngraphics]) < 0) @@ -1686,7 +1686,7 @@ virVMXParseConfig(virVMXContext *ctx, ++def->ngraphics; /* def:disks: 4 * 15 scsi + 4 * 30 sata + 2 * 2 ide + 2 floppy = 186 */ - def->disks = g_new0(virDomainDiskDefPtr, 186); + def->disks = g_new0(virDomainDiskDef *, 186); def->ndisks = 0; /* def:disks (scsi) */ @@ -1734,7 +1734,7 @@ virVMXParseConfig(virVMXContext *ctx, /* add all the SCSI controllers we've seen, up until the last one that is * currently used by a disk */ if (def->ndisks != 0) { - virDomainDeviceInfoPtr info = &def->disks[def->ndisks - 1]->info; + virDomainDeviceInfo *info = &def->disks[def->ndisks - 1]->info; for (controller = 0; controller <= info->addr.drive.controller; controller++) { if (!virDomainDefAddController(def, VIR_DOMAIN_CONTROLLER_TYPE_SCSI, controller, scsi_virtualDev[controller])) @@ -1779,7 +1779,7 @@ virVMXParseConfig(virVMXContext *ctx, /* add all the SATA controllers we've seen, up until the last one that is * currently used by a disk */ if (def->ndisks - saved_ndisks != 0) { - virDomainDeviceInfoPtr info = &def->disks[def->ndisks - 1]->info; + virDomainDeviceInfo *info = &def->disks[def->ndisks - 1]->info; for (controller = 0; controller <= info->addr.drive.controller; controller++) { if (!virDomainDefAddController(def, VIR_DOMAIN_CONTROLLER_TYPE_SATA, controller, -1)) @@ -1839,7 +1839,7 @@ virVMXParseConfig(virVMXContext *ctx, if (sharedFolder_maxNum > 0) { int number; - def->fss = g_new0(virDomainFSDefPtr, sharedFolder_maxNum); + def->fss = g_new0(virDomainFSDef *, sharedFolder_maxNum); def->nfss = 0; for (number = 0; number < sharedFolder_maxNum; ++number) { @@ -1856,7 +1856,7 @@ virVMXParseConfig(virVMXContext *ctx, /* def:nets */ for (controller = 0; controller <= results.networks_max_index; ++controller) { - virDomainNetDefPtr net = NULL; + virDomainNetDef *net = NULL; if (virVMXParseEthernet(conf, controller, &net) < 0) goto cleanup; @@ -1871,7 +1871,7 @@ virVMXParseConfig(virVMXContext *ctx, /* FIXME */ /* def:videos */ - def->videos = g_new0(virDomainVideoDefPtr, 1); + def->videos = g_new0(virDomainVideoDef *, 1); def->nvideos = 0; if (virVMXParseSVGA(conf, &def->videos[def->nvideos]) < 0) @@ -1886,7 +1886,7 @@ virVMXParseConfig(virVMXContext *ctx, /* FIXME */ /* def:serials */ - def->serials = g_new0(virDomainChrDefPtr, 4); + def->serials = g_new0(virDomainChrDef *, 4); def->nserials = 0; for (port = 0; port < 4; ++port) { @@ -1900,7 +1900,7 @@ virVMXParseConfig(virVMXContext *ctx, } /* def:parallels */ - def->parallels = g_new0(virDomainChrDefPtr, 3); + def->parallels = g_new0(virDomainChrDef *, 3); def->nparallels = 0; for (port = 0; port < 3; ++port) { @@ -1967,7 +1967,7 @@ virVMXParseConfig(virVMXContext *ctx, static int -virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def) +virVMXParseVNC(virConf *conf, virDomainGraphicsDef **def) { bool enabled = false; long long port = 0; @@ -2031,7 +2031,7 @@ virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def) static int -virVMXParseSCSIController(virConfPtr conf, int controller, bool *present, +virVMXParseSCSIController(virConf *conf, int controller, bool *present, int *virtualDev) { int result = -1; @@ -2101,7 +2101,7 @@ virVMXParseSCSIController(virConfPtr conf, int controller, bool *present, static int -virVMXParseSATAController(virConfPtr conf, int controller, bool *present) +virVMXParseSATAController(virConf *conf, int controller, bool *present) { char present_name[32]; @@ -2123,9 +2123,9 @@ virVMXParseSATAController(virConfPtr conf, int controller, bool *present) static int -virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr conf, +virVMXParseDisk(virVMXContext *ctx, virDomainXMLOption *xmlopt, virConf *conf, int device, int busType, int controllerOrBus, int unit, - virDomainDiskDefPtr *def, virDomainDefPtr vmdef) + virDomainDiskDef **def, virDomainDef *vmdef) { /* * device = {VIR_DOMAIN_DISK_DEVICE_DISK, @@ -2550,7 +2550,7 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr con static int -virVMXParseFileSystem(virConfPtr conf, int number, virDomainFSDefPtr *def) +virVMXParseFileSystem(virConf *conf, int number, virDomainFSDef **def) { int result = -1; char prefix[48] = ""; @@ -2636,7 +2636,7 @@ virVMXParseFileSystem(virConfPtr conf, int number, virDomainFSDefPtr *def) static int -virVMXParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def) +virVMXParseEthernet(virConf *conf, int controller, virDomainNetDef **def) { int result = -1; char prefix[48] = ""; @@ -2858,8 +2858,8 @@ virVMXParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def) static int -virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, int port, - virDomainChrDefPtr *def) +virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port, + virDomainChrDef **def) { int result = -1; char prefix[48] = ""; @@ -2879,7 +2879,7 @@ virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, int port, char network_endPoint_name[48] = ""; char *network_endPoint = NULL; - virURIPtr parsedUri = NULL; + virURI *parsedUri = NULL; if (def == NULL || *def != NULL) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); @@ -3036,8 +3036,8 @@ virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, int port, static int -virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, int port, - virDomainChrDefPtr *def) +virVMXParseParallel(virVMXContext *ctx, virConf *conf, int port, + virDomainChrDef **def) { int result = -1; char prefix[48] = ""; @@ -3136,7 +3136,7 @@ virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, int port, static int -virVMXParseSVGA(virConfPtr conf, virDomainVideoDefPtr *def) +virVMXParseSVGA(virConf *conf, virDomainVideoDef **def) { int result = -1; long long svga_vramSize = 0; @@ -3175,7 +3175,7 @@ virVMXParseSVGA(virConfPtr conf, virDomainVideoDefPtr *def) */ char * -virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDefPtr def, +virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOption *xmlopt, virDomainDef *def, int virtualHW_version) { char *vmx = NULL; @@ -3577,9 +3577,9 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virDomainDe static int -virVMXFormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer) +virVMXFormatVNC(virDomainGraphicsDef *def, virBuffer *buffer) { - virDomainGraphicsListenDefPtr glisten; + virDomainGraphicsListenDef *glisten; if (def->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Invalid argument")); @@ -3621,8 +3621,8 @@ virVMXFormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer) } static int -virVMXFormatDisk(virVMXContext *ctx, virDomainDiskDefPtr def, - virBufferPtr buffer) +virVMXFormatDisk(virVMXContext *ctx, virDomainDiskDef *def, + virBuffer *buffer) { int controllerOrBus, unit; const char *vmxDeviceType = NULL; @@ -3768,8 +3768,8 @@ virVMXFormatDisk(virVMXContext *ctx, virDomainDiskDefPtr def, } static int -virVMXFormatFloppy(virVMXContext *ctx, virDomainDiskDefPtr def, - virBufferPtr buffer, bool floppy_present[2]) +virVMXFormatFloppy(virVMXContext *ctx, virDomainDiskDef *def, + virBuffer *buffer, bool floppy_present[2]) { int unit; char *fileName = NULL; @@ -3825,7 +3825,7 @@ virVMXFormatFloppy(virVMXContext *ctx, virDomainDiskDefPtr def, static int -virVMXFormatFileSystem(virDomainFSDefPtr def, int number, virBufferPtr buffer) +virVMXFormatFileSystem(virDomainFSDef *def, int number, virBuffer *buffer) { if (def->type != VIR_DOMAIN_FS_TYPE_MOUNT) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, @@ -3850,8 +3850,8 @@ virVMXFormatFileSystem(virDomainFSDefPtr def, int number, virBufferPtr buffer) static int -virVMXFormatEthernet(virDomainNetDefPtr def, int controller, - virBufferPtr buffer, int virtualHW_version) +virVMXFormatEthernet(virDomainNetDef *def, int controller, + virBuffer *buffer, int virtualHW_version) { char mac_string[VIR_MAC_STRING_BUFLEN]; virDomainNetMacType mac_type = VIR_DOMAIN_NET_MAC_TYPE_DEFAULT; @@ -4006,8 +4006,8 @@ virVMXFormatEthernet(virDomainNetDefPtr def, int controller, static int -virVMXFormatSerial(virVMXContext *ctx, virDomainChrDefPtr def, - virBufferPtr buffer) +virVMXFormatSerial(virVMXContext *ctx, virDomainChrDef *def, + virBuffer *buffer) { char *fileName = NULL; const char *protocol; @@ -4112,8 +4112,8 @@ virVMXFormatSerial(virVMXContext *ctx, virDomainChrDefPtr def, static int -virVMXFormatParallel(virVMXContext *ctx, virDomainChrDefPtr def, - virBufferPtr buffer) +virVMXFormatParallel(virVMXContext *ctx, virDomainChrDef *def, + virBuffer *buffer) { char *fileName = NULL; @@ -4164,7 +4164,7 @@ virVMXFormatParallel(virVMXContext *ctx, virDomainChrDefPtr def, static int -virVMXFormatSVGA(virDomainVideoDefPtr def, virBufferPtr buffer) +virVMXFormatSVGA(virDomainVideoDef *def, virBuffer *buffer) { unsigned long long vram; diff --git a/src/vmx/vmx.h b/src/vmx/vmx.h index 550c1264f3..f05c7db33a 100644 --- a/src/vmx/vmx.h +++ b/src/vmx/vmx.h @@ -29,7 +29,7 @@ typedef struct _virVMXContext virVMXContext; -virDomainXMLOptionPtr virVMXDomainXMLConfInit(virCapsPtr caps); +virDomainXMLOption *virVMXDomainXMLConfInit(virCaps *caps); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -41,7 +41,7 @@ typedef int (*virVMXParseFileName)(const char *fileName, char **src, bool allow_missing); typedef char * (*virVMXFormatFileName)(const char *src, void *opaque); -typedef int (*virVMXAutodetectSCSIControllerModel)(virDomainDiskDefPtr def, +typedef int (*virVMXAutodetectSCSIControllerModel)(virDomainDiskDef *def, int *model, void *opaque); /* @@ -86,9 +86,9 @@ char *virVMXConvertToUTF8(const char *encoding, const char *string); * VMX -> Domain XML */ -virDomainDefPtr virVMXParseConfig(virVMXContext *ctx, - virDomainXMLOptionPtr xmlopt, - virCapsPtr caps, +virDomainDef *virVMXParseConfig(virVMXContext *ctx, + virDomainXMLOption *xmlopt, + virCaps *caps, const char *vmx); @@ -97,5 +97,5 @@ virDomainDefPtr virVMXParseConfig(virVMXContext *ctx, * Domain XML -> VMX */ -char *virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, - virDomainDefPtr def, int virtualHW_version); +char *virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOption *xmlopt, + virDomainDef *def, int virtualHW_version); diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c index d8ad2499ab..a9cd3d90c9 100644 --- a/src/vz/vz_driver.c +++ b/src/vz/vz_driver.c @@ -62,26 +62,26 @@ VIR_LOG_INIT("parallels.parallels_driver"); #define VZ_STATEDIR RUNSTATEDIR "/libvirt/vz" -static virClassPtr vzDriverClass; +static virClass *vzDriverClass; static bool vz_driver_privileged; /* pid file FD, ensures two copies of the driver can't use the same root */ static int vz_driver_lock_fd = -1; static virMutex vz_driver_lock; -static vzDriverPtr vz_driver; -static vzConnPtr vz_conn_list; +static struct _vzDriver *vz_driver; +static struct _vzConn *vz_conn_list; -static vzDriverPtr +static struct _vzDriver * vzDriverObjNew(void); static int -vzCapsAddGuestDomain(virCapsPtr caps, +vzCapsAddGuestDomain(virCaps *caps, virDomainOSType ostype, virArch arch, const char * emulator, virDomainVirtType virt_type) { - virCapsGuestPtr guest; + virCapsGuest *guest; if ((guest = virCapabilitiesAddGuest(caps, ostype, arch, emulator, NULL, 0, NULL)) == NULL) @@ -95,10 +95,10 @@ vzCapsAddGuestDomain(virCapsPtr caps, return 0; } -static virCapsPtr +static virCaps * vzBuildCapabilities(void) { - virCapsPtr caps = NULL; + virCaps *caps = NULL; virNodeInfo nodeinfo; virDomainOSType ostypes[] = { VIR_DOMAIN_OSTYPE_HVM, @@ -150,7 +150,7 @@ vzBuildCapabilities(void) static void vzDriverDispose(void * obj) { - vzDriverPtr driver = obj; + struct _vzDriver *driver = obj; prlsdkDisconnect(driver); virObjectUnref(driver->domains); @@ -169,7 +169,7 @@ static int vzDriverOnceInit(void) } VIR_ONCE_GLOBAL_INIT(vzDriver); -vzDriverPtr +struct _vzDriver * vzGetDriverConnection(void) { if (!vz_driver_privileged) { @@ -189,8 +189,8 @@ vzGetDriverConnection(void) void vzDestroyDriverConnection(void) { - vzDriverPtr driver; - vzConnPtr privconn_list; + struct _vzDriver *driver; + struct _vzConn *privconn_list; virMutexLock(&vz_driver_lock); driver = g_steal_pointer(&vz_driver); @@ -198,7 +198,7 @@ vzDestroyDriverConnection(void) virMutexUnlock(&vz_driver_lock); while (privconn_list) { - vzConnPtr privconn = privconn_list; + struct _vzConn *privconn = privconn_list; privconn_list = privconn->next; virConnectCloseCallbackDataCall(privconn->closeCallback, VIR_CONNECT_CLOSE_REASON_EOF); @@ -209,7 +209,7 @@ vzDestroyDriverConnection(void) static char * vzConnectGetCapabilities(virConnectPtr conn) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; if (virConnectGetCapabilitiesEnsureACL(conn) < 0) return NULL; @@ -218,7 +218,7 @@ vzConnectGetCapabilities(virConnectPtr conn) } static int -vzDomainDefAddDefaultInputDevices(virDomainDefPtr def) +vzDomainDefAddDefaultInputDevices(virDomainDef *def) { int bus = IS_CT(def) ? VIR_DOMAIN_INPUT_BUS_PARALLELS : VIR_DOMAIN_INPUT_BUS_PS2; @@ -240,12 +240,12 @@ vzDomainDefAddDefaultInputDevices(virDomainDefPtr def) } static int -vzDomainDefPostParse(virDomainDefPtr def, +vzDomainDefPostParse(virDomainDef *def, unsigned int parseFlags G_GNUC_UNUSED, void *opaque, void *parseOpaque G_GNUC_UNUSED) { - vzDriverPtr driver = opaque; + struct _vzDriver *driver = opaque; if (!virCapabilitiesDomainSupported(driver->caps, def->os.type, def->os.arch, def->virtType)) @@ -269,7 +269,7 @@ vzDomainDefValidate(const virDomainDef *def, } static int -vzDomainDeviceDefPostParse(virDomainDeviceDefPtr dev, +vzDomainDeviceDefPostParse(virDomainDeviceDef *dev, const virDomainDef *def, unsigned int parseFlags G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED, @@ -299,7 +299,7 @@ vzDomainDeviceDefValidate(const virDomainDeviceDef *dev, void *opaque, void *parseOpaque G_GNUC_UNUSED) { - vzDriverPtr driver = opaque; + struct _vzDriver *driver = opaque; if (dev->type == VIR_DOMAIN_DEVICE_DISK) return vzCheckUnsupportedDisk(def, dev->data.disk, &driver->vzCaps); @@ -322,10 +322,10 @@ static virDomainDefParserConfig vzDomainDefParserConfig = { .deviceValidateCallback = vzDomainDeviceDefValidate, }; -static vzDriverPtr +static struct _vzDriver * vzDriverObjNew(void) { - vzDriverPtr driver; + struct _vzDriver *driver; if (vzDriverInitialize() < 0) return NULL; @@ -360,11 +360,11 @@ vzDriverObjNew(void) static virDrvOpenStatus vzConnectOpen(virConnectPtr conn, virConnectAuthPtr auth G_GNUC_UNUSED, - virConfPtr conf G_GNUC_UNUSED, + virConf *conf G_GNUC_UNUSED, unsigned int flags) { - vzDriverPtr driver = NULL; - vzConnPtr privconn = NULL; + struct _vzDriver *driver = NULL; + struct _vzConn *privconn = NULL; virCheckFlags(VIR_CONNECT_RO, VIR_DRV_OPEN_ERROR); @@ -408,9 +408,9 @@ vzConnectOpen(virConnectPtr conn, static int vzConnectClose(virConnectPtr conn) { - vzConnPtr curr; - vzConnPtr *prev = &vz_conn_list; - vzConnPtr privconn = conn->privateData; + struct _vzConn *curr; + struct _vzConn **prev = &vz_conn_list; + struct _vzConn *privconn = conn->privateData; if (!privconn) return 0; @@ -435,7 +435,7 @@ vzConnectClose(virConnectPtr conn) static int vzConnectGetVersion(virConnectPtr conn, unsigned long *hvVer) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; if (virConnectGetVersionEnsureACL(conn) < 0) return -1; @@ -456,8 +456,8 @@ static char *vzConnectGetHostname(virConnectPtr conn) static char * vzConnectGetSysinfo(virConnectPtr conn, unsigned int flags) { - vzConnPtr privconn = conn->privateData; - vzDriverPtr driver = privconn->driver; + struct _vzConn *privconn = conn->privateData; + struct _vzDriver *driver = privconn->driver; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; virCheckFlags(0, NULL); @@ -480,7 +480,7 @@ vzConnectGetSysinfo(virConnectPtr conn, unsigned int flags) static int vzConnectListDomains(virConnectPtr conn, int *ids, int maxids) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; if (virConnectListDomainsEnsureACL(conn) < 0) return -1; @@ -493,7 +493,7 @@ vzConnectListDomains(virConnectPtr conn, int *ids, int maxids) static int vzConnectNumOfDomains(virConnectPtr conn) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; if (virConnectNumOfDomainsEnsureACL(conn) < 0) return -1; @@ -505,7 +505,7 @@ vzConnectNumOfDomains(virConnectPtr conn) static int vzConnectListDefinedDomains(virConnectPtr conn, char **const names, int maxnames) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; if (virConnectListDefinedDomainsEnsureACL(conn) < 0) return -1; @@ -520,7 +520,7 @@ vzConnectListDefinedDomains(virConnectPtr conn, char **const names, int maxnames static int vzConnectNumOfDefinedDomains(virConnectPtr conn) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; if (virConnectNumOfDefinedDomainsEnsureACL(conn) < 0) return -1; @@ -535,7 +535,7 @@ vzConnectListAllDomains(virConnectPtr conn, virDomainPtr **domains, unsigned int flags) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; virCheckFlags(VIR_CONNECT_LIST_DOMAINS_FILTERS_ALL, -1); @@ -549,9 +549,9 @@ vzConnectListAllDomains(virConnectPtr conn, static virDomainPtr vzDomainLookupByID(virConnectPtr conn, int id) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; virDomainPtr ret = NULL; - virDomainObjPtr dom; + virDomainObj *dom; dom = virDomainObjListFindByID(privconn->driver->domains, id); @@ -573,9 +573,9 @@ vzDomainLookupByID(virConnectPtr conn, int id) static virDomainPtr vzDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; virDomainPtr ret = NULL; - virDomainObjPtr dom; + virDomainObj *dom; dom = virDomainObjListFindByUUID(privconn->driver->domains, uuid); @@ -600,9 +600,9 @@ vzDomainLookupByUUID(virConnectPtr conn, const unsigned char *uuid) static virDomainPtr vzDomainLookupByName(virConnectPtr conn, const char *name) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; virDomainPtr ret = NULL; - virDomainObjPtr dom; + virDomainObj *dom; dom = virDomainObjListFindByName(privconn->driver->domains, name); @@ -625,8 +625,8 @@ vzDomainLookupByName(virConnectPtr conn, const char *name) static int vzDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) { - virDomainObjPtr dom; - vzDomObjPtr privdom; + virDomainObj *dom; + struct vzDomObj *privdom; int ret = -1; if (!(dom = vzDomObjFromDomain(domain))) @@ -666,7 +666,7 @@ vzDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) static char * vzDomainGetOSType(virDomainPtr domain) { - virDomainObjPtr dom; + virDomainObj *dom; char *ret = NULL; if (!(dom = vzDomObjFromDomain(domain))) @@ -685,7 +685,7 @@ vzDomainGetOSType(virDomainPtr domain) static int vzDomainIsPersistent(virDomainPtr domain) { - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; if (!(dom = vzDomObjFromDomain(domain))) @@ -705,7 +705,7 @@ static int vzDomainGetState(virDomainPtr domain, int *state, int *reason, unsigned int flags) { - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; virCheckFlags(0, -1); @@ -727,10 +727,10 @@ vzDomainGetState(virDomainPtr domain, static char * vzDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) { - vzConnPtr privconn = domain->conn->privateData; - vzDriverPtr driver = privconn->driver; - virDomainDefPtr def; - virDomainObjPtr dom; + struct _vzConn *privconn = domain->conn->privateData; + struct _vzDriver *driver = privconn->driver; + virDomainDef *def; + virDomainObj *dom; char *ret = NULL; virCheckFlags(VIR_DOMAIN_XML_COMMON_FLAGS, NULL); @@ -754,7 +754,7 @@ vzDomainGetXMLDesc(virDomainPtr domain, unsigned int flags) static int vzDomainGetAutostart(virDomainPtr domain, int *autostart) { - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; if (!(dom = vzDomObjFromDomain(domain))) @@ -772,7 +772,7 @@ vzDomainGetAutostart(virDomainPtr domain, int *autostart) } static int -vzEnsureDomainExists(virDomainObjPtr dom) +vzEnsureDomainExists(virDomainObj *dom) { char uuidstr[VIR_UUID_STRING_BUFLEN]; @@ -790,12 +790,12 @@ vzEnsureDomainExists(virDomainObjPtr dom) static virDomainPtr vzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; virDomainPtr retdom = NULL; - virDomainDefPtr def; - virDomainObjPtr dom = NULL; + virDomainDef *def; + virDomainObj *dom = NULL; unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE; - vzDriverPtr driver = privconn->driver; + struct _vzDriver *driver = privconn->driver; bool job = false; virCheckFlags(VIR_DOMAIN_DEFINE_VALIDATE, NULL); @@ -921,8 +921,8 @@ vzConnectBaselineCPU(virConnectPtr conn, unsigned int ncpus, unsigned int flags) { - virCPUDefPtr *cpus = NULL; - virCPUDefPtr cpu = NULL; + virCPUDef **cpus = NULL; + virCPUDef *cpu = NULL; char *cpustr = NULL; virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, NULL); @@ -957,7 +957,7 @@ vzDomainGetVcpus(virDomainPtr domain, unsigned char *cpumaps, int maplen) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; size_t i; int ret = -1; @@ -976,7 +976,7 @@ vzDomainGetVcpus(virDomainPtr domain, if (maxinfo >= 1) { if (info != NULL) { - vzDomObjPtr privdom; + struct vzDomObj *privdom; memset(info, 0, sizeof(*info) * maxinfo); privdom = dom->privateData; @@ -1025,7 +1025,7 @@ vzConnectDomainEventRegisterAny(virConnectPtr conn, virFreeCallback freecb) { int ret = -1; - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; if (virConnectDomainEventRegisterAnyEnsureACL(conn) < 0) return -1; @@ -1042,7 +1042,7 @@ static int vzConnectDomainEventDeregisterAny(virConnectPtr conn, int callbackID) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; if (virConnectDomainEventDeregisterAnyEnsureACL(conn) < 0) return -1; @@ -1058,8 +1058,8 @@ vzConnectDomainEventDeregisterAny(virConnectPtr conn, static int vzDomainSuspend(virDomainPtr domain) { - vzConnPtr privconn = domain->conn->privateData; - virDomainObjPtr dom; + struct _vzConn *privconn = domain->conn->privateData; + virDomainObj *dom; int ret = -1; bool job = false; @@ -1095,8 +1095,8 @@ vzDomainSuspend(virDomainPtr domain) static int vzDomainResume(virDomainPtr domain) { - vzConnPtr privconn = domain->conn->privateData; - virDomainObjPtr dom; + struct _vzConn *privconn = domain->conn->privateData; + virDomainObj *dom; int ret = -1; bool job = false; @@ -1132,8 +1132,8 @@ vzDomainResume(virDomainPtr domain) static int vzDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) { - vzConnPtr privconn = domain->conn->privateData; - virDomainObjPtr dom; + struct _vzConn *privconn = domain->conn->privateData; + virDomainObj *dom; int ret = -1; bool job = false; @@ -1171,8 +1171,8 @@ vzDomainCreateWithFlags(virDomainPtr domain, unsigned int flags) static int vzDomainDestroyFlags(virDomainPtr domain, unsigned int flags) { - vzConnPtr privconn = domain->conn->privateData; - virDomainObjPtr dom; + struct _vzConn *privconn = domain->conn->privateData; + virDomainObj *dom; int ret = -1; bool job = false; @@ -1216,8 +1216,8 @@ vzDomainDestroy(virDomainPtr dom) static int vzDomainShutdownFlags(virDomainPtr domain, unsigned int flags) { - vzConnPtr privconn = domain->conn->privateData; - virDomainObjPtr dom; + struct _vzConn *privconn = domain->conn->privateData; + virDomainObj *dom; int ret = -1; bool job = false; @@ -1260,8 +1260,8 @@ static int vzDomainShutdown(virDomainPtr dom) static int vzDomainReboot(virDomainPtr domain, unsigned int flags) { - vzConnPtr privconn = domain->conn->privateData; - virDomainObjPtr dom; + struct _vzConn *privconn = domain->conn->privateData; + virDomainObj *dom; int ret = -1; bool job = false; @@ -1298,7 +1298,7 @@ vzDomainReboot(virDomainPtr domain, unsigned int flags) static int vzDomainIsActive(virDomainPtr domain) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; int ret = -1; if (!(dom = vzDomObjFromDomain(domain))) @@ -1325,8 +1325,8 @@ static int vzDomainUndefineFlags(virDomainPtr domain, unsigned int flags) { - vzConnPtr privconn = domain->conn->privateData; - virDomainObjPtr dom = NULL; + struct _vzConn *privconn = domain->conn->privateData; + virDomainObj *dom = NULL; int ret = -1; bool job = false; @@ -1366,7 +1366,7 @@ vzDomainUndefine(virDomainPtr domain) static int vzDomainHasManagedSaveImage(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; int state, reason; int ret = -1; @@ -1393,8 +1393,8 @@ vzDomainHasManagedSaveImage(virDomainPtr domain, unsigned int flags) static int vzDomainManagedSave(virDomainPtr domain, unsigned int flags) { - vzConnPtr privconn = domain->conn->privateData; - virDomainObjPtr dom = NULL; + struct _vzConn *privconn = domain->conn->privateData; + virDomainObj *dom = NULL; int state, reason; int ret = -1; bool job = false; @@ -1439,7 +1439,7 @@ vzDomainManagedSave(virDomainPtr domain, unsigned int flags) static int vzDomainManagedSaveRemove(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; int state, reason; int ret = -1; @@ -1463,7 +1463,7 @@ vzDomainManagedSaveRemove(virDomainPtr domain, unsigned int flags) return ret; } -static int vzCheckConfigUpdateFlags(virDomainObjPtr dom, unsigned int *flags) +static int vzCheckConfigUpdateFlags(virDomainObj *dom, unsigned int *flags) { if (virDomainObjUpdateModificationImpact(dom, flags) < 0) return -1; @@ -1489,10 +1489,10 @@ static int vzDomainAttachDeviceFlags(virDomainPtr domain, const char *xml, unsigned int flags) { int ret = -1; - vzConnPtr privconn = domain->conn->privateData; - virDomainDeviceDefPtr dev = NULL; - virDomainObjPtr dom = NULL; - vzDriverPtr driver = privconn->driver; + struct _vzConn *privconn = domain->conn->privateData; + virDomainDeviceDef *dev = NULL; + virDomainObj *dom = NULL; + struct _vzDriver *driver = privconn->driver; bool job = false; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -1544,10 +1544,10 @@ static int vzDomainDetachDeviceFlags(virDomainPtr domain, const char *xml, unsigned int flags) { int ret = -1; - vzConnPtr privconn = domain->conn->privateData; - virDomainDeviceDefPtr dev = NULL; - virDomainObjPtr dom = NULL; - vzDriverPtr driver = privconn->driver; + struct _vzConn *privconn = domain->conn->privateData; + virDomainDeviceDef *dev = NULL; + virDomainObj *dom = NULL; + struct _vzDriver *driver = privconn->driver; bool job = false; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -1605,7 +1605,7 @@ vzDomainSetUserPassword(virDomainPtr domain, const char *password, unsigned int flags) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; int ret = -1; bool job = false; @@ -1637,10 +1637,10 @@ static int vzDomainUpdateDeviceFlags(virDomainPtr domain, unsigned int flags) { int ret = -1; - vzConnPtr privconn = domain->conn->privateData; - virDomainObjPtr dom = NULL; - virDomainDeviceDefPtr dev = NULL; - vzDriverPtr driver = privconn->driver; + struct _vzConn *privconn = domain->conn->privateData; + virDomainObj *dom = NULL; + virDomainDeviceDef *dev = NULL; + struct _vzDriver *driver = privconn->driver; bool job = false; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -1687,7 +1687,7 @@ static int vzDomainUpdateDeviceFlags(virDomainPtr domain, static unsigned long long vzDomainGetMaxMemory(virDomainPtr domain) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; int ret = -1; if (!(dom = vzDomObjFromDomain(domain))) @@ -1704,11 +1704,11 @@ vzDomainGetMaxMemory(virDomainPtr domain) } static int -vzDomainBlockStatsImpl(virDomainObjPtr dom, +vzDomainBlockStatsImpl(virDomainObj *dom, const char *path, virDomainBlockStatsPtr stats) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; size_t i; int idx; @@ -1757,7 +1757,7 @@ vzDomainBlockStats(virDomainPtr domain, const char *path, virDomainBlockStatsPtr stats) { - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; if (!(dom = vzDomObjFromDomain(domain))) @@ -1820,7 +1820,7 @@ vzDomainBlockStatsFlags(virDomainPtr domain, unsigned int flags) { virDomainBlockStatsStruct stats; - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; virCheckFlags(VIR_TYPED_PARAM_STRING_OKAY, -1); @@ -1852,8 +1852,8 @@ vzDomainInterfaceStats(virDomainPtr domain, const char *device, virDomainInterfaceStatsPtr stats) { - virDomainObjPtr dom = NULL; - vzDomObjPtr privdom; + virDomainObj *dom = NULL; + struct vzDomObj *privdom; int ret = -1; if (!(dom = vzDomObjFromDomain(domain))) @@ -1878,8 +1878,8 @@ vzDomainMemoryStats(virDomainPtr domain, unsigned int nr_stats, unsigned int flags) { - virDomainObjPtr dom = NULL; - vzDomObjPtr privdom; + virDomainObj *dom = NULL; + struct vzDomObj *privdom; int ret = -1; virCheckFlags(0, -1); @@ -1903,7 +1903,7 @@ static int vzDomainGetVcpusFlags(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -1935,7 +1935,7 @@ static int vzDomainGetMaxVcpus(virDomainPtr domain) static int vzDomainIsUpdated(virDomainPtr domain) { - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; /* As far as VZ domains are always updated (e.g. current==persistent), @@ -2026,7 +2026,7 @@ vzConnectRegisterCloseCallback(virConnectPtr conn, void *opaque, virFreeCallback freecb) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; int ret = -1; if (virConnectRegisterCloseCallbackEnsureACL(conn) < 0) @@ -2053,7 +2053,7 @@ vzConnectRegisterCloseCallback(virConnectPtr conn, static int vzConnectUnregisterCloseCallback(virConnectPtr conn, virConnectCloseFunc cb) { - vzConnPtr privconn = conn->privateData; + struct _vzConn *privconn = conn->privateData; int ret = -1; if (virConnectUnregisterCloseCallbackEnsureACL(conn) < 0) @@ -2079,7 +2079,7 @@ vzConnectUnregisterCloseCallback(virConnectPtr conn, virConnectCloseFunc cb) static int vzDomainSetMemoryFlags(virDomainPtr domain, unsigned long memory, unsigned int flags) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; int ret = -1; bool job = false; @@ -2114,7 +2114,7 @@ static int vzDomainSetMemoryFlags(virDomainPtr domain, unsigned long memory, static int vzDomainSetMemory(virDomainPtr domain, unsigned long memory) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; int ret = -1; bool job = false; @@ -2141,10 +2141,10 @@ static int vzDomainSetMemory(virDomainPtr domain, unsigned long memory) return ret; } -static virDomainMomentObjPtr -vzSnapObjFromName(virDomainSnapshotObjListPtr snapshots, const char *name) +static virDomainMomentObj * +vzSnapObjFromName(virDomainSnapshotObjList *snapshots, const char *name) { - virDomainMomentObjPtr snap = NULL; + virDomainMomentObj *snap = NULL; snap = virDomainSnapshotFindByName(snapshots, name); if (!snap) virReportError(VIR_ERR_NO_DOMAIN_SNAPSHOT, @@ -2153,8 +2153,8 @@ vzSnapObjFromName(virDomainSnapshotObjListPtr snapshots, const char *name) return snap; } -static virDomainMomentObjPtr -vzSnapObjFromSnapshot(virDomainSnapshotObjListPtr snapshots, +static virDomainMomentObj * +vzSnapObjFromSnapshot(virDomainSnapshotObjList *snapshots, virDomainSnapshotPtr snapshot) { return vzSnapObjFromName(snapshots, snapshot->name); @@ -2163,8 +2163,8 @@ vzSnapObjFromSnapshot(virDomainSnapshotObjListPtr snapshots, static int vzDomainSnapshotNum(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr dom; - virDomainSnapshotObjListPtr snapshots = NULL; + virDomainObj *dom; + virDomainSnapshotObjList *snapshots = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS | @@ -2194,8 +2194,8 @@ vzDomainSnapshotListNames(virDomainPtr domain, int nameslen, unsigned int flags) { - virDomainObjPtr dom; - virDomainSnapshotObjListPtr snapshots = NULL; + virDomainObj *dom; + virDomainSnapshotObjList *snapshots = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS | @@ -2224,8 +2224,8 @@ vzDomainListAllSnapshots(virDomainPtr domain, virDomainSnapshotPtr **snaps, unsigned int flags) { - virDomainObjPtr dom; - virDomainSnapshotObjListPtr snapshots = NULL; + virDomainObj *dom; + virDomainSnapshotObjList *snapshots = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_ROOTS | @@ -2252,12 +2252,12 @@ vzDomainListAllSnapshots(virDomainPtr domain, static char * vzDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr dom; + virDomainObj *dom; char *xml = NULL; - virDomainMomentObjPtr snap; + virDomainMomentObj *snap; char uuidstr[VIR_UUID_STRING_BUFLEN]; - virDomainSnapshotObjListPtr snapshots = NULL; - vzConnPtr privconn = snapshot->domain->conn->privateData; + virDomainSnapshotObjList *snapshots = NULL; + struct _vzConn *privconn = snapshot->domain->conn->privateData; virCheckFlags(VIR_DOMAIN_SNAPSHOT_XML_SECURE, NULL); @@ -2289,9 +2289,9 @@ vzDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot, unsigned int flags) static int vzDomainSnapshotNumChildren(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr dom; - virDomainMomentObjPtr snap; - virDomainSnapshotObjListPtr snapshots = NULL; + virDomainObj *dom; + virDomainMomentObj *snap; + virDomainSnapshotObjList *snapshots = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | @@ -2324,9 +2324,9 @@ vzDomainSnapshotListChildrenNames(virDomainSnapshotPtr snapshot, int nameslen, unsigned int flags) { - virDomainObjPtr dom; - virDomainMomentObjPtr snap; - virDomainSnapshotObjListPtr snapshots = NULL; + virDomainObj *dom; + virDomainMomentObj *snap; + virDomainSnapshotObjList *snapshots = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | @@ -2358,9 +2358,9 @@ vzDomainSnapshotListAllChildren(virDomainSnapshotPtr snapshot, virDomainSnapshotPtr **snaps, unsigned int flags) { - virDomainObjPtr dom; - virDomainMomentObjPtr snap; - virDomainSnapshotObjListPtr snapshots = NULL; + virDomainObj *dom; + virDomainMomentObj *snap; + virDomainSnapshotObjList *snapshots = NULL; int n = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS | @@ -2392,10 +2392,10 @@ vzDomainSnapshotLookupByName(virDomainPtr domain, const char *name, unsigned int flags) { - virDomainObjPtr dom; - virDomainMomentObjPtr snap; + virDomainObj *dom; + virDomainMomentObj *snap; virDomainSnapshotPtr snapshot = NULL; - virDomainSnapshotObjListPtr snapshots = NULL; + virDomainSnapshotObjList *snapshots = NULL; virCheckFlags(0, NULL); @@ -2423,8 +2423,8 @@ vzDomainSnapshotLookupByName(virDomainPtr domain, static int vzDomainHasCurrentSnapshot(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr dom; - virDomainSnapshotObjListPtr snapshots = NULL; + virDomainObj *dom; + virDomainSnapshotObjList *snapshots = NULL; int ret = -1; virCheckFlags(0, -1); @@ -2450,10 +2450,10 @@ vzDomainHasCurrentSnapshot(virDomainPtr domain, unsigned int flags) static virDomainSnapshotPtr vzDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr dom; - virDomainMomentObjPtr snap; + virDomainObj *dom; + virDomainMomentObj *snap; virDomainSnapshotPtr parent = NULL; - virDomainSnapshotObjListPtr snapshots = NULL; + virDomainSnapshotObjList *snapshots = NULL; virCheckFlags(0, NULL); @@ -2488,10 +2488,10 @@ vzDomainSnapshotGetParent(virDomainSnapshotPtr snapshot, unsigned int flags) static virDomainSnapshotPtr vzDomainSnapshotCurrent(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr dom; + virDomainObj *dom; virDomainSnapshotPtr snapshot = NULL; - virDomainSnapshotObjListPtr snapshots = NULL; - virDomainMomentObjPtr current; + virDomainSnapshotObjList *snapshots = NULL; + virDomainMomentObj *current; virCheckFlags(0, NULL); @@ -2522,10 +2522,10 @@ vzDomainSnapshotCurrent(virDomainPtr domain, unsigned int flags) static int vzDomainSnapshotIsCurrent(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; - virDomainSnapshotObjListPtr snapshots = NULL; - virDomainMomentObjPtr current; + virDomainSnapshotObjList *snapshots = NULL; + virDomainMomentObj *current; virCheckFlags(0, -1); @@ -2552,10 +2552,10 @@ static int vzDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; - virDomainMomentObjPtr snap; - virDomainSnapshotObjListPtr snapshots = NULL; + virDomainMomentObj *snap; + virDomainSnapshotObjList *snapshots = NULL; virCheckFlags(0, -1); @@ -2586,12 +2586,12 @@ vzDomainSnapshotCreateXML(virDomainPtr domain, unsigned int flags) { virDomainSnapshotPtr snapshot = NULL; - virDomainObjPtr dom; - vzConnPtr privconn = domain->conn->privateData; - vzDriverPtr driver = privconn->driver; + virDomainObj *dom; + struct _vzConn *privconn = domain->conn->privateData; + struct _vzDriver *driver = privconn->driver; unsigned int parse_flags = VIR_DOMAIN_SNAPSHOT_PARSE_DISKS; - virDomainSnapshotObjListPtr snapshots = NULL; - virDomainMomentObjPtr current; + virDomainSnapshotObjList *snapshots = NULL; + virDomainMomentObj *current; bool job = false; g_autoptr(virDomainSnapshotDef) def = NULL; @@ -2658,7 +2658,7 @@ vzDomainSnapshotCreateXML(virDomainPtr domain, static int vzDomainSnapshotDelete(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; virCheckFlags(VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN, -1); @@ -2681,7 +2681,7 @@ vzDomainSnapshotDelete(virDomainSnapshotPtr snapshot, unsigned int flags) static int vzDomainRevertToSnapshot(virDomainSnapshotPtr snapshot, unsigned int flags) { - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; bool job = false; @@ -2717,7 +2717,6 @@ enum vzMigrationCookieFeatures { }; typedef struct _vzMigrationCookie vzMigrationCookie; -typedef vzMigrationCookie *vzMigrationCookiePtr; struct _vzMigrationCookie { unsigned char *session_uuid; unsigned char *uuid; @@ -2725,7 +2724,7 @@ struct _vzMigrationCookie { }; static void -vzMigrationCookieFree(vzMigrationCookiePtr mig) +vzMigrationCookieFree(vzMigrationCookie *mig) { if (!mig) return; @@ -2737,8 +2736,8 @@ vzMigrationCookieFree(vzMigrationCookiePtr mig) } static int -vzBakeCookie(vzDriverPtr driver, - virDomainObjPtr dom, +vzBakeCookie(struct _vzDriver *driver, + virDomainObj *dom, char **cookieout, int *cookieoutlen, unsigned int flags) { @@ -2787,12 +2786,12 @@ vzBakeCookie(vzDriverPtr driver, return 0; } -static vzMigrationCookiePtr +static vzMigrationCookie * vzEatCookie(const char *cookiein, int cookieinlen, unsigned int flags) { xmlDocPtr doc = NULL; xmlXPathContextPtr ctx = NULL; - vzMigrationCookiePtr mig = NULL; + vzMigrationCookie *mig = NULL; mig = g_new0(vzMigrationCookie, 1); @@ -2864,8 +2863,8 @@ vzEatCookie(const char *cookiein, int cookieinlen, unsigned int flags) NULL static char * -vzDomainMigrateBeginStep(virDomainObjPtr dom, - vzDriverPtr driver, +vzDomainMigrateBeginStep(virDomainObj *dom, + struct _vzDriver *driver, virTypedParameterPtr params, int nparams, char **cookieout, @@ -2900,8 +2899,8 @@ vzDomainMigrateBegin3Params(virDomainPtr domain, unsigned int flags) { char *xml = NULL; - virDomainObjPtr dom = NULL; - vzConnPtr privconn = domain->conn->privateData; + virDomainObj *dom = NULL; + struct _vzConn *privconn = domain->conn->privateData; unsigned long long bandwidth = 0; virCheckFlags(VZ_MIGRATION_FLAGS, NULL); @@ -2968,12 +2967,12 @@ vzDomainMigratePrepare3Params(virConnectPtr conn, char **uri_out, unsigned int flags) { - vzConnPtr privconn = conn->privateData; - vzDriverPtr driver = privconn->driver; + struct _vzConn *privconn = conn->privateData; + struct _vzDriver *driver = privconn->driver; const char *miguri = NULL; const char *dname = NULL; const char *dom_xml = NULL; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; int ret = -1; virCheckFlags(VZ_MIGRATION_FLAGS, -1); @@ -3051,10 +3050,10 @@ vzConnectSupportsFeature(virConnectPtr conn G_GNUC_UNUSED, int feature) } } -static virURIPtr +static virURI * vzParseVzURI(const char *uri_str) { - virURIPtr uri = NULL; + virURI *uri = NULL; if (!(uri = virURIParse(uri_str))) goto error; @@ -3088,8 +3087,8 @@ vzParseVzURI(const char *uri_str) } static int -vzDomainMigratePerformStep(virDomainObjPtr dom, - vzDriverPtr driver, +vzDomainMigratePerformStep(virDomainObj *dom, + struct _vzDriver *driver, virTypedParameterPtr params, int nparams, const char *cookiein, @@ -3097,11 +3096,11 @@ vzDomainMigratePerformStep(virDomainObjPtr dom, unsigned int flags) { int ret = -1; - vzDomObjPtr privdom = dom->privateData; - virURIPtr vzuri = NULL; + struct vzDomObj *privdom = dom->privateData; + virURI *vzuri = NULL; const char *miguri = NULL; const char *dname = NULL; - vzMigrationCookiePtr mig = NULL; + vzMigrationCookie *mig = NULL; bool job = false; if (virTypedParamsGetString(params, nparams, @@ -3148,8 +3147,8 @@ vzDomainMigratePerformStep(virDomainObjPtr dom, } static int -vzDomainMigratePerformP2P(virDomainObjPtr dom, - vzDriverPtr driver, +vzDomainMigratePerformP2P(virDomainObj *dom, + struct _vzDriver *driver, const char *dconnuri, virTypedParameterPtr orig_params, int nparams, @@ -3258,8 +3257,8 @@ vzDomainMigratePerform3Params(virDomainPtr domain, unsigned int flags) { int ret = -1; - virDomainObjPtr dom; - vzConnPtr privconn = domain->conn->privateData; + virDomainObj *dom; + struct _vzConn *privconn = domain->conn->privateData; virCheckFlags(VZ_MIGRATION_FLAGS, -1); @@ -3296,10 +3295,10 @@ vzDomainMigrateFinish3Params(virConnectPtr dconn, unsigned int flags, int cancelled) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; virDomainPtr domain = NULL; - vzConnPtr privconn = dconn->privateData; - vzDriverPtr driver = privconn->driver; + struct _vzConn *privconn = dconn->privateData; + struct _vzDriver *driver = privconn->driver; const char *name = NULL; virCheckFlags(VZ_MIGRATION_FLAGS, NULL); @@ -3352,10 +3351,10 @@ vzDomainMigrateConfirm3Params(virDomainPtr domain G_GNUC_UNUSED, } static int -vzDomainGetJobInfoImpl(virDomainObjPtr dom, virDomainJobInfoPtr info) +vzDomainGetJobInfoImpl(virDomainObj *dom, virDomainJobInfoPtr info) { - vzDomObjPtr privdom = dom->privateData; - vzDomainJobObjPtr job = &privdom->job; + struct vzDomObj *privdom = dom->privateData; + struct _vzDomainJobObj *job = &privdom->job; memset(info, 0, sizeof(*info)); @@ -3377,7 +3376,7 @@ vzDomainGetJobInfoImpl(virDomainObjPtr dom, virDomainJobInfoPtr info) static int vzDomainGetJobInfo(virDomainPtr domain, virDomainJobInfoPtr info) { - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; if (!(dom = vzDomObjFromDomain(domain))) @@ -3436,7 +3435,7 @@ vzDomainGetJobStats(virDomainPtr domain, unsigned int flags) { virDomainJobInfo info; - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; virCheckFlags(0, -1); @@ -3481,11 +3480,11 @@ do { \ } while (0) static int -vzDomainGetBlockStats(virDomainObjPtr dom, +vzDomainGetBlockStats(virDomainObj *dom, virDomainStatsRecordPtr record, int *maxparams) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; size_t i; char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; @@ -3498,7 +3497,7 @@ vzDomainGetBlockStats(virDomainObjPtr dom, for (i = 0; i < dom->def->ndisks; i++) { virDomainBlockStatsStruct stat; - virDomainDiskDefPtr disk = dom->def->disks[i]; + virDomainDiskDef *disk = dom->def->disks[i]; if (prlsdkGetBlockStats(privdom->stats, disk, @@ -3548,11 +3547,11 @@ vzDomainGetBlockStats(virDomainObjPtr dom, } static int -vzDomainGetNetStats(virDomainObjPtr dom, +vzDomainGetNetStats(virDomainObj *dom, virDomainStatsRecordPtr record, int *maxparams) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; size_t i; char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; @@ -3565,7 +3564,7 @@ vzDomainGetNetStats(virDomainObjPtr dom, for (i = 0; i < dom->def->nnets; i++) { virDomainInterfaceStatsStruct stat; - virDomainNetDefPtr net = dom->def->nets[i]; + virDomainNetDef *net = dom->def->nets[i]; if (prlsdkGetNetStats(privdom->stats, privdom->sdkdom, net->ifname, &stat) < 0) @@ -3589,11 +3588,11 @@ vzDomainGetNetStats(virDomainObjPtr dom, } static int -vzDomainGetVCPUStats(virDomainObjPtr dom, +vzDomainGetVCPUStats(virDomainObj *dom, virDomainStatsRecordPtr record, int *maxparams) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; size_t i; char param_name[VIR_TYPED_PARAM_FIELD_LENGTH]; @@ -3640,11 +3639,11 @@ vzDomainGetVCPUStats(virDomainObjPtr dom, } static int -vzDomainGetBalloonStats(virDomainObjPtr dom, +vzDomainGetBalloonStats(virDomainObj *dom, virDomainStatsRecordPtr record, int *maxparams) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; virDomainMemoryStatStruct stats[VIR_DOMAIN_MEMORY_STAT_NR]; size_t i; int n; @@ -3691,7 +3690,7 @@ vzDomainGetBalloonStats(virDomainObjPtr dom, } static int -vzDomainGetStateStats(virDomainObjPtr dom, +vzDomainGetStateStats(virDomainObj *dom, virDomainStatsRecordPtr record, int *maxparams) { @@ -3714,7 +3713,7 @@ vzDomainGetStateStats(virDomainObjPtr dom, static virDomainStatsRecordPtr vzDomainGetAllStats(virConnectPtr conn, - virDomainObjPtr dom) + virDomainObj *dom) { virDomainStatsRecordPtr stat; int maxparams = 0; @@ -3756,8 +3755,8 @@ vzConnectGetAllDomainStats(virConnectPtr conn, virDomainStatsRecordPtr **retStats, unsigned int flags) { - vzConnPtr privconn = conn->privateData; - vzDriverPtr driver = privconn->driver; + struct _vzConn *privconn = conn->privateData; + struct _vzDriver *driver = privconn->driver; unsigned int lflags = flags & (VIR_CONNECT_LIST_DOMAINS_FILTERS_ACTIVE | VIR_CONNECT_LIST_DOMAINS_FILTERS_PERSISTENT | VIR_CONNECT_LIST_DOMAINS_FILTERS_STATE); @@ -3766,7 +3765,7 @@ vzConnectGetAllDomainStats(virConnectPtr conn, VIR_DOMAIN_STATS_INTERFACE | VIR_DOMAIN_STATS_BALLOON | VIR_DOMAIN_STATS_BLOCK; - virDomainObjPtr *doms = NULL; + virDomainObj **doms = NULL; size_t ndoms; virDomainStatsRecordPtr *tmpstats = NULL; int nstats = 0; @@ -3807,7 +3806,7 @@ vzConnectGetAllDomainStats(virConnectPtr conn, for (i = 0; i < ndoms; i++) { virDomainStatsRecordPtr tmp; - virDomainObjPtr dom = doms[i]; + virDomainObj *dom = doms[i]; virObjectLock(dom); tmp = vzDomainGetAllStats(conn, dom); @@ -3834,7 +3833,7 @@ vzConnectGetAllDomainStats(virConnectPtr conn, static int vzDomainAbortJob(virDomainPtr domain) { - virDomainObjPtr dom; + virDomainObj *dom; int ret = -1; if (!(dom = vzDomObjFromDomain(domain))) @@ -3854,7 +3853,7 @@ vzDomainAbortJob(virDomainPtr domain) static int vzDomainReset(virDomainPtr domain, unsigned int flags) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; int ret = -1; bool job = false; @@ -3885,7 +3884,7 @@ vzDomainReset(virDomainPtr domain, unsigned int flags) static int vzDomainSetVcpusFlags(virDomainPtr domain, unsigned int nvcpus, unsigned int flags) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; int ret = -1; bool job = false; @@ -3928,8 +3927,8 @@ vzDomainBlockResize(virDomainPtr domain, unsigned long long size, unsigned int flags) { - virDomainObjPtr dom = NULL; - virDomainDiskDefPtr disk = NULL; + virDomainObj *dom = NULL; + virDomainDiskDef *disk = NULL; int ret = -1; bool job = false; diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index ac00ed214e..048d4adacd 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -50,9 +50,9 @@ prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque); VIR_LOG_INIT("parallels.sdk"); static PRL_HANDLE -prlsdkFindNetByMAC(PRL_HANDLE sdkdom, virMacAddrPtr mac); +prlsdkFindNetByMAC(PRL_HANDLE sdkdom, virMacAddr *mac); static PRL_HANDLE -prlsdkGetDisk(PRL_HANDLE sdkdom, virDomainDiskDefPtr disk); +prlsdkGetDisk(PRL_HANDLE sdkdom, virDomainDiskDef *disk); static bool prlsdkInBootList(PRL_HANDLE sdkdom, PRL_HANDLE sdktargetdev); @@ -197,7 +197,7 @@ getJobResultHelper(PRL_HANDLE job, unsigned int timeout, PRL_HANDLE *result, result, __FILE__, __FUNCTION__, __LINE__) static PRL_RESULT -getDomainJobResultHelper(PRL_HANDLE job, virDomainObjPtr dom, +getDomainJobResultHelper(PRL_HANDLE job, virDomainObj *dom, unsigned int timeout, PRL_HANDLE *result, const char *filename, const char *funcname, size_t linenr) @@ -236,11 +236,11 @@ waitJobHelper(PRL_HANDLE job, unsigned int timeout, __FUNCTION__, __LINE__) static PRL_RESULT -waitDomainJobHelper(PRL_HANDLE job, virDomainObjPtr dom, unsigned int timeout, +waitDomainJobHelper(PRL_HANDLE job, virDomainObj *dom, unsigned int timeout, const char *filename, const char *funcname, size_t linenr) { - vzDomObjPtr pdom = dom->privateData; + struct vzDomObj *pdom = dom->privateData; PRL_RESULT ret; if (pdom->job.cancelled) { @@ -267,9 +267,9 @@ waitDomainJobHelper(PRL_HANDLE job, virDomainObjPtr dom, unsigned int timeout, typedef PRL_RESULT (*prlsdkParamGetterType)(PRL_HANDLE, char*, PRL_UINT32*); int -prlsdkCancelJob(virDomainObjPtr dom) +prlsdkCancelJob(virDomainObj *dom) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_RESULT pret; PRL_HANDLE job; @@ -344,7 +344,7 @@ prlsdkDeinit(void) }; int -prlsdkConnect(vzDriverPtr driver) +prlsdkConnect(struct _vzDriver *driver) { int ret = -1; PRL_RESULT pret; @@ -396,7 +396,7 @@ prlsdkConnect(vzDriverPtr driver) } void -prlsdkDisconnect(vzDriverPtr driver) +prlsdkDisconnect(struct _vzDriver *driver) { PRL_HANDLE job; PRL_RESULT ret; @@ -418,7 +418,7 @@ prlsdkDisconnect(vzDriverPtr driver) } static int -prlsdkSdkDomainLookup(vzDriverPtr driver, +prlsdkSdkDomainLookup(struct _vzDriver *driver, const char *id, unsigned int flags, PRL_HANDLE *sdkdom) @@ -453,7 +453,7 @@ prlsdkUUIDFormat(const unsigned char *uuid, char *uuidstr) } static PRL_HANDLE -prlsdkSdkDomainLookupByUUID(vzDriverPtr driver, const unsigned char *uuid) +prlsdkSdkDomainLookupByUUID(struct _vzDriver *driver, const unsigned char *uuid) { char uuidstr[VIR_UUID_STRING_BRACED_BUFLEN]; PRL_HANDLE sdkdom = PRL_INVALID_HANDLE; @@ -472,7 +472,7 @@ prlsdkSdkDomainLookupByUUID(vzDriverPtr driver, const unsigned char *uuid) } PRL_HANDLE -prlsdkSdkDomainLookupByName(vzDriverPtr driver, const char *name) +prlsdkSdkDomainLookupByName(struct _vzDriver *driver, const char *name) { PRL_HANDLE sdkdom = PRL_INVALID_HANDLE; @@ -510,7 +510,7 @@ prlsdkUUIDParse(const char *uuidstr, unsigned char *uuid) } static int -prlsdkGetDomainState(virDomainObjPtr dom, PRL_HANDLE sdkdom, VIRTUAL_MACHINE_STATE_PTR vmState) +prlsdkGetDomainState(virDomainObj *dom, PRL_HANDLE sdkdom, VIRTUAL_MACHINE_STATE_PTR vmState) { PRL_HANDLE job = PRL_INVALID_HANDLE; PRL_HANDLE result = PRL_INVALID_HANDLE; @@ -538,10 +538,10 @@ prlsdkGetDomainState(virDomainObjPtr dom, PRL_HANDLE sdkdom, VIRTUAL_MACHINE_STA } static int -prlsdkAddDomainVideoInfoCt(virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt) +prlsdkAddDomainVideoInfoCt(virDomainDef *def, + virDomainXMLOption *xmlopt) { - virDomainVideoDefPtr video = NULL; + virDomainVideoDef *video = NULL; int ret = -1; if (def->ngraphics == 0) @@ -564,10 +564,10 @@ prlsdkAddDomainVideoInfoCt(virDomainDefPtr def, } static int -prlsdkAddDomainVideoInfoVm(PRL_HANDLE sdkdom, virDomainDefPtr def) +prlsdkAddDomainVideoInfoVm(PRL_HANDLE sdkdom, virDomainDef *def) { - virDomainVideoDefPtr video = NULL; - virDomainVideoAccelDefPtr accel = NULL; + virDomainVideoDef *video = NULL; + virDomainVideoAccelDef *accel = NULL; PRL_RESULT ret; PRL_UINT32 videoRam; @@ -630,9 +630,9 @@ prlsdkGetDiskId(PRL_HANDLE disk, int *bus, char **dst) } static int -prlsdkGetDiskInfo(vzDriverPtr driver, +prlsdkGetDiskInfo(struct _vzDriver *driver, PRL_HANDLE prldisk, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, bool isCdrom, bool isCt) { @@ -640,7 +640,7 @@ prlsdkGetDiskInfo(vzDriverPtr driver, PRL_RESULT pret; PRL_UINT32 emulatedType; PRL_UINT32 size; - virDomainDeviceDriveAddressPtr address; + virDomainDeviceDriveAddress *address; int busIdx, devIdx; int ret = -1; @@ -713,12 +713,12 @@ prlsdkGetDiskInfo(vzDriverPtr driver, static int prlsdkGetFSInfo(PRL_HANDLE prldisk, - virDomainFSDefPtr fs) + virDomainFSDef *fs) { char *buf = NULL; int ret = -1; char **matches = NULL; - virURIPtr uri = NULL; + virURI *uri = NULL; fs->type = VIR_DOMAIN_FS_TYPE_FILE; fs->fsdriver = VIR_DOMAIN_FS_DRIVER_TYPE_PLOOP; @@ -784,14 +784,14 @@ prlsdkGetFSInfo(PRL_HANDLE prldisk, } static int -prlsdkAddDomainHardDisksInfo(vzDriverPtr driver, PRL_HANDLE sdkdom, virDomainDefPtr def) +prlsdkAddDomainHardDisksInfo(struct _vzDriver *driver, PRL_HANDLE sdkdom, virDomainDef *def) { PRL_RESULT pret; PRL_UINT32 hddCount; PRL_UINT32 i; PRL_HANDLE hdd = PRL_INVALID_HANDLE; - virDomainDiskDefPtr disk = NULL; - virDomainFSDefPtr fs = NULL; + virDomainDiskDef *disk = NULL; + virDomainFSDef *fs = NULL; pret = PrlVmCfg_GetHardDisksCount(sdkdom, &hddCount); prlsdkCheckRetGoto(pret, error); @@ -846,13 +846,13 @@ prlsdkAddDomainHardDisksInfo(vzDriverPtr driver, PRL_HANDLE sdkdom, virDomainDef } static int -prlsdkAddDomainOpticalDisksInfo(vzDriverPtr driver, PRL_HANDLE sdkdom, virDomainDefPtr def) +prlsdkAddDomainOpticalDisksInfo(struct _vzDriver *driver, PRL_HANDLE sdkdom, virDomainDef *def) { PRL_RESULT pret; PRL_UINT32 cdromsCount; PRL_UINT32 i; PRL_HANDLE cdrom = PRL_INVALID_HANDLE; - virDomainDiskDefPtr disk = NULL; + virDomainDiskDef *disk = NULL; pret = PrlVmCfg_GetOpticalDisksCount(sdkdom, &cdromsCount); prlsdkCheckRetGoto(pret, error); @@ -881,14 +881,14 @@ prlsdkAddDomainOpticalDisksInfo(vzDriverPtr driver, PRL_HANDLE sdkdom, virDomain return -1; } -static virNetDevIPAddrPtr +static virNetDevIPAddr * prlsdkParseNetAddress(char *addr) { char *maskstr = NULL; int nbits; virSocketAddr mask; - virNetDevIPAddrPtr ip = NULL; - virNetDevIPAddrPtr ret = NULL; + virNetDevIPAddr *ip = NULL; + virNetDevIPAddr *ret = NULL; if (!(maskstr = strchr(addr, '/'))) goto cleanup; @@ -921,7 +921,7 @@ prlsdkParseNetAddress(char *addr) } static int -prlsdkGetNetAddresses(PRL_HANDLE sdknet, virDomainNetDefPtr net) +prlsdkGetNetAddresses(PRL_HANDLE sdknet, virDomainNetDef *net) { int ret = -1; PRL_HANDLE addrlist = PRL_INVALID_HANDLE; @@ -936,7 +936,7 @@ prlsdkGetNetAddresses(PRL_HANDLE sdknet, virDomainNetDefPtr net) prlsdkCheckRetGoto(pret, cleanup); for (i = 0; i < num; ++i) { - virNetDevIPAddrPtr ip = NULL; + virNetDevIPAddr *ip = NULL; PRL_UINT32 buflen = 0; char *addr; @@ -965,7 +965,7 @@ prlsdkGetNetAddresses(PRL_HANDLE sdknet, virDomainNetDefPtr net) } static int -prlsdkGetRoutes(PRL_HANDLE sdknet, virDomainNetDefPtr net) +prlsdkGetRoutes(PRL_HANDLE sdknet, virDomainNetDef *net) { int ret = -1; char *gw = NULL; @@ -1009,7 +1009,7 @@ prlsdkGetRoutes(PRL_HANDLE sdknet, virDomainNetDefPtr net) } static int -prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetDefPtr net, bool isCt) +prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetDef *net, bool isCt) { char macstr[VIR_MAC_STRING_BUFLEN]; PRL_UINT32 netAdapterIndex; @@ -1110,9 +1110,9 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetDefPtr net, bool isCt) } static int -prlsdkAddDomainNetInfo(PRL_HANDLE sdkdom, virDomainDefPtr def) +prlsdkAddDomainNetInfo(PRL_HANDLE sdkdom, virDomainDef *def) { - virDomainNetDefPtr net = NULL; + virDomainNetDef *net = NULL; PRL_RESULT ret; PRL_HANDLE netAdapter; PRL_UINT32 netAdaptersCount; @@ -1145,7 +1145,7 @@ prlsdkAddDomainNetInfo(PRL_HANDLE sdkdom, virDomainDefPtr def) } static int -prlsdkGetSerialInfo(PRL_HANDLE serialPort, virDomainChrDefPtr chr) +prlsdkGetSerialInfo(PRL_HANDLE serialPort, virDomainChrDef *chr) { PRL_RESULT pret; PRL_UINT32 serialPortIndex; @@ -1153,7 +1153,7 @@ prlsdkGetSerialInfo(PRL_HANDLE serialPort, virDomainChrDefPtr chr) char *friendlyName = NULL; PRL_SERIAL_PORT_SOCKET_OPERATION_MODE socket_mode; char *uristr = NULL; - virURIPtr uri = NULL; + virURI *uri = NULL; int ret = -1; chr->deviceType = VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL; @@ -1224,14 +1224,14 @@ prlsdkGetSerialInfo(PRL_HANDLE serialPort, virDomainChrDefPtr chr) static int prlsdkAddSerialInfo(PRL_HANDLE sdkdom, - virDomainChrDefPtr **serials, + virDomainChrDef ***serials, size_t *nserials) { PRL_RESULT ret; PRL_HANDLE serialPort; PRL_UINT32 serialPortsCount; PRL_UINT32 i; - virDomainChrDefPtr chr = NULL; + virDomainChrDef *chr = NULL; ret = PrlVmCfg_GetSerialPortsCount(sdkdom, &serialPortsCount); prlsdkCheckRetGoto(ret, cleanup); @@ -1262,10 +1262,10 @@ prlsdkAddSerialInfo(PRL_HANDLE sdkdom, static int -prlsdkAddDomainHardware(vzDriverPtr driver, +prlsdkAddDomainHardware(struct _vzDriver *driver, PRL_HANDLE sdkdom, - virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt) + virDomainDef *def, + virDomainXMLOption *xmlopt) { if (IS_CT(def)) { if (prlsdkAddDomainVideoInfoCt(def, xmlopt) < 0) @@ -1294,9 +1294,9 @@ prlsdkAddDomainHardware(vzDriverPtr driver, static int -prlsdkAddVNCInfo(PRL_HANDLE sdkdom, virDomainDefPtr def) +prlsdkAddVNCInfo(PRL_HANDLE sdkdom, virDomainDef *def) { - virDomainGraphicsDefPtr gr = NULL; + virDomainGraphicsDef *gr = NULL; PRL_VM_REMOTE_DISPLAY_MODE vncMode; PRL_UINT32 port; PRL_RESULT pret; @@ -1347,7 +1347,7 @@ prlsdkAddVNCInfo(PRL_HANDLE sdkdom, virDomainDefPtr def) static void prlsdkConvertDomainState(VIRTUAL_MACHINE_STATE domainState, PRL_UINT32 envId, - virDomainObjPtr dom) + virDomainObj *dom) { switch (domainState) { case VMS_STOPPED: @@ -1424,8 +1424,8 @@ prlsdkConvertDomainState(VIRTUAL_MACHINE_STATE domainState, static int prlsdkConvertCpuInfo(PRL_HANDLE sdkdom, - virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt) + virDomainDef *def, + virDomainXMLOption *xmlopt) { g_autofree char *buf = NULL; int hostcpus; @@ -1463,7 +1463,7 @@ prlsdkConvertCpuInfo(PRL_HANDLE sdkdom, } static int -prlsdkConvertDomainType(PRL_HANDLE sdkdom, virDomainDefPtr def) +prlsdkConvertDomainType(PRL_HANDLE sdkdom, virDomainDef *def) { PRL_VM_TYPE domainType; PRL_RESULT pret; @@ -1489,7 +1489,7 @@ prlsdkConvertDomainType(PRL_HANDLE sdkdom, virDomainDefPtr def) } static int -prlsdkConvertCpuMode(PRL_HANDLE sdkdom, virDomainDefPtr def) +prlsdkConvertCpuMode(PRL_HANDLE sdkdom, virDomainDef *def) { PRL_RESULT pret; PRL_CPU_MODE cpuMode; @@ -1545,8 +1545,8 @@ prlsdkGetDevByDevIndex(PRL_HANDLE sdkdom, PRL_DEVICE_TYPE type, PRL_UINT32 devIn return PRL_INVALID_HANDLE; } -static virDomainDiskDefPtr -virFindDiskBootIndex(virDomainDefPtr def, virDomainDiskDevice type, int index) +static virDomainDiskDef * +virFindDiskBootIndex(virDomainDef *def, virDomainDiskDevice type, int index) { size_t i; int c = 0; @@ -1618,11 +1618,11 @@ prlsdkInBootList(PRL_HANDLE sdkdom, } static int prlsdkBootOrderCheck(PRL_HANDLE sdkdom, PRL_DEVICE_TYPE sdkType, int sdkIndex, - virDomainDefPtr def, int bootIndex) + virDomainDef *def, int bootIndex) { char *sdkName = NULL; PRL_HANDLE dev = PRL_INVALID_HANDLE; - virDomainDiskDefPtr disk; + virDomainDiskDef *disk; virDomainDiskDevice device; int bus; char *dst = NULL; @@ -1699,7 +1699,7 @@ prlsdkBootOrderCheck(PRL_HANDLE sdkdom, PRL_DEVICE_TYPE sdkType, int sdkIndex, } static int -prlsdkConvertBootOrderVm(PRL_HANDLE sdkdom, virDomainDefPtr def) +prlsdkConvertBootOrderVm(PRL_HANDLE sdkdom, virDomainDef *def) { int ret = -1; PRL_RESULT pret; @@ -1793,13 +1793,13 @@ prlsdkConvertBootOrderVm(PRL_HANDLE sdkdom, virDomainDefPtr def) * Returned object is locked and referenced. */ -static virDomainObjPtr -prlsdkLoadDomain(vzDriverPtr driver, +static virDomainObj * +prlsdkLoadDomain(struct _vzDriver *driver, PRL_HANDLE sdkdom, - virDomainObjPtr dom) + virDomainObj *dom) { - virDomainDefPtr def = NULL; - vzDomObjPtr pdom = NULL; + virDomainDef *def = NULL; + struct vzDomObj *pdom = NULL; VIRTUAL_MACHINE_STATE domainState; PRL_RESULT pret; @@ -1892,7 +1892,7 @@ prlsdkLoadDomain(vzDriverPtr driver, } if (!dom) { - virDomainObjPtr olddom = NULL; + virDomainObj *olddom = NULL; job = PrlVm_SubscribeToPerfStats(sdkdom, NULL); if (PRL_FAILED(waitJob(job))) @@ -1940,7 +1940,7 @@ prlsdkLoadDomain(vzDriverPtr driver, } int -prlsdkLoadDomains(vzDriverPtr driver) +prlsdkLoadDomains(struct _vzDriver *driver) { PRL_HANDLE job = PRL_INVALID_HANDLE; PRL_HANDLE result; @@ -1948,7 +1948,7 @@ prlsdkLoadDomains(vzDriverPtr driver) PRL_UINT32 paramsCount; PRL_RESULT pret; size_t i = 0; - virDomainObjPtr dom; + virDomainObj *dom; job = PrlSrv_GetVmListEx(driver->server, PVTF_VM | PVTF_CT); @@ -1978,11 +1978,11 @@ prlsdkLoadDomains(vzDriverPtr driver) return -1; } -virDomainObjPtr -prlsdkAddDomainByUUID(vzDriverPtr driver, const unsigned char *uuid) +virDomainObj * +prlsdkAddDomainByUUID(struct _vzDriver *driver, const unsigned char *uuid) { PRL_HANDLE sdkdom; - virDomainObjPtr dom; + virDomainObj *dom; sdkdom = prlsdkSdkDomainLookupByUUID(driver, uuid); if (sdkdom == PRL_INVALID_HANDLE) @@ -1994,11 +1994,11 @@ prlsdkAddDomainByUUID(vzDriverPtr driver, const unsigned char *uuid) return dom; } -virDomainObjPtr -prlsdkAddDomainByName(vzDriverPtr driver, const char *name) +virDomainObj * +prlsdkAddDomainByName(struct _vzDriver *driver, const char *name) { PRL_HANDLE sdkdom; - virDomainObjPtr dom; + virDomainObj *dom; sdkdom = prlsdkSdkDomainLookupByName(driver, name); if (sdkdom == PRL_INVALID_HANDLE) @@ -2011,10 +2011,10 @@ prlsdkAddDomainByName(vzDriverPtr driver, const char *name) } int -prlsdkUpdateDomain(vzDriverPtr driver, virDomainObjPtr dom) +prlsdkUpdateDomain(struct _vzDriver *driver, virDomainObj *dom) { PRL_HANDLE job; - vzDomObjPtr pdom = dom->privateData; + struct vzDomObj *pdom = dom->privateData; job = PrlVm_RefreshConfig(pdom->sdkdom); if (waitDomainJob(job, dom)) @@ -2024,12 +2024,12 @@ prlsdkUpdateDomain(vzDriverPtr driver, virDomainObjPtr dom) } static void -prlsdkSendEvent(vzDriverPtr driver, - virDomainObjPtr dom, +prlsdkSendEvent(struct _vzDriver *driver, + virDomainObj *dom, virDomainEventType lvEventType, int lvEventTypeDetails) { - virObjectEventPtr event; + virObjectEvent *event; event = virDomainEventLifecycleNewFromObj(dom, lvEventType, @@ -2071,15 +2071,15 @@ prlsdkNewStateToEvent(VIRTUAL_MACHINE_STATE domainState, } static void -prlsdkHandleVmStateEvent(vzDriverPtr driver, +prlsdkHandleVmStateEvent(struct _vzDriver *driver, PRL_HANDLE prlEvent, unsigned char *uuid) { PRL_RESULT pret = PRL_ERR_FAILURE; PRL_HANDLE eventParam = PRL_INVALID_HANDLE; PRL_INT32 domainState; - virDomainObjPtr dom = NULL; - vzDomObjPtr pdom; + virDomainObj *dom = NULL; + struct vzDomObj *pdom; virDomainEventType lvEventType = 0; int lvEventTypeDetails = 0; @@ -2110,10 +2110,10 @@ prlsdkHandleVmStateEvent(vzDriverPtr driver, } static void -prlsdkHandleVmConfigEvent(vzDriverPtr driver, +prlsdkHandleVmConfigEvent(struct _vzDriver *driver, unsigned char *uuid) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; bool job = false; dom = virDomainObjListFindByUUID(driver->domains, uuid); @@ -2141,10 +2141,10 @@ prlsdkHandleVmConfigEvent(vzDriverPtr driver, } static void -prlsdkHandleVmAddedEvent(vzDriverPtr driver, +prlsdkHandleVmAddedEvent(struct _vzDriver *driver, unsigned char *uuid) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; if (!(dom = virDomainObjListFindByUUID(driver->domains, uuid)) && !(dom = prlsdkAddDomainByUUID(driver, uuid))) @@ -2159,10 +2159,10 @@ prlsdkHandleVmAddedEvent(vzDriverPtr driver, } static void -prlsdkHandleVmRemovedEvent(vzDriverPtr driver, +prlsdkHandleVmRemovedEvent(struct _vzDriver *driver, unsigned char *uuid) { - virDomainObjPtr dom = NULL; + virDomainObj *dom = NULL; dom = virDomainObjListFindByUUID(driver->domains, uuid); /* domain was removed from the list from the libvirt @@ -2179,12 +2179,12 @@ prlsdkHandleVmRemovedEvent(vzDriverPtr driver, } static void -prlsdkHandlePerfEvent(vzDriverPtr driver, +prlsdkHandlePerfEvent(struct _vzDriver *driver, PRL_HANDLE event, unsigned char *uuid) { - virDomainObjPtr dom = NULL; - vzDomObjPtr privdom = NULL; + virDomainObj *dom = NULL; + struct vzDomObj *privdom = NULL; if (!(dom = virDomainObjListFindByUUID(driver->domains, uuid))) { PrlHandle_Free(event); @@ -2199,12 +2199,12 @@ prlsdkHandlePerfEvent(vzDriverPtr driver, } static void -prlsdkHandleMigrationProgress(vzDriverPtr driver, +prlsdkHandleMigrationProgress(struct _vzDriver *driver, PRL_HANDLE event, unsigned char *uuid) { - virDomainObjPtr dom = NULL; - vzDomObjPtr privdom = NULL; + virDomainObj *dom = NULL; + struct vzDomObj *privdom = NULL; PRL_UINT32 progress; PRL_HANDLE param = PRL_INVALID_HANDLE; PRL_RESULT pret; @@ -2229,7 +2229,7 @@ prlsdkHandleMigrationProgress(vzDriverPtr driver, static PRL_RESULT prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque) { - vzDriverPtr driver = opaque; + struct _vzDriver *driver = opaque; PRL_RESULT pret = PRL_ERR_FAILURE; PRL_HANDLE_TYPE handleType; char uuidstr[VIR_UUID_STRING_BRACED_BUFLEN]; @@ -2293,10 +2293,10 @@ prlsdkEventsHandler(PRL_HANDLE prlEvent, PRL_VOID_PTR opaque) return PRL_ERR_SUCCESS; } -int prlsdkStart(virDomainObjPtr dom) +int prlsdkStart(virDomainObj *dom) { PRL_HANDLE job = PRL_INVALID_HANDLE; - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_RESULT pret; job = PrlVm_StartEx(privdom->sdkdom, PSM_VM_START, 0); @@ -2308,10 +2308,10 @@ int prlsdkStart(virDomainObjPtr dom) return 0; } -int prlsdkKill(virDomainObjPtr dom) +int prlsdkKill(virDomainObj *dom) { PRL_HANDLE job = PRL_INVALID_HANDLE; - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_RESULT pret; job = PrlVm_StopEx(privdom->sdkdom, PSM_KILL, 0); @@ -2323,10 +2323,10 @@ int prlsdkKill(virDomainObjPtr dom) return 0; } -int prlsdkStop(virDomainObjPtr dom) +int prlsdkStop(virDomainObj *dom) { PRL_HANDLE job = PRL_INVALID_HANDLE; - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_RESULT pret; job = PrlVm_StopEx(privdom->sdkdom, PSM_SHUTDOWN, 0); @@ -2338,10 +2338,10 @@ int prlsdkStop(virDomainObjPtr dom) return 0; } -int prlsdkPause(virDomainObjPtr dom) +int prlsdkPause(virDomainObj *dom) { PRL_HANDLE job = PRL_INVALID_HANDLE; - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_RESULT pret; job = PrlVm_Pause(privdom->sdkdom, false); @@ -2353,10 +2353,10 @@ int prlsdkPause(virDomainObjPtr dom) return 0; } -int prlsdkResume(virDomainObjPtr dom) +int prlsdkResume(virDomainObj *dom) { PRL_HANDLE job = PRL_INVALID_HANDLE; - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_RESULT pret; job = PrlVm_Resume(privdom->sdkdom); @@ -2368,10 +2368,10 @@ int prlsdkResume(virDomainObjPtr dom) return 0; } -int prlsdkSuspend(virDomainObjPtr dom) +int prlsdkSuspend(virDomainObj *dom) { PRL_HANDLE job = PRL_INVALID_HANDLE; - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_RESULT pret; job = PrlVm_Suspend(privdom->sdkdom); @@ -2383,10 +2383,10 @@ int prlsdkSuspend(virDomainObjPtr dom) return 0; } -int prlsdkRestart(virDomainObjPtr dom) +int prlsdkRestart(virDomainObj *dom) { PRL_HANDLE job = PRL_INVALID_HANDLE; - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_RESULT pret; job = PrlVm_Restart(privdom->sdkdom); @@ -2398,10 +2398,10 @@ int prlsdkRestart(virDomainObjPtr dom) return 0; } -int prlsdkReset(virDomainObjPtr dom) +int prlsdkReset(virDomainObj *dom) { PRL_HANDLE job = PRL_INVALID_HANDLE; - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_RESULT pret; job = PrlVm_Reset(privdom->sdkdom); @@ -2434,7 +2434,7 @@ prlsdkConvertError(PRL_RESULT pret) } static int -prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def) +prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDef *def) { size_t i; PRL_VM_TYPE vmType; @@ -2505,7 +2505,7 @@ prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def) } for (i = 0; i < virDomainDefGetVcpusMax(def); i++) { - virDomainVcpuDefPtr vcpu = virDomainDefGetVcpu(def, i); + virDomainVcpuDef *vcpu = virDomainDefGetVcpu(def, i); if (vcpu->cpumask && !virBitmapEqual(def->cpumask, vcpu->cpumask)) { @@ -2518,7 +2518,7 @@ prlsdkCheckUnsupportedParams(PRL_HANDLE sdkdom, virDomainDefPtr def) /* * Though we don't support NUMA configuration at the moment - * virDomainDefPtr always contain non zero NUMA configuration + * virDomainDef *always contain non zero NUMA configuration * So, just make sure this configuration doesn't differ from auto generated. */ if ((virDomainNumatuneGetMode(def->numa, -1, &memMode) == 0 && @@ -2743,9 +2743,9 @@ prlsdkAddDeviceToBootList(PRL_HANDLE sdkdom, return -1; } -static int prlsdkCheckVideoUnsupportedParams(virDomainDefPtr def) +static int prlsdkCheckVideoUnsupportedParams(virDomainDef *def) { - virDomainVideoDefPtr v; + virDomainVideoDef *v; if (IS_CT(def)) { if (def->nvideos == 0) { @@ -2791,7 +2791,7 @@ static int prlsdkCheckVideoUnsupportedParams(virDomainDefPtr def) return 0; } -static int prlsdkCheckSerialUnsupportedParams(virDomainChrDefPtr chr) +static int prlsdkCheckSerialUnsupportedParams(virDomainChrDef *chr) { if (chr->deviceType != VIR_DOMAIN_CHR_DEVICE_TYPE_SERIAL) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -2857,7 +2857,7 @@ static int prlsdkCheckSerialUnsupportedParams(virDomainChrDefPtr chr) return 0; } -static int prlsdkCheckNetUnsupportedParams(virDomainNetDefPtr net) +static int prlsdkCheckNetUnsupportedParams(virDomainNetDef *net) { if (net->type != VIR_DOMAIN_NET_TYPE_NETWORK && net->type != VIR_DOMAIN_NET_TYPE_BRIDGE) { @@ -2933,7 +2933,7 @@ static int prlsdkCheckNetUnsupportedParams(virDomainNetDefPtr net) return 0; } -static int prlsdkCheckFSUnsupportedParams(virDomainFSDefPtr fs) +static int prlsdkCheckFSUnsupportedParams(virDomainFSDef *fs) { if (fs->type != VIR_DOMAIN_FS_TYPE_FILE && fs->type != VIR_DOMAIN_FS_TYPE_VOLUME) { @@ -2989,9 +2989,9 @@ static int prlsdkCheckFSUnsupportedParams(virDomainFSDefPtr fs) } static int prlsdkApplyGraphicsParams(PRL_HANDLE sdkdom, - virDomainGraphicsDefPtr gr) + virDomainGraphicsDef *gr) { - virDomainGraphicsListenDefPtr glisten; + virDomainGraphicsListenDef *glisten; PRL_RESULT pret; if (!gr) { @@ -3022,7 +3022,7 @@ static int prlsdkApplyGraphicsParams(PRL_HANDLE sdkdom, return 0; } -static int prlsdkApplyVideoParams(PRL_HANDLE sdkdom G_GNUC_UNUSED, virDomainDefPtr def) +static int prlsdkApplyVideoParams(PRL_HANDLE sdkdom G_GNUC_UNUSED, virDomainDef *def) { PRL_RESULT pret; @@ -3043,7 +3043,7 @@ static int prlsdkApplyVideoParams(PRL_HANDLE sdkdom G_GNUC_UNUSED, virDomainDefP return 0; } -static int prlsdkAddSerial(PRL_HANDLE sdkdom, virDomainChrDefPtr chr) +static int prlsdkAddSerial(PRL_HANDLE sdkdom, virDomainChrDef *chr) { PRL_RESULT pret; PRL_HANDLE sdkchr = PRL_INVALID_HANDLE; @@ -3122,7 +3122,7 @@ static int prlsdkAddSerial(PRL_HANDLE sdkdom, virDomainChrDefPtr chr) #define PRL_MAC_STRING_BUFNAME 13 -static const char * prlsdkFormatMac(virMacAddrPtr mac, char *macstr) +static const char * prlsdkFormatMac(virMacAddr *mac, char *macstr) { g_snprintf(macstr, PRL_MAC_STRING_BUFNAME, "%02X%02X%02X%02X%02X%02X", @@ -3132,18 +3132,18 @@ static const char * prlsdkFormatMac(virMacAddrPtr mac, char *macstr) return macstr; } -static int prlsdkConfigureGateways(PRL_HANDLE sdknet, virDomainNetDefPtr net) +static int prlsdkConfigureGateways(PRL_HANDLE sdknet, virDomainNetDef *net) { int ret = -1; size_t i; - virNetDevIPRoutePtr route4 = NULL; - virNetDevIPRoutePtr route6 = NULL; + virNetDevIPRoute *route4 = NULL; + virNetDevIPRoute *route6 = NULL; char *gw4 = NULL, *gw6 = NULL; PRL_RESULT pret; for (i = 0; i < net->guestIP.nroutes; i++) { - virSocketAddrPtr addrdst; - virSocketAddrPtr gateway; + virSocketAddr *addrdst; + virSocketAddr *gateway; virSocketAddr zero; addrdst = virNetDevIPRouteGetAddress(net->guestIP.routes[i]); @@ -3218,10 +3218,10 @@ static int prlsdkConfigureGateways(PRL_HANDLE sdknet, virDomainNetDefPtr net) return ret; } -static int prlsdkConfigureNet(vzDriverPtr driver G_GNUC_UNUSED, - virDomainObjPtr dom G_GNUC_UNUSED, +static int prlsdkConfigureNet(struct _vzDriver *driver G_GNUC_UNUSED, + virDomainObj *dom G_GNUC_UNUSED, PRL_HANDLE sdkdom, - virDomainNetDefPtr net, + virDomainNetDef *net, bool isCt, bool create) { PRL_RESULT pret; @@ -3359,7 +3359,7 @@ static int prlsdkConfigureNet(vzDriverPtr driver G_GNUC_UNUSED, } static PRL_HANDLE -prlsdkFindNetByMAC(PRL_HANDLE sdkdom, virMacAddrPtr mac) +prlsdkFindNetByMAC(PRL_HANDLE sdkdom, virMacAddr *mac) { PRL_RESULT pret; PRL_UINT32 adaptersCount; @@ -3397,9 +3397,9 @@ prlsdkFindNetByMAC(PRL_HANDLE sdkdom, virMacAddrPtr mac) return adapter; } -static int prlsdkConfigureDisk(vzDriverPtr driver, +static int prlsdkConfigureDisk(struct _vzDriver *driver, PRL_HANDLE sdkdom, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, bool create) { PRL_RESULT pret; @@ -3408,7 +3408,7 @@ static int prlsdkConfigureDisk(vzDriverPtr driver, PRL_VM_DEV_EMULATION_TYPE emutype; PRL_MASS_STORAGE_INTERFACE_TYPE sdkbus; int idx; - virDomainDeviceDriveAddressPtr drive; + virDomainDeviceDriveAddress *drive; PRL_DEVICE_TYPE devType; PRL_CLUSTERED_DEVICE_SUBTYPE scsiModel; const char *path = disk->src->path ? : ""; @@ -3494,7 +3494,7 @@ static int prlsdkConfigureDisk(vzDriverPtr driver, } static PRL_HANDLE -prlsdkGetDisk(PRL_HANDLE sdkdom, virDomainDiskDefPtr disk) +prlsdkGetDisk(PRL_HANDLE sdkdom, virDomainDiskDef *disk) { PRL_RESULT pret; PRL_UINT32 num; @@ -3541,11 +3541,11 @@ prlsdkGetDisk(PRL_HANDLE sdkdom, virDomainDiskDefPtr disk) } int -prlsdkAttachDevice(vzDriverPtr driver, - virDomainObjPtr dom, - virDomainDeviceDefPtr dev) +prlsdkAttachDevice(struct _vzDriver *driver, + virDomainObj *dom, + virDomainDeviceDef *dev) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job = PRL_INVALID_HANDLE; job = PrlVm_BeginEdit(privdom->sdkdom); @@ -3597,12 +3597,12 @@ prlsdkAttachDevice(vzDriverPtr driver, } int -prlsdkDetachDevice(vzDriverPtr driver G_GNUC_UNUSED, - virDomainObjPtr dom, - virDomainDeviceDefPtr dev) +prlsdkDetachDevice(struct _vzDriver *driver G_GNUC_UNUSED, + virDomainObj *dom, + virDomainDeviceDef *dev) { int ret = -1; - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job = PRL_INVALID_HANDLE; PRL_HANDLE sdkdev = PRL_INVALID_HANDLE; PRL_RESULT pret; @@ -3667,11 +3667,11 @@ prlsdkDetachDevice(vzDriverPtr driver G_GNUC_UNUSED, } int -prlsdkUpdateDevice(vzDriverPtr driver, - virDomainObjPtr dom, - virDomainDeviceDefPtr dev) +prlsdkUpdateDevice(struct _vzDriver *driver, + virDomainObj *dom, + virDomainDeviceDef *dev) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job = PRL_INVALID_HANDLE; job = PrlVm_BeginEdit(privdom->sdkdom); @@ -3717,7 +3717,7 @@ prlsdkUpdateDevice(vzDriverPtr driver, } static int -prlsdkAddFS(PRL_HANDLE sdkdom, virDomainFSDefPtr fs) +prlsdkAddFS(PRL_HANDLE sdkdom, virDomainFSDef *fs) { PRL_RESULT pret; PRL_HANDLE sdkdisk = PRL_INVALID_HANDLE; @@ -3770,7 +3770,7 @@ prlsdkAddFS(PRL_HANDLE sdkdom, virDomainFSDefPtr fs) } static int -prlsdkSetBootOrderCt(PRL_HANDLE sdkdom, virDomainDefPtr def) +prlsdkSetBootOrderCt(PRL_HANDLE sdkdom, virDomainDef *def) { size_t i; PRL_HANDLE hdd = PRL_INVALID_HANDLE; @@ -3804,7 +3804,7 @@ prlsdkSetBootOrderCt(PRL_HANDLE sdkdom, virDomainDefPtr def) } static int -prlsdkSetBootOrderVm(PRL_HANDLE sdkdom, virDomainDefPtr def) +prlsdkSetBootOrderVm(PRL_HANDLE sdkdom, virDomainDef *def) { size_t i; int idx[VIR_DOMAIN_BOOT_LAST] = { 0 }; @@ -3845,11 +3845,11 @@ prlsdkSetBootOrderVm(PRL_HANDLE sdkdom, virDomainDefPtr def) } int -prlsdkDomainSetUserPassword(virDomainObjPtr dom, +prlsdkDomainSetUserPassword(virDomainObj *dom, const char *user, const char *password) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job = PRL_INVALID_HANDLE; job = PrlVm_SetUserPasswd(privdom->sdkdom, @@ -3864,10 +3864,10 @@ prlsdkDomainSetUserPassword(virDomainObjPtr dom, } static int -prlsdkDoApplyConfig(vzDriverPtr driver, - virDomainObjPtr dom, +prlsdkDoApplyConfig(struct _vzDriver *driver, + virDomainObj *dom, PRL_HANDLE sdkdom, - virDomainDefPtr def) + virDomainDef *def) { PRL_RESULT pret; size_t i; @@ -3984,11 +3984,11 @@ prlsdkDoApplyConfig(vzDriverPtr driver, } int -prlsdkApplyConfig(vzDriverPtr driver, - virDomainObjPtr dom, - virDomainDefPtr new) +prlsdkApplyConfig(struct _vzDriver *driver, + virDomainObj *dom, + virDomainDef *new) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job = PRL_INVALID_HANDLE; int ret; @@ -4008,7 +4008,7 @@ prlsdkApplyConfig(vzDriverPtr driver, } int -prlsdkCreateVm(vzDriverPtr driver, virDomainDefPtr def) +prlsdkCreateVm(struct _vzDriver *driver, virDomainDef *def) { PRL_HANDLE sdkdom = PRL_INVALID_HANDLE; PRL_HANDLE job = PRL_INVALID_HANDLE; @@ -4051,7 +4051,7 @@ prlsdkCreateVm(vzDriverPtr driver, virDomainDefPtr def) } static int -virStorageTranslatePoolLocal(virConnectPtr conn, virStorageSourcePtr src) +virStorageTranslatePoolLocal(virConnectPtr conn, virStorageSource *src) { virStoragePoolPtr pool = NULL; virStorageVolPtr vol = NULL; @@ -4094,7 +4094,7 @@ virStorageTranslatePoolLocal(virConnectPtr conn, virStorageSourcePtr src) int -prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def) +prlsdkCreateCt(virConnectPtr conn, virDomainDef *def) { PRL_HANDLE sdkdom = PRL_INVALID_HANDLE; PRL_GET_VM_CONFIG_PARAM_DATA confParam; @@ -4102,8 +4102,8 @@ prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def) PRL_HANDLE result = PRL_INVALID_HANDLE; PRL_RESULT pret; PRL_UINT32 flags; - vzConnPtr privconn = conn->privateData; - vzDriverPtr driver = privconn->driver; + struct _vzConn *privconn = conn->privateData; + struct _vzDriver *driver = privconn->driver; int ret = -1; int useTemplate = 0; size_t i; @@ -4172,7 +4172,7 @@ prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def) * Returns 0 if hard disks were successfully detached or not detected. */ static int -prlsdkDetachDomainHardDisks(virDomainObjPtr dom) +prlsdkDetachDomainHardDisks(virDomainObj *dom) { int ret = -1; PRL_RESULT pret; @@ -4180,7 +4180,7 @@ prlsdkDetachDomainHardDisks(virDomainObjPtr dom) PRL_UINT32 i; PRL_HANDLE job; PRL_HANDLE sdkdisk = PRL_INVALID_HANDLE; - vzDomObjPtr pdom = dom->privateData; + struct vzDomObj *pdom = dom->privateData; PRL_HANDLE sdkdom = pdom->sdkdom; job = PrlVm_BeginEdit(sdkdom); @@ -4213,11 +4213,11 @@ prlsdkDetachDomainHardDisks(virDomainObjPtr dom) } int -prlsdkUnregisterDomain(vzDriverPtr driver, virDomainObjPtr dom, unsigned int flags) +prlsdkUnregisterDomain(struct _vzDriver *driver, virDomainObj *dom, unsigned int flags) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job; - virDomainSnapshotObjListPtr snapshots = NULL; + virDomainSnapshotObjList *snapshots = NULL; VIRTUAL_MACHINE_STATE domainState; int ret = -1; int num; @@ -4266,9 +4266,9 @@ prlsdkUnregisterDomain(vzDriverPtr driver, virDomainObjPtr dom, unsigned int fla } int -prlsdkDomainManagedSaveRemove(virDomainObjPtr dom) +prlsdkDomainManagedSaveRemove(virDomainObj *dom) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job; job = PrlVm_DropSuspendedState(privdom->sdkdom); @@ -4310,11 +4310,11 @@ prlsdkExtractStatsParam(PRL_HANDLE sdkstats, const char *name, long long *val) int prlsdkGetBlockStats(PRL_HANDLE sdkstats, - virDomainDiskDefPtr disk, + virDomainDiskDef *disk, virDomainBlockStatsPtr stats, bool isCt) { - virDomainDeviceDriveAddressPtr address; + virDomainDeviceDriveAddress *address; int idx; const char *prefix; int ret = -1; @@ -4528,9 +4528,9 @@ prlsdkGetMemoryStats(PRL_HANDLE sdkstats, } /* memsize is in MiB */ -int prlsdkSetMemsize(virDomainObjPtr dom, unsigned int memsize) +int prlsdkSetMemsize(virDomainObj *dom, unsigned int memsize) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job; PRL_RESULT pret; @@ -4578,17 +4578,17 @@ prlsdkParseDateTime(const char *str) return (long long)g_date_time_to_unix(then); } -static virDomainSnapshotObjListPtr +static virDomainSnapshotObjList * prlsdkParseSnapshotTree(const char *treexml) { - virDomainSnapshotObjListPtr ret = NULL; + virDomainSnapshotObjList *ret = NULL; xmlDocPtr xml = NULL; xmlXPathContextPtr ctxt = NULL; xmlNodePtr root; xmlNodePtr *nodes = NULL; - virDomainSnapshotDefPtr def = NULL; - virDomainMomentObjPtr snapshot; - virDomainSnapshotObjListPtr snapshots = NULL; + virDomainSnapshotDef *def = NULL; + virDomainMomentObj *snapshot; + virDomainSnapshotObjList *snapshots = NULL; char *xmlstr = NULL; int n; size_t i; @@ -4707,13 +4707,13 @@ prlsdkParseSnapshotTree(const char *treexml) return ret; } -virDomainSnapshotObjListPtr -prlsdkLoadSnapshots(virDomainObjPtr dom) +virDomainSnapshotObjList * +prlsdkLoadSnapshots(virDomainObj *dom) { - virDomainSnapshotObjListPtr ret = NULL; + virDomainSnapshotObjList *ret = NULL; PRL_HANDLE job; PRL_HANDLE result = PRL_INVALID_HANDLE; - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; char *treexml = NULL; job = PrlVm_GetSnapshotsTreeEx(privdom->sdkdom, PGST_WITHOUT_SCREENSHOTS); @@ -4731,9 +4731,9 @@ prlsdkLoadSnapshots(virDomainObjPtr dom) return ret; } -int prlsdkCreateSnapshot(virDomainObjPtr dom, const char *description) +int prlsdkCreateSnapshot(virDomainObj *dom, const char *description) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job; job = PrlVm_CreateSnapshot(privdom->sdkdom, "", @@ -4744,9 +4744,9 @@ int prlsdkCreateSnapshot(virDomainObjPtr dom, const char *description) return 0; } -int prlsdkDeleteSnapshot(virDomainObjPtr dom, const char *uuid, bool children) +int prlsdkDeleteSnapshot(virDomainObj *dom, const char *uuid, bool children) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job; job = PrlVm_DeleteSnapshot(privdom->sdkdom, uuid, children); @@ -4756,9 +4756,9 @@ int prlsdkDeleteSnapshot(virDomainObjPtr dom, const char *uuid, bool children) return 0; } -int prlsdkSwitchToSnapshot(virDomainObjPtr dom, const char *uuid, bool paused) +int prlsdkSwitchToSnapshot(virDomainObj *dom, const char *uuid, bool paused) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job; PRL_UINT32 flags = 0; @@ -4781,12 +4781,12 @@ int prlsdkSwitchToSnapshot(virDomainObjPtr dom, const char *uuid, bool paused) #define PRLSDK_MIGRATION_FLAGS (PSL_HIGH_SECURITY | PVMT_DONT_CREATE_DISK) -int prlsdkMigrate(virDomainObjPtr dom, virURIPtr uri, +int prlsdkMigrate(virDomainObj *dom, virURI *uri, const unsigned char *session_uuid, const char *dname, unsigned int flags) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job = PRL_INVALID_HANDLE; char uuidstr[VIR_UUID_STRING_BRACED_BUFLEN]; PRL_UINT32 vzflags = PRLSDK_MIGRATION_FLAGS; @@ -4810,9 +4810,9 @@ int prlsdkMigrate(virDomainObjPtr dom, virURIPtr uri, return 0; } -int prlsdkSetCpuCount(virDomainObjPtr dom, unsigned int count) +int prlsdkSetCpuCount(virDomainObj *dom, unsigned int count) { - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_HANDLE job; PRL_RESULT pret; @@ -4830,12 +4830,12 @@ int prlsdkSetCpuCount(virDomainObjPtr dom, unsigned int count) return 0; } -int prlsdkResizeImage(virDomainObjPtr dom, virDomainDiskDefPtr disk, +int prlsdkResizeImage(virDomainObj *dom, virDomainDiskDef *disk, unsigned long long newsize) { int ret = -1; PRL_RESULT pret; - vzDomObjPtr privdom = dom->privateData; + struct vzDomObj *privdom = dom->privateData; PRL_UINT32 emulatedType; PRL_HANDLE job = PRL_INVALID_HANDLE; PRL_HANDLE prldisk = PRL_INVALID_HANDLE; diff --git a/src/vz/vz_sdk.h b/src/vz/vz_sdk.h index 5acee2ca9d..86e7694c39 100644 --- a/src/vz/vz_sdk.h +++ b/src/vz/vz_sdk.h @@ -28,43 +28,43 @@ int prlsdkInit(void); void prlsdkDeinit(void); -int prlsdkConnect(vzDriverPtr driver); -void prlsdkDisconnect(vzDriverPtr driver); +int prlsdkConnect(struct _vzDriver *driver); +void prlsdkDisconnect(struct _vzDriver *driver); int -prlsdkLoadDomains(vzDriverPtr driver); -virDomainObjPtr -prlsdkAddDomainByUUID(vzDriverPtr driver, const unsigned char *uuid); -virDomainObjPtr -prlsdkAddDomainByName(vzDriverPtr driver, const char *name); -int prlsdkUpdateDomain(vzDriverPtr driver, virDomainObjPtr dom); +prlsdkLoadDomains(struct _vzDriver *driver); +virDomainObj * +prlsdkAddDomainByUUID(struct _vzDriver *driver, const unsigned char *uuid); +virDomainObj * +prlsdkAddDomainByName(struct _vzDriver *driver, const char *name); +int prlsdkUpdateDomain(struct _vzDriver *driver, virDomainObj *dom); -int prlsdkStart(virDomainObjPtr dom); -int prlsdkKill(virDomainObjPtr dom); -int prlsdkStop(virDomainObjPtr dom); -int prlsdkPause(virDomainObjPtr dom); -int prlsdkResume(virDomainObjPtr dom); -int prlsdkSuspend(virDomainObjPtr dom); -int prlsdkRestart(virDomainObjPtr dom); -int prlsdkReset(virDomainObjPtr dom); +int prlsdkStart(virDomainObj *dom); +int prlsdkKill(virDomainObj *dom); +int prlsdkStop(virDomainObj *dom); +int prlsdkPause(virDomainObj *dom); +int prlsdkResume(virDomainObj *dom); +int prlsdkSuspend(virDomainObj *dom); +int prlsdkRestart(virDomainObj *dom); +int prlsdkReset(virDomainObj *dom); int -prlsdkApplyConfig(vzDriverPtr driver, - virDomainObjPtr dom, - virDomainDefPtr new); -int prlsdkCreateVm(vzDriverPtr driver, virDomainDefPtr def); -int prlsdkCreateCt(virConnectPtr conn, virDomainDefPtr def); +prlsdkApplyConfig(struct _vzDriver *driver, + virDomainObj *dom, + virDomainDef *new); +int prlsdkCreateVm(struct _vzDriver *driver, virDomainDef *def); +int prlsdkCreateCt(virConnectPtr conn, virDomainDef *def); int -prlsdkUnregisterDomain(vzDriverPtr driver, virDomainObjPtr dom, unsigned int flags); +prlsdkUnregisterDomain(struct _vzDriver *driver, virDomainObj *dom, unsigned int flags); int -prlsdkDomainManagedSaveRemove(virDomainObjPtr dom); +prlsdkDomainManagedSaveRemove(virDomainObj *dom); int -prlsdkAttachDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPtr dev); +prlsdkAttachDevice(struct _vzDriver *driver, virDomainObj *dom, virDomainDeviceDef *dev); int -prlsdkDetachDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPtr dev); +prlsdkDetachDevice(struct _vzDriver *driver, virDomainObj *dom, virDomainDeviceDef *dev); int -prlsdkUpdateDevice(vzDriverPtr driver, virDomainObjPtr dom, virDomainDeviceDefPtr dev); +prlsdkUpdateDevice(struct _vzDriver *driver, virDomainObj *dom, virDomainDeviceDef *dev); int -prlsdkGetBlockStats(PRL_HANDLE sdkstats, virDomainDiskDefPtr disk, virDomainBlockStatsPtr stats, bool isCt); +prlsdkGetBlockStats(PRL_HANDLE sdkstats, virDomainDiskDef *disk, virDomainBlockStatsPtr stats, bool isCt); int prlsdkGetNetStats(PRL_HANDLE sdkstas, PRL_HANDLE sdkdom, const char *path, virDomainInterfaceStatsPtr stats); int @@ -72,24 +72,24 @@ prlsdkGetVcpuStats(PRL_HANDLE sdkstas, int idx, unsigned long long *time); int prlsdkGetMemoryStats(PRL_HANDLE sdkstas, virDomainMemoryStatPtr stats, unsigned int nr_stats); /* memsize is in MiB */ -int prlsdkSetMemsize(virDomainObjPtr dom, unsigned int memsize); -int prlsdkSetCpuCount(virDomainObjPtr dom, unsigned int count); +int prlsdkSetMemsize(virDomainObj *dom, unsigned int memsize); +int prlsdkSetCpuCount(virDomainObj *dom, unsigned int count); int -prlsdkDomainSetUserPassword(virDomainObjPtr dom, +prlsdkDomainSetUserPassword(virDomainObj *dom, const char *user, const char *password); -virDomainSnapshotObjListPtr prlsdkLoadSnapshots(virDomainObjPtr dom); -int prlsdkCreateSnapshot(virDomainObjPtr dom, const char *description); -int prlsdkDeleteSnapshot(virDomainObjPtr dom, const char *uuid, bool children); -int prlsdkSwitchToSnapshot(virDomainObjPtr dom, const char *uuid, bool paused); +virDomainSnapshotObjList *prlsdkLoadSnapshots(virDomainObj *dom); +int prlsdkCreateSnapshot(virDomainObj *dom, const char *description); +int prlsdkDeleteSnapshot(virDomainObj *dom, const char *uuid, bool children); +int prlsdkSwitchToSnapshot(virDomainObj *dom, const char *uuid, bool paused); int -prlsdkMigrate(virDomainObjPtr dom, - virURIPtr uri, +prlsdkMigrate(virDomainObj *dom, + virURI *uri, const char unsigned *session_uuid, const char *dname, unsigned int flags); PRL_HANDLE -prlsdkSdkDomainLookupByName(vzDriverPtr driver, const char *name); -int prlsdkCancelJob(virDomainObjPtr dom); -int prlsdkResizeImage(virDomainObjPtr dom, virDomainDiskDefPtr disk, unsigned long long newsize); +prlsdkSdkDomainLookupByName(struct _vzDriver *driver, const char *name); +int prlsdkCancelJob(virDomainObj *dom); +int prlsdkResizeImage(virDomainObj *dom, virDomainDiskDef *disk, unsigned long long newsize); diff --git a/src/vz/vz_utils.c b/src/vz/vz_utils.c index e5106619b6..a07754d5ec 100644 --- a/src/vz/vz_utils.c +++ b/src/vz/vz_utils.c @@ -63,19 +63,19 @@ static virDomainControllerType vz7ControllerTypes[] = {VIR_DOMAIN_CONTROLLER_TYP * vzDomObjFromDomain: * @domain: Domain pointer that has to be looked up * - * This function looks up @domain and returns the appropriate virDomainObjPtr + * This function looks up @domain and returns the appropriate virDomainObj * * that has to be released by calling virDomainObjEndAPI(). * * Returns the domain object with incremented reference counter which is locked * on success, NULL otherwise. */ -virDomainObjPtr +virDomainObj * vzDomObjFromDomain(virDomainPtr domain) { - virDomainObjPtr vm; - vzConnPtr privconn = domain->conn->privateData; + virDomainObj *vm; + struct _vzConn *privconn = domain->conn->privateData; char uuidstr[VIR_UUID_STRING_BUFLEN]; - vzDriverPtr driver = privconn->driver; + struct _vzDriver *driver = privconn->driver; vm = virDomainObjListFindByUUID(driver->domains, domain->uuid); if (!vm) { @@ -92,7 +92,7 @@ vzDomObjFromDomain(virDomainPtr domain) static int vzDoCmdRun(char **outbuf, const char *binary, va_list list) { - virCommandPtr cmd = virCommandNewVAList(binary, list); + virCommand *cmd = virCommandNewVAList(binary, list); int ret = -1; if (outbuf) @@ -132,7 +132,7 @@ vzGetOutput(const char *binary, ...) } static void -vzInitCaps(unsigned long vzVersion, vzCapabilitiesPtr vzCaps) +vzInitCaps(unsigned long vzVersion, struct _vzCapabilities *vzCaps) { if (vzVersion < VIRTUOZZO_VER_7) { vzCaps->ctDiskFormat = VIR_STORAGE_FILE_PLOOP; @@ -150,7 +150,7 @@ vzInitCaps(unsigned long vzVersion, vzCapabilitiesPtr vzCaps) } int -vzInitVersion(vzDriverPtr driver) +vzInitVersion(struct _vzDriver *driver) { char *output, *sVer, *tmp; const char *searchStr = "prlsrvctl version "; @@ -197,9 +197,9 @@ vzInitVersion(vzDriverPtr driver) } static int -vzCheckDiskAddressDriveUnsupportedParams(virDomainDiskDefPtr disk) +vzCheckDiskAddressDriveUnsupportedParams(virDomainDiskDef *disk) { - virDomainDeviceDriveAddressPtr drive = &disk->info.addr.drive; + virDomainDeviceDriveAddress *drive = &disk->info.addr.drive; int devIdx, busIdx; if (drive->controller > 0) { @@ -262,7 +262,7 @@ vzCheckDiskAddressDriveUnsupportedParams(virDomainDiskDefPtr disk) } static int -vzCheckDiskUnsupportedParams(virDomainDiskDefPtr disk) +vzCheckDiskUnsupportedParams(virDomainDiskDef *disk) { if (disk->device != VIR_DOMAIN_DISK_DEVICE_DISK && disk->device != VIR_DOMAIN_DISK_DEVICE_CDROM) { @@ -388,8 +388,8 @@ vzCheckDiskUnsupportedParams(virDomainDiskDefPtr disk) int vzCheckUnsupportedDisk(const virDomainDef *def, - virDomainDiskDefPtr disk, - vzCapabilitiesPtr vzCaps) + virDomainDiskDef *disk, + struct _vzCapabilities *vzCaps) { size_t i; virStorageFileFormat diskFormat; @@ -434,10 +434,10 @@ vzCheckUnsupportedDisk(const virDomainDef *def, } int -vzCheckUnsupportedControllers(const virDomainDef *def, vzCapabilitiesPtr vzCaps) +vzCheckUnsupportedControllers(const virDomainDef *def, struct _vzCapabilities *vzCaps) { size_t i, j; - virDomainControllerDefPtr controller; + virDomainControllerDef *controller; for (i = 0; i < def->ncontrollers; i++) { controller = def->controllers[i]; @@ -468,7 +468,7 @@ vzCheckUnsupportedControllers(const virDomainDef *def, vzCapabilitiesPtr vzCaps) return 0; } -int vzGetDefaultSCSIModel(vzDriverPtr driver, +int vzGetDefaultSCSIModel(struct _vzDriver *driver, PRL_CLUSTERED_DEVICE_SUBTYPE *scsiModel) { switch ((int)driver->vzCaps.scsiControllerModel) { @@ -488,7 +488,7 @@ int vzGetDefaultSCSIModel(vzDriverPtr driver, return 0; } -int vzCheckUnsupportedGraphics(virDomainGraphicsDefPtr gr) +int vzCheckUnsupportedGraphics(virDomainGraphicsDef *gr) { if (gr->type != VIR_DOMAIN_GRAPHICS_TYPE_VNC) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", @@ -554,7 +554,7 @@ int vzCheckUnsupportedGraphics(virDomainGraphicsDefPtr gr) void* vzDomObjAlloc(void *opaque G_GNUC_UNUSED) { - vzDomObjPtr pdom = NULL; + struct vzDomObj *pdom = NULL; pdom = g_new0(struct vzDomObj, 1); @@ -574,7 +574,7 @@ vzDomObjAlloc(void *opaque G_GNUC_UNUSED) void vzDomObjFree(void* p) { - vzDomObjPtr pdom = p; + struct vzDomObj *pdom = p; if (!pdom) return; @@ -588,9 +588,9 @@ vzDomObjFree(void* p) #define VZ_JOB_WAIT_TIME (1000 * 30) int -vzDomainObjBeginJob(virDomainObjPtr dom) +vzDomainObjBeginJob(virDomainObj *dom) { - vzDomObjPtr pdom = dom->privateData; + struct vzDomObj *pdom = dom->privateData; unsigned long long now; unsigned long long then; @@ -624,9 +624,9 @@ vzDomainObjBeginJob(virDomainObjPtr dom) } void -vzDomainObjEndJob(virDomainObjPtr dom) +vzDomainObjEndJob(virDomainObj *dom) { - vzDomObjPtr pdom = dom->privateData; + struct vzDomObj *pdom = dom->privateData; pdom->job.active = false; pdom->job.cancelled = false; @@ -634,7 +634,7 @@ vzDomainObjEndJob(virDomainObjPtr dom) } int -vzDomainJobUpdateTime(vzDomainJobObjPtr job) +vzDomainJobUpdateTime(struct _vzDomainJobObj *job) { unsigned long long now; diff --git a/src/vz/vz_utils.h b/src/vz/vz_utils.h index 7ebb34bb11..9cb3c806e4 100644 --- a/src/vz/vz_utils.h +++ b/src/vz/vz_utils.h @@ -58,7 +58,6 @@ struct _vzCapabilities { virDomainControllerModelSCSI scsiControllerModel; }; typedef struct _vzCapabilities vzCapabilities; -typedef struct _vzCapabilities *vzCapabilitiesPtr; /* +2 to keep enclosing { and } */ #define VIR_UUID_STRING_BRACED_BUFLEN (VIR_UUID_STRING_BUFLEN + 2) @@ -67,30 +66,28 @@ struct _vzDriver { virObjectLockable parent; /* Immutable pointer, self-locking APIs */ - virDomainObjListPtr domains; + virDomainObjList *domains; unsigned char session_uuid[VIR_UUID_BUFLEN]; PRL_HANDLE server; - virCapsPtr caps; - virDomainXMLOptionPtr xmlopt; - virObjectEventStatePtr domainEventState; - virSysinfoDefPtr hostsysinfo; + virCaps *caps; + virDomainXMLOption *xmlopt; + virObjectEventState *domainEventState; + virSysinfoDef *hostsysinfo; unsigned long vzVersion; vzCapabilities vzCaps; }; typedef struct _vzDriver vzDriver; -typedef struct _vzDriver *vzDriverPtr; struct _vzConn { struct _vzConn* next; - vzDriverPtr driver; + struct _vzDriver *driver; /* Immutable pointer, self-locking APIs */ - virConnectCloseCallbackDataPtr closeCallback; + virConnectCloseCallbackData *closeCallback; }; typedef struct _vzConn vzConn; -typedef struct _vzConn *vzConnPtr; struct _vzDomainJobObj { virCond cond; @@ -105,7 +102,6 @@ struct _vzDomainJobObj { }; typedef struct _vzDomainJobObj vzDomainJobObj; -typedef struct _vzDomainJobObj *vzDomainJobObjPtr; struct vzDomObj { int id; @@ -114,36 +110,34 @@ struct vzDomObj { vzDomainJobObj job; }; -typedef struct vzDomObj *vzDomObjPtr; - void* vzDomObjAlloc(void *opaque); void vzDomObjFree(void *p); -virDomainObjPtr vzDomObjFromDomain(virDomainPtr domain); +virDomainObj *vzDomObjFromDomain(virDomainPtr domain); char * vzGetOutput(const char *binary, ...) ATTRIBUTE_NONNULL(1) G_GNUC_NULL_TERMINATED; -vzDriverPtr +struct _vzDriver * vzGetDriverConnection(void); void vzDestroyDriverConnection(void); int -vzInitVersion(vzDriverPtr driver); +vzInitVersion(struct _vzDriver *driver); int vzCheckUnsupportedDisk(const virDomainDef *def, - virDomainDiskDefPtr disk, - vzCapabilitiesPtr vzCaps); + virDomainDiskDef *disk, + struct _vzCapabilities *vzCaps); int vzCheckUnsupportedControllers(const virDomainDef *def, - vzCapabilitiesPtr vzCaps); + struct _vzCapabilities *vzCaps); int -vzGetDefaultSCSIModel(vzDriverPtr driver, +vzGetDefaultSCSIModel(struct _vzDriver *driver, PRL_CLUSTERED_DEVICE_SUBTYPE *scsiModel); -int vzCheckUnsupportedGraphics(virDomainGraphicsDefPtr gr); +int vzCheckUnsupportedGraphics(virDomainGraphicsDef *gr); #define PARALLELS_BLOCK_STATS_FOREACH(OP) \ OP(rd_req, VIR_DOMAIN_BLOCK_STATS_READ_REQ, "read_requests") \ @@ -152,8 +146,8 @@ int vzCheckUnsupportedGraphics(virDomainGraphicsDefPtr gr); OP(wr_bytes, VIR_DOMAIN_BLOCK_STATS_WRITE_BYTES, "write_total") int -vzDomainObjBeginJob(virDomainObjPtr dom); +vzDomainObjBeginJob(virDomainObj *dom); void -vzDomainObjEndJob(virDomainObjPtr dom); +vzDomainObjEndJob(virDomainObj *dom); int -vzDomainJobUpdateTime(vzDomainJobObjPtr job); +vzDomainJobUpdateTime(struct _vzDomainJobObj *job); diff --git a/tests/bhyveargv2xmlmock.c b/tests/bhyveargv2xmlmock.c index 8120be29c1..f129f96500 100644 --- a/tests/bhyveargv2xmlmock.c +++ b/tests/bhyveargv2xmlmock.c @@ -10,7 +10,7 @@ void virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN], - virMacAddrPtr addr) + virMacAddr *addr) { addr->addr[0] = prefix[0]; addr->addr[1] = prefix[1]; @@ -28,7 +28,7 @@ virUUIDGenerate(unsigned char *uuid) return 0; } -virCPUDefPtr +virCPUDef * virCPUProbeHost(virArch arch) { return testUtilsHostCpusGetDefForArch(arch); diff --git a/tests/bhyvexml2argvmock.c b/tests/bhyvexml2argvmock.c index af5e0fd4b9..f3820ef032 100644 --- a/tests/bhyvexml2argvmock.c +++ b/tests/bhyvexml2argvmock.c @@ -42,7 +42,7 @@ opendir(const char *path) } void virMacAddrGenerate(const unsigned char prefix[VIR_MAC_PREFIX_BUFLEN], - virMacAddrPtr addr) + virMacAddr *addr) { addr->addr[0] = prefix[0]; addr->addr[1] = prefix[1]; @@ -62,7 +62,7 @@ int virNetDevTapCreateInBridgePort(const char *brname G_GNUC_UNUSED, const virNetDevVPortProfile *virtPortProfile G_GNUC_UNUSED, const virNetDevVlan *virtVlan G_GNUC_UNUSED, virTristateBool isolatedPort G_GNUC_UNUSED, - virNetDevCoalescePtr coalesce G_GNUC_UNUSED, + virNetDevCoalesce *coalesce G_GNUC_UNUSED, unsigned int mtu G_GNUC_UNUSED, unsigned int *actualMTU G_GNUC_UNUSED, unsigned int fakeflags G_GNUC_UNUSED) diff --git a/tests/commandtest.c b/tests/commandtest.c index 81e9914860..15ea77b36a 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -429,7 +429,7 @@ static int test12(const void *unused G_GNUC_UNUSED) */ static int test13(const void *unused G_GNUC_UNUSED) { - virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper"); + virCommand *cmd = virCommandNew(abs_builddir "/commandhelper"); g_autofree char *outactual = NULL; const char *outexpect = "BEGIN STDOUT\n" "Hello World\n" @@ -467,7 +467,7 @@ static int test13(const void *unused G_GNUC_UNUSED) */ static int test14(const void *unused G_GNUC_UNUSED) { - virCommandPtr cmd = virCommandNew(abs_builddir "/commandhelper"); + virCommand *cmd = virCommandNew(abs_builddir "/commandhelper"); g_autofree char *outactual = NULL; const char *outexpect = "BEGIN STDOUT\n" "Hello World\n" @@ -646,7 +646,7 @@ static int test17(const void *unused G_GNUC_UNUSED) */ static int test18(const void *unused G_GNUC_UNUSED) { - virCommandPtr cmd = virCommandNewArgList("sleep", "100", NULL); + virCommand *cmd = virCommandNewArgList("sleep", "100", NULL); g_autofree char *pidfile = virPidFileBuildPath(abs_builddir, "commandhelper"); pid_t pid; int ret = -1; @@ -806,7 +806,7 @@ static int test22(const void *unused G_GNUC_UNUSED) { int ret = -1; - virCommandPtr cmd; + virCommand *cmd; int status = -1; cmd = virCommandNewArgList("/bin/sh", "-c", "exit 3", NULL); diff --git a/tests/cputest.c b/tests/cputest.c index 593861dfe9..18de84e050 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -56,7 +56,7 @@ struct data { virArch arch; const char *host; const char *name; - virDomainCapsCPUModelsPtr models; + virDomainCapsCPUModels *models; const char *modelsName; unsigned int flags; int result; @@ -67,13 +67,13 @@ static virQEMUDriver driver; #endif -static virCPUDefPtr +static virCPUDef * cpuTestLoadXML(virArch arch, const char *name) { char *xml = NULL; xmlDocPtr doc = NULL; xmlXPathContextPtr ctxt = NULL; - virCPUDefPtr cpu = NULL; + virCPUDef *cpu = NULL; xml = g_strdup_printf("%s/cputestdata/%s-%s.xml", abs_srcdir, virArchToString(arch), name); @@ -91,7 +91,7 @@ cpuTestLoadXML(virArch arch, const char *name) } -static virCPUDefPtr * +static virCPUDef ** cpuTestLoadMultiXML(virArch arch, const char *name, unsigned int *count) @@ -100,7 +100,7 @@ cpuTestLoadMultiXML(virArch arch, xmlDocPtr doc = NULL; xmlXPathContextPtr ctxt = NULL; xmlNodePtr *nodes = NULL; - virCPUDefPtr *cpus = NULL; + virCPUDef **cpus = NULL; int n; size_t i; @@ -116,7 +116,7 @@ cpuTestLoadMultiXML(virArch arch, goto cleanup; } - cpus = g_new0(virCPUDefPtr, n); + cpus = g_new0(virCPUDef *, n); for (i = 0; i < n; i++) { ctxt->node = nodes[i]; @@ -202,8 +202,8 @@ cpuTestCompare(const void *arg) { const struct data *data = arg; int ret = -1; - virCPUDefPtr host = NULL; - virCPUDefPtr cpu = NULL; + virCPUDef *host = NULL; + virCPUDef *cpu = NULL; virCPUCompareResult result; if (!(host = cpuTestLoadXML(data->arch, data->host)) || @@ -237,8 +237,8 @@ cpuTestGuestCPU(const void *arg) { const struct data *data = arg; int ret = -2; - virCPUDefPtr host = NULL; - virCPUDefPtr cpu = NULL; + virCPUDef *host = NULL; + virCPUDef *cpu = NULL; virCPUCompareResult cmpResult; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; char *result = NULL; @@ -302,8 +302,8 @@ cpuTestBaseline(const void *arg) { const struct data *data = arg; int ret = -1; - virCPUDefPtr *cpus = NULL; - virCPUDefPtr baseline = NULL; + virCPUDef **cpus = NULL; + virCPUDef *baseline = NULL; unsigned int ncpus = 0; char *result = NULL; const char *suffix; @@ -379,9 +379,9 @@ cpuTestUpdate(const void *arg) { const struct data *data = arg; int ret = -1; - virCPUDefPtr host = NULL; - virCPUDefPtr migHost = NULL; - virCPUDefPtr cpu = NULL; + virCPUDef *host = NULL; + virCPUDef *migHost = NULL; + virCPUDef *cpu = NULL; char *result = NULL; if (!(host = cpuTestLoadXML(data->arch, data->host)) || @@ -412,8 +412,8 @@ cpuTestHasFeature(const void *arg) { const struct data *data = arg; int ret = -1; - virCPUDefPtr host = NULL; - virCPUDataPtr hostData = NULL; + virCPUDef *host = NULL; + virCPUData *hostData = NULL; int result; if (!(host = cpuTestLoadXML(data->arch, data->host))) @@ -469,13 +469,13 @@ typedef enum { } cpuTestCPUIDJson; #if WITH_QEMU -static virQEMUCapsPtr +static virQEMUCaps * cpuTestMakeQEMUCaps(const struct data *data) { - virQEMUCapsPtr qemuCaps = NULL; - qemuMonitorTestPtr testMon = NULL; - qemuMonitorCPUModelInfoPtr model = NULL; - virCPUDefPtr cpu = NULL; + virQEMUCaps *qemuCaps = NULL; + qemuMonitorTest *testMon = NULL; + qemuMonitorCPUModelInfo *model = NULL; + virCPUDef *cpu = NULL; bool fail_no_props = true; char *json = NULL; @@ -532,9 +532,9 @@ cpuTestMakeQEMUCaps(const struct data *data) static int cpuTestGetCPUModels(const struct data *data, - virDomainCapsCPUModelsPtr *models) + virDomainCapsCPUModels **models) { - virQEMUCapsPtr qemuCaps; + virQEMUCaps *qemuCaps; *models = NULL; @@ -556,7 +556,7 @@ cpuTestGetCPUModels(const struct data *data, static int cpuTestGetCPUModels(const struct data *data, - virDomainCapsCPUModelsPtr *models) + virDomainCapsCPUModels **models) { *models = NULL; @@ -574,12 +574,12 @@ cpuTestCPUID(bool guest, const void *arg) { const struct data *data = arg; int ret = -1; - virCPUDataPtr hostData = NULL; + virCPUData *hostData = NULL; char *hostFile = NULL; char *host = NULL; - virCPUDefPtr cpu = NULL; + virCPUDef *cpu = NULL; char *result = NULL; - virDomainCapsCPUModelsPtr models = NULL; + virDomainCapsCPUModels *models = NULL; hostFile = g_strdup_printf("%s/cputestdata/%s-cpuid-%s.xml", abs_srcdir, virArchToString(data->arch), data->host); @@ -642,7 +642,7 @@ cpuTestGuestCPUID(const void *arg) static int cpuTestCompareSignature(const struct data *data, - virCPUDataPtr hostData) + virCPUData *hostData) { g_autofree char *result = NULL; g_autofree char *sigStr = NULL; @@ -668,7 +668,7 @@ static int cpuTestCPUIDSignature(const void *arg) { const struct data *data = arg; - virCPUDataPtr hostData = NULL; + virCPUData *hostData = NULL; char *hostFile = NULL; char *host = NULL; int ret = -1; @@ -692,8 +692,8 @@ cpuTestCPUIDSignature(const void *arg) static int cpuTestUpdateLiveCompare(virArch arch, - virCPUDefPtr actual, - virCPUDefPtr expected) + virCPUDef *actual, + virCPUDef *expected) { size_t i, j; int ret = 0; @@ -710,8 +710,8 @@ cpuTestUpdateLiveCompare(virArch arch, i = j = 0; while (i < actual->nfeatures || j < expected->nfeatures) { - virCPUFeatureDefPtr featAct = NULL; - virCPUFeatureDefPtr featExp = NULL; + virCPUFeatureDef *featAct = NULL; + virCPUFeatureDef *featExp = NULL; int cmp; if (i < actual->nfeatures) @@ -784,17 +784,17 @@ cpuTestUpdateLive(const void *arg) { const struct data *data = arg; char *cpuFile = NULL; - virCPUDefPtr cpu = NULL; + virCPUDef *cpu = NULL; char *enabledFile = NULL; char *enabled = NULL; - virCPUDataPtr enabledData = NULL; + virCPUData *enabledData = NULL; char *disabledFile = NULL; char *disabled = NULL; - virCPUDataPtr disabledData = NULL; + virCPUData *disabledData = NULL; char *expectedFile = NULL; - virCPUDefPtr expected = NULL; - virDomainCapsCPUModelsPtr hvModels = NULL; - virDomainCapsCPUModelsPtr models = NULL; + virCPUDef *expected = NULL; + virDomainCapsCPUModels *hvModels = NULL; + virDomainCapsCPUModels *models = NULL; int ret = -1; cpuFile = g_strdup_printf("cpuid-%s-guest", data->host); @@ -824,7 +824,7 @@ cpuTestUpdateLive(const void *arg) * use the CPU model from 'expected'. */ if (STRNEQ(cpu->model, expected->model)) { - virDomainCapsCPUModelPtr hvModel; + virDomainCapsCPUModel *hvModel; char **blockers = NULL; virDomainCapsCPUUsable usable = VIR_DOMCAPS_CPU_USABLE_UNKNOWN; int rc; @@ -881,8 +881,8 @@ static int cpuTestJSONCPUID(const void *arg) { const struct data *data = arg; - virQEMUCapsPtr qemuCaps = NULL; - virCPUDefPtr cpu = NULL; + virQEMUCaps *qemuCaps = NULL; + virCPUDef *cpu = NULL; char *result = NULL; int ret = -1; @@ -914,9 +914,9 @@ static int cpuTestJSONSignature(const void *arg) { const struct data *data = arg; - virQEMUCapsPtr qemuCaps = NULL; - virCPUDataPtr hostData = NULL; - qemuMonitorCPUModelInfoPtr modelInfo; + virQEMUCaps *qemuCaps = NULL; + virCPUData *hostData = NULL; + qemuMonitorCPUModelInfo *modelInfo; int ret = -1; if (!(qemuCaps = cpuTestMakeQEMUCaps(data))) @@ -942,10 +942,10 @@ static const char *models_list[] = { "qemu64", "core2duo", "Nehalem", NULL } static const char *haswell_list[] = { "SandyBridge", "Haswell", NULL }; static const char *ppc_models_list[] = { "POWER6", "POWER7", "POWER8", NULL }; -static virDomainCapsCPUModelsPtr +static virDomainCapsCPUModels * cpuTestInitModels(const char **list) { - virDomainCapsCPUModelsPtr cpus; + virDomainCapsCPUModels *cpus; const char **model; if (!(cpus = virDomainCapsCPUModelsNew(0))) @@ -968,11 +968,11 @@ cpuTestInitModels(const char **list) static int mymain(void) { - virDomainCapsCPUModelsPtr model486 = NULL; - virDomainCapsCPUModelsPtr nomodel = NULL; - virDomainCapsCPUModelsPtr models = NULL; - virDomainCapsCPUModelsPtr haswell = NULL; - virDomainCapsCPUModelsPtr ppc_models = NULL; + virDomainCapsCPUModels *model486 = NULL; + virDomainCapsCPUModels *nomodel = NULL; + virDomainCapsCPUModels *models = NULL; + virDomainCapsCPUModels *haswell = NULL; + virDomainCapsCPUModels *ppc_models = NULL; int ret = 0; #if WITH_QEMU diff --git a/tests/domaincapstest.c b/tests/domaincapstest.c index f913346331..ca29644dee 100644 --- a/tests/domaincapstest.c +++ b/tests/domaincapstest.c @@ -28,7 +28,7 @@ #if WITH_QEMU || WITH_BHYVE static int G_GNUC_NULL_TERMINATED -fillStringValues(virDomainCapsStringValuesPtr values, ...) +fillStringValues(virDomainCapsStringValues *values, ...) { va_list list; const char *str; @@ -67,16 +67,16 @@ fakeHostCPU(virArch arch) } static int -fillQemuCaps(virDomainCapsPtr domCaps, +fillQemuCaps(virDomainCaps *domCaps, const char *name, const char *arch, const char *machine, - virQEMUDriverConfigPtr cfg) + virQEMUDriverConfig *cfg) { int ret = -1; char *path = NULL; - virQEMUCapsPtr qemuCaps = NULL; - virDomainCapsLoaderPtr loader = &domCaps->os.loader; + virQEMUCaps *qemuCaps = NULL; + virDomainCapsLoader *loader = &domCaps->os.loader; virDomainVirtType virtType; if (fakeHostCPU(domCaps->arch) < 0) @@ -138,12 +138,12 @@ fillQemuCaps(virDomainCapsPtr domCaps, # include "testutilsxen.h" static int -fillXenCaps(virDomainCapsPtr domCaps) +fillXenCaps(virDomainCaps *domCaps) { - virFirmwarePtr *firmwares; + virFirmware **firmwares; int ret = -1; - firmwares = g_new0(virFirmwarePtr, 2); + firmwares = g_new0(virFirmware *, 2); firmwares[0] = g_new0(virFirmware, 1); firmwares[1] = g_new0(virFirmware, 1); @@ -166,9 +166,9 @@ fillXenCaps(virDomainCapsPtr domCaps) # include "bhyve/bhyve_capabilities.h" static int -fillBhyveCaps(virDomainCapsPtr domCaps, unsigned int *bhyve_caps) +fillBhyveCaps(virDomainCaps *domCaps, unsigned int *bhyve_caps) { - virDomainCapsStringValuesPtr firmwares = NULL; + virDomainCapsStringValues *firmwares = NULL; int ret = -1; firmwares = g_new0(virDomainCapsStringValues, 1); @@ -208,7 +208,7 @@ static int test_virDomainCapsFormat(const void *opaque) { const struct testData *data = opaque; - virDomainCapsPtr domCaps = NULL; + virDomainCaps *domCaps = NULL; char *path = NULL; char *domCapsXML = NULL; int ret = -1; diff --git a/tests/domainconftest.c b/tests/domainconftest.c index 754ef2eb3d..66a133c13e 100644 --- a/tests/domainconftest.c +++ b/tests/domainconftest.c @@ -29,8 +29,8 @@ VIR_LOG_INIT("tests.domainconftest"); -static virCapsPtr caps; -static virDomainXMLOptionPtr xmlopt; +static virCaps *caps; +static virDomainXMLOption *xmlopt; struct testGetFilesystemData { const char *filename; @@ -41,10 +41,10 @@ struct testGetFilesystemData { static int testGetFilesystem(const void *opaque) { int ret = -1; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; char *filename = NULL; const struct testGetFilesystemData *data = opaque; - virDomainFSDefPtr fsdef; + virDomainFSDef *fsdef; filename = g_strdup_printf("%s/domainconfdata/%s.xml", abs_srcdir, data->filename); diff --git a/tests/genericxml2xmltest.c b/tests/genericxml2xmltest.c index 5e8f58b4a2..ac89422a32 100644 --- a/tests/genericxml2xmltest.c +++ b/tests/genericxml2xmltest.c @@ -12,8 +12,8 @@ #define VIR_FROM_THIS VIR_FROM_NONE -static virCapsPtr caps; -static virDomainXMLOptionPtr xmlopt; +static virCaps *caps; +static virDomainXMLOption *xmlopt; struct testInfo { const char *name; @@ -51,10 +51,10 @@ struct testCompareBackupXMLData { }; -static virDomainDiskDefPtr +static virDomainDiskDef * testCompareBackupXMLGetFakeDomdisk(const char *dst) { - virDomainDiskDefPtr domdisk = NULL; + virDomainDiskDef *domdisk = NULL; if (!(domdisk = virDomainDiskDefNew(NULL))) abort(); @@ -104,7 +104,7 @@ testCompareBackupXML(const void *opaque) return -1; fakedef->ndisks = backup->ndisks + 1; - fakedef->disks = g_new0(virDomainDiskDefPtr, fakedef->ndisks); + fakedef->disks = g_new0(virDomainDiskDef *, fakedef->ndisks); for (i = 0; i < backup->ndisks; i++) fakedef->disks[i] = testCompareBackupXMLGetFakeDomdisk(backup->disks[i].name); diff --git a/tests/interfacexml2xmltest.c b/tests/interfacexml2xmltest.c index f9740d1cf3..07d179e3a3 100644 --- a/tests/interfacexml2xmltest.c +++ b/tests/interfacexml2xmltest.c @@ -19,7 +19,7 @@ testCompareXMLToXMLFiles(const char *xml) char *xmlData = NULL; char *actual = NULL; int ret = -1; - virInterfaceDefPtr dev = NULL; + virInterfaceDef *dev = NULL; if (virTestLoadFile(xml, &xmlData) < 0) goto fail; diff --git a/tests/libxlxml2domconfigtest.c b/tests/libxlxml2domconfigtest.c index 3c133ac6f0..484c2121cb 100644 --- a/tests/libxlxml2domconfigtest.c +++ b/tests/libxlxml2domconfigtest.c @@ -41,7 +41,7 @@ # define VIR_FROM_THIS VIR_FROM_LIBXL -static libxlDriverPrivatePtr driver; +static libxlDriverPrivate *driver; static int testCompareXMLToDomConfig(const char *xmlfile, @@ -51,8 +51,8 @@ testCompareXMLToDomConfig(const char *xmlfile, libxl_domain_config actualconfig; libxl_domain_config expectconfig; xentoollog_logger *log = NULL; - virPortAllocatorRangePtr gports = NULL; - virDomainDefPtr vmdef = NULL; + virPortAllocatorRange *gports = NULL; + virDomainDef *vmdef = NULL; char *actualjson = NULL; char *tempjson = NULL; char *expectjson = NULL; diff --git a/tests/lxcconf2xmltest.c b/tests/lxcconf2xmltest.c index ba0c7a1a0c..df7756c931 100644 --- a/tests/lxcconf2xmltest.c +++ b/tests/lxcconf2xmltest.c @@ -10,9 +10,9 @@ # define VIR_FROM_THIS VIR_FROM_NONE -static virLXCDriverPtr driver; +static virLXCDriver *driver; -static int testSanitizeDef(virDomainDefPtr vmdef) +static int testSanitizeDef(virDomainDef *vmdef) { /* Remove UUID randomness */ if (virUUIDParse("c7a5fdbd-edaf-9455-926a-d65c16db1809", vmdef->uuid) < 0) @@ -28,7 +28,7 @@ testCompareXMLToConfigFiles(const char *xmlfile, int ret = -1; char *config = NULL; char *actualxml = NULL; - virDomainDefPtr vmdef = NULL; + virDomainDef *vmdef = NULL; if (virTestLoadFile(configfile, &config) < 0) goto fail; diff --git a/tests/lxcxml2xmltest.c b/tests/lxcxml2xmltest.c index 919ad9be3b..00341ad695 100644 --- a/tests/lxcxml2xmltest.c +++ b/tests/lxcxml2xmltest.c @@ -16,7 +16,7 @@ # define VIR_FROM_THIS VIR_FROM_NONE -static virLXCDriverPtr driver; +static virLXCDriver *driver; struct testInfo { const char *name; diff --git a/tests/networkxml2conftest.c b/tests/networkxml2conftest.c index b35de50f0b..402244ea4a 100644 --- a/tests/networkxml2conftest.c +++ b/tests/networkxml2conftest.c @@ -17,17 +17,17 @@ static int testCompareXMLToConfFiles(const char *inxml, const char *outconf, - char *outhostsfile, dnsmasqCapsPtr caps) + char *outhostsfile, dnsmasqCaps *caps) { char *confactual = NULL; char *hostsfileactual = NULL; int ret = -1; - virNetworkDefPtr def = NULL; - virNetworkObjPtr obj = NULL; - virCommandPtr cmd = NULL; + virNetworkDef *def = NULL; + virNetworkObj *obj = NULL; + virCommand *cmd = NULL; char *pidfile = NULL; dnsmasqContext *dctx = NULL; - virNetworkXMLOptionPtr xmlopt = NULL; + virNetworkXMLOption *xmlopt = NULL; if (!(xmlopt = networkDnsmasqCreateXMLConf())) goto fail; @@ -93,7 +93,7 @@ testCompareXMLToConfFiles(const char *inxml, const char *outconf, typedef struct { const char *name; - dnsmasqCapsPtr caps; + dnsmasqCaps *caps; } testInfo; static int @@ -122,11 +122,11 @@ static int mymain(void) { int ret = 0; - dnsmasqCapsPtr restricted + dnsmasqCaps *restricted = dnsmasqCapsNewFromBuffer("Dnsmasq version 2.48", DNSMASQ); - dnsmasqCapsPtr full + dnsmasqCaps *full = dnsmasqCapsNewFromBuffer("Dnsmasq version 2.63\n--bind-dynamic", DNSMASQ); - dnsmasqCapsPtr dhcpv6 + dnsmasqCaps *dhcpv6 = dnsmasqCapsNewFromBuffer("Dnsmasq version 2.64\n--bind-dynamic", DNSMASQ); #define DO_TEST(xname, xcaps) \ diff --git a/tests/networkxml2firewalltest.c b/tests/networkxml2firewalltest.c index 60cd79eeb2..80ba510d14 100644 --- a/tests/networkxml2firewalltest.c +++ b/tests/networkxml2firewalltest.c @@ -93,7 +93,7 @@ static int testCompareXMLToArgvFiles(const char *xml, { char *actualargv = NULL; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virNetworkDefPtr def = NULL; + virNetworkDef *def = NULL; int ret = -1; char *actual; g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew(); diff --git a/tests/networkxml2xmltest.c b/tests/networkxml2xmltest.c index 17817418b7..3b0a0b7c95 100644 --- a/tests/networkxml2xmltest.c +++ b/tests/networkxml2xmltest.c @@ -29,8 +29,8 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml, char *actual = NULL; int ret; testCompareNetXML2XMLResult result = TEST_COMPARE_NET_XML2XML_RESULT_SUCCESS; - virNetworkDefPtr dev = NULL; - virNetworkXMLOptionPtr xmlopt = NULL; + virNetworkDef *dev = NULL; + virNetworkXMLOption *xmlopt = NULL; if (!(xmlopt = networkDnsmasqCreateXMLConf())) goto cleanup; diff --git a/tests/networkxml2xmlupdatetest.c b/tests/networkxml2xmlupdatetest.c index 00d867fbc2..11cfdfc25e 100644 --- a/tests/networkxml2xmlupdatetest.c +++ b/tests/networkxml2xmlupdatetest.c @@ -22,7 +22,7 @@ testCompareXMLToXMLFiles(const char *netxml, const char *updatexml, char *updateXmlData = NULL; char *actual = NULL; int ret = -1; - virNetworkDefPtr def = NULL; + virNetworkDef *def = NULL; if (virTestLoadFile(updatexml, &updateXmlData) < 0) goto error; diff --git a/tests/nodedevmdevctltest.c b/tests/nodedevmdevctltest.c index 27bdc67928..99e79c18a5 100644 --- a/tests/nodedevmdevctltest.c +++ b/tests/nodedevmdevctltest.c @@ -52,7 +52,7 @@ testMdevctlStartOrDefine(const char *virt_type, const char *jsonfile) { g_autoptr(virNodeDeviceDef) def = NULL; - virNodeDeviceObjPtr obj = NULL; + virNodeDeviceObj *obj = NULL; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; const char *actualCmdline = NULL; int ret = -1; @@ -270,7 +270,7 @@ testMdevctlParse(const void *data) } static void -nodedevTestDriverFree(virNodeDeviceDriverStatePtr drv) +nodedevTestDriverFree(virNodeDeviceDriverState *drv) { if (!drv) return; @@ -283,10 +283,10 @@ nodedevTestDriverFree(virNodeDeviceDriverStatePtr drv) } /* Add a fake root 'computer' device */ -static virNodeDeviceDefPtr +static virNodeDeviceDef * fakeRootDevice(void) { - virNodeDeviceDefPtr def = NULL; + virNodeDeviceDef *def = NULL; def = g_new0(virNodeDeviceDef, 1); def->caps = g_new0(virNodeDevCapsDef, 1); @@ -299,11 +299,11 @@ fakeRootDevice(void) * devices. For our purposes, it only needs to have a name that matches the * parent of the mdev, and it needs a PCI address */ -static virNodeDeviceDefPtr +static virNodeDeviceDef * fakeParentDevice(void) { - virNodeDeviceDefPtr def = NULL; - virNodeDevCapPCIDevPtr pci_dev; + virNodeDeviceDef *def = NULL; + virNodeDevCapPCIDev *pci_dev; def = g_new0(virNodeDeviceDef, 1); def->caps = g_new0(virNodeDevCapsDef, 1); @@ -322,9 +322,9 @@ fakeParentDevice(void) } static int -addDevice(virNodeDeviceDefPtr def) +addDevice(virNodeDeviceDef *def) { - virNodeDeviceObjPtr obj; + virNodeDeviceObj *obj; if (!def) return -1; diff --git a/tests/nodedevxml2xmltest.c b/tests/nodedevxml2xmltest.c index a2321d1394..4ebd578ccc 100644 --- a/tests/nodedevxml2xmltest.c +++ b/tests/nodedevxml2xmltest.c @@ -19,8 +19,8 @@ testCompareXMLToXMLFiles(const char *xml) char *xmlData = NULL; char *actual = NULL; int ret = -1; - virNodeDeviceDefPtr dev = NULL; - virNodeDevCapsDefPtr caps; + virNodeDeviceDef *dev = NULL; + virNodeDevCapsDef *caps; if (virTestLoadFile(xml, &xmlData) < 0) goto fail; @@ -30,7 +30,7 @@ testCompareXMLToXMLFiles(const char *xml) /* Calculate some things that are not read in */ for (caps = dev->caps; caps; caps = caps->next) { - virNodeDevCapDataPtr data = &caps->data; + virNodeDevCapData *data = &caps->data; if (caps->data.type == VIR_NODE_DEV_CAP_STORAGE) { if (data->storage.flags & VIR_NODE_DEV_CAP_STORAGE_REMOVABLE) { diff --git a/tests/nwfilterxml2firewalltest.c b/tests/nwfilterxml2firewalltest.c index 8a7eaf854d..560372b802 100644 --- a/tests/nwfilterxml2firewalltest.c +++ b/tests/nwfilterxml2firewalltest.c @@ -42,11 +42,10 @@ # endif typedef struct _virNWFilterInst virNWFilterInst; -typedef virNWFilterInst *virNWFilterInstPtr; struct _virNWFilterInst { - virNWFilterDefPtr *filters; + virNWFilterDef **filters; size_t nfilters; - virNWFilterRuleInstPtr *rules; + virNWFilterRuleInst **rules; size_t nrules; }; @@ -168,7 +167,7 @@ virNWFilterCreateVarsFrom(GHashTable *vars1, static void -virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst) +virNWFilterRuleInstFree(virNWFilterRuleInst *inst) { if (!inst) return; @@ -179,7 +178,7 @@ virNWFilterRuleInstFree(virNWFilterRuleInstPtr inst) static void -virNWFilterInstReset(virNWFilterInstPtr inst) +virNWFilterInstReset(virNWFilterInst *inst) { size_t i; @@ -198,15 +197,15 @@ virNWFilterInstReset(virNWFilterInstPtr inst) static int virNWFilterDefToInst(const char *xml, GHashTable *vars, - virNWFilterInstPtr inst); + virNWFilterInst *inst); static int -virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def, - virNWFilterRuleDefPtr rule, +virNWFilterRuleDefToRuleInst(virNWFilterDef *def, + virNWFilterRuleDef *rule, GHashTable *vars, - virNWFilterInstPtr inst) + virNWFilterInst *inst) { - virNWFilterRuleInstPtr ruleinst; + virNWFilterRuleInst *ruleinst; int ret = -1; ruleinst = g_new0(virNWFilterRuleInst, 1); @@ -234,9 +233,9 @@ virNWFilterRuleDefToRuleInst(virNWFilterDefPtr def, static int -virNWFilterIncludeDefToRuleInst(virNWFilterIncludeDefPtr inc, +virNWFilterIncludeDefToRuleInst(virNWFilterIncludeDef *inc, GHashTable *vars, - virNWFilterInstPtr inst) + virNWFilterInst *inst) { GHashTable *tmpvars = NULL; int ret = -1; @@ -267,11 +266,11 @@ virNWFilterIncludeDefToRuleInst(virNWFilterIncludeDefPtr inc, static int virNWFilterDefToInst(const char *xml, GHashTable *vars, - virNWFilterInstPtr inst) + virNWFilterInst *inst) { size_t i; int ret = -1; - virNWFilterDefPtr def = virNWFilterDefParseFile(xml); + virNWFilterDef *def = virNWFilterDefParseFile(xml); if (!def) return -1; @@ -326,7 +325,7 @@ static int testSetOneParameter(GHashTable *vars, const char *name, const char *value) { - virNWFilterVarValuePtr val; + virNWFilterVarValue *val; if ((val = virHashLookup(vars, name)) == NULL) { val = virNWFilterVarValueCreateSimpleCopyValue(value); diff --git a/tests/nwfilterxml2xmltest.c b/tests/nwfilterxml2xmltest.c index 9def1e2634..82ce042e01 100644 --- a/tests/nwfilterxml2xmltest.c +++ b/tests/nwfilterxml2xmltest.c @@ -22,7 +22,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml, { char *actual = NULL; int ret = -1; - virNWFilterDefPtr dev = NULL; + virNWFilterDef *dev = NULL; virResetLastError(); diff --git a/tests/openvzutilstest.c b/tests/openvzutilstest.c index 2b1a9fb5ce..136c8011b8 100644 --- a/tests/openvzutilstest.c +++ b/tests/openvzutilstest.c @@ -71,7 +71,7 @@ static int testReadNetworkConf(const void *data G_GNUC_UNUSED) { int result = -1; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; char *actual = NULL; const char *expected = "\n" diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c index bf295496e1..e0d2575c45 100644 --- a/tests/qemuagenttest.c +++ b/tests/qemuagenttest.c @@ -38,8 +38,8 @@ virQEMUDriver driver; static int testQemuAgentSSHKeys(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); char **keys = NULL; int nkeys = 0; int ret = -1; @@ -116,8 +116,8 @@ testQemuAgentSSHKeys(const void *data) static int testQemuAgentFSFreeze(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); const char *mountpoints[] = {"/fs1", "/fs2", "/fs3", "/fs4", "/fs5"}; int ret = -1; @@ -168,8 +168,8 @@ testQemuAgentFSFreeze(const void *data) static int testQemuAgentFSThaw(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); int ret = -1; if (!test) @@ -218,8 +218,8 @@ testQemuAgentFSThaw(const void *data) static int testQemuAgentFSTrim(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); int ret = -1; if (!test) @@ -246,13 +246,13 @@ testQemuAgentFSTrim(const void *data) static int -testQemuAgentGetFSInfoCommon(virDomainXMLOptionPtr xmlopt, - qemuMonitorTestPtr *test, - virDomainDefPtr *def) +testQemuAgentGetFSInfoCommon(virDomainXMLOption *xmlopt, + qemuMonitorTest **test, + virDomainDef **def) { int ret = -1; g_autofree char *domain_filename = NULL; - qemuMonitorTestPtr ret_test = NULL; + qemuMonitorTest *ret_test = NULL; g_autoptr(virDomainDef) ret_def = NULL; if (!test || !def) @@ -319,10 +319,10 @@ testQemuAgentGetFSInfoCommon(virDomainXMLOptionPtr xmlopt, static int testQemuAgentGetFSInfo(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = NULL; - virDomainDefPtr def = NULL; - qemuAgentFSInfoPtr *info = NULL; + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = NULL; + virDomainDef *def = NULL; + qemuAgentFSInfo **info = NULL; int ret = -1, ninfo = 0, i; if (testQemuAgentGetFSInfoCommon(xmlopt, &test, &def) < 0) @@ -421,8 +421,8 @@ testQemuAgentGetFSInfo(const void *data) static int testQemuAgentSuspend(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); int ret = -1; size_t i; @@ -471,13 +471,13 @@ struct qemuAgentShutdownTestData { static int -qemuAgentShutdownTestMonitorHandler(qemuMonitorTestPtr test, - qemuMonitorTestItemPtr item, +qemuAgentShutdownTestMonitorHandler(qemuMonitorTest *test, + qemuMonitorTestItem *item, const char *cmdstr) { struct qemuAgentShutdownTestData *data; g_autoptr(virJSONValue) val = NULL; - virJSONValuePtr args; + virJSONValue *args; const char *cmdname; const char *mode; int ret = -1; @@ -531,8 +531,8 @@ qemuAgentShutdownTestMonitorHandler(qemuMonitorTestPtr test, static int testQemuAgentShutdown(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); struct qemuAgentShutdownTestData priv; int ret = -1; @@ -651,9 +651,9 @@ static const char testQemuAgentCPUArguments3[] = static int testQemuAgentCPU(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); - qemuAgentCPUInfoPtr cpuinfo = NULL; + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); + qemuAgentCPUInfo *cpuinfo = NULL; int nvcpus; int ret = -1; @@ -735,8 +735,8 @@ static const char testQemuAgentArbitraryCommandResponse[] = static int testQemuAgentArbitraryCommand(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); int ret = -1; g_autofree char *reply = NULL; @@ -773,8 +773,8 @@ testQemuAgentArbitraryCommand(const void *data) static int -qemuAgentTimeoutTestMonitorHandler(qemuMonitorTestPtr test G_GNUC_UNUSED, - qemuMonitorTestItemPtr item G_GNUC_UNUSED, +qemuAgentTimeoutTestMonitorHandler(qemuMonitorTest *test G_GNUC_UNUSED, + qemuMonitorTestItem *item G_GNUC_UNUSED, const char *cmdstr G_GNUC_UNUSED) { return 0; @@ -784,8 +784,8 @@ qemuAgentTimeoutTestMonitorHandler(qemuMonitorTestPtr test G_GNUC_UNUSED, static int testQemuAgentTimeout(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); g_autofree char *reply = NULL; int ret = -1; @@ -910,8 +910,8 @@ static const char testQemuAgentGetInterfacesResponse[] = static int testQemuAgentGetInterfaces(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); size_t i; int ret = -1; int ifaces_count = 0; @@ -1059,12 +1059,12 @@ static const char testQemuAgentGetDisksResponse[] = static int testQemuAgentGetDisks(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); size_t i; int ret = -1; int disks_count = 0; - qemuAgentDiskInfoPtr *disks = NULL; + qemuAgentDiskInfo **disks = NULL; if (!test) return -1; @@ -1209,8 +1209,8 @@ checkUserInfo(virTypedParameterPtr params, static int testQemuAgentUsers(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); virTypedParameterPtr params = NULL; int nparams = 0; int maxparams = 0; @@ -1309,8 +1309,8 @@ static const char testQemuAgentOSInfoResponse2[] = static int testQemuAgentOSInfo(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); virTypedParameterPtr params = NULL; int nparams = 0; int maxparams = 0; @@ -1413,8 +1413,8 @@ static const char testQemuAgentTimezoneResponse4[] = static int testQemuAgentTimezone(const void *data) { - virDomainXMLOptionPtr xmlopt = (virDomainXMLOptionPtr)data; - qemuMonitorTestPtr test = qemuMonitorTestNewAgent(xmlopt); + virDomainXMLOption *xmlopt = (virDomainXMLOption *)data; + qemuMonitorTest *test = qemuMonitorTestNewAgent(xmlopt); int ret = -1; if (!test) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 5cc7c27ebe..3f3e6d1532 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -45,7 +45,7 @@ struct testBackingXMLjsonXMLdata { const char *xml; bool legacy; GHashTable *schema; - virJSONValuePtr schemaroot; + virJSONValue *schemaroot; }; static int @@ -135,7 +135,7 @@ static const char *testJSONtoJSONPath = abs_srcdir "/qemublocktestdata/jsontojso struct testJSONtoJSONData { const char *name; GHashTable *schema; - virJSONValuePtr schemaroot; + virJSONValue *schemaroot; }; static int @@ -184,24 +184,24 @@ testJSONtoJSON(const void *args) struct testQemuDiskXMLToJSONImageData { - virJSONValuePtr formatprops; - virJSONValuePtr storageprops; - virJSONValuePtr storagepropssrc; + virJSONValue *formatprops; + virJSONValue *storageprops; + virJSONValue *storagepropssrc; char *backingstore; }; struct testQemuDiskXMLToJSONData { - virQEMUDriverPtr driver; + virQEMUDriver *driver; GHashTable *schema; - virJSONValuePtr schemaroot; + virJSONValue *schemaroot; const char *name; bool fail; struct testQemuDiskXMLToJSONImageData *images; size_t nimages; - virQEMUCapsPtr qemuCaps; + virQEMUCaps *qemuCaps; }; @@ -222,9 +222,9 @@ testQemuDiskXMLToPropsClear(struct testQemuDiskXMLToJSONData *data) static int -testQemuDiskXMLToJSONFakeSecrets(virStorageSourcePtr src) +testQemuDiskXMLToJSONFakeSecrets(virStorageSource *src) { - qemuDomainStorageSourcePrivatePtr srcpriv; + qemuDomainStorageSourcePrivate *srcpriv; if (!src->privateData && !(src->privateData = qemuDomainStorageSourcePrivateNew())) @@ -261,8 +261,8 @@ testQemuDiskXMLToProps(const void *opaque) { struct testQemuDiskXMLToJSONData *data = (void *) opaque; g_autoptr(virDomainDef) vmdef = NULL; - virDomainDiskDefPtr disk = NULL; - virStorageSourcePtr n; + virDomainDiskDef *disk = NULL; + virStorageSource *n; g_autoptr(virJSONValue) formatProps = NULL; g_autoptr(virJSONValue) storageProps = NULL; g_autoptr(virJSONValue) storageSrcOnlyProps = NULL; @@ -461,24 +461,24 @@ struct testQemuImageCreateData { const char *name; const char *backingname; GHashTable *schema; - virJSONValuePtr schemaroot; - virQEMUDriverPtr driver; - virQEMUCapsPtr qemuCaps; + virJSONValue *schemaroot; + virQEMUDriver *driver; + virQEMUCaps *qemuCaps; }; static const char *testQemuImageCreatePath = abs_srcdir "/qemublocktestdata/imagecreate/"; -static virStorageSourcePtr +static virStorageSource * testQemuImageCreateLoadDiskXML(const char *name, - virDomainXMLOptionPtr xmlopt) + virDomainXMLOption *xmlopt) { - virDomainSnapshotDiskDefPtr diskdef = NULL; + virDomainSnapshotDiskDef *diskdef = NULL; g_autoptr(xmlDoc) doc = NULL; g_autoptr(xmlXPathContext) ctxt = NULL; xmlNodePtr node; g_autofree char *xmlpath = NULL; - virStorageSourcePtr ret = NULL; + virStorageSource *ret = NULL; xmlpath = g_strdup_printf("%s%s.xml", testQemuImageCreatePath, name); @@ -589,9 +589,9 @@ static const char *bitmapDetectPrefix = "qemublocktestdata/bitmap/"; static void testQemuDetectBitmapsWorker(GHashTable *nodedata, const char *nodename, - virBufferPtr buf) + virBuffer *buf) { - qemuBlockNamedNodeDataPtr data; + qemuBlockNamedNodeData *data; size_t i; if (!(data = virHashLookup(nodedata, nodename))) @@ -603,7 +603,7 @@ testQemuDetectBitmapsWorker(GHashTable *nodedata, virBufferAdjustIndent(buf, 1); for (i = 0; i < data->nbitmaps; i++) { - qemuBlockNamedNodeDataBitmapPtr bitmap = data->bitmaps[i]; + qemuBlockNamedNodeDataBitmap *bitmap = data->bitmaps[i]; virBufferAsprintf(buf, "%8s: record:%d busy:%d persist:%d inconsist:%d gran:%llu dirty:%llu\n", bitmap->name, bitmap->recording, bitmap->busy, @@ -654,7 +654,7 @@ testQemuDetectBitmaps(const void *opaque) static void testQemuBitmapListPrint(const char *title, GSList *next, - virBufferPtr buf) + virBuffer *buf) { if (!next) return; @@ -662,16 +662,16 @@ testQemuBitmapListPrint(const char *title, virBufferAsprintf(buf, "%s\n", title); for (; next; next = next->next) { - virStorageSourcePtr src = next->data; + virStorageSource *src = next->data; virBufferAsprintf(buf, "%s\n", src->nodeformat); } } -static virStorageSourcePtr +static virStorageSource * testQemuBackupIncrementalBitmapCalculateGetFakeImage(size_t idx) { - virStorageSourcePtr ret = virStorageSourceNew(); + virStorageSource *ret = virStorageSourceNew(); ret->id = idx; ret->type = VIR_STORAGE_TYPE_FILE; @@ -684,11 +684,11 @@ testQemuBackupIncrementalBitmapCalculateGetFakeImage(size_t idx) } -static virStorageSourcePtr +static virStorageSource * testQemuBackupIncrementalBitmapCalculateGetFakeChain(void) { - virStorageSourcePtr ret; - virStorageSourcePtr n; + virStorageSource *ret; + virStorageSource *n; size_t i; n = ret = testQemuBackupIncrementalBitmapCalculateGetFakeImage(1); @@ -702,11 +702,11 @@ testQemuBackupIncrementalBitmapCalculateGetFakeChain(void) } -static virStorageSourcePtr -testQemuBitmapGetFakeChainEntry(virStorageSourcePtr src, +static virStorageSource * +testQemuBitmapGetFakeChainEntry(virStorageSource *src, size_t idx) { - virStorageSourcePtr n; + virStorageSource *n; for (n = src; n; n = n->backingStore) { if (n->id == idx) @@ -721,7 +721,7 @@ static const char *backupDataPrefix = "qemublocktestdata/backupmerge/"; struct testQemuBackupIncrementalBitmapCalculateData { const char *name; - virStorageSourcePtr chain; + virStorageSource *chain; const char *incremental; const char *nodedatafile; }; @@ -773,7 +773,7 @@ static const char *checkpointDeletePrefix = "qemublocktestdata/checkpointdelete/ struct testQemuCheckpointDeleteData { const char *name; - virStorageSourcePtr chain; + virStorageSource *chain; const char *deletebitmap; const char *nodedatafile; }; @@ -828,7 +828,7 @@ testQemuCheckpointDelete(const void *opaque) struct testQemuBlockBitmapValidateData { const char *name; const char *bitmapname; - virStorageSourcePtr chain; + virStorageSource *chain; bool expect; }; @@ -865,7 +865,7 @@ static const char *blockcopyPrefix = "qemublocktestdata/bitmapblockcopy/"; struct testQemuBlockBitmapBlockcopyData { const char *name; bool shallow; - virStorageSourcePtr chain; + virStorageSource *chain; const char *nodedatafile; }; @@ -914,9 +914,9 @@ static const char *blockcommitPrefix = "qemublocktestdata/bitmapblockcommit/"; struct testQemuBlockBitmapBlockcommitData { const char *name; - virStorageSourcePtr top; - virStorageSourcePtr base; - virStorageSourcePtr chain; + virStorageSource *top; + virStorageSource *base; + virStorageSource *chain; const char *nodedatafile; }; @@ -979,7 +979,7 @@ mymain(void) char *capslatest_x86_64 = NULL; g_autoptr(virQEMUCaps) caps_x86_64 = NULL; g_autoptr(GHashTable) qmp_schema_x86_64 = NULL; - virJSONValuePtr qmp_schemaroot_x86_64_blockdev_add = NULL; + virJSONValue *qmp_schemaroot_x86_64_blockdev_add = NULL; g_autoptr(virStorageSource) bitmapSourceChain = NULL; if (qemuTestDriverInit(&driver) < 0) diff --git a/tests/qemucapabilitiestest.c b/tests/qemucapabilitiestest.c index 77fe716c20..b495bfc07d 100644 --- a/tests/qemucapabilitiestest.c +++ b/tests/qemucapabilitiestest.c @@ -32,7 +32,6 @@ #define VIR_FROM_THIS VIR_FROM_NONE typedef struct _testQemuData testQemuData; -typedef testQemuData *testQemuDataPtr; struct _testQemuData { virQEMUDriver driver; const char *inputDir; @@ -46,7 +45,7 @@ struct _testQemuData { static int -testQemuDataInit(testQemuDataPtr data) +testQemuDataInit(testQemuData *data) { if (qemuTestDriverInit(&data->driver) < 0) return -1; @@ -60,7 +59,7 @@ testQemuDataInit(testQemuDataPtr data) static void -testQemuDataReset(testQemuDataPtr data) +testQemuDataReset(testQemuData *data) { qemuTestDriverFree(&data->driver); } @@ -73,7 +72,7 @@ testQemuCaps(const void *opaque) testQemuData *data = (void *) opaque; g_autofree char *repliesFile = NULL; g_autofree char *capsFile = NULL; - qemuMonitorTestPtr mon = NULL; + qemuMonitorTest *mon = NULL; g_autoptr(virQEMUCaps) capsActual = NULL; g_autofree char *binary = NULL; g_autofree char *actual = NULL; @@ -176,7 +175,7 @@ doCapsTest(const char *inputDir, const char *suffix, void *opaque) { - testQemuDataPtr data = (testQemuDataPtr) opaque; + testQemuData *data = (testQemuData *) opaque; g_autofree char *title = NULL; g_autofree char *copyTitle = NULL; diff --git a/tests/qemucaps2xmltest.c b/tests/qemucaps2xmltest.c index af4c96cb69..68bbf07ec2 100644 --- a/tests/qemucaps2xmltest.c +++ b/tests/qemucaps2xmltest.c @@ -27,7 +27,6 @@ typedef struct _testQemuData testQemuData; -typedef testQemuData *testQemuDataPtr; struct _testQemuData { const char *inputDir; const char *outputDir; @@ -39,7 +38,7 @@ struct _testQemuData { }; static int -testQemuDataInit(testQemuDataPtr data) +testQemuDataInit(testQemuData *data) { data->outputDir = abs_srcdir "/qemucaps2xmloutdata"; @@ -48,10 +47,10 @@ testQemuDataInit(testQemuDataPtr data) return 0; } -static virQEMUCapsPtr +static virQEMUCaps * testQemuGetCaps(char *caps) { - virQEMUCapsPtr qemuCaps = NULL; + virQEMUCaps *qemuCaps = NULL; xmlDocPtr xml; xmlXPathContextPtr ctxt = NULL; ssize_t i, n; @@ -91,11 +90,11 @@ testQemuGetCaps(char *caps) return NULL; } -static virCapsPtr +static virCaps * testGetCaps(char *capsData, const testQemuData *data) { g_autoptr(virQEMUCaps) qemuCaps = NULL; - virCapsPtr caps = NULL; + virCaps *caps = NULL; virArch arch = virArchFromString(data->archName); g_autofree char *binary = NULL; @@ -166,7 +165,7 @@ doCapsTest(const char *inputDir, const char *suffix, void *opaque) { - testQemuDataPtr data = (testQemuDataPtr) opaque; + testQemuData *data = (testQemuData *) opaque; g_autofree char *title = NULL; title = g_strdup_printf("%s (%s)", version, archName); diff --git a/tests/qemucapsprobe.c b/tests/qemucapsprobe.c index a89d9c8feb..bfa8ae8db7 100644 --- a/tests/qemucapsprobe.c +++ b/tests/qemucapsprobe.c @@ -45,7 +45,7 @@ int main(int argc, char **argv) { virThread thread; - virQEMUCapsPtr caps; + virQEMUCaps *caps; virArch host; virArch guest; const char *mock = VIR_TEST_MOCK("qemucapsprobe"); diff --git a/tests/qemucapsprobemock.c b/tests/qemucapsprobemock.c index f3f17f2116..3c05a80ca2 100644 --- a/tests/qemucapsprobemock.c +++ b/tests/qemucapsprobemock.c @@ -51,12 +51,12 @@ printLineSkipEmpty(const char *line, } -static int (*realQemuMonitorSend)(qemuMonitorPtr mon, - qemuMonitorMessagePtr msg); +static int (*realQemuMonitorSend)(qemuMonitor *mon, + qemuMonitorMessage *msg); int -qemuMonitorSend(qemuMonitorPtr mon, - qemuMonitorMessagePtr msg) +qemuMonitorSend(qemuMonitor *mon, + qemuMonitorMessage *msg) { char *reformatted; @@ -79,16 +79,16 @@ qemuMonitorSend(qemuMonitorPtr mon, } -static int (*realQemuMonitorJSONIOProcessLine)(qemuMonitorPtr mon, +static int (*realQemuMonitorJSONIOProcessLine)(qemuMonitor *mon, const char *line, - qemuMonitorMessagePtr msg); + qemuMonitorMessage *msg); int -qemuMonitorJSONIOProcessLine(qemuMonitorPtr mon, +qemuMonitorJSONIOProcessLine(qemuMonitor *mon, const char *line, - qemuMonitorMessagePtr msg) + qemuMonitorMessage *msg) { - virJSONValuePtr value = NULL; + virJSONValue *value = NULL; char *json = NULL; int ret; diff --git a/tests/qemucommandutiltest.c b/tests/qemucommandutiltest.c index 03947d87bc..33f92d2935 100644 --- a/tests/qemucommandutiltest.c +++ b/tests/qemucommandutiltest.c @@ -37,7 +37,7 @@ static int testQemuCommandBuildFromJSON(const void *opaque) { const testQemuCommandBuildObjectFromJSONData *data = opaque; - virJSONValuePtr val = NULL; + virJSONValue *val = NULL; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; char *result = NULL; int ret = -1; diff --git a/tests/qemucpumock.c b/tests/qemucpumock.c index 74f25d8194..e84a0294d4 100644 --- a/tests/qemucpumock.c +++ b/tests/qemucpumock.c @@ -26,9 +26,9 @@ #include "virarch.h" -virCPUDefPtr +virCPUDef * virQEMUCapsProbeHostCPU(virArch hostArch G_GNUC_UNUSED, - virDomainCapsCPUModelsPtr models G_GNUC_UNUSED) + virDomainCapsCPUModels *models G_GNUC_UNUSED) { const char *model = getenv("VIR_TEST_MOCK_FAKE_HOST_CPU"); diff --git a/tests/qemudomaincheckpointxml2xmltest.c b/tests/qemudomaincheckpointxml2xmltest.c index efa6aff2cb..25613c8452 100644 --- a/tests/qemudomaincheckpointxml2xmltest.c +++ b/tests/qemudomaincheckpointxml2xmltest.c @@ -66,7 +66,7 @@ testCompareXMLToXMLFiles(const char *inxml, def->parent.parent_name = g_strdup("1525111885"); } if (flags & TEST_VDA_BITMAP) { - virDomainCheckpointDiskDefPtr disk; + virDomainCheckpointDiskDef *disk; VIR_EXPAND_N(def->disks, def->ndisks, 1); disk = &def->disks[0]; @@ -108,7 +108,7 @@ struct testInfo { static long long mocktime; static int -testCheckpointPostParse(virDomainMomentDefPtr def) +testCheckpointPostParse(virDomainMomentDef *def) { if (!mocktime) return 0; diff --git a/tests/qemudomainsnapshotxml2xmltest.c b/tests/qemudomainsnapshotxml2xmltest.c index 2a1fe1f52d..735d0e21a1 100644 --- a/tests/qemudomainsnapshotxml2xmltest.c +++ b/tests/qemudomainsnapshotxml2xmltest.c @@ -91,7 +91,7 @@ struct testInfo { static long long mocktime; static int -testSnapshotPostParse(virDomainMomentDefPtr def) +testSnapshotPostParse(virDomainMomentDef *def) { if (!mocktime) return 0; diff --git a/tests/qemufirmwaretest.c b/tests/qemufirmwaretest.c index e9b7221a2b..cad4b6d383 100644 --- a/tests/qemufirmwaretest.c +++ b/tests/qemufirmwaretest.c @@ -115,9 +115,9 @@ testSupportedFW(const void *opaque) uint64_t actualInterfaces; uint64_t expectedInterfaces = 0; bool actualSecure; - virFirmwarePtr *expFWs = NULL; + virFirmware **expFWs = NULL; size_t nexpFWs = 0; - virFirmwarePtr *actFWs = NULL; + virFirmware **actFWs = NULL; size_t nactFWs = 0; size_t i; int ret = -1; @@ -134,7 +134,7 @@ testSupportedFW(const void *opaque) * Well, some images don't have a NVRAM store. In that case NULL was passed: * ${FW}:NULL. Now iterate over expected firmwares and fix this. */ for (i = 0; i < nexpFWs; i++) { - virFirmwarePtr tmp = expFWs[i]; + virFirmware *tmp = expFWs[i]; if (STREQ(tmp->nvram, "NULL")) VIR_FREE(tmp->nvram); @@ -163,8 +163,8 @@ testSupportedFW(const void *opaque) } for (i = 0; i < nactFWs; i++) { - virFirmwarePtr actFW = actFWs[i]; - virFirmwarePtr expFW = NULL; + virFirmware *actFW = actFWs[i]; + virFirmware *expFW = NULL; if (i >= nexpFWs) { fprintf(stderr, "Unexpected FW image: %s NVRAM: %s\n", diff --git a/tests/qemuhotplugmock.c b/tests/qemuhotplugmock.c index d2e32ecf7e..d1fc50c5f0 100644 --- a/tests/qemuhotplugmock.c +++ b/tests/qemuhotplugmock.c @@ -41,7 +41,7 @@ init_syms(void) } unsigned long long -qemuDomainGetUnplugTimeout(virDomainObjPtr vm) +qemuDomainGetUnplugTimeout(virDomainObj *vm) { /* Wait only 100ms for DEVICE_DELETED event. Give a greater * timeout in case of PSeries guest to be consistent with the @@ -98,19 +98,19 @@ virFileExists(const char *path) int -qemuProcessStartManagedPRDaemon(virDomainObjPtr vm G_GNUC_UNUSED) +qemuProcessStartManagedPRDaemon(virDomainObj *vm G_GNUC_UNUSED) { return 0; } void -qemuProcessKillManagedPRDaemon(virDomainObjPtr vm G_GNUC_UNUSED) +qemuProcessKillManagedPRDaemon(virDomainObj *vm G_GNUC_UNUSED) { } int -qemuInterfaceVDPAConnect(virDomainNetDefPtr net G_GNUC_UNUSED) +qemuInterfaceVDPAConnect(virDomainNetDef *net G_GNUC_UNUSED) { /* need a valid fd or sendmsg won't work. Just open /dev/null */ return open("/dev/null", O_RDONLY); diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c index df5c9c9059..cb29d62aff 100644 --- a/tests/qemuhotplugtest.c +++ b/tests/qemuhotplugtest.c @@ -51,16 +51,16 @@ struct qemuHotplugTestData { const char *const *mon; int action; bool keep; - virDomainObjPtr vm; + virDomainObj *vm; bool deviceDeletedEvent; }; static int -qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt, - virDomainObjPtr *vm, +qemuHotplugCreateObjects(virDomainXMLOption *xmlopt, + virDomainObj **vm, const char *domxml) { - qemuDomainObjPrivatePtr priv = NULL; + qemuDomainObjPrivate *priv = NULL; const unsigned int parseFlags = 0; if (!(*vm = virDomainObjNew(xmlopt))) @@ -118,8 +118,8 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt, } static int -testQemuHotplugAttach(virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +testQemuHotplugAttach(virDomainObj *vm, + virDomainDeviceDef *dev) { int ret = -1; @@ -155,8 +155,8 @@ testQemuHotplugAttach(virDomainObjPtr vm, } static int -testQemuHotplugDetach(virDomainObjPtr vm, - virDomainDeviceDefPtr dev, +testQemuHotplugDetach(virDomainObj *vm, + virDomainDeviceDef *dev, bool async) { int ret = -1; @@ -180,8 +180,8 @@ testQemuHotplugDetach(virDomainObjPtr vm, } static int -testQemuHotplugUpdate(virDomainObjPtr vm, - virDomainDeviceDefPtr dev) +testQemuHotplugUpdate(virDomainObj *vm, + virDomainDeviceDef *dev) { int ret = -1; @@ -204,7 +204,7 @@ testQemuHotplugUpdate(virDomainObjPtr vm, } static int -testQemuHotplugCheckResult(virDomainObjPtr vm, +testQemuHotplugCheckResult(virDomainObj *vm, const char *expected, const char *expectedFile, bool fail) @@ -248,11 +248,11 @@ testQemuHotplug(const void *data) bool fail = test->fail; bool keep = test->keep; unsigned int device_parse_flags = 0; - virDomainObjPtr vm = NULL; - virDomainDeviceDefPtr dev = NULL; + virDomainObj *vm = NULL; + virDomainDeviceDef *dev = NULL; g_autoptr(virCaps) caps = NULL; - qemuMonitorTestPtr test_mon = NULL; - qemuDomainObjPrivatePtr priv = NULL; + qemuMonitorTest *test_mon = NULL; + qemuDomainObjPrivate *priv = NULL; domain_filename = g_strdup_printf("%s/qemuhotplugtestdomains/qemuhotplug-%s.xml", abs_srcdir, test->domain_filename); @@ -368,8 +368,8 @@ struct testQemuHotplugCpuData { char *xml_dom; - virDomainObjPtr vm; - qemuMonitorTestPtr mon; + virDomainObj *vm; + qemuMonitorTest *mon; bool modern; }; @@ -377,8 +377,8 @@ struct testQemuHotplugCpuData { static void testQemuHotplugCpuDataFree(struct testQemuHotplugCpuData *data) { - qemuDomainObjPrivatePtr priv; - qemuMonitorPtr mon; + qemuDomainObjPrivate *priv; + qemuMonitor *mon; if (!data) return; @@ -412,8 +412,8 @@ testQemuHotplugCpuPrepare(const char *test, bool fail, GHashTable *qmpschema) { - qemuDomainObjPrivatePtr priv = NULL; - virCapsPtr caps = NULL; + qemuDomainObjPrivate *priv = NULL; + virCaps *caps = NULL; g_autofree char *prefix = NULL; struct testQemuHotplugCpuData *data = NULL; diff --git a/tests/qemumigparamstest.c b/tests/qemumigparamstest.c index bfa60358c0..dd6b7d5d60 100644 --- a/tests/qemumigparamstest.c +++ b/tests/qemumigparamstest.c @@ -36,15 +36,15 @@ typedef struct _qemuMigParamsData qemuMigParamsData; struct _qemuMigParamsData { - virDomainXMLOptionPtr xmlopt; + virDomainXMLOption *xmlopt; const char *name; GHashTable *qmpschema; }; static void -qemuMigParamsTestFormatXML(virBufferPtr buf, - qemuMigrationParamsPtr migParams) +qemuMigParamsTestFormatXML(virBuffer *buf, + qemuMigrationParams *migParams) { virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); @@ -96,7 +96,7 @@ qemuMigParamsTestXML(const void *opaque) g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; g_autofree char *replyFile = NULL; g_autofree char *xmlFile = NULL; - qemuMonitorTestPtr mon = NULL; + qemuMonitorTest *mon = NULL; g_autoptr(virJSONValue) params = NULL; g_autoptr(qemuMigrationParams) migParams = NULL; g_autofree char *actualXML = NULL; @@ -139,7 +139,7 @@ qemuMigParamsTestJSON(const void *opaque) const qemuMigParamsData *data = opaque; g_autofree char *replyFile = NULL; g_autofree char *jsonFile = NULL; - qemuMonitorTestPtr mon = NULL; + qemuMonitorTest *mon = NULL; g_autoptr(virJSONValue) paramsIn = NULL; g_autoptr(virJSONValue) paramsOut = NULL; g_autoptr(qemuMigrationParams) migParams = NULL; diff --git a/tests/qemumigrationcookiexmltest.c b/tests/qemumigrationcookiexmltest.c index 7f2437a7fe..ba7088c567 100644 --- a/tests/qemumigrationcookiexmltest.c +++ b/tests/qemumigrationcookiexmltest.c @@ -58,14 +58,14 @@ tn(const char *str, ...) struct testQemuMigrationCookieData { const char *name; char *inStatus; - virDomainObjPtr vm; + virDomainObj *vm; unsigned int cookiePopulateFlags; unsigned int cookieParseFlags; qemuMigrationParty cookiePopulateParty; - qemuMigrationCookiePtr cookie; + qemuMigrationCookie *cookie; char *xmlstr; int xmlstrlen; @@ -137,7 +137,7 @@ static int testQemuMigrationCookieParse(const void *opaque) { struct testQemuMigrationCookieData *data = (struct testQemuMigrationCookieData *) opaque; - qemuDomainObjPrivatePtr priv = data->vm->privateData; + qemuDomainObjPrivate *priv = data->vm->privateData; g_auto(virBuffer) actual = VIR_BUFFER_INITIALIZER; if (!(data->cookie = qemuMigrationCookieParse(&driver, @@ -318,8 +318,8 @@ testQemuMigrationCookieBlockDirtyBitmaps(const void *opaque) return -1; for (next = data->cookie->blockDirtyBitmaps; next; next = next->next) { - qemuMigrationBlockDirtyBitmapsDiskPtr disk = next->data; - qemuMigrationBlockDirtyBitmapsDiskBitmapPtr bitmap = disk->bitmaps->data; + qemuMigrationBlockDirtyBitmapsDisk *disk = next->data; + qemuMigrationBlockDirtyBitmapsDiskBitmap *bitmap = disk->bitmaps->data; bitmap->persistent = VIR_TRISTATE_BOOL_YES; } diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 48b41c908a..0866ebe2bf 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -39,11 +39,10 @@ #define VIR_FROM_THIS VIR_FROM_NONE typedef struct _testQemuMonitorJSONSimpleFuncData testQemuMonitorJSONSimpleFuncData; -typedef testQemuMonitorJSONSimpleFuncData *testQemuMonitorJSONSimpleFuncDataPtr; struct _testQemuMonitorJSONSimpleFuncData { const char *cmd; - int (* func) (qemuMonitorPtr mon); - virDomainXMLOptionPtr xmlopt; + int (* func) (qemuMonitor *mon); + virDomainXMLOption *xmlopt; const char *reply; GHashTable *schema; bool allowDeprecated; @@ -52,7 +51,7 @@ struct _testQemuMonitorJSONSimpleFuncData { typedef struct _testGenericData testGenericData; struct _testGenericData { - virDomainXMLOptionPtr xmlopt; + virDomainXMLOption *xmlopt; GHashTable *schema; }; @@ -153,7 +152,7 @@ static int testQemuMonitorJSONGetStatus(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; bool running = false; virDomainPausedReason reason = 0; g_autoptr(qemuMonitorTest) test = NULL; @@ -243,7 +242,7 @@ static int testQemuMonitorJSONGetVersion(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; int ret = -1; int major; int minor; @@ -346,9 +345,9 @@ static int testQemuMonitorJSONGetMachines(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; int ret = -1; - qemuMonitorMachineInfoPtr *info; + qemuMonitorMachineInfo **info; int ninfo = 0; const char *null = NULL; size_t i; @@ -429,7 +428,7 @@ static int testQemuMonitorJSONGetCPUDefinitions(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; g_autoptr(qemuMonitorCPUDefs) defs = NULL; g_autoptr(qemuMonitorTest) test = NULL; @@ -502,7 +501,7 @@ static int testQemuMonitorJSONGetCommands(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; int ret = -1; char **commands = NULL; int ncommands = 0; @@ -567,7 +566,7 @@ static int testQemuMonitorJSONGetTPMModels(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; int ret = -1; char **tpmmodels = NULL; int ntpmmodels = 0; @@ -617,8 +616,8 @@ testQemuMonitorJSONGetTPMModels(const void *opaque) struct qemuMonitorJSONTestAttachChardevData { - qemuMonitorTestPtr test; - virDomainChrSourceDefPtr chr; + qemuMonitorTest *test; + virDomainChrSourceDef *chr; const char *expectPty; bool fail; }; @@ -654,10 +653,10 @@ testQemuMonitorJSONAttachChardev(const void *opaque) static int -qemuMonitorJSONTestAttachOneChardev(virDomainXMLOptionPtr xmlopt, +qemuMonitorJSONTestAttachOneChardev(virDomainXMLOption *xmlopt, GHashTable *schema, const char *label, - virDomainChrSourceDefPtr chr, + virDomainChrSourceDef *chr, const char *expectargs, const char *reply, const char *expectPty, @@ -701,7 +700,7 @@ qemuMonitorJSONTestAttachOneChardev(virDomainXMLOptionPtr xmlopt, } static int -qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr xmlopt, +qemuMonitorJSONTestAttachChardev(virDomainXMLOption *xmlopt, GHashTable *schema) { virDomainChrSourceDef chr; @@ -822,7 +821,7 @@ static int testQemuMonitorJSONDetachChardev(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; g_autoptr(qemuMonitorTest) test = NULL; if (!(test = qemuMonitorTestNewSchema(xmlopt, data->schema))) @@ -851,9 +850,9 @@ static int testQemuMonitorJSONGetListPaths(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; int ret = -1; - qemuMonitorJSONListPathPtr *paths; + qemuMonitorJSONListPath **paths; int npaths = 0; size_t i; g_autoptr(qemuMonitorTest) test = NULL; @@ -929,7 +928,7 @@ static int testQemuMonitorJSONGetObjectProperty(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; qemuMonitorJSONObjectProperty prop; g_autoptr(qemuMonitorTest) test = NULL; @@ -969,7 +968,7 @@ static int testQemuMonitorJSONSetObjectProperty(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; qemuMonitorJSONObjectProperty prop; g_autoptr(qemuMonitorTest) test = NULL; @@ -1018,7 +1017,7 @@ static int testQemuMonitorJSONGetDeviceAliases(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; int ret = -1; char **aliases = NULL; const char **alias; @@ -1078,7 +1077,7 @@ static int testQemuMonitorJSONCPU(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; bool running = false; virDomainPausedReason reason = 0; g_autoptr(qemuMonitorTest) test = NULL; @@ -1132,9 +1131,9 @@ testQemuMonitorJSONCPU(const void *opaque) static int testQemuMonitorJSONSimpleFunc(const void *opaque) { - testQemuMonitorJSONSimpleFuncDataPtr data = - (testQemuMonitorJSONSimpleFuncDataPtr) opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + testQemuMonitorJSONSimpleFuncData *data = + (testQemuMonitorJSONSimpleFuncData *) opaque; + virDomainXMLOption *xmlopt = data->xmlopt; const char *reply = data->reply; g_autoptr(qemuMonitorTest) test = NULL; @@ -1158,7 +1157,7 @@ static int \ testQemuMonitorJSON ## funcName(const void *opaque) \ { \ const testQemuMonitorJSONSimpleFuncData *data = opaque; \ - virDomainXMLOptionPtr xmlopt = data->xmlopt; \ + virDomainXMLOption *xmlopt = data->xmlopt; \ const char *reply = data->reply; \ g_autoptr(qemuMonitorTest) test = NULL; \ \ @@ -1224,7 +1223,7 @@ static int testQemuMonitorJSONqemuMonitorJSONNBDServerStart(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; virStorageNetHostDef server_tcp = { .name = (char *)"localhost", .port = 12345, @@ -1271,7 +1270,7 @@ testQemuMonitorJSONqemuMonitorJSONQueryCPUsEqual(struct qemuMonitorQueryCpusEntr static int -testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qemuMonitorTestPtr test, +testQEMUMonitorJSONqemuMonitorJSONQueryCPUsHelper(qemuMonitorTest *test, struct qemuMonitorQueryCpusEntry *expect, bool fast, size_t num) @@ -1312,7 +1311,7 @@ static int testQemuMonitorJSONqemuMonitorJSONQueryCPUs(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; struct qemuMonitorQueryCpusEntry expect_slow[] = { {0, 17622, (char *) "/machine/unattached/device[0]", true}, {1, 17624, (char *) "/machine/unattached/device[1]", true}, @@ -1378,7 +1377,7 @@ static int testQemuMonitorJSONqemuMonitorJSONQueryCPUsFast(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; struct qemuMonitorQueryCpusEntry expect_fast[] = { {0, 17629, (char *) "/machine/unattached/device[0]", false}, {1, 17630, (char *) "/machine/unattached/device[1]", false}, @@ -1418,7 +1417,7 @@ static int testQemuMonitorJSONqemuMonitorJSONGetBalloonInfo(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; unsigned long long currmem; g_autoptr(qemuMonitorTest) test = NULL; @@ -1474,7 +1473,7 @@ static int testQemuMonitorJSONqemuMonitorJSONGetBlockInfo(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; int ret = -1; GHashTable *blockDevices = NULL; GHashTable *expectedBlockDevices = NULL; @@ -1550,9 +1549,9 @@ static int testQemuMonitorJSONqemuMonitorJSONGetAllBlockStatsInfo(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; GHashTable *blockstats = NULL; - qemuBlockStatsPtr stats; + qemuBlockStats *stats; int ret = -1; g_autoptr(qemuMonitorTest) test = NULL; @@ -1712,7 +1711,7 @@ static int testQemuMonitorJSONqemuMonitorJSONGetMigrationCacheSize(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; unsigned long long cacheSize; g_autoptr(qemuMonitorTest) test = NULL; @@ -1746,7 +1745,7 @@ static int testQemuMonitorJSONqemuMonitorJSONGetMigrationStats(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; int ret = -1; qemuMonitorMigrationStats stats, expectedStats; char *error = NULL; @@ -1841,7 +1840,7 @@ static int testQemuMonitorJSONqemuMonitorJSONGetChardevInfo(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; int ret = -1; GHashTable *info = NULL; GHashTable *expectedInfo = NULL; @@ -1963,7 +1962,7 @@ static int testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; int ret = -1; virDomainBlockIoTuneInfo info, expectedInfo; g_autoptr(qemuMonitorTest) test = NULL; @@ -2017,7 +2016,7 @@ static int testQemuMonitorJSONqemuMonitorJSONGetTargetArch(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; g_autofree char *arch = NULL; g_autoptr(qemuMonitorTest) test = NULL; @@ -2050,7 +2049,7 @@ static int testQemuMonitorJSONqemuMonitorJSONGetMigrationCapabilities(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; const char *cap; g_auto(GStrv) caps = NULL; g_autoptr(virBitmap) bitmap = NULL; @@ -2099,7 +2098,7 @@ static int testQemuMonitorJSONqemuMonitorJSONSendKey(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; unsigned int keycodes[] = {43, 26, 46, 32}; g_autoptr(qemuMonitorTest) test = NULL; @@ -2121,7 +2120,7 @@ static int testQemuMonitorJSONqemuMonitorJSONSendKeyHoldtime(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; unsigned int keycodes[] = {43, 26, 46, 32}; g_autoptr(qemuMonitorTest) test = NULL; @@ -2150,7 +2149,7 @@ static int testQemuMonitorJSONqemuMonitorSupportsActiveCommit(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; const char *error1 = "{" " \"error\": {" @@ -2193,7 +2192,7 @@ static int testQemuMonitorJSONqemuMonitorJSONGetDumpGuestMemoryCapability(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; + virDomainXMLOption *xmlopt = data->xmlopt; int cap; const char *reply = "{" @@ -2231,7 +2230,7 @@ testQemuMonitorJSONqemuMonitorJSONGetDumpGuestMemoryCapability(const void *opaqu struct testCPUData { const char *name; - virDomainXMLOptionPtr xmlopt; + virDomainXMLOption *xmlopt; GHashTable *schema; }; @@ -2240,7 +2239,7 @@ static int testQemuMonitorJSONGetCPUData(const void *opaque) { const struct testCPUData *data = opaque; - virCPUDataPtr cpuData = NULL; + virCPUData *cpuData = NULL; char *jsonFile = NULL; char *dataFile = NULL; char *jsonStr = NULL; @@ -2302,8 +2301,8 @@ static int testQemuMonitorJSONGetNonExistingCPUData(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; - virCPUDataPtr cpuData = NULL; + virDomainXMLOption *xmlopt = data->xmlopt; + virCPUData *cpuData = NULL; int rv, ret = -1; g_autoptr(qemuMonitorTest) test = NULL; @@ -2345,8 +2344,8 @@ static int testQemuMonitorJSONGetIOThreads(const void *opaque) { const testGenericData *data = opaque; - virDomainXMLOptionPtr xmlopt = data->xmlopt; - qemuMonitorIOThreadInfoPtr *info; + virDomainXMLOption *xmlopt = data->xmlopt; + qemuMonitorIOThreadInfo **info; int ninfo = 0; int ret = -1; size_t i; @@ -2414,18 +2413,18 @@ testQemuMonitorJSONGetIOThreads(const void *opaque) struct testCPUInfoData { const char *name; size_t maxvcpus; - virDomainXMLOptionPtr xmlopt; + virDomainXMLOption *xmlopt; bool fast; GHashTable *schema; }; static char * -testQemuMonitorCPUInfoFormat(qemuMonitorCPUInfoPtr vcpus, +testQemuMonitorCPUInfoFormat(qemuMonitorCPUInfo *vcpus, size_t nvcpus) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - qemuMonitorCPUInfoPtr vcpu; + qemuMonitorCPUInfo *vcpu; size_t i; for (i = 0; i < nvcpus; i++) { @@ -2487,7 +2486,7 @@ static int testQemuMonitorCPUInfo(const void *opaque) { const struct testCPUInfoData *data = opaque; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; char *queryCpusFile = NULL; char *queryHotpluggableFile = NULL; char *dataFile = NULL; @@ -2495,7 +2494,7 @@ testQemuMonitorCPUInfo(const void *opaque) char *queryHotpluggableStr = NULL; char *actual = NULL; const char *queryCpusFunction; - qemuMonitorCPUInfoPtr vcpus = NULL; + qemuMonitorCPUInfo *vcpus = NULL; int rc; int ret = -1; g_autoptr(qemuMonitorTest) test = NULL; @@ -2563,9 +2562,9 @@ testBlockNodeNameDetectFormat(void *payload, const char *name, void *opaque) { - qemuBlockNodeNameBackingChainDataPtr entry = payload; + qemuBlockNodeNameBackingChainData *entry = payload; const char *diskalias = name; - virBufferPtr buf = opaque; + virBuffer *buf = opaque; virBufferSetIndent(buf, 0); @@ -2599,8 +2598,8 @@ testBlockNodeNameDetect(const void *opaque) const char *pathprefix = "qemumonitorjsondata/qemumonitorjson-nodename-"; char *resultFile = NULL; char *actual = NULL; - virJSONValuePtr namedNodesJson = NULL; - virJSONValuePtr blockstatsJson = NULL; + virJSONValue *namedNodesJson = NULL; + virJSONValue *blockstatsJson = NULL; GHashTable *nodedata = NULL; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; int ret = -1; @@ -2657,7 +2656,7 @@ static int testQAPISchemaQuery(const void *opaque) { const struct testQAPISchemaData *data = opaque; - virJSONValuePtr replyobj = NULL; + virJSONValue *replyobj = NULL; int rc; rc = virQEMUQAPISchemaPathGet(data->query, data->schema, &replyobj); @@ -2677,8 +2676,8 @@ testQAPISchemaValidate(const void *opaque) { const struct testQAPISchemaData *data = opaque; g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER; - virJSONValuePtr schemaroot; - virJSONValuePtr json = NULL; + virJSONValue *schemaroot; + virJSONValue *json = NULL; int ret = -1; if (virQEMUQAPISchemaPathGet(data->query, data->schema, &schemaroot) < 0) @@ -2724,7 +2723,7 @@ static int testQAPISchemaObjectDeviceAdd(const void *opaque) { GHashTable *schema = (GHashTable *) opaque; - virJSONValuePtr entry; + virJSONValue *entry; if (virQEMUQAPISchemaPathGet("device_add/arg-type", schema, &entry) < 0) { fprintf(stderr, "schema for 'device_add' not found\n"); @@ -2745,8 +2744,8 @@ testQAPISchemaObjectDeviceAdd(const void *opaque) static void -testQueryJobsPrintJob(virBufferPtr buf, - qemuMonitorJobInfoPtr job) +testQueryJobsPrintJob(virBuffer *buf, + qemuMonitorJobInfo *job) { virBufferAddLit(buf, "[job]\n"); virBufferAsprintf(buf, "id=%s\n", NULLSTR(job->id)); @@ -2759,7 +2758,7 @@ testQueryJobsPrintJob(virBufferPtr buf, struct testQueryJobsData { const char *name; - virDomainXMLOptionPtr xmlopt; + virDomainXMLOption *xmlopt; }; @@ -2767,12 +2766,12 @@ static int testQueryJobs(const void *opaque) { const struct testQueryJobsData *data = opaque; - qemuMonitorTestPtr test = qemuMonitorTestNewSimple(data->xmlopt); + qemuMonitorTest *test = qemuMonitorTestNewSimple(data->xmlopt); g_autofree char *filenameJSON = NULL; g_autofree char *fileJSON = NULL; g_autofree char *filenameResult = NULL; g_autofree char *actual = NULL; - qemuMonitorJobInfoPtr *jobs = NULL; + qemuMonitorJobInfo **jobs = NULL; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; size_t njobs = 0; size_t i; @@ -2923,7 +2922,7 @@ testQemuMonitorJSONqemuMonitorJSONGetCPUModelBaseline(const void *opaque) g_autoptr(qemuMonitorTest) test = NULL; g_autoptr(virCPUDef) cpu_a = virCPUDefNew(); g_autoptr(virCPUDef) cpu_b = virCPUDefNew(); - qemuMonitorCPUModelInfoPtr baseline = NULL; + qemuMonitorCPUModelInfo *baseline = NULL; int ret = -1; if (!(test = qemuMonitorTestNewSchema(data->xmlopt, data->schema))) @@ -2994,7 +2993,7 @@ mymain(void) virQEMUDriver driver; testQemuMonitorJSONSimpleFuncData simpleFunc; struct testQAPISchemaData qapiData; - virJSONValuePtr metaschema = NULL; + virJSONValue *metaschema = NULL; char *metaschemastr = NULL; if (qemuTestDriverInit(&driver) < 0) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 227b78d527..143dd954e6 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -70,26 +70,26 @@ struct _qemuMonitorTest { size_t outgoingLength; size_t outgoingCapacity; - virNetSocketPtr server; - virNetSocketPtr client; + virNetSocket *server; + virNetSocket *client; virEventThread *eventThread; - qemuMonitorPtr mon; - qemuAgentPtr agent; + qemuMonitor *mon; + qemuAgent *agent; char *tmpdir; size_t nitems; - qemuMonitorTestItemPtr *items; + qemuMonitorTestItem **items; - virDomainObjPtr vm; + virDomainObj *vm; GHashTable *qapischema; }; static void -qemuMonitorTestItemFree(qemuMonitorTestItemPtr item) +qemuMonitorTestItemFree(qemuMonitorTestItem *item) { if (!item) return; @@ -107,7 +107,7 @@ qemuMonitorTestItemFree(qemuMonitorTestItemPtr item) * Appends data for a reply to the outgoing buffer */ int -qemuMonitorTestAddResponse(qemuMonitorTestPtr test, +qemuMonitorTestAddResponse(qemuMonitorTest *test, const char *response) { size_t want = strlen(response) + 2; @@ -129,7 +129,7 @@ qemuMonitorTestAddResponse(qemuMonitorTestPtr test, static int -qemuMonitorTestAddErrorResponseInternal(qemuMonitorTestPtr test, +qemuMonitorTestAddErrorResponseInternal(qemuMonitorTest *test, const char *usermsg) { g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; @@ -161,7 +161,7 @@ qemuMonitorTestAddErrorResponseInternal(qemuMonitorTestPtr test, int -qemuMonitorTestAddInvalidCommandResponse(qemuMonitorTestPtr test, +qemuMonitorTestAddInvalidCommandResponse(qemuMonitorTest *test, const char *expectedcommand, const char *actualcommand) { @@ -175,7 +175,7 @@ qemuMonitorTestAddInvalidCommandResponse(qemuMonitorTestPtr test, int G_GNUC_PRINTF(2, 3) -qemuMonitorTestAddErrorResponse(qemuMonitorTestPtr test, const char *errmsg, ...) +qemuMonitorTestAddErrorResponse(qemuMonitorTest *test, const char *errmsg, ...) { va_list msgargs; g_autofree char *msg = NULL; @@ -222,7 +222,7 @@ qemuMonitorTestErrorInvalidCommand(const char *expectedcommand, static int -qemuMonitorTestProcessCommand(qemuMonitorTestPtr test, +qemuMonitorTestProcessCommand(qemuMonitorTest *test, const char *cmdstr) { int ret; @@ -232,7 +232,7 @@ qemuMonitorTestProcessCommand(qemuMonitorTestPtr test, if (test->nitems == 0) { qemuMonitorTestError("unexpected command: '%s'", cmdstr); } else { - qemuMonitorTestItemPtr item = test->items[0]; + qemuMonitorTestItem *item = test->items[0]; ret = (item->cb)(test, item, cmdstr); qemuMonitorTestItemFree(item); if (VIR_DELETE_ELEMENT(test->items, 0, test->nitems) < 0) @@ -247,11 +247,11 @@ qemuMonitorTestProcessCommand(qemuMonitorTestPtr test, * Handles read/write of monitor data on the monitor server side */ static void -qemuMonitorTestIO(virNetSocketPtr sock, +qemuMonitorTestIO(virNetSocket *sock, int events, void *opaque) { - qemuMonitorTestPtr test = opaque; + qemuMonitorTest *test = opaque; bool err = false; virMutexLock(&test->lock); @@ -344,7 +344,7 @@ qemuMonitorTestIO(virNetSocketPtr sock, static void qemuMonitorTestWorker(void *opaque) { - qemuMonitorTestPtr test = opaque; + qemuMonitorTest *test = opaque; virMutexLock(&test->lock); @@ -376,7 +376,7 @@ qemuMonitorTestFreeTimer(int timer G_GNUC_UNUSED, void -qemuMonitorTestFree(qemuMonitorTestPtr test) +qemuMonitorTestFree(qemuMonitorTest *test) { size_t i; int timer = -1; @@ -449,13 +449,13 @@ qemuMonitorTestFree(qemuMonitorTestPtr test) int -qemuMonitorTestAddHandler(qemuMonitorTestPtr test, +qemuMonitorTestAddHandler(qemuMonitorTest *test, const char *identifier, qemuMonitorTestResponseCallback cb, void *opaque, virFreeCallback freecb) { - qemuMonitorTestItemPtr item; + qemuMonitorTestItem *item; item = g_new0(qemuMonitorTestItem, 1); @@ -481,14 +481,13 @@ qemuMonitorTestAddHandler(qemuMonitorTestPtr test, } void * -qemuMonitorTestItemGetPrivateData(qemuMonitorTestItemPtr item) +qemuMonitorTestItemGetPrivateData(qemuMonitorTestItem *item) { return item ? item->opaque : NULL; } typedef struct _qemuMonitorTestCommandArgs qemuMonitorTestCommandArgs; -typedef qemuMonitorTestCommandArgs *qemuMonitorTestCommandArgsPtr; struct _qemuMonitorTestCommandArgs { char *argname; char *argval; @@ -500,7 +499,7 @@ struct qemuMonitorTestHandlerData { char *cmderr; char *response; size_t nargs; - qemuMonitorTestCommandArgsPtr args; + qemuMonitorTestCommandArgs *args; char *expectArgs; }; @@ -529,9 +528,9 @@ qemuMonitorTestHandlerDataFree(void *opaque) /* Returns -1 on error, 0 if validation was successful/not necessary */ static int -qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTestPtr test, +qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTest *test, const char *cmdname, - virJSONValuePtr args) + virJSONValue *args) { g_auto(virBuffer) debug = VIR_BUFFER_INITIALIZER; @@ -577,13 +576,13 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTestPtr test, static int -qemuMonitorTestProcessCommandDefault(qemuMonitorTestPtr test, - qemuMonitorTestItemPtr item, +qemuMonitorTestProcessCommandDefault(qemuMonitorTest *test, + qemuMonitorTestItem *item, const char *cmdstr) { struct qemuMonitorTestHandlerData *data = item->opaque; g_autoptr(virJSONValue) val = NULL; - virJSONValuePtr cmdargs = NULL; + virJSONValue *cmdargs = NULL; const char *cmdname; if (!(val = virJSONValueFromString(cmdstr))) @@ -608,7 +607,7 @@ qemuMonitorTestProcessCommandDefault(qemuMonitorTestPtr test, int -qemuMonitorTestAddItem(qemuMonitorTestPtr test, +qemuMonitorTestAddItem(qemuMonitorTest *test, const char *command_name, const char *response) { @@ -627,14 +626,14 @@ qemuMonitorTestAddItem(qemuMonitorTestPtr test, static int -qemuMonitorTestProcessCommandVerbatim(qemuMonitorTestPtr test, - qemuMonitorTestItemPtr item, +qemuMonitorTestProcessCommandVerbatim(qemuMonitorTest *test, + qemuMonitorTestItem *item, const char *cmdstr) { struct qemuMonitorTestHandlerData *data = item->opaque; g_autofree char *reformatted = NULL; g_autoptr(virJSONValue) json = NULL; - virJSONValuePtr cmdargs; + virJSONValue *cmdargs; const char *cmdname; int ret = -1; @@ -681,7 +680,7 @@ qemuMonitorTestProcessCommandVerbatim(qemuMonitorTestPtr test, * Returns 0 when command was successfully added, -1 on error. */ int -qemuMonitorTestAddItemVerbatim(qemuMonitorTestPtr test, +qemuMonitorTestAddItemVerbatim(qemuMonitorTest *test, const char *command, const char *cmderr, const char *response) @@ -709,12 +708,12 @@ qemuMonitorTestAddItemVerbatim(qemuMonitorTestPtr test, static int -qemuMonitorTestProcessGuestAgentSync(qemuMonitorTestPtr test, - qemuMonitorTestItemPtr item G_GNUC_UNUSED, +qemuMonitorTestProcessGuestAgentSync(qemuMonitorTest *test, + qemuMonitorTestItem *item G_GNUC_UNUSED, const char *cmdstr) { g_autoptr(virJSONValue) val = NULL; - virJSONValuePtr args; + virJSONValue *args; unsigned long long id; const char *cmdname; g_autofree char *retmsg = NULL; @@ -754,7 +753,7 @@ qemuMonitorTestProcessGuestAgentSync(qemuMonitorTestPtr test, int -qemuMonitorTestAddAgentSyncResponse(qemuMonitorTestPtr test) +qemuMonitorTestAddAgentSyncResponse(qemuMonitorTest *test) { if (!test->agent) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -770,14 +769,14 @@ qemuMonitorTestAddAgentSyncResponse(qemuMonitorTestPtr test) static int -qemuMonitorTestProcessCommandWithArgs(qemuMonitorTestPtr test, - qemuMonitorTestItemPtr item, +qemuMonitorTestProcessCommandWithArgs(qemuMonitorTest *test, + qemuMonitorTestItem *item, const char *cmdstr) { struct qemuMonitorTestHandlerData *data = item->opaque; g_autoptr(virJSONValue) val = NULL; - virJSONValuePtr args; - virJSONValuePtr argobj; + virJSONValue *args; + virJSONValue *argobj; const char *cmdname; size_t i; @@ -803,7 +802,7 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTestPtr test, /* validate the args */ for (i = 0; i < data->nargs; i++) { - qemuMonitorTestCommandArgsPtr arg = &data->args[i]; + qemuMonitorTestCommandArgs *arg = &data->args[i]; g_autofree char *argstr = NULL; if (!(argobj = virJSONValueObjectGet(args, arg->argname))) { @@ -837,7 +836,7 @@ qemuMonitorTestProcessCommandWithArgs(qemuMonitorTestPtr test, /* this allows to add a responder that is able to check * a (shallow) structure of arguments for a command */ int -qemuMonitorTestAddItemParams(qemuMonitorTestPtr test, +qemuMonitorTestAddItemParams(qemuMonitorTest *test, const char *cmdname, const char *response, ...) @@ -884,13 +883,13 @@ qemuMonitorTestAddItemParams(qemuMonitorTestPtr test, static int -qemuMonitorTestProcessCommandWithArgStr(qemuMonitorTestPtr test, - qemuMonitorTestItemPtr item, +qemuMonitorTestProcessCommandWithArgStr(qemuMonitorTest *test, + qemuMonitorTestItem *item, const char *cmdstr) { struct qemuMonitorTestHandlerData *data = item->opaque; g_autoptr(virJSONValue) val = NULL; - virJSONValuePtr args; + virJSONValue *args; g_autofree char *argstr = NULL; const char *cmdname; @@ -944,7 +943,7 @@ qemuMonitorTestProcessCommandWithArgStr(qemuMonitorTestPtr test, * quotes for simplification of writing the strings into code. */ int -qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test, +qemuMonitorTestAddItemExpect(qemuMonitorTest *test, const char *cmdname, const char *cmdargs, bool apostrophe, @@ -977,16 +976,16 @@ qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test, static void -qemuMonitorTestEOFNotify(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm G_GNUC_UNUSED, +qemuMonitorTestEOFNotify(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { } static void -qemuMonitorTestErrorNotify(qemuMonitorPtr mon G_GNUC_UNUSED, - virDomainObjPtr vm G_GNUC_UNUSED, +qemuMonitorTestErrorNotify(qemuMonitor *mon G_GNUC_UNUSED, + virDomainObj *vm G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { } @@ -1000,8 +999,8 @@ static qemuMonitorCallbacks qemuMonitorTestCallbacks = { static void -qemuMonitorTestAgentNotify(qemuAgentPtr agent G_GNUC_UNUSED, - virDomainObjPtr vm G_GNUC_UNUSED) +qemuMonitorTestAgentNotify(qemuAgent *agent G_GNUC_UNUSED, + virDomainObj *vm G_GNUC_UNUSED) { } @@ -1012,12 +1011,12 @@ static qemuAgentCallbacks qemuMonitorTestAgentCallbacks = { }; -static qemuMonitorTestPtr -qemuMonitorCommonTestNew(virDomainXMLOptionPtr xmlopt, - virDomainObjPtr vm, - virDomainChrSourceDefPtr src) +static qemuMonitorTest * +qemuMonitorCommonTestNew(virDomainXMLOption *xmlopt, + virDomainObj *vm, + virDomainChrSourceDef *src) { - qemuMonitorTestPtr test = NULL; + qemuMonitorTest *test = NULL; char *path = NULL; char *tmpdir_template = NULL; @@ -1077,7 +1076,7 @@ qemuMonitorCommonTestNew(virDomainXMLOptionPtr xmlopt, static int -qemuMonitorCommonTestInit(qemuMonitorTestPtr test) +qemuMonitorCommonTestInit(qemuMonitorTest *test) { int events = VIR_EVENT_HANDLE_READABLE; @@ -1130,14 +1129,14 @@ qemuMonitorCommonTestInit(qemuMonitorTestPtr test) /* We skip the normal handshake reply of "{\"execute\":\"qmp_capabilities\"}" */ -qemuMonitorTestPtr -qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt, - virDomainObjPtr vm, - virQEMUDriverPtr driver, +qemuMonitorTest * +qemuMonitorTestNew(virDomainXMLOption *xmlopt, + virDomainObj *vm, + virQEMUDriver *driver, const char *greeting, GHashTable *schema) { - qemuMonitorTestPtr test = NULL; + qemuMonitorTest *test = NULL; virDomainChrSourceDef src; memset(&src, 0, sizeof(src)); @@ -1193,12 +1192,12 @@ qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt, * * Returns the monitor object on success; NULL on error. */ -qemuMonitorTestPtr +qemuMonitorTest * qemuMonitorTestNewFromFile(const char *fileName, - virDomainXMLOptionPtr xmlopt, + virDomainXMLOption *xmlopt, bool simple) { - qemuMonitorTestPtr test = NULL; + qemuMonitorTest *test = NULL; g_autofree char *json = NULL; char *tmp; char *singleReply; @@ -1266,7 +1265,7 @@ qemuMonitorTestNewFromFile(const char *fileName, * to test some negative scenarios which would not use all commands. */ void -qemuMonitorTestAllowUnusedCommands(qemuMonitorTestPtr test) +qemuMonitorTestAllowUnusedCommands(qemuMonitorTest *test) { test->allowUnusedCommands = true; } @@ -1289,7 +1288,7 @@ qemuMonitorTestAllowUnusedCommands(qemuMonitorTestPtr test) * argument is removed it will still fail validation. */ void -qemuMonitorTestSkipDeprecatedValidation(qemuMonitorTestPtr test, +qemuMonitorTestSkipDeprecatedValidation(qemuMonitorTest *test, bool allowRemoved) { test->skipValidationDeprecated = true; @@ -1298,7 +1297,7 @@ qemuMonitorTestSkipDeprecatedValidation(qemuMonitorTestPtr test, static int -qemuMonitorTestFullAddItem(qemuMonitorTestPtr test, +qemuMonitorTestFullAddItem(qemuMonitorTest *test, const char *filename, const char *command, const char *response, @@ -1331,13 +1330,13 @@ qemuMonitorTestFullAddItem(qemuMonitorTestPtr test, * * Returns the monitor object on success; NULL on error. */ -qemuMonitorTestPtr +qemuMonitorTest * qemuMonitorTestNewFromFileFull(const char *fileName, - virQEMUDriverPtr driver, - virDomainObjPtr vm, + virQEMUDriver *driver, + virDomainObj *vm, GHashTable *qmpschema) { - qemuMonitorTestPtr ret = NULL; + qemuMonitorTest *ret = NULL; g_autofree char *jsonstr = NULL; char *tmp; size_t line = 0; @@ -1413,10 +1412,10 @@ qemuMonitorTestNewFromFileFull(const char *fileName, } -qemuMonitorTestPtr -qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt) +qemuMonitorTest * +qemuMonitorTestNewAgent(virDomainXMLOption *xmlopt) { - qemuMonitorTestPtr test = NULL; + qemuMonitorTest *test = NULL; virDomainChrSourceDef src; memset(&src, 0, sizeof(src)); @@ -1450,22 +1449,22 @@ qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt) } -qemuMonitorPtr -qemuMonitorTestGetMonitor(qemuMonitorTestPtr test) +qemuMonitor * +qemuMonitorTestGetMonitor(qemuMonitorTest *test) { return test->mon; } -qemuAgentPtr -qemuMonitorTestGetAgent(qemuMonitorTestPtr test) +qemuAgent * +qemuMonitorTestGetAgent(qemuMonitorTest *test) { return test->agent; } -virDomainObjPtr -qemuMonitorTestGetDomainObj(qemuMonitorTestPtr test) +virDomainObj * +qemuMonitorTestGetDomainObj(qemuMonitorTest *test) { return test->vm; } diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h index ec40f29e75..e572627e20 100644 --- a/tests/qemumonitortestutils.h +++ b/tests/qemumonitortestutils.h @@ -25,53 +25,51 @@ #include "qemu/qemu_agent.h" typedef struct _qemuMonitorTest qemuMonitorTest; -typedef qemuMonitorTest *qemuMonitorTestPtr; typedef struct _qemuMonitorTestItem qemuMonitorTestItem; -typedef qemuMonitorTestItem *qemuMonitorTestItemPtr; -typedef int (*qemuMonitorTestResponseCallback)(qemuMonitorTestPtr test, - qemuMonitorTestItemPtr item, +typedef int (*qemuMonitorTestResponseCallback)(qemuMonitorTest *test, + qemuMonitorTestItem *item, const char *message); -int qemuMonitorTestAddHandler(qemuMonitorTestPtr test, +int qemuMonitorTestAddHandler(qemuMonitorTest *test, const char *identifier, qemuMonitorTestResponseCallback cb, void *opaque, virFreeCallback freecb); -int qemuMonitorTestAddResponse(qemuMonitorTestPtr test, +int qemuMonitorTestAddResponse(qemuMonitorTest *test, const char *response); -int qemuMonitorTestAddInvalidCommandResponse(qemuMonitorTestPtr test, +int qemuMonitorTestAddInvalidCommandResponse(qemuMonitorTest *test, const char *expectedcommand, const char *actualcommand); -void *qemuMonitorTestItemGetPrivateData(qemuMonitorTestItemPtr item); +void *qemuMonitorTestItemGetPrivateData(qemuMonitorTestItem *item); -int qemuMonitorTestAddErrorResponse(qemuMonitorTestPtr test, const char *errmsg, ...); +int qemuMonitorTestAddErrorResponse(qemuMonitorTest *test, const char *errmsg, ...); -void qemuMonitorTestAllowUnusedCommands(qemuMonitorTestPtr test); -void qemuMonitorTestSkipDeprecatedValidation(qemuMonitorTestPtr test, +void qemuMonitorTestAllowUnusedCommands(qemuMonitorTest *test); +void qemuMonitorTestSkipDeprecatedValidation(qemuMonitorTest *test, bool allowRemoved); -int qemuMonitorTestAddItem(qemuMonitorTestPtr test, +int qemuMonitorTestAddItem(qemuMonitorTest *test, const char *command_name, const char *response); -int qemuMonitorTestAddItemVerbatim(qemuMonitorTestPtr test, +int qemuMonitorTestAddItemVerbatim(qemuMonitorTest *test, const char *command, const char *cmderr, const char *response); -int qemuMonitorTestAddAgentSyncResponse(qemuMonitorTestPtr test); +int qemuMonitorTestAddAgentSyncResponse(qemuMonitorTest *test); -int qemuMonitorTestAddItemParams(qemuMonitorTestPtr test, +int qemuMonitorTestAddItemParams(qemuMonitorTest *test, const char *cmdname, const char *response, ...) G_GNUC_NULL_TERMINATED; -int qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test, +int qemuMonitorTestAddItemExpect(qemuMonitorTest *test, const char *cmdname, const char *cmdargs, bool apostrophe, @@ -82,27 +80,27 @@ int qemuMonitorTestAddItemExpect(qemuMonitorTestPtr test, #define qemuMonitorTestNewSchema(xmlopt, schema) \ qemuMonitorTestNew(xmlopt, NULL, NULL, NULL, schema) -qemuMonitorTestPtr qemuMonitorTestNew(virDomainXMLOptionPtr xmlopt, - virDomainObjPtr vm, - virQEMUDriverPtr driver, +qemuMonitorTest *qemuMonitorTestNew(virDomainXMLOption *xmlopt, + virDomainObj *vm, + virQEMUDriver *driver, const char *greeting, GHashTable *schema); -qemuMonitorTestPtr qemuMonitorTestNewFromFile(const char *fileName, - virDomainXMLOptionPtr xmlopt, +qemuMonitorTest *qemuMonitorTestNewFromFile(const char *fileName, + virDomainXMLOption *xmlopt, bool simple); -qemuMonitorTestPtr qemuMonitorTestNewFromFileFull(const char *fileName, - virQEMUDriverPtr driver, - virDomainObjPtr vm, +qemuMonitorTest *qemuMonitorTestNewFromFileFull(const char *fileName, + virQEMUDriver *driver, + virDomainObj *vm, GHashTable *qmpschema); -qemuMonitorTestPtr qemuMonitorTestNewAgent(virDomainXMLOptionPtr xmlopt); +qemuMonitorTest *qemuMonitorTestNewAgent(virDomainXMLOption *xmlopt); -void qemuMonitorTestFree(qemuMonitorTestPtr test); +void qemuMonitorTestFree(qemuMonitorTest *test); -qemuMonitorPtr qemuMonitorTestGetMonitor(qemuMonitorTestPtr test); -qemuAgentPtr qemuMonitorTestGetAgent(qemuMonitorTestPtr test); -virDomainObjPtr qemuMonitorTestGetDomainObj(qemuMonitorTestPtr test); +qemuMonitor *qemuMonitorTestGetMonitor(qemuMonitorTest *test); +qemuAgent *qemuMonitorTestGetAgent(qemuMonitorTest *test); +virDomainObj *qemuMonitorTestGetDomainObj(qemuMonitorTest *test); G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuMonitorTest, qemuMonitorTestFree); diff --git a/tests/qemusecuritytest.c b/tests/qemusecuritytest.c index 74a25f2be1..184ffca15f 100644 --- a/tests/qemusecuritytest.c +++ b/tests/qemusecuritytest.c @@ -30,17 +30,17 @@ #define VIR_FROM_THIS VIR_FROM_NONE struct testData { - virQEMUDriverPtr driver; + virQEMUDriver *driver; const char *file; /* file name to load VM def XML from; qemuxml2argvdata/ */ }; static int -prepareObjects(virQEMUDriverPtr driver, +prepareObjects(virQEMUDriver *driver, const char *xmlname, - virDomainObjPtr *vm_ret) + virDomainObj **vm_ret) { - qemuDomainObjPrivatePtr priv; + qemuDomainObjPrivate *priv; g_autoptr(virDomainObj) vm = NULL; g_autofree char *filename = NULL; g_autofree char *domxml = NULL; @@ -95,8 +95,8 @@ testDomain(const void *opaque) return -1; for (i = 0; i < vm->def->ndisks; i++) { - virStorageSourcePtr src = vm->def->disks[i]->src; - virStorageSourcePtr n; + virStorageSource *src = vm->def->disks[i]->src; + virStorageSource *n; if (!src) continue; @@ -136,10 +136,10 @@ static int mymain(void) { virQEMUDriver driver; - virSecurityManagerPtr stack = NULL; - virSecurityManagerPtr dac = NULL; + virSecurityManager *stack = NULL; + virSecurityManager *dac = NULL; #ifdef WITH_SELINUX - virSecurityManagerPtr selinux = NULL; + virSecurityManager *selinux = NULL; #endif int ret = 0; diff --git a/tests/qemustatusxml2xmltest.c b/tests/qemustatusxml2xmltest.c index a39ad87ae5..63fbaa0ddb 100644 --- a/tests/qemustatusxml2xmltest.c +++ b/tests/qemustatusxml2xmltest.c @@ -19,7 +19,7 @@ static int testCompareStatusXMLToXMLFiles(const void *opaque) { const struct testQemuInfo *data = opaque; - virDomainObjPtr obj = NULL; + virDomainObj *obj = NULL; g_autofree char *actual = NULL; int ret = -1; diff --git a/tests/qemuxml2argvmock.c b/tests/qemuxml2argvmock.c index 6900232b33..9d812bfc2e 100644 --- a/tests/qemuxml2argvmock.c +++ b/tests/qemuxml2argvmock.c @@ -81,7 +81,7 @@ virNumaNodeIsAvailable(int node) } bool -virNumaNodesetIsAvailable(virBitmapPtr nodeset) +virNumaNodesetIsAvailable(virBitmap *nodeset) { ssize_t bit = -1; @@ -193,12 +193,12 @@ virHostGetDRMRenderNode(void) return g_strdup("/dev/dri/foo"); } -static void (*real_virCommandPassFD)(virCommandPtr cmd, int fd, unsigned int flags); +static void (*real_virCommandPassFD)(virCommand *cmd, int fd, unsigned int flags); static const int testCommandPassSafeFDs[] = { 1730, 1731, 1732 }; void -virCommandPassFD(virCommandPtr cmd, +virCommandPassFD(virCommand *cmd, int fd, unsigned int flags) { @@ -225,8 +225,8 @@ virNetDevOpenvswitchGetVhostuserIfname(const char *path G_GNUC_UNUSED, } int -qemuInterfaceOpenVhostNet(virDomainDefPtr def G_GNUC_UNUSED, - virDomainNetDefPtr net, +qemuInterfaceOpenVhostNet(virDomainDef *def G_GNUC_UNUSED, + virDomainNetDef *net, int *vhostfd, size_t *vhostfdSize) { @@ -285,7 +285,7 @@ virNetDevSetRootQDisc(const char *ifname G_GNUC_UNUSED, int -qemuInterfaceVDPAConnect(virDomainNetDefPtr net G_GNUC_UNUSED) +qemuInterfaceVDPAConnect(virDomainNetDef *net G_GNUC_UNUSED) { if (fcntl(1732, F_GETFD) != -1) abort(); diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 317ee3267d..475a3dbdfc 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -281,7 +281,7 @@ static virNWFilterDriver fakeNWFilterDriver = { static int -testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy) +testAddCPUModels(virQEMUCaps *caps, bool skipLegacy) { virArch arch = virQEMUCapsGetArch(caps); const char *x86Models[] = { @@ -354,7 +354,7 @@ testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy) static int testUpdateQEMUCaps(const struct testQemuInfo *info, virArch arch, - virCapsPtr caps) + virCaps *caps) { if (!caps) return -1; @@ -392,15 +392,15 @@ testCheckExclusiveFlags(int flags) } -static virCommandPtr -testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv, - virDomainObjPtr vm, +static virCommand * +testCompareXMLToArgvCreateArgs(virQEMUDriver *drv, + virDomainObj *vm, const char *migrateURI, struct testQemuInfo *info, unsigned int flags, bool jsonPropsValidation) { - qemuDomainObjPrivatePtr priv = vm->privateData; + qemuDomainObjPrivate *priv = vm->privateData; bool enableFips = !!(flags & FLAG_FIPS_HOST); size_t i; @@ -409,7 +409,7 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv, return NULL; for (i = 0; i < vm->def->ndisks; i++) { - virDomainDiskDefPtr disk = vm->def->disks[i]; + virDomainDiskDef *disk = vm->def->disks[i]; /* host cdrom requires special treatment in qemu, mock it */ if (disk->device == VIR_DOMAIN_DISK_DEVICE_CDROM && @@ -420,7 +420,7 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv, } for (i = 0; i < vm->def->nhostdevs; i++) { - virDomainHostdevDefPtr hostdev = vm->def->hostdevs[i]; + virDomainHostdevDef *hostdev = vm->def->hostdevs[i]; if (hostdev->mode == VIR_DOMAIN_HOSTDEV_MODE_SUBSYS && hostdev->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI && @@ -429,7 +429,7 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv, } if (virHostdevIsSCSIDevice(hostdev)) { - virDomainHostdevSubsysSCSIPtr scsisrc = &hostdev->source.subsys.u.scsi; + virDomainHostdevSubsysSCSI *scsisrc = &hostdev->source.subsys.u.scsi; switch ((virDomainHostdevSCSIProtocolType) scsisrc->protocol) { case VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_NONE: @@ -448,7 +448,7 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv, } for (i = 0; i < vm->def->nfss; i++) { - virDomainFSDefPtr fs = vm->def->fss[i]; + virDomainFSDef *fs = vm->def->fss[i]; char *s; if (fs->fsdriver != VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS || @@ -460,9 +460,9 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv, } if (vm->def->vsock) { - virDomainVsockDefPtr vsock = vm->def->vsock; - qemuDomainVsockPrivatePtr vsockPriv = - (qemuDomainVsockPrivatePtr)vsock->privateData; + virDomainVsockDef *vsock = vm->def->vsock; + qemuDomainVsockPrivate *vsockPriv = + (qemuDomainVsockPrivate *)vsock->privateData; if (vsock->auto_cid == VIR_TRISTATE_BOOL_YES) vsock->guest_cid = 42; @@ -480,10 +480,10 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv, } for (i = 0; i < vm->def->nvideos; i++) { - virDomainVideoDefPtr video = vm->def->videos[i]; + virDomainVideoDef *video = vm->def->videos[i]; if (video->backend == VIR_DOMAIN_VIDEO_BACKEND_TYPE_VHOSTUSER) { - qemuDomainVideoPrivatePtr vpriv = QEMU_DOMAIN_VIDEO_PRIVATE(video); + qemuDomainVideoPrivate *vpriv = QEMU_DOMAIN_VIDEO_PRIVATE(video); vpriv->vhost_user_fd = 1729; } @@ -491,11 +491,11 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv, if (flags & FLAG_SLIRP_HELPER) { for (i = 0; i < vm->def->nnets; i++) { - virDomainNetDefPtr net = vm->def->nets[i]; + virDomainNetDef *net = vm->def->nets[i]; if (net->type == VIR_DOMAIN_NET_TYPE_USER && virQEMUCapsGet(info->qemuCaps, QEMU_CAPS_DBUS_VMSTATE)) { - qemuSlirpPtr slirp = qemuSlirpNew(); + qemuSlirp *slirp = qemuSlirpNew(); slirp->fd[0] = 42; QEMU_DOMAIN_NETWORK_PRIVATE(net)->slirp = slirp; } @@ -513,14 +513,14 @@ testCompareXMLToArgvCreateArgs(virQEMUDriverPtr drv, static int -testCompareXMLToArgvValidateSchema(virQEMUDriverPtr drv, +testCompareXMLToArgvValidateSchema(virQEMUDriver *drv, const char *migrateURI, struct testQemuInfo *info, unsigned int flags) { g_auto(GStrv) args = NULL; g_autoptr(virDomainObj) vm = NULL; - qemuDomainObjPrivatePtr priv = NULL; + qemuDomainObjPrivate *priv = NULL; size_t nargs = 0; size_t i; GHashTable *schema = NULL; @@ -638,13 +638,13 @@ testCompareXMLToArgv(const void *data) unsigned int flags = info->flags; unsigned int parseFlags = info->parseFlags; int ret = -1; - virDomainObjPtr vm = NULL; + virDomainObj *vm = NULL; virDomainChrSourceDef monitor_chr; g_autoptr(virConnect) conn = NULL; virError *err = NULL; char *log = NULL; g_autoptr(virCommand) cmd = NULL; - qemuDomainObjPrivatePtr priv = NULL; + qemuDomainObjPrivate *priv = NULL; g_autoptr(xmlDoc) xml = NULL; g_autoptr(xmlXPathContext) ctxt = NULL; xmlNodePtr root; diff --git a/tests/seclabeltest.c b/tests/seclabeltest.c index 105c25ea2d..39a96d0fc0 100644 --- a/tests/seclabeltest.c +++ b/tests/seclabeltest.c @@ -8,7 +8,7 @@ static int mymain(void) { - virSecurityManagerPtr mgr; + virSecurityManager *mgr; const char *doi, *model; mgr = virSecurityManagerNew(NULL, "QEMU", VIR_SECURITY_MANAGER_DEFAULT_CONFINED); diff --git a/tests/secretxml2xmltest.c b/tests/secretxml2xmltest.c index 74a262e1e8..48f48416b5 100644 --- a/tests/secretxml2xmltest.c +++ b/tests/secretxml2xmltest.c @@ -12,7 +12,7 @@ testCompareXMLToXMLFiles(const char *inxml, const char *outxml) { char *actual = NULL; int ret = -1; - virSecretDefPtr secret = NULL; + virSecretDef *secret = NULL; if (!(secret = virSecretDefParseFile(inxml))) goto fail; diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c index def88e3950..b1a6735d33 100644 --- a/tests/securityselinuxlabeltest.c +++ b/tests/securityselinuxlabeltest.c @@ -44,7 +44,7 @@ VIR_LOG_INIT("tests.securityselinuxlabeltest"); static virQEMUDriver driver; -static virSecurityManagerPtr mgr; +static virSecurityManager *mgr; typedef struct testSELinuxFile testSELinuxFile; @@ -159,11 +159,11 @@ testSELinuxLoadFileList(const char *testname, } -static virDomainDefPtr +static virDomainDef * testSELinuxLoadDef(const char *testname) { char *xmlfile = NULL; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; size_t i; xmlfile = g_strdup_printf("%s/securityselinuxlabeldata/%s.xml", abs_srcdir, @@ -282,7 +282,7 @@ testSELinuxLabeling(const void *opaque) testSELinuxFile *files = NULL; size_t nfiles = 0; size_t i; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; if (testSELinuxLoadFileList(testname, &files, &nfiles) < 0) goto cleanup; diff --git a/tests/securityselinuxtest.c b/tests/securityselinuxtest.c index a75ff495eb..9b65eeb994 100644 --- a/tests/securityselinuxtest.c +++ b/tests/securityselinuxtest.c @@ -39,7 +39,7 @@ VIR_LOG_INIT("tests.securityselinuxtest"); struct testSELinuxGenLabelData { - virSecurityManagerPtr mgr; + virSecurityManager *mgr; const char *pidcon; @@ -59,19 +59,19 @@ struct testSELinuxGenLabelData { int catMax; }; -static virDomainDefPtr +static virDomainDef * testBuildDomainDef(bool dynamic, const char *label, const char *baselabel) { - virDomainDefPtr def; - virSecurityLabelDefPtr secdef = NULL; + virDomainDef *def; + virSecurityLabelDef *secdef = NULL; if (!(def = virDomainDefNew())) goto error; def->virtType = VIR_DOMAIN_VIRT_KVM; - def->seclabels = g_new0(virSecurityLabelDefPtr, 1); + def->seclabels = g_new0(virSecurityLabelDef *, 1); secdef = g_new0(virSecurityLabelDef, 1); @@ -211,7 +211,7 @@ testSELinuxGenLabel(const void *opaque) { const struct testSELinuxGenLabelData *data = opaque; int ret = -1; - virDomainDefPtr def; + virDomainDef *def; context_t con = NULL; context_t imgcon = NULL; @@ -265,7 +265,7 @@ static int mymain(void) { int ret = 0; - virSecurityManagerPtr mgr; + virSecurityManager *mgr; if (!(mgr = virSecurityManagerNew("selinux", "QEMU", VIR_SECURITY_MANAGER_DEFAULT_CONFINED | diff --git a/tests/storagepoolcapstest.c b/tests/storagepoolcapstest.c index 28b9f7d90a..f937670aa7 100644 --- a/tests/storagepoolcapstest.c +++ b/tests/storagepoolcapstest.c @@ -28,11 +28,11 @@ struct test_virStoragePoolCapsFormatData { const char *filename; - virCapsPtr driverCaps; + virCaps *driverCaps; }; static void -test_virCapabilitiesAddFullStoragePool(virCapsPtr caps) +test_virCapabilitiesAddFullStoragePool(virCaps *caps) { size_t i; @@ -42,7 +42,7 @@ test_virCapabilitiesAddFullStoragePool(virCapsPtr caps) static void -test_virCapabilitiesAddFSStoragePool(virCapsPtr caps) +test_virCapabilitiesAddFSStoragePool(virCaps *caps) { virCapabilitiesAddStoragePool(caps, VIR_STORAGE_POOL_FS); } @@ -53,7 +53,7 @@ test_virStoragePoolCapsFormat(const void *opaque) { struct test_virStoragePoolCapsFormatData *data = (struct test_virStoragePoolCapsFormatData *) opaque; - virCapsPtr driverCaps = data->driverCaps; + virCaps *driverCaps = data->driverCaps; g_autoptr(virStoragePoolCaps) poolCaps = NULL; g_autofree char *path = NULL; g_autofree char *poolCapsXML = NULL; diff --git a/tests/storagepoolxml2argvtest.c b/tests/storagepoolxml2argvtest.c index 58fb14b8b2..449b745519 100644 --- a/tests/storagepoolxml2argvtest.c +++ b/tests/storagepoolxml2argvtest.c @@ -23,8 +23,8 @@ testCompareXMLToArgvFiles(bool shouldFail, const char *cmdline) { int ret = -1; - virStoragePoolDefPtr def = NULL; - virStoragePoolObjPtr pool = NULL; + virStoragePoolDef *def = NULL; + virStoragePoolObj *pool = NULL; const char *defTypeStr; g_autofree char *actualCmdline = NULL; g_autofree char *src = NULL; diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c index 1b639e157e..6058d2b689 100644 --- a/tests/storagevolxml2argvtest.c +++ b/tests/storagevolxml2argvtest.c @@ -13,8 +13,8 @@ const char create_tool[] = "qemu-img"; /* createVol sets this on volume creation */ static void -testSetVolumeType(virStorageVolDefPtr vol, - virStoragePoolDefPtr pool) +testSetVolumeType(virStorageVolDef *vol, + virStoragePoolDef *pool) { if (!vol || !pool) return; @@ -44,8 +44,8 @@ testCompareXMLToArgvFiles(bool shouldFail, { virStorageVolEncryptConvertStep convertStep = VIR_STORAGE_VOL_ENCRYPT_NONE; int ret = -1; - virStoragePoolDefPtr def = NULL; - virStoragePoolObjPtr obj = NULL; + virStoragePoolDef *def = NULL; + virStoragePoolObj *obj = NULL; g_autofree char *actualCmdline = NULL; g_autoptr(virStorageVolDef) vol = NULL; g_autoptr(virStorageVolDef) inputvol = NULL; diff --git a/tests/sysinfotest.c b/tests/sysinfotest.c index 9129b6db7a..973b8317b5 100644 --- a/tests/sysinfotest.c +++ b/tests/sysinfotest.c @@ -41,7 +41,7 @@ struct testSysinfoData { const char *name; /* test name, also base name for result files */ - virSysinfoDefPtr (*func)(void); /* sysinfo gathering function */ + virSysinfoDef *(*func)(void); /* sysinfo gathering function */ }; diff --git a/tests/testutils.c b/tests/testutils.c index 0a719bc782..c39797e51d 100644 --- a/tests/testutils.c +++ b/tests/testutils.c @@ -52,8 +52,8 @@ static unsigned int testRegenerate = -1; static size_t testCounter; -static virBitmapPtr testBitmap; -static virBitmapPtr failedTests; +static virBitmap *testBitmap; +static virBitmap *failedTests; virArch virTestHostArch = VIR_ARCH_X86_64; @@ -300,10 +300,10 @@ virTestLoadFilePath(const char *p, ...) * Constructs the test file path from variable arguments and loads and parses * the JSON file. 'abs_srcdir' is automatically prepended to the path. */ -virJSONValuePtr +virJSONValue * virTestLoadFileJSON(const char *p, ...) { - virJSONValuePtr ret = NULL; + virJSONValue *ret = NULL; g_autofree char *jsonstr = NULL; g_autofree char *path = NULL; va_list ap; @@ -649,13 +649,13 @@ struct virtTestLogData { static struct virtTestLogData testLog = { VIR_BUFFER_INITIALIZER }; static void -virtTestLogOutput(virLogSourcePtr source G_GNUC_UNUSED, +virtTestLogOutput(virLogSource *source G_GNUC_UNUSED, virLogPriority priority G_GNUC_UNUSED, const char *filename G_GNUC_UNUSED, int lineno G_GNUC_UNUSED, const char *funcname G_GNUC_UNUSED, const char *timestamp, - virLogMetadataPtr metadata G_GNUC_UNUSED, + struct _virLogMetadata *metadata G_GNUC_UNUSED, const char *rawstr G_GNUC_UNUSED, const char *str, void *data) @@ -748,8 +748,8 @@ int virTestMain(int argc, int ret; char *testRange = NULL; size_t noutputs = 0; - virLogOutputPtr output = NULL; - virLogOutputPtr *outputs = NULL; + virLogOutput *output = NULL; + virLogOutput **outputs = NULL; g_autofree char *baseprogname = NULL; const char *progname; g_autofree const char **preloads = NULL; @@ -851,10 +851,11 @@ int virTestMain(int argc, } -virCapsPtr virTestGenericCapsInit(void) +virCaps * +virTestGenericCapsInit(void) { g_autoptr(virCaps) caps = NULL; - virCapsGuestPtr guest; + virCapsGuest *guest; if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64, false, false)) == NULL) @@ -911,11 +912,11 @@ virCapsPtr virTestGenericCapsInit(void) * Build NUMA topology with cell id starting from (0 + seq) * for testing */ -virCapsHostNUMAPtr +virCapsHostNUMA * virTestCapsBuildNUMATopology(int seq) { g_autoptr(virCapsHostNUMA) caps = virCapabilitiesHostNUMANew(); - virCapsHostNUMACellCPUPtr cell_cpus = NULL; + virCapsHostNUMACellCPU *cell_cpus = NULL; int core_id, cell_id; int id; @@ -948,7 +949,7 @@ static virDomainDefParserConfig virTestGenericDomainDefParserConfig = { .features = VIR_DOMAIN_DEF_FEATURE_INDIVIDUAL_VCPUS, }; -virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void) +virDomainXMLOption *virTestGenericDomainXMLConfInit(void) { return virDomainXMLOptionNew(&virTestGenericDomainDefParserConfig, NULL, NULL, NULL, NULL); @@ -956,8 +957,8 @@ virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void) int -testCompareDomXML2XMLFiles(virCapsPtr caps G_GNUC_UNUSED, - virDomainXMLOptionPtr xmlopt, +testCompareDomXML2XMLFiles(virCaps *caps G_GNUC_UNUSED, + virDomainXMLOption *xmlopt, const char *infile, const char *outfile, bool live, unsigned int parseFlags, testCompareDomXML2XMLResult expectResult) @@ -965,7 +966,7 @@ testCompareDomXML2XMLFiles(virCapsPtr caps G_GNUC_UNUSED, g_autofree char *actual = NULL; int ret = -1; testCompareDomXML2XMLResult result; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; unsigned int parse_flags = live ? 0 : VIR_DOMAIN_DEF_PARSE_INACTIVE; unsigned int format_flags = VIR_DOMAIN_DEF_FORMAT_SECURE; diff --git a/tests/testutils.h b/tests/testutils.h index 36154e7077..e268a95612 100644 --- a/tests/testutils.h +++ b/tests/testutils.h @@ -43,7 +43,7 @@ int virTestRun(const char *title, int virTestLoadFile(const char *file, char **buf); char *virTestLoadFilePath(const char *p, ...) G_GNUC_NULL_TERMINATED; -virJSONValuePtr virTestLoadFileJSON(const char *p, ...) +virJSONValue *virTestLoadFileJSON(const char *p, ...) G_GNUC_NULL_TERMINATED; int virTestDifference(FILE *stream, @@ -143,9 +143,9 @@ int virTestMain(int argc, #define VIR_TEST_MOCK(mock) (abs_builddir "/lib" mock "mock" MOCK_EXT) -virCapsPtr virTestGenericCapsInit(void); -virCapsHostNUMAPtr virTestCapsBuildNUMATopology(int seq); -virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void); +virCaps *virTestGenericCapsInit(void); +virCapsHostNUMA *virTestCapsBuildNUMATopology(int seq); +virDomainXMLOption *virTestGenericDomainXMLConfInit(void); typedef enum { TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS, @@ -155,8 +155,8 @@ typedef enum { TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_COMPARE, } testCompareDomXML2XMLResult; -int testCompareDomXML2XMLFiles(virCapsPtr caps, - virDomainXMLOptionPtr xmlopt, +int testCompareDomXML2XMLFiles(virCaps *caps, + virDomainXMLOption *xmlopt, const char *inxml, const char *outfile, bool live, diff --git a/tests/testutilshostcpus.h b/tests/testutilshostcpus.h index 91d9c153d9..cf0fc833e1 100644 --- a/tests/testutilshostcpus.h +++ b/tests/testutilshostcpus.h @@ -138,7 +138,7 @@ static virCPUDef cpuSparcData = { .threads = 1, }; -static inline virCPUDefPtr +static inline virCPUDef * testUtilsHostCpusGetDefForModel(const char *model) { if (!model) @@ -158,7 +158,7 @@ testUtilsHostCpusGetDefForModel(const char *model) return NULL; } -static inline virCPUDefPtr +static inline virCPUDef * testUtilsHostCpusGetDefForArch(virArch arch) { if (ARCH_IS_X86(arch)) diff --git a/tests/testutilslxc.c b/tests/testutilslxc.c index e15ea2bd32..9ab57f7ccb 100644 --- a/tests/testutilslxc.c +++ b/tests/testutilslxc.c @@ -8,11 +8,11 @@ # define VIR_FROM_THIS VIR_FROM_LXC -virCapsPtr +virCaps * testLXCCapsInit(void) { - virCapsPtr caps; - virCapsGuestPtr guest; + virCaps *caps; + virCapsGuest *guest; if ((caps = virCapabilitiesNew(VIR_ARCH_X86_64, false, false)) == NULL) @@ -58,10 +58,10 @@ testLXCCapsInit(void) } -virLXCDriverPtr +virLXCDriver * testLXCDriverInit(void) { - virLXCDriverPtr driver = g_new0(virLXCDriver, 1); + virLXCDriver *driver = g_new0(virLXCDriver, 1); if (virMutexInit(&driver->lock) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -78,7 +78,7 @@ testLXCDriverInit(void) void -testLXCDriverFree(virLXCDriverPtr driver) +testLXCDriverFree(virLXCDriver *driver) { virObjectUnref(driver->xmlopt); virObjectUnref(driver->caps); diff --git a/tests/testutilslxc.h b/tests/testutilslxc.h index fe170540b5..0f7345b1c1 100644 --- a/tests/testutilslxc.h +++ b/tests/testutilslxc.h @@ -23,6 +23,6 @@ #define FAKEDEVDIR0 "/fakedevdir0/bla/fasl" #define FAKEDEVDIR1 "/fakedevdir1/bla/fasl" -virCapsPtr testLXCCapsInit(void); -virLXCDriverPtr testLXCDriverInit(void); -void testLXCDriverFree(virLXCDriverPtr driver); +virCaps *testLXCCapsInit(void); +virLXCDriver *testLXCDriverInit(void); +void testLXCDriverFree(virLXCDriver *driver); diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 22f43c3bec..7451929807 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -16,10 +16,10 @@ # define VIR_FROM_THIS VIR_FROM_QEMU -virCPUDefPtr cpuDefault; -virCPUDefPtr cpuHaswell; -virCPUDefPtr cpuPower8; -virCPUDefPtr cpuPower9; +virCPUDef *cpuDefault; +virCPUDef *cpuHaswell; +virCPUDef *cpuPower8; +virCPUDef *cpuPower9; static const char *qemu_emulators[VIR_ARCH_LAST] = { @@ -133,7 +133,7 @@ virFindFileInPath(const char *file) } -virCapsHostNUMAPtr +virCapsHostNUMA * virCapabilitiesHostNUMANewHost(void) { /* @@ -145,12 +145,12 @@ virCapabilitiesHostNUMANewHost(void) static int -testQemuAddGuest(virCapsPtr caps, +testQemuAddGuest(virCaps *caps, virArch arch) { size_t nmachines; - virCapsGuestMachinePtr *machines = NULL; - virCapsGuestPtr guest; + virCapsGuestMachine **machines = NULL; + virCapsGuest *guest; virArch emu_arch = arch; if (arch_alias[arch] != VIR_ARCH_NONE) @@ -213,9 +213,9 @@ testQemuAddGuest(virCapsPtr caps, } -virCapsPtr testQemuCapsInit(void) +virCaps *testQemuCapsInit(void) { - virCapsPtr caps; + virCaps *caps; size_t i; if (!(caps = virCapabilitiesNew(VIR_ARCH_X86_64, false, false))) @@ -257,7 +257,7 @@ virCapsPtr testQemuCapsInit(void) void -qemuTestSetHostArch(virQEMUDriverPtr driver, +qemuTestSetHostArch(virQEMUDriver *driver, virArch arch) { if (arch == VIR_ARCH_NONE) @@ -271,9 +271,9 @@ qemuTestSetHostArch(virQEMUDriverPtr driver, void -qemuTestSetHostCPU(virQEMUDriverPtr driver, +qemuTestSetHostCPU(virQEMUDriver *driver, virArch arch, - virCPUDefPtr cpu) + virCPUDef *cpu) { if (!cpu) { if (ARCH_IS_X86(arch)) @@ -300,11 +300,11 @@ qemuTestSetHostCPU(virQEMUDriverPtr driver, } -virQEMUCapsPtr +virQEMUCaps * qemuTestParseCapabilitiesArch(virArch arch, const char *capsFile) { - virQEMUCapsPtr qemuCaps = NULL; + virQEMUCaps *qemuCaps = NULL; g_autofree char *binary = g_strdup_printf("/usr/bin/qemu-system-%s", virArchToString(arch)); @@ -334,13 +334,13 @@ void qemuTestDriverFree(virQEMUDriver *driver) virObjectUnref(driver->securityManager); } -int qemuTestCapsCacheInsert(virFileCachePtr cache, - virQEMUCapsPtr caps) +int qemuTestCapsCacheInsert(virFileCache *cache, + virQEMUCaps *caps) { size_t i, j; for (i = 0; i < G_N_ELEMENTS(qemu_emulators); i++) { - virQEMUCapsPtr tmpCaps; + virQEMUCaps *tmpCaps; if (qemu_emulators[i] == NULL) continue; if (caps) { @@ -410,7 +410,7 @@ int qemuTestCapsCacheInsert(virFileCachePtr cache, int qemuTestDriverInit(virQEMUDriver *driver) { - virSecurityManagerPtr mgr = NULL; + virSecurityManager *mgr = NULL; char statedir[] = STATEDIRTEMPLATE; char configdir[] = CONFIGDIRTEMPLATE; @@ -489,7 +489,7 @@ int qemuTestDriverInit(virQEMUDriver *driver) } int -testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps, +testQemuCapsSetGIC(virQEMUCaps *qemuCaps, int gic) { virGICCapability *gicCapabilities = NULL; @@ -686,7 +686,7 @@ testQemuInfoSetArgs(struct testQemuInfo *info, { va_list argptr; testQemuInfoArgName argname; - virQEMUCapsPtr qemuCaps = NULL; + virQEMUCaps *qemuCaps = NULL; int gic = GIC_NONE; char *capsarch = NULL; char *capsver = NULL; @@ -774,7 +774,7 @@ testQemuInfoSetArgs(struct testQemuInfo *info, if (!qemuCaps && capsarch && capsver) { bool stripmachinealiases = false; - virQEMUCapsPtr cachedcaps = NULL; + virQEMUCaps *cachedcaps = NULL; info->arch = virArchFromString(capsarch); diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index e1b386f234..2e9ce8ec62 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -59,7 +59,7 @@ struct testQemuInfo { char *infile; char *outfile; char *errfile; - virQEMUCapsPtr qemuCaps; + virQEMUCaps *qemuCaps; const char *migrateFrom; int migrateFd; unsigned int flags; @@ -69,30 +69,30 @@ struct testQemuInfo { GHashTable *qapiSchemaCache; }; -virCapsPtr testQemuCapsInit(void); -virDomainXMLOptionPtr testQemuXMLConfInit(void); +virCaps *testQemuCapsInit(void); +virDomainXMLOption *testQemuXMLConfInit(void); -virQEMUCapsPtr qemuTestParseCapabilitiesArch(virArch arch, +virQEMUCaps *qemuTestParseCapabilitiesArch(virArch arch, const char *capsFile); -extern virCPUDefPtr cpuDefault; -extern virCPUDefPtr cpuHaswell; -extern virCPUDefPtr cpuPower8; -extern virCPUDefPtr cpuPower9; +extern virCPUDef *cpuDefault; +extern virCPUDef *cpuHaswell; +extern virCPUDef *cpuPower8; +extern virCPUDef *cpuPower9; -void qemuTestSetHostArch(virQEMUDriverPtr driver, +void qemuTestSetHostArch(virQEMUDriver *driver, virArch arch); -void qemuTestSetHostCPU(virQEMUDriverPtr driver, +void qemuTestSetHostCPU(virQEMUDriver *driver, virArch arch, - virCPUDefPtr cpu); + virCPUDef *cpu); int qemuTestDriverInit(virQEMUDriver *driver); void qemuTestDriverFree(virQEMUDriver *driver); -int qemuTestCapsCacheInsert(virFileCachePtr cache, - virQEMUCapsPtr caps); +int qemuTestCapsCacheInsert(virFileCache *cache, + virQEMUCaps *caps); -int testQemuCapsSetGIC(virQEMUCapsPtr qemuCaps, +int testQemuCapsSetGIC(virQEMUCaps *qemuCaps, int gic); char *testQemuGetLatestCapsForArch(const char *arch, diff --git a/tests/testutilsqemuschema.c b/tests/testutilsqemuschema.c index a842a219e2..f6347231a8 100644 --- a/tests/testutilsqemuschema.c +++ b/tests/testutilsqemuschema.c @@ -23,19 +23,19 @@ struct testQEMUSchemaValidateCtxt { GHashTable *schema; - virBufferPtr debug; + virBuffer *debug; bool allowDeprecated; }; static int -testQEMUSchemaValidateRecurse(virJSONValuePtr obj, - virJSONValuePtr root, +testQEMUSchemaValidateRecurse(virJSONValue *obj, + virJSONValue *root, struct testQEMUSchemaValidateCtxt *ctxt); static int -testQEMUSchemaValidateBuiltin(virJSONValuePtr obj, - virJSONValuePtr root, +testQEMUSchemaValidateBuiltin(virJSONValue *obj, + virJSONValue *root, struct testQEMUSchemaValidateCtxt *ctxt) { const char *t = virJSONValueObjectGetString(root, "json-type"); @@ -95,18 +95,18 @@ testQEMUSchemaValidateBuiltin(virJSONValuePtr obj, } struct testQEMUSchemaValidateObjectMemberData { - virJSONValuePtr rootmembers; + virJSONValue *rootmembers; struct testQEMUSchemaValidateCtxt *ctxt; bool missingMandatory; }; -static virJSONValuePtr +static virJSONValue * testQEMUSchemaStealObjectMemberByName(const char *name, - virJSONValuePtr members) + virJSONValue *members) { - virJSONValuePtr member; - virJSONValuePtr ret = NULL; + virJSONValue *member; + virJSONValue *ret = NULL; size_t i; for (i = 0; i < virJSONValueArraySize(members); i++) { @@ -124,13 +124,13 @@ testQEMUSchemaStealObjectMemberByName(const char *name, static int testQEMUSchemaValidateObjectMember(const char *key, - virJSONValuePtr value, + virJSONValue *value, void *opaque) { struct testQEMUSchemaValidateObjectMemberData *data = opaque; g_autoptr(virJSONValue) keymember = NULL; const char *keytype; - virJSONValuePtr keyschema = NULL; + virJSONValue *keyschema = NULL; int rc; virBufferStrcat(data->ctxt->debug, key, ": ", NULL); @@ -159,10 +159,10 @@ testQEMUSchemaValidateObjectMember(const char *key, static int testQEMUSchemaValidateObjectMergeVariantMember(size_t pos G_GNUC_UNUSED, - virJSONValuePtr item, + virJSONValue *item, void *opaque) { - virJSONValuePtr array = opaque; + virJSONValue *array = opaque; g_autoptr(virJSONValue) copy = NULL; if (!(copy = virJSONValueCopy(item))) @@ -182,17 +182,17 @@ testQEMUSchemaValidateObjectMergeVariantMember(size_t pos G_GNUC_UNUSED, * 'variants' array from @root. */ static int -testQEMUSchemaValidateObjectMergeVariant(virJSONValuePtr root, +testQEMUSchemaValidateObjectMergeVariant(virJSONValue *root, const char *variantfield, const char *variantname, struct testQEMUSchemaValidateCtxt *ctxt) { size_t i; g_autoptr(virJSONValue) variants = NULL; - virJSONValuePtr variant; - virJSONValuePtr variantschema; - virJSONValuePtr variantschemamembers; - virJSONValuePtr rootmembers; + virJSONValue *variant; + virJSONValue *variantschema; + virJSONValue *variantschemamembers; + virJSONValue *rootmembers; const char *varianttype = NULL; if (!(variants = virJSONValueObjectStealArray(root, "variants"))) { @@ -238,7 +238,7 @@ testQEMUSchemaValidateObjectMergeVariant(virJSONValuePtr root, static int testQEMUSchemaValidateObjectMandatoryMember(size_t pos G_GNUC_UNUSED, - virJSONValuePtr item, + virJSONValue *item, void *opaque G_GNUC_UNUSED) { struct testQEMUSchemaValidateObjectMemberData *data = opaque; @@ -254,8 +254,8 @@ testQEMUSchemaValidateObjectMandatoryMember(size_t pos G_GNUC_UNUSED, static int -testQEMUSchemaValidateObject(virJSONValuePtr obj, - virJSONValuePtr root, +testQEMUSchemaValidateObject(virJSONValue *obj, + virJSONValue *root, struct testQEMUSchemaValidateCtxt *ctxt) { struct testQEMUSchemaValidateObjectMemberData data = { NULL, ctxt, false }; @@ -313,13 +313,13 @@ testQEMUSchemaValidateObject(virJSONValuePtr obj, static int -testQEMUSchemaValidateEnum(virJSONValuePtr obj, - virJSONValuePtr root, +testQEMUSchemaValidateEnum(virJSONValue *obj, + virJSONValue *root, struct testQEMUSchemaValidateCtxt *ctxt) { const char *objstr; - virJSONValuePtr values = NULL; - virJSONValuePtr value; + virJSONValue *values = NULL; + virJSONValue *value; size_t i; if (virJSONValueGetType(obj) != VIR_JSON_TYPE_STRING) { @@ -351,13 +351,13 @@ testQEMUSchemaValidateEnum(virJSONValuePtr obj, static int -testQEMUSchemaValidateArray(virJSONValuePtr objs, - virJSONValuePtr root, +testQEMUSchemaValidateArray(virJSONValue *objs, + virJSONValue *root, struct testQEMUSchemaValidateCtxt *ctxt) { const char *elemtypename = virJSONValueObjectGetString(root, "element-type"); - virJSONValuePtr elementschema; - virJSONValuePtr obj; + virJSONValue *elementschema; + virJSONValue *obj; size_t i; if (virJSONValueGetType(objs) != VIR_JSON_TYPE_ARRAY) { @@ -389,16 +389,16 @@ testQEMUSchemaValidateArray(virJSONValuePtr objs, } static int -testQEMUSchemaValidateAlternate(virJSONValuePtr obj, - virJSONValuePtr root, +testQEMUSchemaValidateAlternate(virJSONValue *obj, + virJSONValue *root, struct testQEMUSchemaValidateCtxt *ctxt) { - virJSONValuePtr members; - virJSONValuePtr member; + virJSONValue *members; + virJSONValue *member; size_t i; size_t n; const char *membertype; - virJSONValuePtr memberschema; + virJSONValue *memberschema; int indent; int rc; @@ -446,11 +446,11 @@ testQEMUSchemaValidateAlternate(virJSONValuePtr obj, static int -testQEMUSchemaValidateDeprecated(virJSONValuePtr root, +testQEMUSchemaValidateDeprecated(virJSONValue *root, const char *name, struct testQEMUSchemaValidateCtxt *ctxt) { - virJSONValuePtr features = virJSONValueObjectGetArray(root, "features"); + virJSONValue *features = virJSONValueObjectGetArray(root, "features"); size_t nfeatures; size_t i; @@ -460,7 +460,7 @@ testQEMUSchemaValidateDeprecated(virJSONValuePtr root, nfeatures = virJSONValueArraySize(features); for (i = 0; i < nfeatures; i++) { - virJSONValuePtr cur = virJSONValueArrayGet(features, i); + virJSONValue *cur = virJSONValueArrayGet(features, i); const char *curstr; if (!cur || @@ -487,8 +487,8 @@ testQEMUSchemaValidateDeprecated(virJSONValuePtr root, static int -testQEMUSchemaValidateRecurse(virJSONValuePtr obj, - virJSONValuePtr root, +testQEMUSchemaValidateRecurse(virJSONValue *obj, + virJSONValue *root, struct testQEMUSchemaValidateCtxt *ctxt) { const char *n = virJSONValueObjectGetString(root, "name"); @@ -531,11 +531,11 @@ testQEMUSchemaValidateRecurse(virJSONValuePtr obj, * @debug is filled with information regarding the validation process */ int -testQEMUSchemaValidate(virJSONValuePtr obj, - virJSONValuePtr root, +testQEMUSchemaValidate(virJSONValue *obj, + virJSONValue *root, GHashTable *schema, bool allowDeprecated, - virBufferPtr debug) + virBuffer *debug) { struct testQEMUSchemaValidateCtxt ctxt = { .schema = schema, .debug = debug, @@ -567,19 +567,19 @@ testQEMUSchemaValidate(virJSONValuePtr obj, */ int testQEMUSchemaValidateCommand(const char *command, - virJSONValuePtr arguments, + virJSONValue *arguments, GHashTable *schema, bool allowDeprecated, bool allowRemoved, - virBufferPtr debug) + virBuffer *debug) { struct testQEMUSchemaValidateCtxt ctxt = { .schema = schema, .debug = debug, .allowDeprecated = allowDeprecated }; g_autofree char *schemapatharguments = g_strdup_printf("%s/arg-type", command); g_autoptr(virJSONValue) emptyargs = NULL; - virJSONValuePtr schemarootcommand; - virJSONValuePtr schemarootarguments; + virJSONValue *schemarootcommand; + virJSONValue *schemarootarguments; int rc; if (virQEMUQAPISchemaPathGet(command, schema, &schemarootcommand) < 0 || @@ -629,7 +629,7 @@ testQEMUSchemaValidateCommand(const char *command, * members. */ int -testQEMUSchemaEntryMatchTemplate(virJSONValuePtr schemaentry, +testQEMUSchemaEntryMatchTemplate(virJSONValue *schemaentry, ...) { g_autoptr(virJSONValue) members = NULL; @@ -675,7 +675,7 @@ testQEMUSchemaEntryMatchTemplate(virJSONValuePtr schemaentry, } for (i = 0; i < virJSONValueArraySize(members); i++) { - virJSONValuePtr member = virJSONValueArrayGet(members, i); + virJSONValue *member = virJSONValueArrayGet(members, i); const char *membername = virJSONValueObjectGetString(member, "name"); const char *membertype = virJSONValueObjectGetString(member, "type"); @@ -722,14 +722,14 @@ testQEMUSchemaEntryMatchTemplate(virJSONValuePtr schemaentry, } -static virJSONValuePtr +static virJSONValue * testQEMUSchemaLoadReplies(const char *filename) { g_autofree char *caps = NULL; char *schemaReply; char *end; g_autoptr(virJSONValue) reply = NULL; - virJSONValuePtr schema = NULL; + virJSONValue *schema = NULL; if (virTestLoadFile(filename, &caps) < 0) return NULL; @@ -767,7 +767,7 @@ testQEMUSchemaLoadReplies(const char *filename) * Returns the schema data as the qemu monitor would reply from the latest * replies file used for qemucapabilitiestest for the x86_64 architecture. */ -virJSONValuePtr +virJSONValue * testQEMUSchemaGetLatest(const char *arch) { g_autofree char *capsLatestFile = NULL; @@ -786,7 +786,7 @@ testQEMUSchemaGetLatest(const char *arch) GHashTable * testQEMUSchemaLoadLatest(const char *arch) { - virJSONValuePtr schema; + virJSONValue *schema; if (!(schema = testQEMUSchemaGetLatest(arch))) return NULL; @@ -798,7 +798,7 @@ testQEMUSchemaLoadLatest(const char *arch) GHashTable * testQEMUSchemaLoad(const char *filename) { - virJSONValuePtr schema; + virJSONValue *schema; if (!(schema = testQEMUSchemaLoadReplies(filename))) return NULL; diff --git a/tests/testutilsqemuschema.h b/tests/testutilsqemuschema.h index 6790e96e5e..ba881a991a 100644 --- a/tests/testutilsqemuschema.h +++ b/tests/testutilsqemuschema.h @@ -23,26 +23,26 @@ #include "virbuffer.h" int -testQEMUSchemaValidate(virJSONValuePtr obj, - virJSONValuePtr root, +testQEMUSchemaValidate(virJSONValue *obj, + virJSONValue *root, GHashTable *schema, bool allowDeprecated, - virBufferPtr debug); + virBuffer *debug); int testQEMUSchemaValidateCommand(const char *command, - virJSONValuePtr arguments, + virJSONValue *arguments, GHashTable *schema, bool allowDeprecated, bool allowRemoved, - virBufferPtr debug); + virBuffer *debug); int -testQEMUSchemaEntryMatchTemplate(virJSONValuePtr schemaentry, +testQEMUSchemaEntryMatchTemplate(virJSONValue *schemaentry, ...); -virJSONValuePtr +virJSONValue * testQEMUSchemaGetLatest(const char* arch); GHashTable * diff --git a/tests/testutilsxen.c b/tests/testutilsxen.c index d50c3003da..09af6bffee 100644 --- a/tests/testutilsxen.c +++ b/tests/testutilsxen.c @@ -8,12 +8,12 @@ #define VIR_FROM_THIS VIR_FROM_LIBXL -static virCapsPtr +static virCaps * testXLInitCaps(void) { - virCapsPtr caps; - virCapsGuestPtr guest; - virCapsGuestMachinePtr *machines; + virCaps *caps; + virCapsGuest *guest; + virCapsGuestMachine **machines; int nmachines; static const char *const x86_machines[] = { "xenfv" @@ -83,9 +83,9 @@ testXLInitCaps(void) } -libxlDriverPrivatePtr testXLInitDriver(void) +libxlDriverPrivate *testXLInitDriver(void) { - libxlDriverPrivatePtr driver = g_new0(libxlDriverPrivate, 1); + libxlDriverPrivate *driver = g_new0(libxlDriverPrivate, 1); if (virMutexInit(&driver->lock) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, @@ -110,7 +110,7 @@ libxlDriverPrivatePtr testXLInitDriver(void) return driver; } -void testXLFreeDriver(libxlDriverPrivatePtr driver) +void testXLFreeDriver(libxlDriverPrivate *driver) { virObjectUnref(driver->config); virObjectUnref(driver->xmlopt); diff --git a/tests/testutilsxen.h b/tests/testutilsxen.h index a31d3d9047..6a41caf845 100644 --- a/tests/testutilsxen.h +++ b/tests/testutilsxen.h @@ -20,8 +20,8 @@ #ifdef WITH_LIBXL # include "libxl/libxl_conf.h" -libxlDriverPrivatePtr testXLInitDriver(void); +libxlDriverPrivate *testXLInitDriver(void); -void testXLFreeDriver(libxlDriverPrivatePtr driver); +void testXLFreeDriver(libxlDriverPrivate *driver); #endif /* WITH_LIBXL */ diff --git a/tests/vboxsnapshotxmltest.c b/tests/vboxsnapshotxmltest.c index e44ca7fc98..f5f8fe36b9 100644 --- a/tests/vboxsnapshotxmltest.c +++ b/tests/vboxsnapshotxmltest.c @@ -50,7 +50,7 @@ testCompareXMLtoXMLFiles(const char *xml) char *actual = NULL; char *pathResult = NULL; int ret = -1; - virVBoxSnapshotConfMachinePtr machine = NULL; + virVBoxSnapshotConfMachine *machine = NULL; pathResult = g_strdup(abs_builddir "/vboxsnapshotxmldata/testResult.vbox"); diff --git a/tests/virauthconfigtest.c b/tests/virauthconfigtest.c index 1bff3debb0..6fd7407b97 100644 --- a/tests/virauthconfigtest.c +++ b/tests/virauthconfigtest.c @@ -32,7 +32,7 @@ VIR_LOG_INIT("tests.authconfigtest"); struct ConfigLookupData { - virAuthConfigPtr config; + virAuthConfig *config; const char *hostname; const char *service; const char *credname; @@ -82,7 +82,7 @@ mymain(void) { int ret = 0; - virAuthConfigPtr config; + virAuthConfig *config; const char *confdata = "[credentials-test]\n" diff --git a/tests/virbitmaptest.c b/tests/virbitmaptest.c index 77a58f0176..a376a613db 100644 --- a/tests/virbitmaptest.c +++ b/tests/virbitmaptest.c @@ -28,7 +28,7 @@ static int -checkBitmap(virBitmapPtr map, +checkBitmap(virBitmap *map, const char *expect, ssize_t expectedSize) { @@ -82,7 +82,7 @@ test1(const void *data G_GNUC_UNUSED) } static int -testBit(virBitmapPtr bitmap, +testBit(virBitmap *bitmap, unsigned int start, unsigned int end, bool expected) diff --git a/tests/virbuftest.c b/tests/virbuftest.c index df341be50c..977e0883a6 100644 --- a/tests/virbuftest.c +++ b/tests/virbuftest.c @@ -18,7 +18,7 @@ struct testBufAddStrData { static int testBufAutoIndent(const void *data G_GNUC_UNUSED) { g_auto(virBuffer) bufinit = VIR_BUFFER_INITIALIZER; - virBufferPtr buf = &bufinit; + virBuffer *buf = &bufinit; const char expected[] = " 1\n 2\n 3\n 4\n 5\n 6\n 7\n &\n 8\n 9\n 10\n ' 11'\n"; g_autofree char *result = NULL; @@ -97,7 +97,7 @@ static int testBufAutoIndent(const void *data G_GNUC_UNUSED) static int testBufTrim(const void *data G_GNUC_UNUSED) { g_auto(virBuffer) bufinit = VIR_BUFFER_INITIALIZER; - virBufferPtr buf = NULL; + virBuffer *buf = NULL; g_autofree char *result = NULL; const char *expected = "a,b"; diff --git a/tests/vircaps2xmltest.c b/tests/vircaps2xmltest.c index 17cd600a7a..ead3fb88ff 100644 --- a/tests/vircaps2xmltest.c +++ b/tests/vircaps2xmltest.c @@ -38,7 +38,7 @@ test_virCapabilities(const void *opaque) { struct virCapabilitiesData *data = (struct virCapabilitiesData *) opaque; const char *archStr = virArchToString(data->arch); - virCapsPtr caps = NULL; + virCaps *caps = NULL; char *capsXML = NULL; char *path = NULL; char *system = NULL; diff --git a/tests/vircapstest.c b/tests/vircapstest.c index 08eb017a76..9299b42bf3 100644 --- a/tests/vircapstest.c +++ b/tests/vircapstest.c @@ -33,8 +33,8 @@ static int test_virCapabilitiesGetCpusForNodemask(const void *data G_GNUC_UNUSED) { const char *nodestr = "3,4,5,6"; - virBitmapPtr nodemask = NULL; - virBitmapPtr cpumap = NULL; + virBitmap *nodemask = NULL; + virBitmap *cpumap = NULL; g_autoptr(virCapsHostNUMA) caps = NULL; int mask_size = 8; int ret = -1; @@ -59,14 +59,14 @@ test_virCapabilitiesGetCpusForNodemask(const void *data G_GNUC_UNUSED) static bool G_GNUC_UNUSED -doCapsExpectFailure(virCapsPtr caps, +doCapsExpectFailure(virCaps *caps, int ostype, virArch arch, int domaintype, const char *emulator, const char *machinetype) { - virCapsDomainDataPtr data = virCapabilitiesDomainDataLookup(caps, ostype, + virCapsDomainData *data = virCapabilitiesDomainDataLookup(caps, ostype, arch, domaintype, emulator, machinetype); if (data) { @@ -78,7 +78,7 @@ doCapsExpectFailure(virCapsPtr caps, } static bool G_GNUC_UNUSED -doCapsCompare(virCapsPtr caps, +doCapsCompare(virCaps *caps, int ostype, virArch arch, int domaintype, @@ -91,7 +91,7 @@ doCapsCompare(virCapsPtr caps, const char *expect_machinetype) { bool ret = false; - virCapsDomainDataPtr data = virCapabilitiesDomainDataLookup(caps, ostype, + virCapsDomainData *data = virCapabilitiesDomainDataLookup(caps, ostype, arch, domaintype, emulator, machinetype); if (!data) @@ -151,7 +151,7 @@ static int test_virCapsDomainDataLookupQEMU(const void *data G_GNUC_UNUSED) { int ret = 0; - virCapsPtr caps = NULL; + virCaps *caps = NULL; if (!(caps = testQemuCapsInit())) { ret = -1; @@ -210,7 +210,7 @@ static int test_virCapsDomainDataLookupLXC(const void *data G_GNUC_UNUSED) { int ret = 0; - virCapsPtr caps = NULL; + virCaps *caps = NULL; if (!(caps = testLXCCapsInit())) { ret = -1; diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c index 5d7badc44a..a67c0d95d7 100644 --- a/tests/vircgroupmock.c +++ b/tests/vircgroupmock.c @@ -595,7 +595,7 @@ int open(const char *path, int flags, ...) } bool -virCgroupV2DevicesAvailable(virCgroupPtr group G_GNUC_UNUSED) +virCgroupV2DevicesAvailable(virCgroup *group G_GNUC_UNUSED) { return true; } diff --git a/tests/vircgrouptest.c b/tests/vircgrouptest.c index 85c5a6ebd4..1060f6073e 100644 --- a/tests/vircgrouptest.c +++ b/tests/vircgrouptest.c @@ -37,7 +37,7 @@ VIR_LOG_INIT("tests.cgrouptest"); -static int validateCgroup(virCgroupPtr cgroup, +static int validateCgroup(virCgroup *cgroup, const char **expectMountPoint, const char **expectLinkPoint, const char **expectPlacement, diff --git a/tests/virconftest.c b/tests/virconftest.c index 7a759db014..52f68287d6 100644 --- a/tests/virconftest.c +++ b/tests/virconftest.c @@ -68,7 +68,7 @@ static int testConfMemoryNoNewline(const void *opaque G_GNUC_UNUSED) g_autoptr(virConf) conf = virConfReadString(srcdata, 0); int ret = -1; - virConfValuePtr val; + virConfValue *val; unsigned long long llvalue; char *str = NULL; int uintvalue; diff --git a/tests/virfilecachetest.c b/tests/virfilecachetest.c index 4d65c0c6ce..3083aee35d 100644 --- a/tests/virfilecachetest.c +++ b/tests/virfilecachetest.c @@ -33,16 +33,15 @@ struct _testFileCacheObj { char *data; }; typedef struct _testFileCacheObj testFileCacheObj; -typedef testFileCacheObj *testFileCacheObjPtr; -static virClassPtr testFileCacheObjClass; +static virClass *testFileCacheObjClass; static void testFileCacheObjDispose(void *opaque) { - testFileCacheObjPtr obj = opaque; + testFileCacheObj *obj = opaque; g_free(obj->data); } @@ -60,10 +59,10 @@ testFileCacheObjOnceInit(void) VIR_ONCE_GLOBAL_INIT(testFileCacheObj); -static testFileCacheObjPtr +static testFileCacheObj * testFileCacheObjNew(const char *data) { - testFileCacheObjPtr obj; + testFileCacheObj *obj; if (testFileCacheObjInitialize() < 0) return NULL; @@ -83,15 +82,14 @@ struct _testFileCachePriv { const char *expectData; }; typedef struct _testFileCachePriv testFileCachePriv; -typedef testFileCachePriv *testFileCachePrivPtr; static bool testFileCacheIsValid(void *data, void *priv) { - testFileCachePrivPtr testPriv = priv; - testFileCacheObjPtr obj = data; + testFileCachePriv *testPriv = priv; + testFileCacheObj *obj = data; return STREQ(testPriv->expectData, obj->data); } @@ -101,7 +99,7 @@ static void * testFileCacheNewData(const char *name G_GNUC_UNUSED, void *priv) { - testFileCachePrivPtr testPriv = priv; + testFileCachePriv *testPriv = priv; return testFileCacheObjNew(testPriv->newData); } @@ -113,7 +111,7 @@ testFileCacheLoadFile(const char *filename, void *priv G_GNUC_UNUSED, bool *outdated G_GNUC_UNUSED) { - testFileCacheObjPtr obj; + testFileCacheObj *obj; char *data; if (virFileReadAll(filename, 20, &data) < 0) @@ -131,7 +129,7 @@ testFileCacheSaveFile(void *data G_GNUC_UNUSED, const char *filename G_GNUC_UNUSED, void *priv) { - testFileCachePrivPtr testPriv = priv; + testFileCachePriv *testPriv = priv; testPriv->dataSaved = true; @@ -148,14 +146,13 @@ virFileCacheHandlers testFileCacheHandlers = { struct _testFileCacheData { - virFileCachePtr cache; + virFileCache *cache; const char *name; const char *newData; const char *expectData; bool expectSave; }; typedef struct _testFileCacheData testFileCacheData; -typedef testFileCacheData *testFileCacheDataPtr; static int @@ -163,8 +160,8 @@ testFileCache(const void *opaque) { int ret = -1; const testFileCacheData *data = opaque; - testFileCacheObjPtr obj = NULL; - testFileCachePrivPtr testPriv = virFileCacheGetPriv(data->cache); + testFileCacheObj *obj = NULL; + testFileCachePriv *testPriv = virFileCacheGetPriv(data->cache); testPriv->dataSaved = false; testPriv->newData = data->newData; @@ -201,7 +198,7 @@ mymain(void) { int ret = 0; testFileCachePriv testPriv = {0}; - virFileCachePtr cache = NULL; + virFileCache *cache = NULL; if (!(cache = virFileCacheNew(abs_srcdir "/virfilecachedata", "cache", &testFileCacheHandlers))) diff --git a/tests/virfirewalltest.c b/tests/virfirewalltest.c index ba44201fa2..8e65fa8524 100644 --- a/tests/virfirewalltest.c +++ b/tests/virfirewalltest.c @@ -36,7 +36,7 @@ # define VIR_FROM_THIS VIR_FROM_FIREWALL static bool fwDisabled = true; -static virBufferPtr fwBuf; +static virBuffer *fwBuf; static bool fwError; # define TEST_FILTER_TABLE_LIST \ @@ -242,7 +242,7 @@ testFirewallRemoveRule(const void *opaque) IPTABLES_PATH " -w -A INPUT --source 192.168.122.1 --jump ACCEPT\n" IPTABLES_PATH " -w -A INPUT --source '!192.168.122.1' --jump REJECT\n"; const struct testFirewallData *data = opaque; - virFirewallRulePtr fwrule; + virFirewallRule *fwrule; g_autoptr(virCommandDryRunToken) dryRunToken = virCommandDryRunTokenNew(); fwDisabled = data->fwDisabled; @@ -907,7 +907,7 @@ testFirewallQueryHook(const char *const*args, static int -testFirewallQueryCallback(virFirewallPtr fw, +testFirewallQueryCallback(virFirewall *fw, virFirewallLayer layer, const char *const *lines, void *opaque G_GNUC_UNUSED) diff --git a/tests/virhostcputest.c b/tests/virhostcputest.c index 2608f0becc..9e329b38b4 100644 --- a/tests/virhostcputest.c +++ b/tests/virhostcputest.c @@ -74,7 +74,7 @@ linuxTestCompareFiles(const char *cpuinfofile, static int -linuxCPUStatsToBuf(virBufferPtr buf, +linuxCPUStatsToBuf(virBuffer *buf, int cpu, virNodeCPUStatsPtr param, size_t nparams) diff --git a/tests/virhostdevtest.c b/tests/virhostdevtest.c index d3c0bca1c0..b9e16dd4e8 100644 --- a/tests/virhostdevtest.c +++ b/tests/virhostdevtest.c @@ -57,11 +57,11 @@ static const char *dom_name = "test_domain"; static const unsigned char *uuid = (unsigned char *)("f92360b0-2541-8791-fb32-d1f838811541"); static int nhostdevs = 3; -static virDomainHostdevDefPtr hostdevs[] = {NULL, NULL, NULL}; -static virPCIDevicePtr dev[] = {NULL, NULL, NULL}; -static virHostdevManagerPtr mgr; +static virDomainHostdevDef *hostdevs[] = {NULL, NULL, NULL}; +static virPCIDevice *dev[] = {NULL, NULL, NULL}; +static virHostdevManager *mgr; static const size_t ndisks = 3; -static virDomainDiskDefPtr disks[] = {NULL, NULL, NULL}; +static virDomainDiskDef *disks[] = {NULL, NULL, NULL}; static const char *diskXML[] = { "" " " diff --git a/tests/virjsontest.c b/tests/virjsontest.c index 77ca6b449b..5e26de1f22 100644 --- a/tests/virjsontest.c +++ b/tests/virjsontest.c @@ -177,7 +177,7 @@ testJSONLookup(const void *data) { const struct testInfo *info = data; g_autoptr(virJSONValue) json = NULL; - virJSONValuePtr value = NULL; + virJSONValue *value = NULL; g_autofree char *result = NULL; int rc; int number; diff --git a/tests/virkmodtest.c b/tests/virkmodtest.c index b2dfecb42c..2a85e0ae6d 100644 --- a/tests/virkmodtest.c +++ b/tests/virkmodtest.c @@ -32,7 +32,7 @@ # define VIR_FROM_THIS VIR_FROM_NONE static int -checkOutput(virBufferPtr buf, const char *exp_cmd) +checkOutput(virBuffer *buf, const char *exp_cmd) { int ret = -1; char *actual_cmd = NULL; diff --git a/tests/virlockspacetest.c b/tests/virlockspacetest.c index 82aef8bc2b..109edf34d5 100644 --- a/tests/virlockspacetest.c +++ b/tests/virlockspacetest.c @@ -39,7 +39,7 @@ VIR_LOG_INIT("tests.lockspacetest"); static int testLockSpaceCreate(const void *args G_GNUC_UNUSED) { - virLockSpacePtr lockspace; + virLockSpace *lockspace; int ret = -1; rmdir(LOCKSPACE_DIR); @@ -61,7 +61,7 @@ static int testLockSpaceCreate(const void *args G_GNUC_UNUSED) static int testLockSpaceResourceLifecycle(const void *args G_GNUC_UNUSED) { - virLockSpacePtr lockspace; + virLockSpace *lockspace; int ret = -1; rmdir(LOCKSPACE_DIR); @@ -95,7 +95,7 @@ static int testLockSpaceResourceLifecycle(const void *args G_GNUC_UNUSED) static int testLockSpaceResourceLockExcl(const void *args G_GNUC_UNUSED) { - virLockSpacePtr lockspace; + virLockSpace *lockspace; int ret = -1; rmdir(LOCKSPACE_DIR); @@ -141,7 +141,7 @@ static int testLockSpaceResourceLockExcl(const void *args G_GNUC_UNUSED) static int testLockSpaceResourceLockExclAuto(const void *args G_GNUC_UNUSED) { - virLockSpacePtr lockspace; + virLockSpace *lockspace; int ret = -1; rmdir(LOCKSPACE_DIR); @@ -179,7 +179,7 @@ static int testLockSpaceResourceLockExclAuto(const void *args G_GNUC_UNUSED) static int testLockSpaceResourceLockShr(const void *args G_GNUC_UNUSED) { - virLockSpacePtr lockspace; + virLockSpace *lockspace; int ret = -1; rmdir(LOCKSPACE_DIR); @@ -233,7 +233,7 @@ static int testLockSpaceResourceLockShr(const void *args G_GNUC_UNUSED) static int testLockSpaceResourceLockShrAuto(const void *args G_GNUC_UNUSED) { - virLockSpacePtr lockspace; + virLockSpace *lockspace; int ret = -1; rmdir(LOCKSPACE_DIR); @@ -293,7 +293,7 @@ static int testLockSpaceResourceLockShrAuto(const void *args G_GNUC_UNUSED) static int testLockSpaceResourceLockPath(const void *args G_GNUC_UNUSED) { - virLockSpacePtr lockspace; + virLockSpace *lockspace; int ret = -1; rmdir(LOCKSPACE_DIR); diff --git a/tests/virlogtest.c b/tests/virlogtest.c index ea7fd5e2a4..44d71015d5 100644 --- a/tests/virlogtest.c +++ b/tests/virlogtest.c @@ -48,7 +48,7 @@ testLogParseOutputs(const void *opaque) { int ret = -1; int noutputs; - virLogOutputPtr *outputs = NULL; + virLogOutput **outputs = NULL; const struct testLogData *data = opaque; noutputs = virLogParseOutputs(data->str, &outputs); @@ -80,7 +80,7 @@ testLogParseFilters(const void *opaque) { int ret = -1; int nfilters; - virLogFilterPtr *filters = NULL; + virLogFilter **filters = NULL; const struct testLogData *data = opaque; nfilters = virLogParseFilters(data->str, &filters); diff --git a/tests/virmacmaptest.c b/tests/virmacmaptest.c index 77fa2b3e98..1b536af1ab 100644 --- a/tests/virmacmaptest.c +++ b/tests/virmacmaptest.c @@ -27,7 +27,7 @@ struct testData { const char *file; const char *domain; const char * const * macs; - virMacMapPtr mgr; + virMacMap *mgr; }; @@ -35,7 +35,7 @@ static int testMACLookup(const void *opaque) { const struct testData *data = opaque; - virMacMapPtr mgr = NULL; + virMacMap *mgr = NULL; GSList *macs; GSList *next; size_t i, j; @@ -88,7 +88,7 @@ static int testMACRemove(const void *opaque) { const struct testData *data = opaque; - virMacMapPtr mgr = NULL; + virMacMap *mgr = NULL; GSList *macs; size_t i; char *file = NULL; @@ -150,7 +150,7 @@ static int mymain(void) { int ret = 0; - virMacMapPtr mgr = NULL; + virMacMap *mgr = NULL; #define DO_TEST_BASIC(f, d, ...) \ do { \ diff --git a/tests/virnetdaemontest.c b/tests/virnetdaemontest.c index c77c21611f..ce0384f026 100644 --- a/tests/virnetdaemontest.c +++ b/tests/virnetdaemontest.c @@ -33,7 +33,7 @@ struct testClientPriv { static void * -testClientNew(virNetServerClientPtr client G_GNUC_UNUSED, +testClientNew(virNetServerClient *client G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { struct testClientPriv *priv; @@ -46,8 +46,8 @@ testClientNew(virNetServerClientPtr client G_GNUC_UNUSED, } -static virJSONValuePtr -testClientPreExec(virNetServerClientPtr client G_GNUC_UNUSED, +static virJSONValue * +testClientPreExec(virNetServerClient *client G_GNUC_UNUSED, void *data) { struct testClientPriv *priv = data; @@ -57,8 +57,8 @@ testClientPreExec(virNetServerClientPtr client G_GNUC_UNUSED, static void * -testClientNewPostExec(virNetServerClientPtr client, - virJSONValuePtr object, +testClientNewPostExec(virNetServerClient *client, + virJSONValue *object, void *opaque) { int magic; @@ -80,16 +80,16 @@ testClientFree(void *opaque) } -static virNetServerPtr +static virNetServer * testCreateServer(const char *server_name, const char *host, int family) { - virNetServerPtr srv = NULL; - virNetServerServicePtr svc1 = NULL; - virNetServerServicePtr svc2 = NULL; - virNetServerClientPtr cln1 = NULL; - virNetServerClientPtr cln2 = NULL; - virNetSocketPtr sk1 = NULL; - virNetSocketPtr sk2 = NULL; + virNetServer *srv = NULL; + virNetServerService *svc1 = NULL; + virNetServerService *svc2 = NULL; + virNetServerClient *cln1 = NULL; + virNetServerClient *cln2 = NULL; + virNetSocket *sk1 = NULL; + virNetSocket *sk2 = NULL; int fdclient[2]; if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdclient) < 0) { @@ -186,9 +186,9 @@ testCreateServer(const char *server_name, const char *host, int family) static char *testGenerateJSON(const char *server_name) { - virNetDaemonPtr dmn = NULL; - virNetServerPtr srv = NULL; - virJSONValuePtr json = NULL; + virNetDaemon *dmn = NULL; + virNetServer *srv = NULL; + virJSONValue *json = NULL; char *jsonstr = NULL; bool has_ipv4, has_ipv6; @@ -240,10 +240,10 @@ struct testExecRestartData { bool pass; }; -static virNetServerPtr -testNewServerPostExecRestart(virNetDaemonPtr dmn G_GNUC_UNUSED, +static virNetServer * +testNewServerPostExecRestart(virNetDaemon *dmn G_GNUC_UNUSED, const char *name, - virJSONValuePtr object, + virJSONValue *object, void *opaque) { struct testExecRestartData *data = opaque; @@ -268,12 +268,12 @@ static int testExecRestart(const void *opaque) { size_t i; int ret = -1; - virNetDaemonPtr dmn = NULL; + virNetDaemon *dmn = NULL; const struct testExecRestartData *data = opaque; char *infile = NULL, *outfile = NULL; char *injsonstr = NULL, *outjsonstr = NULL; - virJSONValuePtr injson = NULL; - virJSONValuePtr outjson = NULL; + virJSONValue *injson = NULL; + virJSONValue *outjson = NULL; int fdclient[2] = { -1, -1 }, fdserver[2] = { -1, -1 }; if (socketpair(PF_UNIX, SOCK_STREAM, 0, fdclient) < 0) { diff --git a/tests/virnetmessagetest.c b/tests/virnetmessagetest.c index 9f6115f226..386c339c2c 100644 --- a/tests/virnetmessagetest.c +++ b/tests/virnetmessagetest.c @@ -33,7 +33,7 @@ VIR_LOG_INIT("tests.netmessagetest"); static int testMessageHeaderEncode(const void *args G_GNUC_UNUSED) { - virNetMessagePtr msg = virNetMessageNew(true); + virNetMessage *msg = virNetMessageNew(true); static const char expect[] = { 0x00, 0x00, 0x00, 0x1c, /* Length */ 0x11, 0x22, 0x33, 0x44, /* Program */ @@ -86,7 +86,7 @@ static int testMessageHeaderEncode(const void *args G_GNUC_UNUSED) static int testMessageHeaderDecode(const void *args G_GNUC_UNUSED) { - virNetMessagePtr msg = virNetMessageNew(true); + virNetMessage *msg = virNetMessageNew(true); static char input_buf [] = { 0x00, 0x00, 0x00, 0x1c, /* Length */ 0x11, 0x22, 0x33, 0x44, /* Program */ @@ -182,7 +182,7 @@ static int testMessageHeaderDecode(const void *args G_GNUC_UNUSED) static int testMessagePayloadEncode(const void *args G_GNUC_UNUSED) { virNetMessageError err; - virNetMessagePtr msg = virNetMessageNew(true); + virNetMessage *msg = virNetMessageNew(true); int ret = -1; static const char expect[] = { 0x00, 0x00, 0x00, 0x74, /* Length */ @@ -290,7 +290,7 @@ static int testMessagePayloadEncode(const void *args G_GNUC_UNUSED) static int testMessagePayloadDecode(const void *args G_GNUC_UNUSED) { virNetMessageError err; - virNetMessagePtr msg = virNetMessageNew(true); + virNetMessage *msg = virNetMessageNew(true); static char input_buffer[] = { 0x00, 0x00, 0x00, 0x74, /* Length */ 0x11, 0x22, 0x33, 0x44, /* Program */ @@ -453,7 +453,7 @@ static int testMessagePayloadDecode(const void *args G_GNUC_UNUSED) static int testMessagePayloadStreamEncode(const void *args G_GNUC_UNUSED) { char stream[] = "The quick brown fox jumps over the lazy dog"; - virNetMessagePtr msg = virNetMessageNew(true); + virNetMessage *msg = virNetMessageNew(true); static const char expect[] = { 0x00, 0x00, 0x00, 0x47, /* Length */ 0x11, 0x22, 0x33, 0x44, /* Program */ diff --git a/tests/virnetserverclientmock.c b/tests/virnetserverclientmock.c index d11c66af5d..277d6ce930 100644 --- a/tests/virnetserverclientmock.c +++ b/tests/virnetserverclientmock.c @@ -30,7 +30,7 @@ int virEventAddTimeout(int frequency G_GNUC_UNUSED, return 0; } -int virNetSocketGetUNIXIdentity(virNetSocketPtr sock G_GNUC_UNUSED, +int virNetSocketGetUNIXIdentity(virNetSocket *sock G_GNUC_UNUSED, uid_t *uid, gid_t *gid, pid_t *pid, @@ -53,7 +53,7 @@ char *virGetGroupName(gid_t gid G_GNUC_UNUSED) return strdup("fictionalusers"); } -int virNetSocketGetSELinuxContext(virNetSocketPtr sock G_GNUC_UNUSED, +int virNetSocketGetSELinuxContext(virNetSocket *sock G_GNUC_UNUSED, char **context) { if (!(*context = strdup("foo_u:bar_r:wizz_t:s0-s0:c0.c1023"))) diff --git a/tests/virnetserverclienttest.c b/tests/virnetserverclienttest.c index 959100ec66..942901bf60 100644 --- a/tests/virnetserverclienttest.c +++ b/tests/virnetserverclienttest.c @@ -27,7 +27,7 @@ #ifndef WIN32 static void * -testClientNew(virNetServerClientPtr client G_GNUC_UNUSED, +testClientNew(virNetServerClient *client G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) { char *dummy; @@ -48,8 +48,8 @@ static int testIdentity(const void *opaque G_GNUC_UNUSED) { int sv[2]; int ret = -1; - virNetSocketPtr sock = NULL; - virNetServerClientPtr client = NULL; + virNetSocket *sock = NULL; + virNetServerClient *client = NULL; g_autoptr(virIdentity) ident = NULL; const char *gotUsername = NULL; uid_t gotUserID; diff --git a/tests/virnetsockettest.c b/tests/virnetsockettest.c index 5216b98424..6afdcbdbc7 100644 --- a/tests/virnetsockettest.c +++ b/tests/virnetsockettest.c @@ -128,7 +128,7 @@ testSocketClient(void *opaque) { struct testClientData *data = opaque; char c; - virNetSocketPtr csock = NULL; + virNetSocket *csock = NULL; if (data->path) { if (virNetSocketNewConnectUNIX(data->path, false, @@ -158,11 +158,11 @@ testSocketClient(void *opaque) static void -testSocketIncoming(virNetSocketPtr sock, +testSocketIncoming(virNetSocket *sock, int events G_GNUC_UNUSED, void *opaque) { - virNetSocketPtr *retsock = opaque; + virNetSocket **retsock = opaque; VIR_DEBUG("Incoming sock=%p events=%d", sock, events); *retsock = sock; } @@ -178,10 +178,10 @@ struct testSocketData { static int testSocketAccept(const void *opaque) { - virNetSocketPtr *lsock = NULL; /* Listen socket */ + virNetSocket **lsock = NULL; /* Listen socket */ size_t nlsock = 0, i; - virNetSocketPtr ssock = NULL; /* Server socket */ - virNetSocketPtr rsock = NULL; /* Incoming client socket */ + virNetSocket *ssock = NULL; /* Server socket */ + virNetSocket *rsock = NULL; /* Incoming client socket */ const struct testSocketData *data = opaque; int ret = -1; char portstr[100]; @@ -195,7 +195,7 @@ testSocketAccept(const void *opaque) char b = '\0'; if (!data) { - virNetSocketPtr usock; + virNetSocket *usock; tmpdir = g_mkdtemp(template); if (tmpdir == NULL) { VIR_WARN("Failed to create temporary directory"); @@ -206,7 +206,7 @@ testSocketAccept(const void *opaque) if (virNetSocketNewListenUNIX(path, 0700, -1, getegid(), &usock) < 0) goto cleanup; - lsock = g_new0(virNetSocketPtr, 1); + lsock = g_new0(virNetSocket *, 1); lsock[0] = usock; nlsock = 1; @@ -307,9 +307,9 @@ testSocketAccept(const void *opaque) #ifndef WIN32 static int testSocketUNIXAddrs(const void *data G_GNUC_UNUSED) { - virNetSocketPtr lsock = NULL; /* Listen socket */ - virNetSocketPtr ssock = NULL; /* Server socket */ - virNetSocketPtr csock = NULL; /* Client socket */ + virNetSocket *lsock = NULL; /* Listen socket */ + virNetSocket *ssock = NULL; /* Server socket */ + virNetSocket *csock = NULL; /* Client socket */ int ret = -1; char *path = NULL; @@ -394,11 +394,11 @@ static int testSocketUNIXAddrs(const void *data G_GNUC_UNUSED) static int testSocketCommandNormal(const void *data G_GNUC_UNUSED) { - virNetSocketPtr csock = NULL; /* Client socket */ + virNetSocket *csock = NULL; /* Client socket */ char buf[100]; size_t i; int ret = -1; - virCommandPtr cmd = virCommandNewArgList("/bin/cat", "/dev/zero", NULL); + virCommand *cmd = virCommandNewArgList("/bin/cat", "/dev/zero", NULL); virCommandAddEnvPassCommon(cmd); if (virNetSocketNewConnectCommand(cmd, &csock) < 0) @@ -422,10 +422,10 @@ static int testSocketCommandNormal(const void *data G_GNUC_UNUSED) static int testSocketCommandFail(const void *data G_GNUC_UNUSED) { - virNetSocketPtr csock = NULL; /* Client socket */ + virNetSocket *csock = NULL; /* Client socket */ char buf[100]; int ret = -1; - virCommandPtr cmd = virCommandNewArgList("/bin/cat", "/dev/does-not-exist", NULL); + virCommand *cmd = virCommandNewArgList("/bin/cat", "/dev/does-not-exist", NULL); virCommandAddEnvPassCommon(cmd); if (virNetSocketNewConnectCommand(cmd, &csock) < 0) @@ -462,7 +462,7 @@ struct testSSHData { static int testSocketSSH(const void *opaque) { const struct testSSHData *data = opaque; - virNetSocketPtr csock = NULL; /* Client socket */ + virNetSocket *csock = NULL; /* Client socket */ int ret = -1; char buf[1024]; g_autofree char *command = virNetClientSSHHelperCommand(VIR_NET_CLIENT_PROXY_AUTO, diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c index 26793545c1..0ad42a77ed 100644 --- a/tests/virnettlscontexttest.c +++ b/tests/virnettlscontexttest.c @@ -53,13 +53,13 @@ struct testTLSContextData { * * This code is done when libvirtd starts up, or before * a libvirt client connects. The test is ensuring that - * the creation of virNetTLSContextPtr fails if we + * the creation of virNetTLSContext *fails if we * give bogus certs, or succeeds for good certs */ static int testTLSContextInit(const void *opaque) { struct testTLSContextData *data = (struct testTLSContextData *)opaque; - virNetTLSContextPtr ctxt = NULL; + virNetTLSContext *ctxt = NULL; int ret = -1; if (data->isServer) { diff --git a/tests/virnettlssessiontest.c b/tests/virnettlssessiontest.c index ccb5cad198..b9249cca56 100644 --- a/tests/virnettlssessiontest.c +++ b/tests/virnettlssessiontest.c @@ -77,10 +77,10 @@ static ssize_t testRead(char *buf, size_t len, void *opaque) static int testTLSSessionInit(const void *opaque) { struct testTLSSessionData *data = (struct testTLSSessionData *)opaque; - virNetTLSContextPtr clientCtxt = NULL; - virNetTLSContextPtr serverCtxt = NULL; - virNetTLSSessionPtr clientSess = NULL; - virNetTLSSessionPtr serverSess = NULL; + virNetTLSContext *clientCtxt = NULL; + virNetTLSContext *serverCtxt = NULL; + virNetTLSSession *clientSess = NULL; + virNetTLSSession *serverSess = NULL; int ret = -1; int channel[2]; bool clientShake = false; diff --git a/tests/virnumamock.c b/tests/virnumamock.c index 40e18e646e..3a203ded77 100644 --- a/tests/virnumamock.c +++ b/tests/virnumamock.c @@ -66,7 +66,7 @@ int virNumaGetMaxNode(void) { int ret = -1; - virBitmapPtr map = NULL; + virBitmap *map = NULL; if (virFileReadValueBitmap(&map, "%s/node/online", SYSFS_SYSTEM_PATH) < 0) return -1; @@ -80,7 +80,7 @@ bool virNumaNodeIsAvailable(int node) { bool ret = false; - virBitmapPtr map = NULL; + virBitmap *map = NULL; if (virFileReadValueBitmap(&map, "%s/node/online", SYSFS_SYSTEM_PATH) < 0) return false; @@ -162,7 +162,7 @@ virNumaGetPages(int node, } int -virNumaGetNodeCPUs(int node, virBitmapPtr *cpus) +virNumaGetNodeCPUs(int node, virBitmap **cpus) { int ret = -1; char *cpulist = NULL; diff --git a/tests/virnwfilterbindingxml2xmltest.c b/tests/virnwfilterbindingxml2xmltest.c index 3360dd28d3..ba8edcfd05 100644 --- a/tests/virnwfilterbindingxml2xmltest.c +++ b/tests/virnwfilterbindingxml2xmltest.c @@ -40,7 +40,7 @@ testCompareXMLToXMLFiles(const char *xml) { char *actual = NULL; int ret = -1; - virNWFilterBindingDefPtr dev = NULL; + virNWFilterBindingDef *dev = NULL; virResetLastError(); diff --git a/tests/virpcitest.c b/tests/virpcitest.c index b6ca686c5c..0466e5a0f7 100644 --- a/tests/virpcitest.c +++ b/tests/virpcitest.c @@ -30,7 +30,7 @@ # define VIR_FROM_THIS VIR_FROM_NONE static int -testVirPCIDeviceCheckDriver(virPCIDevicePtr dev, const char *expected) +testVirPCIDeviceCheckDriver(virPCIDevice *dev, const char *expected) { char *path = NULL; char *driver = NULL; @@ -58,7 +58,7 @@ static int testVirPCIDeviceNew(const void *opaque G_GNUC_UNUSED) { int ret = -1; - virPCIDevicePtr dev; + virPCIDevice *dev; const char *devName; virPCIDeviceAddress devAddr = {.domain = 0, .bus = 0, .slot = 0, .function = 0}; @@ -91,10 +91,10 @@ static int testVirPCIDeviceDetach(const void *opaque G_GNUC_UNUSED) { int ret = -1; - virPCIDevicePtr dev[] = {NULL, NULL, NULL}; + virPCIDevice *dev[] = {NULL, NULL, NULL}; size_t i, nDev = G_N_ELEMENTS(dev); - virPCIDeviceListPtr activeDevs = NULL; - virPCIDeviceListPtr inactiveDevs = NULL; + virPCIDeviceList *activeDevs = NULL; + virPCIDeviceList *inactiveDevs = NULL; int count; if (!(activeDevs = virPCIDeviceListNew()) || @@ -135,10 +135,10 @@ static int testVirPCIDeviceReset(const void *opaque G_GNUC_UNUSED) { int ret = -1; - virPCIDevicePtr dev[] = {NULL, NULL, NULL}; + virPCIDevice *dev[] = {NULL, NULL, NULL}; size_t i, nDev = G_N_ELEMENTS(dev); - virPCIDeviceListPtr activeDevs = NULL; - virPCIDeviceListPtr inactiveDevs = NULL; + virPCIDeviceList *activeDevs = NULL; + virPCIDeviceList *inactiveDevs = NULL; int count; if (!(activeDevs = virPCIDeviceListNew()) || @@ -173,10 +173,10 @@ static int testVirPCIDeviceReattach(const void *opaque G_GNUC_UNUSED) { int ret = -1; - virPCIDevicePtr dev[] = {NULL, NULL, NULL}; + virPCIDevice *dev[] = {NULL, NULL, NULL}; size_t i, nDev = G_N_ELEMENTS(dev); - virPCIDeviceListPtr activeDevs = NULL; - virPCIDeviceListPtr inactiveDevs = NULL; + virPCIDeviceList *activeDevs = NULL; + virPCIDeviceList *inactiveDevs = NULL; int count; if (!(activeDevs = virPCIDeviceListNew()) || @@ -231,7 +231,7 @@ testVirPCIDeviceIsAssignable(const void *opaque) { const struct testPCIDevData *data = opaque; int ret = -1; - virPCIDevicePtr dev; + virPCIDevice *dev; virPCIDeviceAddress devAddr = {.domain = data->domain, .bus = data->bus, .slot = data->slot, .function = data->function}; @@ -250,7 +250,7 @@ testVirPCIDeviceDetachSingle(const void *opaque) { const struct testPCIDevData *data = opaque; int ret = -1; - virPCIDevicePtr dev; + virPCIDevice *dev; virPCIDeviceAddress devAddr = {.domain = data->domain, .bus = data->bus, .slot = data->slot, .function = data->function}; @@ -274,7 +274,7 @@ testVirPCIDeviceReattachSingle(const void *opaque) { const struct testPCIDevData *data = opaque; int ret = -1; - virPCIDevicePtr dev; + virPCIDevice *dev; virPCIDeviceAddress devAddr = {.domain = data->domain, .bus = data->bus, .slot = data->slot, .function = data->function}; @@ -300,7 +300,7 @@ testVirPCIDeviceCheckDriverTest(const void *opaque) { const struct testPCIDevData *data = opaque; int ret = -1; - virPCIDevicePtr dev; + virPCIDevice *dev; virPCIDeviceAddress devAddr = {.domain = data->domain, .bus = data->bus, .slot = data->slot, .function = data->function}; @@ -322,7 +322,7 @@ testVirPCIDeviceUnbind(const void *opaque) { const struct testPCIDevData *data = opaque; int ret = -1; - virPCIDevicePtr dev; + virPCIDevice *dev; virPCIDeviceAddress devAddr = {.domain = data->domain, .bus = data->bus, .slot = data->slot, .function = data->function}; diff --git a/tests/virportallocatortest.c b/tests/virportallocatortest.c index 691d3f22f1..5c0a76de6f 100644 --- a/tests/virportallocatortest.c +++ b/tests/virportallocatortest.c @@ -38,7 +38,7 @@ VIR_LOG_INIT("tests.portallocatortest"); static int testAllocAll(const void *args G_GNUC_UNUSED) { - virPortAllocatorRangePtr ports = virPortAllocatorRangeNew("test", 5900, 5909); + virPortAllocatorRange *ports = virPortAllocatorRangeNew("test", 5900, 5909); int ret = -1; unsigned short p1 = 0, p2 = 0, p3 = 0, p4 = 0, p5 = 0, p6 = 0, p7 = 0; @@ -110,7 +110,7 @@ static int testAllocAll(const void *args G_GNUC_UNUSED) static int testAllocReuse(const void *args G_GNUC_UNUSED) { - virPortAllocatorRangePtr ports = virPortAllocatorRangeNew("test", 5900, 5910); + virPortAllocatorRange *ports = virPortAllocatorRangeNew("test", 5900, 5910); int ret = -1; unsigned short p1 = 0, p2 = 0, p3 = 0, p4 = 0; diff --git a/tests/virresctrltest.c b/tests/virresctrltest.c index bb6d0fe48e..00f9f552e5 100644 --- a/tests/virresctrltest.c +++ b/tests/virresctrltest.c @@ -21,10 +21,10 @@ test_virResctrlGetUnused(const void *opaque) char *system_dir = NULL; char *resctrl_dir = NULL; int ret = -1; - virResctrlAllocPtr alloc = NULL; + virResctrlAlloc *alloc = NULL; char *schemata_str = NULL; char *schemata_file; - virCapsPtr caps = NULL; + virCaps *caps = NULL; system_dir = g_strdup_printf("%s/vircaps2xmldata/linux-%s/system", abs_srcdir, data->filename); diff --git a/tests/virrotatingfiletest.c b/tests/virrotatingfiletest.c index f8dd7daefe..87699936cb 100644 --- a/tests/virrotatingfiletest.c +++ b/tests/virrotatingfiletest.c @@ -166,7 +166,7 @@ static int testRotatingFileInitFiles(off_t baseSize, static int testRotatingFileWriterNew(const void *data G_GNUC_UNUSED) { - virRotatingFileWriterPtr file; + virRotatingFileWriter *file; int ret = -1; char buf[512]; @@ -209,7 +209,7 @@ static int testRotatingFileWriterNew(const void *data G_GNUC_UNUSED) static int testRotatingFileWriterAppend(const void *data G_GNUC_UNUSED) { - virRotatingFileWriterPtr file; + virRotatingFileWriter *file; int ret = -1; char buf[512]; @@ -252,7 +252,7 @@ static int testRotatingFileWriterAppend(const void *data G_GNUC_UNUSED) static int testRotatingFileWriterTruncate(const void *data G_GNUC_UNUSED) { - virRotatingFileWriterPtr file; + virRotatingFileWriter *file; int ret = -1; char buf[512]; @@ -295,7 +295,7 @@ static int testRotatingFileWriterTruncate(const void *data G_GNUC_UNUSED) static int testRotatingFileWriterRolloverNone(const void *data G_GNUC_UNUSED) { - virRotatingFileWriterPtr file; + virRotatingFileWriter *file; int ret = -1; char buf[512]; @@ -338,7 +338,7 @@ static int testRotatingFileWriterRolloverNone(const void *data G_GNUC_UNUSED) static int testRotatingFileWriterRolloverOne(const void *data G_GNUC_UNUSED) { - virRotatingFileWriterPtr file; + virRotatingFileWriter *file; int ret = -1; char buf[512]; @@ -383,7 +383,7 @@ static int testRotatingFileWriterRolloverOne(const void *data G_GNUC_UNUSED) static int testRotatingFileWriterRolloverAppend(const void *data G_GNUC_UNUSED) { - virRotatingFileWriterPtr file; + virRotatingFileWriter *file; int ret = -1; char buf[512]; @@ -426,7 +426,7 @@ static int testRotatingFileWriterRolloverAppend(const void *data G_GNUC_UNUSED) static int testRotatingFileWriterRolloverMany(const void *data G_GNUC_UNUSED) { - virRotatingFileWriterPtr file; + virRotatingFileWriter *file; int ret = -1; char buf[512]; @@ -475,7 +475,7 @@ static int testRotatingFileWriterRolloverMany(const void *data G_GNUC_UNUSED) static int testRotatingFileWriterRolloverLineBreak(const void *data G_GNUC_UNUSED) { - virRotatingFileWriterPtr file; + virRotatingFileWriter *file; int ret = -1; const char *buf = "The quick brown fox jumps over the lazy dog\n" "The wizard quickly jinxed the gnomes before they vaporized\n"; @@ -517,7 +517,7 @@ static int testRotatingFileWriterRolloverLineBreak(const void *data G_GNUC_UNUSE static int testRotatingFileWriterLargeFile(const void *data G_GNUC_UNUSED) { - virRotatingFileWriterPtr file; + virRotatingFileWriter *file; int ret = -1; const char *buf = "The quick brown fox jumps over the lazy dog\n" "The wizard quickly jinxed the gnomes before they vaporized\n"; @@ -559,7 +559,7 @@ static int testRotatingFileWriterLargeFile(const void *data G_GNUC_UNUSED) static int testRotatingFileReaderOne(const void *data G_GNUC_UNUSED) { - virRotatingFileReaderPtr file; + virRotatingFileReader *file; int ret = -1; char buf[512]; ssize_t got; @@ -591,7 +591,7 @@ static int testRotatingFileReaderOne(const void *data G_GNUC_UNUSED) static int testRotatingFileReaderAll(const void *data G_GNUC_UNUSED) { - virRotatingFileReaderPtr file; + virRotatingFileReader *file; int ret = -1; char buf[768]; ssize_t got; @@ -623,7 +623,7 @@ static int testRotatingFileReaderAll(const void *data G_GNUC_UNUSED) static int testRotatingFileReaderPartial(const void *data G_GNUC_UNUSED) { - virRotatingFileReaderPtr file; + virRotatingFileReader *file; int ret = -1; char buf[600]; ssize_t got; @@ -655,7 +655,7 @@ static int testRotatingFileReaderPartial(const void *data G_GNUC_UNUSED) static int testRotatingFileReaderSeek(const void *data G_GNUC_UNUSED) { - virRotatingFileReaderPtr file; + virRotatingFileReader *file; int ret = -1; char buf[600]; ssize_t got; diff --git a/tests/virschematest.c b/tests/virschematest.c index 9a947f61f2..4e657159e1 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -41,7 +41,7 @@ struct testSchemaEntry { struct testSchemaData { - virXMLValidatorPtr validator; + virXMLValidator *validator; const char *xml_path; }; @@ -65,7 +65,7 @@ testSchemaValidateXML(const void *args) static int testSchemaFile(const char *schema, - virXMLValidatorPtr validator, + virXMLValidator *validator, const char *path) { g_autofree char *test_name = NULL; @@ -82,7 +82,7 @@ testSchemaFile(const char *schema, static int testSchemaDir(const char *schema, - virXMLValidatorPtr validator, + virXMLValidator *validator, const char *dir_path, const char *filterstr) { @@ -150,12 +150,12 @@ testSchemaGrammarReport(const void *opaque) return 0; } -static virXMLValidatorPtr +static virXMLValidator * testSchemaGrammarLoad(const char *schema) { g_autofree char *schema_path = NULL; g_autofree char *testname = NULL; - virXMLValidatorPtr ret; + virXMLValidator *ret; schema_path = g_strdup_printf("%s/%s", abs_top_srcdir, schema); diff --git a/tests/virscsitest.c b/tests/virscsitest.c index 47035e927e..84b6f15ec6 100644 --- a/tests/virscsitest.c +++ b/tests/virscsitest.c @@ -60,12 +60,12 @@ test1(const void *data G_GNUC_UNUSED) static int test2(const void *data G_GNUC_UNUSED) { - virSCSIDeviceListPtr list = NULL; - virSCSIDevicePtr dev = NULL; - virSCSIDevicePtr dev1 = NULL; + virSCSIDeviceList *list = NULL; + virSCSIDevice *dev = NULL; + virSCSIDevice *dev1 = NULL; bool free_dev = true; bool free_dev1 = true; - virSCSIDevicePtr tmp = NULL; + virSCSIDevice *tmp = NULL; char *sgname = NULL; int ret = -1; diff --git a/tests/virstoragetest.c b/tests/virstoragetest.c index 23cc72d85c..1b211b60e6 100644 --- a/tests/virstoragetest.c +++ b/tests/virstoragetest.c @@ -80,7 +80,7 @@ testCleanupImages(void) } -static virStorageSourcePtr +static virStorageSource * testStorageFileGetMetadata(const char *path, int format, uid_t uid, gid_t gid) @@ -269,7 +269,7 @@ static int testStorageChain(const void *args) { const struct testChainData *data = args; - virStorageSourcePtr elt; + virStorageSource *elt; size_t i = 0; g_autoptr(virStorageSource) meta = NULL; @@ -337,14 +337,14 @@ testStorageChain(const void *args) struct testLookupData { - virStorageSourcePtr chain; + virStorageSource *chain; const char *target; - virStorageSourcePtr from; + virStorageSource *from; const char *name; unsigned int expIndex; const char *expResult; - virStorageSourcePtr expMeta; - virStorageSourcePtr expParent; + virStorageSource *expMeta; + virStorageSource *expParent; }; static int @@ -352,8 +352,8 @@ testStorageLookup(const void *args) { const struct testLookupData *data = args; int ret = 0; - virStorageSourcePtr result; - virStorageSourcePtr actualParent; + virStorageSource *result; + virStorageSource *actualParent; result = virStorageSourceChainLookup(data->chain, data->from, data->name, data->target, &actualParent); @@ -455,8 +455,8 @@ testPathRelativePrepare(void) struct testPathRelativeBacking { - virStorageSourcePtr top; - virStorageSourcePtr base; + virStorageSource *top; + virStorageSource *base; const char *expect; }; @@ -548,8 +548,8 @@ mymain(void) struct testLookupData data2; struct testPathRelativeBacking data4; struct testBackingParseData data5; - virStorageSourcePtr chain2; /* short for chain->backingStore */ - virStorageSourcePtr chain3; /* short for chain2->backingStore */ + virStorageSource *chain2; /* short for chain->backingStore */ + virStorageSource *chain3; /* short for chain2->backingStore */ g_autoptr(virCommand) cmd = NULL; g_autoptr(virStorageSource) chain = NULL; diff --git a/tests/virsystemdtest.c b/tests/virsystemdtest.c index c082b95732..f1c9a4ee5f 100644 --- a/tests/virsystemdtest.c +++ b/tests/virsystemdtest.c @@ -495,8 +495,8 @@ static int testPMSupportSystemdNotRunning(const void *opaque) static int -testActivationCreateFDs(virNetSocketPtr *sockUNIX, - virNetSocketPtr **sockIP, +testActivationCreateFDs(virNetSocket **sockUNIX, + virNetSocket ***sockIP, size_t *nsockIP) { *sockUNIX = NULL; @@ -526,8 +526,8 @@ testActivationCreateFDs(virNetSocketPtr *sockUNIX, static int testActivation(bool useNames) { - virNetSocketPtr sockUNIX; - virNetSocketPtr *sockIP; + virNetSocket *sockUNIX; + virNetSocket **sockIP; size_t nsockIP; int ret = -1; size_t i; @@ -624,7 +624,7 @@ testActivation(bool useNames) static int testActivationEmpty(const void *opaque G_GNUC_UNUSED) { - virSystemdActivationPtr act; + virSystemdActivation *act; g_unsetenv("LISTEN_FDS"); diff --git a/tests/viruritest.c b/tests/viruritest.c index 587498bc2b..1962000bc8 100644 --- a/tests/viruritest.c +++ b/tests/viruritest.c @@ -41,13 +41,13 @@ struct URIParseData { const char *query; const char *fragment; const char *user; - virURIParamPtr params; + virURIParam *params; }; static int testURIParse(const void *args) { int ret = -1; - virURIPtr uri = NULL; + virURI *uri = NULL; const struct URIParseData *data = args; char *uristr = NULL; size_t i; diff --git a/tests/virusbtest.c b/tests/virusbtest.c index 7df4e3aec3..baad7dd821 100644 --- a/tests/virusbtest.c +++ b/tests/virusbtest.c @@ -45,7 +45,7 @@ struct findTestInfo { bool expectFailure; }; -static int testDeviceFileActor(virUSBDevicePtr dev, +static int testDeviceFileActor(virUSBDevice *dev, const char *path, void *opaque G_GNUC_UNUSED) { @@ -69,8 +69,8 @@ static int testDeviceFind(const void *opaque) { const struct findTestInfo *info = opaque; int ret = -1; - virUSBDevicePtr dev = NULL; - virUSBDeviceListPtr devs = NULL; + virUSBDevice *dev = NULL; + virUSBDeviceList *devs = NULL; int rv = 0; size_t i, ndevs = 0; @@ -113,7 +113,7 @@ static int testDeviceFind(const void *opaque) ndevs = virUSBDeviceListCount(devs); for (i = 0; i < ndevs; i++) { - virUSBDevicePtr device = virUSBDeviceListGet(devs, i); + virUSBDevice *device = virUSBDeviceListGet(devs, i); if (virUSBDeviceFileIterate(device, testDeviceFileActor, NULL) < 0) goto cleanup; } @@ -147,9 +147,9 @@ testCheckNdevs(const char* occasion, static int testUSBList(const void *opaque G_GNUC_UNUSED) { - virUSBDeviceListPtr list = NULL; - virUSBDeviceListPtr devlist = NULL; - virUSBDevicePtr dev = NULL; + virUSBDeviceList *list = NULL; + virUSBDeviceList *devlist = NULL; + virUSBDevice *dev = NULL; int ret = -1; size_t i, ndevs; diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c index 11739e6f3f..8f74648503 100644 --- a/tests/vmx2xmltest.c +++ b/tests/vmx2xmltest.c @@ -13,15 +13,15 @@ # define VIR_FROM_THIS VIR_FROM_VMWARE -static virCapsPtr caps; -static virDomainXMLOptionPtr xmlopt; +static virCaps *caps; +static virDomainXMLOption *xmlopt; static virVMXContext ctx; static void testCapsInit(void) { - virCapsGuestPtr guest = NULL; + virCapsGuest *guest = NULL; caps = virCapabilitiesNew(VIR_ARCH_I686, true, true); @@ -71,7 +71,7 @@ testCompareFiles(const char *vmx, const char *xml, bool should_fail_parse) int ret = -1; char *vmxData = NULL; char *formatted = NULL; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; if (virTestLoadFile(vmx, &vmxData) < 0) return -1; diff --git a/tests/vshtabletest.c b/tests/vshtabletest.c index 7e5ac01c6c..41c33b1701 100644 --- a/tests/vshtabletest.c +++ b/tests/vshtabletest.c @@ -55,7 +55,7 @@ testVshTableHeader(const void *opaque G_GNUC_UNUSED) " 1 fedora28 running\n" " 2 rhel7.5 running\n"; - vshTablePtr table = vshTableNew("Id", "Name", "State", + vshTable *table = vshTableNew("Id", "Name", "State", NULL); //to ask about return if (!table) goto cleanup; @@ -84,7 +84,7 @@ testVshTableRowAppend(const void *opaque G_GNUC_UNUSED) { int ret = 0; - vshTablePtr table = vshTableNew("Id", "Name", NULL); + vshTable *table = vshTableNew("Id", "Name", NULL); if (!table) goto cleanup; @@ -126,7 +126,7 @@ testUnicode(const void *opaque G_GNUC_UNUSED) "-----------------------------------------\n" " 1 fedora28 running\n" " 2 つへソrhel7.5つへソ running\n"; - vshTablePtr table; + vshTable *table; table = vshTableNew("Id", "名稱", "государство", NULL); if (!table) @@ -158,7 +158,7 @@ testUnicodeArabic(const void *opaque G_GNUC_UNUSED) "-------------------------------------------------------------------------------------------\n" " 1 ﻉﺪﻴﻟ ﺎﻠﺜﻘﻴﻟ ﻕﺎﻣ ﻊﻧ, ٣٠ ﻎﻴﻨﻳﺍ ﻮﺘﻧﺎﻤﺗ ﺎﻠﺛﺎﻠﺛ، ﺄﺳﺭ, ﺩﻮﻟ ﺩﻮﻟ. ﺄﻣﺎﻣ ﺍ ﺎﻧ ﻲﻜﻧ\n" " ﺺﻔﺣﺓ ﺖﻜﺘﻴﻛﺍً ﻊﻟ, ﺎﻠﺠﻧﻭﺩ ﻭﺎﻠﻌﺗﺍﺩ ﺵﺭ\n"; - vshTablePtr table; + vshTable *table; wchar_t wc; /* If this char is not classed as printable, the actual @@ -194,7 +194,7 @@ static int testUnicodeZeroWidthChar(const void *opaque G_GNUC_UNUSED) { int ret = 0; - vshTablePtr table = NULL; + vshTable *table = NULL; const char *exp = " I\u200Bd Name \u200BStatus\n" "--------------------------\n" @@ -231,7 +231,7 @@ static int testUnicodeCombiningChar(const void *opaque G_GNUC_UNUSED) { int ret = 0; - vshTablePtr table = NULL; + vshTable *table = NULL; const char *exp = " Id Náme Ⓢtatus\n" "--------------------------\n" @@ -260,7 +260,7 @@ static int testUnicodeNonPrintableChar(const void *opaque G_GNUC_UNUSED) { int ret = 0; - vshTablePtr table = NULL; + vshTable *table = NULL; const char *exp = " I\\x09d Name Status\n" "----------------------------------\n" @@ -288,9 +288,9 @@ static int testNTables(const void *opaque G_GNUC_UNUSED) { int ret = 0; - vshTablePtr table1 = NULL; - vshTablePtr table2 = NULL; - vshTablePtr table3 = NULL; + vshTable *table1 = NULL; + vshTable *table2 = NULL; + vshTable *table3 = NULL; const char *exp1 = " Id Name Status\n" "--------------------------\n" diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c index ab1a834f1b..7c6931000a 100644 --- a/tests/xlconfigtest.c +++ b/tests/xlconfigtest.c @@ -36,7 +36,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE -static libxlDriverPrivatePtr driver; +static libxlDriverPrivate *driver; /* * This function provides a mechanism to replace variables in test @@ -70,7 +70,7 @@ testCompareParseXML(const char *xlcfg, const char *xml, bool replaceVars) virConnectPtr conn = NULL; int wrote = 4096; int ret = -1; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; char *replacedXML = NULL; gotxlcfgData = g_new0(char, wrote); @@ -128,7 +128,7 @@ testCompareFormatXML(const char *xlcfg, const char *xml, bool replaceVars) g_autoptr(virConf) conf = NULL; int ret = -1; virConnectPtr conn; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; char *replacedXML = NULL; g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver); diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c index 8d6b2378fd..bf74e4a163 100644 --- a/tests/xmconfigtest.c +++ b/tests/xmconfigtest.c @@ -34,7 +34,7 @@ #define VIR_FROM_THIS VIR_FROM_NONE -static libxlDriverPrivatePtr driver; +static libxlDriverPrivate *driver; static int testCompareParseXML(const char *xmcfg, const char *xml) @@ -44,7 +44,7 @@ testCompareParseXML(const char *xmcfg, const char *xml) int ret = -1; virConnectPtr conn = NULL; int wrote = 4096; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; gotxmcfgData = g_new0(char, wrote); @@ -87,7 +87,7 @@ testCompareFormatXML(const char *xmcfg, const char *xml) char *gotxml = NULL; g_autoptr(virConf) conf = NULL; int ret = -1; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver); if (virTestLoadFile(xmcfg, &xmcfgData) < 0) diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c index b74fda29ef..fb87000529 100644 --- a/tests/xml2vmxtest.c +++ b/tests/xml2vmxtest.c @@ -13,15 +13,15 @@ # define VIR_FROM_THIS VIR_FROM_VMWARE -static virCapsPtr caps; +static virCaps *caps; static virVMXContext ctx; -static virDomainXMLOptionPtr xmlopt; +static virDomainXMLOption *xmlopt; static void testCapsInit(void) { - virCapsGuestPtr guest = NULL; + virCapsGuest *guest = NULL; caps = virCapabilitiesNew(VIR_ARCH_I686, true, true); @@ -72,7 +72,7 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version) { int result = -1; char *formatted = NULL; - virDomainDefPtr def = NULL; + virDomainDef *def = NULL; def = virDomainDefParseFile(xml, xmlopt, NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE); @@ -129,7 +129,7 @@ testCompareHelper(const void *data) } static int -testAutodetectSCSIControllerModel(virDomainDiskDefPtr def G_GNUC_UNUSED, +testAutodetectSCSIControllerModel(virDomainDiskDef *def G_GNUC_UNUSED, int *model, void *opaque G_GNUC_UNUSED) { *model = VIR_DOMAIN_CONTROLLER_MODEL_SCSI_LSILOGIC; diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index 91f7c963c1..20a02b0b02 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -158,7 +158,7 @@ cmdCheckpointCreate(vshControl *ctl, */ static int virshParseCheckpointDiskspec(vshControl *ctl, - virBufferPtr buf, + virBuffer *buf, const char *str) { int ret = -1; @@ -540,10 +540,9 @@ struct virshCheckpointList { struct virshChk *chks; int nchks; }; -typedef struct virshCheckpointList *virshCheckpointListPtr; static void -virshCheckpointListFree(virshCheckpointListPtr checkpointlist) +virshCheckpointListFree(struct virshCheckpointList *checkpointlist) { size_t i; @@ -581,7 +580,7 @@ virshChkSorter(const void *a, * list is limited to descendants of the given checkpoint. If FLAGS is * given, the list is filtered. If TREE is specified, then all but * FROM or the roots will also have parent information. */ -static virshCheckpointListPtr +static struct virshCheckpointList * virshCheckpointListCollect(vshControl *ctl, virDomainPtr dom, virDomainCheckpointPtr from, @@ -591,8 +590,8 @@ virshCheckpointListCollect(vshControl *ctl, size_t i; int count = -1; virDomainCheckpointPtr *chks; - virshCheckpointListPtr checkpointlist = NULL; - virshCheckpointListPtr ret = NULL; + struct virshCheckpointList *checkpointlist = NULL; + struct virshCheckpointList *ret = NULL; unsigned int flags = orig_flags; checkpointlist = g_new0(struct virshCheckpointList, 1); @@ -646,7 +645,7 @@ virshCheckpointListLookup(int id, bool parent, void *opaque) { - virshCheckpointListPtr checkpointlist = opaque; + struct virshCheckpointList *checkpointlist = opaque; if (parent) return checkpointlist->chks[id].parent; return virDomainCheckpointGetName(checkpointlist->chks[id].chk); @@ -731,8 +730,8 @@ cmdCheckpointList(vshControl *ctl, const char *from_chk = NULL; char *parent_chk = NULL; virDomainCheckpointPtr start = NULL; - virshCheckpointListPtr checkpointlist = NULL; - vshTablePtr table = NULL; + struct virshCheckpointList *checkpointlist = NULL; + vshTable *table = NULL; VSH_EXCLUSIVE_OPTIONS_VAR(tree, name); VSH_EXCLUSIVE_OPTIONS_VAR(parent, roots); diff --git a/tools/virsh-completer-checkpoint.c b/tools/virsh-completer-checkpoint.c index 29d644dad0..1296741061 100644 --- a/tools/virsh-completer-checkpoint.c +++ b/tools/virsh-completer-checkpoint.c @@ -31,7 +31,7 @@ virshCheckpointNameCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virDomainPtr dom = NULL; virDomainCheckpointPtr *checkpoints = NULL; int ncheckpoints = 0; diff --git a/tools/virsh-completer-domain.c b/tools/virsh-completer-domain.c index 15993064fa..99b36a2f9f 100644 --- a/tools/virsh-completer-domain.c +++ b/tools/virsh-completer-domain.c @@ -41,7 +41,7 @@ virshDomainNameCompleter(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virDomainPtr *domains = NULL; int ndomains = 0; size_t i = 0; @@ -88,7 +88,7 @@ virshDomainUUIDCompleter(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virDomainPtr *domains = NULL; int ndomains = 0; size_t i = 0; @@ -139,7 +139,7 @@ virshDomainInterfaceCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; g_autoptr(xmlDoc) xmldoc = NULL; g_autoptr(xmlXPathContext) ctxt = NULL; int ninterfaces; @@ -187,7 +187,7 @@ virshDomainDiskTargetCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; g_autoptr(xmlDoc) xmldoc = NULL; g_autoptr(xmlXPathContext) ctxt = NULL; g_autofree xmlNodePtr *disks = NULL; @@ -243,7 +243,7 @@ virshDomainInterfaceStateCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; const char *iface = NULL; g_autoptr(xmlDoc) xml = NULL; g_autoptr(xmlXPathContext) ctxt = NULL; @@ -300,7 +300,7 @@ virshDomainDeviceAliasCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; g_autoptr(xmlDoc) xmldoc = NULL; g_autoptr(xmlXPathContext) ctxt = NULL; int naliases; @@ -563,7 +563,7 @@ virshDomainCpulistCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; size_t i; int cpunum; g_autofree unsigned char *cpumap = NULL; @@ -672,7 +672,7 @@ virshDomainConsoleCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; g_autoptr(xmlDoc) xmldoc = NULL; g_autoptr(xmlXPathContext) ctxt = NULL; int nserials; diff --git a/tools/virsh-completer-host.c b/tools/virsh-completer-host.c index 9d3bdb2024..213f029552 100644 --- a/tools/virsh-completer-host.c +++ b/tools/virsh-completer-host.c @@ -54,7 +54,7 @@ virshAllocpagesPagesizeCompleter(vshControl *ctl, unsigned int flags) { g_autoptr(xmlXPathContext) ctxt = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; int npages = 0; g_autofree xmlNodePtr *pages = NULL; g_autoptr(xmlDoc) doc = NULL; @@ -104,7 +104,7 @@ virshCellnoCompleter(vshControl *ctl, unsigned int flags) { g_autoptr(xmlXPathContext) ctxt = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; int ncells = 0; g_autofree xmlNodePtr *cells = NULL; g_autoptr(xmlDoc) doc = NULL; @@ -143,7 +143,7 @@ virshNodeCpuCompleter(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; g_auto(GStrv) tmp = NULL; size_t i; int cpunum; diff --git a/tools/virsh-completer-interface.c b/tools/virsh-completer-interface.c index db819ae689..9a6603b27e 100644 --- a/tools/virsh-completer-interface.c +++ b/tools/virsh-completer-interface.c @@ -34,7 +34,7 @@ virshInterfaceStringHelper(vshControl *ctl, unsigned int flags, virInterfaceStringCallback cb) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virInterfacePtr *ifaces = NULL; int nifaces = 0; size_t i = 0; diff --git a/tools/virsh-completer-network.c b/tools/virsh-completer-network.c index 5f5f527fa4..f9154f23a4 100644 --- a/tools/virsh-completer-network.c +++ b/tools/virsh-completer-network.c @@ -31,7 +31,7 @@ virshNetworkNameCompleter(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virNetworkPtr *nets = NULL; int nnets = 0; size_t i = 0; @@ -90,7 +90,7 @@ virshNetworkPortUUIDCompleter(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virNetworkPtr net = NULL; virNetworkPortPtr *ports = NULL; int nports = 0; @@ -140,7 +140,7 @@ virshNetworkUUIDCompleter(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virNetworkPtr *nets = NULL; int nnets = 0; size_t i = 0; @@ -181,7 +181,7 @@ virshNetworkDhcpMacCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virNetworkDHCPLeasePtr *leases = NULL; virNetworkPtr network = NULL; int nleases; diff --git a/tools/virsh-completer-nodedev.c b/tools/virsh-completer-nodedev.c index 1165e0680c..d595b687fd 100644 --- a/tools/virsh-completer-nodedev.c +++ b/tools/virsh-completer-nodedev.c @@ -32,7 +32,7 @@ virshNodeDeviceNameCompleter(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virNodeDevicePtr *devs = NULL; int ndevs = 0; size_t i = 0; diff --git a/tools/virsh-completer-nwfilter.c b/tools/virsh-completer-nwfilter.c index 13caefff1e..859f72f6e9 100644 --- a/tools/virsh-completer-nwfilter.c +++ b/tools/virsh-completer-nwfilter.c @@ -30,7 +30,7 @@ virshNWFilterNameCompleter(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virNWFilterPtr *nwfilters = NULL; int nnwfilters = 0; size_t i = 0; @@ -67,7 +67,7 @@ virshNWFilterBindingNameCompleter(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virNWFilterBindingPtr *bindings = NULL; int nbindings = 0; size_t i = 0; diff --git a/tools/virsh-completer-pool.c b/tools/virsh-completer-pool.c index 4a0eb1582d..9350eff2d3 100644 --- a/tools/virsh-completer-pool.c +++ b/tools/virsh-completer-pool.c @@ -32,7 +32,7 @@ virshStoragePoolNameCompleter(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virStoragePoolPtr *pools = NULL; int npools = 0; size_t i = 0; diff --git a/tools/virsh-completer-secret.c b/tools/virsh-completer-secret.c index 75ebe7b4e9..396997244d 100644 --- a/tools/virsh-completer-secret.c +++ b/tools/virsh-completer-secret.c @@ -32,7 +32,7 @@ virshSecretUUIDCompleter(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virSecretPtr *secrets = NULL; int nsecrets = 0; size_t i = 0; diff --git a/tools/virsh-completer-snapshot.c b/tools/virsh-completer-snapshot.c index e64b2442ca..e8109ee1e2 100644 --- a/tools/virsh-completer-snapshot.c +++ b/tools/virsh-completer-snapshot.c @@ -31,7 +31,7 @@ virshSnapshotNameCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virDomainPtr dom = NULL; virDomainSnapshotPtr *snapshots = NULL; int rc; diff --git a/tools/virsh-completer-volume.c b/tools/virsh-completer-volume.c index 2ac8cd25cc..301ee982a5 100644 --- a/tools/virsh-completer-volume.c +++ b/tools/virsh-completer-volume.c @@ -31,7 +31,7 @@ virshStorageVolNameCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virStoragePoolPtr pool = NULL; virStorageVolPtr *vols = NULL; int rc; diff --git a/tools/virsh-console.c b/tools/virsh-console.c index 39e38e5959..449619c95f 100644 --- a/tools/virsh-console.c +++ b/tools/virsh-console.c @@ -58,7 +58,6 @@ struct virConsoleBuffer { typedef struct virConsole virConsole; -typedef virConsole *virConsolePtr; struct virConsole { virObjectLockable parent; @@ -76,7 +75,7 @@ struct virConsole { virError error; }; -static virClassPtr virConsoleClass; +static virClass *virConsoleClass; static void virConsoleDispose(void *obj); static int @@ -97,7 +96,7 @@ virConsoleHandleSignal(int sig G_GNUC_UNUSED) static void -virConsoleShutdown(virConsolePtr con, +virConsoleShutdown(virConsole *con, bool graceful) { virErrorPtr err = virGetLastError(); @@ -139,7 +138,7 @@ virConsoleShutdown(virConsolePtr con, static void virConsoleDispose(void *obj) { - virConsolePtr con = obj; + virConsole *con = obj; if (con->st) virStreamFree(con->st); @@ -153,7 +152,7 @@ static void virConsoleEventOnStream(virStreamPtr st, int events, void *opaque) { - virConsolePtr con = opaque; + virConsole *con = opaque; virObjectLock(con); @@ -234,7 +233,7 @@ virConsoleEventOnStdin(int watch G_GNUC_UNUSED, int events, void *opaque) { - virConsolePtr con = opaque; + virConsole *con = opaque; virObjectLock(con); @@ -305,7 +304,7 @@ virConsoleEventOnStdout(int watch G_GNUC_UNUSED, int events, void *opaque) { - virConsolePtr con = opaque; + virConsole *con = opaque; virObjectLock(con); @@ -360,10 +359,10 @@ virConsoleEventOnStdout(int watch G_GNUC_UNUSED, } -static virConsolePtr +static virConsole * virConsoleNew(void) { - virConsolePtr con; + virConsole *con; if (virConsoleInitialize() < 0) return NULL; @@ -405,8 +404,8 @@ virshRunConsole(vshControl *ctl, const char *dev_name, unsigned int flags) { - virConsolePtr con = NULL; - virshControlPtr priv = ctl->privData; + virConsole *con = NULL; + virshControl *priv = ctl->privData; int ret = -1; struct sigaction old_sigquit; diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index c4d7464695..0e49f5da8a 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -467,7 +467,7 @@ cmdDomblkinfo(vshControl *ctl, const vshCmd *cmd) char *cap = NULL; char *alloc = NULL; char *phy = NULL; - vshTablePtr table = NULL; + vshTable *table = NULL; VSH_EXCLUSIVE_OPTIONS("all", "device"); @@ -605,7 +605,7 @@ cmdDomblklist(vshControl *ctl, const vshCmd *cmd) char *device = NULL; char *target = NULL; char *source = NULL; - vshTablePtr table = NULL; + vshTable *table = NULL; if (vshCommandOptBool(cmd, "inactive")) flags |= VIR_DOMAIN_XML_INACTIVE; @@ -728,7 +728,7 @@ cmdDomiflist(vshControl *ctl, const vshCmd *cmd) int ninterfaces; xmlNodePtr *interfaces = NULL; size_t i; - vshTablePtr table = NULL; + vshTable *table = NULL; if (vshCommandOptBool(cmd, "inactive")) flags |= VIR_DOMAIN_XML_INACTIVE; @@ -1290,7 +1290,7 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) unsigned int id; char *str, uuid[VIR_UUID_STRING_BUFLEN]; int has_managed_save = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; g_auto(GStrv) messages = NULL; if (!(dom = virshCommandOptDomain(ctl, cmd, NULL))) @@ -1609,10 +1609,9 @@ struct virshDomainList { virDomainPtr *domains; size_t ndomains; }; -typedef struct virshDomainList *virshDomainListPtr; static void -virshDomainListFree(virshDomainListPtr domlist) +virshDomainListFree(struct virshDomainList *domlist) { size_t i; @@ -1624,10 +1623,10 @@ virshDomainListFree(virshDomainListPtr domlist) g_free(domlist); } -static virshDomainListPtr +static struct virshDomainList * virshDomainListCollect(vshControl *ctl, unsigned int flags) { - virshDomainListPtr list = g_new0(struct virshDomainList, 1); + struct virshDomainList *list = g_new0(struct virshDomainList, 1); size_t i; int ret; int *ids = NULL; @@ -1643,7 +1642,7 @@ virshDomainListCollect(vshControl *ctl, unsigned int flags) int nsnap; int nchk; int mansave; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; /* try the list with flags support (0.9.13 and later) */ if ((ret = virConnectListAllDomains(priv->conn, &list->domains, @@ -1965,12 +1964,12 @@ cmdList(vshControl *ctl, const vshCmd *cmd) char uuid[VIR_UUID_STRING_BUFLEN]; int state; bool ret = false; - virshDomainListPtr list = NULL; + struct virshDomainList *list = NULL; virDomainPtr dom; char id_buf[VIR_INT64_STR_BUFLEN]; unsigned int id; unsigned int flags = VIR_CONNECT_LIST_DOMAINS_ACTIVE; - vshTablePtr table = NULL; + vshTable *table = NULL; /* construct filter flags */ if (vshCommandOptBool(cmd, "inactive") || @@ -2242,7 +2241,7 @@ cmdDomstats(vshControl *ctl, const vshCmd *cmd) int flags = 0; const vshCmdOpt *opt = NULL; bool ret = false; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "state")) stats |= VIR_DOMAIN_STATS_STATE; diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 532169d8d7..fac590fbc6 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -174,7 +174,7 @@ virshAddressParse(const char *str, static void -virshAddressFormat(virBufferPtr buf, +virshAddressFormat(virBuffer *buf, struct virshAddress *addr) { switch ((enum virshAddressType) addr->type) { @@ -496,7 +496,7 @@ static const vshCmdOptDef opts_attach_disk[] = { static int cmdAttachDiskFormatAddress(vshControl *ctl, - virBufferPtr buf, + virBuffer *buf, const char *straddr, const char *target, bool multifunction) @@ -855,7 +855,7 @@ static const vshCmdOptDef opts_attach_interface[] = { static int virshParseRateStr(vshControl *ctl, const char *rateStr, - virNetDevBandwidthRatePtr rate) + virNetDevBandwidthRate *rate) { g_auto(GStrv) tok = NULL; size_t ntok; @@ -1685,7 +1685,6 @@ static void virshCatchInt(int sig G_GNUC_UNUSED, typedef struct _virshBlockJobWaitData virshBlockJobWaitData; -typedef virshBlockJobWaitData *virshBlockJobWaitDataPtr; struct _virshBlockJobWaitData { vshControl *ctl; virDomainPtr dom; @@ -1710,7 +1709,7 @@ virshBlockJobStatusHandler(virConnectPtr conn G_GNUC_UNUSED, int status, void *opaque) { - virshBlockJobWaitDataPtr data = opaque; + virshBlockJobWaitData *data = opaque; if (STREQ_NULLABLE(disk, data->dev)) data->status = status; @@ -1736,7 +1735,7 @@ virshBlockJobStatusHandler(virConnectPtr conn G_GNUC_UNUSED, * Returns the data structure that holds data needed for block job waiting or * NULL in case of error. */ -static virshBlockJobWaitDataPtr +static virshBlockJobWaitData * virshBlockJobWaitInit(vshControl *ctl, virDomainPtr dom, const char *dev, @@ -1746,8 +1745,8 @@ virshBlockJobWaitInit(vshControl *ctl, bool async_abort) { virConnectDomainEventGenericCallback cb; - virshBlockJobWaitDataPtr ret; - virshControlPtr priv = ctl->privData; + virshBlockJobWaitData *ret; + virshControl *priv = ctl->privData; ret = g_new0(virshBlockJobWaitData, 1); @@ -1779,9 +1778,9 @@ virshBlockJobWaitInit(vshControl *ctl, static void -virshBlockJobWaitFree(virshBlockJobWaitDataPtr data) +virshBlockJobWaitFree(virshBlockJobWaitData *data) { - virshControlPtr priv = NULL; + virshControl *priv = NULL; if (!data) return; @@ -1813,7 +1812,7 @@ virshBlockJobWaitFree(virshBlockJobWaitDataPtr data) * VIR_DOMAIN_BLOCK_JOB_READY if the block job reaches 100%. */ static int -virshBlockJobWait(virshBlockJobWaitDataPtr data) +virshBlockJobWait(virshBlockJobWaitData *data) { /* For two phase jobs like active commit or block copy, the marker reaches * 100% and an event fires. In case where virsh would not be able to match @@ -2035,7 +2034,7 @@ cmdBlockcommit(vshControl *ctl, const vshCmd *cmd) int abort_flags = 0; unsigned int flags = 0; unsigned long bandwidth = 0; - virshBlockJobWaitDataPtr bjWait = NULL; + virshBlockJobWaitData *bjWait = NULL; VSH_EXCLUSIVE_OPTIONS("pivot", "keep-overlay"); @@ -2282,7 +2281,7 @@ cmdBlockcopy(vshControl *ctl, const vshCmd *cmd) const char *xml = NULL; char *xmlstr = NULL; virTypedParameterPtr params = NULL; - virshBlockJobWaitDataPtr bjWait = NULL; + virshBlockJobWaitData *bjWait = NULL; int nparams = 0; if (vshCommandOptStringReq(ctl, cmd, "path", &path) < 0) @@ -2555,7 +2554,7 @@ virshBlockJobInfo(vshControl *ctl, bool bytes) { virDomainBlockJobInfo info; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; unsigned long long speed; unsigned int flags = 0; int rc = -1; @@ -2787,7 +2786,7 @@ cmdBlockpull(vshControl *ctl, const vshCmd *cmd) const char *base = NULL; unsigned long bandwidth = 0; unsigned int flags = 0; - virshBlockJobWaitDataPtr bjWait = NULL; + virshBlockJobWaitData *bjWait = NULL; VSH_REQUIRE_OPTION("verbose", "wait"); VSH_REQUIRE_OPTION("async", "wait"); @@ -2966,7 +2965,7 @@ cmdRunConsole(vshControl *ctl, virDomainPtr dom, unsigned int flags) { int state; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if ((state = virshDomainState(ctl, dom, NULL)) < 0) { vshError(ctl, "%s", _("Unable to get domain status")); @@ -3667,7 +3666,7 @@ cmdUndefine(vshControl *ctl, const vshCmd *cmd) char *pool = NULL; size_t i; size_t j; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; VSH_REQUIRE_OPTION("delete-storage-volume-snapshots", "remove-all-storage"); VSH_EXCLUSIVE_OPTIONS("nvram", "keep-nvram"); @@ -4539,7 +4538,7 @@ cmdSaveImageDumpxml(vshControl *ctl, const vshCmd *cmd) bool ret = false; unsigned int flags = 0; char *xml = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "security-info")) flags |= VIR_DOMAIN_XML_SECURE; @@ -4598,7 +4597,7 @@ cmdSaveImageDefine(vshControl *ctl, const vshCmd *cmd) const char *xmlfile = NULL; char *xml = NULL; unsigned int flags = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "running")) flags |= VIR_DOMAIN_SAVE_RUNNING; @@ -4660,7 +4659,7 @@ cmdSaveImageEdit(vshControl *ctl, const vshCmd *cmd) bool ret = false; unsigned int getxml_flags = VIR_DOMAIN_XML_SECURE; unsigned int define_flags = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "running")) define_flags |= VIR_DOMAIN_SAVE_RUNNING; @@ -5333,7 +5332,7 @@ cmdRestore(vshControl *ctl, const vshCmd *cmd) unsigned int flags = 0; const char *xmlfile = NULL; char *xml = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) return false; @@ -5608,7 +5607,7 @@ cmdScreenshot(vshControl *ctl, const vshCmd *cmd) bool created = false; bool generated = false; char *mime = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virshStreamCallbackData cbdata; if (vshCommandOptStringReq(ctl, cmd, "file", (const char **) &file) < 0) @@ -6791,13 +6790,13 @@ virshVcpuinfoPrintAffinity(vshControl *ctl, } -static virBitmapPtr +static virBitmap * virshDomainGetVcpuBitmap(vshControl *ctl, virDomainPtr dom, bool inactive) { unsigned int flags = 0; - virBitmapPtr ret = NULL; + virBitmap *ret = NULL; xmlDocPtr xml = NULL; xmlXPathContextPtr ctxt = NULL; xmlNodePtr *nodes = NULL; @@ -6916,7 +6915,7 @@ cmdVcpuinfo(vshControl *ctl, const vshCmd *cmd) size_t cpumaplen; bool pretty = vshCommandOptBool(cmd, "pretty"); int n; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (!(dom = virshCommandOptDomain(ctl, cmd, NULL))) return false; @@ -7032,7 +7031,7 @@ virshVcpuPinQuery(vshControl *ctl, size_t i; int ncpus; bool ret = false; - vshTablePtr table = NULL; + vshTable *table = NULL; if ((ncpus = virshCPUCountCollect(ctl, dom, countFlags, true)) < 0) { if (ncpus == -1) { @@ -7098,7 +7097,7 @@ virshParseCPUList(vshControl *ctl, int *cpumaplen, const char *cpulist, int maxcpu) { unsigned char *cpumap = NULL; - virBitmapPtr map = NULL; + virBitmap *map = NULL; if (cpulist[0] == 'r') { map = virBitmapNew(maxcpu); @@ -7142,7 +7141,7 @@ cmdVcpuPin(vshControl *ctl, const vshCmd *cmd) bool current = vshCommandOptBool(cmd, "current"); int got_vcpu; unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; VSH_EXCLUSIVE_OPTIONS_VAR(current, live); VSH_EXCLUSIVE_OPTIONS_VAR(current, config); @@ -7240,7 +7239,7 @@ cmdEmulatorPin(vshControl *ctl, const vshCmd *cmd) bool current = vshCommandOptBool(cmd, "current"); bool query = false; /* Query mode if no cpulist */ unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; VSH_EXCLUSIVE_OPTIONS_VAR(current, live); VSH_EXCLUSIVE_OPTIONS_VAR(current, config); @@ -7661,7 +7660,7 @@ cmdIOThreadInfo(vshControl *ctl, const vshCmd *cmd) virDomainIOThreadInfoPtr *info = NULL; size_t i; unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT; - vshTablePtr table = NULL; + vshTable *table = NULL; bool ret = false; int rc; @@ -7764,7 +7763,7 @@ cmdIOThreadPin(vshControl *ctl, const vshCmd *cmd) unsigned char *cpumap = NULL; int cpumaplen; unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; VSH_EXCLUSIVE_OPTIONS_VAR(current, live); VSH_EXCLUSIVE_OPTIONS_VAR(current, config); @@ -8273,7 +8272,7 @@ cmdCreate(vshControl *ctl, const vshCmd *cmd) unsigned int flags = 0; size_t nfds = 0; int *fds = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) return false; @@ -8346,7 +8345,7 @@ cmdDefine(vshControl *ctl, const vshCmd *cmd) bool ret = true; char *buffer; unsigned int flags = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) return false; @@ -9615,7 +9614,7 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd) g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; bool pretty = vshCommandOptBool(cmd, "pretty"); bool returnval = vshCommandOptBool(cmd, "return-value"); - virJSONValuePtr formatjson; + virJSONValue *formatjson; g_autofree char *jsonstr = NULL; VSH_EXCLUSIVE_OPTIONS("hmp", "pretty"); @@ -9690,7 +9689,7 @@ virshEventQemuPrint(virConnectPtr conn G_GNUC_UNUSED, void *opaque) { virshQemuEventData *data = opaque; - virJSONValuePtr pretty = NULL; + virJSONValue *pretty = NULL; char *str = NULL; if (!data->loop && data->count) @@ -9775,7 +9774,7 @@ cmdQemuMonitorEvent(vshControl *ctl, const vshCmd *cmd) int timeout = 0; const char *event = NULL; virshQemuEventData data; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "regex")) flags |= VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX; @@ -9859,7 +9858,7 @@ cmdQemuAttach(vshControl *ctl, const vshCmd *cmd) virDomainPtr dom = NULL; unsigned int flags = 0; unsigned int pid_value; /* API uses unsigned int, not pid_t */ - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptUInt(ctl, cmd, "pid", &pid_value) <= 0) return false; @@ -9927,7 +9926,7 @@ cmdQemuAgentCommand(vshControl *ctl, const vshCmd *cmd) unsigned int flags = 0; const vshCmdOpt *opt = NULL; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; - virJSONValuePtr pretty = NULL; + virJSONValue *pretty = NULL; dom = virshCommandOptDomain(ctl, cmd, NULL); if (dom == NULL) @@ -10033,7 +10032,7 @@ cmdLxcEnterNamespace(vshControl *ctl, const vshCmd *cmd) bool setlabel = true; virSecurityModelPtr secmodel = NULL; virSecurityLabelPtr seclabel = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; dom = virshCommandOptDomain(ctl, cmd, NULL); if (dom == NULL) @@ -10227,7 +10226,7 @@ cmdDomXMLFromNative(vshControl *ctl, const vshCmd *cmd) char *configData; char *xmlData; unsigned int flags = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "format", &format) < 0 || vshCommandOptStringReq(ctl, cmd, "config", &configFile) < 0) @@ -10284,7 +10283,7 @@ cmdDomXMLToNative(vshControl *ctl, const vshCmd *cmd) char *configData = NULL; char *xmlData = NULL; unsigned int flags = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virDomainPtr dom = NULL; if (vshCommandOptStringReq(ctl, cmd, "format", &format) < 0 || @@ -11058,7 +11057,7 @@ cmdMigrate(vshControl *ctl, const vshCmd *cmd) unsigned int timeout = 0; virshMigrateTimeoutAction timeoutAction = VIRSH_MIGRATE_TIMEOUT_DEFAULT; bool live_flag = false; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; int iterEvent = -1; g_autoptr(GMainContext) eventCtxt = g_main_context_new(); g_autoptr(GMainLoop) eventLoop = g_main_loop_new(eventCtxt, FALSE); @@ -11597,9 +11596,9 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd) if (virSocketAddrParse(&addr, listen_addr, AF_UNSPEC) > 0 && virSocketAddrIsWildcard(&addr)) { - virConnectPtr conn = ((virshControlPtr)(ctl->privData))->conn; + virConnectPtr conn = ((virshControl *)(ctl->privData))->conn; char *uriStr = virConnectGetURI(conn); - virURIPtr uri = NULL; + virURI *uri = NULL; if (uriStr) { uri = virURIParse(uriStr); @@ -12722,7 +12721,7 @@ cmdEdit(vshControl *ctl, const vshCmd *cmd) virDomainPtr dom_edited = NULL; unsigned int query_flags = VIR_DOMAIN_XML_SECURE | VIR_DOMAIN_XML_INACTIVE; unsigned int define_flags = VIR_DOMAIN_DEFINE_VALIDATE; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; dom = virshCommandOptDomain(ctl, cmd, NULL); if (dom == NULL) @@ -13020,7 +13019,7 @@ typedef struct virshDomEventData virshDomEventData; */ static void virshEventPrint(virshDomEventData *data, - virBufferPtr buf) + virBuffer *buf) { char *msg; @@ -13585,7 +13584,7 @@ cmdEvent(vshControl *ctl, const vshCmd *cmd) bool loop = vshCommandOptBool(cmd, "loop"); bool timestamp = vshCommandOptBool(cmd, "timestamp"); int count = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; VSH_EXCLUSIVE_OPTIONS("all", "event"); VSH_EXCLUSIVE_OPTIONS("list", "all"); @@ -14027,7 +14026,7 @@ cmdDomFSInfo(vshControl *ctl, const vshCmd *cmd) int rc = -1; size_t i, j; virDomainFSInfoPtr *info = NULL; - vshTablePtr table = NULL; + vshTable *table = NULL; size_t ninfos = 0; bool ret = false; diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 747d355456..1eca0bc231 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -50,7 +50,7 @@ static bool cmdCapabilities(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { char *caps; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if ((caps = virConnectGetCapabilities(priv->conn)) == NULL) { vshError(ctl, "%s", _("failed to get capabilities")); @@ -105,7 +105,7 @@ cmdDomCapabilities(vshControl *ctl, const vshCmd *cmd) const char *arch = NULL; const char *machine = NULL; const unsigned int flags = 0; /* No flags so far */ - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "virttype", &virttype) < 0 || vshCommandOptStringReq(ctl, cmd, "emulatorbin", &emulatorbin) < 0 || @@ -169,7 +169,7 @@ cmdFreecell(vshControl *ctl, const vshCmd *cmd) char *cap_xml = NULL; xmlDocPtr xml = NULL; xmlXPathContextPtr ctxt = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; VSH_EXCLUSIVE_OPTIONS_VAR(all, cellno); @@ -312,7 +312,7 @@ cmdFreepages(vshControl *ctl, const vshCmd *cmd) bool all = vshCommandOptBool(cmd, "all"); bool cellno = vshCommandOptBool(cmd, "cellno"); bool pagesz = vshCommandOptBool(cmd, "pagesize"); - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; VSH_EXCLUSIVE_OPTIONS_VAR(all, cellno); @@ -509,7 +509,7 @@ cmdAllocpages(vshControl *ctl, const vshCmd *cmd) xmlDocPtr xml = NULL; xmlXPathContextPtr ctxt = NULL; xmlNodePtr *nodes = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; VSH_EXCLUSIVE_OPTIONS_VAR(all, cellno); @@ -608,7 +608,7 @@ cmdMaxvcpus(vshControl *ctl, const vshCmd *cmd) char *caps = NULL; xmlDocPtr xml = NULL; xmlXPathContextPtr ctxt = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; bool ret = false; if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0) @@ -654,7 +654,7 @@ static bool cmdNodeinfo(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { virNodeInfo info; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (virNodeGetInfo(priv->conn, &info) < 0) { vshError(ctl, "%s", _("failed to get node information")); @@ -703,7 +703,7 @@ cmdNodeCpuMap(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) unsigned int online; bool pretty = vshCommandOptBool(cmd, "pretty"); bool ret = false; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; cpunum = virNodeGetCPUMap(priv->conn, &cpumap, &online, 0); if (cpunum < 0) { @@ -801,7 +801,7 @@ cmdNodeCpuStats(vshControl *ctl, const vshCmd *cmd) bool ret = false; unsigned long long cpu_stats[VIRSH_CPU_LAST] = { 0 }; bool present[VIRSH_CPU_LAST] = { false }; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptInt(ctl, cmd, "cpu", &cpuNum) < 0) return false; @@ -912,7 +912,7 @@ cmdNodeMemStats(vshControl *ctl, const vshCmd *cmd) int cellNum = VIR_NODE_MEMORY_STATS_ALL_CELLS; virNodeMemoryStatsPtr params = NULL; bool ret = false; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptInt(ctl, cmd, "cell", &cellNum) < 0) return false; @@ -982,7 +982,7 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd) const char *target = NULL; unsigned int suspendTarget; long long duration; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "target", &target) < 0) return false; @@ -1030,7 +1030,7 @@ static bool cmdSysinfo(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { char *sysinfo; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; sysinfo = virConnectGetSysinfo(priv->conn, 0); if (sysinfo == NULL) { @@ -1061,7 +1061,7 @@ static bool cmdHostname(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { char *hostname; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; hostname = virConnectGetHostname(priv->conn); if (hostname == NULL) { @@ -1092,7 +1092,7 @@ static bool cmdURI(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { char *uri; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; uri = virConnectGetURI(priv->conn); if (uri == NULL) { @@ -1230,7 +1230,7 @@ cmdCPUCompare(vshControl *ctl, const vshCmd *cmd) int result; char **cpus = NULL; unsigned int flags = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "error")) flags |= VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE; @@ -1311,7 +1311,7 @@ cmdCPUBaseline(vshControl *ctl, const vshCmd *cmd) char *result = NULL; char **list = NULL; unsigned int flags = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "features")) flags |= VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES; @@ -1367,7 +1367,7 @@ cmdCPUModelNames(vshControl *ctl, const vshCmd *cmd) size_t i; int nmodels; const char *arch = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "arch", &arch) < 0) return false; @@ -1425,7 +1425,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) unsigned int major; unsigned int minor; unsigned int rel; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; hvType = virConnectGetType(priv->conn); if (hvType == NULL) { @@ -1532,7 +1532,7 @@ cmdNodeMemoryTune(vshControl *ctl, const vshCmd *cmd) bool ret = false; int rc = -1; size_t i; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if ((rc = vshCommandOptUInt(ctl, cmd, "shm-pages-to-scan", &value)) < 0) { goto cleanup; @@ -1664,7 +1664,7 @@ cmdHypervisorCPUCompare(vshControl *ctl, int result; char **cpus = NULL; unsigned int flags = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "error")) flags |= VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE; @@ -1778,7 +1778,7 @@ cmdHypervisorCPUBaseline(vshControl *ctl, char *result = NULL; char **list = NULL; unsigned int flags = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "features")) flags |= VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES; diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index a11d4ba607..41acae5dcb 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -49,7 +49,7 @@ virshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd, const char *n = NULL; bool is_mac = false; virMacAddr dummy; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virCheckFlags(VIRSH_BYNAME | VIRSH_BYMAC, NULL); @@ -112,7 +112,7 @@ cmdInterfaceEdit(vshControl *ctl, const vshCmd *cmd) virInterfacePtr iface = NULL; virInterfacePtr iface_edited = NULL; unsigned int flags = VIR_INTERFACE_XML_INACTIVE; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; iface = virshCommandOptInterface(ctl, cmd, NULL); if (iface == NULL) @@ -164,10 +164,9 @@ struct virshInterfaceList { virInterfacePtr *ifaces; size_t nifaces; }; -typedef struct virshInterfaceList *virshInterfaceListPtr; static void -virshInterfaceListFree(virshInterfaceListPtr list) +virshInterfaceListFree(struct virshInterfaceList *list) { size_t i; @@ -181,11 +180,11 @@ virshInterfaceListFree(virshInterfaceListPtr list) g_free(list); } -static virshInterfaceListPtr +static struct virshInterfaceList * virshInterfaceListCollect(vshControl *ctl, unsigned int flags) { - virshInterfaceListPtr list = g_new0(struct virshInterfaceList, 1); + struct virshInterfaceList *list = g_new0(struct virshInterfaceList, 1); size_t i; int ret; char **activeNames = NULL; @@ -196,7 +195,7 @@ virshInterfaceListCollect(vshControl *ctl, int nActiveIfaces = 0; int nInactiveIfaces = 0; int nAllIfaces = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; /* try the list with flags support (0.10.2 and later) */ if ((ret = virConnectListAllInterfaces(priv->conn, @@ -346,10 +345,10 @@ cmdInterfaceList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) bool inactive = vshCommandOptBool(cmd, "inactive"); bool all = vshCommandOptBool(cmd, "all"); unsigned int flags = VIR_CONNECT_LIST_INTERFACES_ACTIVE; - virshInterfaceListPtr list = NULL; + struct virshInterfaceList *list = NULL; size_t i; bool ret = false; - vshTablePtr table = NULL; + vshTable *table = NULL; VSH_EXCLUSIVE_OPTIONS_VAR(all, inactive); @@ -536,7 +535,7 @@ cmdInterfaceDefine(vshControl *ctl, const vshCmd *cmd) const char *from = NULL; bool ret = true; char *buffer; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) return false; @@ -697,7 +696,7 @@ static const vshCmdOptDef opts_interface_begin[] = { static bool cmdInterfaceBegin(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (virInterfaceChangeBegin(priv->conn, 0) < 0) { vshError(ctl, "%s", _("Failed to begin network config change transaction")); @@ -728,7 +727,7 @@ static const vshCmdOptDef opts_interface_commit[] = { static bool cmdInterfaceCommit(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (virInterfaceChangeCommit(priv->conn, 0) < 0) { vshError(ctl, "%s", _("Failed to commit network config change transaction")); @@ -759,7 +758,7 @@ static const vshCmdOptDef opts_interface_rollback[] = { static bool cmdInterfaceRollback(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (virInterfaceChangeRollback(priv->conn, 0) < 0) { vshError(ctl, "%s", _("Failed to rollback network config change transaction")); @@ -825,7 +824,7 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd) xmlDocPtr xml_doc = NULL; xmlXPathContextPtr ctxt = NULL; xmlNodePtr top_node, br_node, if_node, cur; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; /* Get a handle to the original device */ if (!(if_handle = virshCommandOptInterfaceBy(ctl, cmd, "interface", @@ -1047,7 +1046,7 @@ cmdInterfaceUnbridge(vshControl *ctl, const vshCmd *cmd) xmlDocPtr xml_doc = NULL; xmlXPathContextPtr ctxt = NULL; xmlNodePtr top_node, if_node, cur; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; /* Get a handle to the original device */ if (!(br_handle = virshCommandOptInterfaceBy(ctl, cmd, "bridge", diff --git a/tools/virsh-network.c b/tools/virsh-network.c index a203fa64ff..d95db7f6d1 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -69,7 +69,7 @@ virshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd, virNetworkPtr network = NULL; const char *n = NULL; const char *optname = "network"; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virCheckFlags(VIRSH_BYUUID | VIRSH_BYNAME, NULL); @@ -207,7 +207,7 @@ cmdNetworkCreate(vshControl *ctl, const vshCmd *cmd) const char *from = NULL; bool ret = true; char *buffer; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) return false; @@ -255,7 +255,7 @@ cmdNetworkDefine(vshControl *ctl, const vshCmd *cmd) const char *from = NULL; bool ret = true; char *buffer; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) return false; @@ -447,10 +447,9 @@ struct virshNetworkList { virNetworkPtr *nets; size_t nnets; }; -typedef struct virshNetworkList *virshNetworkListPtr; static void -virshNetworkListFree(virshNetworkListPtr list) +virshNetworkListFree(struct virshNetworkList *list) { size_t i; @@ -464,11 +463,11 @@ virshNetworkListFree(virshNetworkListPtr list) g_free(list); } -static virshNetworkListPtr +static struct virshNetworkList * virshNetworkListCollect(vshControl *ctl, unsigned int flags) { - virshNetworkListPtr list = g_new0(struct virshNetworkList, 1); + struct virshNetworkList *list = g_new0(struct virshNetworkList, 1); size_t i; int ret; char **names = NULL; @@ -480,7 +479,7 @@ virshNetworkListCollect(vshControl *ctl, int nActiveNets = 0; int nInactiveNets = 0; int nAllNets = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; /* try the list with flags support (0.10.2 and later) */ if ((ret = virConnectListAllNetworks(priv->conn, @@ -704,7 +703,7 @@ static const vshCmdOptDef opts_network_list[] = { static bool cmdNetworkList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { - virshNetworkListPtr list = NULL; + struct virshNetworkList *list = NULL; size_t i; bool ret = false; bool optName = vshCommandOptBool(cmd, "name"); @@ -712,7 +711,7 @@ cmdNetworkList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) bool optUUID = vshCommandOptBool(cmd, "uuid"); char uuid[VIR_UUID_STRING_BUFLEN]; unsigned int flags = VIR_CONNECT_LIST_NETWORKS_ACTIVE; - vshTablePtr table = NULL; + vshTable *table = NULL; if (vshCommandOptBool(cmd, "inactive")) flags = VIR_CONNECT_LIST_NETWORKS_INACTIVE; @@ -1142,7 +1141,7 @@ cmdNetworkEdit(vshControl *ctl, const vshCmd *cmd) bool ret = false; virNetworkPtr network = NULL; virNetworkPtr network_edited = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; network = virshCommandOptNetwork(ctl, cmd, NULL); if (network == NULL) @@ -1290,7 +1289,7 @@ cmdNetworkEvent(vshControl *ctl, const vshCmd *cmd) virshNetEventData data; const char *eventName = NULL; int event; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "list")) { size_t i; @@ -1408,7 +1407,7 @@ cmdNetworkDHCPLeases(vshControl *ctl, const vshCmd *cmd) size_t i; unsigned int flags = 0; virNetworkPtr network = NULL; - vshTablePtr table = NULL; + vshTable *table = NULL; if (vshCommandOptStringReq(ctl, cmd, "mac", &mac) < 0) return false; @@ -1664,10 +1663,9 @@ struct virshNetworkPortList { virNetworkPortPtr *ports; size_t nports; }; -typedef struct virshNetworkPortList *virshNetworkPortListPtr; static void -virshNetworkPortListFree(virshNetworkPortListPtr list) +virshNetworkPortListFree(struct virshNetworkPortList *list) { size_t i; @@ -1681,12 +1679,12 @@ virshNetworkPortListFree(virshNetworkPortListPtr list) g_free(list); } -static virshNetworkPortListPtr +static struct virshNetworkPortList * virshNetworkPortListCollect(vshControl *ctl, const vshCmd *cmd, unsigned int flags) { - virshNetworkPortListPtr list = g_new0(struct virshNetworkPortList, 1); + struct virshNetworkPortList *list = g_new0(struct virshNetworkPortList, 1); int ret; virNetworkPtr network = NULL; bool success = false; @@ -1749,14 +1747,14 @@ static const vshCmdOptDef opts_network_port_list[] = { static bool cmdNetworkPortList(vshControl *ctl, const vshCmd *cmd) { - virshNetworkPortListPtr list = NULL; + struct virshNetworkPortList *list = NULL; size_t i; bool ret = false; bool optTable = vshCommandOptBool(cmd, "table"); bool optUUID = vshCommandOptBool(cmd, "uuid"); char uuid[VIR_UUID_STRING_BUFLEN]; unsigned int flags = 0; - vshTablePtr table = NULL; + vshTable *table = NULL; if (optTable + optUUID > 1) { vshError(ctl, "%s", diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index 8b59b1f452..8c2086b71f 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -59,7 +59,7 @@ cmdNodeDeviceCreate(vshControl *ctl, const vshCmd *cmd) const char *from = NULL; bool ret = true; char *buffer; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) return false; @@ -117,7 +117,7 @@ vshFindNodeDevice(vshControl *ctl, const char *value) virNodeDevicePtr dev = NULL; char **arr = NULL; int narr; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (strchr(value, ',')) { narr = vshStringToArray(value, &arr); @@ -206,10 +206,9 @@ struct virshNodeDeviceList { virNodeDevicePtr *devices; size_t ndevices; }; -typedef struct virshNodeDeviceList *virshNodeDeviceListPtr; static void -virshNodeDeviceListFree(virshNodeDeviceListPtr list) +virshNodeDeviceListFree(struct virshNodeDeviceList *list) { size_t i; @@ -223,13 +222,13 @@ virshNodeDeviceListFree(virshNodeDeviceListPtr list) g_free(list); } -static virshNodeDeviceListPtr +static struct virshNodeDeviceList * virshNodeDeviceListCollect(vshControl *ctl, char **capnames, int ncapnames, unsigned int flags) { - virshNodeDeviceListPtr list = g_new0(struct virshNodeDeviceList, 1); + struct virshNodeDeviceList *list = g_new0(struct virshNodeDeviceList, 1); size_t i; int ret; virNodeDevicePtr device; @@ -237,7 +236,7 @@ virshNodeDeviceListCollect(vshControl *ctl, size_t deleted = 0; int ndevices = 0; char **names = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; /* try the list with flags support (0.10.2 and later) */ if ((ret = virConnectListAllNodeDevices(priv->conn, @@ -412,7 +411,7 @@ cmdNodeListDevices(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) unsigned int flags = 0; char **caps = NULL; int ncaps = 0; - virshNodeDeviceListPtr list = NULL; + struct virshNodeDeviceList *list = NULL; int cap_type = -1; bool inactive = vshCommandOptBool(cmd, "inactive"); bool all = vshCommandOptBool(cmd, "all"); @@ -649,7 +648,7 @@ cmdNodeDeviceDetach(vshControl *ctl, const vshCmd *cmd) const char *driverName = NULL; virNodeDevicePtr device; bool ret = true; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "device", &name) < 0) return false; @@ -711,7 +710,7 @@ cmdNodeDeviceReAttach(vshControl *ctl, const vshCmd *cmd) const char *name = NULL; virNodeDevicePtr device; bool ret = true; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "device", &name) < 0) return false; @@ -762,7 +761,7 @@ cmdNodeDeviceReset(vshControl *ctl, const vshCmd *cmd) const char *name = NULL; virNodeDevicePtr device; bool ret = true; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "device", &name) < 0) return false; @@ -931,7 +930,7 @@ cmdNodeDeviceEvent(vshControl *ctl, const vshCmd *cmd) const char *eventName = NULL; const char *device_value = NULL; int event; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "list")) { size_t i; diff --git a/tools/virsh-nwfilter.c b/tools/virsh-nwfilter.c index 0d09a016bc..640e54446e 100644 --- a/tools/virsh-nwfilter.c +++ b/tools/virsh-nwfilter.c @@ -33,7 +33,7 @@ virshCommandOptNWFilterBy(vshControl *ctl, const vshCmd *cmd, virNWFilterPtr nwfilter = NULL; const char *n = NULL; const char *optname = "nwfilter"; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virCheckFlags(VIRSH_BYUUID | VIRSH_BYNAME, NULL); @@ -91,7 +91,7 @@ cmdNWFilterDefine(vshControl *ctl, const vshCmd *cmd) const char *from = NULL; bool ret = true; char *buffer; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) return false; @@ -222,10 +222,9 @@ struct virshNWFilterList { virNWFilterPtr *filters; size_t nfilters; }; -typedef struct virshNWFilterList *virshNWFilterListPtr; static void -virshNWFilterListFree(virshNWFilterListPtr list) +virshNWFilterListFree(struct virshNWFilterList *list) { size_t i; @@ -239,11 +238,11 @@ virshNWFilterListFree(virshNWFilterListPtr list) g_free(list); } -static virshNWFilterListPtr +static struct virshNWFilterList * virshNWFilterListCollect(vshControl *ctl, unsigned int flags) { - virshNWFilterListPtr list = g_new0(struct virshNWFilterList, 1); + struct virshNWFilterList *list = g_new0(struct virshNWFilterList, 1); size_t i; int ret; virNWFilterPtr filter; @@ -251,7 +250,7 @@ virshNWFilterListCollect(vshControl *ctl, size_t deleted = 0; int nfilters = 0; char **names = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; /* try the list with flags support (0.10.2 and later) */ if ((ret = virConnectListAllNWFilters(priv->conn, @@ -354,8 +353,8 @@ cmdNWFilterList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) size_t i; char uuid[VIR_UUID_STRING_BUFLEN]; bool ret = false; - virshNWFilterListPtr list = NULL; - vshTablePtr table = NULL; + struct virshNWFilterList *list = NULL; + vshTable *table = NULL; if (!(list = virshNWFilterListCollect(ctl, 0))) return false; @@ -413,7 +412,7 @@ cmdNWFilterEdit(vshControl *ctl, const vshCmd *cmd) bool ret = false; virNWFilterPtr nwfilter = NULL; virNWFilterPtr nwfilter_edited = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; nwfilter = virshCommandOptNWFilter(ctl, cmd, NULL); if (nwfilter == NULL) @@ -456,7 +455,7 @@ virshCommandOptNWFilterBindingBy(vshControl *ctl, virNWFilterBindingPtr binding = NULL; const char *n = NULL; const char *optname = "binding"; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virCheckFlags(0, NULL); @@ -506,7 +505,7 @@ cmdNWFilterBindingCreate(vshControl *ctl, const vshCmd *cmd) const char *from = NULL; bool ret = true; char *buffer; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) return false; @@ -641,11 +640,10 @@ struct virshNWFilterBindingList { virNWFilterBindingPtr *bindings; size_t nbindings; }; -typedef struct virshNWFilterBindingList *virshNWFilterBindingListPtr; static void -virshNWFilterBindingListFree(virshNWFilterBindingListPtr list) +virshNWFilterBindingListFree(struct virshNWFilterBindingList *list) { size_t i; @@ -660,14 +658,14 @@ virshNWFilterBindingListFree(virshNWFilterBindingListPtr list) } -static virshNWFilterBindingListPtr +static struct virshNWFilterBindingList * virshNWFilterBindingListCollect(vshControl *ctl, unsigned int flags) { - virshNWFilterBindingListPtr list = g_new0(struct virshNWFilterBindingList, 1); + struct virshNWFilterBindingList *list = g_new0(struct virshNWFilterBindingList, 1); int ret; bool success = false; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if ((ret = virConnectListAllNWFilterBindings(priv->conn, &list->bindings, @@ -718,8 +716,8 @@ cmdNWFilterBindingList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { size_t i; bool ret = false; - virshNWFilterBindingListPtr list = NULL; - vshTablePtr table = NULL; + struct virshNWFilterBindingList *list = NULL; + vshTable *table = NULL; if (!(list = virshNWFilterBindingListCollect(ctl, 0))) return false; diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index 5256b50589..e8d3c33506 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -153,7 +153,7 @@ virshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname, { virStoragePoolPtr pool = NULL; const char *n = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virCheckFlags(VIRSH_BYUUID | VIRSH_BYNAME, NULL); @@ -274,7 +274,7 @@ cmdPoolCreate(vshControl *ctl, const vshCmd *cmd) bool overwrite; bool no_overwrite; unsigned int flags = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) return false; @@ -469,7 +469,7 @@ cmdPoolCreateAs(vshControl *ctl, const vshCmd *cmd) bool overwrite; bool no_overwrite; unsigned int flags = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; build = vshCommandOptBool(cmd, "build"); overwrite = vshCommandOptBool(cmd, "overwrite"); @@ -533,7 +533,7 @@ cmdPoolDefine(vshControl *ctl, const vshCmd *cmd) const char *from = NULL; bool ret = true; char *buffer; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) return false; @@ -575,7 +575,7 @@ cmdPoolDefineAs(vshControl *ctl, const vshCmd *cmd) const char *name; char *xml; bool printXML = vshCommandOptBool(cmd, "print-xml"); - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (!virshBuildPoolXML(ctl, cmd, &name, &xml)) return false; @@ -838,10 +838,9 @@ struct virshStoragePoolList { virStoragePoolPtr *pools; size_t npools; }; -typedef struct virshStoragePoolList *virshStoragePoolListPtr; static void -virshStoragePoolListFree(virshStoragePoolListPtr list) +virshStoragePoolListFree(struct virshStoragePoolList *list) { size_t i; @@ -855,11 +854,11 @@ virshStoragePoolListFree(virshStoragePoolListPtr list) g_free(list); } -static virshStoragePoolListPtr +static struct virshStoragePoolList * virshStoragePoolListCollect(vshControl *ctl, unsigned int flags) { - virshStoragePoolListPtr list = g_new0(struct virshStoragePoolList, 1); + struct virshStoragePoolList *list = g_new0(struct virshStoragePoolList, 1); size_t i; int ret; char **names = NULL; @@ -871,7 +870,7 @@ virshStoragePoolListCollect(vshControl *ctl, int nActivePools = 0; int nInactivePools = 0; int nAllPools = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; /* try the list with flags support (0.10.2 and later) */ if ((ret = virConnectListAllStoragePools(priv->conn, @@ -1135,13 +1134,13 @@ cmdPoolList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) }; struct poolInfoText *poolInfoTexts = NULL; unsigned int flags = VIR_CONNECT_LIST_STORAGE_POOLS_ACTIVE; - virshStoragePoolListPtr list = NULL; + struct virshStoragePoolList *list = NULL; const char *type = NULL; bool details = vshCommandOptBool(cmd, "details"); bool inactive, all; bool uuid = false; bool name = false; - vshTablePtr table = NULL; + vshTable *table = NULL; inactive = vshCommandOptBool(cmd, "inactive"); all = vshCommandOptBool(cmd, "all"); @@ -1454,7 +1453,7 @@ cmdPoolDiscoverSourcesAs(vshControl * ctl, const vshCmd * cmd G_GNUC_UNUSED) char *srcSpec = NULL; char *srcList; const char *initiator = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0 || vshCommandOptStringReq(ctl, cmd, "host", &host) < 0 || @@ -1530,7 +1529,7 @@ cmdPoolDiscoverSources(vshControl * ctl, const vshCmd * cmd G_GNUC_UNUSED) { const char *type = NULL, *srcSpecFile = NULL; char *srcSpec = NULL, *srcList; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0) return false; @@ -1842,7 +1841,7 @@ cmdPoolEdit(vshControl *ctl, const vshCmd *cmd) virStoragePoolPtr pool_edited = NULL; unsigned int flags = VIR_STORAGE_XML_INACTIVE; char *tmp_desc = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; pool = virshCommandOptPool(ctl, cmd, "pool", NULL); if (pool == NULL) @@ -2037,7 +2036,7 @@ cmdPoolEvent(vshControl *ctl, const vshCmd *cmd) virshPoolEventData data; const char *eventName = NULL; int event; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "list")) { size_t i; @@ -2128,7 +2127,7 @@ cmdPoolCapabilities(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { const unsigned int flags = 0; /* No flags so far */ - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; g_autofree char *caps = NULL; caps = virConnectGetStoragePoolCapabilities(priv->conn, flags); diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index 7ca3e864da..cfecbb9b95 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -39,7 +39,7 @@ virshCommandOptSecret(vshControl *ctl, const vshCmd *cmd, const char **name) virSecretPtr secret = NULL; const char *n = NULL; const char *optname = "secret"; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, optname, &n) < 0) return NULL; @@ -84,7 +84,7 @@ cmdSecretDefine(vshControl *ctl, const vshCmd *cmd) virSecretPtr res; char uuid[VIR_UUID_STRING_BUFLEN]; bool ret = false; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0) return false; @@ -399,10 +399,9 @@ struct virshSecretList { virSecretPtr *secrets; size_t nsecrets; }; -typedef struct virshSecretList *virshSecretListPtr; static void -virshSecretListFree(virshSecretListPtr list) +virshSecretListFree(struct virshSecretList *list) { size_t i; @@ -415,11 +414,11 @@ virshSecretListFree(virshSecretListPtr list) g_free(list); } -static virshSecretListPtr +static struct virshSecretList * virshSecretListCollect(vshControl *ctl, unsigned int flags) { - virshSecretListPtr list = g_new0(struct virshSecretList, 1); + struct virshSecretList *list = g_new0(struct virshSecretList, 1); size_t i; int ret; virSecretPtr secret; @@ -427,7 +426,7 @@ virshSecretListCollect(vshControl *ctl, size_t deleted = 0; int nsecrets = 0; char **uuids = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; /* try the list with flags support (0.10.2 and later) */ if ((ret = virConnectListAllSecrets(priv->conn, @@ -549,10 +548,10 @@ static bool cmdSecretList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { size_t i; - virshSecretListPtr list = NULL; + struct virshSecretList *list = NULL; bool ret = false; unsigned int flags = 0; - vshTablePtr table = NULL; + vshTable *table = NULL; if (vshCommandOptBool(cmd, "ephemeral")) flags |= VIR_CONNECT_LIST_SECRETS_EPHEMERAL; @@ -759,7 +758,7 @@ cmdSecretEvent(vshControl *ctl, const vshCmd *cmd) virshSecretEventData data; const char *eventName = NULL; int event; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "list")) { size_t i; diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 1b10ef37e3..2bc2cb7e23 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -216,7 +216,7 @@ cmdSnapshotCreate(vshControl *ctl, const vshCmd *cmd) * "snapshot-create-as" command */ static int -virshParseSnapshotMemspec(vshControl *ctl, virBufferPtr buf, const char *str) +virshParseSnapshotMemspec(vshControl *ctl, virBuffer *buf, const char *str) { int ret = -1; const char *snapshot = NULL; @@ -256,7 +256,7 @@ virshParseSnapshotMemspec(vshControl *ctl, virBufferPtr buf, const char *str) } static int -virshParseSnapshotDiskspec(vshControl *ctl, virBufferPtr buf, const char *str) +virshParseSnapshotDiskspec(vshControl *ctl, virBuffer *buf, const char *str) { int ret = -1; const char *name = NULL; @@ -738,7 +738,7 @@ virshGetSnapshotParent(vshControl *ctl, virDomainSnapshotPtr snapshot, xmlDocPtr xmldoc = NULL; xmlXPathContextPtr ctxt = NULL; int ret = -1; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; *parent_name = NULL; @@ -883,7 +883,7 @@ cmdSnapshotInfo(vshControl *ctl, const vshCmd *cmd) unsigned int flags; int current; int metadata; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; dom = virshCommandOptDomain(ctl, cmd, NULL); if (dom == NULL) @@ -1020,10 +1020,9 @@ struct virshSnapshotList { struct virshSnap *snaps; int nsnaps; }; -typedef struct virshSnapshotList *virshSnapshotListPtr; static void -virshSnapshotListFree(virshSnapshotListPtr snaplist) +virshSnapshotListFree(struct virshSnapshotList *snaplist) { size_t i; @@ -1058,7 +1057,7 @@ virshSnapSorter(const void *a, const void *b) * list is limited to descendants of the given snapshot. If FLAGS is * given, the list is filtered. If TREE is specified, then all but * FROM or the roots will also have parent information. */ -static virshSnapshotListPtr +static struct virshSnapshotList * virshSnapshotListCollect(vshControl *ctl, virDomainPtr dom, virDomainSnapshotPtr from, unsigned int orig_flags, bool tree) @@ -1069,14 +1068,14 @@ virshSnapshotListCollect(vshControl *ctl, virDomainPtr dom, bool descendants = false; bool roots = false; virDomainSnapshotPtr *snaps; - virshSnapshotListPtr snaplist = g_new0(struct virshSnapshotList, 1); - virshSnapshotListPtr ret = NULL; + struct virshSnapshotList *snaplist = g_new0(struct virshSnapshotList, 1); + struct virshSnapshotList *ret = NULL; const char *fromname = NULL; int start_index = -1; int deleted = 0; bool filter_fallback = false; unsigned int flags = orig_flags; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; /* Try the interface available in 0.9.13 and newer. */ if (!priv->useSnapshotOld) { @@ -1388,7 +1387,7 @@ virshSnapshotListCollect(vshControl *ctl, virDomainPtr dom, static const char * virshSnapshotListLookup(int id, bool parent, void *opaque) { - virshSnapshotListPtr snaplist = opaque; + struct virshSnapshotList *snaplist = opaque; if (parent) return snaplist->snaps[id].parent; return virDomainSnapshotGetName(snaplist->snaps[id].snap); @@ -1502,8 +1501,8 @@ cmdSnapshotList(vshControl *ctl, const vshCmd *cmd) const char *from_snap = NULL; char *parent_snap = NULL; virDomainSnapshotPtr start = NULL; - virshSnapshotListPtr snaplist = NULL; - vshTablePtr table = NULL; + struct virshSnapshotList *snaplist = NULL; + vshTable *table = NULL; VSH_EXCLUSIVE_OPTIONS_VAR(tree, name); VSH_EXCLUSIVE_OPTIONS_VAR(parent, roots); diff --git a/tools/virsh-util.c b/tools/virsh-util.c index 9f69bad8cc..97b8f4d5c3 100644 --- a/tools/virsh-util.c +++ b/tools/virsh-util.c @@ -33,7 +33,7 @@ virshLookupDomainInternal(vshControl *ctl, { virDomainPtr dom = NULL; int id; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virCheckFlags(VIRSH_BYID | VIRSH_BYUUID | VIRSH_BYNAME, NULL); @@ -117,7 +117,7 @@ virshDomainState(vshControl *ctl, int *reason) { virDomainInfo info; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if (reason) *reason = -1; @@ -148,7 +148,7 @@ virshStreamSink(virStreamPtr st G_GNUC_UNUSED, size_t nbytes, void *opaque) { - virshStreamCallbackDataPtr cbData = opaque; + virshStreamCallbackData *cbData = opaque; return safewrite(cbData->fd, bytes, nbytes); } @@ -160,7 +160,7 @@ virshStreamSource(virStreamPtr st G_GNUC_UNUSED, size_t nbytes, void *opaque) { - virshStreamCallbackDataPtr cbData = opaque; + virshStreamCallbackData *cbData = opaque; int fd = cbData->fd; return saferead(fd, bytes, nbytes); @@ -172,7 +172,7 @@ virshStreamSourceSkip(virStreamPtr st G_GNUC_UNUSED, long long offset, void *opaque) { - virshStreamCallbackDataPtr cbData = opaque; + virshStreamCallbackData *cbData = opaque; int fd = cbData->fd; if (lseek(fd, offset, SEEK_CUR) == (off_t) -1) @@ -187,7 +187,7 @@ virshStreamSkip(virStreamPtr st G_GNUC_UNUSED, long long offset, void *opaque) { - virshStreamCallbackDataPtr cbData = opaque; + virshStreamCallbackData *cbData = opaque; off_t cur; if (cbData->isBlock) { @@ -228,7 +228,7 @@ virshStreamInData(virStreamPtr st G_GNUC_UNUSED, long long *offset, void *opaque) { - virshStreamCallbackDataPtr cbData = opaque; + virshStreamCallbackData *cbData = opaque; vshControl *ctl = cbData->ctl; int fd = cbData->fd; diff --git a/tools/virsh-util.h b/tools/virsh-util.h index 9ef28cfe0a..87673bce9f 100644 --- a/tools/virsh-util.h +++ b/tools/virsh-util.h @@ -68,7 +68,6 @@ virshStreamSink(virStreamPtr st, void *opaque); typedef struct _virshStreamCallbackData virshStreamCallbackData; -typedef virshStreamCallbackData *virshStreamCallbackDataPtr; struct _virshStreamCallbackData { vshControl *ctl; int fd; diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index af2d1d42a3..c7d5ab8c3b 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -71,7 +71,7 @@ virshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd, virStorageVolPtr vol = NULL; virStoragePoolPtr pool = NULL; const char *n = NULL, *p = NULL; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virCheckFlags(VIRSH_BYUUID | VIRSH_BYNAME, NULL); @@ -226,7 +226,7 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd) unsigned long long capacity, allocation = 0; g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER; unsigned long flags = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; bool ret = false; if (vshCommandOptBool(cmd, "prealloc-metadata")) @@ -674,7 +674,7 @@ cmdVolUpload(vshControl *ctl, const vshCmd *cmd) virStreamPtr st = NULL; const char *name = NULL; unsigned long long offset = 0, length = 0; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; unsigned int flags = 0; virshStreamCallbackData cbData; struct stat sb; @@ -797,7 +797,7 @@ cmdVolDownload(vshControl *ctl, const vshCmd *cmd) const char *name = NULL; unsigned long long offset = 0, length = 0; bool created = false; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; virshStreamCallbackData cbData; unsigned int flags = 0; struct stat sb; @@ -1261,10 +1261,9 @@ struct virshStorageVolList { virStorageVolPtr *vols; size_t nvols; }; -typedef struct virshStorageVolList *virshStorageVolListPtr; static void -virshStorageVolListFree(virshStorageVolListPtr list) +virshStorageVolListFree(struct virshStorageVolList *list) { size_t i; @@ -1278,12 +1277,12 @@ virshStorageVolListFree(virshStorageVolListPtr list) g_free(list); } -static virshStorageVolListPtr +static struct virshStorageVolList * virshStorageVolListCollect(vshControl *ctl, virStoragePoolPtr pool, unsigned int flags) { - virshStorageVolListPtr list = g_new0(struct virshStorageVolList, 1); + struct virshStorageVolList *list = g_new0(struct virshStorageVolList, 1); size_t i; char **names = NULL; virStorageVolPtr vol = NULL; @@ -1404,8 +1403,8 @@ cmdVolList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) char *type; }; struct volInfoText *volInfoTexts = NULL; - virshStorageVolListPtr list = NULL; - vshTablePtr table = NULL; + struct virshStorageVolList *list = NULL; + vshTable *table = NULL; /* Look up the pool information given to us by the user */ if (!(pool = virshCommandOptPool(ctl, cmd, "pool", NULL))) diff --git a/tools/virsh.c b/tools/virsh.c index 732655a894..7d7109cfdf 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -119,7 +119,7 @@ virshConnect(vshControl *ctl, const char *uri, bool readonly) int interval = 5; /* Default */ int count = 6; /* Default */ bool keepalive_forced = false; - virPolkitAgentPtr pkagent = NULL; + virPolkitAgent *pkagent = NULL; int authfail = 0; bool agentCreated = false; @@ -194,7 +194,7 @@ static int virshReconnect(vshControl *ctl, const char *name, bool readonly, bool force) { bool connected = false; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; /* If the flag was not specified, then it depends on whether we are * reconnecting to the current URI (in which case we want to keep the @@ -314,7 +314,7 @@ virshConnectionUsability(vshControl *ctl, virConnectPtr conn) static void * virshConnectionHandler(vshControl *ctl) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; if ((!priv->conn || disconnected) && virshReconnect(ctl, NULL, false, false) < 0) @@ -333,7 +333,7 @@ virshConnectionHandler(vshControl *ctl) static bool virshInit(vshControl *ctl) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; /* Since we have the commandline arguments parsed, we need to * reload our initial settings to make debugging and readline @@ -391,7 +391,7 @@ virshDeinitTimer(int timer G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) static bool virshDeinit(vshControl *ctl) { - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; vshDeinit(ctl); VIR_FREE(ctl->connname); @@ -637,7 +637,7 @@ virshParseArgv(vshControl *ctl, int argc, char **argv) int arg, len, debug, keepalive; size_t i; int longindex = -1; - virshControlPtr priv = ctl->privData; + virshControl *priv = ctl->privData; struct option opt[] = { {"connect", required_argument, NULL, 'c'}, {"debug", required_argument, NULL, 'd'}, diff --git a/tools/virsh.h b/tools/virsh.h index 1b896cd535..4d777545ff 100644 --- a/tools/virsh.h +++ b/tools/virsh.h @@ -128,7 +128,6 @@ VIRSH_COMMON_OPT_DOMAIN_OT_ARGV(N_("domain name, id or uuid"), cflags) typedef struct _virshControl virshControl; -typedef virshControl *virshControlPtr; typedef struct _virshCtrlData virshCtrlData; diff --git a/tools/virt-admin-completer.c b/tools/virt-admin-completer.c index 61004beeb5..4c84ea8fc4 100644 --- a/tools/virt-admin-completer.c +++ b/tools/virt-admin-completer.c @@ -31,7 +31,7 @@ vshAdmServerCompleter(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED, unsigned int flags) { - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; virAdmServerPtr *srvs = NULL; int nsrvs = 0; size_t i = 0; diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 1108a07896..3a050ab9ab 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -107,7 +107,7 @@ vshAdmCatchDisconnect(virAdmConnectPtr conn G_GNUC_UNUSED, static int vshAdmConnect(vshControl *ctl, unsigned int flags) { - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; priv->conn = virAdmConnectOpen(ctl->connname, flags); @@ -133,7 +133,7 @@ static int vshAdmDisconnect(vshControl *ctl) { int ret = 0; - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; if (!priv->conn) return ret; @@ -158,7 +158,7 @@ vshAdmDisconnect(vshControl *ctl) static void vshAdmReconnect(vshControl *ctl) { - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; if (priv->conn) priv->wantReconnect = true; @@ -186,7 +186,7 @@ static bool cmdURI(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) { char *uri; - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; uri = virAdmConnectGetURI(priv->conn); if (!uri) { @@ -224,7 +224,7 @@ cmdVersion(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) unsigned int major; unsigned int minor; unsigned int rel; - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; includeVersion = LIBVIR_VERSION_NUMBER; major = includeVersion / 1000000; @@ -290,7 +290,7 @@ static bool cmdConnect(vshControl *ctl, const vshCmd *cmd) { const char *name = NULL; - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; bool connected = priv->conn; if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0) @@ -332,8 +332,8 @@ cmdSrvList(vshControl *ctl, const vshCmd *cmd G_GNUC_UNUSED) bool ret = false; char *uri = NULL; virAdmServerPtr *srvs = NULL; - vshAdmControlPtr priv = ctl->privData; - vshTablePtr table = NULL; + vshAdmControl *priv = ctl->privData; + vshTable *table = NULL; /* Obtain a list of available servers on the daemon */ if ((nsrvs = virAdmConnectListServers(priv->conn, &srvs, 0)) < 0) { @@ -408,7 +408,7 @@ cmdSrvThreadpoolInfo(vshControl *ctl, const vshCmd *cmd) size_t i; const char *srvname = NULL; virAdmServerPtr srv = NULL; - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0) return false; @@ -484,7 +484,7 @@ cmdSrvThreadpoolSet(vshControl *ctl, const vshCmd *cmd) const char *srvname = NULL; virTypedParameterPtr params = NULL; virAdmServerPtr srv = NULL; - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0) return false; @@ -580,8 +580,8 @@ cmdSrvClientsList(vshControl *ctl, const vshCmd *cmd) virClientTransport transport; virAdmServerPtr srv = NULL; virAdmClientPtr *clts = NULL; - vshAdmControlPtr priv = ctl->privData; - vshTablePtr table = NULL; + vshAdmControl *priv = ctl->privData; + vshTable *table = NULL; if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0) return false; @@ -675,7 +675,7 @@ cmdClientInfo(vshControl *ctl, const vshCmd *cmd) virAdmClientPtr clnt = NULL; virTypedParameterPtr params = NULL; int nparams = 0; - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; if (vshCommandOptULongLong(ctl, cmd, "client", &id) < 0) return false; @@ -759,7 +759,7 @@ cmdClientDisconnect(vshControl *ctl, const vshCmd *cmd) unsigned long long id = 0; virAdmServerPtr srv = NULL; virAdmClientPtr client = NULL; - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0) return false; @@ -821,7 +821,7 @@ cmdSrvClientsInfo(vshControl *ctl, const vshCmd *cmd) size_t i; const char *srvname = NULL; virAdmServerPtr srv = NULL; - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0) return false; @@ -893,7 +893,7 @@ cmdSrvClientsSet(vshControl *ctl, const vshCmd *cmd) const char *srvname = NULL; virAdmServerPtr srv = NULL; virTypedParameterPtr params = NULL; - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0) return false; @@ -984,7 +984,7 @@ cmdSrvUpdateTlsFiles(vshControl *ctl, const vshCmd *cmd) const char *srvname = NULL; virAdmServerPtr srv = NULL; - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0) return false; @@ -1034,7 +1034,7 @@ static const vshCmdOptDef opts_daemon_log_filters[] = { static bool cmdDaemonLogFilters(vshControl *ctl, const vshCmd *cmd) { - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "filters")) { const char *filters = NULL; @@ -1087,7 +1087,7 @@ static const vshCmdOptDef opts_daemon_log_outputs[] = { static bool cmdDaemonLogOutputs(vshControl *ctl, const vshCmd *cmd) { - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; if (vshCommandOptBool(cmd, "outputs")) { const char *outputs = NULL; @@ -1113,7 +1113,7 @@ cmdDaemonLogOutputs(vshControl *ctl, const vshCmd *cmd) static void * vshAdmConnectionHandler(vshControl *ctl) { - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; if (!virAdmConnectIsAlive(priv->conn)) vshAdmReconnect(ctl); @@ -1132,7 +1132,7 @@ vshAdmConnectionHandler(vshControl *ctl) static bool vshAdmInit(vshControl *ctl) { - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; /* Since we have the commandline arguments parsed, we need to * reload our initial settings to make debugging and readline @@ -1181,7 +1181,7 @@ vshAdmDeinitTimer(int timer G_GNUC_UNUSED, void *opaque G_GNUC_UNUSED) static void vshAdmDeinit(vshControl *ctl) { - vshAdmControlPtr priv = ctl->privData; + vshAdmControl *priv = ctl->privData; vshDeinit(ctl); VIR_FREE(ctl->connname); diff --git a/tools/virt-admin.h b/tools/virt-admin.h index 9f9fdc503d..81f5937eed 100644 --- a/tools/virt-admin.h +++ b/tools/virt-admin.h @@ -30,7 +30,6 @@ */ typedef struct _vshAdmControl vshAdmControl; -typedef vshAdmControl *vshAdmControlPtr; /* * adminControl diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c index 7e9f5a667c..6dd851f07d 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -188,10 +188,10 @@ int virHostValidateNamespace(const char *hvname, } -virBitmapPtr virHostValidateGetCPUFlags(void) +virBitmap *virHostValidateGetCPUFlags(void) { FILE *fp; - virBitmapPtr flags = NULL; + virBitmap *flags = NULL; if (!(fp = fopen("/proc/cpuinfo", "r"))) return NULL; @@ -327,7 +327,7 @@ int virHostValidateCGroupControllers(const char *hvname G_GNUC_UNUSED, int virHostValidateIOMMU(const char *hvname, virHostValidateLevel level) { - virBitmapPtr flags; + virBitmap *flags; struct stat sb; const char *bootarg = NULL; bool isAMD = false, isIntel = false; @@ -441,7 +441,7 @@ bool virHostKernelModuleIsLoaded(const char *module) int virHostValidateSecureGuests(const char *hvname, virHostValidateLevel level) { - virBitmapPtr flags; + virBitmap *flags; bool hasFac158 = false; bool hasAMDSev = false; virArch arch = virArchFromHost(); diff --git a/tools/virt-host-validate-common.h b/tools/virt-host-validate-common.h index 3df5ea0c7e..08a9997f5f 100644 --- a/tools/virt-host-validate-common.h +++ b/tools/virt-host-validate-common.h @@ -66,7 +66,7 @@ int virHostValidateDeviceAccessible(const char *hvname, virHostValidateLevel level, const char *hint); -virBitmapPtr virHostValidateGetCPUFlags(void); +virBitmap *virHostValidateGetCPUFlags(void); int virHostValidateLinuxKernel(const char *hvname, int version, diff --git a/tools/virt-host-validate-qemu.c b/tools/virt-host-validate-qemu.c index f9432f522d..d225a7e5c8 100644 --- a/tools/virt-host-validate-qemu.c +++ b/tools/virt-host-validate-qemu.c @@ -29,7 +29,7 @@ int virHostValidateQEMU(void) { - virBitmapPtr flags; + virBitmap *flags; int ret = 0; bool hasHwVirt = false; bool hasVirtFlag = false; diff --git a/tools/virt-login-shell-helper.c b/tools/virt-login-shell-helper.c index f848056386..78e351867f 100644 --- a/tools/virt-login-shell-helper.c +++ b/tools/virt-login-shell-helper.c @@ -39,7 +39,7 @@ static const char *conf_file = SYSCONFDIR "/libvirt/virt-login-shell.conf"; -static int virLoginShellAllowedUser(virConfPtr conf, +static int virLoginShellAllowedUser(virConf *conf, const char *name, gid_t *groups, size_t ngroups) @@ -89,7 +89,7 @@ static int virLoginShellAllowedUser(virConfPtr conf, } -static int virLoginShellGetShellArgv(virConfPtr conf, +static int virLoginShellGetShellArgv(virConf *conf, char ***shargv, size_t *shargvlen) { diff --git a/tools/vsh-table.c b/tools/vsh-table.c index c5e57c0d7b..78d1cb27f1 100644 --- a/tools/vsh-table.c +++ b/tools/vsh-table.c @@ -38,13 +38,13 @@ struct _vshTableRow { struct _vshTable { - vshTableRowPtr *rows; + vshTableRow **rows; size_t nrows; }; static void -vshTableRowFree(vshTableRowPtr row) +vshTableRowFree(vshTableRow *row) { size_t i; @@ -60,7 +60,7 @@ vshTableRowFree(vshTableRowPtr row) void -vshTableFree(vshTablePtr table) +vshTableFree(vshTable *table) { size_t i; @@ -82,12 +82,12 @@ vshTableFree(vshTablePtr table) * Create a new row in the table. Each argument passed * represents a cell in the row. * - * Return: pointer to vshTableRowPtr row or NULL. + * Return: pointer to vshTableRow *row or NULL. */ -static vshTableRowPtr +static vshTableRow * vshTableRowNew(const char *arg, va_list ap) { - vshTableRowPtr row = NULL; + vshTableRow *row = NULL; if (!arg) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -124,11 +124,11 @@ vshTableRowNew(const char *arg, va_list ap) * * Returns: pointer to table or NULL. */ -vshTablePtr +vshTable * vshTableNew(const char *arg, ...) { - vshTablePtr table = NULL; - vshTableRowPtr header = NULL; + vshTable *table = NULL; + vshTableRow *header = NULL; va_list ap; table = g_new0(vshTable, 1); @@ -162,9 +162,9 @@ vshTableNew(const char *arg, ...) * Returns: 0 if succeeded, -1 if failed. */ int -vshTableRowAppend(vshTablePtr table, const char *arg, ...) +vshTableRowAppend(vshTable *table, const char *arg, ...) { - vshTableRowPtr row = NULL; + vshTableRow *row = NULL; size_t ncolumns = table->rows[0]->ncells; va_list ap; int ret = -1; @@ -279,7 +279,7 @@ vshTableSafeEncode(const char *s, size_t *width) * Return 0 in case of success, -1 otherwise. */ static int -vshTableGetColumnsWidths(vshTablePtr table, +vshTableGetColumnsWidths(vshTable *table, size_t *maxwidths, size_t **widths, bool header) @@ -288,7 +288,7 @@ vshTableGetColumnsWidths(vshTablePtr table, i = header? 0 : 1; for (; i < table->nrows; i++) { - vshTableRowPtr row = table->rows[i]; + vshTableRow *row = table->rows[i]; size_t j; for (j = 0; j < row->ncells; j++) { @@ -321,10 +321,10 @@ vshTableGetColumnsWidths(vshTablePtr table, * @buf: buffer to store table (only if @toStdout == true) */ static void -vshTableRowPrint(vshTableRowPtr row, +vshTableRowPrint(vshTableRow *row, size_t *maxwidths, size_t *widths, - virBufferPtr buf) + virBuffer *buf) { size_t i; size_t j; @@ -355,7 +355,7 @@ vshTableRowPrint(vshTableRowPtr row, * Return string containing table, or NULL */ static char * -vshTablePrint(vshTablePtr table, bool header) +vshTablePrint(vshTable *table, bool header) { size_t i; size_t j; @@ -410,7 +410,7 @@ vshTablePrint(vshTablePtr table, bool header) * (apart from quiet mode) this code may need update */ void -vshTablePrintToStdout(vshTablePtr table, vshControl *ctl) +vshTablePrintToStdout(vshTable *table, vshControl *ctl) { bool header; g_autofree char *out = NULL; @@ -432,7 +432,7 @@ vshTablePrintToStdout(vshTablePtr table, vshControl *ctl) * stdout. User will have to free returned string. */ char * -vshTablePrintToString(vshTablePtr table, bool header) +vshTablePrintToString(vshTable *table, bool header) { return vshTablePrint(table, header); } diff --git a/tools/vsh-table.h b/tools/vsh-table.h index ef0042ffcc..a8cfca62d5 100644 --- a/tools/vsh-table.h +++ b/tools/vsh-table.h @@ -24,11 +24,9 @@ typedef struct _vshTable vshTable; typedef struct _vshTableRow vshTableRow; -typedef vshTable *vshTablePtr; -typedef vshTableRow *vshTableRowPtr; -void vshTableFree(vshTablePtr table); -vshTablePtr vshTableNew(const char *format, ...); -int vshTableRowAppend(vshTablePtr table, const char *arg, ...); -void vshTablePrintToStdout(vshTablePtr table, vshControl *ctl); -char *vshTablePrintToString(vshTablePtr table, bool header); +void vshTableFree(vshTable *table); +vshTable *vshTableNew(const char *format, ...); +int vshTableRowAppend(vshTable *table, const char *arg, ...); +void vshTablePrintToStdout(vshTable *table, vshControl *ctl); +char *vshTablePrintToString(vshTable *table, bool header); diff --git a/tools/vsh.c b/tools/vsh.c index d9c0a9b80d..ebaf17f326 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -2406,7 +2406,7 @@ int vshEditFile(vshControl *ctl, const char *filename) { const char *editor; - virCommandPtr cmd; + virCommand *cmd; int ret = -1; int outfd = STDOUT_FILENO; int errfd = STDERR_FILENO; @@ -2479,7 +2479,7 @@ vshTreePrintInternal(vshControl *ctl, int devid, int lastdev, bool root, - virBufferPtr indent) + virBuffer *indent) { size_t i; int nextlastdev = -1;