search for: logical_block_size

Displaying 20 results from an estimated 33 matches for "logical_block_size".

2020 Feb 10
2
Re: [RFC] lib: allow to specify physical/logical block size for disks
...th "4K native" sector > > size support. > > Do you have a small test case for this? > > > In order to fix the issue we need to allow users to specify desired > > physical and/or logical block size per drive basis. > > It seems like physical_block_size / logical_block_size in qemu are > completely undocumented. However I did some experiments with patching > libguestfs and examining the qemu and parted code. Here are my > observations: > > (1) Setting only physical_block_size = 4096 seems to do nothing. The guest sees the physical_block_size and can...
2020 Feb 10
2
Re: [RFC] lib: allow to specify physical/logical block size for disks
...l test case for this? We can easily create one with patched libguestfs and attach disk to unpatched libguestfs. > > In order to fix the issue we need to allow users to specify desired > > physical and/or logical block size per drive basis. > > It seems like physical_block_size / logical_block_size in qemu are > completely undocumented. However I did some experiments with patching > libguestfs and examining the qemu and parted code. Here are my > observations: > > (1) Setting only physical_block_size = 4096 seems to do nothing. See my thoughts on this in previous email. &gt...
2020 Feb 10
0
Re: [RFC] lib: allow to specify physical/logical block size for disks
...> > size support. > > > > Do you have a small test case for this? > > > > > In order to fix the issue we need to allow users to specify desired > > > physical and/or logical block size per drive basis. > > > > It seems like physical_block_size / logical_block_size in qemu are > > completely undocumented. However I did some experiments with patching > > libguestfs and examining the qemu and parted code. Here are my > > observations: > > > > (1) Setting only physical_block_size = 4096 seems to do nothing. > > The guest see...
2020 Feb 07
8
[RFC] lib: allow to specify physical/logical block size for disks
...+ */ +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, "qemuopts"); + return -1; +} + static int add_drive (guestfs_h *g, struct backend_direct_data *data, struct qemuopt...
2020 Feb 10
2
Re: [RFC] lib: allow to specify physical/logical block size for disks
...r: physical_block_size: The physical block size the disk will report to the guest OS. For Linux this would be the value returned by the BLKPBSZGET ioctl and describes the disk's hardware sector size which can be relevant for the alignment of disk data. We don't have an API to get this one. logical_block_size: The logical block size the disk will report to the guest OS. For Linux this would be the value returned by the BLKSSZGET ioctl and describes the smallest units for disk I/O. We have blockdev-getsz API to get this value. How do they use. If your HDD has physical block size = 4096 you might want ma...
2020 Feb 10
0
Re: [RFC] lib: allow to specify physical/logical block size for disks
...easily create one with patched libguestfs and attach disk to > unpatched libguestfs. > > > > In order to fix the issue we need to allow users to specify desired > > > physical and/or logical block size per drive basis. > > > > It seems like physical_block_size / logical_block_size in qemu are > > completely undocumented. However I did some experiments with patching > > libguestfs and examining the qemu and parted code. Here are my > > observations: > > > > (1) Setting only physical_block_size = 4096 seems to do nothing. > > See my thoug...
2020 Feb 11
2
[PATCH v2] lib: add support for disks with 4096 bytes sector size
...ze will be set to the same value. In this patch one more optional parameter 'blocksize' is added to add_drive_opts API method. Valid values are 512 and 4096. add_drive_scratch has the same optional parameter for a consistency and testing purpose. add-domain and add_libvirt_dom will pass logical_block_size value from libvirt XML to add_drive_opts method. --- generator/actions_core.ml | 26 +++++- lib/drives.c | 38 ++++++++- lib/guestfs-internal.h | 1 + lib/launch-direct.c | 25 ++++++ lib/launch-...
2017 Jul 26
2
[PATCH] virtio_blk: fix incorrect message when disk is resized
The message printed on disk resize is incorrect. The following is printed when resizing to 2 GiB: $ truncate -s 1G test.img $ qemu -device virtio-blk-pci,logical_block_size=4096,... (qemu) block_resize drive1 2G virtio_blk virtio0: new size: 4194304 4096-byte logical blocks (17.2 GB/16.0 GiB) The virtio_blk capacity config field is in 512-byte sector units regardless of logical_block_size as per the VIRTIO specification. Therefore the message should read: vir...
2017 Jul 26
2
[PATCH] virtio_blk: fix incorrect message when disk is resized
The message printed on disk resize is incorrect. The following is printed when resizing to 2 GiB: $ truncate -s 1G test.img $ qemu -device virtio-blk-pci,logical_block_size=4096,... (qemu) block_resize drive1 2G virtio_blk virtio0: new size: 4194304 4096-byte logical blocks (17.2 GB/16.0 GiB) The virtio_blk capacity config field is in 512-byte sector units regardless of logical_block_size as per the VIRTIO specification. Therefore the message should read: vir...
2020 Feb 10
1
[PATCH] lib: allow to specify physical/logical block size for disks
...ehaviour. This might be used in command line tools like guestfish, virt-df and so on to reset blocksize value to a beckend-default value (similar to --format option). add_drive_scratch has the same optional parameter for a consistency and testing purpose. add-domain and add_libvirt_dom will pass logical_block_size value from libvirt XML to add_drive_opts method. --- generator/actions_core.ml | 38 ++++++++- lib/drives.c | 38 ++++++++- lib/guestfs-internal.h | 1 + lib/launch-direct.c | 25 ++++++ lib/laun...
2020 Feb 10
0
Re: [RFC] lib: allow to specify physical/logical block size for disks
...age which was partitioned on a system with "4K native" sector > size support. Do you have a small test case for this? > In order to fix the issue we need to allow users to specify desired > physical and/or logical block size per drive basis. It seems like physical_block_size / logical_block_size in qemu are completely undocumented. However I did some experiments with patching libguestfs and examining the qemu and parted code. Here are my observations: (1) Setting only physical_block_size = 4096 seems to do nothing. (2) Setting only logical_block_size = 4096 is explicitly rejected by vi...
2020 Feb 10
0
Re: [RFC] lib: allow to specify physical/logical block size for disks
...ysical block size the disk will report to > the guest OS. For Linux this would be the value returned by the > BLKPBSZGET ioctl and describes the disk's hardware sector size which > can be relevant for the alignment of disk data. We don't have an API > to get this one. > > logical_block_size: The logical block size the disk will report to the > guest OS. For Linux this would be the value returned by the BLKSSZGET > ioctl and describes the smallest units for disk I/O. We have > blockdev-getsz API to get this value. Interestingly parted uses BLKSSZGET (logical_block_size), but...
2019 Oct 29
2
[PATCH] fish: add option --blocksize for disks
When --blocksize <val> is provided, qemu command line would add physical_block_size=<val>,physical_logical_size=<val> to -device directive. Example: qemu-kvm \ -drive file=raw.img,cache=writeback,id=hd0,if=none \ -device scsi-hd,drive=hd0,physical_block_size=4096,logical_block_size=4096 \ Signed-off-by: Tuan Hoang <tmhoang@linux.ibm.com> --- fish/fish.c | 5 +++++ generator/c.ml | 2 ++ lib/launch-direct.c | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/fish/fish.c b/fish/fish.c index 2070e37..dd58d23 100644 --- a/fish/fish.c +++ b/fish/fish.c @...
2016 Mar 17
1
Questions regarding hostdev scsi
...lt;/block> <bus>ata</bus> <drive_type>disk</drive_type> <model>Samsung SSD 850</model> <vendor>ATA</vendor> <serial>Samsung_SSD_850_PRO_256GB_S251NXAGB42213R</serial> <size>256060514304</size> <logical_block_size>512</logical_block_size> <num_blocks>500118192</num_blocks> </capability> </device> <device> <name>scsi_generic_sg1</name> <path>/sys/devices/pci0000:00/0000:00:1f.2/ata5/host4/target4:0:0/4:0:0:0/scsi_generic/sg1</path> &l...
2019 Nov 05
2
[PATCH v3 RESEND] direct, fish: add blocksize as optional argument for launch command
...argument, called `blocksize`. Example: $ guestfish --listen -a raw.img $ guestfish --remote -- launch blocksize:4096 The actual qemu command is: [...] -device virtio-scsi-ccw,id=scsi -drive file=raw.img,cache=writeback,id=hd0,if=none -device scsi-hd,drive=hd0,physical_block_size=4096,logical_block_size=4096 [...] Signed-off-by: Tuan Hoang <tmhoang@linux.ibm.com> --- generator/actions_core.ml | 18 ++++++++++++++++-- lib/guestfs-internal.h | 3 +++ lib/launch-direct.c | 6 ++++++ lib/launch.c | 12 +++++++++++- 4 files changed, 36 insertions(+), 3 deletions(-) diff...
2017 Aug 04
0
[PATCH] virtio_blk: fix incorrect message when disk is resized
On Wed, Jul 26, 2017 at 03:32:23PM +0100, Stefan Hajnoczi wrote: > The message printed on disk resize is incorrect. The following is > printed when resizing to 2 GiB: > > $ truncate -s 1G test.img > $ qemu -device virtio-blk-pci,logical_block_size=4096,... > (qemu) block_resize drive1 2G > > virtio_blk virtio0: new size: 4194304 4096-byte logical blocks (17.2 GB/16.0 GiB) > > The virtio_blk capacity config field is in 512-byte sector units > regardless of logical_block_size as per the VIRTIO specification. > Theref...
2014 Sep 11
0
trying but failing - pass-through scsi/sata
...t;/dev/sdb</block> <bus>ata</bus> <drive_type>disk</drive_type> <model>OCZ-VERTEX4</model> <vendor>ATA</vendor> <serial>OCZ-VERTEX4_OCZ-352C77TZVQF1Y3SX</serial> <size>128035676160</size> <logical_block_size>512</logical_block_size> <num_blocks>250069680</num_blocks> </capability> </device> how do I pass-through sata drives? any help much appreciated, thanks!
2019 Nov 05
1
[PATCH v2 RESEND] direct, fish: add command launch_blocksize
...ied alias is `run-blocksize`. Example: $ guestfish --listen -a raw.img $ guestfish --remote -- launch_blocksize 4096 The actual qemu command is: [...] -device virtio-scsi-ccw,id=scsi -drive file=raw.img,cache=writeback,id=hd0,if=none -device scsi-hd,drive=hd0,physical_block_size=4096,logical_block_size=4096 [...] Ideally it would be better to invoke optional option to `launch` command like: $ guestfish --remote -- launch --blocksize 4096 Signed-off-by: Tuan Hoang <tmhoang@linux.ibm.com> --- generator/actions_core.ml | 11 +++++++++++ lib/guestfs-internal.h | 3 +++ lib/launch-direct...
2020 Feb 10
0
Re: [RFC] lib: allow to specify physical/logical block size for disks
...lockio_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, "qemuopts"); > + return -1; > +} > + > static int > add_drive (guestfs_h *g, struc...
2020 Jul 21
0
[PATCH 01/10] block: introduce blk_is_valid_logical_block_size
.../block/blk-settings.c > > +++ b/block/blk-settings.c > > @@ -311,6 +311,21 @@ void blk_queue_max_segment_size(struct request_queue *q, unsigned int max_size) > > } > > EXPORT_SYMBOL(blk_queue_max_segment_size); > > > > + > > +/** > > + * blk_check_logical_block_size - check if logical block size is supported > > + * by the kernel > > + * @size: the logical block size, in bytes > > + * > > + * Description: > > + * This function checks if the block layers supports given block size > > + **/ > > +bool blk_is_valid_logi...