qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Merge NBD client/server int qemu-nbd


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] Merge NBD client/server int qemu-nbd
Date: Fri, 13 Jun 2008 12:49:45 -0500
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

Laurent Vivier wrote:
Hi,

this patch allows to connect directly a disk image file to an NBD
device. It introduces the use of a unix socket (instead of inet).

- To connect a file to a device:

# qemu-nbd --connect=/dev/nbd0 my_disk.qcow2

Then you can see directly your disk (no need of nbd-client):

# fdisk -l /dev/nbd0

Disk /dev/nbd0: 4294 MB, 4294967296 bytes
255 heads, 63 sectors/track, 522 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot      Start         End      Blocks   Id  System
/dev/nbd0p1   *           1         492     3951958+  83  Linux
/dev/nbd0p2             493         522      240975    5  Extended
/dev/nbd0p5             493         522      240943+  82  Linux swap /
Solaris

- To disconnect the file from the device:

# qemu-nbd --disconnect /dev/nbd0

Regards,
Laurent
+static void show_parts(const char *device)
+{
+    if (fork() == 0) {
+        int nbd;
+
+       /* wait device */
+        sleep(1);

This looks like a big red-herring. What is this sleep waiting for any can it be possibly made into something less racy?

Regards,

Anthony Liguori




reply via email to

[Prev in Thread] Current Thread [Next in Thread]