[libvirt] [PATCH] tests: redo test argv file line wrapping

Daniel P. Berrange berrange at redhat.com
Fri Nov 6 16:16:59 UTC 2015


On Fri, Nov 06, 2015 at 03:20:31PM +0000, Daniel P. Berrange wrote:
> On Fri, Nov 06, 2015 at 04:00:04PM +0100, Martin Kletzander wrote:
> > On Fri, Nov 06, 2015 at 01:30:35PM +0000, Daniel P. Berrange wrote:
> > >Back in
> > >
> > > commit bd6c46fa0cfe275c24debc1152cfc5206c04b59b
> > > Author: Juerg Haefliger <juerg.haefliger at hp.com>
> > > Date:   Mon Jan 31 06:42:57 2011 -0500
> > >
> > >   tests: handle backspace-newline pairs in test input files
> > >
> > >all the test argv files were line wrapped so that the args
> > >were less than 80 characters.
> > >
> > >The way the line wrapping was done turns out to be quite
> > >undesirable, because it often leaves multiple parameters
> > >on the same line. If we later need to add or remove
> > >individual parameters, then it leaves us having to redo
> > >line wrapping.
> > >
> > >This commit changes the line wrapping so that every
> > >single "-param value" is one its own new line. If the
> > >"value" is still too long, then we break on ',' or ':'
> > >or ' ' as needed.
> > >
> > 
> > What if we fix the syntax-check instead and allow longer than 80
> > character lines in case they have no space in it, or exactly one space
> > (to allow --parameter option,option,option,...)?  That would make even
> > corner cases easier to review, e.g. when you remove or add a parameter
> > into the long list of parameters.
> 
> The alternative that I'm actually thinking is that we make
> syntax-check skip line length on all these .args files.
> 
> Instead re-run the 'test-wrap-argv.pl' script during
> syntax-check, and validate that no changeas are made.
> 
> This will guarantee that all our .args files are always
> using our ideal formatting / line wrapping rules.
> 
> Then I could remove these two special cases and just let
> us have "-arg value" lines exceed 80 characters when
> they need to

