search for: append_list_format

Displaying 20 results from an estimated 23 matches for "append_list_format".

2017 Sep 12
1
Re: [PATCH v2 5/5] launch: direct: Disable qemu locking when opening drives readonly (RHBZ#1417306).
On Tuesday, 12 September 2017 14:29:16 CEST Richard W.M. Jones wrote: > @@ -255,11 +256,13 @@ add_drive_standard_params (guestfs_h *g, struct backend_direct_data *data, > } > else { > /* Writable qcow2 overlay on top of read-only drive. */ > - append_list_format ("file=%s", drv->overlay); > + append_list_format ("file.file.filename=%s", drv->overlay); > + append_list ("file.driver=qcow2"); > append_list ("cache=unsafe"); > - append_list ("format=qcow2"); > if (drv-&gt...
2018 Jan 17
1
[PATCH] launch: direct: Use old-style file= and format= parameters when not disabling locking (RHBZ#1503497).
...unch-direct.c b/lib/launch-direct.c index aa4139359..47e8f37de 100644 --- a/lib/launch-direct.c +++ b/lib/launch-direct.c @@ -255,17 +255,28 @@ add_drive_standard_params (guestfs_h *g, struct backend_direct_data *data, } else { /* Writable qcow2 overlay on top of read-only drive. */ - append_list_format ("file.file.filename=%s", drv->overlay); - append_list ("file.driver=qcow2"); - append_list ("cache=unsafe"); - if (drv->disk_label) - append_list_format ("serial=%s", drv->disk_label); - - /* Add the file-specific locking option onl...
2019 Oct 29
2
[PATCH] fish: add option --blocksize for disks
...uot; +int blocksize = 0; + /* Per-handle data. */ struct backend_direct_data { pid_t pid; /* Qemu PID. */ @@ -315,6 +317,8 @@ add_drive (guestfs_h *g, struct backend_direct_data *data, start_list ("-device") { append_list ("scsi-hd"); append_list_format ("drive=hd%zu", i); + append_list_format ("physical_block_size=%d", blocksize); + append_list_format ("logical_block_size=%d", blocksize); if (drv->disk_label) append_list_format ("serial=%s", drv->disk_label); } end_list...
2017 Sep 05
4
[PATCH] lib: direct: Disable qemu locking when opening drives
Incomplete fix for https://bugzilla.redhat.com/show_bug.cgi?id=1417306 The full fix is waiting for a libvirt change, but this can still go upstream. Rich.
2017 Sep 12
0
[PATCH v2 5/5] launch: direct: Disable qemu locking when opening drives readonly (RHBZ#1417306).
...qemu_data *qemu_data; /* qemu -help output etc. */ char guestfsd_sock[UNIX_PATH_MAX]; /* Path to daemon socket. */ @@ -255,11 +256,13 @@ add_drive_standard_params (guestfs_h *g, struct backend_direct_data *data, } else { /* Writable qcow2 overlay on top of read-only drive. */ - append_list_format ("file=%s", drv->overlay); + append_list_format ("file.file.filename=%s", drv->overlay); + append_list ("file.driver=qcow2"); append_list ("cache=unsafe"); - append_list ("format=qcow2"); if (drv->disk_label) appen...
2017 Sep 05
1
Re: [PATCH] lib: direct: Disable qemu locking when opening drives readonly.
...ch-direct.c > index 3b848165c..e5465539d 100644 > --- a/lib/launch-direct.c > +++ b/lib/launch-direct.c > @@ -221,8 +221,11 @@ add_drive_standard_params (guestfs_h *g, struct backend_direct_data *data, > file = guestfs_int_drive_source_qemu_param (g, &drv->src); > append_list_format ("file=%s", file); > > - if (drv->readonly) > + if (drv->readonly) { > append_list ("snapshot=on"); > + if (guestfs_int_version_ge (&data->qemu_version, 2, 10, 0)) > + append_list ("locking=off"); > + } &g...
2019 Nov 05
1
[PATCH v2 RESEND] direct, fish: add command launch_blocksize
...-git a/lib/launch-direct.c b/lib/launch-direct.c index ee2dcb8..54cd8c6 100644 --- a/lib/launch-direct.c +++ b/lib/launch-direct.c @@ -315,6 +315,12 @@ add_drive (guestfs_h *g, struct backend_direct_data *data, start_list ("-device") { append_list ("scsi-hd"); append_list_format ("drive=hd%zu", i); + if (g->blocksize >= 512 && g->blocksize <= 32768 + && (g->blocksize & (g->blocksize-1)) == 0) + { + append_list_format ("physical_block_size=%d", g->blocksize); + append_list_format (...
2020 Feb 10
0
Re: [RFC] lib: allow to specify physical/logical block size for disks
...n -1; > } > > +/** > + * Add the blockio elements of the C<-device> parameter. > + */ > +static int > +add_device_blockio_params (guestfs_h *g, struct qemuopts *qopts, > + struct drive *drv) > +{ > + if (drv->pblocksize) > + append_list_format ("physical_block_size=%d", drv->pblocksize); > + if (drv->lblocksize) > + append_list_format ("logical_block_size=%d", drv->lblocksize); > + > + return 0; > + > + /* This label is called implicitly from the qemuopts macros on error. */ > + qem...
2019 Nov 05
2
[PATCH v3 RESEND] direct, fish: add blocksize as optional argument for launch command
...-git a/lib/launch-direct.c b/lib/launch-direct.c index ee2dcb8..54cd8c6 100644 --- a/lib/launch-direct.c +++ b/lib/launch-direct.c @@ -315,6 +315,12 @@ add_drive (guestfs_h *g, struct backend_direct_data *data, start_list ("-device") { append_list ("scsi-hd"); append_list_format ("drive=hd%zu", i); + if (g->blocksize >= 512 && g->blocksize <= 32768 + && (g->blocksize & (g->blocksize-1)) == 0) + { + append_list_format ("physical_block_size=%d", g->blocksize); + append_list_format (...
2020 Feb 07
8
[RFC] lib: allow to specify physical/logical block size for disks
...uestfs_h *g, struct backend_direct_data *data, return -1; } +/** + * Add the blockio elements of the C<-device> parameter. + */ +static int +add_device_blockio_params (guestfs_h *g, struct qemuopts *qopts, + struct drive *drv) +{ + if (drv->pblocksize) + append_list_format ("physical_block_size=%d", drv->pblocksize); + if (drv->lblocksize) + append_list_format ("logical_block_size=%d", drv->lblocksize); + + return 0; + + /* This label is called implicitly from the qemuopts macros on error. */ + qemuopts_error: + perrorf (g, "q...
2017 Sep 05
0
[PATCH] lib: direct: Disable qemu locking when opening drives readonly.
...lib/launch-direct.c b/lib/launch-direct.c index 3b848165c..e5465539d 100644 --- a/lib/launch-direct.c +++ b/lib/launch-direct.c @@ -221,8 +221,11 @@ add_drive_standard_params (guestfs_h *g, struct backend_direct_data *data, file = guestfs_int_drive_source_qemu_param (g, &drv->src); append_list_format ("file=%s", file); - if (drv->readonly) + if (drv->readonly) { append_list ("snapshot=on"); + if (guestfs_int_version_ge (&data->qemu_version, 2, 10, 0)) + append_list ("locking=off"); + } append_list_format ("cache=...
2017 Sep 12
0
Re: [PATCH] lib: direct: Disable qemu locking when opening drives readonly.
...848165c..e5465539d 100644 > > --- a/lib/launch-direct.c > > +++ b/lib/launch-direct.c > > @@ -221,8 +221,11 @@ add_drive_standard_params (guestfs_h *g, struct backend_direct_data *data, > > file = guestfs_int_drive_source_qemu_param (g, &drv->src); > > append_list_format ("file=%s", file); > > > > - if (drv->readonly) > > + if (drv->readonly) { > > append_list ("snapshot=on"); > > + if (guestfs_int_version_ge (&data->qemu_version, 2, 10, 0)) > > + append_list ("lock...
2017 Apr 27
4
[PATCH 0/4] common: Add a simple mini-library for handling qemu command and config files.
Currently we have an OCaml library for generating the qemu command line (used only by ‘virt-v2v -o qemu’). However we also generate a qemu command line in ‘lib/launch-direct.c’, and we might in future need to generate a ‘-readconfig’-compatible configuration file if we want to go beyond 10,000 drives for scalability testing. Therefore this patch series reimplements the qemu command line code as
2020 Feb 11
2
[PATCH v2] lib: add support for disks with 4096 bytes sector size
...ata, return -1; } +/** + * Add the physical_block_size and logical_block_size elements of the C<-device> + * parameter. + */ +static int +add_device_blocksize_params (guestfs_h *g, struct qemuopts *qopts, + struct drive *drv) +{ + if (drv->blocksize) { + append_list_format ("physical_block_size=%d", drv->blocksize); + append_list_format ("logical_block_size=%d", drv->blocksize); + } + + return 0; + + /* This label is called implicitly from the qemuopts macros on error. */ + qemuopts_error: + perrorf (g, "qemuopts"); + retur...
2020 Feb 10
1
[PATCH] lib: allow to specify physical/logical block size for disks
...ata, return -1; } +/** + * Add the physical_block_size and logical_block_size elements of the C<-device> + * parameter. + */ +static int +add_device_blocksize_params (guestfs_h *g, struct qemuopts *qopts, + struct drive *drv) +{ + if (drv->blocksize) { + append_list_format ("physical_block_size=%d", drv->blocksize); + append_list_format ("logical_block_size=%d", drv->blocksize); + } + + return 0; + + /* This label is called implicitly from the qemuopts macros on error. */ + qemuopts_error: + perrorf (g, "qemuopts"); + retur...
2017 Sep 12
9
[PATCH v2 0/5] launch: direct: Disable qemu locking when opening drives readonly (RHBZ#1417306)
Patches 1-4 are almost the same as they are when previously posted here: https://www.redhat.com/archives/libguestfs/2017-September/msg00039.html Patch 5 actually uses the mandatory locking test to turn off locking in the narrow case where a drive is opened readonly, and then only for the drive being inspected. Passes ordinary tests (‘check-direct’ and ‘check-valgrind-direct’). Rich.
2017 Nov 23
0
[PATCH] launch: direct: Omit locking option for non-file disks (RHBZ#1516094)
...direct.c b/lib/launch-direct.c index 87ac121c7558..678c8c68d59d 100644 --- a/lib/launch-direct.c +++ b/lib/launch-direct.c @@ -260,7 +260,11 @@ add_drive_standard_params (guestfs_h *g, struct backend_direct_data *data, append_list ("cache=unsafe"); if (drv->disk_label) append_list_format ("serial=%s", drv->disk_label); - if (data->qemu_mandatory_locking) + + /* Add the file-specific locking option only for files, as qemu + * won't accept options unknown to the block driver in use. + */ + if (data->qemu_mandatory_locking && drv->src...
2018 Sep 03
0
[PATCH] ppc64le: Use -machine cap-htm=off unconditionally (RHBZ#1614948).
...b/lib/launch-direct.c @@ -523,6 +523,9 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) #ifdef __aarch64__ if (has_kvm && !force_tcg) append_list ("gic-version=host"); +#endif +#ifdef __powerpc64__ + append_list ("cap-htm=off"); #endif append_list_format ("accel=%s", !force_tcg ? "kvm:tcg" : "tcg"); } end_list (); diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c index 48404ef93..53284fc08 100644 --- a/lib/launch-libvirt.c +++ b/lib/launch-libvirt.c @@ -1181,6 +1181,16 @@ construct_libvirt_xml_boot (guestfs_h...
2018 Sep 03
1
[PATCH v2] ppc64le: Use -machine cap-htm=off unconditionally
v1 was here: https://www.redhat.com/archives/libguestfs/2018-September/thread.html#00000 v2: - Make conditional on qemu >= 2.11.2 and libvirt >= 4.6.0. - Fix the libvirt XML to match what went upstream. Still untested. Rich.
2018 Sep 03
0
[PATCH v3] ppc64le: Use -machine cap-htm=off unconditionally (RHBZ#1614948).
...id *datav, const char *arg) #ifdef __aarch64__ if (has_kvm && !force_tcg) append_list ("gic-version=host"); +#endif +#ifdef __powerpc64__ + if (guestfs_int_version_ge (&data->qemu_version, 2, 11, 2)) + append_list ("cap-htm=off"); #endif append_list_format ("accel=%s", !force_tcg ? "kvm:tcg" : "tcg"); } end_list (); diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c index 48404ef93..1a074fd6c 100644 --- a/lib/launch-libvirt.c +++ b/lib/launch-libvirt.c @@ -1181,6 +1181,16 @@ construct_libvirt_xml_boot (guestfs_h...