Am 10.06.2020 um 08:28 hat Sam Eiderman geschrieben: > Hi, > > My target format is a Persistent Disk on GCP. > https://cloud.google.com/persistent-disk > > And my use case is converting VMDKs to PDs so I'm just using qemu-img > for the conversion (not using qemu as a hypervisor). > > Luckily PDs are zeroed out when allocated but I was asking to > understand the restrictions of qemu-img convert. > > It could be useful for qemu-img convert to not zero out the disk, but > do write allocated zeroes, I'm imagining cloud scenarios where instead > of virtual disks the customer receives an attached physical SSD device > that is not zeroed out beforehand (only encryption key changed, for > privacy/security sake) so reads will return garbage.
But that's the default mode? Zeroing out the whole disk upfront is an optimisation that we do if efficient zeroing is possible, but if we can't, we just write explicit zeros where needed. --target-is-zero means that you promise that the target is already pre-zeroed so qemu-img can further optimise things. If you specify it and the target doesn't contain zeros, but random data, you get garbage. Kevin