So if we *never* line wrap within a '-arg value' parameter
then we would have a fair number of lines longer than 80
characters.

    80 qemuxml2argv-arm-virt-virtio.args
    80 qemuxml2argv-cpu-strict1.args
    80 qemuxml2argv-disk-drive-cache-v2-none.args
    80 qemuxml2argv-disk-drive-network-sheepdog.args
    80 qemuxml2argv-disk-snapshot.args
    81 qemuxml2argv-arm-vexpressa9-virtio.args
    81 qemuxml2argv-boot-menu-disable-drive-bootindex.args
    81 qemuxml2argv-disk-drive-no-boot.args
    81 qemuxml2argv-disk-virtio-ccw.args
    81 qemuxml2argv-disk-virtio-ccw-many.args
    82 qemuxml2argv-bios-nvram.args
    82 qemuxml2argv-disk-drive-cache-unsafe.args
    83 qemuxml2argv-disk-drive-copy-on-read.args
    83 qemuxml2argv-serial-spiceport.args
    84 qemuxml2argv-video-device-pciaddr-default.args
    84 qemuxml2argv-video-qxl-device.args
    84 qemuxml2argv-video-qxl-sec-device.args
    84 qemuxml2argv-video-vga-device.args
    84 qemuxml2argv-video-vga-device-vgamem.args
    85 qemuxml2argv-disk-drive-cache-v2-wb.args
    85 qemuxml2argv-disk-drive-network-iscsi.args
    85 qemuxml2argv-numatune-memnode-no-memory.args
    86 qemuxml2argv-arm-vexpressa9-basic.args
    86 qemuxml2argv-cpu-host-model.args
    86 qemuxml2argv-cpu-minimum1.args
    86 qemuxml2argv-disk-drive-cache-directsync.args
    86 qemuxml2argv-net-virtio-device.args
    87 qemuxml2argv-disk-drive-network-gluster.args
    87 qemuxml2argv-virtio-rng-random.args
    88 qemuxml2argv-disk-cdrom-network-ftp.args
    88 qemuxml2argv-disk-drive-cache-v2-wt.args
    88 qemuxml2argv-usb-ich9-companion.args
    88 qemuxml2argv-usb-redir.args
    88 qemuxml2argv-usb-redir-boot.args
    89 qemuxml2argv-disk-cdrom-network-http.args
    89 qemuxml2argv-disk-cdrom-network-tftp.args
    89 qemuxml2argv-disk-ide-wwn.args
    89 qemuxml2argv-net-vhostuser.args
    89 qemuxml2argv-net-virtio-netdev.args
    89 qemuxml2argv-pci-bridge-many-disks.args
    89 qemuxml2argv-pci-many.args
    89 qemuxml2argv-serial-udp-chardev.args
    89 qemuxml2argv-usb1-usb2.args
    89 qemuxml2argv-usb-ich9-ehci-addr.args
    90 qemuxml2argv-disk-cdrom-network-ftps.args
    91 qemuxml2argv-cpu-host-model-fallback.args
    91 qemuxml2argv-disk-aio.args
    91 qemuxml2argv-disk-cdrom-network-https.args
    91 qemuxml2argv-disk-serial.args
    91 qemuxml2argv-fs9p-ccw.args
    92 qemuxml2argv-virtio-lun.args
    93 qemuxml2argv-boot-complex.args
    93 qemuxml2argv-console-virtio-ccw.args
    93 qemuxml2argv-disk-drive-error-policy-enospace.args
    93 qemuxml2argv-disk-order.args
    93 qemuxml2argv-hostdev-scsi-readonly.args
    93 qemuxml2argv-hostdev-scsi-virtio-scsi.args
    93 qemuxml2argv-virtio-rng-ccw.args
    94 qemuxml2argv-disk-geometry.args
    94 qemuxml2argv-disk-scsi-disk-split.args
    94 qemuxml2argv-fs9p.args
    95 qemuxml2argv-tpm-passthrough.args
    96 qemuxml2argv-aarch64-virtio-pci.args
    96 qemuxml2argv-channel-spicevmc-old.args
    96 qemuxml2argv-disk-scsi-megasas.args
    96 qemuxml2argv-disk-scsi-virtio-scsi.args
    96 qemuxml2argv-disk-scsi-vscsi.args
    96 qemuxml2argv-disk-source-pool-mode.args
    96 qemuxml2argv-disk-virtio-scsi-ccw.args
    96 qemuxml2argv-disk-virtio-scsi-cmd_per_lun.args
    96 qemuxml2argv-disk-virtio-scsi-ioeventfd.args
    96 qemuxml2argv-disk-virtio-scsi-max_sectors.args
    96 qemuxml2argv-disk-virtio-scsi-num_queues.args
    96 qemuxml2argv-pseries-vio.args
    96 qemuxml2argv-pseries-vio-user-assigned.args
    96 qemuxml2argv-video-qxl-device-vgamem.args
    96 qemuxml2argv-video-qxl-sec-device-vgamem.args
    97 qemuxml2argv-disk-scsi-lun-passthrough.args
    97 qemuxml2argv-encrypted-disk.args
    98 qemuxml2argv-disk-cdrom-tray.args
    98 qemuxml2argv-disk-copy_on_read.args
    98 qemuxml2argv-graphics-spice-timeout.args
   100 qemuxml2argv-iothreads-disk-virtio-ccw.args
   101 qemuxml2argv-hostdev-scsi-lsi-iscsi.args
   101 qemuxml2argv-hostdev-scsi-virtio-iscsi.args
   102 qemuxml2argv-disk-drive-network-iscsi-lun.args
   103 qemuxml2argv-cpu-minimum2.args
   103 qemuxml2argv-disk-drive-error-policy-stop.args
   103 qemuxml2argv-iothreads-disk.args
   104 qemuxml2argv-graphics-spice-sasl.args
   104 qemuxml2argv-net-vhostuser-multiq.args
   105 qemuxml2argv-boot-complex-bootindex.args
   105 qemuxml2argv-boot-order.args
   105 qemuxml2argv-boot-strict.args
   105 qemuxml2argv-hostdev-scsi-boot.args
   106 qemuxml2argv-blkdeviotune.args
   106 qemuxml2argv-disk-ioeventfd.args
   106 qemuxml2argv-event_idx.args
   107 qemuxml2argv-channel-spicevmc.args
   107 qemuxml2argv-channel-virtio-default.args
   107 qemuxml2argv-controller-order.args
   107 qemuxml2argv-disk-drive-error-policy-wreport-rignore.args
   107 qemuxml2argv-shmem.args
   108 qemuxml2argv-cpu-host-model-vendor.args
   108 qemuxml2argv-disk-drive-shared.args
   109 qemuxml2argv-hugepages-pages2.args
   109 qemuxml2argv-hugepages-pages3.args
   110 qemuxml2argv-pci-rom.args
   111 qemuxml2argv-channel-virtio.args
   111 qemuxml2argv-channel-virtio-unix.args
   111 qemuxml2argv-migrate-numa-unaligned.args
   111 qemuxml2argv-numatune-memnode.args
   112 qemuxml2argv-channel-virtio-autoadd.args
   112 qemuxml2argv-channel-virtio-auto.args
   112 qemuxml2argv-channel-virtio-autoassign.args
   112 qemuxml2argv-channel-virtio-state.args
   112 qemuxml2argv-graphics-spice-agentmouse.args
   113 qemuxml2argv-disk-blockio.args
   113 qemuxml2argv-disk-drive-discard.args
   116 qemuxml2argv-usb-redir-filter.args
   117 qemuxml2argv-disk-scsi-disk-wwn.args
   121 qemuxml2argv-graphics-spice-qxl-vga.args
   129 qemuxml2argv-disk-drive-network-iscsi-auth.args
   129 qemuxml2argv-disk-scsi-disk-vpd.args
   129 qemuxml2argv-smartcard-host-certificates.args
   131 qemuxml2argv-disk-iscsi.args
   135 qemuxml2argv-memory-hotplug-dimm-addr.args
   135 qemuxml2argv-memory-hotplug-dimm.args
   136 qemuxml2argv-hugepages-numa.args
   137 qemuxml2argv-hugepages-pages.args
   144 qemuxml2argv-usb-redir-filter-version.args
   145 qemuxml2argv-graphics-spice-agent-file-xfer.args
   147 qemuxml2argv-hostdev-scsi-lsi-iscsi-auth.args
   147 qemuxml2argv-hostdev-scsi-virtio-iscsi-auth.args
   147 qemuxml2argv-hugepages-shared.args
   155 qemuxml2argv-disk-drive-network-rbd.args
   186 qemuxml2argv-disk-drive-network-rbd-ipv6.args
   196 qemuxml2argv-smbios.args
   203 qemuxml2argv-blkdeviotune-max.args
   209 qemuxml2argv-graphics-spice-compression.args
   225 qemuxml2argv-disk-drive-network-rbd-auth.args
   238 qemuxml2argv-net-virtio-disable-offloads.args
   291 qemuxml2argv-graphics-spice-usb-redir.args
   314 qemuxml2argv-graphics-spice.args

I didn't realize it was quite so huge with these. With spice
reaching 314 characters for a single parameter value, I feel
we really have to artificially split the value strings.
314 is just too long for a single line.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list